@metrostar/comet-uswds
Advanced tools
Comparing version 2.2.0-alpha-1 to 2.2.0-alpha-3
@@ -1,2 +0,14 @@ | ||
import{jsx as e,Fragment as a,jsxs as s}from"react/jsx-runtime";import{useState as n,useRef as r,useEffect as i}from"react";import t from"@uswds/uswds/js/usa-accordion";import c from"@uswds/uswds/js/usa-banner";import o from"@uswds/uswds/img/us_flag_small.png";import l from"@uswds/uswds/img/icon-https.svg";import d from"@uswds/uswds/img/icon-dot-gov.svg";function u(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g,b={exports:{}}; | ||
'use client'; | ||
import { jsx as e, Fragment as a, jsxs as s } from 'react/jsx-runtime'; | ||
import { useState as n, useRef as r, useEffect as i } from 'react'; | ||
import t from '@uswds/uswds/js/usa-accordion'; | ||
import c from '@uswds/uswds/js/usa-banner'; | ||
import o from '@uswds/uswds/img/us_flag_small.png'; | ||
import l from '@uswds/uswds/img/icon-https.svg'; | ||
import d from '@uswds/uswds/img/icon-dot-gov.svg'; | ||
function u(e) { | ||
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, 'default') ? e.default : e; | ||
} | ||
var g, | ||
b = { exports: {} }; | ||
/*! | ||
@@ -6,3 +18,355 @@ Copyright (c) 2018 Jed Watson. | ||
http://jedwatson.github.io/classnames | ||
*/g=b,function(){var e={}.hasOwnProperty;function a(){for(var e="",a=0;a<arguments.length;a++){var r=arguments[a];r&&(e=n(e,s(r)))}return e}function s(s){if("string"==typeof s||"number"==typeof s)return s;if("object"!=typeof s)return"";if(Array.isArray(s))return a.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var r="";for(var i in s)e.call(s,i)&&s[i]&&(r=n(r,i));return r}function n(e,a){return a?e?e+" "+a:e+a:e}g.exports?(a.default=a,g.exports=a):window.classNames=a}();var m=u(b.exports);const h=({id:n,type:r,show:i=!0,slim:t,noIcon:c,heading:o,body:l,children:d})=>{const u=m("usa-alert",{"usa-alert--success":"success"===r,"usa-alert--warning":"warning"===r,"usa-alert--error":"error"===r,"usa-alert--info":"info"===r,"usa-alert--slim":t,"usa-alert--no-icon":c});return i?e("div",Object.assign({id:n,className:u},{children:s("div",Object.assign({className:"usa-alert__body"},{children:[o&&e("h4",Object.assign({className:"usa-alert__heading"},{children:o})),null!=l?l:e("p",Object.assign({className:"usa-alert__text"},{children:d}))]}))})):e(a,{})},f={gov:"government",mil:"U.S. Department of Defense"},_=({id:a,type:u="gov"})=>{const[g]=n(!1),b=r(null);return i((()=>{const e=b.current;return c.on(e),t.on(e),()=>{c.off(e),t.off(e)}})),e("section",Object.assign({id:a,className:"usa-banner","aria-label":"Official government website",ref:b},{children:s("div",Object.assign({className:"usa-accordion"},{children:[e("header",Object.assign({className:"usa-banner__header"},{children:s("div",Object.assign({className:"usa-banner__inner"},{children:[e("div",Object.assign({className:"grid-col-auto"},{children:e("img",{className:"usa-banner__header-flag",src:o,alt:"U.S. flag"})})),s("div",Object.assign({className:"grid-col-fill tablet:grid-col-auto"},{children:[e("p",Object.assign({className:"usa-banner__header-text"},{children:"An official website of the United States government"})),e("p",Object.assign({className:"usa-banner__header-action","aria-hidden":"true"},{children:"Here’s how you know"}))]})),e("button",Object.assign({className:"usa-accordion__button usa-banner__button","aria-expanded":"false","aria-controls":"gov-banner-default"},{children:e("span",Object.assign({className:"usa-banner__button-text"},{children:"Here’s how you know"}))}))]}))})),e("div",Object.assign({className:"usa-banner__content usa-accordion__content",id:"gov-banner-default",hidden:!g},{children:s("div",Object.assign({className:"grid-row grid-gap-lg"},{children:[s("div",Object.assign({className:"usa-banner__guidance tablet:grid-col-6"},{children:[e("img",{className:"usa-banner__icon usa-media-block__img",src:d,role:"img",alt:"","aria-hidden":"true"}),e("div",Object.assign({className:"usa-media-block__body"},{children:s("p",{children:[s("strong",{children:[" Official websites use .",u," "]}),e("br",{}),"A ",s("strong",{children:[".",u]})," website belongs to an official"," ",f[u]," organization in the United States."]})}))]})),s("div",Object.assign({className:"usa-banner__guidance tablet:grid-col-6"},{children:[e("img",{className:"usa-banner__icon usa-media-block__img",src:l,role:"img",alt:"","aria-hidden":"true"}),e("div",Object.assign({className:"usa-media-block__body"},{children:s("p",{children:[e("strong",{children:" Secure .gov websites use HTTPS "}),e("br",{}),"A ",e("strong",{children:"lock"})," (",e("span",Object.assign({className:"icon-lock"},{children:s("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",width:"52",height:"64",viewBox:"0 0 52 64",className:"usa-banner__lock-image",role:"img","aria-labelledby":"banner-lock-title-default banner-lock-description-default",focusable:"false"},{children:[e("title",Object.assign({id:"banner-lock-title-default"},{children:"Lock"})),e("desc",Object.assign({id:"banner-lock-description-default"},{children:"A locked padlock"})),e("path",{fill:"#000000",fillRule:"evenodd",d:"M26 0c10.493 0 19 8.507 19 19v9h3a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V32a4 4 0 0 1 4-4h3v-9C7 8.507 15.507 0 26 0zm0 8c-5.979 0-10.843 4.77-10.996 10.712L15 19v9h22v-9c0-6.075-4.925-11-11-11z"})]}))})),") or ",e("strong",{children:"https://"})," means you’ve safely connected to the .",u," ","website. Share sensitive information only on official, secure websites."]})}))]}))]}))}))]}))}))};export{h as Alert,_ as Banner}; | ||
*/ (g = b), | ||
(function () { | ||
var e = {}.hasOwnProperty; | ||
function a() { | ||
for (var e = '', a = 0; a < arguments.length; a++) { | ||
var r = arguments[a]; | ||
r && (e = n(e, s(r))); | ||
} | ||
return e; | ||
} | ||
function s(s) { | ||
if ('string' == typeof s || 'number' == typeof s) return s; | ||
if ('object' != typeof s) return ''; | ||
if (Array.isArray(s)) return a.apply(null, s); | ||
if ( | ||
s.toString !== Object.prototype.toString && | ||
!s.toString.toString().includes('[native code]') | ||
) | ||
return s.toString(); | ||
var r = ''; | ||
for (var i in s) e.call(s, i) && s[i] && (r = n(r, i)); | ||
return r; | ||
} | ||
function n(e, a) { | ||
return a ? (e ? e + ' ' + a : e + a) : e; | ||
} | ||
g.exports ? ((a.default = a), (g.exports = a)) : (window.classNames = a); | ||
})(); | ||
var m = u(b.exports); | ||
const h = ({ | ||
id: n, | ||
type: r, | ||
show: i = !0, | ||
slim: t, | ||
noIcon: c, | ||
heading: o, | ||
body: l, | ||
children: d, | ||
}) => { | ||
const u = m('usa-alert', { | ||
'usa-alert--success': 'success' === r, | ||
'usa-alert--warning': 'warning' === r, | ||
'usa-alert--error': 'error' === r, | ||
'usa-alert--info': 'info' === r, | ||
'usa-alert--slim': t, | ||
'usa-alert--no-icon': c, | ||
}); | ||
return i | ||
? e( | ||
'div', | ||
Object.assign( | ||
{ id: n, className: u }, | ||
{ | ||
children: s( | ||
'div', | ||
Object.assign( | ||
{ className: 'usa-alert__body' }, | ||
{ | ||
children: [ | ||
o && | ||
e( | ||
'h4', | ||
Object.assign({ className: 'usa-alert__heading' }, { children: o }), | ||
), | ||
null != l | ||
? l | ||
: e('p', Object.assign({ className: 'usa-alert__text' }, { children: d })), | ||
], | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
) | ||
: e(a, {}); | ||
}, | ||
f = { gov: 'government', mil: 'U.S. Department of Defense' }, | ||
_ = ({ id: a, type: u = 'gov' }) => { | ||
const [g] = n(!1), | ||
b = r(null); | ||
return ( | ||
i(() => { | ||
const e = b.current; | ||
return ( | ||
c.on(e), | ||
t.on(e), | ||
() => { | ||
c.off(e), t.off(e); | ||
} | ||
); | ||
}), | ||
e( | ||
'section', | ||
Object.assign( | ||
{ id: a, className: 'usa-banner', 'aria-label': 'Official government website', ref: b }, | ||
{ | ||
children: s( | ||
'div', | ||
Object.assign( | ||
{ className: 'usa-accordion' }, | ||
{ | ||
children: [ | ||
e( | ||
'header', | ||
Object.assign( | ||
{ className: 'usa-banner__header' }, | ||
{ | ||
children: s( | ||
'div', | ||
Object.assign( | ||
{ className: 'usa-banner__inner' }, | ||
{ | ||
children: [ | ||
e( | ||
'div', | ||
Object.assign( | ||
{ className: 'grid-col-auto' }, | ||
{ | ||
children: e('img', { | ||
className: 'usa-banner__header-flag', | ||
src: o, | ||
alt: 'U.S. flag', | ||
}), | ||
}, | ||
), | ||
), | ||
s( | ||
'div', | ||
Object.assign( | ||
{ className: 'grid-col-fill tablet:grid-col-auto' }, | ||
{ | ||
children: [ | ||
e( | ||
'p', | ||
Object.assign( | ||
{ className: 'usa-banner__header-text' }, | ||
{ | ||
children: | ||
'An official website of the United States government', | ||
}, | ||
), | ||
), | ||
e( | ||
'p', | ||
Object.assign( | ||
{ | ||
className: 'usa-banner__header-action', | ||
'aria-hidden': 'true', | ||
}, | ||
{ children: 'Here’s how you know' }, | ||
), | ||
), | ||
], | ||
}, | ||
), | ||
), | ||
e( | ||
'button', | ||
Object.assign( | ||
{ | ||
className: 'usa-accordion__button usa-banner__button', | ||
'aria-expanded': 'false', | ||
'aria-controls': 'gov-banner-default', | ||
}, | ||
{ | ||
children: e( | ||
'span', | ||
Object.assign( | ||
{ className: 'usa-banner__button-text' }, | ||
{ children: 'Here’s how you know' }, | ||
), | ||
), | ||
}, | ||
), | ||
), | ||
], | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
), | ||
e( | ||
'div', | ||
Object.assign( | ||
{ | ||
className: 'usa-banner__content usa-accordion__content', | ||
id: 'gov-banner-default', | ||
hidden: !g, | ||
}, | ||
{ | ||
children: s( | ||
'div', | ||
Object.assign( | ||
{ className: 'grid-row grid-gap-lg' }, | ||
{ | ||
children: [ | ||
s( | ||
'div', | ||
Object.assign( | ||
{ className: 'usa-banner__guidance tablet:grid-col-6' }, | ||
{ | ||
children: [ | ||
e('img', { | ||
className: 'usa-banner__icon usa-media-block__img', | ||
src: d, | ||
role: 'img', | ||
alt: '', | ||
'aria-hidden': 'true', | ||
}), | ||
e( | ||
'div', | ||
Object.assign( | ||
{ className: 'usa-media-block__body' }, | ||
{ | ||
children: s('p', { | ||
children: [ | ||
s('strong', { | ||
children: [ | ||
' Official websites use .', | ||
u, | ||
' ', | ||
], | ||
}), | ||
e('br', {}), | ||
'A ', | ||
s('strong', { children: ['.', u] }), | ||
' website belongs to an official', | ||
' ', | ||
f[u], | ||
' organization in the United States.', | ||
], | ||
}), | ||
}, | ||
), | ||
), | ||
], | ||
}, | ||
), | ||
), | ||
s( | ||
'div', | ||
Object.assign( | ||
{ className: 'usa-banner__guidance tablet:grid-col-6' }, | ||
{ | ||
children: [ | ||
e('img', { | ||
className: 'usa-banner__icon usa-media-block__img', | ||
src: l, | ||
role: 'img', | ||
alt: '', | ||
'aria-hidden': 'true', | ||
}), | ||
e( | ||
'div', | ||
Object.assign( | ||
{ className: 'usa-media-block__body' }, | ||
{ | ||
children: s('p', { | ||
children: [ | ||
e('strong', { | ||
children: ' Secure .gov websites use HTTPS ', | ||
}), | ||
e('br', {}), | ||
'A ', | ||
e('strong', { children: 'lock' }), | ||
' (', | ||
e( | ||
'span', | ||
Object.assign( | ||
{ className: 'icon-lock' }, | ||
{ | ||
children: s( | ||
'svg', | ||
Object.assign( | ||
{ | ||
xmlns: 'http://www.w3.org/2000/svg', | ||
width: '52', | ||
height: '64', | ||
viewBox: '0 0 52 64', | ||
className: 'usa-banner__lock-image', | ||
role: 'img', | ||
'aria-labelledby': | ||
'banner-lock-title-default banner-lock-description-default', | ||
focusable: 'false', | ||
}, | ||
{ | ||
children: [ | ||
e( | ||
'title', | ||
Object.assign( | ||
{ | ||
id: 'banner-lock-title-default', | ||
}, | ||
{ children: 'Lock' }, | ||
), | ||
), | ||
e( | ||
'desc', | ||
Object.assign( | ||
{ | ||
id: 'banner-lock-description-default', | ||
}, | ||
{ | ||
children: | ||
'A locked padlock', | ||
}, | ||
), | ||
), | ||
e('path', { | ||
fill: '#000000', | ||
fillRule: 'evenodd', | ||
d: 'M26 0c10.493 0 19 8.507 19 19v9h3a4 4 0 0 1 4 4v28a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V32a4 4 0 0 1 4-4h3v-9C7 8.507 15.507 0 26 0zm0 8c-5.979 0-10.843 4.77-10.996 10.712L15 19v9h22v-9c0-6.075-4.925-11-11-11z', | ||
}), | ||
], | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
), | ||
') or ', | ||
e('strong', { children: 'https://' }), | ||
' means you’ve safely connected to the .', | ||
u, | ||
' ', | ||
'website. Share sensitive information only on official, secure websites.', | ||
], | ||
}), | ||
}, | ||
), | ||
), | ||
], | ||
}, | ||
), | ||
), | ||
], | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
), | ||
], | ||
}, | ||
), | ||
), | ||
}, | ||
), | ||
) | ||
); | ||
}; | ||
export { h as Alert, _ as Banner }; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@metrostar/comet-uswds", | ||
"version": "2.2.0-alpha-1", | ||
"version": "2.2.0-alpha-3", | ||
"description": "React with TypeScript Component Library based on USWDS 3.0.", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
122007
3011