boreal-ui 0.0.889 → 0.0.890
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -14
- package/README.npm.md +7 -5
- package/dist/core/{Footer-BzPTfew2.cjs → Footer-6H7E0aW5.cjs} +1 -1
- package/dist/core/{Footer-Cm-V5_2F.js → Footer-DC_LqIlJ.js} +1 -1
- package/dist/core/Footer.cjs.js +1 -1
- package/dist/core/Footer.js +1 -1
- package/dist/core/ThemeContext-BosEFe2d.cjs +1 -0
- package/dist/core/{ThemeContext-_fqD_6jM.js → ThemeContext-DFVNYGOV.js} +137 -136
- package/dist/core/ThemeProvider.cjs.js +1 -1
- package/dist/core/ThemeProvider.js +1 -1
- package/dist/core/index.cjs.js +1 -1
- package/dist/core/index.js +2 -2
- package/dist/next/{Footer-V-XnI_zl.js → Footer-znmCP-MT.js} +1 -1
- package/dist/next/Footer.js +1 -1
- package/dist/next/NextThemeProvider-A6VtyTUj.js +8 -0
- package/dist/next/{ThemeContext-CNR7tRqD.js → ThemeContext-BAYIo3D-.js} +137 -136
- package/dist/next/ThemeProvider.js +2 -2
- package/dist/next/index.js +3 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/context/ThemeContext.d.ts.map +1 -1
- package/dist/types/context/ThemeContext.types.d.ts +3 -0
- package/dist/types/context/ThemeContext.types.d.ts.map +1 -1
- package/dist/types/core/Accordion.d.ts +4 -0
- package/dist/types/core/Accordion.d.ts.map +1 -0
- package/dist/types/core/Avatar.d.ts +4 -0
- package/dist/types/core/Avatar.d.ts.map +1 -0
- package/dist/types/core/Badge.d.ts +4 -0
- package/dist/types/core/Badge.d.ts.map +1 -0
- package/dist/types/core/Breadcrumbs.d.ts +4 -0
- package/dist/types/core/Breadcrumbs.d.ts.map +1 -0
- package/dist/types/core/Button.d.ts +4 -0
- package/dist/types/core/Button.d.ts.map +1 -0
- package/dist/types/core/Card.d.ts +4 -0
- package/dist/types/core/Card.d.ts.map +1 -0
- package/dist/types/core/CheckBox.d.ts +4 -0
- package/dist/types/core/CheckBox.d.ts.map +1 -0
- package/dist/types/core/Chip.d.ts +4 -0
- package/dist/types/core/Chip.d.ts.map +1 -0
- package/dist/types/core/CircularProgress.d.ts +4 -0
- package/dist/types/core/CircularProgress.d.ts.map +1 -0
- package/dist/types/core/ColorPicker.d.ts +4 -0
- package/dist/types/core/ColorPicker.d.ts.map +1 -0
- package/dist/types/core/CommandPalette.d.ts +4 -0
- package/dist/types/core/CommandPalette.d.ts.map +1 -0
- package/dist/types/core/DataTable.d.ts +4 -0
- package/dist/types/core/DataTable.d.ts.map +1 -0
- package/dist/types/core/DateTimePicker.d.ts +4 -0
- package/dist/types/core/DateTimePicker.d.ts.map +1 -0
- package/dist/types/core/Divider.d.ts +4 -0
- package/dist/types/core/Divider.d.ts.map +1 -0
- package/dist/types/core/Dropdown.d.ts +4 -0
- package/dist/types/core/Dropdown.d.ts.map +1 -0
- package/dist/types/core/EmptyState.d.ts +4 -0
- package/dist/types/core/EmptyState.d.ts.map +1 -0
- package/dist/types/core/FileUpload.d.ts +4 -0
- package/dist/types/core/FileUpload.d.ts.map +1 -0
- package/dist/types/core/Footer.d.ts +4 -0
- package/dist/types/core/Footer.d.ts.map +1 -0
- package/dist/types/core/FormGroup.d.ts +4 -0
- package/dist/types/core/FormGroup.d.ts.map +1 -0
- package/dist/types/core/IconButton.d.ts +4 -0
- package/dist/types/core/IconButton.d.ts.map +1 -0
- package/dist/types/core/MarkdownRenderer.d.ts +4 -0
- package/dist/types/core/MarkdownRenderer.d.ts.map +1 -0
- package/dist/types/core/MessagePopUp.d.ts +4 -0
- package/dist/types/core/MessagePopUp.d.ts.map +1 -0
- package/dist/types/core/MetricBox.d.ts +4 -0
- package/dist/types/core/MetricBox.d.ts.map +1 -0
- package/dist/types/core/Modal.d.ts +4 -0
- package/dist/types/core/Modal.d.ts.map +1 -0
- package/dist/types/core/NavBar.d.ts +4 -0
- package/dist/types/core/NavBar.d.ts.map +1 -0
- package/dist/types/core/NotificationCenter.d.ts +4 -0
- package/dist/types/core/NotificationCenter.d.ts.map +1 -0
- package/dist/types/core/Pager.d.ts +4 -0
- package/dist/types/core/Pager.d.ts.map +1 -0
- package/dist/types/core/PopOver.d.ts +4 -0
- package/dist/types/core/PopOver.d.ts.map +1 -0
- package/dist/types/core/ProgressBar.d.ts +4 -0
- package/dist/types/core/ProgressBar.d.ts.map +1 -0
- package/dist/types/core/RadioButton.d.ts +5 -0
- package/dist/types/core/RadioButton.d.ts.map +1 -0
- package/dist/types/core/RadioGroup.d.ts +4 -0
- package/dist/types/core/RadioGroup.d.ts.map +1 -0
- package/dist/types/core/Rating.d.ts +4 -0
- package/dist/types/core/Rating.d.ts.map +1 -0
- package/dist/types/core/ScrollToTop.d.ts +4 -0
- package/dist/types/core/ScrollToTop.d.ts.map +1 -0
- package/dist/types/core/Select.d.ts +4 -0
- package/dist/types/core/Select.d.ts.map +1 -0
- package/dist/types/core/Sidebar.d.ts +4 -0
- package/dist/types/core/Sidebar.d.ts.map +1 -0
- package/dist/types/core/Skeleton.d.ts +4 -0
- package/dist/types/core/Skeleton.d.ts.map +1 -0
- package/dist/types/core/Slider.d.ts +4 -0
- package/dist/types/core/Slider.d.ts.map +1 -0
- package/dist/types/core/Spinner.d.ts +4 -0
- package/dist/types/core/Spinner.d.ts.map +1 -0
- package/dist/types/core/Stepper.d.ts +4 -0
- package/dist/types/core/Stepper.d.ts.map +1 -0
- package/dist/types/core/Tabs.d.ts +4 -0
- package/dist/types/core/Tabs.d.ts.map +1 -0
- package/dist/types/core/TagInput.d.ts +4 -0
- package/dist/types/core/TagInput.d.ts.map +1 -0
- package/dist/types/core/TextArea.d.ts +4 -0
- package/dist/types/core/TextArea.d.ts.map +1 -0
- package/dist/types/core/TextInput.d.ts +4 -0
- package/dist/types/core/TextInput.d.ts.map +1 -0
- package/dist/types/core/ThemeProvider.d.ts +3 -0
- package/dist/types/core/ThemeProvider.d.ts.map +1 -0
- package/dist/types/core/Timeline.d.ts +4 -0
- package/dist/types/core/Timeline.d.ts.map +1 -0
- package/dist/types/core/Toggle.d.ts +4 -0
- package/dist/types/core/Toggle.d.ts.map +1 -0
- package/dist/types/core/Toolbar.d.ts +4 -0
- package/dist/types/core/Toolbar.d.ts.map +1 -0
- package/dist/types/core/Tooltip.d.ts +4 -0
- package/dist/types/core/Tooltip.d.ts.map +1 -0
- package/dist/types/core/Typography.d.ts +4 -0
- package/dist/types/core/Typography.d.ts.map +1 -0
- package/dist/types/core/colorSchemes.d.ts +2 -0
- package/dist/types/core/colorSchemes.d.ts.map +1 -0
- package/dist/types/core/globals.d.ts +2 -0
- package/dist/types/core/globals.d.ts.map +1 -0
- package/dist/types/core/registerColorScheme.d.ts +2 -0
- package/dist/types/core/registerColorScheme.d.ts.map +1 -0
- package/dist/types/core/registerColorSheme.d.ts +2 -0
- package/dist/types/core/registerColorSheme.d.ts.map +1 -0
- package/dist/types/next/Accordion.d.ts +4 -0
- package/dist/types/next/Accordion.d.ts.map +1 -0
- package/dist/types/next/Avatar.d.ts +4 -0
- package/dist/types/next/Avatar.d.ts.map +1 -0
- package/dist/types/next/Badge.d.ts +4 -0
- package/dist/types/next/Badge.d.ts.map +1 -0
- package/dist/types/next/Breadcrumbs.d.ts +4 -0
- package/dist/types/next/Breadcrumbs.d.ts.map +1 -0
- package/dist/types/next/Button.d.ts +4 -0
- package/dist/types/next/Button.d.ts.map +1 -0
- package/dist/types/next/Card.d.ts +4 -0
- package/dist/types/next/Card.d.ts.map +1 -0
- package/dist/types/next/CheckBox.d.ts +4 -0
- package/dist/types/next/CheckBox.d.ts.map +1 -0
- package/dist/types/next/Chip.d.ts +4 -0
- package/dist/types/next/Chip.d.ts.map +1 -0
- package/dist/types/next/CircularProgress.d.ts +4 -0
- package/dist/types/next/CircularProgress.d.ts.map +1 -0
- package/dist/types/next/ColorPicker.d.ts +4 -0
- package/dist/types/next/ColorPicker.d.ts.map +1 -0
- package/dist/types/next/CommandPalette.d.ts +4 -0
- package/dist/types/next/CommandPalette.d.ts.map +1 -0
- package/dist/types/next/DataTable.d.ts +4 -0
- package/dist/types/next/DataTable.d.ts.map +1 -0
- package/dist/types/next/DateTimePicker.d.ts +4 -0
- package/dist/types/next/DateTimePicker.d.ts.map +1 -0
- package/dist/types/next/Divider.d.ts +4 -0
- package/dist/types/next/Divider.d.ts.map +1 -0
- package/dist/types/next/Dropdown.d.ts +4 -0
- package/dist/types/next/Dropdown.d.ts.map +1 -0
- package/dist/types/next/EmptyState.d.ts +4 -0
- package/dist/types/next/EmptyState.d.ts.map +1 -0
- package/dist/types/next/FileUpload.d.ts +4 -0
- package/dist/types/next/FileUpload.d.ts.map +1 -0
- package/dist/types/next/Footer.d.ts +4 -0
- package/dist/types/next/Footer.d.ts.map +1 -0
- package/dist/types/next/FormGroup.d.ts +4 -0
- package/dist/types/next/FormGroup.d.ts.map +1 -0
- package/dist/types/next/IconButton.d.ts +4 -0
- package/dist/types/next/IconButton.d.ts.map +1 -0
- package/dist/types/next/MarkdownRenderer.d.ts +4 -0
- package/dist/types/next/MarkdownRenderer.d.ts.map +1 -0
- package/dist/types/next/MessagePopUp.d.ts +4 -0
- package/dist/types/next/MessagePopUp.d.ts.map +1 -0
- package/dist/types/next/MetricBox.d.ts +4 -0
- package/dist/types/next/MetricBox.d.ts.map +1 -0
- package/dist/types/next/Modal.d.ts +4 -0
- package/dist/types/next/Modal.d.ts.map +1 -0
- package/dist/types/next/NavBar.d.ts +4 -0
- package/dist/types/next/NavBar.d.ts.map +1 -0
- package/dist/types/next/NotificationCenter.d.ts +4 -0
- package/dist/types/next/NotificationCenter.d.ts.map +1 -0
- package/dist/types/next/Pager.d.ts +4 -0
- package/dist/types/next/Pager.d.ts.map +1 -0
- package/dist/types/next/PopOver.d.ts +4 -0
- package/dist/types/next/PopOver.d.ts.map +1 -0
- package/dist/types/next/ProgressBar.d.ts +4 -0
- package/dist/types/next/ProgressBar.d.ts.map +1 -0
- package/dist/types/next/RadioButton.d.ts +5 -0
- package/dist/types/next/RadioButton.d.ts.map +1 -0
- package/dist/types/next/RadioGroup.d.ts +4 -0
- package/dist/types/next/RadioGroup.d.ts.map +1 -0
- package/dist/types/next/Rating.d.ts +4 -0
- package/dist/types/next/Rating.d.ts.map +1 -0
- package/dist/types/next/ScrollToTop.d.ts +4 -0
- package/dist/types/next/ScrollToTop.d.ts.map +1 -0
- package/dist/types/next/Select.d.ts +4 -0
- package/dist/types/next/Select.d.ts.map +1 -0
- package/dist/types/next/Sidebar.d.ts +4 -0
- package/dist/types/next/Sidebar.d.ts.map +1 -0
- package/dist/types/next/Skeleton.d.ts +4 -0
- package/dist/types/next/Skeleton.d.ts.map +1 -0
- package/dist/types/next/Slider.d.ts +4 -0
- package/dist/types/next/Slider.d.ts.map +1 -0
- package/dist/types/next/Spinner.d.ts +4 -0
- package/dist/types/next/Spinner.d.ts.map +1 -0
- package/dist/types/next/Stepper.d.ts +4 -0
- package/dist/types/next/Stepper.d.ts.map +1 -0
- package/dist/types/next/Tabs.d.ts +4 -0
- package/dist/types/next/Tabs.d.ts.map +1 -0
- package/dist/types/next/TagInput.d.ts +4 -0
- package/dist/types/next/TagInput.d.ts.map +1 -0
- package/dist/types/next/TextArea.d.ts +4 -0
- package/dist/types/next/TextArea.d.ts.map +1 -0
- package/dist/types/next/TextInput.d.ts +4 -0
- package/dist/types/next/TextInput.d.ts.map +1 -0
- package/dist/types/next/ThemeProvider.d.ts +4 -0
- package/dist/types/next/ThemeProvider.d.ts.map +1 -0
- package/dist/types/next/Timeline.d.ts +4 -0
- package/dist/types/next/Timeline.d.ts.map +1 -0
- package/dist/types/next/Toggle.d.ts +4 -0
- package/dist/types/next/Toggle.d.ts.map +1 -0
- package/dist/types/next/Toolbar.d.ts +4 -0
- package/dist/types/next/Toolbar.d.ts.map +1 -0
- package/dist/types/next/Tooltip.d.ts +4 -0
- package/dist/types/next/Tooltip.d.ts.map +1 -0
- package/dist/types/next/Typography.d.ts +4 -0
- package/dist/types/next/Typography.d.ts.map +1 -0
- package/dist/types/next/colorSchemes.d.ts +2 -0
- package/dist/types/next/colorSchemes.d.ts.map +1 -0
- package/dist/types/next/globals.d.ts +2 -0
- package/dist/types/next/globals.d.ts.map +1 -0
- package/dist/types/next/registerColorScheme.d.ts +2 -0
- package/dist/types/next/registerColorScheme.d.ts.map +1 -0
- package/dist/types/next/registerColorSheme.d.ts +2 -0
- package/dist/types/next/registerColorSheme.d.ts.map +1 -0
- package/docs/styling-and-theming.md +13 -6
- package/package.json +4 -1
- package/packages/cli/src/commands/init.js +23 -3
- package/packages/cli/src/utils/constants.js +1 -1
- package/dist/core/ThemeContext-4s7wgjA0.cjs +0 -1
- package/dist/next/NextThemeProvider-Dv0eJlsJ.js +0 -8
package/README.md
CHANGED
|
@@ -104,15 +104,15 @@ body {
|
|
|
104
104
|
}
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
The CLI can create or repair that safer baseline for Next.js apps:
|
|
108
|
-
|
|
109
|
-
```bash
|
|
110
|
-
npx boreal-ui init --framework next --recommended-globals
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Interactive Next.js setup prompts for this by default. Use `--recommended-globals` to apply it without the prompt, or `--no-recommended-globals` to skip it.
|
|
114
|
-
|
|
115
|
-
Then import components from the Next build:
|
|
107
|
+
The CLI can create or repair that safer baseline for Next.js apps:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npx boreal-ui init --framework next --recommended-globals
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Interactive Next.js setup prompts for this by default. Use `--recommended-globals` to apply it without the prompt, or `--no-recommended-globals` to skip it.
|
|
114
|
+
|
|
115
|
+
Then import components from the Next build:
|
|
116
116
|
|
|
117
117
|
```tsx
|
|
118
118
|
"use client";
|
|
@@ -256,6 +256,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
256
256
|
return (
|
|
257
257
|
<ThemeProvider
|
|
258
258
|
customSchemes={customSchemes}
|
|
259
|
+
enableThemeScript={false}
|
|
259
260
|
initialSchemeName="Cyberpunk Pulse"
|
|
260
261
|
>
|
|
261
262
|
{children}
|
|
@@ -266,11 +267,12 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
266
267
|
|
|
267
268
|
`ThemeProvider` props:
|
|
268
269
|
|
|
269
|
-
| Prop | Description
|
|
270
|
-
| ---------------------- |
|
|
271
|
-
| `customSchemes` | Register additional color schemes at runtime.
|
|
272
|
-
| `
|
|
273
|
-
| `
|
|
270
|
+
| Prop | Description |
|
|
271
|
+
| ---------------------- | ---------------------------------------------------------------------------------------- |
|
|
272
|
+
| `customSchemes` | Register additional color schemes at runtime. |
|
|
273
|
+
| `enableThemeScript` | Render the pre-hydration theme script. Defaults to `true` for core and `false` for Next. |
|
|
274
|
+
| `initialSchemeName` | Select an initial scheme by name. |
|
|
275
|
+
| `useOnlyCustomSchemes` | Use only custom schemes instead of the built-in list. |
|
|
274
276
|
|
|
275
277
|
Color scheme shape:
|
|
276
278
|
|
package/README.npm.md
CHANGED
|
@@ -302,6 +302,7 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
302
302
|
return (
|
|
303
303
|
<ThemeProvider
|
|
304
304
|
customSchemes={customSchemes}
|
|
305
|
+
enableThemeScript={false}
|
|
305
306
|
initialSchemeName="Cyberpunk Pulse"
|
|
306
307
|
>
|
|
307
308
|
{children}
|
|
@@ -312,11 +313,12 @@ export function Providers({ children }: { children: React.ReactNode }) {
|
|
|
312
313
|
|
|
313
314
|
### ThemeProvider Props
|
|
314
315
|
|
|
315
|
-
| Prop | Description
|
|
316
|
-
| ---------------------- |
|
|
317
|
-
| `customSchemes` | Register additional color schemes at runtime.
|
|
318
|
-
| `
|
|
319
|
-
| `
|
|
316
|
+
| Prop | Description |
|
|
317
|
+
| ---------------------- | ---------------------------------------------------------------------------------------- |
|
|
318
|
+
| `customSchemes` | Register additional color schemes at runtime. |
|
|
319
|
+
| `enableThemeScript` | Render the pre-hydration theme script. Defaults to `true` for core and `false` for Next. |
|
|
320
|
+
| `initialSchemeName` | Select an initial scheme by name. |
|
|
321
|
+
| `useOnlyCustomSchemes` | Use only custom schemes instead of the built-in list. |
|
|
320
322
|
|
|
321
323
|
### Color Scheme Shape
|
|
322
324
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";require('./Footer.css');const t=require("react/jsx-runtime"),he=require("./propAliases-Bfsf5cJN.cjs"),z=require("react"),r=require("./classNames-C7V3kfBj.cjs"),j=require("./boreal-style-config-BB8MdwYx.cjs"),k=require("./capitalize-CnTiekgk.cjs"),Re=require("./IconButton-O0x6cSnS.cjs"),Ee=require("./Select-BkErbR5B.cjs"),Ge=require("./ThemeContext-
|
|
1
|
+
"use strict";require('./Footer.css');const t=require("react/jsx-runtime"),he=require("./propAliases-Bfsf5cJN.cjs"),z=require("react"),r=require("./classNames-C7V3kfBj.cjs"),j=require("./boreal-style-config-BB8MdwYx.cjs"),k=require("./capitalize-CnTiekgk.cjs"),Re=require("./IconButton-O0x6cSnS.cjs"),Ee=require("./Select-BkErbR5B.cjs"),Ge=require("./ThemeContext-BosEFe2d.cjs"),L=l=>l.toLowerCase().trim().replace(/\s+/g,"-"),fe=({theme:l=j.getDefaultTheme(),glass:b=j.getDefaultGlass(),attachment:B="static",shadow:N="none",rounding:x="none",layout:c="inline",className:_="","data-testid":C,testId:n=C??"footer",copyright:a,copyrightInBottom:$,links:f=[],sections:m,logo:s,brandTitle:y,brandDescription:R,brandHref:W,brandTarget:H,brandRel:be,socialLinks:S=[],showThemeSelect:J=!1,bottomEnd:E,contentClassName:K,leftClassName:O,linksClassName:Ne,linkClassName:xe,logoClassName:G,socialClassName:ge,themeToggleClassName:je,brandClassName:_e,brandLinkClassName:Q,brandTitleClassName:Ce,brandDescriptionClassName:$e,sectionsClassName:ye,sectionTitleClassName:V,actionsClassName:Se,actionGroupClassName:ve,bottomClassName:we,bottomCopyrightClassName:Te,bottomEndClassName:pe,copyrightClassName:X,IconButton:qe,ImageComponent:Y="img",ThemeSelect:Fe,classMap:o,LinkWrapper:Z=({href:w,children:T,...oe})=>t.jsx("a",{href:w,...oe,children:T}),"aria-label":A,"aria-labelledby":D,"aria-describedby":I,navAriaLabel:M="Footer site links",socialNavAriaLabel:ke="Social media",themeSelectAriaLabel:ee="Theme selector",logoAriaLabel:v="Logo",logoDecorative:h=!1,labelId:g,...te})=>{const w=he.resolvePropAlias(B),T=z.useMemo(()=>r.combineClassNames(o.footer,o[l],b&&o.glass,c!=="inline"&&o[`layout${k.capitalize(c)}`],N!=="none"&&o[`shadow${k.capitalize(N)}`],x!=="none"&&o[`round${k.capitalize(x)}`],o[`attachment${k.capitalize(w)}`],_),[o,l,b,c,N,x,w,_]),re=typeof s=="string"||(e=>typeof e=="object"&&e!==null&&"src"in e)(s),i=re?typeof s=="string"?{src:s}:s:void 0,U=i==null?void 0:i.src,ne=(i==null?void 0:i.width)??20,ae=(i==null?void 0:i.height)??20,se=m&&m.length>0?m:f.length>0?[{title:"Links",links:f,"aria-label":M,testId:"links"}]:[],ie=$??c==="columns",le=()=>re&&U?typeof Y=="string"?t.jsx("img",{className:r.combineClassNames(o.logo,G),"data-testid":`${n}-logo`,loading:"lazy",src:U,alt:h?"":v,"aria-hidden":h?!0:void 0,height:ae,width:ne}):t.jsx(Y,{className:r.combineClassNames(o.logo,G),"data-testid":`${n}-logo`,src:U,alt:h?"":v,"aria-hidden":h?!0:void 0,height:ae,width:ne}):s?t.jsx("span",{className:r.combineClassNames(o.logo,G),role:h?void 0:"img","aria-label":h?void 0:v,"aria-hidden":h?!0:void 0,"data-testid":`${n}-logo`,children:s}):null,de=(e,d,p)=>{const u=L(e.label||e.href||`link-${d}`),q=`${e.href??u}-${d}`,F=r.combineClassNames(o.link,p);return e.disabled?t.jsx("li",{children:t.jsx("span",{className:F,"data-testid":`${n}-link-${u}`,"aria-disabled":"true",title:e.title,children:e.label})},q):t.jsx("li",{children:t.jsx(Z,{href:e.href,className:F,"data-testid":`${n}-link-${u}`,"aria-label":e["aria-label"],"aria-current":e["aria-current"],title:e.title,rel:e.rel,target:e.target,children:e.label})},q)},ce=()=>S.length===0?null:t.jsx("nav",{className:r.combineClassNames(o.social,ge),"aria-label":ke,"data-testid":`${n}-social`,children:S.map((e,d)=>t.jsx(qe,{icon:e.icon,href:e.href,isExternal:e.isExternal??!0,shadow:"none","aria-label":e["aria-label"]??e.title,title:e.tooltip??e.title,theme:"clear",glass:b,disabled:e.disabled,rel:e.rel,target:e.target,"data-testid":`${n}-social-${L(e.title)}`},`${e.href??e.title}-${d}`))}),me=()=>J?t.jsx("div",{className:r.combineClassNames(o.themeToggle,je),"data-testid":`${n}-theme-select`,"aria-label":ee,children:t.jsx(Fe,{theme:"clear",label:R,shadow:"none","aria-label":ee})}):null,ze=()=>{const e=t.jsxs(t.Fragment,{children:[le(),y&&t.jsx("span",{className:r.combineClassNames(o.brandTitle,Ce),"data-testid":`${n}-brand-title`,children:y})]});return t.jsxs("div",{className:r.combineClassNames(o.brand,_e),"data-testid":`${n}-brand`,children:[W?t.jsx(Z,{href:W,className:r.combineClassNames(o.brandLink,Q),target:H,rel:be??(H==="_blank"?"noopener noreferrer":void 0),"aria-label":typeof y=="string"?y:v,children:e}):t.jsx("div",{className:r.combineClassNames(o.brandLink,Q),children:e}),R&&t.jsx("p",{className:r.combineClassNames(o.brandDescription,$e),"data-testid":`${n}-brand-description`,children:R}),a&&!ie&&t.jsx("div",{className:r.combineClassNames(o.copyright,X),"data-testid":`${n}-copyright`,children:t.jsx("p",{id:g,children:a})})]})},Be=()=>se.length===0?null:t.jsx("div",{className:r.combineClassNames(o.sections,ye),"data-testid":`${n}-sections`,children:se.map((e,d)=>{const p=typeof e.title=="string"?e.title:`section-${d+1}`,u=e.testId??L(p);return t.jsxs("nav",{className:r.combineClassNames(o.section,e.className),"aria-label":e["aria-label"]??`${p} links`,"data-testid":`${n}-section-${u}`,children:[t.jsx("h2",{className:r.combineClassNames(o.sectionTitle,V,e.titleClassName),children:e.title}),t.jsx("ul",{className:r.combineClassNames(o.sectionList,e.listClassName),children:e.links.map((q,F)=>de(q,F,e.linkClassName))})]},u)})});return c==="columns"?t.jsxs("footer",{className:T,"data-testid":n,role:"contentinfo","aria-label":A,"aria-labelledby":D??g,"aria-describedby":I,...te,children:[t.jsxs("div",{className:r.combineClassNames(o.content,K),children:[ze(),Be(),(S.length>0||J)&&t.jsxs("div",{className:r.combineClassNames(o.actions,Se),"data-testid":`${n}-actions`,children:[S.length>0&&t.jsxs("div",{className:r.combineClassNames(o.actionGroup,ve),children:[t.jsx("h2",{className:r.combineClassNames(o.sectionTitle,V),children:"Connect"}),ce()]}),me()]})]}),(a||E)&&t.jsxs("div",{className:r.combineClassNames(o.bottom,we),"data-testid":`${n}-bottom`,children:[a&&ie&&t.jsx("p",{id:g,className:r.combineClassNames(o.bottomCopyright,Te),"data-testid":`${n}-copyright`,children:a}),E&&t.jsx("div",{className:r.combineClassNames(o.bottomEnd,pe),"data-testid":`${n}-bottom-end`,children:E})]})]}):t.jsx("footer",{className:T,"data-testid":n,role:"contentinfo","aria-label":A,"aria-labelledby":D??g,"aria-describedby":I,...te,children:t.jsxs("div",{className:r.combineClassNames(o.content,K),children:[t.jsxs("div",{className:r.combineClassNames(o.left,O),"data-testid":`${n}-left`,children:[le(),a&&t.jsx("div",{className:r.combineClassNames(o.copyright,X)??r.combineClassNames(o.left,O),"data-testid":`${n}-copyright`,children:t.jsx("p",{id:g,children:a})})]}),f.length>0&&t.jsx("nav",{className:r.combineClassNames(o.links,Ne),"aria-label":M,"data-testid":`${n}-nav`,children:t.jsx("ul",{children:f.map((e,d)=>de(e,d,xe))})}),me(),ce()]})})};fe.displayName="FooterBase";const P=z.forwardRef(({theme:l=j.getDefaultTheme(),shadow:b=j.getDefaultShadow(),rounding:B=j.getDefaultRounding(),"data-testid":N,testId:x=N??"theme-select",state:c=""},_)=>{const C=z.useContext(Ge.ThemeContext);if(!C)throw new Error("ThemeContext is undefined. Wrap with ThemeProvider.");const{selectedScheme:n,setSelectedScheme:a,schemes:$}=C,f=z.useMemo(()=>$.map((m,s)=>({value:String(s),label:m.name})),[$]);return t.jsx("div",{className:"control-container",children:t.jsx(Ee.Select,{ref:_,theme:l,state:c,shadow:b,rounding:B,options:f,"data-testid":x,value:String(n),"aria-label":"Select Theme",onChange:m=>a(parseInt(String(m),10))})})});P.displayName="UserThemeSettings";const Ue={footer:"footer",glass:"footer_glass",primary:"footer_primary",secondary:"footer_secondary",tertiary:"footer_tertiary",quaternary:"footer_quaternary",clear:"footer_clear",layoutColumns:"footer_layout-columns",shadowNone:"footer_shadow-None",shadowLight:"footer_shadow-Light",shadowMedium:"footer_shadow-Medium",shadowStrong:"footer_shadow-Strong",shadowIntense:"footer_shadow-Intense",roundNone:"footer_round-None",roundSmall:"footer_round-Small",roundMedium:"footer_round-Medium",roundLarge:"footer_round-Large",attachmentStatic:"footer_attachment-static",attachmentFixed:"footer_attachment-fixed",attachmentSticky:"footer_attachment-sticky",content:"footer_content",logo:"footer_logo",left:"footer_left",links:"footer_links",link:"footer_link",social:"footer_social",themeToggle:"footer_theme-toggle",copyright:"footer_copyright",brand:"footer_brand",brandLink:"footer_brand-link",brandTitle:"footer_brand-title",brandDescription:"footer_brand-description",sections:"footer_sections",section:"footer_section",sectionTitle:"footer_section-title",sectionList:"footer_section-list",actions:"footer_actions",actionGroup:"footer_action-group",bottom:"footer_bottom",bottomCopyright:"footer_bottom-copyright",bottomEnd:"footer_bottom-end"},ue=l=>t.jsx(fe,{...l,IconButton:Re.IconButton,ThemeSelect:P,classMap:he.expandClassMap(Ue)});ue.displayName="Footer";exports.Footer=ue;exports.UserThemeSettings=P;
|
|
@@ -6,7 +6,7 @@ import { d as he, f as Le, b as Pe, a as We } from "./boreal-style-config-C_UvmP
|
|
|
6
6
|
import { c as z } from "./capitalize-D_pj4b3P.js";
|
|
7
7
|
import { I as He } from "./IconButton-BfMahcMh.js";
|
|
8
8
|
import { S as Je } from "./Select-0YF1mL1x.js";
|
|
9
|
-
import { T as Ke } from "./ThemeContext-
|
|
9
|
+
import { T as Ke } from "./ThemeContext-DFVNYGOV.js";
|
|
10
10
|
import './Footer.css';const q = (s) => s.toLowerCase().trim().replace(/\s+/g, "-"), me = ({
|
|
11
11
|
theme: s = he(),
|
|
12
12
|
glass: g = Le(),
|
package/dist/core/Footer.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Footer-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./Footer-6H7E0aW5.cjs");exports.default=e.Footer;
|
package/dist/core/Footer.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const M=require("react/jsx-runtime"),d=require("react"),N=require("./boreal-style-config-BB8MdwYx.cjs"),O=require("./colorSchemes.cjs.js"),S="boreal:selectedSchemeName",v=4.5,T=3;function R(r,e=[]){const t=[...r];for(const o of e){const n=t.findIndex(a=>a.name===o.name);n>=0?t[n]=o:t.push(o)}return t}function p(r,e){return e?r.findIndex(t=>t.name===e):-1}function $({customSchemes:r=[],useOnlyCustomSchemes:e=!1}){return e?[...r]:R([...O.defaultColorSchemes],r)}function k(r,{initialSchemeName:e,savedSchemeName:t}){const o=p(r,e),n=p(r,t),a=p(r,N.getDefaultColorSchemeName());return o!==-1?o:n!==-1?n:a!==-1?a:0}function I(r){if(!r)return null;try{return r.getItem(S)}catch{return console.error("Failed to load saved theme name"),null}}function _(r,e){if(r)try{r.setItem(S,e)}catch{console.error("Failed to save theme name")}}function E(r){const e=r.trim(),t=/^#([\da-f])([\da-f])([\da-f])$/i.exec(e);return t?`#${t[1]}${t[1]}${t[2]}${t[2]}${t[3]}${t[3]}`.toLowerCase():/^#[\da-f]{6}([\da-f]{2})?$/i.exec(e)?e.slice(0,7).toLowerCase():null}function C(r){const e=E(r)??"#000000",t=parseInt(e.slice(1,3),16)/255,o=parseInt(e.slice(3,5),16)/255,n=parseInt(e.slice(5,7),16)/255,a=Math.max(t,o,n),s=Math.min(t,o,n);let c=0,l=0;const u=(a+s)/2;if(a!==s){const i=a-s;switch(l=u>.5?i/(2-a-s):i/(a+s),a){case t:c=(o-n)/i+(o<n?6:0);break;case o:c=(n-t)/i+2;break;case n:c=(t-o)/i+4;break}c/=6}return{h:Math.round(c*360),s:Math.round(l*100),l:Math.round(u*100)}}function b(r,e,t){e/=100,t/=100;const o=s=>(s+r/30)%12,n=e*Math.min(t,1-t),a=s=>Math.round(255*(t-n*Math.max(-1,Math.min(o(s)-3,Math.min(9-o(s),1)))));return`#${[a(0),a(8),a(4)].map(s=>s.toString(16).padStart(2,"0")).join("")}`}function f(r,e){const{h:t,s:o,l:n}=C(r);return b(t,o,Math.min(100,Math.max(0,n+e)))}function w(r){const e=E(r)??"#000000",t=[1,3,5].map(o=>{const n=parseInt(e.slice(o,o+2),16)/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)});return .2126*t[0]+.7152*t[1]+.0722*t[2]}function h(r,e){const t=w(r),o=w(e),n=Math.max(t,o),a=Math.min(t,o);return(n+.05)/(a+.05)}function x(r,e,t=v){if(e&&h(r,e)>=t)return e;const o=h(r,"#000000"),n=h(r,"#ffffff");return o>=n?"#000000":"#ffffff"}function j(r,e,t){const o=f(e,t);return h(r,o)>=v?o:e}function q(r,e){const t=e==="#000000"?1:-1;for(let o=30;o>=0;o-=5){const n=f(e,o*t);if(h(r,n)>=v)return n}return e}function m(r,e,t){const o=f(r,t);if(h(o,e)>=v)return o;const{h:n,s:a,l:s}=C(r),c=e==="#ffffff";for(let l=4;l<=48;l+=4){const u=c?Math.max(0,s-l):Math.min(100,s+l),i=b(n,a,u);if(h(i,e)>=v)return i}return r}function g(r,e=14,t=14){const{h:o,s:n,l:a}=C(r),s=a>=50?Math.max(0,a-t):Math.min(100,a+e),c=n>8?Math.max(0,n-8):n,l=b(o,c,s);return h(r,l)>=T?l:x(r,void 0,T)}function J(r){const{primaryColor:e,secondaryColor:t,tertiaryColor:o,quaternaryColor:n,backgroundColor:a,forceTextColor:s}=r,c=x(a,s),l=x(e,s),u=x(t),i=x(o),y=x(n);return{"--primary-color":e,"--primary-color-light":f(e,10),"--primary-color-hover":m(e,l,-10),"--text-color-primary":l,"--text-color-primary-contrast":c,"--text-color":c,"--text-color-light":q(a,c),"--text-color-lighter":q(a,c),"--secondary-color":t,"--secondary-color-light":f(t,10),"--secondary-color-hover":m(t,u,-10),"--text-color-secondary":u,"--tertiary-color":o,"--tertiary-color-light":f(o,10),"--tertiary-color-hover":m(o,i,-10),"--text-color-tertiary":i,"--quaternary-color":n,"--quaternary-color-light":f(n,10),"--quaternary-color-hover":m(n,y,-10),"--text-color-quaternary":y,"--background-color":a,"--background-color-dark":f(a,-10),"--background-color-darker":f(a,-25),"--background-color-light":f(a,10),"--background-color-lighter":f(a,20),"--link-color":c,"--link-hover-color":j(a,c,c==="#ffffff"?-20:20),"--link-hover-color-primary":m(e,l,-10),"--link-hover-color-secondary":m(t,u,-10),"--link-hover-color-tertiary":m(o,i,-10),"--link-hover-color-quaternary":m(n,y,-10),"--focus-outline-color":c,"--divider-color":g(a),"--border-color":g(a),"--border-color-subtle":g(a,10,10),"--border-color-strong":g(a,20,20)}}function z(r,e){for(const[t,o]of Object.entries(e))r.setProperty(t,o)}function P(r,e=document){z(e.documentElement.style,J(r)),e.documentElement.dataset.borealTheme=r.name}function L({customSchemes:r=[],initialSchemeName:e,useOnlyCustomSchemes:t=!1}={}){const o=$({customSchemes:r,useOnlyCustomSchemes:t}),n=N.getDefaultColorSchemeName();return`(function(){try{var s=${JSON.stringify(o).replace(/</g,"\\u003c")};var k=${JSON.stringify(S)};var initial=${JSON.stringify(e??null)};var fallback=${JSON.stringify(n)};var saved=null;try{saved=localStorage.getItem(k)}catch(e){}var name=initial||saved||fallback;var scheme=s.find(function(x){return x.name===name})||s.find(function(x){return x.name===fallback})||s[0];if(!scheme)return;var d=document.documentElement.style;var hex=function(v){v=String(v||"").trim();var m=/^#([\\da-f])([\\da-f])([\\da-f])$/i.exec(v);if(m)return("#"+m[1]+m[1]+m[2]+m[2]+m[3]+m[3]).toLowerCase();return /^#[\\da-f]{6}([\\da-f]{2})?$/i.test(v)?v.slice(0,7).toLowerCase():"#000000"};var lum=function(v){v=hex(v);var r=[1,3,5].map(function(i){var c=parseInt(v.slice(i,i+2),16)/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*r[0]+.7152*r[1]+.0722*r[2]};var contrast=function(a,b){var x=lum(a),y=lum(b),l=Math.max(x,y),q=Math.min(x,y);return(l+.05)/(q+.05)};var text=function(bg,preferred,min){min=min||4.5;if(preferred&&contrast(bg,preferred)>=min)return preferred;return contrast(bg,"#000000")>=contrast(bg,"#ffffff")?"#000000":"#ffffff"};var set=function(n,v){d.setProperty(n,v)};var page=text(scheme.backgroundColor,scheme.forceTextColor);set("--primary-color",scheme.primaryColor);set("--secondary-color",scheme.secondaryColor);set("--tertiary-color",scheme.tertiaryColor);set("--quaternary-color",scheme.quaternaryColor);set("--background-color",scheme.backgroundColor);set("--text-color",page);set("--text-color-primary",text(scheme.primaryColor,scheme.forceTextColor));set("--text-color-primary-contrast",page);set("--text-color-secondary",text(scheme.secondaryColor));set("--text-color-tertiary",text(scheme.tertiaryColor));set("--text-color-quaternary",text(scheme.quaternaryColor));set("--link-color",page);set("--focus-outline-color",page);document.documentElement.dataset.borealTheme=scheme.name}catch(e){}})();`}const A=d.createContext(void 0),H=({children:r,customSchemes:e=[],enableThemeScript:t=!0,initialSchemeName:o,useOnlyCustomSchemes:n=!1})=>{const a=d.useMemo(()=>JSON.stringify(e??[]),[e]),s=d.useMemo(()=>{try{const i=JSON.parse(a);if(Array.isArray(i))return i}catch{console.error("Failed to parse custom schemes")}return[]},[a]),c=d.useMemo(()=>$({customSchemes:s,useOnlyCustomSchemes:n}),[s,n]),[l,u]=d.useState(()=>k(c,{initialSchemeName:o,savedSchemeName:typeof window>"u"?null:I(window.localStorage)}));return d.useEffect(()=>{const i=k(c,{initialSchemeName:o,savedSchemeName:typeof window>"u"?null:I(window.localStorage)});u(y=>o?i:c[y]?y:i)},[c,o]),d.useInsertionEffect(()=>{const i=c[l]??c[0];!i||typeof document>"u"||P(i,document)},[l,c]),d.useEffect(()=>{const i=c[l]??c[0];i&&_(typeof window>"u"?void 0:window.localStorage,i.name)},[l,c]),M.jsxs(A.Provider,{value:{selectedScheme:l,setSelectedScheme:u,schemes:c},children:[t?M.jsx("script",{dangerouslySetInnerHTML:{__html:L({customSchemes:s,initialSchemeName:o,useOnlyCustomSchemes:n})},suppressHydrationWarning:!0}):null,r]})};exports.ThemeContext=A;exports.ThemeProvider=H;exports.getThemeInitializationScript=L;
|
|
@@ -2,29 +2,29 @@ import { jsxs as L, jsx as A } from "react/jsx-runtime";
|
|
|
2
2
|
import { createContext as O, useMemo as p, useState as _, useEffect as M, useInsertionEffect as J } from "react";
|
|
3
3
|
import { g as N } from "./boreal-style-config-C_UvmPI9.js";
|
|
4
4
|
import { defaultColorSchemes as R } from "./colorSchemes.js";
|
|
5
|
-
const b = "boreal:selectedSchemeName",
|
|
6
|
-
function j(t,
|
|
7
|
-
const
|
|
8
|
-
for (const o of
|
|
9
|
-
const n =
|
|
10
|
-
n >= 0 ?
|
|
5
|
+
const b = "boreal:selectedSchemeName", x = 4.5, T = 3;
|
|
6
|
+
function j(t, e = []) {
|
|
7
|
+
const r = [...t];
|
|
8
|
+
for (const o of e) {
|
|
9
|
+
const n = r.findIndex((a) => a.name === o.name);
|
|
10
|
+
n >= 0 ? r[n] = o : r.push(o);
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return r;
|
|
13
13
|
}
|
|
14
|
-
function g(t,
|
|
15
|
-
return
|
|
14
|
+
function g(t, e) {
|
|
15
|
+
return e ? t.findIndex((r) => r.name === e) : -1;
|
|
16
16
|
}
|
|
17
17
|
function q({
|
|
18
18
|
customSchemes: t = [],
|
|
19
|
-
useOnlyCustomSchemes:
|
|
19
|
+
useOnlyCustomSchemes: e = !1
|
|
20
20
|
}) {
|
|
21
|
-
return
|
|
21
|
+
return e ? [...t] : j([...R], t);
|
|
22
22
|
}
|
|
23
23
|
function k(t, {
|
|
24
|
-
initialSchemeName:
|
|
25
|
-
savedSchemeName:
|
|
24
|
+
initialSchemeName: e,
|
|
25
|
+
savedSchemeName: r
|
|
26
26
|
}) {
|
|
27
|
-
const o = g(t,
|
|
27
|
+
const o = g(t, e), n = g(t, r), a = g(t, N());
|
|
28
28
|
return o !== -1 ? o : n !== -1 ? n : a !== -1 ? a : 0;
|
|
29
29
|
}
|
|
30
30
|
function I(t) {
|
|
@@ -35,274 +35,275 @@ function I(t) {
|
|
|
35
35
|
return console.error("Failed to load saved theme name"), null;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
function z(t,
|
|
38
|
+
function z(t, e) {
|
|
39
39
|
if (t)
|
|
40
40
|
try {
|
|
41
|
-
t.setItem(b,
|
|
41
|
+
t.setItem(b, e);
|
|
42
42
|
} catch {
|
|
43
43
|
console.error("Failed to save theme name");
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
function E(t) {
|
|
47
|
-
const
|
|
48
|
-
return
|
|
47
|
+
const e = t.trim(), r = /^#([\da-f])([\da-f])([\da-f])$/i.exec(e);
|
|
48
|
+
return r ? `#${r[1]}${r[1]}${r[2]}${r[2]}${r[3]}${r[3]}`.toLowerCase() : /^#[\da-f]{6}([\da-f]{2})?$/i.exec(e) ? e.slice(0, 7).toLowerCase() : null;
|
|
49
49
|
}
|
|
50
50
|
function S(t) {
|
|
51
|
-
const
|
|
52
|
-
let
|
|
53
|
-
const
|
|
54
|
-
if (a !==
|
|
55
|
-
const
|
|
56
|
-
switch (l =
|
|
57
|
-
case
|
|
58
|
-
|
|
51
|
+
const e = E(t) ?? "#000000", r = parseInt(e.slice(1, 3), 16) / 255, o = parseInt(e.slice(3, 5), 16) / 255, n = parseInt(e.slice(5, 7), 16) / 255, a = Math.max(r, o, n), s = Math.min(r, o, n);
|
|
52
|
+
let c = 0, l = 0;
|
|
53
|
+
const u = (a + s) / 2;
|
|
54
|
+
if (a !== s) {
|
|
55
|
+
const i = a - s;
|
|
56
|
+
switch (l = u > 0.5 ? i / (2 - a - s) : i / (a + s), a) {
|
|
57
|
+
case r:
|
|
58
|
+
c = (o - n) / i + (o < n ? 6 : 0);
|
|
59
59
|
break;
|
|
60
60
|
case o:
|
|
61
|
-
|
|
61
|
+
c = (n - r) / i + 2;
|
|
62
62
|
break;
|
|
63
63
|
case n:
|
|
64
|
-
|
|
64
|
+
c = (r - o) / i + 4;
|
|
65
65
|
break;
|
|
66
66
|
}
|
|
67
|
-
|
|
67
|
+
c /= 6;
|
|
68
68
|
}
|
|
69
69
|
return {
|
|
70
|
-
h: Math.round(
|
|
70
|
+
h: Math.round(c * 360),
|
|
71
71
|
s: Math.round(l * 100),
|
|
72
|
-
l: Math.round(
|
|
72
|
+
l: Math.round(u * 100)
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
|
-
function C(t,
|
|
76
|
-
|
|
77
|
-
const o = (
|
|
78
|
-
255 * (
|
|
75
|
+
function C(t, e, r) {
|
|
76
|
+
e /= 100, r /= 100;
|
|
77
|
+
const o = (s) => (s + t / 30) % 12, n = e * Math.min(r, 1 - r), a = (s) => Math.round(
|
|
78
|
+
255 * (r - n * Math.max(-1, Math.min(o(s) - 3, Math.min(9 - o(s), 1))))
|
|
79
79
|
);
|
|
80
|
-
return `#${[a(0), a(8), a(4)].map((
|
|
80
|
+
return `#${[a(0), a(8), a(4)].map((s) => s.toString(16).padStart(2, "0")).join("")}`;
|
|
81
81
|
}
|
|
82
|
-
function f(t,
|
|
83
|
-
const { h:
|
|
84
|
-
return C(
|
|
82
|
+
function f(t, e) {
|
|
83
|
+
const { h: r, s: o, l: n } = S(t);
|
|
84
|
+
return C(r, o, Math.min(100, Math.max(0, n + e)));
|
|
85
85
|
}
|
|
86
86
|
function w(t) {
|
|
87
|
-
const
|
|
88
|
-
const n = parseInt(
|
|
87
|
+
const e = E(t) ?? "#000000", r = [1, 3, 5].map((o) => {
|
|
88
|
+
const n = parseInt(e.slice(o, o + 2), 16) / 255;
|
|
89
89
|
return n <= 0.03928 ? n / 12.92 : Math.pow((n + 0.055) / 1.055, 2.4);
|
|
90
90
|
});
|
|
91
|
-
return 0.2126 *
|
|
91
|
+
return 0.2126 * r[0] + 0.7152 * r[1] + 0.0722 * r[2];
|
|
92
92
|
}
|
|
93
|
-
function d(t,
|
|
94
|
-
const
|
|
93
|
+
function d(t, e) {
|
|
94
|
+
const r = w(t), o = w(e), n = Math.max(r, o), a = Math.min(r, o);
|
|
95
95
|
return (n + 0.05) / (a + 0.05);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
if (
|
|
99
|
-
return
|
|
97
|
+
function y(t, e, r = x) {
|
|
98
|
+
if (e && d(t, e) >= r)
|
|
99
|
+
return e;
|
|
100
100
|
const o = d(t, "#000000"), n = d(t, "#ffffff");
|
|
101
101
|
return o >= n ? "#000000" : "#ffffff";
|
|
102
102
|
}
|
|
103
|
-
function H(t,
|
|
104
|
-
const o = f(
|
|
105
|
-
return d(t, o) >=
|
|
103
|
+
function H(t, e, r) {
|
|
104
|
+
const o = f(e, r);
|
|
105
|
+
return d(t, o) >= x ? o : e;
|
|
106
106
|
}
|
|
107
|
-
function $(t,
|
|
108
|
-
const
|
|
107
|
+
function $(t, e) {
|
|
108
|
+
const r = e === "#000000" ? 1 : -1;
|
|
109
109
|
for (let o = 30; o >= 0; o -= 5) {
|
|
110
|
-
const n = f(
|
|
111
|
-
if (d(t, n) >=
|
|
110
|
+
const n = f(e, o * r);
|
|
111
|
+
if (d(t, n) >= x)
|
|
112
112
|
return n;
|
|
113
113
|
}
|
|
114
|
-
return
|
|
114
|
+
return e;
|
|
115
115
|
}
|
|
116
|
-
function m(t,
|
|
117
|
-
const o = f(t,
|
|
118
|
-
if (d(o,
|
|
116
|
+
function m(t, e, r) {
|
|
117
|
+
const o = f(t, r);
|
|
118
|
+
if (d(o, e) >= x)
|
|
119
119
|
return o;
|
|
120
|
-
const { h: n, s: a, l:
|
|
120
|
+
const { h: n, s: a, l: s } = S(t), c = e === "#ffffff";
|
|
121
121
|
for (let l = 4; l <= 48; l += 4) {
|
|
122
|
-
const
|
|
123
|
-
if (d(
|
|
124
|
-
return
|
|
122
|
+
const u = c ? Math.max(0, s - l) : Math.min(100, s + l), i = C(n, a, u);
|
|
123
|
+
if (d(i, e) >= x)
|
|
124
|
+
return i;
|
|
125
125
|
}
|
|
126
126
|
return t;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
const { h: o, s: n, l: a } = S(t),
|
|
130
|
-
return d(t, l) >= T ? l :
|
|
128
|
+
function v(t, e = 14, r = 14) {
|
|
129
|
+
const { h: o, s: n, l: a } = S(t), s = a >= 50 ? Math.max(0, a - r) : Math.min(100, a + e), c = n > 8 ? Math.max(0, n - 8) : n, l = C(o, c, s);
|
|
130
|
+
return d(t, l) >= T ? l : y(t, void 0, T);
|
|
131
131
|
}
|
|
132
132
|
function P(t) {
|
|
133
133
|
const {
|
|
134
|
-
primaryColor:
|
|
135
|
-
secondaryColor:
|
|
134
|
+
primaryColor: e,
|
|
135
|
+
secondaryColor: r,
|
|
136
136
|
tertiaryColor: o,
|
|
137
137
|
quaternaryColor: n,
|
|
138
138
|
backgroundColor: a,
|
|
139
|
-
forceTextColor:
|
|
140
|
-
} = t,
|
|
139
|
+
forceTextColor: s
|
|
140
|
+
} = t, c = y(a, s), l = y(e, s), u = y(r), i = y(o), h = y(n);
|
|
141
141
|
return {
|
|
142
|
-
"--primary-color":
|
|
143
|
-
"--primary-color-light": f(
|
|
142
|
+
"--primary-color": e,
|
|
143
|
+
"--primary-color-light": f(e, 10),
|
|
144
144
|
"--primary-color-hover": m(
|
|
145
|
-
|
|
145
|
+
e,
|
|
146
146
|
l,
|
|
147
147
|
-10
|
|
148
148
|
),
|
|
149
149
|
"--text-color-primary": l,
|
|
150
|
-
"--text-color-primary-contrast":
|
|
151
|
-
"--text-color":
|
|
152
|
-
"--text-color-light": $(a,
|
|
150
|
+
"--text-color-primary-contrast": c,
|
|
151
|
+
"--text-color": c,
|
|
152
|
+
"--text-color-light": $(a, c),
|
|
153
153
|
"--text-color-lighter": $(
|
|
154
154
|
a,
|
|
155
|
-
|
|
155
|
+
c
|
|
156
156
|
),
|
|
157
|
-
"--secondary-color":
|
|
158
|
-
"--secondary-color-light": f(
|
|
157
|
+
"--secondary-color": r,
|
|
158
|
+
"--secondary-color-light": f(r, 10),
|
|
159
159
|
"--secondary-color-hover": m(
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
r,
|
|
161
|
+
u,
|
|
162
162
|
-10
|
|
163
163
|
),
|
|
164
|
-
"--text-color-secondary":
|
|
164
|
+
"--text-color-secondary": u,
|
|
165
165
|
"--tertiary-color": o,
|
|
166
166
|
"--tertiary-color-light": f(o, 10),
|
|
167
167
|
"--tertiary-color-hover": m(
|
|
168
168
|
o,
|
|
169
|
-
|
|
169
|
+
i,
|
|
170
170
|
-10
|
|
171
171
|
),
|
|
172
|
-
"--text-color-tertiary":
|
|
172
|
+
"--text-color-tertiary": i,
|
|
173
173
|
"--quaternary-color": n,
|
|
174
174
|
"--quaternary-color-light": f(n, 10),
|
|
175
175
|
"--quaternary-color-hover": m(
|
|
176
176
|
n,
|
|
177
|
-
|
|
177
|
+
h,
|
|
178
178
|
-10
|
|
179
179
|
),
|
|
180
|
-
"--text-color-quaternary":
|
|
180
|
+
"--text-color-quaternary": h,
|
|
181
181
|
"--background-color": a,
|
|
182
182
|
"--background-color-dark": f(a, -10),
|
|
183
183
|
"--background-color-darker": f(a, -25),
|
|
184
184
|
"--background-color-light": f(a, 10),
|
|
185
185
|
"--background-color-lighter": f(a, 20),
|
|
186
|
-
"--link-color":
|
|
186
|
+
"--link-color": c,
|
|
187
187
|
"--link-hover-color": H(
|
|
188
188
|
a,
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
c,
|
|
190
|
+
c === "#ffffff" ? -20 : 20
|
|
191
191
|
),
|
|
192
192
|
"--link-hover-color-primary": m(
|
|
193
|
-
|
|
193
|
+
e,
|
|
194
194
|
l,
|
|
195
195
|
-10
|
|
196
196
|
),
|
|
197
197
|
"--link-hover-color-secondary": m(
|
|
198
|
-
|
|
199
|
-
|
|
198
|
+
r,
|
|
199
|
+
u,
|
|
200
200
|
-10
|
|
201
201
|
),
|
|
202
202
|
"--link-hover-color-tertiary": m(
|
|
203
203
|
o,
|
|
204
|
-
|
|
204
|
+
i,
|
|
205
205
|
-10
|
|
206
206
|
),
|
|
207
207
|
"--link-hover-color-quaternary": m(
|
|
208
208
|
n,
|
|
209
|
-
|
|
209
|
+
h,
|
|
210
210
|
-10
|
|
211
211
|
),
|
|
212
|
-
"--focus-outline-color":
|
|
213
|
-
"--divider-color":
|
|
214
|
-
"--border-color":
|
|
215
|
-
"--border-color-subtle":
|
|
216
|
-
"--border-color-strong":
|
|
212
|
+
"--focus-outline-color": c,
|
|
213
|
+
"--divider-color": v(a),
|
|
214
|
+
"--border-color": v(a),
|
|
215
|
+
"--border-color-subtle": v(a, 10, 10),
|
|
216
|
+
"--border-color-strong": v(a, 20, 20)
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
-
function F(t,
|
|
220
|
-
for (const [
|
|
221
|
-
t.setProperty(
|
|
219
|
+
function F(t, e) {
|
|
220
|
+
for (const [r, o] of Object.entries(e))
|
|
221
|
+
t.setProperty(r, o);
|
|
222
222
|
}
|
|
223
|
-
function V(t,
|
|
223
|
+
function V(t, e = document) {
|
|
224
224
|
F(
|
|
225
|
-
|
|
225
|
+
e.documentElement.style,
|
|
226
226
|
P(t)
|
|
227
|
-
),
|
|
227
|
+
), e.documentElement.dataset.borealTheme = t.name;
|
|
228
228
|
}
|
|
229
229
|
function B({
|
|
230
230
|
customSchemes: t = [],
|
|
231
|
-
initialSchemeName:
|
|
232
|
-
useOnlyCustomSchemes:
|
|
231
|
+
initialSchemeName: e,
|
|
232
|
+
useOnlyCustomSchemes: r = !1
|
|
233
233
|
} = {}) {
|
|
234
|
-
const o = q({ customSchemes: t, useOnlyCustomSchemes:
|
|
235
|
-
return `(function(){try{var s=${JSON.stringify(o).replace(/</g, "\\u003c")};var k=${JSON.stringify(b)};var initial=${JSON.stringify(
|
|
234
|
+
const o = q({ customSchemes: t, useOnlyCustomSchemes: r }), n = N();
|
|
235
|
+
return `(function(){try{var s=${JSON.stringify(o).replace(/</g, "\\u003c")};var k=${JSON.stringify(b)};var initial=${JSON.stringify(e ?? null)};var fallback=${JSON.stringify(n)};var saved=null;try{saved=localStorage.getItem(k)}catch(e){}var name=initial||saved||fallback;var scheme=s.find(function(x){return x.name===name})||s.find(function(x){return x.name===fallback})||s[0];if(!scheme)return;var d=document.documentElement.style;var hex=function(v){v=String(v||"").trim();var m=/^#([\\da-f])([\\da-f])([\\da-f])$/i.exec(v);if(m)return("#"+m[1]+m[1]+m[2]+m[2]+m[3]+m[3]).toLowerCase();return /^#[\\da-f]{6}([\\da-f]{2})?$/i.test(v)?v.slice(0,7).toLowerCase():"#000000"};var lum=function(v){v=hex(v);var r=[1,3,5].map(function(i){var c=parseInt(v.slice(i,i+2),16)/255;return c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4)});return .2126*r[0]+.7152*r[1]+.0722*r[2]};var contrast=function(a,b){var x=lum(a),y=lum(b),l=Math.max(x,y),q=Math.min(x,y);return(l+.05)/(q+.05)};var text=function(bg,preferred,min){min=min||4.5;if(preferred&&contrast(bg,preferred)>=min)return preferred;return contrast(bg,"#000000")>=contrast(bg,"#ffffff")?"#000000":"#ffffff"};var set=function(n,v){d.setProperty(n,v)};var page=text(scheme.backgroundColor,scheme.forceTextColor);set("--primary-color",scheme.primaryColor);set("--secondary-color",scheme.secondaryColor);set("--tertiary-color",scheme.tertiaryColor);set("--quaternary-color",scheme.quaternaryColor);set("--background-color",scheme.backgroundColor);set("--text-color",page);set("--text-color-primary",text(scheme.primaryColor,scheme.forceTextColor));set("--text-color-primary-contrast",page);set("--text-color-secondary",text(scheme.secondaryColor));set("--text-color-tertiary",text(scheme.tertiaryColor));set("--text-color-quaternary",text(scheme.quaternaryColor));set("--link-color",page);set("--focus-outline-color",page);document.documentElement.dataset.borealTheme=scheme.name}catch(e){}})();`;
|
|
236
236
|
}
|
|
237
237
|
const D = O(
|
|
238
238
|
void 0
|
|
239
239
|
), X = ({
|
|
240
240
|
children: t,
|
|
241
|
-
customSchemes:
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
customSchemes: e = [],
|
|
242
|
+
enableThemeScript: r = !0,
|
|
243
|
+
initialSchemeName: o,
|
|
244
|
+
useOnlyCustomSchemes: n = !1
|
|
244
245
|
}) => {
|
|
245
|
-
const
|
|
246
|
-
() => JSON.stringify(
|
|
247
|
-
[
|
|
248
|
-
),
|
|
246
|
+
const a = p(
|
|
247
|
+
() => JSON.stringify(e ?? []),
|
|
248
|
+
[e]
|
|
249
|
+
), s = p(() => {
|
|
249
250
|
try {
|
|
250
|
-
const i = JSON.parse(
|
|
251
|
+
const i = JSON.parse(a);
|
|
251
252
|
if (Array.isArray(i))
|
|
252
253
|
return i;
|
|
253
254
|
} catch {
|
|
254
255
|
console.error("Failed to parse custom schemes");
|
|
255
256
|
}
|
|
256
257
|
return [];
|
|
257
|
-
}, [
|
|
258
|
+
}, [a]), c = p(
|
|
258
259
|
() => q({
|
|
259
|
-
customSchemes:
|
|
260
|
-
useOnlyCustomSchemes:
|
|
260
|
+
customSchemes: s,
|
|
261
|
+
useOnlyCustomSchemes: n
|
|
261
262
|
}),
|
|
262
|
-
[
|
|
263
|
-
), [
|
|
263
|
+
[s, n]
|
|
264
|
+
), [l, u] = _(
|
|
264
265
|
() => k(c, {
|
|
265
|
-
initialSchemeName:
|
|
266
|
+
initialSchemeName: o,
|
|
266
267
|
savedSchemeName: typeof window > "u" ? null : I(window.localStorage)
|
|
267
268
|
})
|
|
268
269
|
);
|
|
269
270
|
return M(() => {
|
|
270
271
|
const i = k(c, {
|
|
271
|
-
initialSchemeName:
|
|
272
|
+
initialSchemeName: o,
|
|
272
273
|
savedSchemeName: typeof window > "u" ? null : I(window.localStorage)
|
|
273
274
|
});
|
|
274
|
-
|
|
275
|
-
}, [c,
|
|
276
|
-
const i = c[
|
|
275
|
+
u((h) => o ? i : c[h] ? h : i);
|
|
276
|
+
}, [c, o]), J(() => {
|
|
277
|
+
const i = c[l] ?? c[0];
|
|
277
278
|
!i || typeof document > "u" || V(i, document);
|
|
278
|
-
}, [
|
|
279
|
-
const i = c[
|
|
279
|
+
}, [l, c]), M(() => {
|
|
280
|
+
const i = c[l] ?? c[0];
|
|
280
281
|
i && z(
|
|
281
282
|
typeof window > "u" ? void 0 : window.localStorage,
|
|
282
283
|
i.name
|
|
283
284
|
);
|
|
284
|
-
}, [
|
|
285
|
+
}, [l, c]), /* @__PURE__ */ L(
|
|
285
286
|
D.Provider,
|
|
286
287
|
{
|
|
287
288
|
value: {
|
|
288
|
-
selectedScheme:
|
|
289
|
-
setSelectedScheme:
|
|
289
|
+
selectedScheme: l,
|
|
290
|
+
setSelectedScheme: u,
|
|
290
291
|
schemes: c
|
|
291
292
|
},
|
|
292
293
|
children: [
|
|
293
|
-
/* @__PURE__ */ A(
|
|
294
|
+
r ? /* @__PURE__ */ A(
|
|
294
295
|
"script",
|
|
295
296
|
{
|
|
296
297
|
dangerouslySetInnerHTML: {
|
|
297
298
|
__html: B({
|
|
298
|
-
customSchemes:
|
|
299
|
-
initialSchemeName:
|
|
300
|
-
useOnlyCustomSchemes:
|
|
299
|
+
customSchemes: s,
|
|
300
|
+
initialSchemeName: o,
|
|
301
|
+
useOnlyCustomSchemes: n
|
|
301
302
|
})
|
|
302
303
|
},
|
|
303
304
|
suppressHydrationWarning: !0
|
|
304
305
|
}
|
|
305
|
-
),
|
|
306
|
+
) : null,
|
|
306
307
|
t
|
|
307
308
|
]
|
|
308
309
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeContext-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ThemeContext-BosEFe2d.cjs");exports.ThemeContext=e.ThemeContext;exports.ThemeProvider=e.ThemeProvider;exports.getThemeInitializationScript=e.getThemeInitializationScript;
|