jaci-ui 0.9.4 → 1.0.2
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/CHANGELOG.md +25 -0
- package/README.md +11 -1
- package/dist/_virtual/_rolldown/runtime.cjs +1 -1
- package/dist/components/accordion/accordion.cjs.map +1 -1
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert/alert.cjs.map +1 -1
- package/dist/components/alert/alert.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.cjs.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/aspect-ratio/aspect-ratio.cjs.map +1 -1
- package/dist/components/avatar/avatar.cjs.map +1 -1
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/breadcrumbs/breadcrumbs.cjs.map +1 -1
- package/dist/components/button/button.cjs +1 -0
- package/dist/components/button/button.cjs.map +1 -1
- package/dist/components/button/button.d.cts +2 -1
- package/dist/components/button/button.d.ts +2 -1
- package/dist/components/button/button.js +1 -0
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.cjs.map +1 -1
- package/dist/components/calendar/calendar.cjs +4 -6
- package/dist/components/calendar/calendar.cjs.map +1 -1
- package/dist/components/calendar/calendar.js +4 -6
- package/dist/components/calendar/calendar.js.map +1 -1
- package/dist/components/card/card.cjs.map +1 -1
- package/dist/components/carousel/carousel.cjs.map +1 -1
- package/dist/components/carousel/carousel.js.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.cjs +7 -3
- package/dist/components/checkbox-group/checkbox-group.cjs.map +1 -1
- package/dist/components/checkbox-group/checkbox-group.js +7 -3
- package/dist/components/checkbox-group/checkbox-group.js.map +1 -1
- package/dist/components/code/code.cjs.map +1 -1
- package/dist/components/code/code.js.map +1 -1
- package/dist/components/collapsible/collapsible.cjs.map +1 -1
- package/dist/components/collapsible/collapsible.js.map +1 -1
- package/dist/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/color-picker/color-utils.cjs +5 -3
- package/dist/components/color-picker/color-utils.cjs.map +1 -1
- package/dist/components/color-picker/color-utils.js +5 -3
- package/dist/components/color-picker/color-utils.js.map +1 -1
- package/dist/components/color-swatch/color-swatch.cjs.map +1 -1
- package/dist/components/combobox/combobox.cjs +2 -1
- package/dist/components/combobox/combobox.cjs.map +1 -1
- package/dist/components/combobox/combobox.js +2 -1
- package/dist/components/combobox/combobox.js.map +1 -1
- package/dist/components/command/command.cjs.map +1 -1
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/context-menu/context-menu.cjs.map +1 -1
- package/dist/components/context-menu/context-menu.d.cts +2 -2
- package/dist/components/context-menu/context-menu.d.ts +2 -2
- package/dist/components/controls/checkbox.cjs.map +1 -1
- package/dist/components/controls/checkbox.js.map +1 -1
- package/dist/components/controls/input.cjs.map +1 -1
- package/dist/components/controls/input.js.map +1 -1
- package/dist/components/controls/radio.cjs.map +1 -1
- package/dist/components/controls/switch.cjs.map +1 -1
- package/dist/components/controls/switch.js.map +1 -1
- package/dist/components/controls/textarea.cjs.map +1 -1
- package/dist/components/controls/textarea.js.map +1 -1
- package/dist/components/copyable/copyable.cjs.map +1 -1
- package/dist/components/copyable/copyable.js.map +1 -1
- package/dist/components/data-toolbar/data-toolbar.cjs.map +1 -1
- package/dist/components/data-toolbar/data-toolbar.js.map +1 -1
- package/dist/components/data-view/data-view.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.cjs +4 -7
- package/dist/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.js +4 -7
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.cjs +4 -6
- package/dist/components/date-range-picker/date-range-picker.cjs.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +4 -6
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/dialog/dialog.cjs.map +1 -1
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/download-trigger/download-trigger.cjs.map +1 -1
- package/dist/components/drawer/drawer.cjs.map +1 -1
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/empty-state/empty-state.cjs.map +1 -1
- package/dist/components/feedback/badge.cjs.map +1 -1
- package/dist/components/field/field.cjs.map +1 -1
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/fieldset/fieldset.cjs.map +1 -1
- package/dist/components/figure/figure.cjs.map +1 -1
- package/dist/components/figure/figure.js.map +1 -1
- package/dist/components/form/form.cjs.map +1 -1
- package/dist/components/form/form.js.map +1 -1
- package/dist/components/icon-button/icon-button.cjs.map +1 -1
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/dist/components/image/image.cjs.map +1 -1
- package/dist/components/image/image.js.map +1 -1
- package/dist/components/input-group/input-group.cjs.map +1 -1
- package/dist/components/kbd/kbd.cjs.map +1 -1
- package/dist/components/layout/index.cjs.map +1 -1
- package/dist/components/list/list.cjs.map +1 -1
- package/dist/components/menu/menu.cjs.map +1 -1
- package/dist/components/menu/menu.d.cts +2 -2
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/menubar/menubar.cjs.map +1 -1
- package/dist/components/menubar/menubar.d.cts +2 -2
- package/dist/components/menubar/menubar.d.ts +2 -2
- package/dist/components/menubar/menubar.js.map +1 -1
- package/dist/components/meter/meter.cjs.map +1 -1
- package/dist/components/meter/meter.js.map +1 -1
- package/dist/components/navigation/navigation.cjs.map +1 -1
- package/dist/components/navigation/navigation.js.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.cjs.map +1 -1
- package/dist/components/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/number-field/number-field.cjs +2 -1
- package/dist/components/number-field/number-field.cjs.map +1 -1
- package/dist/components/number-field/number-field.js +2 -1
- package/dist/components/number-field/number-field.js.map +1 -1
- package/dist/components/option-selector/option-selector.cjs.map +1 -1
- package/dist/components/option-selector/option-selector.js.map +1 -1
- package/dist/components/pagination/pagination.cjs.map +1 -1
- package/dist/components/pagination/pagination.js.map +1 -1
- package/dist/components/pin-input/pin-input.cjs.map +1 -1
- package/dist/components/pin-input/pin-input.js.map +1 -1
- package/dist/components/popover/popover.cjs.map +1 -1
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/progress/progress.cjs.map +1 -1
- package/dist/components/progress/progress.js.map +1 -1
- package/dist/components/qr-code/qr-code.cjs.map +1 -1
- package/dist/components/qr-code/qr-code.js.map +1 -1
- package/dist/components/quote/quote.cjs.map +1 -1
- package/dist/components/quote/quote.js.map +1 -1
- package/dist/components/radio-group/radio-group.cjs +7 -3
- package/dist/components/radio-group/radio-group.cjs.map +1 -1
- package/dist/components/radio-group/radio-group.js +7 -3
- package/dist/components/radio-group/radio-group.js.map +1 -1
- package/dist/components/range-slider/range-slider.cjs.map +1 -1
- package/dist/components/range-slider/range-slider.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.cjs.map +1 -1
- package/dist/components/select/select.cjs.map +1 -1
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/sidebar/sidebar.cjs.map +1 -1
- package/dist/components/sidebar/sidebar.js.map +1 -1
- package/dist/components/skeleton/skeleton.cjs.map +1 -1
- package/dist/components/slider/slider.cjs.map +1 -1
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/spacer/spacer.cjs.map +1 -1
- package/dist/components/stat/stat.cjs.map +1 -1
- package/dist/components/stat/stat.js.map +1 -1
- package/dist/components/stepper/stepper.cjs +2 -1
- package/dist/components/stepper/stepper.cjs.map +1 -1
- package/dist/components/stepper/stepper.js +2 -1
- package/dist/components/stepper/stepper.js.map +1 -1
- package/dist/components/table/table.cjs.map +1 -1
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.cjs.map +1 -1
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/tags-input/tags-input.cjs +10 -9
- package/dist/components/tags-input/tags-input.cjs.map +1 -1
- package/dist/components/tags-input/tags-input.js +10 -9
- package/dist/components/tags-input/tags-input.js.map +1 -1
- package/dist/components/toast/toast.cjs.map +1 -1
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.cjs.map +1 -1
- package/dist/components/toggle-group/toggle-group.cjs.map +1 -1
- package/dist/components/toolbar/toolbar.cjs.map +1 -1
- package/dist/components/tooltip/tooltip.cjs.map +1 -1
- package/dist/components/tree-view/tree-view.cjs.map +1 -1
- package/dist/components/tree-view/tree-view.js.map +1 -1
- package/dist/components/typography/heading.cjs.map +1 -1
- package/dist/components/typography/link.cjs.map +1 -1
- package/dist/components/typography/paragraph.cjs.map +1 -1
- package/dist/components/typography/text.cjs.map +1 -1
- package/dist/components/upload/upload.cjs +2 -2
- package/dist/components/upload/upload.cjs.map +1 -1
- package/dist/components/upload/upload.js +2 -2
- package/dist/components/upload/upload.js.map +1 -1
- package/dist/components/visually-hidden/visually-hidden.cjs.map +1 -1
- package/dist/panda-preset.cjs.map +1 -1
- package/dist/styles/theme.cjs +18 -18
- package/dist/styles/theme.cjs.map +1 -1
- package/dist/styles/theme.js +18 -18
- package/dist/styles/theme.js.map +1 -1
- package/dist/styles.css +12 -21
- package/dist/theme/theme-provider.cjs.map +1 -1
- package/dist/theme/theme-provider.js.map +1 -1
- package/dist/theme/theme-scope.cjs.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3bd3028: Override package versions with high severity vulnerabilities
|
|
8
|
+
|
|
9
|
+
## 1.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 58c4e2c: Fix semantic tokens for dark theme
|
|
14
|
+
- 52c2715: Update packages
|
|
15
|
+
|
|
16
|
+
## 1.0.0
|
|
17
|
+
|
|
18
|
+
### Major Changes
|
|
19
|
+
|
|
20
|
+
- bc5a3e1: Prepare the first stable 1.0.0 release by freezing the public component API, validating the
|
|
21
|
+
published contract across supported React frameworks, and completing the release-readiness
|
|
22
|
+
checks.
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- bea249e: Update supported tooling and runtime dependencies, including Storybook, Base UI, date-fns, and security-patched transitive packages.
|
|
27
|
+
|
|
3
28
|
## 0.9.4
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -410,7 +410,17 @@ export function App() {
|
|
|
410
410
|
|
|
411
411
|
`system` uses `ssrTheme` during server rendering and reads `prefers-color-scheme` only after
|
|
412
412
|
mounting. The provider is a client module, so Next.js App Router applications should place it
|
|
413
|
-
inside a client boundary
|
|
413
|
+
inside a client boundary and inside `<body>` (the default provider root is a `<div>`):
|
|
414
|
+
|
|
415
|
+
```tsx
|
|
416
|
+
// app/layout.tsx
|
|
417
|
+
<html data-jaci-theme="dark">
|
|
418
|
+
<body><ThemeProvider ssrTheme="dark">{children}</ThemeProvider></body>
|
|
419
|
+
</html>
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
When `tokens` and `style` target the same `--jaci-*` variable, the provider token takes
|
|
423
|
+
precedence. Direct `data-jaci-theme` and `--jaci-*` variables remain supported.
|
|
414
424
|
|
|
415
425
|
Popups rendered through Jaci portal slots inherit the nearest `ThemeProvider` scope, including
|
|
416
426
|
local accent tokens. An explicit `container` prop on a portal still takes precedence. Without a
|
|
@@ -15,7 +15,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.cjs","names":["accordion","BaseAccordion","withRecipeClassName","cx"],"sources":["../../../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AccordionRoot as BaseAccordionRoot } from \"@base-ui/react/accordion\";\n\nimport { withRecipeClassName } from \"../base-ui\";\nimport { cx } from \"../../styled-system/css\";\nimport { accordion } from \"../../styled-system/recipes\";\n\nexport type AccordionRootProps<Value = unknown> = BaseAccordionRoot.Props<Value>;\n\n/**\n * Groups disclosure items. Use `value`/`onValueChange` for a controlled root,\n * or `defaultValue` for an uncontrolled one.\n */\nexport function AccordionRoot<Value = unknown>({ className, ...props }: AccordionRootProps<Value>) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"accordion\"\n data-slot=\"accordion\"\n />\n );\n}\n\nexport type AccordionItemProps = ComponentPropsWithoutRef<typeof BaseAccordion.Item>;\n\nexport const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(function AccordionItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseAccordion.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().item, className)}\n data-slot=\"accordion-item\"\n />\n );\n});\n\nexport type AccordionHeaderProps = ComponentPropsWithoutRef<typeof BaseAccordion.Header>;\n\nexport const AccordionHeader = forwardRef<HTMLHeadingElement, AccordionHeaderProps>(\n function AccordionHeader({ className, ...props }, ref) {\n return (\n <BaseAccordion.Header\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().header, className)}\n data-slot=\"accordion-header\"\n />\n );\n },\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n showIndicator?: boolean;\n}\n\nexport const AccordionTrigger = forwardRef<HTMLElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, showIndicator = true, ...props }, ref) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-slot=\"accordion-trigger\"\n >\n {showIndicator ? <AccordionIndicator /> : null}\n {children}\n </BaseAccordion.Trigger>\n );\n },\n);\n\nexport type AccordionPanelProps = ComponentPropsWithoutRef<typeof BaseAccordion.Panel>;\n\nexport const AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().panel, className)}\n data-slot=\"accordion-panel\"\n />\n );\n },\n);\n\nexport type AccordionIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AccordionIndicator = forwardRef<HTMLSpanElement, AccordionIndicatorProps>(\n function AccordionIndicator({ children = \"›\", className, ...props }, ref) {\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(accordion().indicator, className)}\n data-slot=\"accordion-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Header: AccordionHeader,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n Indicator: AccordionIndicator,\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgB,cAA+B,EAAE,WAAW,GAAG,SAAoC;CACjG,MAAM,SAASA,kBAAAA,UAAU;CAEzB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,UAAc,MAAf;EACE,GAAI;EACJ,WAAWC,gBAAAA,oBAAoB,OAAO,MAAM,SAAS;EACrD,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL;AAIA,MAAa,iBAAA,
|
|
1
|
+
{"version":3,"file":"accordion.cjs","names":["accordion","BaseAccordion","withRecipeClassName","forwardRef","cx"],"sources":["../../../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AccordionRoot as BaseAccordionRoot } from \"@base-ui/react/accordion\";\n\nimport { withRecipeClassName } from \"../base-ui\";\nimport { cx } from \"../../styled-system/css\";\nimport { accordion } from \"../../styled-system/recipes\";\n\nexport type AccordionRootProps<Value = unknown> = BaseAccordionRoot.Props<Value>;\n\n/**\n * Groups disclosure items. Use `value`/`onValueChange` for a controlled root,\n * or `defaultValue` for an uncontrolled one.\n */\nexport function AccordionRoot<Value = unknown>({ className, ...props }: AccordionRootProps<Value>) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"accordion\"\n data-slot=\"accordion\"\n />\n );\n}\n\nexport type AccordionItemProps = ComponentPropsWithoutRef<typeof BaseAccordion.Item>;\n\nexport const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(function AccordionItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseAccordion.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().item, className)}\n data-slot=\"accordion-item\"\n />\n );\n});\n\nexport type AccordionHeaderProps = ComponentPropsWithoutRef<typeof BaseAccordion.Header>;\n\nexport const AccordionHeader = forwardRef<HTMLHeadingElement, AccordionHeaderProps>(\n function AccordionHeader({ className, ...props }, ref) {\n return (\n <BaseAccordion.Header\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().header, className)}\n data-slot=\"accordion-header\"\n />\n );\n },\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n showIndicator?: boolean;\n}\n\nexport const AccordionTrigger = forwardRef<HTMLElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, showIndicator = true, ...props }, ref) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-slot=\"accordion-trigger\"\n >\n {showIndicator ? <AccordionIndicator /> : null}\n {children}\n </BaseAccordion.Trigger>\n );\n },\n);\n\nexport type AccordionPanelProps = ComponentPropsWithoutRef<typeof BaseAccordion.Panel>;\n\nexport const AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().panel, className)}\n data-slot=\"accordion-panel\"\n />\n );\n },\n);\n\nexport type AccordionIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AccordionIndicator = forwardRef<HTMLSpanElement, AccordionIndicatorProps>(\n function AccordionIndicator({ children = \"›\", className, ...props }, ref) {\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(accordion().indicator, className)}\n data-slot=\"accordion-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Header: AccordionHeader,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n Indicator: AccordionIndicator,\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgB,cAA+B,EAAE,WAAW,GAAG,SAAoC;CACjG,MAAM,SAASA,kBAAAA,UAAU;CAEzB,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,yBAAAA,UAAc,MAAf;EACE,GAAI;EACJ,WAAWC,gBAAAA,oBAAoB,OAAO,MAAM,SAAS;EACrD,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL;AAIA,MAAa,iBAAA,GAAgBC,MAAAA,WAAAA,CAA+C,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA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,IAAA,CAAC,QAAD;EACE,GAAI;EACJ,eAAY;EACP;EACL,WAAWC,WAAAA,GAAGJ,kBAAAA,UAAU,CAAC,CAAC,WAAW,SAAS;EAC9C,aAAU;EAET;CACG,CAAA;AAEV,CACF;AAEA,MAAa,YAAY;CACvB,MAAM;CACN,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;CACP,WAAW;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","names":["AccordionRoot","BaseAccordion","Accordion"],"sources":["../../../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AccordionRoot as BaseAccordionRoot } from \"@base-ui/react/accordion\";\n\nimport { withRecipeClassName } from \"../base-ui\";\nimport { cx } from \"../../styled-system/css\";\nimport { accordion } from \"../../styled-system/recipes\";\n\nexport type AccordionRootProps<Value = unknown> = BaseAccordionRoot.Props<Value>;\n\n/**\n * Groups disclosure items. Use `value`/`onValueChange` for a controlled root,\n * or `defaultValue` for an uncontrolled one.\n */\nexport function AccordionRoot<Value = unknown>({ className, ...props }: AccordionRootProps<Value>) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"accordion\"\n data-slot=\"accordion\"\n />\n );\n}\n\nexport type AccordionItemProps = ComponentPropsWithoutRef<typeof BaseAccordion.Item>;\n\nexport const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(function AccordionItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseAccordion.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().item, className)}\n data-slot=\"accordion-item\"\n />\n );\n});\n\nexport type AccordionHeaderProps = ComponentPropsWithoutRef<typeof BaseAccordion.Header>;\n\nexport const AccordionHeader = forwardRef<HTMLHeadingElement, AccordionHeaderProps>(\n function AccordionHeader({ className, ...props }, ref) {\n return (\n <BaseAccordion.Header\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().header, className)}\n data-slot=\"accordion-header\"\n />\n );\n },\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n showIndicator?: boolean;\n}\n\nexport const AccordionTrigger = forwardRef<HTMLElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, showIndicator = true, ...props }, ref) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-slot=\"accordion-trigger\"\n >\n {showIndicator ? <AccordionIndicator /> : null}\n {children}\n </BaseAccordion.Trigger>\n );\n },\n);\n\nexport type AccordionPanelProps = ComponentPropsWithoutRef<typeof BaseAccordion.Panel>;\n\nexport const AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().panel, className)}\n data-slot=\"accordion-panel\"\n />\n );\n },\n);\n\nexport type AccordionIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AccordionIndicator = forwardRef<HTMLSpanElement, AccordionIndicatorProps>(\n function AccordionIndicator({ children = \"›\", className, ...props }, ref) {\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(accordion().indicator, className)}\n data-slot=\"accordion-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Header: AccordionHeader,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n Indicator: AccordionIndicator,\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgBA,gBAA+B,EAAE,WAAW,GAAG,SAAoC;CACjG,MAAM,SAAS,UAAU;CAEzB,OACE,oBAACC,UAAc,MAAf;EACE,GAAI;EACJ,WAAW,oBAAoB,OAAO,MAAM,SAAS;EACrD,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL;AAIA,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,UAAc,MAAf;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,UAAU,CAAC,CAAC,MAAM,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,oBAACA,UAAc,QAAf;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,UAAU,CAAC,CAAC,QAAQ,SAAS;EAC5D,aAAU;CACX,CAAA;AAEL,CACF;AAOA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,UAAU,WAAW,gBAAgB,MAAM,GAAG,SAAS,KAAK;CACtF,MAAM,SAAS,UAAU;CAEzB,OACE,qBAACA,UAAc,SAAf;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,SAAS,SAAS;EACxD,aAAU;
|
|
1
|
+
{"version":3,"file":"accordion.js","names":["AccordionRoot","BaseAccordion","Accordion"],"sources":["../../../src/components/accordion/accordion.tsx"],"sourcesContent":["\"use client\";\n\nimport { Accordion as BaseAccordion } from \"@base-ui/react/accordion\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AccordionRoot as BaseAccordionRoot } from \"@base-ui/react/accordion\";\n\nimport { withRecipeClassName } from \"../base-ui\";\nimport { cx } from \"../../styled-system/css\";\nimport { accordion } from \"../../styled-system/recipes\";\n\nexport type AccordionRootProps<Value = unknown> = BaseAccordionRoot.Props<Value>;\n\n/**\n * Groups disclosure items. Use `value`/`onValueChange` for a controlled root,\n * or `defaultValue` for an uncontrolled one.\n */\nexport function AccordionRoot<Value = unknown>({ className, ...props }: AccordionRootProps<Value>) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Root\n {...props}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"accordion\"\n data-slot=\"accordion\"\n />\n );\n}\n\nexport type AccordionItemProps = ComponentPropsWithoutRef<typeof BaseAccordion.Item>;\n\nexport const AccordionItem = forwardRef<HTMLDivElement, AccordionItemProps>(function AccordionItem(\n { className, ...props },\n ref,\n) {\n return (\n <BaseAccordion.Item\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().item, className)}\n data-slot=\"accordion-item\"\n />\n );\n});\n\nexport type AccordionHeaderProps = ComponentPropsWithoutRef<typeof BaseAccordion.Header>;\n\nexport const AccordionHeader = forwardRef<HTMLHeadingElement, AccordionHeaderProps>(\n function AccordionHeader({ className, ...props }, ref) {\n return (\n <BaseAccordion.Header\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().header, className)}\n data-slot=\"accordion-header\"\n />\n );\n },\n);\n\nexport interface AccordionTriggerProps\n extends ComponentPropsWithoutRef<typeof BaseAccordion.Trigger> {\n showIndicator?: boolean;\n}\n\nexport const AccordionTrigger = forwardRef<HTMLElement, AccordionTriggerProps>(\n function AccordionTrigger({ children, className, showIndicator = true, ...props }, ref) {\n const styles = accordion();\n\n return (\n <BaseAccordion.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(styles.trigger, className)}\n data-slot=\"accordion-trigger\"\n >\n {showIndicator ? <AccordionIndicator /> : null}\n {children}\n </BaseAccordion.Trigger>\n );\n },\n);\n\nexport type AccordionPanelProps = ComponentPropsWithoutRef<typeof BaseAccordion.Panel>;\n\nexport const AccordionPanel = forwardRef<HTMLDivElement, AccordionPanelProps>(\n function AccordionPanel({ className, ...props }, ref) {\n return (\n <BaseAccordion.Panel\n {...props}\n ref={ref}\n className={withRecipeClassName(accordion().panel, className)}\n data-slot=\"accordion-panel\"\n />\n );\n },\n);\n\nexport type AccordionIndicatorProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AccordionIndicator = forwardRef<HTMLSpanElement, AccordionIndicatorProps>(\n function AccordionIndicator({ children = \"›\", className, ...props }, ref) {\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(accordion().indicator, className)}\n data-slot=\"accordion-indicator\"\n >\n {children}\n </span>\n );\n },\n);\n\nexport const Accordion = {\n Root: AccordionRoot,\n Item: AccordionItem,\n Header: AccordionHeader,\n Trigger: AccordionTrigger,\n Panel: AccordionPanel,\n Indicator: AccordionIndicator,\n};\n"],"mappings":";;;;;;;;;;;;AAiBA,SAAgBA,gBAA+B,EAAE,WAAW,GAAG,SAAoC;CACjG,MAAM,SAAS,UAAU;CAEzB,OACE,oBAACC,UAAc,MAAf;EACE,GAAI;EACJ,WAAW,oBAAoB,OAAO,MAAM,SAAS;EACrD,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL;AAIA,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAACA,UAAc,MAAf;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,UAAU,CAAC,CAAC,MAAM,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,kBAAkB,WAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,oBAACA,UAAc,QAAf;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,UAAU,CAAC,CAAC,QAAQ,SAAS;EAC5D,aAAU;CACX,CAAA;AAEL,CACF;AAOA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,UAAU,WAAW,gBAAgB,MAAM,GAAG,SAAS,KAAK;CACtF,MAAM,SAAS,UAAU;CAEzB,OACE,qBAACA,UAAc,SAAf;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,SAAS,SAAS;EACxD,aAAU;EAJZ,UAAA,CAMG,gBAAgB,oBAAC,oBAAD,CAAqB,CAAA,IAAI,MACzC,QACoB;;AAE3B,CACF;AAIA,MAAa,iBAAiB,WAC5B,SAAS,eAAe,EAAE,WAAW,GAAG,SAAS,KAAK;CACpD,OACE,oBAACA,UAAc,OAAf;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,UAAU,CAAC,CAAC,OAAO,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,KAAK,WAAW,GAAG,SAAS,KAAK;CACxE,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,eAAY;EACP;EACL,WAAW,GAAG,UAAU,CAAC,CAAC,WAAW,SAAS;EAC9C,aAAU;EAET;CACG,CAAA;AAEV,CACF;AAEA,MAAaC,cAAY;CACvB,MAAMF;CACN,MAAM;CACN,QAAQ;CACR,SAAS;CACT,OAAO;CACP,WAAW;AACb"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.cjs","names":["alert","cx"],"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { alert } from \"../../styled-system/recipes\";\n\nexport type AlertTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst AlertToneContext = createContext<AlertTone>(\"info\");\n\nfunction useAlertStyles() {\n return alert({ tone: useContext(AlertToneContext) });\n}\n\nconst iconByTone: Record<AlertTone, string> = {\n danger: \"!\",\n info: \"i\",\n success: \"✓\",\n warning: \"!\",\n};\n\nexport interface AlertRootProps extends ComponentPropsWithoutRef<\"div\"> {\n tone?: AlertTone;\n}\n\n/**\n * An SSR-safe status message. Informational alerts use a polite live region;\n * warnings and errors default to the assertive `alert` role.\n */\nexport const AlertRoot = forwardRef<HTMLDivElement, AlertRootProps>(function AlertRoot(\n { className, role, tone = \"info\", ...props },\n ref,\n) {\n const styles = alert({ tone });\n const defaultRole = tone === \"danger\" || tone === \"warning\" ? \"alert\" : \"status\";\n\n return (\n <AlertToneContext.Provider value={tone}>\n <div\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"alert\"\n data-jaci-tone={tone}\n data-slot=\"alert\"\n role={role ?? defaultRole}\n />\n </AlertToneContext.Provider>\n );\n});\n\nexport type AlertIconProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AlertIcon = forwardRef<HTMLSpanElement, AlertIconProps>(function AlertIcon(\n { children, className, ...props },\n ref,\n) {\n const tone = useContext(AlertToneContext);\n\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useAlertStyles().icon, className)}\n data-slot=\"alert-icon\"\n >\n {children ?? iconByTone[tone]}\n </span>\n );\n});\n\nexport type AlertTitleProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertTitle = forwardRef<HTMLDivElement, AlertTitleProps>(function AlertTitle(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().title, className)}\n data-slot=\"alert-title\"\n />\n );\n});\n\nexport type AlertDescriptionProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDescription = forwardRef<HTMLDivElement, AlertDescriptionProps>(\n function AlertDescription({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().description, className)}\n data-slot=\"alert-description\"\n />\n );\n },\n);\n\nexport type AlertActionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertActions = forwardRef<HTMLDivElement, AlertActionsProps>(function AlertActions(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().actions, className)}\n data-slot=\"alert-actions\"\n />\n );\n});\n\nexport const Alert = {\n Root: AlertRoot,\n Icon: AlertIcon,\n Title: AlertTitle,\n Description: AlertDescription,\n Actions: AlertActions,\n};\n"],"mappings":";;;;;AAQA,MAAM,oBAAA,
|
|
1
|
+
{"version":3,"file":"alert.cjs","names":["createContext","alert","useContext","forwardRef","cx"],"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { alert } from \"../../styled-system/recipes\";\n\nexport type AlertTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst AlertToneContext = createContext<AlertTone>(\"info\");\n\nfunction useAlertStyles() {\n return alert({ tone: useContext(AlertToneContext) });\n}\n\nconst iconByTone: Record<AlertTone, string> = {\n danger: \"!\",\n info: \"i\",\n success: \"✓\",\n warning: \"!\",\n};\n\nexport interface AlertRootProps extends ComponentPropsWithoutRef<\"div\"> {\n tone?: AlertTone;\n}\n\n/**\n * An SSR-safe status message. Informational alerts use a polite live region;\n * warnings and errors default to the assertive `alert` role.\n */\nexport const AlertRoot = forwardRef<HTMLDivElement, AlertRootProps>(function AlertRoot(\n { className, role, tone = \"info\", ...props },\n ref,\n) {\n const styles = alert({ tone });\n const defaultRole = tone === \"danger\" || tone === \"warning\" ? \"alert\" : \"status\";\n\n return (\n <AlertToneContext.Provider value={tone}>\n <div\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"alert\"\n data-jaci-tone={tone}\n data-slot=\"alert\"\n role={role ?? defaultRole}\n />\n </AlertToneContext.Provider>\n );\n});\n\nexport type AlertIconProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AlertIcon = forwardRef<HTMLSpanElement, AlertIconProps>(function AlertIcon(\n { children, className, ...props },\n ref,\n) {\n const tone = useContext(AlertToneContext);\n\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useAlertStyles().icon, className)}\n data-slot=\"alert-icon\"\n >\n {children ?? iconByTone[tone]}\n </span>\n );\n});\n\nexport type AlertTitleProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertTitle = forwardRef<HTMLDivElement, AlertTitleProps>(function AlertTitle(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().title, className)}\n data-slot=\"alert-title\"\n />\n );\n});\n\nexport type AlertDescriptionProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDescription = forwardRef<HTMLDivElement, AlertDescriptionProps>(\n function AlertDescription({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().description, className)}\n data-slot=\"alert-description\"\n />\n );\n },\n);\n\nexport type AlertActionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertActions = forwardRef<HTMLDivElement, AlertActionsProps>(function AlertActions(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().actions, className)}\n data-slot=\"alert-actions\"\n />\n );\n});\n\nexport const Alert = {\n Root: AlertRoot,\n Icon: AlertIcon,\n Title: AlertTitle,\n Description: AlertDescription,\n Actions: AlertActions,\n};\n"],"mappings":";;;;;AAQA,MAAM,oBAAA,GAAmBA,MAAAA,cAAAA,CAAyB,MAAM;AAExD,SAAS,iBAAiB;CACxB,OAAOC,cAAAA,MAAM,EAAE,OAAA,GAAMC,MAAAA,WAAAA,CAAW,gBAAgB,EAAE,CAAC;AACrD;AAEA,MAAM,aAAwC;CAC5C,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;AACX;;;;;AAUA,MAAa,aAAA,GAAYC,MAAAA,WAAAA,CAA2C,SAAS,UAC3E,EAAE,WAAW,MAAM,OAAO,QAAQ,GAAG,SACrC,KACA;CACA,MAAM,SAASF,cAAAA,MAAM,EAAE,KAAK,CAAC;CAC7B,MAAM,cAAc,SAAS,YAAY,SAAS,YAAY,UAAU;CAExE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAiB,UAAlB;EAA2B,OAAO;EAChC,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GACE,GAAI;GACC;GACL,WAAWG,WAAAA,GAAG,OAAO,MAAM,SAAS;GACpC,uBAAoB;GACpB,kBAAgB;GAChB,aAAU;GACV,MAAM,QAAQ;EACf,CAAA;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":[],"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { alert } from \"../../styled-system/recipes\";\n\nexport type AlertTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst AlertToneContext = createContext<AlertTone>(\"info\");\n\nfunction useAlertStyles() {\n return alert({ tone: useContext(AlertToneContext) });\n}\n\nconst iconByTone: Record<AlertTone, string> = {\n danger: \"!\",\n info: \"i\",\n success: \"✓\",\n warning: \"!\",\n};\n\nexport interface AlertRootProps extends ComponentPropsWithoutRef<\"div\"> {\n tone?: AlertTone;\n}\n\n/**\n * An SSR-safe status message. Informational alerts use a polite live region;\n * warnings and errors default to the assertive `alert` role.\n */\nexport const AlertRoot = forwardRef<HTMLDivElement, AlertRootProps>(function AlertRoot(\n { className, role, tone = \"info\", ...props },\n ref,\n) {\n const styles = alert({ tone });\n const defaultRole = tone === \"danger\" || tone === \"warning\" ? \"alert\" : \"status\";\n\n return (\n <AlertToneContext.Provider value={tone}>\n <div\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"alert\"\n data-jaci-tone={tone}\n data-slot=\"alert\"\n role={role ?? defaultRole}\n />\n </AlertToneContext.Provider>\n );\n});\n\nexport type AlertIconProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AlertIcon = forwardRef<HTMLSpanElement, AlertIconProps>(function AlertIcon(\n { children, className, ...props },\n ref,\n) {\n const tone = useContext(AlertToneContext);\n\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useAlertStyles().icon, className)}\n data-slot=\"alert-icon\"\n >\n {children ?? iconByTone[tone]}\n </span>\n );\n});\n\nexport type AlertTitleProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertTitle = forwardRef<HTMLDivElement, AlertTitleProps>(function AlertTitle(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().title, className)}\n data-slot=\"alert-title\"\n />\n );\n});\n\nexport type AlertDescriptionProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDescription = forwardRef<HTMLDivElement, AlertDescriptionProps>(\n function AlertDescription({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().description, className)}\n data-slot=\"alert-description\"\n />\n );\n },\n);\n\nexport type AlertActionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertActions = forwardRef<HTMLDivElement, AlertActionsProps>(function AlertActions(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().actions, className)}\n data-slot=\"alert-actions\"\n />\n );\n});\n\nexport const Alert = {\n Root: AlertRoot,\n Icon: AlertIcon,\n Title: AlertTitle,\n Description: AlertDescription,\n Actions: AlertActions,\n};\n"],"mappings":";;;;;AAQA,MAAM,mBAAmB,cAAyB,MAAM;AAExD,SAAS,iBAAiB;CACxB,OAAO,MAAM,EAAE,MAAM,WAAW,gBAAgB,EAAE,CAAC;AACrD;AAEA,MAAM,aAAwC;CAC5C,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;AACX;;;;;AAUA,MAAa,YAAY,WAA2C,SAAS,UAC3E,EAAE,WAAW,MAAM,OAAO,QAAQ,GAAG,SACrC,KACA;CACA,MAAM,SAAS,MAAM,EAAE,KAAK,CAAC;CAC7B,MAAM,cAAc,SAAS,YAAY,SAAS,YAAY,UAAU;CAExE,OACE,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO;
|
|
1
|
+
{"version":3,"file":"alert.js","names":[],"sources":["../../../src/components/alert/alert.tsx"],"sourcesContent":["import { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { alert } from \"../../styled-system/recipes\";\n\nexport type AlertTone = \"info\" | \"success\" | \"warning\" | \"danger\";\n\nconst AlertToneContext = createContext<AlertTone>(\"info\");\n\nfunction useAlertStyles() {\n return alert({ tone: useContext(AlertToneContext) });\n}\n\nconst iconByTone: Record<AlertTone, string> = {\n danger: \"!\",\n info: \"i\",\n success: \"✓\",\n warning: \"!\",\n};\n\nexport interface AlertRootProps extends ComponentPropsWithoutRef<\"div\"> {\n tone?: AlertTone;\n}\n\n/**\n * An SSR-safe status message. Informational alerts use a polite live region;\n * warnings and errors default to the assertive `alert` role.\n */\nexport const AlertRoot = forwardRef<HTMLDivElement, AlertRootProps>(function AlertRoot(\n { className, role, tone = \"info\", ...props },\n ref,\n) {\n const styles = alert({ tone });\n const defaultRole = tone === \"danger\" || tone === \"warning\" ? \"alert\" : \"status\";\n\n return (\n <AlertToneContext.Provider value={tone}>\n <div\n {...props}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"alert\"\n data-jaci-tone={tone}\n data-slot=\"alert\"\n role={role ?? defaultRole}\n />\n </AlertToneContext.Provider>\n );\n});\n\nexport type AlertIconProps = ComponentPropsWithoutRef<\"span\">;\n\nexport const AlertIcon = forwardRef<HTMLSpanElement, AlertIconProps>(function AlertIcon(\n { children, className, ...props },\n ref,\n) {\n const tone = useContext(AlertToneContext);\n\n return (\n <span\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n className={cx(useAlertStyles().icon, className)}\n data-slot=\"alert-icon\"\n >\n {children ?? iconByTone[tone]}\n </span>\n );\n});\n\nexport type AlertTitleProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertTitle = forwardRef<HTMLDivElement, AlertTitleProps>(function AlertTitle(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().title, className)}\n data-slot=\"alert-title\"\n />\n );\n});\n\nexport type AlertDescriptionProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDescription = forwardRef<HTMLDivElement, AlertDescriptionProps>(\n function AlertDescription({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().description, className)}\n data-slot=\"alert-description\"\n />\n );\n },\n);\n\nexport type AlertActionsProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertActions = forwardRef<HTMLDivElement, AlertActionsProps>(function AlertActions(\n { className, ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(useAlertStyles().actions, className)}\n data-slot=\"alert-actions\"\n />\n );\n});\n\nexport const Alert = {\n Root: AlertRoot,\n Icon: AlertIcon,\n Title: AlertTitle,\n Description: AlertDescription,\n Actions: AlertActions,\n};\n"],"mappings":";;;;;AAQA,MAAM,mBAAmB,cAAyB,MAAM;AAExD,SAAS,iBAAiB;CACxB,OAAO,MAAM,EAAE,MAAM,WAAW,gBAAgB,EAAE,CAAC;AACrD;AAEA,MAAM,aAAwC;CAC5C,QAAQ;CACR,MAAM;CACN,SAAS;CACT,SAAS;AACX;;;;;AAUA,MAAa,YAAY,WAA2C,SAAS,UAC3E,EAAE,WAAW,MAAM,OAAO,QAAQ,GAAG,SACrC,KACA;CACA,MAAM,SAAS,MAAM,EAAE,KAAK,CAAC;CAC7B,MAAM,cAAc,SAAS,YAAY,SAAS,YAAY,UAAU;CAExE,OACE,oBAAC,iBAAiB,UAAlB;EAA2B,OAAO;EAChC,UAAA,oBAAC,OAAD;GACE,GAAI;GACC;GACL,WAAW,GAAG,OAAO,MAAM,SAAS;GACpC,uBAAoB;GACpB,kBAAgB;GAChB,aAAU;GACV,MAAM,QAAQ;EACf,CAAA;CACwB,CAAA;AAE/B,CAAC;AAID,MAAa,YAAY,WAA4C,SAAS,UAC5E,EAAE,UAAU,WAAW,GAAG,SAC1B,KACA;CACA,MAAM,OAAO,WAAW,gBAAgB;CAExC,OACE,oBAAC,QAAD;EACE,GAAI;EACJ,eAAY;EACP;EACL,WAAW,GAAG,eAAe,CAAC,CAAC,MAAM,SAAS;EAC9C,aAAU;EAET,UAAA,YAAY,WAAW;CACpB,CAAA;AAEV,CAAC;AAID,MAAa,aAAa,WAA4C,SAAS,WAC7E,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,eAAe,CAAC,CAAC,OAAO,SAAS;EAC/C,aAAU;CACX,CAAA;AAEL,CAAC;AAID,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,GAAG,SAAS,KAAK;CACtD,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,eAAe,CAAC,CAAC,aAAa,SAAS;EACrD,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,eAAe,WAA8C,SAAS,aACjF,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,WAAW,GAAG,eAAe,CAAC,CAAC,SAAS,SAAS;EACjD,aAAU;CACX,CAAA;AAEL,CAAC;AAED,MAAa,QAAQ;CACnB,MAAM;CACN,MAAM;CACN,OAAO;CACP,aAAa;CACb,SAAS;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.cjs","names":["BaseAlertDialog","withRecipeClassName","dialog","useThemePortalProps","cx"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;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;CACR,QAAQ;CACR,cAAcF,4BAAAA,YAAgB;AAChC"}
|
|
1
|
+
{"version":3,"file":"alert-dialog.cjs","names":["BaseAlertDialog","forwardRef","withRecipeClassName","dialog","useThemePortalProps","cx"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAmBA,SAAgB,gBAAmC,OAAsC;CACvF,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACA,4BAAAA,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,sBAAA,GAAqBC,MAAAA,WAAAA,CAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACD,4BAAAA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAWE,gBAAAA,oBAAoBC,eAAAA,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,SAAgB,kBAAkB,OAA+B;CAC/D,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACH,4BAAAA,YAAgB,QAAjB,EAAwB,GAAII,oBAAAA,oBAAoB,KAAK,EAAI,CAAA;AAClE;AAIA,MAAa,uBAAA,GAAsBH,MAAAA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BAAkBC,eAAAA,OAAO,CAAC,CAAC,SAASA,eAAAA,OAAO,CAAC,CAAC,OAC7C,SACF;EACA,aAAW,YAAY;EAEtB,UAAA,YAAY;CACQ,CAAA;AAE3B,CACF;AAIA,MAAa,qBAAA,GAAoBF,MAAAA,WAAAA,CAC/B,SAAS,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CACjE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,qBAAA,GAAoBA,MAAAA,WAAAA,CAC/B,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAa,cAAc;CACzB,MAAM;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcD,4BAAAA,YAAgB;AAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert-dialog.js","names":["AlertDialogRoot","BaseAlertDialog","AlertDialog"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAmBA,SAAgBA,kBAAmC,OAAsC;CACvF,OAAO,oBAACC,YAAgB,MAAjB,EAAsB,GAAI,MAAQ,CAAA;AAC3C;AAIA,MAAa,qBAAqB,WAChC,SAAS,mBAAmB,EAAE,WAAW,GAAG,SAAS,KAAK;CACxD,OACE,oBAACA,YAAgB,SAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,SAAS,SAAS;EAC1D,aAAU;CACX,CAAA;AAEL,CACF;AAGA,SAAgB,kBAAkB,OAA+B;CAC/D,OAAO,oBAACA,YAAgB,QAAjB,EAAwB,GAAI,oBAAoB,KAAK,EAAI,CAAA;AAClE;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,oBAACA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,sBAAsB,WACjC,SAAS,oBAAoB,EAAE,WAAW,GAAG,SAAS,KAAK;CACzD,OACE,oBAACA,YAAgB,UAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,CAAC,CAAC,UAAU,SAAS;EAC3D,aAAU;CACX,CAAA;AAEL,CACF;AAOA,MAAa,mBAAmB,WAC9B,SAAS,iBAAiB,EAAE,WAAW,OAAO,MAAM,GAAG,SAAS,KAAK;CACnE,OACE,oBAACA,YAAgB,OAAjB;EACE,GAAI;EACC;EACL,WAAW,oBAAoB,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,OAAO,SAAS;EAChE,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,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AC,OAC7C,SACF;EACA,aAAW,YAAY;YAEtB,YAAY;CACQ,CAAA;AAE3B,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,UAAU,GAAG,SAAS,KAAK;CACjE,OACE,oBAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,oBAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAaC,gBAAc;CACzB,MAAMF;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcC,YAAgB;AAChC"}
|
|
1
|
+
{"version":3,"file":"alert-dialog.js","names":["AlertDialogRoot","BaseAlertDialog","AlertDialog"],"sources":["../../../src/components/alert-dialog/alert-dialog.tsx"],"sourcesContent":["\"use client\";\n\nimport { AlertDialog as BaseAlertDialog } from \"@base-ui/react/alert-dialog\";\nimport { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport type { AlertDialogRoot as BaseAlertDialogRoot } from \"@base-ui/react/alert-dialog\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { dialog } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\nimport type { DialogSize } from \"../dialog\";\nimport { useThemePortalProps } from \"../../theme/theme-scope\";\n\n/**\n * A modal confirmation primitive with Base UI's focus trap, Escape handling,\n * and accessible alert-dialog semantics.\n */\nexport type AlertDialogRootProps<Payload = unknown> = BaseAlertDialogRoot.Props<Payload>;\n\nexport function AlertDialogRoot<Payload = unknown>(props: AlertDialogRootProps<Payload>) {\n return <BaseAlertDialog.Root {...props} />;\n}\n\nexport type AlertDialogTriggerProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Trigger>;\n\nexport const AlertDialogTrigger = forwardRef<HTMLButtonElement, AlertDialogTriggerProps>(\n function AlertDialogTrigger({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Trigger\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().trigger, className)}\n data-slot=\"alert-dialog-trigger\"\n />\n );\n },\n);\n\nexport type AlertDialogPortalProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Portal>;\nexport function AlertDialogPortal(props: AlertDialogPortalProps) {\n return <BaseAlertDialog.Portal {...useThemePortalProps(props)} />;\n}\n\nexport type AlertDialogBackdropProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Backdrop>;\n\nexport const AlertDialogBackdrop = forwardRef<HTMLDivElement, AlertDialogBackdropProps>(\n function AlertDialogBackdrop({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Backdrop\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().backdrop, className)}\n data-slot=\"alert-dialog-backdrop\"\n />\n );\n },\n);\n\nexport type AlertDialogViewportProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Viewport>;\n\nexport const AlertDialogViewport = forwardRef<HTMLDivElement, AlertDialogViewportProps>(\n function AlertDialogViewport({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Viewport\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().viewport, className)}\n data-slot=\"alert-dialog-viewport\"\n />\n );\n },\n);\n\nexport interface AlertDialogPopupProps\n extends ComponentPropsWithoutRef<typeof BaseAlertDialog.Popup> {\n size?: DialogSize;\n}\n\nexport const AlertDialogPopup = forwardRef<HTMLDivElement, AlertDialogPopupProps>(\n function AlertDialogPopup({ className, size = \"md\", ...props }, ref) {\n return (\n <BaseAlertDialog.Popup\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog({ size }).popup, className)}\n data-jaci-component=\"alert-dialog\"\n data-slot=\"alert-dialog-popup\"\n />\n );\n },\n);\n\nexport type AlertDialogHeaderProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogHeader = forwardRef<HTMLDivElement, AlertDialogHeaderProps>(\n function AlertDialogHeader({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().header, className)}\n data-slot=\"alert-dialog-header\"\n />\n );\n },\n);\n\nexport type AlertDialogTitleProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Title>;\n\nexport const AlertDialogTitle = forwardRef<HTMLHeadingElement, AlertDialogTitleProps>(\n function AlertDialogTitle({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Title\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().title, className)}\n data-slot=\"alert-dialog-title\"\n />\n );\n },\n);\n\nexport type AlertDialogDescriptionProps = ComponentPropsWithoutRef<\n typeof BaseAlertDialog.Description\n>;\n\nexport const AlertDialogDescription = forwardRef<HTMLParagraphElement, AlertDialogDescriptionProps>(\n function AlertDialogDescription({ className, ...props }, ref) {\n return (\n <BaseAlertDialog.Description\n {...props}\n ref={ref}\n className={withRecipeClassName(dialog().description, className)}\n data-slot=\"alert-dialog-description\"\n />\n );\n },\n);\n\nexport type AlertDialogBodyProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogBody = forwardRef<HTMLDivElement, AlertDialogBodyProps>(\n function AlertDialogBody({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().body, className)}\n data-slot=\"alert-dialog-body\"\n />\n );\n },\n);\n\nexport type AlertDialogFooterProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const AlertDialogFooter = forwardRef<HTMLDivElement, AlertDialogFooterProps>(\n function AlertDialogFooter({ className, ...props }, ref) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(dialog().footer, className)}\n data-slot=\"alert-dialog-footer\"\n />\n );\n },\n);\n\nexport type AlertDialogCloseProps = ComponentPropsWithoutRef<typeof BaseAlertDialog.Close> & {\n \"data-slot\"?: string;\n};\n\nexport const AlertDialogClose = forwardRef<HTMLButtonElement, AlertDialogCloseProps>(\n function AlertDialogClose(\n { \"aria-label\": ariaLabel, children, className, \"data-slot\": dataSlot, ...props },\n ref,\n ) {\n const hasVisibleLabel = children != null;\n\n return (\n <BaseAlertDialog.Close\n {...props}\n aria-label={ariaLabel ?? (hasVisibleLabel ? undefined : \"Close alert dialog\")}\n ref={ref}\n className={withRecipeClassName(\n hasVisibleLabel ? dialog().action : dialog().close,\n className,\n )}\n data-slot={dataSlot ?? \"alert-dialog-close\"}\n >\n {children ?? \"×\"}\n </BaseAlertDialog.Close>\n );\n },\n);\n\nexport type AlertDialogCancelProps = AlertDialogCloseProps;\n\nexport const AlertDialogCancel = forwardRef<HTMLButtonElement, AlertDialogCancelProps>(\n function AlertDialogCancel({ children = \"Cancel\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-cancel\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport type AlertDialogActionProps = AlertDialogCloseProps;\n\nexport const AlertDialogAction = forwardRef<HTMLButtonElement, AlertDialogActionProps>(\n function AlertDialogAction({ children = \"Continue\", ...props }, ref) {\n return (\n <AlertDialogClose {...props} ref={ref} data-slot=\"alert-dialog-action\">\n {children}\n </AlertDialogClose>\n );\n },\n);\n\nexport const AlertDialog = {\n Root: AlertDialogRoot,\n Trigger: AlertDialogTrigger,\n Portal: AlertDialogPortal,\n Backdrop: AlertDialogBackdrop,\n Viewport: AlertDialogViewport,\n Popup: AlertDialogPopup,\n Header: AlertDialogHeader,\n Title: AlertDialogTitle,\n Description: AlertDialogDescription,\n Body: AlertDialogBody,\n Footer: AlertDialogFooter,\n Close: AlertDialogClose,\n Cancel: AlertDialogCancel,\n Action: AlertDialogAction,\n createHandle: BaseAlertDialog.createHandle,\n};\n"],"mappings":";;;;;;;;;AAmBA,SAAgBA,kBAAmC,OAAsC;CACvF,OAAO,oBAACC,YAAg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AAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAIA,MAAa,oBAAoB,WAC/B,SAAS,kBAAkB,EAAE,WAAW,YAAY,GAAG,SAAS,KAAK;CACnE,OACE,oBAAC,kBAAD;EAAkB,GAAI;EAAY;EAAK,aAAU;EAC9C;CACe,CAAA;AAEtB,CACF;AAEA,MAAaC,gBAAc;CACzB,MAAMF;CACN,SAAS;CACT,QAAQ;CACR,UAAU;CACV,UAAU;CACV,OAAO;CACP,QAAQ;CACR,OAAO;CACP,aAAa;CACb,MAAM;CACN,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,QAAQ;CACR,cAAcC,YAAgB;AAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aspect-ratio.cjs","names":["cx","aspectRatioBox"],"sources":["../../../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { aspectRatioBox } from \"../../styled-system/recipes\";\n\nexport interface AspectRatioProps extends ComponentPropsWithoutRef<\"div\"> {\n ratio?: number;\n}\n\nexport const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(function AspectRatio(\n { className, ratio = 1, style, ...props },\n ref,\n) {\n const safeRatio = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(aspectRatioBox(), className)}\n data-jaci-component=\"aspect-ratio\"\n data-slot=\"aspect-ratio\"\n style={{ aspectRatio: safeRatio, ...style }}\n />\n );\n});\n"],"mappings":";;;;;AAUA,MAAa,eAAA,
|
|
1
|
+
{"version":3,"file":"aspect-ratio.cjs","names":["forwardRef","cx","aspectRatioBox"],"sources":["../../../src/components/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { aspectRatioBox } from \"../../styled-system/recipes\";\n\nexport interface AspectRatioProps extends ComponentPropsWithoutRef<\"div\"> {\n ratio?: number;\n}\n\nexport const AspectRatio = forwardRef<HTMLDivElement, AspectRatioProps>(function AspectRatio(\n { className, ratio = 1, style, ...props },\n ref,\n) {\n const safeRatio = Number.isFinite(ratio) && ratio > 0 ? ratio : 1;\n\n return (\n <div\n {...props}\n ref={ref}\n className={cx(aspectRatioBox(), className)}\n data-jaci-component=\"aspect-ratio\"\n data-slot=\"aspect-ratio\"\n style={{ aspectRatio: safeRatio, ...style }}\n />\n );\n});\n"],"mappings":";;;;;AAUA,MAAa,eAAA,GAAcA,MAAAA,WAAAA,CAA6C,SAAS,YAC/E,EAAE,WAAW,QAAQ,GAAG,OAAO,GAAG,SAClC,KACA;CACA,MAAM,YAAY,OAAO,SAAS,KAAK,KAAK,QAAQ,IAAI,QAAQ;CAEhE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGC,yBAAAA,eAAe,GAAG,SAAS;EACzC,uBAAoB;EACpB,aAAU;EACV,OAAO;GAAE,aAAa;GAAW,GAAG;EAAM;CAC3C,CAAA;AAEL,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.cjs","names":["avatar","BaseAvatar","withRecipeClassName"],"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { AvatarRoot as BaseAvatarRoot } from \"@base-ui/react/avatar\";\n\nimport { avatar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type AvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type AvatarShape = \"circle\" | \"rounded\";\n\ninterface AvatarStyleContextValue {\n hasAccessibleLabel: boolean;\n shape: AvatarShape;\n size: AvatarSize;\n}\n\nconst AvatarStyleContext = createContext<AvatarStyleContextValue>({\n hasAccessibleLabel: false,\n shape: \"circle\",\n size: \"md\",\n});\n\nfunction useAvatarStyleContext() {\n return useContext(AvatarStyleContext);\n}\n\nfunction useAvatarStyles() {\n const { shape, size } = useAvatarStyleContext();\n\n return avatar({ shape, size });\n}\n\nexport interface AvatarRootProps extends BaseAvatarRoot.Props {\n children?: ReactNode;\n shape?: AvatarShape;\n size?: AvatarSize;\n}\n\n/**\n * Groups an image and text fallback in a fixed-size avatar. Base UI controls\n * the image lifecycle, so only one accessible representation is mounted at a\n * time and the initial server render remains deterministic.\n */\nexport const AvatarRoot = forwardRef<HTMLSpanElement, AvatarRootProps>(function AvatarRoot(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n children,\n className,\n role,\n shape = \"circle\",\n size = \"md\",\n ...props\n },\n ref,\n) {\n const styles = avatar({ shape, size });\n const hasAccessibleLabel = Boolean(ariaLabel || ariaLabelledBy);\n\n return (\n <AvatarStyleContext.Provider value={{ hasAccessibleLabel, shape, size }}>\n <BaseAvatar.Root\n {...props}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"avatar\"\n data-shape={shape}\n data-size={size}\n data-slot=\"avatar\"\n role={role ?? (hasAccessibleLabel ? \"img\" : undefined)}\n >\n {children}\n </BaseAvatar.Root>\n </AvatarStyleContext.Provider>\n );\n});\n\nexport interface AvatarImageProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseAvatar.Image>, \"alt\"> {\n /** Use an empty string explicitly when the image is decorative. */\n alt: string;\n}\n\n/** The optional image layer. It is mounted by Base UI only after loading. */\nexport const AvatarImage = forwardRef<HTMLImageElement, AvatarImageProps>(function AvatarImage(\n { alt, className, ...props },\n ref,\n) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Image\n {...props}\n alt={hasAccessibleLabel ? \"\" : alt}\n aria-hidden={hasAccessibleLabel || undefined}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().image, className)}\n data-slot=\"avatar-image\"\n />\n );\n});\n\nexport type AvatarFallbackProps = ComponentPropsWithoutRef<typeof BaseAvatar.Fallback>;\n\n/** Textual initials or an icon shown whenever an image is unavailable. */\nexport const AvatarFallback = forwardRef<HTMLSpanElement, AvatarFallbackProps>(\n function AvatarFallback({ \"aria-hidden\": ariaHidden, className, ...props }, ref) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Fallback\n {...props}\n aria-hidden={ariaHidden ?? (hasAccessibleLabel || undefined)}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().fallback, className)}\n data-slot=\"avatar-fallback\"\n />\n );\n },\n);\n\nexport const Avatar = {\n Root: AvatarRoot,\n Image: AvatarImage,\n Fallback: AvatarFallback,\n};\n"],"mappings":";;;;;;;AAmBA,MAAM,sBAAA,
|
|
1
|
+
{"version":3,"file":"avatar.cjs","names":["createContext","useContext","avatar","forwardRef","BaseAvatar","withRecipeClassName"],"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { AvatarRoot as BaseAvatarRoot } from \"@base-ui/react/avatar\";\n\nimport { avatar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type AvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type AvatarShape = \"circle\" | \"rounded\";\n\ninterface AvatarStyleContextValue {\n hasAccessibleLabel: boolean;\n shape: AvatarShape;\n size: AvatarSize;\n}\n\nconst AvatarStyleContext = createContext<AvatarStyleContextValue>({\n hasAccessibleLabel: false,\n shape: \"circle\",\n size: \"md\",\n});\n\nfunction useAvatarStyleContext() {\n return useContext(AvatarStyleContext);\n}\n\nfunction useAvatarStyles() {\n const { shape, size } = useAvatarStyleContext();\n\n return avatar({ shape, size });\n}\n\nexport interface AvatarRootProps extends BaseAvatarRoot.Props {\n children?: ReactNode;\n shape?: AvatarShape;\n size?: AvatarSize;\n}\n\n/**\n * Groups an image and text fallback in a fixed-size avatar. Base UI controls\n * the image lifecycle, so only one accessible representation is mounted at a\n * time and the initial server render remains deterministic.\n */\nexport const AvatarRoot = forwardRef<HTMLSpanElement, AvatarRootProps>(function AvatarRoot(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n children,\n className,\n role,\n shape = \"circle\",\n size = \"md\",\n ...props\n },\n ref,\n) {\n const styles = avatar({ shape, size });\n const hasAccessibleLabel = Boolean(ariaLabel || ariaLabelledBy);\n\n return (\n <AvatarStyleContext.Provider value={{ hasAccessibleLabel, shape, size }}>\n <BaseAvatar.Root\n {...props}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"avatar\"\n data-shape={shape}\n data-size={size}\n data-slot=\"avatar\"\n role={role ?? (hasAccessibleLabel ? \"img\" : undefined)}\n >\n {children}\n </BaseAvatar.Root>\n </AvatarStyleContext.Provider>\n );\n});\n\nexport interface AvatarImageProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseAvatar.Image>, \"alt\"> {\n /** Use an empty string explicitly when the image is decorative. */\n alt: string;\n}\n\n/** The optional image layer. It is mounted by Base UI only after loading. */\nexport const AvatarImage = forwardRef<HTMLImageElement, AvatarImageProps>(function AvatarImage(\n { alt, className, ...props },\n ref,\n) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Image\n {...props}\n alt={hasAccessibleLabel ? \"\" : alt}\n aria-hidden={hasAccessibleLabel || undefined}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().image, className)}\n data-slot=\"avatar-image\"\n />\n );\n});\n\nexport type AvatarFallbackProps = ComponentPropsWithoutRef<typeof BaseAvatar.Fallback>;\n\n/** Textual initials or an icon shown whenever an image is unavailable. */\nexport const AvatarFallback = forwardRef<HTMLSpanElement, AvatarFallbackProps>(\n function AvatarFallback({ \"aria-hidden\": ariaHidden, className, ...props }, ref) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Fallback\n {...props}\n aria-hidden={ariaHidden ?? (hasAccessibleLabel || undefined)}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().fallback, className)}\n data-slot=\"avatar-fallback\"\n />\n );\n },\n);\n\nexport const Avatar = {\n Root: AvatarRoot,\n Image: AvatarImage,\n Fallback: AvatarFallback,\n};\n"],"mappings":";;;;;;;AAmBA,MAAM,sBAAA,GAAqBA,MAAAA,cAAAA,CAAuC;CAChE,oBAAoB;CACpB,OAAO;CACP,MAAM;AACR,CAAC;AAED,SAAS,wBAAwB;CAC/B,QAAA,GAAOC,MAAAA,WAAAA,CAAW,kBAAkB;AACtC;AAEA,SAAS,kBAAkB;CACzB,MAAM,EAAE,OAAO,SAAS,sBAAsB;CAE9C,OAAOC,eAAAA,OAAO;EAAE;EAAO;CAAK,CAAC;AAC/B;;;;;;AAaA,MAAa,cAAA,GAAaC,MAAAA,WAAAA,CAA6C,SAAS,WAC9E,EACE,cAAc,WACd,mBAAmB,gBACnB,UACA,WACA,MACA,QAAQ,UACR,OAAO,MACP,GAAG,SAEL,KACA;CACA,MAAM,SAASD,eAAAA,OAAO;EAAE;EAAO;CAAK,CAAC;CACrC,MAAM,qBAAqB,QAAQ,aAAa,cAAc;CAE9D,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,mBAAmB,UAApB;EAA6B,OAAO;GAAE;GAAoB;GAAO;EAAK;EACpE,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACE,sBAAAA,OAAW,MAAZ;GACE,GAAI;GACJ,cAAY;GACZ,mBAAiB;GACZ;GACL,WAAWC,gBAAAA,oBAAoB,OAAO,MAAM,SAAS;GACrD,uBAAoB;GACpB,cAAY;GACZ,aAAW;GACX,aAAU;GACV,MAAM,SAAS,qBAAqB,QAAQ,KAAA;GAE3C;EACc,CAAA;CACU,CAAA;AAEjC,CAAC;;AASD,MAAa,eAAA,GAAcF,MAAAA,WAAAA,CAA+C,SAAS,YACjF,EAAE,KAAK,WAAW,GAAG,SACrB,KACA;CACA,MAAM,EAAE,uBAAuB,sBAAsB;CAErD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,OAAZ;EACE,GAAI;EACJ,KAAK,qBAAqB,KAAK;EAC/B,eAAa,sBAAsB,KAAA;EAC9B;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,OAAO,SAAS;EACjE,aAAU;CACX,CAAA;AAEL,CAAC;;AAKD,MAAa,kBAAA,GAAiBF,MAAAA,WAAAA,CAC5B,SAAS,eAAe,EAAE,eAAe,YAAY,WAAW,GAAG,SAAS,KAAK;CAC/E,MAAM,EAAE,uBAAuB,sBAAsB;CAErD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,OAAW,UAAZ;EACE,GAAI;EACJ,eAAa,eAAe,sBAAsB,KAAA;EAC7C;EACL,WAAWC,gBAAAA,oBAAoB,gBAAgB,CAAC,CAAC,UAAU,SAAS;EACpE,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAa,SAAS;CACpB,MAAM;CACN,OAAO;CACP,UAAU;AACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","names":["AvatarRoot","BaseAvatar","Avatar"],"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { AvatarRoot as BaseAvatarRoot } from \"@base-ui/react/avatar\";\n\nimport { avatar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type AvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type AvatarShape = \"circle\" | \"rounded\";\n\ninterface AvatarStyleContextValue {\n hasAccessibleLabel: boolean;\n shape: AvatarShape;\n size: AvatarSize;\n}\n\nconst AvatarStyleContext = createContext<AvatarStyleContextValue>({\n hasAccessibleLabel: false,\n shape: \"circle\",\n size: \"md\",\n});\n\nfunction useAvatarStyleContext() {\n return useContext(AvatarStyleContext);\n}\n\nfunction useAvatarStyles() {\n const { shape, size } = useAvatarStyleContext();\n\n return avatar({ shape, size });\n}\n\nexport interface AvatarRootProps extends BaseAvatarRoot.Props {\n children?: ReactNode;\n shape?: AvatarShape;\n size?: AvatarSize;\n}\n\n/**\n * Groups an image and text fallback in a fixed-size avatar. Base UI controls\n * the image lifecycle, so only one accessible representation is mounted at a\n * time and the initial server render remains deterministic.\n */\nexport const AvatarRoot = forwardRef<HTMLSpanElement, AvatarRootProps>(function AvatarRoot(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n children,\n className,\n role,\n shape = \"circle\",\n size = \"md\",\n ...props\n },\n ref,\n) {\n const styles = avatar({ shape, size });\n const hasAccessibleLabel = Boolean(ariaLabel || ariaLabelledBy);\n\n return (\n <AvatarStyleContext.Provider value={{ hasAccessibleLabel, shape, size }}>\n <BaseAvatar.Root\n {...props}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"avatar\"\n data-shape={shape}\n data-size={size}\n data-slot=\"avatar\"\n role={role ?? (hasAccessibleLabel ? \"img\" : undefined)}\n >\n {children}\n </BaseAvatar.Root>\n </AvatarStyleContext.Provider>\n );\n});\n\nexport interface AvatarImageProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseAvatar.Image>, \"alt\"> {\n /** Use an empty string explicitly when the image is decorative. */\n alt: string;\n}\n\n/** The optional image layer. It is mounted by Base UI only after loading. */\nexport const AvatarImage = forwardRef<HTMLImageElement, AvatarImageProps>(function AvatarImage(\n { alt, className, ...props },\n ref,\n) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Image\n {...props}\n alt={hasAccessibleLabel ? \"\" : alt}\n aria-hidden={hasAccessibleLabel || undefined}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().image, className)}\n data-slot=\"avatar-image\"\n />\n );\n});\n\nexport type AvatarFallbackProps = ComponentPropsWithoutRef<typeof BaseAvatar.Fallback>;\n\n/** Textual initials or an icon shown whenever an image is unavailable. */\nexport const AvatarFallback = forwardRef<HTMLSpanElement, AvatarFallbackProps>(\n function AvatarFallback({ \"aria-hidden\": ariaHidden, className, ...props }, ref) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Fallback\n {...props}\n aria-hidden={ariaHidden ?? (hasAccessibleLabel || undefined)}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().fallback, className)}\n data-slot=\"avatar-fallback\"\n />\n );\n },\n);\n\nexport const Avatar = {\n Root: AvatarRoot,\n Image: AvatarImage,\n Fallback: AvatarFallback,\n};\n"],"mappings":";;;;;;;AAmBA,MAAM,qBAAqB,cAAuC;CAChE,oBAAoB;CACpB,OAAO;CACP,MAAM;AACR,CAAC;AAED,SAAS,wBAAwB;CAC/B,OAAO,WAAW,kBAAkB;AACtC;AAEA,SAAS,kBAAkB;CACzB,MAAM,EAAE,OAAO,SAAS,sBAAsB;CAE9C,OAAO,OAAO;EAAE;EAAO;CAAK,CAAC;AAC/B;;;;;;AAaA,MAAaA,eAAa,WAA6C,SAAS,WAC9E,EACE,cAAc,WACd,mBAAmB,gBACnB,UACA,WACA,MACA,QAAQ,UACR,OAAO,MACP,GAAG,SAEL,KACA;CACA,MAAM,SAAS,OAAO;EAAE;EAAO;CAAK,CAAC;CACrC,MAAM,qBAAqB,QAAQ,aAAa,cAAc;CAE9D,OACE,oBAAC,mBAAmB,UAApB;EAA6B,OAAO;GAAE;GAAoB;GAAO;EAAK;
|
|
1
|
+
{"version":3,"file":"avatar.js","names":["AvatarRoot","BaseAvatar","Avatar"],"sources":["../../../src/components/avatar/avatar.tsx"],"sourcesContent":["\"use client\";\n\nimport { Avatar as BaseAvatar } from \"@base-ui/react/avatar\";\nimport { createContext, forwardRef, useContext } from \"react\";\nimport type { ComponentPropsWithoutRef, ReactNode } from \"react\";\nimport type { AvatarRoot as BaseAvatarRoot } from \"@base-ui/react/avatar\";\n\nimport { avatar } from \"../../styled-system/recipes\";\nimport { withRecipeClassName } from \"../base-ui\";\n\nexport type AvatarSize = \"xs\" | \"sm\" | \"md\" | \"lg\" | \"xl\";\nexport type AvatarShape = \"circle\" | \"rounded\";\n\ninterface AvatarStyleContextValue {\n hasAccessibleLabel: boolean;\n shape: AvatarShape;\n size: AvatarSize;\n}\n\nconst AvatarStyleContext = createContext<AvatarStyleContextValue>({\n hasAccessibleLabel: false,\n shape: \"circle\",\n size: \"md\",\n});\n\nfunction useAvatarStyleContext() {\n return useContext(AvatarStyleContext);\n}\n\nfunction useAvatarStyles() {\n const { shape, size } = useAvatarStyleContext();\n\n return avatar({ shape, size });\n}\n\nexport interface AvatarRootProps extends BaseAvatarRoot.Props {\n children?: ReactNode;\n shape?: AvatarShape;\n size?: AvatarSize;\n}\n\n/**\n * Groups an image and text fallback in a fixed-size avatar. Base UI controls\n * the image lifecycle, so only one accessible representation is mounted at a\n * time and the initial server render remains deterministic.\n */\nexport const AvatarRoot = forwardRef<HTMLSpanElement, AvatarRootProps>(function AvatarRoot(\n {\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n children,\n className,\n role,\n shape = \"circle\",\n size = \"md\",\n ...props\n },\n ref,\n) {\n const styles = avatar({ shape, size });\n const hasAccessibleLabel = Boolean(ariaLabel || ariaLabelledBy);\n\n return (\n <AvatarStyleContext.Provider value={{ hasAccessibleLabel, shape, size }}>\n <BaseAvatar.Root\n {...props}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledBy}\n ref={ref}\n className={withRecipeClassName(styles.root, className)}\n data-jaci-component=\"avatar\"\n data-shape={shape}\n data-size={size}\n data-slot=\"avatar\"\n role={role ?? (hasAccessibleLabel ? \"img\" : undefined)}\n >\n {children}\n </BaseAvatar.Root>\n </AvatarStyleContext.Provider>\n );\n});\n\nexport interface AvatarImageProps\n extends Omit<ComponentPropsWithoutRef<typeof BaseAvatar.Image>, \"alt\"> {\n /** Use an empty string explicitly when the image is decorative. */\n alt: string;\n}\n\n/** The optional image layer. It is mounted by Base UI only after loading. */\nexport const AvatarImage = forwardRef<HTMLImageElement, AvatarImageProps>(function AvatarImage(\n { alt, className, ...props },\n ref,\n) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Image\n {...props}\n alt={hasAccessibleLabel ? \"\" : alt}\n aria-hidden={hasAccessibleLabel || undefined}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().image, className)}\n data-slot=\"avatar-image\"\n />\n );\n});\n\nexport type AvatarFallbackProps = ComponentPropsWithoutRef<typeof BaseAvatar.Fallback>;\n\n/** Textual initials or an icon shown whenever an image is unavailable. */\nexport const AvatarFallback = forwardRef<HTMLSpanElement, AvatarFallbackProps>(\n function AvatarFallback({ \"aria-hidden\": ariaHidden, className, ...props }, ref) {\n const { hasAccessibleLabel } = useAvatarStyleContext();\n\n return (\n <BaseAvatar.Fallback\n {...props}\n aria-hidden={ariaHidden ?? (hasAccessibleLabel || undefined)}\n ref={ref}\n className={withRecipeClassName(useAvatarStyles().fallback, className)}\n data-slot=\"avatar-fallback\"\n />\n );\n },\n);\n\nexport const Avatar = {\n Root: AvatarRoot,\n Image: AvatarImage,\n Fallback: AvatarFallback,\n};\n"],"mappings":";;;;;;;AAmBA,MAAM,qBAAqB,cAAuC;CAChE,oBAAoB;CACpB,OAAO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B,gBAAgB,CAAC,CAAC,UAAU,SAAS;EACpE,aAAU;CACX,CAAA;AAEL,CACF;AAEA,MAAaC,WAAS;CACpB,MAAMF;CACN,OAAO;CACP,UAAU;AACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumbs.cjs","names":["breadcrumbs","cx"],"sources":["../../../src/components/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { breadcrumbs } from \"../../styled-system/recipes\";\n\nexport type BreadcrumbsRootProps = ComponentPropsWithoutRef<\"nav\">;\n\n/** A landmark navigation region for a hierarchical path. */\nexport const BreadcrumbsRoot = forwardRef<HTMLElement, BreadcrumbsRootProps>(\n function BreadcrumbsRoot({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const styles = breadcrumbs();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Breadcrumb\"}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"breadcrumbs\"\n data-slot=\"breadcrumbs\"\n />\n );\n },\n);\n\nexport type BreadcrumbsListProps = ComponentPropsWithoutRef<\"ol\">;\n\n/** Ordered list containing links, separators, and the current page. */\nexport const BreadcrumbsList = forwardRef<HTMLOListElement, BreadcrumbsListProps>(\n function BreadcrumbsList({ className, ...props }, ref) {\n return (\n <ol\n {...props}\n ref={ref}\n className={cx(breadcrumbs().list, className)}\n data-slot=\"breadcrumbs-list\"\n />\n );\n },\n);\n\nexport type BreadcrumbsItemProps = ComponentPropsWithoutRef<\"li\">;\n\n/** A semantic list item that wraps one breadcrumb destination. */\nexport const BreadcrumbsItem = forwardRef<HTMLLIElement, BreadcrumbsItemProps>(\n function BreadcrumbsItem({ className, ...props }, ref) {\n return (\n <li\n {...props}\n ref={ref}\n className={cx(breadcrumbs().item, className)}\n data-slot=\"breadcrumbs-item\"\n />\n );\n },\n);\n\nexport type BreadcrumbsLinkProps = ComponentPropsWithoutRef<\"a\">;\n\n/** A link to an ancestor in the current path. */\nexport const BreadcrumbsLink = forwardRef<HTMLAnchorElement, BreadcrumbsLinkProps>(\n function BreadcrumbsLink({ className, ...props }, ref) {\n return (\n <a\n {...props}\n ref={ref}\n className={cx(breadcrumbs().link, className)}\n data-slot=\"breadcrumbs-link\"\n />\n );\n },\n);\n\nexport type BreadcrumbsCurrentProps = ComponentPropsWithoutRef<\"span\">;\n\n/** The final, non-link breadcrumb that identifies the current page. */\nexport const BreadcrumbsCurrent = forwardRef<HTMLSpanElement, BreadcrumbsCurrentProps>(\n function BreadcrumbsCurrent({ \"aria-current\": ariaCurrent, className, ...props }, ref) {\n return (\n <span\n {...props}\n aria-current={ariaCurrent ?? \"page\"}\n ref={ref}\n className={cx(breadcrumbs().current, className)}\n data-slot=\"breadcrumbs-current\"\n />\n );\n },\n);\n\nexport type BreadcrumbsSeparatorProps = ComponentPropsWithoutRef<\"li\">;\n\n/** A decorative separator. It is excluded from the ordered-list semantics. */\nexport const BreadcrumbsSeparator = forwardRef<HTMLLIElement, BreadcrumbsSeparatorProps>(\n function BreadcrumbsSeparator({ children = \"/\", className, ...props }, ref) {\n return (\n <li\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n role=\"presentation\"\n className={cx(breadcrumbs().separator, className)}\n data-slot=\"breadcrumbs-separator\"\n >\n {children}\n </li>\n );\n },\n);\n\nexport const Breadcrumbs = {\n Root: BreadcrumbsRoot,\n List: BreadcrumbsList,\n Item: BreadcrumbsItem,\n Link: BreadcrumbsLink,\n Current: BreadcrumbsCurrent,\n Separator: BreadcrumbsSeparator,\n};\n"],"mappings":";;;;;;AASA,MAAa,mBAAA,
|
|
1
|
+
{"version":3,"file":"breadcrumbs.cjs","names":["forwardRef","breadcrumbs","cx"],"sources":["../../../src/components/breadcrumbs/breadcrumbs.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { breadcrumbs } from \"../../styled-system/recipes\";\n\nexport type BreadcrumbsRootProps = ComponentPropsWithoutRef<\"nav\">;\n\n/** A landmark navigation region for a hierarchical path. */\nexport const BreadcrumbsRoot = forwardRef<HTMLElement, BreadcrumbsRootProps>(\n function BreadcrumbsRoot({ \"aria-label\": ariaLabel, className, ...props }, ref) {\n const styles = breadcrumbs();\n\n return (\n <nav\n {...props}\n aria-label={ariaLabel ?? \"Breadcrumb\"}\n ref={ref}\n className={cx(styles.root, className)}\n data-jaci-component=\"breadcrumbs\"\n data-slot=\"breadcrumbs\"\n />\n );\n },\n);\n\nexport type BreadcrumbsListProps = ComponentPropsWithoutRef<\"ol\">;\n\n/** Ordered list containing links, separators, and the current page. */\nexport const BreadcrumbsList = forwardRef<HTMLOListElement, BreadcrumbsListProps>(\n function BreadcrumbsList({ className, ...props }, ref) {\n return (\n <ol\n {...props}\n ref={ref}\n className={cx(breadcrumbs().list, className)}\n data-slot=\"breadcrumbs-list\"\n />\n );\n },\n);\n\nexport type BreadcrumbsItemProps = ComponentPropsWithoutRef<\"li\">;\n\n/** A semantic list item that wraps one breadcrumb destination. */\nexport const BreadcrumbsItem = forwardRef<HTMLLIElement, BreadcrumbsItemProps>(\n function BreadcrumbsItem({ className, ...props }, ref) {\n return (\n <li\n {...props}\n ref={ref}\n className={cx(breadcrumbs().item, className)}\n data-slot=\"breadcrumbs-item\"\n />\n );\n },\n);\n\nexport type BreadcrumbsLinkProps = ComponentPropsWithoutRef<\"a\">;\n\n/** A link to an ancestor in the current path. */\nexport const BreadcrumbsLink = forwardRef<HTMLAnchorElement, BreadcrumbsLinkProps>(\n function BreadcrumbsLink({ className, ...props }, ref) {\n return (\n <a\n {...props}\n ref={ref}\n className={cx(breadcrumbs().link, className)}\n data-slot=\"breadcrumbs-link\"\n />\n );\n },\n);\n\nexport type BreadcrumbsCurrentProps = ComponentPropsWithoutRef<\"span\">;\n\n/** The final, non-link breadcrumb that identifies the current page. */\nexport const BreadcrumbsCurrent = forwardRef<HTMLSpanElement, BreadcrumbsCurrentProps>(\n function BreadcrumbsCurrent({ \"aria-current\": ariaCurrent, className, ...props }, ref) {\n return (\n <span\n {...props}\n aria-current={ariaCurrent ?? \"page\"}\n ref={ref}\n className={cx(breadcrumbs().current, className)}\n data-slot=\"breadcrumbs-current\"\n />\n );\n },\n);\n\nexport type BreadcrumbsSeparatorProps = ComponentPropsWithoutRef<\"li\">;\n\n/** A decorative separator. It is excluded from the ordered-list semantics. */\nexport const BreadcrumbsSeparator = forwardRef<HTMLLIElement, BreadcrumbsSeparatorProps>(\n function BreadcrumbsSeparator({ children = \"/\", className, ...props }, ref) {\n return (\n <li\n {...props}\n aria-hidden=\"true\"\n ref={ref}\n role=\"presentation\"\n className={cx(breadcrumbs().separator, className)}\n data-slot=\"breadcrumbs-separator\"\n >\n {children}\n </li>\n );\n },\n);\n\nexport const Breadcrumbs = {\n Root: BreadcrumbsRoot,\n List: BreadcrumbsList,\n Item: BreadcrumbsItem,\n Link: BreadcrumbsLink,\n Current: BreadcrumbsCurrent,\n Separator: BreadcrumbsSeparator,\n};\n"],"mappings":";;;;;;AASA,MAAa,mBAAA,GAAkBA,MAAAA,WAAAA,CAC7B,SAAS,gBAAgB,EAAE,cAAc,WAAW,WAAW,GAAG,SAAS,KAAK;CAC9E,MAAM,SAASC,oBAAAA,YAAY;CAE3B,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACJ,cAAY,aAAa;EACpB;EACL,WAAWC,WAAAA,GAAG,OAAO,MAAM,SAAS;EACpC,uBAAoB;EACpB,aAAU;CACX,CAAA;AAEL,CACF;;AAKA,MAAa,mBAAA,GAAkBF,MAAAA,WAAAA,CAC7B,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAS,KAAK;CACrD,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;EACE,GAAI;EACC;EACL,WAAWE,WAAAA,GAAGD,oBAAAA,YAAY,CAAC,C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AS;CACT,WAAW;AACb"}
|
|
@@ -39,6 +39,7 @@ const Button = (0, react.forwardRef)(function Button({ children, className, vari
|
|
|
39
39
|
"data-slot": "button",
|
|
40
40
|
children: childrenWithIcons,
|
|
41
41
|
onClick: handleRenderedClick,
|
|
42
|
+
ref,
|
|
42
43
|
...render.type === "a" && (disabled || loading) ? {
|
|
43
44
|
href: renderedHref,
|
|
44
45
|
tabIndex: -1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.cjs","names":["Spinner","cx","button"],"sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import { cloneElement, forwardRef } from \"react\";\nimport type {\n ComponentPropsWithoutRef,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { button } from \"../../styled-system/recipes\";\nimport { Spinner } from \"../layout\";\n\ntype RenderableButtonProps = Record<string, unknown> & {\n children?: ReactNode | undefined;\n className?: string | undefined;\n href?: string | undefined;\n onClick?: MouseEventHandler<HTMLElement> | undefined;\n};\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"color\" | \"children\"> {\n children?: ReactNode;\n variant?: \"outline\" | \"solid\" | \"ghost\" | \"danger\";\n size?: \"sm\" | \"md\" | \"lg\";\n fullWidth?: boolean;\n loading?: boolean;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n render?: ReactElement<RenderableButtonProps>;\n}\n\nfunction content(children: ReactNode, loading: boolean, startIcon: ReactNode, endIcon: ReactNode) {\n return (\n <>\n {loading ? <Spinner aria-hidden=\"true\" label=\"\" size=\"sm\" /> : startIcon}\n {children}\n {!loading ? endIcon : undefined}\n </>\n );\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n className,\n variant = \"outline\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n startIcon,\n endIcon,\n disabled,\n onClick: buttonOnClick,\n render,\n type = \"button\",\n ...props\n },\n ref,\n) {\n const buttonClassName = cx(button({ variant, size, fullWidth }), className);\n const childrenWithIcons = content(children, loading, startIcon, endIcon);\n\n if (render) {\n // Keep the render path tolerant of framework-rendered elements and avoid\n // adding a synthetic client handler when the composed element has none.\n const renderedProps = render.props ?? {};\n const renderedOnClick = renderedProps.onClick as MouseEventHandler<HTMLElement> | undefined;\n const handleRenderedClick: MouseEventHandler<HTMLElement> | undefined =\n renderedOnClick || buttonOnClick\n ? disabled || loading\n ? (event) => event.preventDefault()\n : (event) => {\n renderedOnClick?.(event);\n if (!event.defaultPrevented) {\n buttonOnClick?.(event as unknown as MouseEvent<HTMLButtonElement>);\n }\n }\n : undefined;\n\n // A server component can compose Button with a native anchor. Remove its\n // href while disabled/loading instead of attaching a client-only event\n // handler during the server render.\n const renderedHref =\n disabled || loading\n ? render.type === \"a\"\n ? undefined\n : renderedProps.href\n : renderedProps.href;\n\n return cloneElement(render, {\n ...props,\n \"aria-busy\": loading || undefined,\n \"aria-disabled\": disabled || loading || undefined,\n className: cx(buttonClassName, renderedProps.className),\n \"data-jaci-component\": \"button\",\n \"data-slot\": \"button\",\n children: childrenWithIcons,\n onClick: handleRenderedClick,\n ...(render.type === \"a\" && (disabled || loading) ? { href: renderedHref, tabIndex: -1 } : {}),\n });\n }\n\n return (\n <button\n {...props}\n aria-busy={loading || undefined}\n className={buttonClassName}\n data-jaci-component=\"button\"\n data-slot=\"button\"\n disabled={disabled || loading}\n onClick={buttonOnClick}\n ref={ref}\n type={type}\n >\n {childrenWithIcons}\n </button>\n );\n});\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"button.cjs","names":["Spinner","forwardRef","cx","button","cloneElement"],"sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import { cloneElement, forwardRef } from \"react\";\nimport type {\n ComponentPropsWithoutRef,\n MouseEvent,\n MouseEventHandler,\n Ref,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { button } from \"../../styled-system/recipes\";\nimport { Spinner } from \"../layout\";\n\ntype RenderableButtonProps = Record<string, unknown> & {\n children?: ReactNode | undefined;\n className?: string | undefined;\n href?: string | undefined;\n onClick?: MouseEventHandler<HTMLElement> | undefined;\n ref?: Ref<HTMLElement> | undefined;\n};\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"color\" | \"children\"> {\n children?: ReactNode;\n variant?: \"outline\" | \"solid\" | \"ghost\" | \"danger\";\n size?: \"sm\" | \"md\" | \"lg\";\n fullWidth?: boolean;\n loading?: boolean;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n render?: ReactElement<RenderableButtonProps>;\n}\n\nfunction content(children: ReactNode, loading: boolean, startIcon: ReactNode, endIcon: ReactNode) {\n return (\n <>\n {loading ? <Spinner aria-hidden=\"true\" label=\"\" size=\"sm\" /> : startIcon}\n {children}\n {!loading ? endIcon : undefined}\n </>\n );\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n className,\n variant = \"outline\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n startIcon,\n endIcon,\n disabled,\n onClick: buttonOnClick,\n render,\n type = \"button\",\n ...props\n },\n ref,\n) {\n const buttonClassName = cx(button({ variant, size, fullWidth }), className);\n const childrenWithIcons = content(children, loading, startIcon, endIcon);\n\n if (render) {\n // Keep the render path tolerant of framework-rendered elements and avoid\n // adding a synthetic client handler when the composed element has none.\n const renderedProps = render.props ?? {};\n const renderedOnClick = renderedProps.onClick as MouseEventHandler<HTMLElement> | undefined;\n const handleRenderedClick: MouseEventHandler<HTMLElement> | undefined =\n renderedOnClick || buttonOnClick\n ? disabled || loading\n ? (event) => event.preventDefault()\n : (event) => {\n renderedOnClick?.(event);\n if (!event.defaultPrevented) {\n buttonOnClick?.(event as unknown as MouseEvent<HTMLButtonElement>);\n }\n }\n : undefined;\n\n // A server component can compose Button with a native anchor. Remove its\n // href while disabled/loading instead of attaching a client-only event\n // handler during the server render.\n const renderedHref =\n disabled || loading\n ? render.type === \"a\"\n ? undefined\n : renderedProps.href\n : renderedProps.href;\n\n return cloneElement(render, {\n ...props,\n \"aria-busy\": loading || undefined,\n \"aria-disabled\": disabled || loading || undefined,\n className: cx(buttonClassName, renderedProps.className),\n \"data-jaci-component\": \"button\",\n \"data-slot\": \"button\",\n children: childrenWithIcons,\n onClick: handleRenderedClick,\n // `render` is intentionally polymorphic. Forward the public Button ref\n // to the rendered element so anchors and framework links keep the same\n // focus/ref contract as the native button path.\n ref: ref as unknown as Ref<HTMLElement>,\n ...(render.type === \"a\" && (disabled || loading) ? { href: renderedHref, tabIndex: -1 } : {}),\n });\n }\n\n return (\n <button\n {...props}\n aria-busy={loading || undefined}\n className={buttonClassName}\n data-jaci-component=\"button\"\n data-slot=\"button\"\n disabled={disabled || loading}\n onClick={buttonOnClick}\n ref={ref}\n type={type}\n >\n {childrenWithIcons}\n </button>\n );\n});\n"],"mappings":";;;;;;AAkCA,SAAS,QAAQ,UAAqB,SAAkB,WAAsB,SAAoB;CAChG,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAA,kBAAA,UAAA,EAAA,UAAA;EACG,UAAU,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,SAAD;GAAS,eAAY;GAAO,OAAM;GAAG,MAAK;EAAM,CAAA,IAAI;EAC9D;EACA,CAAC,UAAU,UAAU,KAAA;CACtB,EAAA,CAAA;AAEN;AAEA,MAAa,UAAA,GAASC,MAAAA,WAAAA,CAA2C,SAAS,OACxE,EACE,UACA,WACA,UAAU,WACV,OAAO,MACP,YAAY,OACZ,UAAU,OACV,WACA,SACA,UACA,SAAS,eACT,QACA,OAAO,UACP,GAAG,SAEL,KACA;CACA,MAAM,kBAAkBC,WAAAA,GAAGC,eAAAA,OAAO;EAAE;EAAS;EAAM;CAAU,CAAC,GAAG,SAAS;CAC1E,MAAM,oBAAoB,QAAQ,UAAU,SAAS,WAAW,OAAO;CAEvE,IAAI,QAAQ;EAGV,MAAM,gBAAgB,OAAO,SAAS,CAAC;EACvC,MAAM,kBAAkB,cAAc;EACtC,MAAM,sBACJ,mBAAmB,gBACf,YAAY,WACT,UAAU,MAAM,eAAe,KAC/B,UAAU;GACT,kBAAkB,KAAK;GACvB,IAAI,CAAC,MAAM,kBACT,gBAAgB,KAAiD;EAErE,IACF,KAAA;EAKN,MAAM,eACJ,YAAY,UACR,OAAO,SAAS,MACd,KAAA,IACA,cAAc,OAChB,cAAc;EAEpB,QAAA,GAAOC,MAAAA,aAAAA,CAAa,QAAQ;GAC1B,GAAG;GACH,aAAa,WAAW,KAAA;GACxB,iBAAiB,YAAY,WAAW,KAAA;GACxC,WAAWF,WAAAA,GAAG,iBAAiB,cAAc,SAAS;GACtD,uBAAuB;GACvB,aAAa;GACb,UAAU;GACV,SAAS;GAIJ;GACL,GAAI,OAAO,SAAS,QAAQ,YAAY,WAAW;IAAE,MAAM;IAAc,UAAU;GAAG,IAAI,CAAC;EAC7F,CAAC;CACH;CAEA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,UAAD;EACE,GAAI;EACJ,aAAW,WAAW,KAAA;EACtB,WAAW;EACX,uBAAoB;EACpB,aAAU;EACV,UAAU,YAAY;EACtB,SAAS;EACJ;EACC;EAEL,UAAA;CACK,CAAA;AAEZ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
1
|
+
import { ComponentPropsWithoutRef, MouseEventHandler, ReactElement, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/components/button/button.d.ts
|
|
3
3
|
type RenderableButtonProps = Record<string, unknown> & {
|
|
4
4
|
children?: ReactNode | undefined;
|
|
5
5
|
className?: string | undefined;
|
|
6
6
|
href?: string | undefined;
|
|
7
7
|
onClick?: MouseEventHandler<HTMLElement> | undefined;
|
|
8
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
8
9
|
};
|
|
9
10
|
interface ButtonProps extends Omit<ComponentPropsWithoutRef<"button">, "color" | "children"> {
|
|
10
11
|
children?: ReactNode;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ComponentPropsWithoutRef, MouseEventHandler, ReactElement, ReactNode } from "react";
|
|
1
|
+
import { ComponentPropsWithoutRef, MouseEventHandler, ReactElement, ReactNode, Ref } from "react";
|
|
2
2
|
//#region src/components/button/button.d.ts
|
|
3
3
|
type RenderableButtonProps = Record<string, unknown> & {
|
|
4
4
|
children?: ReactNode | undefined;
|
|
5
5
|
className?: string | undefined;
|
|
6
6
|
href?: string | undefined;
|
|
7
7
|
onClick?: MouseEventHandler<HTMLElement> | undefined;
|
|
8
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
8
9
|
};
|
|
9
10
|
interface ButtonProps extends Omit<ComponentPropsWithoutRef<"button">, "color" | "children"> {
|
|
10
11
|
children?: ReactNode;
|
|
@@ -39,6 +39,7 @@ const Button = forwardRef(function Button({ children, className, variant = "outl
|
|
|
39
39
|
"data-slot": "button",
|
|
40
40
|
children: childrenWithIcons,
|
|
41
41
|
onClick: handleRenderedClick,
|
|
42
|
+
ref,
|
|
42
43
|
...render.type === "a" && (disabled || loading) ? {
|
|
43
44
|
href: renderedHref,
|
|
44
45
|
tabIndex: -1
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","names":[],"sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import { cloneElement, forwardRef } from \"react\";\nimport type {\n ComponentPropsWithoutRef,\n MouseEvent,\n MouseEventHandler,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { button } from \"../../styled-system/recipes\";\nimport { Spinner } from \"../layout\";\n\ntype RenderableButtonProps = Record<string, unknown> & {\n children?: ReactNode | undefined;\n className?: string | undefined;\n href?: string | undefined;\n onClick?: MouseEventHandler<HTMLElement> | undefined;\n};\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"color\" | \"children\"> {\n children?: ReactNode;\n variant?: \"outline\" | \"solid\" | \"ghost\" | \"danger\";\n size?: \"sm\" | \"md\" | \"lg\";\n fullWidth?: boolean;\n loading?: boolean;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n render?: ReactElement<RenderableButtonProps>;\n}\n\nfunction content(children: ReactNode, loading: boolean, startIcon: ReactNode, endIcon: ReactNode) {\n return (\n <>\n {loading ? <Spinner aria-hidden=\"true\" label=\"\" size=\"sm\" /> : startIcon}\n {children}\n {!loading ? endIcon : undefined}\n </>\n );\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n className,\n variant = \"outline\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n startIcon,\n endIcon,\n disabled,\n onClick: buttonOnClick,\n render,\n type = \"button\",\n ...props\n },\n ref,\n) {\n const buttonClassName = cx(button({ variant, size, fullWidth }), className);\n const childrenWithIcons = content(children, loading, startIcon, endIcon);\n\n if (render) {\n // Keep the render path tolerant of framework-rendered elements and avoid\n // adding a synthetic client handler when the composed element has none.\n const renderedProps = render.props ?? {};\n const renderedOnClick = renderedProps.onClick as MouseEventHandler<HTMLElement> | undefined;\n const handleRenderedClick: MouseEventHandler<HTMLElement> | undefined =\n renderedOnClick || buttonOnClick\n ? disabled || loading\n ? (event) => event.preventDefault()\n : (event) => {\n renderedOnClick?.(event);\n if (!event.defaultPrevented) {\n buttonOnClick?.(event as unknown as MouseEvent<HTMLButtonElement>);\n }\n }\n : undefined;\n\n // A server component can compose Button with a native anchor. Remove its\n // href while disabled/loading instead of attaching a client-only event\n // handler during the server render.\n const renderedHref =\n disabled || loading\n ? render.type === \"a\"\n ? undefined\n : renderedProps.href\n : renderedProps.href;\n\n return cloneElement(render, {\n ...props,\n \"aria-busy\": loading || undefined,\n \"aria-disabled\": disabled || loading || undefined,\n className: cx(buttonClassName, renderedProps.className),\n \"data-jaci-component\": \"button\",\n \"data-slot\": \"button\",\n children: childrenWithIcons,\n onClick: handleRenderedClick,\n ...(render.type === \"a\" && (disabled || loading) ? { href: renderedHref, tabIndex: -1 } : {}),\n });\n }\n\n return (\n <button\n {...props}\n aria-busy={loading || undefined}\n className={buttonClassName}\n data-jaci-component=\"button\"\n data-slot=\"button\"\n disabled={disabled || loading}\n onClick={buttonOnClick}\n ref={ref}\n type={type}\n >\n {childrenWithIcons}\n </button>\n );\n});\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"button.js","names":[],"sources":["../../../src/components/button/button.tsx"],"sourcesContent":["import { cloneElement, forwardRef } from \"react\";\nimport type {\n ComponentPropsWithoutRef,\n MouseEvent,\n MouseEventHandler,\n Ref,\n ReactElement,\n ReactNode,\n} from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { button } from \"../../styled-system/recipes\";\nimport { Spinner } from \"../layout\";\n\ntype RenderableButtonProps = Record<string, unknown> & {\n children?: ReactNode | undefined;\n className?: string | undefined;\n href?: string | undefined;\n onClick?: MouseEventHandler<HTMLElement> | undefined;\n ref?: Ref<HTMLElement> | undefined;\n};\n\nexport interface ButtonProps\n extends Omit<ComponentPropsWithoutRef<\"button\">, \"color\" | \"children\"> {\n children?: ReactNode;\n variant?: \"outline\" | \"solid\" | \"ghost\" | \"danger\";\n size?: \"sm\" | \"md\" | \"lg\";\n fullWidth?: boolean;\n loading?: boolean;\n startIcon?: ReactNode;\n endIcon?: ReactNode;\n render?: ReactElement<RenderableButtonProps>;\n}\n\nfunction content(children: ReactNode, loading: boolean, startIcon: ReactNode, endIcon: ReactNode) {\n return (\n <>\n {loading ? <Spinner aria-hidden=\"true\" label=\"\" size=\"sm\" /> : startIcon}\n {children}\n {!loading ? endIcon : undefined}\n </>\n );\n}\n\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n children,\n className,\n variant = \"outline\",\n size = \"md\",\n fullWidth = false,\n loading = false,\n startIcon,\n endIcon,\n disabled,\n onClick: buttonOnClick,\n render,\n type = \"button\",\n ...props\n },\n ref,\n) {\n const buttonClassName = cx(button({ variant, size, fullWidth }), className);\n const childrenWithIcons = content(children, loading, startIcon, endIcon);\n\n if (render) {\n // Keep the render path tolerant of framework-rendered elements and avoid\n // adding a synthetic client handler when the composed element has none.\n const renderedProps = render.props ?? {};\n const renderedOnClick = renderedProps.onClick as MouseEventHandler<HTMLElement> | undefined;\n const handleRenderedClick: MouseEventHandler<HTMLElement> | undefined =\n renderedOnClick || buttonOnClick\n ? disabled || loading\n ? (event) => event.preventDefault()\n : (event) => {\n renderedOnClick?.(event);\n if (!event.defaultPrevented) {\n buttonOnClick?.(event as unknown as MouseEvent<HTMLButtonElement>);\n }\n }\n : undefined;\n\n // A server component can compose Button with a native anchor. Remove its\n // href while disabled/loading instead of attaching a client-only event\n // handler during the server render.\n const renderedHref =\n disabled || loading\n ? render.type === \"a\"\n ? undefined\n : renderedProps.href\n : renderedProps.href;\n\n return cloneElement(render, {\n ...props,\n \"aria-busy\": loading || undefined,\n \"aria-disabled\": disabled || loading || undefined,\n className: cx(buttonClassName, renderedProps.className),\n \"data-jaci-component\": \"button\",\n \"data-slot\": \"button\",\n children: childrenWithIcons,\n onClick: handleRenderedClick,\n // `render` is intentionally polymorphic. Forward the public Button ref\n // to the rendered element so anchors and framework links keep the same\n // focus/ref contract as the native button path.\n ref: ref as unknown as Ref<HTMLElement>,\n ...(render.type === \"a\" && (disabled || loading) ? { href: renderedHref, tabIndex: -1 } : {}),\n });\n }\n\n return (\n <button\n {...props}\n aria-busy={loading || undefined}\n className={buttonClassName}\n data-jaci-component=\"button\"\n data-slot=\"button\"\n disabled={disabled || loading}\n onClick={buttonOnClick}\n ref={ref}\n type={type}\n >\n {childrenWithIcons}\n </button>\n );\n});\n"],"mappings":";;;;;;AAkCA,SAAS,QAAQ,UAAqB,SAAkB,WAAsB,SAAoB;CAChG,OACE,qBAAA,UAAA,EAAA,UAAA;EACG,UAAU,oBAAC,SAAD;GAAS,eAAY;GAAO,OAAM;GAAG,MAAK;EAAM,CAAA,IAAI;EAC9D;EACA,CAAC,UAAU,UAAU,KAAA;CACtB,EAAA,CAAA;AAEN;AAEA,MAAa,SAAS,WAA2C,SAAS,OACxE,EACE,UACA,WACA,UAAU,WACV,OAAO,MACP,YAAY,OACZ,UAAU,OACV,WACA,SACA,UACA,SAAS,eACT,QACA,OAAO,UACP,GAAG,SAEL,KACA;CACA,MAAM,kBAAkB,GAAG,OAAO;EAAE;EAAS;EAAM;CAAU,CAAC,GAAG,SAAS;CAC1E,MAAM,oBAAoB,QAAQ,UAAU,SAAS,WAAW,OAAO;CAEvE,IAAI,QAAQ;EAGV,MAAM,gBAAgB,OAAO,SAAS,CAAC;EACvC,MAAM,kBAAkB,cAAc;EACtC,MAAM,sBACJ,mBAAmB,gBACf,YAAY,WACT,UAAU,MAAM,eAAe,KAC/B,UAAU;GACT,kBAAkB,KAAK;GACvB,IAAI,CAAC,MAAM,kBACT,gBAAgB,KAAiD;EAErE,IACF,KAAA;EAKN,MAAM,eACJ,YAAY,UACR,OAAO,SAAS,MACd,KAAA,IACA,cAAc,OAChB,cAAc;EAEpB,OAAO,aAAa,QAAQ;GAC1B,GAAG;GACH,aAAa,WAAW,KAAA;GACxB,iBAAiB,YAAY,WAAW,KAAA;GACxC,WAAW,GAAG,iBAAiB,cAAc,SAAS;GACtD,uBAAuB;GACvB,aAAa;GACb,UAAU;GACV,SAAS;GAIJ;GACL,GAAI,OAAO,SAAS,QAAQ,YAAY,WAAW;IAAE,MAAM;IAAc,UAAU;GAAG,IAAI,CAAC;EAC7F,CAAC;CACH;CAEA,OACE,oBAAC,UAAD;EACE,GAAI;EACJ,aAAW,WAAW,KAAA;EACtB,WAAW;EACX,uBAAoB;EACpB,aAAU;EACV,UAAU,YAAY;EACtB,SAAS;EACJ;EACC;EAEL,UAAA;CACK,CAAA;AAEZ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.cjs","names":["cx","buttonGroup"],"sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { buttonGroup } from \"../../styled-system/recipes\";\n\nexport interface ButtonGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const ButtonGroupRoot = forwardRef<HTMLDivElement, ButtonGroupProps>(function ButtonGroup(\n { className, orientation = \"horizontal\", ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(buttonGroup({ orientation }).root, className)}\n data-jaci-component=\"button-group\"\n data-orientation={orientation}\n data-slot=\"button-group\"\n role={props.role ?? \"group\"}\n />\n );\n});\n\nexport const ButtonGroup = Object.assign(ButtonGroupRoot, { Root: ButtonGroupRoot });\n"],"mappings":";;;;;AAUA,MAAa,mBAAA,
|
|
1
|
+
{"version":3,"file":"button-group.cjs","names":["forwardRef","cx","buttonGroup"],"sources":["../../../src/components/button-group/button-group.tsx"],"sourcesContent":["import { forwardRef } from \"react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\n\nimport { cx } from \"../../styled-system/css\";\nimport { buttonGroup } from \"../../styled-system/recipes\";\n\nexport interface ButtonGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n orientation?: \"horizontal\" | \"vertical\";\n}\n\nexport const ButtonGroupRoot = forwardRef<HTMLDivElement, ButtonGroupProps>(function ButtonGroup(\n { className, orientation = \"horizontal\", ...props },\n ref,\n) {\n return (\n <div\n {...props}\n ref={ref}\n className={cx(buttonGroup({ orientation }).root, className)}\n data-jaci-component=\"button-group\"\n data-orientation={orientation}\n data-slot=\"button-group\"\n role={props.role ?? \"group\"}\n />\n );\n});\n\nexport const ButtonGroup = Object.assign(ButtonGroupRoot, { Root: ButtonGroupRoot });\n"],"mappings":";;;;;AAUA,MAAa,mBAAA,GAAkBA,MAAAA,WAAAA,CAA6C,SAAS,YACnF,EAAE,WAAW,cAAc,cAAc,GAAG,SAC5C,KACA;CACA,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EACE,GAAI;EACC;EACL,WAAWC,WAAAA,GAAGC,qBAAAA,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,MAAM,SAAS;EAC1D,uBAAoB;EACpB,oBAAkB;EAClB,aAAU;EACV,MAAM,MAAM,QAAQ;CACrB,CAAA;AAEL,CAAC;AAED,MAAa,cAAc,OAAO,OAAO,iBAAiB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -291,12 +291,10 @@ const CalendarDay = (0, react.forwardRef)(function CalendarDay({ children, class
|
|
|
291
291
|
nextDate = require_date_utils.addMonths(date, event.shiftKey ? 12 : 1);
|
|
292
292
|
break;
|
|
293
293
|
case "Enter":
|
|
294
|
-
case " ":
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
}
|
|
299
|
-
break;
|
|
294
|
+
case " ": if (!isDisabled) {
|
|
295
|
+
event.preventDefault();
|
|
296
|
+
onSelect(date);
|
|
297
|
+
}
|
|
300
298
|
}
|
|
301
299
|
if (nextDate) {
|
|
302
300
|
event.preventDefault();
|