tempest-react-sdk 0.74.0 → 0.76.0
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 +3 -1
- package/dist/br/BrazilMap.module.cjs.map +1 -1
- package/dist/br/BrazilMap.module.js.map +1 -1
- package/dist/br/MunicipalitySearch.cjs +1 -1
- package/dist/br/MunicipalitySearch.cjs.map +1 -1
- package/dist/br/MunicipalitySearch.js +66 -48
- package/dist/br/MunicipalitySearch.js.map +1 -1
- package/dist/br/MunicipalitySearch.module.cjs +1 -1
- package/dist/br/MunicipalitySearch.module.cjs.map +1 -1
- package/dist/br/MunicipalitySearch.module.js +4 -3
- package/dist/br/MunicipalitySearch.module.js.map +1 -1
- package/dist/br.d.ts +12 -0
- package/dist/components/AIChat/AIChat.module.cjs.map +1 -1
- package/dist/components/AIChat/AIChat.module.js.map +1 -1
- package/dist/components/AppBar/AppBar.cjs +1 -1
- package/dist/components/AppBar/AppBar.cjs.map +1 -1
- package/dist/components/AppBar/AppBar.js +1 -0
- package/dist/components/AppBar/AppBar.js.map +1 -1
- package/dist/components/AppBar/AppBar.module.cjs +1 -1
- package/dist/components/AppBar/AppBar.module.cjs.map +1 -1
- package/dist/components/AppBar/AppBar.module.js +12 -11
- package/dist/components/AppBar/AppBar.module.js.map +1 -1
- package/dist/components/Button/Button.module.cjs.map +1 -1
- package/dist/components/Button/Button.module.js.map +1 -1
- package/dist/components/Button/ButtonContent.cjs.map +1 -1
- package/dist/components/Button/ButtonContent.js.map +1 -1
- package/dist/components/Carousel/Carousel.module.cjs.map +1 -1
- package/dist/components/Carousel/Carousel.module.js.map +1 -1
- package/dist/components/Chat/Chat.module.cjs.map +1 -1
- package/dist/components/Chat/Chat.module.js.map +1 -1
- package/dist/components/Combobox/Combobox.cjs +1 -1
- package/dist/components/Combobox/Combobox.cjs.map +1 -1
- package/dist/components/Combobox/Combobox.js +18 -23
- package/dist/components/Combobox/Combobox.js.map +1 -1
- package/dist/components/Combobox/use-listbox-dismiss.cjs +2 -0
- package/dist/components/Combobox/use-listbox-dismiss.cjs.map +1 -0
- package/dist/components/Combobox/use-listbox-dismiss.js +34 -0
- package/dist/components/Combobox/use-listbox-dismiss.js.map +1 -0
- package/dist/components/Dropzone/Dropzone.module.cjs.map +1 -1
- package/dist/components/Dropzone/Dropzone.module.js.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.cjs.map +1 -1
- package/dist/components/FilterBar/FilterBar.module.js.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.cjs.map +1 -1
- package/dist/components/FloatingActionButton/FloatingActionButton.module.js.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.cjs.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.module.js.map +1 -1
- package/dist/components/ListTile/ListTile.module.cjs.map +1 -1
- package/dist/components/ListTile/ListTile.module.js.map +1 -1
- package/dist/components/Markdown/Markdown.module.cjs.map +1 -1
- package/dist/components/Markdown/Markdown.module.js.map +1 -1
- package/dist/components/Menubar/Menubar.module.cjs.map +1 -1
- package/dist/components/Menubar/Menubar.module.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.cjs +1 -1
- package/dist/components/MultiSelect/MultiSelect.cjs.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.js +55 -54
- package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/Navbar/Navbar.cjs +1 -1
- package/dist/components/Navbar/Navbar.cjs.map +1 -1
- package/dist/components/Navbar/Navbar.js +1 -0
- package/dist/components/Navbar/Navbar.js.map +1 -1
- package/dist/components/Navbar/Navbar.module.cjs +1 -1
- package/dist/components/Navbar/Navbar.module.cjs.map +1 -1
- package/dist/components/Navbar/Navbar.module.js +9 -8
- package/dist/components/Navbar/Navbar.module.js.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.cjs.map +1 -1
- package/dist/components/NavigationMenu/NavigationMenu.module.js.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.cjs.map +1 -1
- package/dist/components/NavigationRail/NavigationRail.module.js.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.module.cjs.map +1 -1
- package/dist/components/NotificationCenter/NotificationCenter.module.js.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.module.cjs.map +1 -1
- package/dist/components/PasswordInput/PasswordInput.module.js.map +1 -1
- package/dist/components/PinInput/PinInput.module.cjs.map +1 -1
- package/dist/components/PinInput/PinInput.module.js.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs +1 -1
- package/dist/components/SectionHeader/SectionHeader.cjs.map +1 -1
- package/dist/components/SectionHeader/SectionHeader.js +33 -25
- package/dist/components/SectionHeader/SectionHeader.js.map +1 -1
- package/dist/components/Tour/Tour.module.cjs.map +1 -1
- package/dist/components/Tour/Tour.module.js.map +1 -1
- package/dist/components/Transfer/Transfer.module.cjs.map +1 -1
- package/dist/components/Transfer/Transfer.module.js.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.cjs.map +1 -1
- package/dist/components/VirtualTable/VirtualTable.module.js.map +1 -1
- package/dist/geo/TrajectoryMap.module.cjs.map +1 -1
- package/dist/geo/TrajectoryMap.module.js.map +1 -1
- package/dist/icons/IconPicker.module.cjs.map +1 -1
- package/dist/icons/IconPicker.module.js.map +1 -1
- package/dist/neural.cjs +2 -0
- package/dist/neural.cjs.map +1 -0
- package/dist/neural.d.ts +110 -0
- package/dist/neural.js +48 -0
- package/dist/neural.js.map +1 -0
- package/dist/styles/actions.css +2 -2
- package/dist/styles/br.css +3 -3
- package/dist/styles/chat.css +5 -5
- package/dist/styles/component/AIChat.css +3 -3
- package/dist/styles/component/AppBar.css +1 -0
- package/dist/styles/component/BrazilMap.css +2 -2
- package/dist/styles/component/Button.css +1 -1
- package/dist/styles/component/Carousel.css +3 -3
- package/dist/styles/component/Chat.css +2 -2
- package/dist/styles/component/Dropzone.css +2 -1
- package/dist/styles/component/FilterBar.css +2 -2
- package/dist/styles/component/FloatingActionButton.css +1 -1
- package/dist/styles/component/IconPicker.css +1 -1
- package/dist/styles/component/ImageCropper.css +2 -2
- package/dist/styles/component/ListTile.css +1 -1
- package/dist/styles/component/Markdown.css +1 -1
- package/dist/styles/component/Menubar.css +1 -1
- package/dist/styles/component/MunicipalitySearch.css +1 -1
- package/dist/styles/component/Navbar.css +1 -0
- package/dist/styles/component/NavigationMenu.css +1 -1
- package/dist/styles/component/NavigationRail.css +1 -1
- package/dist/styles/component/NotificationCenter.css +3 -3
- package/dist/styles/component/PasswordInput.css +1 -1
- package/dist/styles/component/PinInput.css +1 -1
- package/dist/styles/component/Tour.css +2 -2
- package/dist/styles/component/TrajectoryMap.css +1 -1
- package/dist/styles/component/Transfer.css +2 -2
- package/dist/styles/component/VirtualTable.css +2 -2
- package/dist/styles/data.css +10 -10
- package/dist/styles/feedback.css +3 -3
- package/dist/styles/forms.css +6 -5
- package/dist/styles/geo.css +1 -1
- package/dist/styles/icons.css +1 -1
- package/dist/styles/inverse.css +225 -0
- package/dist/styles/navigation.css +8 -6
- package/dist/styles.css +1 -1
- package/dist/tempest-react-sdk.d.ts +130 -17
- package/dist/theme/create-theme.cjs +1 -1
- package/dist/theme/create-theme.cjs.map +1 -1
- package/dist/theme/create-theme.js +6 -1
- package/dist/theme/create-theme.js.map +1 -1
- package/dist/theme/inverse-render.cjs +1 -1
- package/dist/theme/inverse-render.cjs.map +1 -1
- package/dist/theme/inverse-render.js +1 -1
- package/dist/theme/inverse-render.js.map +1 -1
- package/dist/theme/inverse-restore.cjs +5 -0
- package/dist/theme/inverse-restore.cjs.map +1 -0
- package/dist/theme/inverse-restore.js +30 -0
- package/dist/theme/inverse-restore.js.map +1 -0
- package/dist/theme/inverse-surface.cjs +1 -1
- package/dist/theme/inverse-surface.cjs.map +1 -1
- package/dist/theme/inverse-surface.js +69 -72
- package/dist/theme/inverse-surface.js.map +1 -1
- package/package.json +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PasswordInput.module.js","names":[],"sources":["../../../src/components/PasswordInput/PasswordInput.module.css"],"sourcesContent":[".wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n font-family: var(--tempest-font-sans);\n width: 100%;\n}\n\n.label {\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n color: var(--tempest-text);\n}\n\n.field {\n position: relative;\n display: flex;\n align-items: center;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n transition: border-color var(--tempest-duration-fast, 120ms);\n}\n\n.field:focus-within {\n border-color: var(--tempest-primary);\n box-shadow: 0 0 0 var(--tempest-focus-ring-width, 2px)\n var(--tempest-focus-ring-color,
|
|
1
|
+
{"version":3,"file":"PasswordInput.module.js","names":[],"sources":["../../../src/components/PasswordInput/PasswordInput.module.css"],"sourcesContent":[".wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n font-family: var(--tempest-font-sans);\n width: 100%;\n}\n\n.label {\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n color: var(--tempest-text);\n}\n\n.field {\n position: relative;\n display: flex;\n align-items: center;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n transition: border-color var(--tempest-duration-fast, 120ms);\n}\n\n.field:focus-within {\n border-color: var(--tempest-primary);\n box-shadow: 0 0 0 var(--tempest-focus-ring-width, 2px)\n var(--tempest-focus-ring-color, currentColor);\n}\n\n.input {\n flex: 1 1 auto;\n border: 0;\n background: transparent;\n outline: 0;\n color: var(--tempest-text);\n font: inherit;\n font-family: var(--tempest-font-sans);\n}\n\n.sm .input {\n padding: 6px 8px;\n font-size: var(--tempest-text-sm);\n}\n\n.md .input {\n padding: 8px 12px;\n font-size: var(--tempest-text-md);\n}\n\n.lg .input {\n padding: 10px 14px;\n font-size: var(--tempest-text-lg);\n}\n\n.toggle {\n flex: 0 0 auto;\n background: none;\n border: 0;\n cursor: pointer;\n padding: 0 12px;\n font-size: 16px;\n color: var(--tempest-text-muted);\n}\n\n.toggle:hover {\n color: var(--tempest-text);\n}\n\n.error .field {\n border-color: var(--tempest-danger-border, var(--tempest-danger));\n}\n\n.helper {\n font-size: var(--tempest-text-xs);\n color: var(--tempest-text-muted);\n}\n\n.errorText {\n font-size: var(--tempest-text-xs);\n color: var(--tempest-danger-fg, var(--tempest-danger));\n}\n\n.strength {\n display: flex;\n align-items: center;\n gap: var(--tempest-space-2);\n font-size: var(--tempest-text-xs);\n}\n\n.strengthBar {\n flex: 1 1 auto;\n height: 4px;\n background: var(--tempest-border);\n border-radius: var(--tempest-radius-full);\n overflow: hidden;\n}\n\n.strengthBar > span {\n display: block;\n height: 100%;\n transition: width var(--tempest-duration-base, 200ms);\n}\n\n.strengthLabel {\n color: var(--tempest-text-muted);\n flex: 0 0 auto;\n}\n\n.level0 .strengthBar > span,\n.level1 .strengthBar > span {\n background: var(--tempest-danger-solid, var(--tempest-danger));\n}\n\n.level2 .strengthBar > span {\n background: var(--tempest-warning-solid, var(--tempest-warning));\n}\n\n.level3 .strengthBar > span,\n.level4 .strengthBar > span {\n background: var(--tempest-success-solid, var(--tempest-success));\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinInput.module.cjs","names":[],"sources":["../../../src/components/PinInput/PinInput.module.css"],"sourcesContent":[".wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n font-family: var(--tempest-font-sans);\n}\n\n.label {\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n color: var(--tempest-text);\n}\n\n.cells {\n display: flex;\n gap: var(--tempest-space-2);\n}\n\n.cell {\n flex: 0 0 auto;\n text-align: center;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n font-family: var(--tempest-font-mono, var(--tempest-font-sans));\n transition: border-color var(--tempest-duration-fast, 120ms);\n}\n\n.cells.sm .cell {\n width: 32px;\n height: 36px;\n font-size: var(--tempest-text-md);\n}\n\n.cells.md .cell {\n width: 44px;\n height: 52px;\n font-size: var(--tempest-text-lg);\n}\n\n.cells.lg .cell {\n width: 56px;\n height: 64px;\n font-size: var(--tempest-text-xl);\n}\n\n.cell:focus {\n outline: none;\n border-color: var(--tempest-primary);\n box-shadow: 0 0 0 var(--tempest-focus-ring-width, 2px)\n var(--tempest-focus-ring-color,
|
|
1
|
+
{"version":3,"file":"PinInput.module.cjs","names":[],"sources":["../../../src/components/PinInput/PinInput.module.css"],"sourcesContent":[".wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n font-family: var(--tempest-font-sans);\n}\n\n.label {\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n color: var(--tempest-text);\n}\n\n.cells {\n display: flex;\n gap: var(--tempest-space-2);\n}\n\n.cell {\n flex: 0 0 auto;\n text-align: center;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n font-family: var(--tempest-font-mono, var(--tempest-font-sans));\n transition: border-color var(--tempest-duration-fast, 120ms);\n}\n\n.cells.sm .cell {\n width: 32px;\n height: 36px;\n font-size: var(--tempest-text-md);\n}\n\n.cells.md .cell {\n width: 44px;\n height: 52px;\n font-size: var(--tempest-text-lg);\n}\n\n.cells.lg .cell {\n width: 56px;\n height: 64px;\n font-size: var(--tempest-text-xl);\n}\n\n.cell:focus {\n outline: none;\n border-color: var(--tempest-primary);\n box-shadow: 0 0 0 var(--tempest-focus-ring-width, 2px)\n var(--tempest-focus-ring-color, currentColor);\n}\n\n.cell:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.error .cell {\n border-color: var(--tempest-danger-border, var(--tempest-danger));\n}\n\n.helper {\n font-size: var(--tempest-text-xs);\n color: var(--tempest-text-muted);\n}\n\n.errorText {\n font-size: var(--tempest-text-xs);\n color: var(--tempest-danger-fg, var(--tempest-danger));\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PinInput.module.js","names":[],"sources":["../../../src/components/PinInput/PinInput.module.css"],"sourcesContent":[".wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n font-family: var(--tempest-font-sans);\n}\n\n.label {\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n color: var(--tempest-text);\n}\n\n.cells {\n display: flex;\n gap: var(--tempest-space-2);\n}\n\n.cell {\n flex: 0 0 auto;\n text-align: center;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n font-family: var(--tempest-font-mono, var(--tempest-font-sans));\n transition: border-color var(--tempest-duration-fast, 120ms);\n}\n\n.cells.sm .cell {\n width: 32px;\n height: 36px;\n font-size: var(--tempest-text-md);\n}\n\n.cells.md .cell {\n width: 44px;\n height: 52px;\n font-size: var(--tempest-text-lg);\n}\n\n.cells.lg .cell {\n width: 56px;\n height: 64px;\n font-size: var(--tempest-text-xl);\n}\n\n.cell:focus {\n outline: none;\n border-color: var(--tempest-primary);\n box-shadow: 0 0 0 var(--tempest-focus-ring-width, 2px)\n var(--tempest-focus-ring-color,
|
|
1
|
+
{"version":3,"file":"PinInput.module.js","names":[],"sources":["../../../src/components/PinInput/PinInput.module.css"],"sourcesContent":[".wrapper {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n font-family: var(--tempest-font-sans);\n}\n\n.label {\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n color: var(--tempest-text);\n}\n\n.cells {\n display: flex;\n gap: var(--tempest-space-2);\n}\n\n.cell {\n flex: 0 0 auto;\n text-align: center;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n font-family: var(--tempest-font-mono, var(--tempest-font-sans));\n transition: border-color var(--tempest-duration-fast, 120ms);\n}\n\n.cells.sm .cell {\n width: 32px;\n height: 36px;\n font-size: var(--tempest-text-md);\n}\n\n.cells.md .cell {\n width: 44px;\n height: 52px;\n font-size: var(--tempest-text-lg);\n}\n\n.cells.lg .cell {\n width: 56px;\n height: 64px;\n font-size: var(--tempest-text-xl);\n}\n\n.cell:focus {\n outline: none;\n border-color: var(--tempest-primary);\n box-shadow: 0 0 0 var(--tempest-focus-ring-width, 2px)\n var(--tempest-focus-ring-color, currentColor);\n}\n\n.cell:disabled {\n opacity: 0.4;\n cursor: not-allowed;\n}\n\n.error .cell {\n border-color: var(--tempest-danger-border, var(--tempest-danger));\n}\n\n.helper {\n font-size: var(--tempest-text-xs);\n color: var(--tempest-text-muted);\n}\n\n.errorText {\n font-size: var(--tempest-text-xs);\n color: var(--tempest-danger-fg, var(--tempest-danger));\n}\n"],"mappings":";"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=require("../../utils/cn.cjs"),t=require("./SectionHeader.module.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.createContext)(null);function a({title:a,eyebrow:o,description:s,actions:c,level:l=2,align:u=`start`,id:d,className:f,...p}){let m=(0,n.useId)(),h=
|
|
1
|
+
const e=require("../../utils/cn.cjs"),t=require("./SectionHeader.module.cjs");let n=require("react"),r=require("react/jsx-runtime");var i=(0,n.createContext)(null);function a({title:a,eyebrow:o,description:s,actions:c,level:l=2,align:u=`start`,id:d,className:f,...p}){let m=(0,n.useId)(),h=(0,n.useContext)(i),g=!!a,_=h!==null&&g&&h.claim(m),v=d??(_?h.sectionId:m),y=h?.register;if((0,n.useLayoutEffect)(()=>{if(y&&g)return y(v)},[y,g,v]),!a&&!o&&!s&&!c)return null;let b=`h${l}`;return(0,r.jsxs)(`header`,{className:e.cn(t.default.header,u===`center`&&t.default.center,f),...p,children:[(0,r.jsxs)(`div`,{className:t.default.headerText,children:[o&&(0,r.jsx)(`div`,{className:t.default.eyebrow,children:o}),a&&(0,r.jsx)(b,{id:v,className:t.default.title,children:a}),s&&(0,r.jsx)(`p`,{className:t.default.description,children:s})]}),c&&(0,r.jsx)(`div`,{className:t.default.actions,children:c})]})}function o({children:e,tone:t,...a}){let o=(0,n.useId)(),s=(0,n.useRef)(null),[c,l]=(0,n.useState)(null),u=(0,n.useMemo)(()=>({sectionId:o,claim:e=>(s.current??=e,s.current===e),register:e=>(l(t=>[...t??[],e]),()=>l(t=>(t??[]).filter(t=>t!==e)))}),[o]);(0,n.useLayoutEffect)(()=>{l(e=>e??[])},[]);let d=a[`aria-labelledby`]!==void 0||a[`aria-label`]!==void 0,f=c===null?o:c[0];return(0,r.jsx)(i.Provider,{value:u,children:(0,r.jsx)(`section`,{"aria-labelledby":d?void 0:f,"data-tempest-tone":t,...a,children:e})})}exports.Section=o,exports.SectionHeader=a;
|
|
2
2
|
//# sourceMappingURL=SectionHeader.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.cjs","names":[],"sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"sourcesContent":["/**\n * @tempest-limits props-count — a heading block is slots (eyebrow, title, description,\n * actions) plus the three switches that decide its semantics: level, align and the\n * heading id. Splitting them would leave the id away from the heading it names.\n */\nimport { createContext, useContext, useId, useLayoutEffect, useMemo, useState } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport styles from \"./SectionHeader.module.css\";\n\nexport type SectionHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type SectionHeaderAlign = \"start\" | \"center\";\n\n/**\n * Lets the nearest `<Section>` learn the id of the heading that names it.\n *\n * `register` returns the matching unregister so a heading that unmounts (or\n * changes id) releases the section instead of leaving `aria-labelledby` pointing\n * at an element that no longer exists.\n */\ninterface SectionContextValue {\n register: (headingId: string) => () => void;\n}\n\nconst SectionContext = createContext<SectionContextValue | null>(null);\n\nexport interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLElement>, \"title\" | \"id\"> {\n /** Heading text, rendered as `<h{level}>`. */\n title?: ReactNode;\n /** Short label above the title (category, breadcrumbs). */\n eyebrow?: ReactNode;\n /** Supporting text rendered below the title. */\n description?: ReactNode;\n /** Trailing slot for buttons or menus. */\n actions?: ReactNode;\n /** Heading level — semantics only, the look does not change with it. Default `2`. */\n level?: SectionHeaderLevel;\n /** Horizontal alignment of the text block. Default `\"start\"`. */\n align?: SectionHeaderAlign;\n /** Id of the heading element. Generated with `useId` when absent. */\n id?: string;\n}\n\n/**\n * Header of a page or of one section of it: eyebrow, title, description and\n * actions, with the same look `Page` uses for its own header.\n *\n * The heading level is a prop because one page needs one `<h1>` and many\n * `<h2>` that look alike; the visual stays the same at every level so the\n * outline is picked by meaning, not by size. Inside a `<Section>` the heading\n * id is registered with it, which is what gives the `region` landmark its\n * accessible name.\n *\n * @example\n * <Section>\n * <SectionHeader eyebrow=\"Soluções\" title=\"O que podemos desenvolver\" align=\"center\" />\n * <p>Conteúdo da seção.</p>\n * </Section>\n */\nexport function SectionHeader({\n title,\n eyebrow,\n description,\n actions,\n level = 2,\n align = \"start\",\n id,\n className,\n ...props\n}: SectionHeaderProps) {\n const autoId = useId();\n const headingId = id ?? autoId;\n const section = useContext(SectionContext);\n const register = section?.register;\n const hasTitle = Boolean(title);\n useLayoutEffect(() => {\n if (!register || !hasTitle) return undefined;\n return register(headingId);\n }, [register, hasTitle, headingId]);\n if (!title && !eyebrow && !description && !actions) return null;\n const Heading = `h${level}` as const;\n return (\n <header\n className={cn(styles.header, align === \"center\" && styles.center, className)}\n {...props}\n >\n <div className={styles.headerText}>\n {eyebrow && <div className={styles.eyebrow}>{eyebrow}</div>}\n {title && (\n <Heading id={headingId} className={styles.title}>\n {title}\n </Heading>\n )}\n {description && <p className={styles.description}>{description}</p>}\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </header>\n );\n}\n\n/** Surface tone a {@link Section} can take. */\nexport type SectionTone = \"inverse\";\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * `\"inverse\"` paints the section in the brand color and inverts every color\n * token inside it, by writing `data-tempest-tone=\"inverse\"`. The tokens are\n * opt-in, because most apps never paint a section in the brand: they come\n * from `tempest-react-sdk/styles/inverse.css` for the SDK's own blue, or from\n * `createTheme({ primary, inverse: createInverseSurface })` for yours, each\n * measured against the fill (text and muted text at 4.5:1 or more, the focus\n * ring at 3:1 or more). With neither loaded the attribute matches nothing and\n * the section keeps the page's tokens — legible, not inverted. The prop\n * exists so the tone is typed: a typo in a hand-written attribute fails\n * silently, a typo here fails the build.\n */\n tone?: SectionTone;\n}\n\n/**\n * `<section>` that takes its accessible name from the `SectionHeader` inside it.\n *\n * A `<section>` is exposed as a `region` landmark only when it has an\n * accessible name; without one it is an anonymous group and screen-reader\n * landmark navigation skips it. Wiring `aria-labelledby` to the heading id is\n * the same mechanical step on every page, so the section does it: every\n * `SectionHeader` with a `title` below it registers its id through context (so\n * wrappers in between do not break the link) and the first one mounted names\n * the section; when it unmounts, the next one takes over. An explicit\n * `aria-labelledby` or `aria-label` wins over the registered one, and with no\n * heading the attribute is left off rather than pointing at nothing.\n *\n * @example\n * <Section>\n * <SectionHeader title=\"Planos\" />\n * <PlanGrid />\n * </Section>\n *\n * @example\n * <Section tone=\"inverse\">\n * <SectionHeader title=\"Comece agora\" />\n * <Button>Criar conta</Button>\n * </Section>\n */\nexport function Section({ children, tone, ...props }: SectionProps) {\n const [headingIds, setHeadingIds] = useState<string[]>([]);\n const context = useMemo<SectionContextValue>(\n () => ({\n register: (id: string) => {\n setHeadingIds((current) => [...current, id]);\n return () => setHeadingIds((current) => current.filter((entry) => entry !== id));\n },\n }),\n [],\n );\n const named = props[\"aria-labelledby\"] !== undefined || props[\"aria-label\"] !== undefined;\n return (\n <SectionContext.Provider value={context}>\n <section\n aria-labelledby={named ? undefined : headingIds[0]}\n data-tempest-tone={tone}\n {...props}\n >\n {children}\n </section>\n </SectionContext.Provider>\n );\n}\n"],"mappings":"oIAwBA,IAAM,GAAA,EAAiB,EAAA,cAAA,CAA0C,IAAI,EAmCrE,SAAgB,EAAc,CAC1B,QACA,UACA,cACA,UACA,QAAQ,EACR,QAAQ,QACR,KACA,YACA,GAAG,GACgB,CACnB,IAAM,GAAA,EAAS,EAAA,MAAA,CAAM,EACf,EAAY,GAAM,EAElB,GAAA,EADU,EAAA,WAAA,CAAW,CACV,CAAA,EAAS,SACpB,EAAW,EAAQ,EAKzB,IAJA,EAAA,EAAA,gBAAA,KAAsB,CACd,GAAC,GAAa,EAClB,OAAO,EAAS,CAAS,CAC7B,EAAG,CAAC,EAAU,EAAU,CAAS,CAAC,EAC9B,CAAC,GAAS,CAAC,GAAW,CAAC,GAAe,CAAC,EAAS,OAAO,KAC3D,IAAM,EAAU,IAAI,IACpB,OACI,EAAA,EAAA,KAAA,CAAC,SAAD,CACI,UAAW,EAAA,GAAG,EAAA,QAAO,OAAQ,IAAU,UAAY,EAAA,QAAO,OAAQ,CAAS,EAC3E,GAAI,EAFR,SAAA,EAII,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,WAAvB,SAAA,CACK,IAAW,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,QAAU,SAAA,CAAa,CAAA,EACzD,IACG,EAAA,EAAA,IAAA,CAAC,EAAD,CAAS,GAAI,EAAW,UAAW,EAAA,QAAO,MACrC,SAAA,CACI,CAAA,EAEZ,IAAe,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAW,EAAA,QAAO,YAAc,SAAA,CAAe,CAAA,CACjE,CACJ,CAAA,EAAA,IAAW,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,QAAU,SAAA,CAAa,CAAA,CACtD,GAEhB,CA8CA,SAAgB,EAAQ,CAAE,WAAU,OAAM,GAAG,GAAuB,CAChE,GAAM,CAAC,EAAY,IAAA,EAAiB,EAAA,SAAA,CAAmB,CAAC,CAAC,EACnD,GAAA,EAAU,EAAA,QAAA,MACL,CACH,SAAW,IACP,EAAe,GAAY,CAAC,GAAG,EAAS,CAAE,CAAC,MAC9B,EAAe,GAAY,EAAQ,OAAQ,GAAU,IAAU,CAAE,CAAC,EAEvF,GACA,CAAC,CACL,EACM,EAAQ,EAAM,qBAAuB,IAAA,IAAa,EAAM,gBAAkB,IAAA,GAChF,OACI,EAAA,EAAA,IAAA,CAAC,EAAe,SAAhB,CAAyB,MAAO,EAC5B,UAAA,EAAA,EAAA,IAAA,CAAC,UAAD,CACI,kBAAiB,EAAQ,IAAA,GAAY,EAAW,GAChD,oBAAmB,EACnB,GAAI,EAEH,UACI,CAAA,CACY,CAAA,CAEjC"}
|
|
1
|
+
{"version":3,"file":"SectionHeader.cjs","names":[],"sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"sourcesContent":["/**\n * @tempest-limits props-count — a heading block is slots (eyebrow, title, description,\n * actions) plus the three switches that decide its semantics: level, align and the\n * heading id. Splitting them would leave the id away from the heading it names.\n */\nimport {\n createContext,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport styles from \"./SectionHeader.module.css\";\n\nexport type SectionHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type SectionHeaderAlign = \"start\" | \"center\";\n\n/**\n * Links the nearest `<Section>` to the heading that names it.\n *\n * Two channels, because they answer at different times:\n *\n * - `sectionId` + `claim` work during render, so the link exists in the very\n * first HTML (`renderToString`, hydration) where no effect runs. The section\n * owns `sectionId` (from `useId`, identical on server and client) and writes\n * it to `aria-labelledby` before any child renders; the first titled\n * `SectionHeader` to call `claim` in render order becomes its owner and, when\n * it has no explicit `id`, puts `sectionId` on its heading. `claim` is keyed by\n * the caller's own `useId`, so asking twice (Strict Mode, a re-render) gives\n * the same answer and never hands the id to a second heading.\n * - `register` works after mount and is the source of truth from then on: it\n * returns the matching unregister so a heading that unmounts (or changes id)\n * releases the section instead of leaving `aria-labelledby` pointing at an\n * element that no longer exists, and the next registered heading takes over.\n */\ninterface SectionContextValue {\n sectionId: string;\n claim: (headerKey: string) => boolean;\n register: (headingId: string) => () => void;\n}\n\nconst SectionContext = createContext<SectionContextValue | null>(null);\n\nexport interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLElement>, \"title\" | \"id\"> {\n /** Heading text, rendered as `<h{level}>`. */\n title?: ReactNode;\n /** Short label above the title (category, breadcrumbs). */\n eyebrow?: ReactNode;\n /** Supporting text rendered below the title. */\n description?: ReactNode;\n /** Trailing slot for buttons or menus. */\n actions?: ReactNode;\n /** Heading level — semantics only, the look does not change with it. Default `2`. */\n level?: SectionHeaderLevel;\n /** Horizontal alignment of the text block. Default `\"start\"`. */\n align?: SectionHeaderAlign;\n /** Id of the heading element. Generated with `useId` when absent. */\n id?: string;\n}\n\n/**\n * Header of a page or of one section of it: eyebrow, title, description and\n * actions, with the same look `Page` uses for its own header.\n *\n * The heading level is a prop because one page needs one `<h1>` and many\n * `<h2>` that look alike; the visual stays the same at every level so the\n * outline is picked by meaning, not by size. Inside a `<Section>` the first\n * titled header takes the section's own id for its heading (unless `id` is\n * given) and registers it, which is what gives the `region` landmark its\n * accessible name — in the server HTML too.\n *\n * @example\n * <Section>\n * <SectionHeader eyebrow=\"Soluções\" title=\"O que podemos desenvolver\" align=\"center\" />\n * <p>Conteúdo da seção.</p>\n * </Section>\n */\nexport function SectionHeader({\n title,\n eyebrow,\n description,\n actions,\n level = 2,\n align = \"start\",\n id,\n className,\n ...props\n}: SectionHeaderProps) {\n const autoId = useId();\n const section = useContext(SectionContext);\n const hasTitle = Boolean(title);\n const ownsSection = section !== null && hasTitle && section.claim(autoId);\n const headingId = id ?? (ownsSection ? section.sectionId : autoId);\n const register = section?.register;\n useLayoutEffect(() => {\n if (!register || !hasTitle) return undefined;\n return register(headingId);\n }, [register, hasTitle, headingId]);\n if (!title && !eyebrow && !description && !actions) return null;\n const Heading = `h${level}` as const;\n return (\n <header\n className={cn(styles.header, align === \"center\" && styles.center, className)}\n {...props}\n >\n <div className={styles.headerText}>\n {eyebrow && <div className={styles.eyebrow}>{eyebrow}</div>}\n {title && (\n <Heading id={headingId} className={styles.title}>\n {title}\n </Heading>\n )}\n {description && <p className={styles.description}>{description}</p>}\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </header>\n );\n}\n\n/** Surface tone a {@link Section} can take. */\nexport type SectionTone = \"inverse\" | \"default\";\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * `\"inverse\"` paints the section in the brand color and inverts every color\n * token inside it, by writing `data-tempest-tone=\"inverse\"`. The tokens are\n * opt-in, because most apps never paint a section in the brand: they come\n * from `tempest-react-sdk/styles/inverse.css` for the SDK's own blue, or from\n * `createTheme({ primary, inverse: createInverseSurface })` for yours, each\n * measured against the fill (text and muted text at 4.5:1 or more, the focus\n * ring at 3:1 or more). With neither loaded the attribute matches nothing and\n * the section keeps the page's tokens — legible, not inverted. The prop\n * exists so the tone is typed: a typo in a hand-written attribute fails\n * silently, a typo here fails the build.\n *\n * `\"default\"` hands a region inside an inverse section back to the page's\n * tokens — light or dark, whichever the page is on — by writing\n * `data-tempest-tone=\"default\"`: a white form or price card in a navy hero.\n * The rules ship with the inverse tokens, so it costs nothing until those are\n * loaded, and outside an inverse section the tokens it restores are the ones\n * already there.\n */\n tone?: SectionTone;\n}\n\n/**\n * `<section>` that takes its accessible name from the `SectionHeader` inside it.\n *\n * A `<section>` is exposed as a `region` landmark only when it has an\n * accessible name; without one it is an anonymous group and screen-reader\n * landmark navigation skips it. Wiring `aria-labelledby` to the heading id is\n * the same mechanical step on every page, so the section does it: every\n * `SectionHeader` with a `title` below it reaches the section through context\n * (so wrappers in between do not break the link) and the first one names it;\n * when it unmounts, the next one takes over. An explicit `aria-labelledby` or\n * `aria-label` wins over the automatic one, and once mounted with no titled\n * heading the attribute is left off rather than pointing at nothing.\n *\n * The section owns the id (`useId`), so the link is already in the first\n * render — `renderToString` and the HTML a server sends — where no effect runs.\n * The parent's attributes are written before any child renders, so the section\n * cannot know what is below it: it always writes its own id, and the first\n * titled `SectionHeader` in render order puts that id on its heading. Two\n * cases cannot be known on the server, and both are settled on hydration\n * without a mismatch warning: with no titled heading the server attribute is\n * dropped (until then it resolves to nothing, which Chromium 153 exposes as\n * the same anonymous group as no attribute at all), and when that first header\n * has an explicit `id` the attribute moves to it. A consumer that needs the\n * explicit id in the server HTML passes `aria-labelledby` itself.\n *\n * @example\n * <Section>\n * <SectionHeader title=\"Planos\" />\n * <PlanGrid />\n * </Section>\n *\n * @example\n * <Section tone=\"inverse\">\n * <SectionHeader title=\"Comece agora\" />\n * <Button>Criar conta</Button>\n * </Section>\n */\nexport function Section({ children, tone, ...props }: SectionProps) {\n const sectionId = useId();\n const ownerRef = useRef<string | null>(null);\n const [headingIds, setHeadingIds] = useState<string[] | null>(null);\n const context = useMemo<SectionContextValue>(\n () => ({\n sectionId,\n claim: (headerKey: string) => {\n ownerRef.current ??= headerKey;\n return ownerRef.current === headerKey;\n },\n register: (id: string) => {\n setHeadingIds((current) => [...(current ?? []), id]);\n return () =>\n setHeadingIds((current) => (current ?? []).filter((entry) => entry !== id));\n },\n }),\n [sectionId],\n );\n useLayoutEffect(() => {\n setHeadingIds((current) => current ?? []);\n }, []);\n const named = props[\"aria-labelledby\"] !== undefined || props[\"aria-label\"] !== undefined;\n const labelledBy = headingIds === null ? sectionId : headingIds[0];\n return (\n <SectionContext.Provider value={context}>\n <section\n aria-labelledby={named ? undefined : labelledBy}\n data-tempest-tone={tone}\n {...props}\n >\n {children}\n </section>\n </SectionContext.Provider>\n );\n}\n"],"mappings":"oIA6CA,IAAM,GAAA,EAAiB,EAAA,cAAA,CAA0C,IAAI,EAoCrE,SAAgB,EAAc,CAC1B,QACA,UACA,cACA,UACA,QAAQ,EACR,QAAQ,QACR,KACA,YACA,GAAG,GACgB,CACnB,IAAM,GAAA,EAAS,EAAA,MAAA,CAAM,EACf,GAAA,EAAU,EAAA,WAAA,CAAW,CAAc,EACnC,EAAW,EAAQ,EACnB,EAAc,IAAY,MAAQ,GAAY,EAAQ,MAAM,CAAM,EAClE,EAAY,IAAO,EAAc,EAAQ,UAAY,GACrD,EAAW,GAAS,SAK1B,IAJA,EAAA,EAAA,gBAAA,KAAsB,CACd,GAAC,GAAa,EAClB,OAAO,EAAS,CAAS,CAC7B,EAAG,CAAC,EAAU,EAAU,CAAS,CAAC,EAC9B,CAAC,GAAS,CAAC,GAAW,CAAC,GAAe,CAAC,EAAS,OAAO,KAC3D,IAAM,EAAU,IAAI,IACpB,OACI,EAAA,EAAA,KAAA,CAAC,SAAD,CACI,UAAW,EAAA,GAAG,EAAA,QAAO,OAAQ,IAAU,UAAY,EAAA,QAAO,OAAQ,CAAS,EAC3E,GAAI,EAFR,SAAA,EAII,EAAA,EAAA,KAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,WAAvB,SAAA,CACK,IAAW,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,QAAU,SAAA,CAAa,CAAA,EACzD,IACG,EAAA,EAAA,IAAA,CAAC,EAAD,CAAS,GAAI,EAAW,UAAW,EAAA,QAAO,MACrC,SAAA,CACI,CAAA,EAEZ,IAAe,EAAA,EAAA,IAAA,CAAC,IAAD,CAAG,UAAW,EAAA,QAAO,YAAc,SAAA,CAAe,CAAA,CACjE,CACJ,CAAA,EAAA,IAAW,EAAA,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW,EAAA,QAAO,QAAU,SAAA,CAAa,CAAA,CACtD,GAEhB,CAiEA,SAAgB,EAAQ,CAAE,WAAU,OAAM,GAAG,GAAuB,CAChE,IAAM,GAAA,EAAY,EAAA,MAAA,CAAM,EAClB,GAAA,EAAW,EAAA,OAAA,CAAsB,IAAI,EACrC,CAAC,EAAY,IAAA,EAAiB,EAAA,SAAA,CAA0B,IAAI,EAC5D,GAAA,EAAU,EAAA,QAAA,MACL,CACH,YACA,MAAQ,IACJ,EAAS,UAAY,EACd,EAAS,UAAY,GAEhC,SAAW,IACP,EAAe,GAAY,CAAC,GAAI,GAAW,CAAC,EAAI,CAAE,CAAC,MAE/C,EAAe,IAAa,GAAW,CAAC,EAAA,CAAG,OAAQ,GAAU,IAAU,CAAE,CAAC,EAEtF,GACA,CAAC,CAAS,CACd,GACA,EAAA,EAAA,gBAAA,KAAsB,CAClB,EAAe,GAAY,GAAW,CAAC,CAAC,CAC5C,EAAG,CAAC,CAAC,EACL,IAAM,EAAQ,EAAM,qBAAuB,IAAA,IAAa,EAAM,gBAAkB,IAAA,GAC1E,EAAa,IAAe,KAAO,EAAY,EAAW,GAChE,OACI,EAAA,EAAA,IAAA,CAAC,EAAe,SAAhB,CAAyB,MAAO,EAC5B,UAAA,EAAA,EAAA,IAAA,CAAC,UAAD,CACI,kBAAiB,EAAQ,IAAA,GAAY,EACrC,oBAAmB,EACnB,GAAI,EAEH,UACI,CAAA,CACY,CAAA,CAEjC"}
|
|
@@ -1,51 +1,59 @@
|
|
|
1
1
|
import { cn as e } from "../../utils/cn.js";
|
|
2
2
|
import t from "./SectionHeader.module.js";
|
|
3
|
-
import { createContext as n, useContext as r, useId as i, useLayoutEffect as a, useMemo as o,
|
|
4
|
-
import { jsx as
|
|
3
|
+
import { createContext as n, useContext as r, useId as i, useLayoutEffect as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
4
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/SectionHeader/SectionHeader.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let _ = i(), v =
|
|
6
|
+
var d = n(null);
|
|
7
|
+
function f({ title: n, eyebrow: o, description: s, actions: c, level: f = 2, align: p = "start", id: m, className: h, ...g }) {
|
|
8
|
+
let _ = i(), v = r(d), y = !!n, b = v !== null && y && v.claim(_), x = m ?? (b ? v.sectionId : _), S = v?.register;
|
|
9
9
|
if (a(() => {
|
|
10
|
-
if (
|
|
10
|
+
if (S && y) return S(x);
|
|
11
11
|
}, [
|
|
12
|
+
S,
|
|
12
13
|
y,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return /* @__PURE__ */ l("header", {
|
|
14
|
+
x
|
|
15
|
+
]), !n && !o && !s && !c) return null;
|
|
16
|
+
let C = `h${f}`;
|
|
17
|
+
return /* @__PURE__ */ u("header", {
|
|
18
18
|
className: e(t.header, p === "center" && t.center, h),
|
|
19
19
|
...g,
|
|
20
|
-
children: [/* @__PURE__ */
|
|
20
|
+
children: [/* @__PURE__ */ u("div", {
|
|
21
21
|
className: t.headerText,
|
|
22
22
|
children: [
|
|
23
|
-
o && /* @__PURE__ */
|
|
23
|
+
o && /* @__PURE__ */ l("div", {
|
|
24
24
|
className: t.eyebrow,
|
|
25
25
|
children: o
|
|
26
26
|
}),
|
|
27
|
-
n && /* @__PURE__ */
|
|
28
|
-
id:
|
|
27
|
+
n && /* @__PURE__ */ l(C, {
|
|
28
|
+
id: x,
|
|
29
29
|
className: t.title,
|
|
30
30
|
children: n
|
|
31
31
|
}),
|
|
32
|
-
s && /* @__PURE__ */
|
|
32
|
+
s && /* @__PURE__ */ l("p", {
|
|
33
33
|
className: t.description,
|
|
34
34
|
children: s
|
|
35
35
|
})
|
|
36
36
|
]
|
|
37
|
-
}),
|
|
37
|
+
}), c && /* @__PURE__ */ l("div", {
|
|
38
38
|
className: t.actions,
|
|
39
|
-
children:
|
|
39
|
+
children: c
|
|
40
40
|
})]
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
-
function
|
|
44
|
-
let
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
function p({ children: e, tone: t, ...n }) {
|
|
44
|
+
let r = i(), u = s(null), [f, p] = c(null), m = o(() => ({
|
|
45
|
+
sectionId: r,
|
|
46
|
+
claim: (e) => (u.current ??= e, u.current === e),
|
|
47
|
+
register: (e) => (p((t) => [...t ?? [], e]), () => p((t) => (t ?? []).filter((t) => t !== e)))
|
|
48
|
+
}), [r]);
|
|
49
|
+
a(() => {
|
|
50
|
+
p((e) => e ?? []);
|
|
51
|
+
}, []);
|
|
52
|
+
let h = n["aria-labelledby"] !== void 0 || n["aria-label"] !== void 0, g = f === null ? r : f[0];
|
|
53
|
+
return /* @__PURE__ */ l(d.Provider, {
|
|
54
|
+
value: m,
|
|
55
|
+
children: /* @__PURE__ */ l("section", {
|
|
56
|
+
"aria-labelledby": h ? void 0 : g,
|
|
49
57
|
"data-tempest-tone": t,
|
|
50
58
|
...n,
|
|
51
59
|
children: e
|
|
@@ -53,6 +61,6 @@ function f({ children: e, tone: t, ...n }) {
|
|
|
53
61
|
});
|
|
54
62
|
}
|
|
55
63
|
//#endregion
|
|
56
|
-
export {
|
|
64
|
+
export { p as Section, f as SectionHeader };
|
|
57
65
|
|
|
58
66
|
//# sourceMappingURL=SectionHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SectionHeader.js","names":[],"sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"sourcesContent":["/**\n * @tempest-limits props-count — a heading block is slots (eyebrow, title, description,\n * actions) plus the three switches that decide its semantics: level, align and the\n * heading id. Splitting them would leave the id away from the heading it names.\n */\nimport { createContext, useContext, useId, useLayoutEffect, useMemo, useState } from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport styles from \"./SectionHeader.module.css\";\n\nexport type SectionHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type SectionHeaderAlign = \"start\" | \"center\";\n\n/**\n * Lets the nearest `<Section>` learn the id of the heading that names it.\n *\n * `register` returns the matching unregister so a heading that unmounts (or\n * changes id) releases the section instead of leaving `aria-labelledby` pointing\n * at an element that no longer exists.\n */\ninterface SectionContextValue {\n register: (headingId: string) => () => void;\n}\n\nconst SectionContext = createContext<SectionContextValue | null>(null);\n\nexport interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLElement>, \"title\" | \"id\"> {\n /** Heading text, rendered as `<h{level}>`. */\n title?: ReactNode;\n /** Short label above the title (category, breadcrumbs). */\n eyebrow?: ReactNode;\n /** Supporting text rendered below the title. */\n description?: ReactNode;\n /** Trailing slot for buttons or menus. */\n actions?: ReactNode;\n /** Heading level — semantics only, the look does not change with it. Default `2`. */\n level?: SectionHeaderLevel;\n /** Horizontal alignment of the text block. Default `\"start\"`. */\n align?: SectionHeaderAlign;\n /** Id of the heading element. Generated with `useId` when absent. */\n id?: string;\n}\n\n/**\n * Header of a page or of one section of it: eyebrow, title, description and\n * actions, with the same look `Page` uses for its own header.\n *\n * The heading level is a prop because one page needs one `<h1>` and many\n * `<h2>` that look alike; the visual stays the same at every level so the\n * outline is picked by meaning, not by size. Inside a `<Section>` the heading\n * id is registered with it, which is what gives the `region` landmark its\n * accessible name.\n *\n * @example\n * <Section>\n * <SectionHeader eyebrow=\"Soluções\" title=\"O que podemos desenvolver\" align=\"center\" />\n * <p>Conteúdo da seção.</p>\n * </Section>\n */\nexport function SectionHeader({\n title,\n eyebrow,\n description,\n actions,\n level = 2,\n align = \"start\",\n id,\n className,\n ...props\n}: SectionHeaderProps) {\n const autoId = useId();\n const headingId = id ?? autoId;\n const section = useContext(SectionContext);\n const register = section?.register;\n const hasTitle = Boolean(title);\n useLayoutEffect(() => {\n if (!register || !hasTitle) return undefined;\n return register(headingId);\n }, [register, hasTitle, headingId]);\n if (!title && !eyebrow && !description && !actions) return null;\n const Heading = `h${level}` as const;\n return (\n <header\n className={cn(styles.header, align === \"center\" && styles.center, className)}\n {...props}\n >\n <div className={styles.headerText}>\n {eyebrow && <div className={styles.eyebrow}>{eyebrow}</div>}\n {title && (\n <Heading id={headingId} className={styles.title}>\n {title}\n </Heading>\n )}\n {description && <p className={styles.description}>{description}</p>}\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </header>\n );\n}\n\n/** Surface tone a {@link Section} can take. */\nexport type SectionTone = \"inverse\";\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * `\"inverse\"` paints the section in the brand color and inverts every color\n * token inside it, by writing `data-tempest-tone=\"inverse\"`. The tokens are\n * opt-in, because most apps never paint a section in the brand: they come\n * from `tempest-react-sdk/styles/inverse.css` for the SDK's own blue, or from\n * `createTheme({ primary, inverse: createInverseSurface })` for yours, each\n * measured against the fill (text and muted text at 4.5:1 or more, the focus\n * ring at 3:1 or more). With neither loaded the attribute matches nothing and\n * the section keeps the page's tokens — legible, not inverted. The prop\n * exists so the tone is typed: a typo in a hand-written attribute fails\n * silently, a typo here fails the build.\n */\n tone?: SectionTone;\n}\n\n/**\n * `<section>` that takes its accessible name from the `SectionHeader` inside it.\n *\n * A `<section>` is exposed as a `region` landmark only when it has an\n * accessible name; without one it is an anonymous group and screen-reader\n * landmark navigation skips it. Wiring `aria-labelledby` to the heading id is\n * the same mechanical step on every page, so the section does it: every\n * `SectionHeader` with a `title` below it registers its id through context (so\n * wrappers in between do not break the link) and the first one mounted names\n * the section; when it unmounts, the next one takes over. An explicit\n * `aria-labelledby` or `aria-label` wins over the registered one, and with no\n * heading the attribute is left off rather than pointing at nothing.\n *\n * @example\n * <Section>\n * <SectionHeader title=\"Planos\" />\n * <PlanGrid />\n * </Section>\n *\n * @example\n * <Section tone=\"inverse\">\n * <SectionHeader title=\"Comece agora\" />\n * <Button>Criar conta</Button>\n * </Section>\n */\nexport function Section({ children, tone, ...props }: SectionProps) {\n const [headingIds, setHeadingIds] = useState<string[]>([]);\n const context = useMemo<SectionContextValue>(\n () => ({\n register: (id: string) => {\n setHeadingIds((current) => [...current, id]);\n return () => setHeadingIds((current) => current.filter((entry) => entry !== id));\n },\n }),\n [],\n );\n const named = props[\"aria-labelledby\"] !== undefined || props[\"aria-label\"] !== undefined;\n return (\n <SectionContext.Provider value={context}>\n <section\n aria-labelledby={named ? undefined : headingIds[0]}\n data-tempest-tone={tone}\n {...props}\n >\n {children}\n </section>\n </SectionContext.Provider>\n );\n}\n"],"mappings":";;;;;AAwBA,IAAM,IAAiB,EAA0C,IAAI;AAmCrE,SAAgB,EAAc,EAC1B,UACA,YACA,gBACA,YACA,WAAQ,GACR,WAAQ,SACR,OACA,cACA,GAAG,KACgB;CACnB,IAAM,IAAS,EAAM,GACf,IAAY,KAAM,GAElB,IADU,EAAW,CACV,CAAA,EAAS,UACpB,IAAW,EAAQ;CAKzB,IAJA,QAAsB;EACd,IAAC,KAAa,GAClB,OAAO,EAAS,CAAS;CAC7B,GAAG;EAAC;EAAU;EAAU;CAAS,CAAC,GAC9B,CAAC,KAAS,CAAC,KAAW,CAAC,KAAe,CAAC,GAAS,OAAO;CAC3D,IAAM,IAAU,IAAI;CACpB,OACI,kBAAC,UAAD;EACI,WAAW,EAAG,EAAO,QAAQ,MAAU,YAAY,EAAO,QAAQ,CAAS;EAC3E,GAAI;EAFR,UAAA,CAII,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAvB,UAAA;IACK,KAAW,kBAAC,OAAD;KAAK,WAAW,EAAO;KAAU,UAAA;IAAa,CAAA;IACzD,KACG,kBAAC,GAAD;KAAS,IAAI;KAAW,WAAW,EAAO;KACrC,UAAA;IACI,CAAA;IAEZ,KAAe,kBAAC,KAAD;KAAG,WAAW,EAAO;KAAc,UAAA;IAAe,CAAA;GACjE;EACJ,CAAA,GAAA,KAAW,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAU,UAAA;EAAa,CAAA,CACtD;;AAEhB;AA8CA,SAAgB,EAAQ,EAAE,aAAU,SAAM,GAAG,KAAuB;CAChE,IAAM,CAAC,GAAY,KAAiB,EAAmB,CAAC,CAAC,GACnD,IAAU,SACL,EACH,WAAW,OACP,GAAe,MAAY,CAAC,GAAG,GAAS,CAAE,CAAC,SAC9B,GAAe,MAAY,EAAQ,QAAQ,MAAU,MAAU,CAAE,CAAC,GAEvF,IACA,CAAC,CACL,GACM,IAAQ,EAAM,uBAAuB,KAAA,KAAa,EAAM,kBAAkB,KAAA;CAChF,OACI,kBAAC,EAAe,UAAhB;EAAyB,OAAO;EAC5B,UAAA,kBAAC,WAAD;GACI,mBAAiB,IAAQ,KAAA,IAAY,EAAW;GAChD,qBAAmB;GACnB,GAAI;GAEH;EACI,CAAA;CACY,CAAA;AAEjC"}
|
|
1
|
+
{"version":3,"file":"SectionHeader.js","names":[],"sources":["../../../src/components/SectionHeader/SectionHeader.tsx"],"sourcesContent":["/**\n * @tempest-limits props-count — a heading block is slots (eyebrow, title, description,\n * actions) plus the three switches that decide its semantics: level, align and the\n * heading id. Splitting them would leave the id away from the heading it names.\n */\nimport {\n createContext,\n useContext,\n useId,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"@/utils/cn\";\nimport styles from \"./SectionHeader.module.css\";\n\nexport type SectionHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;\nexport type SectionHeaderAlign = \"start\" | \"center\";\n\n/**\n * Links the nearest `<Section>` to the heading that names it.\n *\n * Two channels, because they answer at different times:\n *\n * - `sectionId` + `claim` work during render, so the link exists in the very\n * first HTML (`renderToString`, hydration) where no effect runs. The section\n * owns `sectionId` (from `useId`, identical on server and client) and writes\n * it to `aria-labelledby` before any child renders; the first titled\n * `SectionHeader` to call `claim` in render order becomes its owner and, when\n * it has no explicit `id`, puts `sectionId` on its heading. `claim` is keyed by\n * the caller's own `useId`, so asking twice (Strict Mode, a re-render) gives\n * the same answer and never hands the id to a second heading.\n * - `register` works after mount and is the source of truth from then on: it\n * returns the matching unregister so a heading that unmounts (or changes id)\n * releases the section instead of leaving `aria-labelledby` pointing at an\n * element that no longer exists, and the next registered heading takes over.\n */\ninterface SectionContextValue {\n sectionId: string;\n claim: (headerKey: string) => boolean;\n register: (headingId: string) => () => void;\n}\n\nconst SectionContext = createContext<SectionContextValue | null>(null);\n\nexport interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLElement>, \"title\" | \"id\"> {\n /** Heading text, rendered as `<h{level}>`. */\n title?: ReactNode;\n /** Short label above the title (category, breadcrumbs). */\n eyebrow?: ReactNode;\n /** Supporting text rendered below the title. */\n description?: ReactNode;\n /** Trailing slot for buttons or menus. */\n actions?: ReactNode;\n /** Heading level — semantics only, the look does not change with it. Default `2`. */\n level?: SectionHeaderLevel;\n /** Horizontal alignment of the text block. Default `\"start\"`. */\n align?: SectionHeaderAlign;\n /** Id of the heading element. Generated with `useId` when absent. */\n id?: string;\n}\n\n/**\n * Header of a page or of one section of it: eyebrow, title, description and\n * actions, with the same look `Page` uses for its own header.\n *\n * The heading level is a prop because one page needs one `<h1>` and many\n * `<h2>` that look alike; the visual stays the same at every level so the\n * outline is picked by meaning, not by size. Inside a `<Section>` the first\n * titled header takes the section's own id for its heading (unless `id` is\n * given) and registers it, which is what gives the `region` landmark its\n * accessible name — in the server HTML too.\n *\n * @example\n * <Section>\n * <SectionHeader eyebrow=\"Soluções\" title=\"O que podemos desenvolver\" align=\"center\" />\n * <p>Conteúdo da seção.</p>\n * </Section>\n */\nexport function SectionHeader({\n title,\n eyebrow,\n description,\n actions,\n level = 2,\n align = \"start\",\n id,\n className,\n ...props\n}: SectionHeaderProps) {\n const autoId = useId();\n const section = useContext(SectionContext);\n const hasTitle = Boolean(title);\n const ownsSection = section !== null && hasTitle && section.claim(autoId);\n const headingId = id ?? (ownsSection ? section.sectionId : autoId);\n const register = section?.register;\n useLayoutEffect(() => {\n if (!register || !hasTitle) return undefined;\n return register(headingId);\n }, [register, hasTitle, headingId]);\n if (!title && !eyebrow && !description && !actions) return null;\n const Heading = `h${level}` as const;\n return (\n <header\n className={cn(styles.header, align === \"center\" && styles.center, className)}\n {...props}\n >\n <div className={styles.headerText}>\n {eyebrow && <div className={styles.eyebrow}>{eyebrow}</div>}\n {title && (\n <Heading id={headingId} className={styles.title}>\n {title}\n </Heading>\n )}\n {description && <p className={styles.description}>{description}</p>}\n </div>\n {actions && <div className={styles.actions}>{actions}</div>}\n </header>\n );\n}\n\n/** Surface tone a {@link Section} can take. */\nexport type SectionTone = \"inverse\" | \"default\";\n\nexport interface SectionProps extends HTMLAttributes<HTMLElement> {\n /**\n * `\"inverse\"` paints the section in the brand color and inverts every color\n * token inside it, by writing `data-tempest-tone=\"inverse\"`. The tokens are\n * opt-in, because most apps never paint a section in the brand: they come\n * from `tempest-react-sdk/styles/inverse.css` for the SDK's own blue, or from\n * `createTheme({ primary, inverse: createInverseSurface })` for yours, each\n * measured against the fill (text and muted text at 4.5:1 or more, the focus\n * ring at 3:1 or more). With neither loaded the attribute matches nothing and\n * the section keeps the page's tokens — legible, not inverted. The prop\n * exists so the tone is typed: a typo in a hand-written attribute fails\n * silently, a typo here fails the build.\n *\n * `\"default\"` hands a region inside an inverse section back to the page's\n * tokens — light or dark, whichever the page is on — by writing\n * `data-tempest-tone=\"default\"`: a white form or price card in a navy hero.\n * The rules ship with the inverse tokens, so it costs nothing until those are\n * loaded, and outside an inverse section the tokens it restores are the ones\n * already there.\n */\n tone?: SectionTone;\n}\n\n/**\n * `<section>` that takes its accessible name from the `SectionHeader` inside it.\n *\n * A `<section>` is exposed as a `region` landmark only when it has an\n * accessible name; without one it is an anonymous group and screen-reader\n * landmark navigation skips it. Wiring `aria-labelledby` to the heading id is\n * the same mechanical step on every page, so the section does it: every\n * `SectionHeader` with a `title` below it reaches the section through context\n * (so wrappers in between do not break the link) and the first one names it;\n * when it unmounts, the next one takes over. An explicit `aria-labelledby` or\n * `aria-label` wins over the automatic one, and once mounted with no titled\n * heading the attribute is left off rather than pointing at nothing.\n *\n * The section owns the id (`useId`), so the link is already in the first\n * render — `renderToString` and the HTML a server sends — where no effect runs.\n * The parent's attributes are written before any child renders, so the section\n * cannot know what is below it: it always writes its own id, and the first\n * titled `SectionHeader` in render order puts that id on its heading. Two\n * cases cannot be known on the server, and both are settled on hydration\n * without a mismatch warning: with no titled heading the server attribute is\n * dropped (until then it resolves to nothing, which Chromium 153 exposes as\n * the same anonymous group as no attribute at all), and when that first header\n * has an explicit `id` the attribute moves to it. A consumer that needs the\n * explicit id in the server HTML passes `aria-labelledby` itself.\n *\n * @example\n * <Section>\n * <SectionHeader title=\"Planos\" />\n * <PlanGrid />\n * </Section>\n *\n * @example\n * <Section tone=\"inverse\">\n * <SectionHeader title=\"Comece agora\" />\n * <Button>Criar conta</Button>\n * </Section>\n */\nexport function Section({ children, tone, ...props }: SectionProps) {\n const sectionId = useId();\n const ownerRef = useRef<string | null>(null);\n const [headingIds, setHeadingIds] = useState<string[] | null>(null);\n const context = useMemo<SectionContextValue>(\n () => ({\n sectionId,\n claim: (headerKey: string) => {\n ownerRef.current ??= headerKey;\n return ownerRef.current === headerKey;\n },\n register: (id: string) => {\n setHeadingIds((current) => [...(current ?? []), id]);\n return () =>\n setHeadingIds((current) => (current ?? []).filter((entry) => entry !== id));\n },\n }),\n [sectionId],\n );\n useLayoutEffect(() => {\n setHeadingIds((current) => current ?? []);\n }, []);\n const named = props[\"aria-labelledby\"] !== undefined || props[\"aria-label\"] !== undefined;\n const labelledBy = headingIds === null ? sectionId : headingIds[0];\n return (\n <SectionContext.Provider value={context}>\n <section\n aria-labelledby={named ? undefined : labelledBy}\n data-tempest-tone={tone}\n {...props}\n >\n {children}\n </section>\n </SectionContext.Provider>\n );\n}\n"],"mappings":";;;;;AA6CA,IAAM,IAAiB,EAA0C,IAAI;AAoCrE,SAAgB,EAAc,EAC1B,UACA,YACA,gBACA,YACA,WAAQ,GACR,WAAQ,SACR,OACA,cACA,GAAG,KACgB;CACnB,IAAM,IAAS,EAAM,GACf,IAAU,EAAW,CAAc,GACnC,IAAW,EAAQ,GACnB,IAAc,MAAY,QAAQ,KAAY,EAAQ,MAAM,CAAM,GAClE,IAAY,MAAO,IAAc,EAAQ,YAAY,IACrD,IAAW,GAAS;CAK1B,IAJA,QAAsB;EACd,IAAC,KAAa,GAClB,OAAO,EAAS,CAAS;CAC7B,GAAG;EAAC;EAAU;EAAU;CAAS,CAAC,GAC9B,CAAC,KAAS,CAAC,KAAW,CAAC,KAAe,CAAC,GAAS,OAAO;CAC3D,IAAM,IAAU,IAAI;CACpB,OACI,kBAAC,UAAD;EACI,WAAW,EAAG,EAAO,QAAQ,MAAU,YAAY,EAAO,QAAQ,CAAS;EAC3E,GAAI;EAFR,UAAA,CAII,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAvB,UAAA;IACK,KAAW,kBAAC,OAAD;KAAK,WAAW,EAAO;KAAU,UAAA;IAAa,CAAA;IACzD,KACG,kBAAC,GAAD;KAAS,IAAI;KAAW,WAAW,EAAO;KACrC,UAAA;IACI,CAAA;IAEZ,KAAe,kBAAC,KAAD;KAAG,WAAW,EAAO;KAAc,UAAA;IAAe,CAAA;GACjE;EACJ,CAAA,GAAA,KAAW,kBAAC,OAAD;GAAK,WAAW,EAAO;GAAU,UAAA;EAAa,CAAA,CACtD;;AAEhB;AAiEA,SAAgB,EAAQ,EAAE,aAAU,SAAM,GAAG,KAAuB;CAChE,IAAM,IAAY,EAAM,GAClB,IAAW,EAAsB,IAAI,GACrC,CAAC,GAAY,KAAiB,EAA0B,IAAI,GAC5D,IAAU,SACL;EACH;EACA,QAAQ,OACJ,EAAS,YAAY,GACd,EAAS,YAAY;EAEhC,WAAW,OACP,GAAe,MAAY,CAAC,GAAI,KAAW,CAAC,GAAI,CAAE,CAAC,SAE/C,GAAe,OAAa,KAAW,CAAC,EAAA,CAAG,QAAQ,MAAU,MAAU,CAAE,CAAC;CAEtF,IACA,CAAC,CAAS,CACd;CACA,QAAsB;EAClB,GAAe,MAAY,KAAW,CAAC,CAAC;CAC5C,GAAG,CAAC,CAAC;CACL,IAAM,IAAQ,EAAM,uBAAuB,KAAA,KAAa,EAAM,kBAAkB,KAAA,GAC1E,IAAa,MAAe,OAAO,IAAY,EAAW;CAChE,OACI,kBAAC,EAAe,UAAhB;EAAyB,OAAO;EAC5B,UAAA,kBAAC,WAAD;GACI,mBAAiB,IAAQ,KAAA,IAAY;GACrC,qBAAmB;GACnB,GAAI;GAEH;EACI,CAAA;CACY,CAAA;AAEjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tour.module.cjs","names":[],"sources":["../../../src/components/Tour/Tour.module.css"],"sourcesContent":[".root {\n position: fixed;\n inset: 0;\n z-index: var(--tempest-z-modal, 1000);\n font-family: var(--tempest-font-sans);\n pointer-events: none;\n}\n\n/*\n * The dimmed area is four rectangles, each one hit-testable, so the page behind is\n * blocked while the highlighted element stays clickable. A single overlay with a\n * `box-shadow` hole looks the same and blocks nothing: a shadow is not hit-tested.\n */\n.backdrop {\n position: fixed;\n background-color: var(--tempest-tour-backdrop, rgb(0 0 0 / 55%));\n pointer-events: auto;\n}\n\n.spotlight {\n position: fixed;\n border-radius: var(--tempest-radius-md);\n box-shadow: 0 0 0 2px var(--tempest-primary);\n pointer-events: none;\n}\n\n.card {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n width: min(22rem, calc(100vw - 2rem));\n padding: var(--tempest-space-4);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-lg);\n color: var(--tempest-text);\n pointer-events: auto;\n}\n\n.card:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"Tour.module.cjs","names":[],"sources":["../../../src/components/Tour/Tour.module.css"],"sourcesContent":[".root {\n position: fixed;\n inset: 0;\n z-index: var(--tempest-z-modal, 1000);\n font-family: var(--tempest-font-sans);\n pointer-events: none;\n}\n\n/*\n * The dimmed area is four rectangles, each one hit-testable, so the page behind is\n * blocked while the highlighted element stays clickable. A single overlay with a\n * `box-shadow` hole looks the same and blocks nothing: a shadow is not hit-tested.\n */\n.backdrop {\n position: fixed;\n background-color: var(--tempest-tour-backdrop, rgb(0 0 0 / 55%));\n pointer-events: auto;\n}\n\n.spotlight {\n position: fixed;\n border-radius: var(--tempest-radius-md);\n box-shadow: 0 0 0 2px var(--tempest-primary);\n pointer-events: none;\n}\n\n.card {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n width: min(22rem, calc(100vw - 2rem));\n padding: var(--tempest-space-4);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-lg);\n color: var(--tempest-text);\n pointer-events: auto;\n}\n\n.card:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: var(--tempest-focus-ring-offset);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-2);\n}\n\n.progress {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-xs);\n font-variant-numeric: tabular-nums;\n}\n\n.close {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n border: none;\n border-radius: var(--tempest-radius-sm);\n background: none;\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-lg);\n line-height: 1;\n cursor: pointer;\n}\n\n.close:hover {\n background-color: var(--tempest-surface);\n color: var(--tempest-text);\n}\n\n.title {\n margin: 0;\n font-size: var(--tempest-text-base);\n font-weight: var(--tempest-weight-semibold);\n}\n\n.body {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n line-height: var(--tempest-leading-normal);\n}\n\n.footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-3);\n margin-block-start: var(--tempest-space-2);\n}\n\n.actions {\n display: flex;\n gap: var(--tempest-space-2);\n margin-inline-start: auto;\n}\n\n.skip {\n padding: 0;\n border: none;\n background: none;\n color: var(--tempest-text-muted);\n font: inherit;\n font-size: var(--tempest-text-xs);\n text-decoration: underline;\n cursor: pointer;\n}\n\n.primary,\n.secondary {\n padding: var(--tempest-space-2) var(--tempest-space-4);\n border-radius: var(--tempest-radius-md);\n font: inherit;\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n cursor: pointer;\n}\n\n.primary {\n border: none;\n background-color: var(--tempest-primary);\n color: var(--tempest-primary-foreground);\n}\n\n.secondary {\n border: 1px solid var(--tempest-border);\n background-color: var(--tempest-bg);\n color: var(--tempest-text);\n}\n\n.primary:focus-visible,\n.secondary:focus-visible,\n.skip:focus-visible,\n.close:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: var(--tempest-focus-ring-offset);\n}\n\n/* The spotlight ring is decoration; a reader who asked for less motion gets none. */\n@media (prefers-reduced-motion: no-preference) {\n .spotlight {\n transition:\n top var(--tempest-duration-base) var(--tempest-ease-out),\n left var(--tempest-duration-base) var(--tempest-ease-out),\n width var(--tempest-duration-base) var(--tempest-ease-out),\n height var(--tempest-duration-base) var(--tempest-ease-out);\n }\n\n .card {\n transition:\n top var(--tempest-duration-base) var(--tempest-ease-out),\n left var(--tempest-duration-base) var(--tempest-ease-out);\n }\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tour.module.js","names":[],"sources":["../../../src/components/Tour/Tour.module.css"],"sourcesContent":[".root {\n position: fixed;\n inset: 0;\n z-index: var(--tempest-z-modal, 1000);\n font-family: var(--tempest-font-sans);\n pointer-events: none;\n}\n\n/*\n * The dimmed area is four rectangles, each one hit-testable, so the page behind is\n * blocked while the highlighted element stays clickable. A single overlay with a\n * `box-shadow` hole looks the same and blocks nothing: a shadow is not hit-tested.\n */\n.backdrop {\n position: fixed;\n background-color: var(--tempest-tour-backdrop, rgb(0 0 0 / 55%));\n pointer-events: auto;\n}\n\n.spotlight {\n position: fixed;\n border-radius: var(--tempest-radius-md);\n box-shadow: 0 0 0 2px var(--tempest-primary);\n pointer-events: none;\n}\n\n.card {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n width: min(22rem, calc(100vw - 2rem));\n padding: var(--tempest-space-4);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-lg);\n color: var(--tempest-text);\n pointer-events: auto;\n}\n\n.card:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"Tour.module.js","names":[],"sources":["../../../src/components/Tour/Tour.module.css"],"sourcesContent":[".root {\n position: fixed;\n inset: 0;\n z-index: var(--tempest-z-modal, 1000);\n font-family: var(--tempest-font-sans);\n pointer-events: none;\n}\n\n/*\n * The dimmed area is four rectangles, each one hit-testable, so the page behind is\n * blocked while the highlighted element stays clickable. A single overlay with a\n * `box-shadow` hole looks the same and blocks nothing: a shadow is not hit-tested.\n */\n.backdrop {\n position: fixed;\n background-color: var(--tempest-tour-backdrop, rgb(0 0 0 / 55%));\n pointer-events: auto;\n}\n\n.spotlight {\n position: fixed;\n border-radius: var(--tempest-radius-md);\n box-shadow: 0 0 0 2px var(--tempest-primary);\n pointer-events: none;\n}\n\n.card {\n position: fixed;\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n width: min(22rem, calc(100vw - 2rem));\n padding: var(--tempest-space-4);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-lg);\n color: var(--tempest-text);\n pointer-events: auto;\n}\n\n.card:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: var(--tempest-focus-ring-offset);\n}\n\n.header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-2);\n}\n\n.progress {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-xs);\n font-variant-numeric: tabular-nums;\n}\n\n.close {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 1.75rem;\n height: 1.75rem;\n padding: 0;\n border: none;\n border-radius: var(--tempest-radius-sm);\n background: none;\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-lg);\n line-height: 1;\n cursor: pointer;\n}\n\n.close:hover {\n background-color: var(--tempest-surface);\n color: var(--tempest-text);\n}\n\n.title {\n margin: 0;\n font-size: var(--tempest-text-base);\n font-weight: var(--tempest-weight-semibold);\n}\n\n.body {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n line-height: var(--tempest-leading-normal);\n}\n\n.footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-3);\n margin-block-start: var(--tempest-space-2);\n}\n\n.actions {\n display: flex;\n gap: var(--tempest-space-2);\n margin-inline-start: auto;\n}\n\n.skip {\n padding: 0;\n border: none;\n background: none;\n color: var(--tempest-text-muted);\n font: inherit;\n font-size: var(--tempest-text-xs);\n text-decoration: underline;\n cursor: pointer;\n}\n\n.primary,\n.secondary {\n padding: var(--tempest-space-2) var(--tempest-space-4);\n border-radius: var(--tempest-radius-md);\n font: inherit;\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-medium);\n cursor: pointer;\n}\n\n.primary {\n border: none;\n background-color: var(--tempest-primary);\n color: var(--tempest-primary-foreground);\n}\n\n.secondary {\n border: 1px solid var(--tempest-border);\n background-color: var(--tempest-bg);\n color: var(--tempest-text);\n}\n\n.primary:focus-visible,\n.secondary:focus-visible,\n.skip:focus-visible,\n.close:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: var(--tempest-focus-ring-offset);\n}\n\n/* The spotlight ring is decoration; a reader who asked for less motion gets none. */\n@media (prefers-reduced-motion: no-preference) {\n .spotlight {\n transition:\n top var(--tempest-duration-base) var(--tempest-ease-out),\n left var(--tempest-duration-base) var(--tempest-ease-out),\n width var(--tempest-duration-base) var(--tempest-ease-out),\n height var(--tempest-duration-base) var(--tempest-ease-out);\n }\n\n .card {\n transition:\n top var(--tempest-duration-base) var(--tempest-ease-out),\n left var(--tempest-duration-base) var(--tempest-ease-out);\n }\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transfer.module.cjs","names":[],"sources":["../../../src/components/Transfer/Transfer.module.css"],"sourcesContent":[".wrapper {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n gap: var(--tempest-space-3);\n align-items: stretch;\n font-family: var(--tempest-font-sans);\n}\n\n/*\n * The move controls sit between the panes in the grid, but come **last** in the\n * DOM: a keyboard reaching the buttons before it has seen what they act on has to\n * go back, and a screen reader reads \"move checked to the right\" with no idea what\n * is checked. Order 2 puts them back in the middle visually.\n */\n.controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: var(--tempest-space-2);\n order: 2;\n}\n\n.pane {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n min-width: 0;\n padding: var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n}\n\n.pane:first-of-type {\n order: 1;\n}\n\n.pane:last-of-type {\n order: 3;\n}\n\n.paneHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.paneTitle {\n display: flex;\n align-items: center;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.title {\n margin: 0;\n overflow: hidden;\n color: var(--tempest-text);\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-semibold);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.count {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-xs);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.search {\n width: 100%;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background-color: var(--tempest-bg);\n color: inherit;\n font: inherit;\n font-size: var(--tempest-text-sm);\n}\n\n.search:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"Transfer.module.cjs","names":[],"sources":["../../../src/components/Transfer/Transfer.module.css"],"sourcesContent":[".wrapper {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n gap: var(--tempest-space-3);\n align-items: stretch;\n font-family: var(--tempest-font-sans);\n}\n\n/*\n * The move controls sit between the panes in the grid, but come **last** in the\n * DOM: a keyboard reaching the buttons before it has seen what they act on has to\n * go back, and a screen reader reads \"move checked to the right\" with no idea what\n * is checked. Order 2 puts them back in the middle visually.\n */\n.controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: var(--tempest-space-2);\n order: 2;\n}\n\n.pane {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n min-width: 0;\n padding: var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n}\n\n.pane:first-of-type {\n order: 1;\n}\n\n.pane:last-of-type {\n order: 3;\n}\n\n.paneHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.paneTitle {\n display: flex;\n align-items: center;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.title {\n margin: 0;\n overflow: hidden;\n color: var(--tempest-text);\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-semibold);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.count {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-xs);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.search {\n width: 100%;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background-color: var(--tempest-bg);\n color: inherit;\n font: inherit;\n font-size: var(--tempest-text-sm);\n}\n\n.search:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: calc(var(--tempest-focus-ring-width) * -1);\n}\n\n.list {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n margin: 0;\n padding: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n list-style: none;\n}\n\n.row {\n padding: var(--tempest-space-1) var(--tempest-space-2);\n border-radius: var(--tempest-radius-sm);\n font-size: var(--tempest-text-sm);\n}\n\n.row:hover {\n background-color: var(--tempest-surface);\n}\n\n.empty {\n padding: var(--tempest-space-4) var(--tempest-space-2);\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n text-align: center;\n}\n\n.control {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--tempest-control-height-sm);\n height: var(--tempest-control-height-sm);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background-color: var(--tempest-bg);\n color: var(--tempest-text);\n font-size: var(--tempest-text-base);\n line-height: 1;\n cursor: pointer;\n}\n\n.control:hover:not(:disabled) {\n border-color: var(--tempest-primary);\n color: var(--tempest-primary);\n}\n\n.control:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: 1px;\n}\n\n.control:disabled {\n color: var(--tempest-text-subtle);\n cursor: not-allowed;\n}\n\n/*\n * Below the md breakpoint the panes stack and the controls turn horizontal: two\n * 16rem lists side by side on a phone leave each about 150px wide, where a role\n * name wraps to three lines.\n */\n@media (max-width: 640px) {\n .wrapper {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .controls {\n flex-direction: row;\n justify-content: center;\n }\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Transfer.module.js","names":[],"sources":["../../../src/components/Transfer/Transfer.module.css"],"sourcesContent":[".wrapper {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n gap: var(--tempest-space-3);\n align-items: stretch;\n font-family: var(--tempest-font-sans);\n}\n\n/*\n * The move controls sit between the panes in the grid, but come **last** in the\n * DOM: a keyboard reaching the buttons before it has seen what they act on has to\n * go back, and a screen reader reads \"move checked to the right\" with no idea what\n * is checked. Order 2 puts them back in the middle visually.\n */\n.controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: var(--tempest-space-2);\n order: 2;\n}\n\n.pane {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n min-width: 0;\n padding: var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n}\n\n.pane:first-of-type {\n order: 1;\n}\n\n.pane:last-of-type {\n order: 3;\n}\n\n.paneHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.paneTitle {\n display: flex;\n align-items: center;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.title {\n margin: 0;\n overflow: hidden;\n color: var(--tempest-text);\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-semibold);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.count {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-xs);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.search {\n width: 100%;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background-color: var(--tempest-bg);\n color: inherit;\n font: inherit;\n font-size: var(--tempest-text-sm);\n}\n\n.search:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"Transfer.module.js","names":[],"sources":["../../../src/components/Transfer/Transfer.module.css"],"sourcesContent":[".wrapper {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n gap: var(--tempest-space-3);\n align-items: stretch;\n font-family: var(--tempest-font-sans);\n}\n\n/*\n * The move controls sit between the panes in the grid, but come **last** in the\n * DOM: a keyboard reaching the buttons before it has seen what they act on has to\n * go back, and a screen reader reads \"move checked to the right\" with no idea what\n * is checked. Order 2 puts them back in the middle visually.\n */\n.controls {\n display: flex;\n flex-direction: column;\n justify-content: center;\n gap: var(--tempest-space-2);\n order: 2;\n}\n\n.pane {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-2);\n min-width: 0;\n padding: var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n}\n\n.pane:first-of-type {\n order: 1;\n}\n\n.pane:last-of-type {\n order: 3;\n}\n\n.paneHeader {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.paneTitle {\n display: flex;\n align-items: center;\n gap: var(--tempest-space-2);\n min-width: 0;\n}\n\n.title {\n margin: 0;\n overflow: hidden;\n color: var(--tempest-text);\n font-size: var(--tempest-text-sm);\n font-weight: var(--tempest-weight-semibold);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.count {\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-xs);\n font-variant-numeric: tabular-nums;\n white-space: nowrap;\n}\n\n.search {\n width: 100%;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background-color: var(--tempest-bg);\n color: inherit;\n font: inherit;\n font-size: var(--tempest-text-sm);\n}\n\n.search:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: calc(var(--tempest-focus-ring-width) * -1);\n}\n\n.list {\n display: flex;\n flex-direction: column;\n gap: var(--tempest-space-1);\n margin: 0;\n padding: 0;\n overflow-y: auto;\n overscroll-behavior: contain;\n list-style: none;\n}\n\n.row {\n padding: var(--tempest-space-1) var(--tempest-space-2);\n border-radius: var(--tempest-radius-sm);\n font-size: var(--tempest-text-sm);\n}\n\n.row:hover {\n background-color: var(--tempest-surface);\n}\n\n.empty {\n padding: var(--tempest-space-4) var(--tempest-space-2);\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n text-align: center;\n}\n\n.control {\n display: flex;\n align-items: center;\n justify-content: center;\n width: var(--tempest-control-height-sm);\n height: var(--tempest-control-height-sm);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background-color: var(--tempest-bg);\n color: var(--tempest-text);\n font-size: var(--tempest-text-base);\n line-height: 1;\n cursor: pointer;\n}\n\n.control:hover:not(:disabled) {\n border-color: var(--tempest-primary);\n color: var(--tempest-primary);\n}\n\n.control:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: 1px;\n}\n\n.control:disabled {\n color: var(--tempest-text-subtle);\n cursor: not-allowed;\n}\n\n/*\n * Below the md breakpoint the panes stack and the controls turn horizontal: two\n * 16rem lists side by side on a phone leave each about 150px wide, where a role\n * name wraps to three lines.\n */\n@media (max-width: 640px) {\n .wrapper {\n grid-template-columns: minmax(0, 1fr);\n }\n\n .controls {\n flex-direction: row;\n justify-content: center;\n }\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTable.module.cjs","names":[],"sources":["../../../src/components/VirtualTable/VirtualTable.module.css"],"sourcesContent":[".scroll {\n width: 100%;\n overflow: auto;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-xs);\n}\n\n.table {\n width: 100%;\n border-collapse: separate;\n border-spacing: 0;\n font-family: var(--tempest-font-sans);\n font-size: var(--tempest-text-base);\n line-height: var(--tempest-leading-snug);\n /*\n * Fixed layout is what keeps columns from jumping mid-scroll: with `auto`,\n * the browser sizes each column from the rows currently in the DOM, and a\n * virtualized table swaps those rows out as you scroll.\n */\n table-layout: fixed;\n}\n\n.caption {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border-width: 0;\n}\n\n/*\n * `border-collapse: separate` above exists for this: a sticky `<th>` inside a\n * collapsed table loses its bottom border while scrolling, because the shared\n * border belongs to the cell that scrolled away.\n */\n.head .th {\n position: sticky;\n top: 0;\n z-index: 1;\n}\n\n.th,\n.td {\n padding: 0 var(--tempest-space-4);\n text-align: left;\n border-bottom: 1px solid var(--tempest-border);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.th {\n padding-block: var(--tempest-space-3);\n background-color: var(--tempest-surface);\n color: var(--tempest-text-muted);\n font-weight: var(--tempest-weight-semibold);\n font-size: var(--tempest-text-xs);\n letter-spacing: var(--tempest-tracking-wider);\n text-transform: uppercase;\n}\n\n.alignRight {\n text-align: right;\n}\n\n.alignCenter {\n text-align: center;\n}\n\n.sortButton {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-1);\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n cursor: pointer;\n}\n\n.sortButton:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"VirtualTable.module.cjs","names":[],"sources":["../../../src/components/VirtualTable/VirtualTable.module.css"],"sourcesContent":[".scroll {\n width: 100%;\n overflow: auto;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-xs);\n}\n\n.table {\n width: 100%;\n border-collapse: separate;\n border-spacing: 0;\n font-family: var(--tempest-font-sans);\n font-size: var(--tempest-text-base);\n line-height: var(--tempest-leading-snug);\n /*\n * Fixed layout is what keeps columns from jumping mid-scroll: with `auto`,\n * the browser sizes each column from the rows currently in the DOM, and a\n * virtualized table swaps those rows out as you scroll.\n */\n table-layout: fixed;\n}\n\n.caption {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border-width: 0;\n}\n\n/*\n * `border-collapse: separate` above exists for this: a sticky `<th>` inside a\n * collapsed table loses its bottom border while scrolling, because the shared\n * border belongs to the cell that scrolled away.\n */\n.head .th {\n position: sticky;\n top: 0;\n z-index: 1;\n}\n\n.th,\n.td {\n padding: 0 var(--tempest-space-4);\n text-align: left;\n border-bottom: 1px solid var(--tempest-border);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.th {\n padding-block: var(--tempest-space-3);\n background-color: var(--tempest-surface);\n color: var(--tempest-text-muted);\n font-weight: var(--tempest-weight-semibold);\n font-size: var(--tempest-text-xs);\n letter-spacing: var(--tempest-tracking-wider);\n text-transform: uppercase;\n}\n\n.alignRight {\n text-align: right;\n}\n\n.alignCenter {\n text-align: center;\n}\n\n.sortButton {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-1);\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n cursor: pointer;\n}\n\n.sortButton:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: var(--tempest-focus-ring-offset);\n border-radius: var(--tempest-radius-sm);\n}\n\n.sortIndicator {\n font-size: var(--tempest-text-xs);\n opacity: 0.55;\n}\n\n.tr.clickable {\n cursor: pointer;\n transition: background-color var(--tempest-duration-fast) var(--tempest-ease-out);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .tr.clickable:hover {\n background-color: var(--tempest-surface);\n }\n}\n\n.tr.clickable:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: calc(var(--tempest-focus-ring-width) * -1);\n}\n\n.emptyRow {\n padding: var(--tempest-space-8) var(--tempest-space-4);\n text-align: center;\n color: var(--tempest-text-muted);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tr.clickable {\n transition: none;\n }\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VirtualTable.module.js","names":[],"sources":["../../../src/components/VirtualTable/VirtualTable.module.css"],"sourcesContent":[".scroll {\n width: 100%;\n overflow: auto;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-xs);\n}\n\n.table {\n width: 100%;\n border-collapse: separate;\n border-spacing: 0;\n font-family: var(--tempest-font-sans);\n font-size: var(--tempest-text-base);\n line-height: var(--tempest-leading-snug);\n /*\n * Fixed layout is what keeps columns from jumping mid-scroll: with `auto`,\n * the browser sizes each column from the rows currently in the DOM, and a\n * virtualized table swaps those rows out as you scroll.\n */\n table-layout: fixed;\n}\n\n.caption {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border-width: 0;\n}\n\n/*\n * `border-collapse: separate` above exists for this: a sticky `<th>` inside a\n * collapsed table loses its bottom border while scrolling, because the shared\n * border belongs to the cell that scrolled away.\n */\n.head .th {\n position: sticky;\n top: 0;\n z-index: 1;\n}\n\n.th,\n.td {\n padding: 0 var(--tempest-space-4);\n text-align: left;\n border-bottom: 1px solid var(--tempest-border);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.th {\n padding-block: var(--tempest-space-3);\n background-color: var(--tempest-surface);\n color: var(--tempest-text-muted);\n font-weight: var(--tempest-weight-semibold);\n font-size: var(--tempest-text-xs);\n letter-spacing: var(--tempest-tracking-wider);\n text-transform: uppercase;\n}\n\n.alignRight {\n text-align: right;\n}\n\n.alignCenter {\n text-align: center;\n}\n\n.sortButton {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-1);\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n cursor: pointer;\n}\n\n.sortButton:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"VirtualTable.module.js","names":[],"sources":["../../../src/components/VirtualTable/VirtualTable.module.css"],"sourcesContent":[".scroll {\n width: 100%;\n overflow: auto;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n background-color: var(--tempest-bg);\n box-shadow: var(--tempest-shadow-xs);\n}\n\n.table {\n width: 100%;\n border-collapse: separate;\n border-spacing: 0;\n font-family: var(--tempest-font-sans);\n font-size: var(--tempest-text-base);\n line-height: var(--tempest-leading-snug);\n /*\n * Fixed layout is what keeps columns from jumping mid-scroll: with `auto`,\n * the browser sizes each column from the rows currently in the DOM, and a\n * virtualized table swaps those rows out as you scroll.\n */\n table-layout: fixed;\n}\n\n.caption {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border-width: 0;\n}\n\n/*\n * `border-collapse: separate` above exists for this: a sticky `<th>` inside a\n * collapsed table loses its bottom border while scrolling, because the shared\n * border belongs to the cell that scrolled away.\n */\n.head .th {\n position: sticky;\n top: 0;\n z-index: 1;\n}\n\n.th,\n.td {\n padding: 0 var(--tempest-space-4);\n text-align: left;\n border-bottom: 1px solid var(--tempest-border);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.th {\n padding-block: var(--tempest-space-3);\n background-color: var(--tempest-surface);\n color: var(--tempest-text-muted);\n font-weight: var(--tempest-weight-semibold);\n font-size: var(--tempest-text-xs);\n letter-spacing: var(--tempest-tracking-wider);\n text-transform: uppercase;\n}\n\n.alignRight {\n text-align: right;\n}\n\n.alignCenter {\n text-align: center;\n}\n\n.sortButton {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-1);\n padding: 0;\n border: none;\n background: none;\n color: inherit;\n font: inherit;\n letter-spacing: inherit;\n text-transform: inherit;\n cursor: pointer;\n}\n\n.sortButton:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: var(--tempest-focus-ring-offset);\n border-radius: var(--tempest-radius-sm);\n}\n\n.sortIndicator {\n font-size: var(--tempest-text-xs);\n opacity: 0.55;\n}\n\n.tr.clickable {\n cursor: pointer;\n transition: background-color var(--tempest-duration-fast) var(--tempest-ease-out);\n}\n\n@media (hover: hover) and (pointer: fine) {\n .tr.clickable:hover {\n background-color: var(--tempest-surface);\n }\n}\n\n.tr.clickable:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: calc(var(--tempest-focus-ring-width) * -1);\n}\n\n.emptyRow {\n padding: var(--tempest-space-8) var(--tempest-space-4);\n text-align: center;\n color: var(--tempest-text-muted);\n}\n\n@media (prefers-reduced-motion: reduce) {\n .tr.clickable {\n transition: none;\n }\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrajectoryMap.module.cjs","names":[],"sources":["../../src/geo/TrajectoryMap.module.css"],"sourcesContent":[".map {\n position: relative;\n width: 100%;\n overflow: hidden;\n background: var(--tempest-surface-2);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n font-family: var(--tempest-font-sans);\n}\n\n.svg {\n display: block;\n width: 100%;\n}\n\n.empty,\n.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n}\n\n.grid line {\n stroke: var(--tempest-border);\n stroke-width: 1;\n stroke-dasharray: 3 5;\n opacity: 0.5;\n}\n\n.path {\n stroke: var(--tempest-primary);\n stroke-width: 3;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.start {\n fill: var(--tempest-success-solid);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.end {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.current {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.pulse {\n fill: var(--tempest-primary);\n opacity: 0.25;\n transform-origin: center;\n transform-box: fill-box;\n animation: tempest-geo-pulse 1.8s ease-out infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .pulse {\n animation: none;\n }\n}\n\n@keyframes tempest-geo-pulse {\n 0% {\n transform: scale(0.6);\n opacity: 0.35;\n }\n 100% {\n transform: scale(1.6);\n opacity: 0;\n }\n}\n\n.marker {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.marker[role=\"button\"] {\n cursor: pointer;\n}\n\n.marker[role=\"button\"]:focus-visible {\n outline: none;\n stroke: var(--tempest-
|
|
1
|
+
{"version":3,"file":"TrajectoryMap.module.cjs","names":[],"sources":["../../src/geo/TrajectoryMap.module.css"],"sourcesContent":[".map {\n position: relative;\n width: 100%;\n overflow: hidden;\n background: var(--tempest-surface-2);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n font-family: var(--tempest-font-sans);\n}\n\n.svg {\n display: block;\n width: 100%;\n}\n\n.empty,\n.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n}\n\n.grid line {\n stroke: var(--tempest-border);\n stroke-width: 1;\n stroke-dasharray: 3 5;\n opacity: 0.5;\n}\n\n.path {\n stroke: var(--tempest-primary);\n stroke-width: 3;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.start {\n fill: var(--tempest-success-solid);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.end {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.current {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.pulse {\n fill: var(--tempest-primary);\n opacity: 0.25;\n transform-origin: center;\n transform-box: fill-box;\n animation: tempest-geo-pulse 1.8s ease-out infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .pulse {\n animation: none;\n }\n}\n\n@keyframes tempest-geo-pulse {\n 0% {\n transform: scale(0.6);\n opacity: 0.35;\n }\n 100% {\n transform: scale(1.6);\n opacity: 0;\n }\n}\n\n.marker {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.marker[role=\"button\"] {\n cursor: pointer;\n}\n\n.marker[role=\"button\"]:focus-visible {\n outline: none;\n stroke: var(--tempest-focus-ring-color);\n stroke-width: 3;\n}\n\n.scale line {\n stroke: var(--tempest-text);\n stroke-width: 2;\n}\n\n.scale text {\n fill: var(--tempest-text);\n font-size: var(--tempest-text-xs);\n font-family: var(--tempest-font-sans);\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrajectoryMap.module.js","names":[],"sources":["../../src/geo/TrajectoryMap.module.css"],"sourcesContent":[".map {\n position: relative;\n width: 100%;\n overflow: hidden;\n background: var(--tempest-surface-2);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n font-family: var(--tempest-font-sans);\n}\n\n.svg {\n display: block;\n width: 100%;\n}\n\n.empty,\n.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n}\n\n.grid line {\n stroke: var(--tempest-border);\n stroke-width: 1;\n stroke-dasharray: 3 5;\n opacity: 0.5;\n}\n\n.path {\n stroke: var(--tempest-primary);\n stroke-width: 3;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.start {\n fill: var(--tempest-success-solid);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.end {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.current {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.pulse {\n fill: var(--tempest-primary);\n opacity: 0.25;\n transform-origin: center;\n transform-box: fill-box;\n animation: tempest-geo-pulse 1.8s ease-out infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .pulse {\n animation: none;\n }\n}\n\n@keyframes tempest-geo-pulse {\n 0% {\n transform: scale(0.6);\n opacity: 0.35;\n }\n 100% {\n transform: scale(1.6);\n opacity: 0;\n }\n}\n\n.marker {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.marker[role=\"button\"] {\n cursor: pointer;\n}\n\n.marker[role=\"button\"]:focus-visible {\n outline: none;\n stroke: var(--tempest-
|
|
1
|
+
{"version":3,"file":"TrajectoryMap.module.js","names":[],"sources":["../../src/geo/TrajectoryMap.module.css"],"sourcesContent":[".map {\n position: relative;\n width: 100%;\n overflow: hidden;\n background: var(--tempest-surface-2);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-lg);\n font-family: var(--tempest-font-sans);\n}\n\n.svg {\n display: block;\n width: 100%;\n}\n\n.empty,\n.loading {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 100%;\n color: var(--tempest-text-muted);\n font-size: var(--tempest-text-sm);\n}\n\n.grid line {\n stroke: var(--tempest-border);\n stroke-width: 1;\n stroke-dasharray: 3 5;\n opacity: 0.5;\n}\n\n.path {\n stroke: var(--tempest-primary);\n stroke-width: 3;\n stroke-linecap: round;\n stroke-linejoin: round;\n}\n\n.start {\n fill: var(--tempest-success-solid);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.end {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.current {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.pulse {\n fill: var(--tempest-primary);\n opacity: 0.25;\n transform-origin: center;\n transform-box: fill-box;\n animation: tempest-geo-pulse 1.8s ease-out infinite;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .pulse {\n animation: none;\n }\n}\n\n@keyframes tempest-geo-pulse {\n 0% {\n transform: scale(0.6);\n opacity: 0.35;\n }\n 100% {\n transform: scale(1.6);\n opacity: 0;\n }\n}\n\n.marker {\n fill: var(--tempest-primary);\n stroke: var(--tempest-surface);\n stroke-width: 2;\n}\n\n.marker[role=\"button\"] {\n cursor: pointer;\n}\n\n.marker[role=\"button\"]:focus-visible {\n outline: none;\n stroke: var(--tempest-focus-ring-color);\n stroke-width: 3;\n}\n\n.scale line {\n stroke: var(--tempest-text);\n stroke-width: 2;\n}\n\n.scale text {\n fill: var(--tempest-text);\n font-size: var(--tempest-text-xs);\n font-family: var(--tempest-font-sans);\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconPicker.module.cjs","names":[],"sources":["../../src/icons/IconPicker.module.css"],"sourcesContent":[".picker {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-2);\n font-family: var(--tempest-font-sans);\n}\n\n.preview {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 34px;\n height: 34px;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n}\n\n.input {\n flex: 1 1 auto;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-bg);\n color: var(--tempest-text);\n font-family: inherit;\n font-size: var(--tempest-text-sm);\n min-height: 34px;\n}\n\n.input:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"IconPicker.module.cjs","names":[],"sources":["../../src/icons/IconPicker.module.css"],"sourcesContent":[".picker {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-2);\n font-family: var(--tempest-font-sans);\n}\n\n.preview {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 34px;\n height: 34px;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n}\n\n.input {\n flex: 1 1 auto;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-bg);\n color: var(--tempest-text);\n font-family: inherit;\n font-size: var(--tempest-text-sm);\n min-height: 34px;\n}\n\n.input:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: 1px;\n}\n\n.input[aria-invalid=\"true\"] {\n border-color: var(--tempest-danger);\n}\n"],"mappings":";"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconPicker.module.js","names":[],"sources":["../../src/icons/IconPicker.module.css"],"sourcesContent":[".picker {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-2);\n font-family: var(--tempest-font-sans);\n}\n\n.preview {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 34px;\n height: 34px;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n}\n\n.input {\n flex: 1 1 auto;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-bg);\n color: var(--tempest-text);\n font-family: inherit;\n font-size: var(--tempest-text-sm);\n min-height: 34px;\n}\n\n.input:focus-visible {\n outline:
|
|
1
|
+
{"version":3,"file":"IconPicker.module.js","names":[],"sources":["../../src/icons/IconPicker.module.css"],"sourcesContent":[".picker {\n display: inline-flex;\n align-items: center;\n gap: var(--tempest-space-2);\n font-family: var(--tempest-font-sans);\n}\n\n.preview {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n flex: 0 0 auto;\n width: 34px;\n height: 34px;\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-surface);\n color: var(--tempest-text);\n}\n\n.input {\n flex: 1 1 auto;\n min-width: 0;\n padding: var(--tempest-space-2) var(--tempest-space-3);\n border: 1px solid var(--tempest-border);\n border-radius: var(--tempest-radius-md);\n background: var(--tempest-bg);\n color: var(--tempest-text);\n font-family: inherit;\n font-size: var(--tempest-text-sm);\n min-height: 34px;\n}\n\n.input:focus-visible {\n outline: var(--tempest-focus-ring-width) solid var(--tempest-focus-ring-color);\n outline-offset: 1px;\n}\n\n.input[aria-invalid=\"true\"] {\n border-color: var(--tempest-danger);\n}\n"],"mappings":";"}
|
package/dist/neural.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("@sapphi-red/web-noise-suppressor");function t(){return typeof AudioWorkletNode<`u`&&typeof window<`u`&&window.isSecureContext}var n=null,r=new WeakMap;async function i(t,i){let a=r.get(t);return a||(a=t.audioWorklet.addModule(i.workletUrl).then(()=>void 0,e=>{throw r.delete(t),e}),r.set(t,a)),await a,n===null&&(n=(0,e.loadRnnoise)({url:i.wasmUrl,simdUrl:i.simdWasmUrl}).catch(e=>{throw n=null,e})),n}async function a(t,n,r,a){if(t.sampleRate!==48e3)return null;let o;try{o=await i(t,r)}catch{return null}let s;try{s=new e.RnnoiseWorkletNode(t,{maxChannels:a.maxChannels,wasmBinary:o})}catch{return null}let c=t.createMediaStreamSource(new MediaStream([n])),l=t.createMediaStreamDestination();c.connect(s),s.connect(l);let u=l.stream.getAudioTracks()[0];return u?(u.contentHint=n.contentHint,{track:u,release:()=>{c.disconnect(),s.disconnect(),l.disconnect(),s.destroy(),u.stop()}}):(c.disconnect(),s.disconnect(),l.disconnect(),s.destroy(),null)}exports.createNeuralSuppressor=a,exports.isNeuralSuppressionSupported=t,exports.prepareNeuralSuppressor=i;
|
|
2
|
+
//# sourceMappingURL=neural.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"neural.cjs","names":[],"sources":["../src/neural/index.ts"],"sourcesContent":["import { RnnoiseWorkletNode, loadRnnoise } from \"@sapphi-red/web-noise-suppressor\";\n\n/**\n * Where the suppressor's three pieces live, as URLs a bundler hands over.\n *\n * The `@sapphi-red/web-noise-suppressor` package ships the runnable assets next\n * to its code, but it cannot say where they are from inside a library: the\n * `?url` suffix that resolves a module to its served address is a bundler\n * feature, and every bundler answers it differently. So this subpath takes the\n * three resolved addresses as arguments and does the honest part — the graph,\n * the load-once semantics, the per-context registration — here.\n */\nexport interface NeuralSuppressorAssets {\n /**\n * The `AudioWorklet` processor module the model runs its DSP in\n * (`rnnoiseWorklet.js`).\n */\n workletUrl: string;\n /** The SIMD build of the model's wasm (`rnnoise_simd.wasm`). */\n simdWasmUrl: string;\n /** The baseline build, used where the engine lacks SIMD (`rnnoise.wasm`). */\n wasmUrl: string;\n}\n\n/**\n * Whether this browser can run a worklet-based noise suppressor.\n *\n * Answered from the two things the path needs that nothing but the platform can\n * supply: `AudioWorkletNode` runs custom DSP on the audio thread, and a secure\n * context is what the browser requires before letting a module near the\n * microphone graph. Everything else — the models, the wasm — ships with the\n * caller, so it cannot be missing. The context must also run at 48 kHz, which\n * is checked at build time rather than here because the caller owns how its\n * context was opened.\n *\n * Deliberately conservative: anything it cannot establish answers `false`, and\n * a `false` sends the caller back to the browser's own `noiseSuppression`\n * constraint, which is weaker but always there.\n *\n * @returns True when a neural suppressor can be built on top of a capture.\n */\nexport function isNeuralSuppressionSupported(): boolean {\n return (\n typeof AudioWorkletNode !== \"undefined\" &&\n typeof window !== \"undefined\" &&\n window.isSecureContext\n );\n}\n\n/**\n * The one wasm binary every suppressor shares, fetched once.\n *\n * `loadRnnoise` compiles the whole model, and the answer is identical for every\n * graph that opens afterwards — a mesh can build a suppressor per published\n * track and a settings dialog may build a second for its monitor within a\n * single frame. Held as the promise rather than the result so the first two\n * callers race into one fetch instead of two. Reset on failure, so the next\n * call retries instead of replaying a dead promise.\n */\nlet loadingBinary: Promise<ArrayBuffer> | null = null;\n\n/**\n * The contexts the worklet module has already been registered on, mapped to the\n * registration's own promise.\n *\n * `addModule` is per-context and throws on a name it already holds, so the\n * module records the moment a context is ready and skips the call next time.\n * The promise is what makes a fast caller that cannot wait — a mesh can open a\n * microphone and a preview within a single frame — race into one `addModule`\n * instead of two: had this been a set, the second caller would see the context\n * absent while the first was still awaiting and register the module twice.\n * Mapped to a promise rather than the module itself the way the wasm is,\n * because the registration belongs to one context while the wasm is shared,\n * and nothing here should keep a dead context alive — the value is dropped\n * with the context. On failure the entry is removed, so the next attempt\n * actually retries instead of replaying the broken registration.\n */\nconst readyContexts = new WeakMap<AudioContext, Promise<void>>();\n\n/**\n * The compiled model for this context, loading what is not ready yet.\n *\n * Idempotent across calls: the wasm fetch and the module registration both\n * happen exactly once. The wasm is shared by every suppressor, while the module\n * registration belongs to one context.\n *\n * @param context - The context the suppression graph will run in.\n * @param assets - The resolved asset addresses from {@link NeuralSuppressorAssets}.\n * @returns The compiled model binary, ready to hand to a worklet node.\n * @throws Whatever the fetch or the compile threw, for the caller to fall back on.\n */\nexport async function prepareNeuralSuppressor(\n context: AudioContext,\n assets: NeuralSuppressorAssets,\n): Promise<ArrayBuffer> {\n let ready = readyContexts.get(context);\n if (!ready) {\n ready = context.audioWorklet.addModule(assets.workletUrl).then(\n () => undefined,\n (error: unknown) => {\n readyContexts.delete(context);\n throw error;\n },\n );\n readyContexts.set(context, ready);\n }\n await ready;\n if (loadingBinary === null) {\n loadingBinary = loadRnnoise({ url: assets.wasmUrl, simdUrl: assets.simdWasmUrl }).catch(\n (error: unknown) => {\n loadingBinary = null;\n throw error;\n },\n );\n }\n return loadingBinary;\n}\n\n/**\n * A denoised track plus the graph that has to come down with it.\n *\n * `track` is not the captured one — it is the output of a `MediaStream`\n * destination the worklet feeds — so stopping the published track is not enough\n * to free the microphone. `release` closes the graph; the captured track behind\n * it belongs to the caller.\n */\nexport interface NeuralSuppressor {\n /** The track to publish in place of the captured one. */\n track: MediaStreamTrack;\n /** Tears the graph down. Does not stop the source track it was built from. */\n release(): void;\n}\n\n/**\n * Build a suppressor graph on top of a captured microphone track.\n *\n * The model runs on the audio thread through an `AudioWorkletNode` — a\n * recurrent network trained on speech that separates a voice from everything\n * that is not one: keyboards, fans, traffic, a room full of people. The\n * browser's `noiseSuppression` constraint answers the same question with a\n * stationary-noise gate that either lets a transient through or eats the voice\n * with it.\n *\n * Prefer {@link prepareNeuralSuppressor} before the capture opens: the fallback\n * to the browser's own suppression is a `getUserMedia` constraint, and a\n * constraint cannot be added to a capture that already exists. A caller that\n * did not preload still works — the load happens here, idempotently.\n *\n * The model assumes 48 kHz. A context opened at any other rate answers `null`\n * before anything is fetched, because feeding speech samples of the wrong rate\n * into a network trained on 48 kHz produces mush, not a voice.\n *\n * Failure is not fatal and is reported as `null` — whether the wasm would not\n * load or the worklet node could not be built: by the time this runs the caller\n * has already committed to the neural path, so the honest outcome is a call\n * without suppression rather than a microphone that will not open. {@link\n * prepareNeuralSuppressor}, which exists to be called *before* the capture,\n * still throws so the caller can pick a different fallback while one is\n * reachable.\n *\n * @param context - The shared context, prepared at 48 kHz.\n * @param source - The captured microphone track.\n * @param assets - The resolved asset addresses from {@link NeuralSuppressorAssets}.\n * @param options - `maxChannels` is the channel count of the capture; the model\n * is mono, and a stereo capture asks for two so a second channel is not lost.\n * @returns The denoised track and its teardown, or `null` when this context or\n * this graph cannot host the suppressor.\n */\nexport async function createNeuralSuppressor(\n context: AudioContext,\n source: MediaStreamTrack,\n assets: NeuralSuppressorAssets,\n options: { maxChannels: number },\n): Promise<NeuralSuppressor | null> {\n if (context.sampleRate !== 48_000) return null;\n\n let binary: ArrayBuffer;\n try {\n binary = await prepareNeuralSuppressor(context, assets);\n } catch {\n return null;\n }\n\n let node: RnnoiseWorkletNode;\n try {\n node = new RnnoiseWorkletNode(context, {\n maxChannels: options.maxChannels,\n wasmBinary: binary,\n });\n } catch {\n return null;\n }\n\n const input = context.createMediaStreamSource(new MediaStream([source]));\n const output = context.createMediaStreamDestination();\n input.connect(node);\n node.connect(output);\n\n const track = output.stream.getAudioTracks()[0];\n if (!track) {\n input.disconnect();\n node.disconnect();\n output.disconnect();\n node.destroy();\n return null;\n }\n track.contentHint = source.contentHint;\n\n return {\n track,\n release: () => {\n input.disconnect();\n node.disconnect();\n output.disconnect();\n node.destroy();\n track.stop();\n },\n };\n}\n"],"mappings":"qHAyCA,SAAgB,GAAwC,CACpD,OACI,OAAO,iBAAqB,KAC5B,OAAO,OAAW,KAClB,OAAO,eAEf,CAYA,IAAI,EAA6C,KAkB3C,EAAgB,IAAI,QAc1B,eAAsB,EAClB,EACA,EACoB,CACpB,IAAI,EAAQ,EAAc,IAAI,CAAO,EAoBrC,OAnBK,IACD,EAAQ,EAAQ,aAAa,UAAU,EAAO,UAAU,CAAC,CAAC,SAChD,IAAA,GACL,GAAmB,CAEhB,MADA,EAAc,OAAO,CAAO,EACtB,CACV,CACJ,EACA,EAAc,IAAI,EAAS,CAAK,GAEpC,MAAM,EACF,IAAkB,OAClB,GAAA,EAAgB,EAAA,YAAA,CAAY,CAAE,IAAK,EAAO,QAAS,QAAS,EAAO,WAAY,CAAC,CAAC,CAAC,MAC7E,GAAmB,CAEhB,KADA,GAAgB,KACV,CACV,CACJ,GAEG,CACX,CAoDA,eAAsB,EAClB,EACA,EACA,EACA,EACgC,CAChC,GAAI,EAAQ,aAAe,KAAQ,OAAO,KAE1C,IAAI,EACJ,GAAI,CACA,EAAS,MAAM,EAAwB,EAAS,CAAM,CAC1D,MAAQ,CACJ,OAAO,IACX,CAEA,IAAI,EACJ,GAAI,CACA,EAAO,IAAI,EAAA,mBAAmB,EAAS,CACnC,YAAa,EAAQ,YACrB,WAAY,CAChB,CAAC,CACL,MAAQ,CACJ,OAAO,IACX,CAEA,IAAM,EAAQ,EAAQ,wBAAwB,IAAI,YAAY,CAAC,CAAM,CAAC,CAAC,EACjE,EAAS,EAAQ,6BAA6B,EACpD,EAAM,QAAQ,CAAI,EAClB,EAAK,QAAQ,CAAM,EAEnB,IAAM,EAAQ,EAAO,OAAO,eAAe,CAAC,CAAC,GAU7C,OATK,GAOL,EAAM,YAAc,EAAO,YAEpB,CACH,QACA,YAAe,CACX,EAAM,WAAW,EACjB,EAAK,WAAW,EAChB,EAAO,WAAW,EAClB,EAAK,QAAQ,EACb,EAAM,KAAK,CACf,CACJ,IAjBI,EAAM,WAAW,EACjB,EAAK,WAAW,EAChB,EAAO,WAAW,EAClB,EAAK,QAAQ,EACN,KAcf"}
|
package/dist/neural.d.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build a suppressor graph on top of a captured microphone track.
|
|
3
|
+
*
|
|
4
|
+
* The model runs on the audio thread through an `AudioWorkletNode` — a
|
|
5
|
+
* recurrent network trained on speech that separates a voice from everything
|
|
6
|
+
* that is not one: keyboards, fans, traffic, a room full of people. The
|
|
7
|
+
* browser's `noiseSuppression` constraint answers the same question with a
|
|
8
|
+
* stationary-noise gate that either lets a transient through or eats the voice
|
|
9
|
+
* with it.
|
|
10
|
+
*
|
|
11
|
+
* Prefer {@link prepareNeuralSuppressor} before the capture opens: the fallback
|
|
12
|
+
* to the browser's own suppression is a `getUserMedia` constraint, and a
|
|
13
|
+
* constraint cannot be added to a capture that already exists. A caller that
|
|
14
|
+
* did not preload still works — the load happens here, idempotently.
|
|
15
|
+
*
|
|
16
|
+
* The model assumes 48 kHz. A context opened at any other rate answers `null`
|
|
17
|
+
* before anything is fetched, because feeding speech samples of the wrong rate
|
|
18
|
+
* into a network trained on 48 kHz produces mush, not a voice.
|
|
19
|
+
*
|
|
20
|
+
* Failure is not fatal and is reported as `null` — whether the wasm would not
|
|
21
|
+
* load or the worklet node could not be built: by the time this runs the caller
|
|
22
|
+
* has already committed to the neural path, so the honest outcome is a call
|
|
23
|
+
* without suppression rather than a microphone that will not open. {@link
|
|
24
|
+
* prepareNeuralSuppressor}, which exists to be called *before* the capture,
|
|
25
|
+
* still throws so the caller can pick a different fallback while one is
|
|
26
|
+
* reachable.
|
|
27
|
+
*
|
|
28
|
+
* @param context - The shared context, prepared at 48 kHz.
|
|
29
|
+
* @param source - The captured microphone track.
|
|
30
|
+
* @param assets - The resolved asset addresses from {@link NeuralSuppressorAssets}.
|
|
31
|
+
* @param options - `maxChannels` is the channel count of the capture; the model
|
|
32
|
+
* is mono, and a stereo capture asks for two so a second channel is not lost.
|
|
33
|
+
* @returns The denoised track and its teardown, or `null` when this context or
|
|
34
|
+
* this graph cannot host the suppressor.
|
|
35
|
+
*/
|
|
36
|
+
export declare function createNeuralSuppressor(context: AudioContext, source: MediaStreamTrack, assets: NeuralSuppressorAssets, options: {
|
|
37
|
+
maxChannels: number;
|
|
38
|
+
}): Promise<NeuralSuppressor | null>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Whether this browser can run a worklet-based noise suppressor.
|
|
42
|
+
*
|
|
43
|
+
* Answered from the two things the path needs that nothing but the platform can
|
|
44
|
+
* supply: `AudioWorkletNode` runs custom DSP on the audio thread, and a secure
|
|
45
|
+
* context is what the browser requires before letting a module near the
|
|
46
|
+
* microphone graph. Everything else — the models, the wasm — ships with the
|
|
47
|
+
* caller, so it cannot be missing. The context must also run at 48 kHz, which
|
|
48
|
+
* is checked at build time rather than here because the caller owns how its
|
|
49
|
+
* context was opened.
|
|
50
|
+
*
|
|
51
|
+
* Deliberately conservative: anything it cannot establish answers `false`, and
|
|
52
|
+
* a `false` sends the caller back to the browser's own `noiseSuppression`
|
|
53
|
+
* constraint, which is weaker but always there.
|
|
54
|
+
*
|
|
55
|
+
* @returns True when a neural suppressor can be built on top of a capture.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isNeuralSuppressionSupported(): boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* A denoised track plus the graph that has to come down with it.
|
|
61
|
+
*
|
|
62
|
+
* `track` is not the captured one — it is the output of a `MediaStream`
|
|
63
|
+
* destination the worklet feeds — so stopping the published track is not enough
|
|
64
|
+
* to free the microphone. `release` closes the graph; the captured track behind
|
|
65
|
+
* it belongs to the caller.
|
|
66
|
+
*/
|
|
67
|
+
export declare interface NeuralSuppressor {
|
|
68
|
+
/** The track to publish in place of the captured one. */
|
|
69
|
+
track: MediaStreamTrack;
|
|
70
|
+
/** Tears the graph down. Does not stop the source track it was built from. */
|
|
71
|
+
release(): void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Where the suppressor's three pieces live, as URLs a bundler hands over.
|
|
76
|
+
*
|
|
77
|
+
* The `@sapphi-red/web-noise-suppressor` package ships the runnable assets next
|
|
78
|
+
* to its code, but it cannot say where they are from inside a library: the
|
|
79
|
+
* `?url` suffix that resolves a module to its served address is a bundler
|
|
80
|
+
* feature, and every bundler answers it differently. So this subpath takes the
|
|
81
|
+
* three resolved addresses as arguments and does the honest part — the graph,
|
|
82
|
+
* the load-once semantics, the per-context registration — here.
|
|
83
|
+
*/
|
|
84
|
+
export declare interface NeuralSuppressorAssets {
|
|
85
|
+
/**
|
|
86
|
+
* The `AudioWorklet` processor module the model runs its DSP in
|
|
87
|
+
* (`rnnoiseWorklet.js`).
|
|
88
|
+
*/
|
|
89
|
+
workletUrl: string;
|
|
90
|
+
/** The SIMD build of the model's wasm (`rnnoise_simd.wasm`). */
|
|
91
|
+
simdWasmUrl: string;
|
|
92
|
+
/** The baseline build, used where the engine lacks SIMD (`rnnoise.wasm`). */
|
|
93
|
+
wasmUrl: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The compiled model for this context, loading what is not ready yet.
|
|
98
|
+
*
|
|
99
|
+
* Idempotent across calls: the wasm fetch and the module registration both
|
|
100
|
+
* happen exactly once. The wasm is shared by every suppressor, while the module
|
|
101
|
+
* registration belongs to one context.
|
|
102
|
+
*
|
|
103
|
+
* @param context - The context the suppression graph will run in.
|
|
104
|
+
* @param assets - The resolved asset addresses from {@link NeuralSuppressorAssets}.
|
|
105
|
+
* @returns The compiled model binary, ready to hand to a worklet node.
|
|
106
|
+
* @throws Whatever the fetch or the compile threw, for the caller to fall back on.
|
|
107
|
+
*/
|
|
108
|
+
export declare function prepareNeuralSuppressor(context: AudioContext, assets: NeuralSuppressorAssets): Promise<ArrayBuffer>;
|
|
109
|
+
|
|
110
|
+
export { }
|