@panneau/ui 5.0.0-alpha.6 → 5.0.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -1
- package/dist/alert/Alert.d.ts +2 -2
- package/dist/alert/Alert.js +108 -40
- package/dist/alert/Alert.js.map +1 -1
- package/dist/alert/tokens.d.ts +1 -1
- package/dist/alert/tokens.js.map +1 -1
- package/dist/badge/Badge.d.ts +1 -1
- package/dist/badge/Badge.js +34 -6
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/tokens.d.ts +1 -1
- package/dist/badge/tokens.js.map +1 -1
- package/dist/button/Button.d.ts +3 -3
- package/dist/button/Button.js +111 -17
- package/dist/button/Button.js.map +1 -1
- package/dist/button/tokens.d.ts +1 -1
- package/dist/button/tokens.js.map +1 -1
- package/dist/card/Card.js +76 -23
- package/dist/card/Card.js.map +1 -1
- package/dist/card/tokens.d.ts +1 -1
- package/dist/card/tokens.js.map +1 -1
- package/dist/checkbox/Checkbox.d.ts +1 -1
- package/dist/checkbox/Checkbox.js +86 -25
- package/dist/checkbox/Checkbox.js.map +1 -1
- package/dist/checkbox/ChoiceChrome.js +82 -21
- package/dist/checkbox/ChoiceChrome.js.map +1 -1
- package/dist/checkbox/tokens.d.ts +1 -1
- package/dist/checkbox/tokens.js.map +1 -1
- package/dist/combo-box/ComboBox.d.ts +1 -1
- package/dist/combo-box/ComboBox.js +291 -79
- package/dist/combo-box/ComboBox.js.map +1 -1
- package/dist/command-palette/CommandPalette.d.ts +1 -1
- package/dist/command-palette/CommandPalette.js +463 -160
- package/dist/command-palette/CommandPalette.js.map +1 -1
- package/dist/command-palette/match.d.ts +1 -1
- package/dist/command-palette/match.js.map +1 -1
- package/dist/command-palette/tokens.d.ts +1 -1
- package/dist/command-palette/tokens.js.map +1 -1
- package/dist/command-palette/useCommandShortcut.js +31 -12
- package/dist/command-palette/useCommandShortcut.js.map +1 -1
- package/dist/container/Container.js +48 -5
- package/dist/container/Container.js.map +1 -1
- package/dist/container/tokens.d.ts +1 -1
- package/dist/container/tokens.js.map +1 -1
- package/dist/date-picker/DatePicker.d.ts +1 -1
- package/dist/date-picker/DatePicker.js +234 -73
- package/dist/date-picker/DatePicker.js.map +1 -1
- package/dist/date-picker/calendarTokens.d.ts +1 -1
- package/dist/date-picker/calendarTokens.js.map +1 -1
- package/dist/dialog/Dialog.js +161 -45
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/tokens.d.ts +1 -1
- package/dist/dialog/tokens.js.map +1 -1
- package/dist/disclosure/Disclosure.js +132 -28
- package/dist/disclosure/Disclosure.js.map +1 -1
- package/dist/disclosure/tokens.d.ts +1 -1
- package/dist/disclosure/tokens.js.map +1 -1
- package/dist/divider/Divider.js +55 -11
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/tokens.d.ts +1 -1
- package/dist/divider/tokens.js.map +1 -1
- package/dist/field/FieldParts.d.ts +1 -1
- package/dist/field/FieldParts.js +69 -15
- package/dist/field/FieldParts.js.map +1 -1
- package/dist/field/Fieldset.js +99 -32
- package/dist/field/Fieldset.js.map +1 -1
- package/dist/field/inputTokens.d.ts +1 -1
- package/dist/field/inputTokens.js.map +1 -1
- package/dist/field/tokens.d.ts +1 -1
- package/dist/field/tokens.js.map +1 -1
- package/dist/grid/Grid.d.ts +1 -1
- package/dist/grid/Grid.js +123 -14
- package/dist/grid/Grid.js.map +1 -1
- package/dist/grid/tokens.d.ts +1 -1
- package/dist/grid/tokens.js.map +1 -1
- package/dist/heading/Heading.js +41 -6
- package/dist/heading/Heading.js.map +1 -1
- package/dist/heading/tokens.d.ts +1 -1
- package/dist/heading/tokens.js.map +1 -1
- package/dist/icon/Icon.js +36 -11
- package/dist/icon/Icon.js.map +1 -1
- package/dist/icon/lucideIconLoader.d.ts +1 -1
- package/dist/icon/lucideIconLoader.js.map +1 -1
- package/dist/icon/namedIcons.d.ts +1 -1
- package/dist/icon/namedIcons.js +87 -26
- package/dist/icon/namedIcons.js.map +1 -1
- package/dist/icon-button/IconButton.d.ts +2 -2
- package/dist/icon-button/IconButton.js +70 -13
- package/dist/icon-button/IconButton.js.map +1 -1
- package/dist/index.d.ts +61 -59
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/inline/Inline.d.ts +1 -1
- package/dist/inline/Inline.js +65 -7
- package/dist/inline/Inline.js.map +1 -1
- package/dist/inline/tokens.d.ts +1 -1
- package/dist/inline/tokens.js.map +1 -1
- package/dist/intl/usePanneauIntl.js.map +1 -1
- package/dist/layout/responsive.js.map +1 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/menu/Menu.d.ts +1 -1
- package/dist/menu/Menu.js +170 -44
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/tokens.d.ts +1 -1
- package/dist/menu/tokens.js.map +1 -1
- package/dist/named-icons/index.d.ts +1 -1
- package/dist/number-input/NumberInput.d.ts +1 -1
- package/dist/number-input/NumberInput.js +232 -60
- package/dist/number-input/NumberInput.js.map +1 -1
- package/dist/number-input/tokens.d.ts +1 -1
- package/dist/number-input/tokens.js.map +1 -1
- package/dist/pill-trigger/PillTrigger.js +76 -20
- package/dist/pill-trigger/PillTrigger.js.map +1 -1
- package/dist/pill-trigger/tokens.d.ts +1 -1
- package/dist/pill-trigger/tokens.js.map +1 -1
- package/dist/popover/Popover.js +109 -18
- package/dist/popover/Popover.js.map +1 -1
- package/dist/popover/tokens.d.ts +1 -1
- package/dist/popover/tokens.js.map +1 -1
- package/dist/prose/Prose.js +36 -5
- package/dist/prose/Prose.js.map +1 -1
- package/dist/prose/tokens.d.ts +1 -1
- package/dist/prose/tokens.js.map +1 -1
- package/dist/radio-group/RadioGroup.d.ts +2 -2
- package/dist/radio-group/RadioGroup.js +211 -61
- package/dist/radio-group/RadioGroup.js.map +1 -1
- package/dist/radio-group/tokens.d.ts +1 -1
- package/dist/radio-group/tokens.js.map +1 -1
- package/dist/root/PanneauRoot.d.ts +9 -3
- package/dist/root/PanneauRoot.d.ts.map +1 -1
- package/dist/root/PanneauRoot.js +212 -49
- package/dist/root/PanneauRoot.js.map +1 -1
- package/dist/root/ThemeScope.d.ts +1 -1
- package/dist/root/ThemeScope.js +107 -26
- package/dist/root/ThemeScope.js.map +1 -1
- package/dist/segmented-control/SegmentedControl.d.ts +1 -1
- package/dist/segmented-control/SegmentedControl.js +120 -22
- package/dist/segmented-control/SegmentedControl.js.map +1 -1
- package/dist/segmented-control/tokens.d.ts +1 -1
- package/dist/segmented-control/tokens.js.map +1 -1
- package/dist/select/Select.d.ts +1 -1
- package/dist/select/Select.js +298 -92
- package/dist/select/Select.js.map +1 -1
- package/dist/select/listBoxTokens.d.ts +1 -1
- package/dist/select/listBoxTokens.js.map +1 -1
- package/dist/skeleton/LoadingRegion.d.ts +16 -0
- package/dist/skeleton/LoadingRegion.d.ts.map +1 -0
- package/dist/skeleton/LoadingRegion.js +65 -0
- package/dist/skeleton/LoadingRegion.js.map +1 -0
- package/dist/skeleton/Skeleton.css +62 -0
- package/dist/skeleton/Skeleton.d.ts +25 -0
- package/dist/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/skeleton/Skeleton.js +106 -0
- package/dist/skeleton/Skeleton.js.map +1 -0
- package/dist/skeleton/Skeleton.module.js +22 -0
- package/dist/skeleton/Skeleton.module.js.map +1 -0
- package/dist/skeleton/tokens.d.ts +3 -0
- package/dist/skeleton/tokens.d.ts.map +1 -0
- package/dist/skeleton/tokens.js +15 -0
- package/dist/skeleton/tokens.js.map +1 -0
- package/dist/slider/Slider.d.ts +1 -1
- package/dist/slider/Slider.js +222 -44
- package/dist/slider/Slider.js.map +1 -1
- package/dist/spinner/Spinner.js +49 -9
- package/dist/spinner/Spinner.js.map +1 -1
- package/dist/spinner/tokens.d.ts +1 -1
- package/dist/spinner/tokens.js.map +1 -1
- package/dist/stack/Stack.d.ts +1 -1
- package/dist/stack/Stack.js +60 -7
- package/dist/stack/Stack.js.map +1 -1
- package/dist/stack/tokens.d.ts +1 -1
- package/dist/stack/tokens.js.map +1 -1
- package/dist/switch/Switch.d.ts +1 -1
- package/dist/switch/Switch.js +68 -11
- package/dist/switch/Switch.js.map +1 -1
- package/dist/switch/tokens.d.ts +1 -1
- package/dist/switch/tokens.js.map +1 -1
- package/dist/tabs/Tabs.js +1 -1
- package/dist/tabs/Tabs.js.map +1 -1
- package/dist/tabs/tokens.d.ts +1 -1
- package/dist/tabs/tokens.js.map +1 -1
- package/dist/tags-input/TagsInput.d.ts +1 -1
- package/dist/tags-input/TagsInput.js +277 -121
- package/dist/tags-input/TagsInput.js.map +1 -1
- package/dist/text/Text.d.ts +1 -1
- package/dist/text/Text.js +70 -5
- package/dist/text/Text.js.map +1 -1
- package/dist/text/tokens.d.ts +1 -1
- package/dist/text/tokens.js.map +1 -1
- package/dist/text-area/TextArea.d.ts +1 -1
- package/dist/text-area/TextArea.js +135 -28
- package/dist/text-area/TextArea.js.map +1 -1
- package/dist/text-input/TextInput.d.ts +1 -1
- package/dist/text-input/TextInput.js +164 -49
- package/dist/text-input/TextInput.js.map +1 -1
- package/dist/theme/bootstrap.d.ts +2 -2
- package/dist/theme/bootstrap.js.map +1 -1
- package/dist/theme/chartColors.js.map +1 -1
- package/dist/theme/checkTheme.d.ts +2 -2
- package/dist/theme/checkTheme.js.map +1 -1
- package/dist/theme/cli.d.ts +2 -2
- package/dist/theme/cli.js.map +1 -1
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/colorVision.d.ts +1 -1
- package/dist/theme/colorVision.js.map +1 -1
- package/dist/theme/componentTokens.js.map +1 -1
- package/dist/theme/components.d.ts +1 -0
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +2 -0
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/defineTheme.d.ts +5 -5
- package/dist/theme/defineTheme.js.map +1 -1
- package/dist/theme/fonts.js.map +1 -1
- package/dist/theme/index.d.ts +12 -12
- package/dist/theme/semanticTokens.js.map +1 -1
- package/dist/theme/theme.d.ts +2 -2
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/toneClass.d.ts +1 -1
- package/dist/theme/toneClass.js.map +1 -1
- package/dist/theme/tones.d.ts +1 -1
- package/dist/theme/tones.js.map +1 -1
- package/dist/time-input/TimeInput.d.ts +1 -1
- package/dist/time-input/TimeInput.js +138 -31
- package/dist/time-input/TimeInput.js.map +1 -1
- package/dist/toast/Toast.d.ts +1 -1
- package/dist/toast/Toast.js +1 -1
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/tokens.d.ts +1 -1
- package/dist/toast/tokens.js.map +1 -1
- package/dist/tooltip/Tooltip.js +38 -8
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/tokens.d.ts +1 -1
- package/dist/tooltip/tokens.js.map +1 -1
- package/dist/utils/cx.js.map +1 -1
- package/package.json +5 -5
package/dist/card/Card.js
CHANGED
|
@@ -1,36 +1,89 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import Card_module_default from "./Card.module.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { useId } from "react";
|
|
5
6
|
//#region src/card/Card.tsx
|
|
6
7
|
/** A surface that groups related content, with an optional header and footer. */
|
|
7
|
-
function Card(
|
|
8
|
+
function Card(t0) {
|
|
9
|
+
const $ = c(24);
|
|
10
|
+
const { title, headingLevel: t1, actions, children, footer, as, className, headerClassName, bodyClassName, footerClassName } = t0;
|
|
11
|
+
const headingLevel = t1 === void 0 ? 2 : t1;
|
|
8
12
|
const titleId = useId();
|
|
9
13
|
const hasTitle = title !== void 0 && title !== null;
|
|
10
14
|
const Element = as ?? (hasTitle ? "section" : "div");
|
|
11
15
|
const Heading = `h${headingLevel}`;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
className:
|
|
26
|
-
children
|
|
27
|
-
}),
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
]
|
|
33
|
-
|
|
16
|
+
let t2;
|
|
17
|
+
if ($[0] !== className) {
|
|
18
|
+
t2 = cx("panneau-card", Card_module_default.card, className);
|
|
19
|
+
$[0] = className;
|
|
20
|
+
$[1] = t2;
|
|
21
|
+
} else t2 = $[1];
|
|
22
|
+
const t3 = hasTitle && Element !== "div" ? titleId : void 0;
|
|
23
|
+
let t4;
|
|
24
|
+
if ($[2] !== Heading || $[3] !== actions || $[4] !== hasTitle || $[5] !== headerClassName || $[6] !== title || $[7] !== titleId) {
|
|
25
|
+
t4 = hasTitle || actions !== void 0 && actions !== null ? /* @__PURE__ */ jsxs("header", {
|
|
26
|
+
className: cx(Card_module_default.header, headerClassName),
|
|
27
|
+
children: [hasTitle ? /* @__PURE__ */ jsx(Heading, {
|
|
28
|
+
id: titleId,
|
|
29
|
+
className: Card_module_default.title,
|
|
30
|
+
children: title
|
|
31
|
+
}) : /* @__PURE__ */ jsx("span", {}), actions]
|
|
32
|
+
}) : null;
|
|
33
|
+
$[2] = Heading;
|
|
34
|
+
$[3] = actions;
|
|
35
|
+
$[4] = hasTitle;
|
|
36
|
+
$[5] = headerClassName;
|
|
37
|
+
$[6] = title;
|
|
38
|
+
$[7] = titleId;
|
|
39
|
+
$[8] = t4;
|
|
40
|
+
} else t4 = $[8];
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[9] !== bodyClassName) {
|
|
43
|
+
t5 = cx(Card_module_default.body, bodyClassName);
|
|
44
|
+
$[9] = bodyClassName;
|
|
45
|
+
$[10] = t5;
|
|
46
|
+
} else t5 = $[10];
|
|
47
|
+
let t6;
|
|
48
|
+
if ($[11] !== children || $[12] !== t5) {
|
|
49
|
+
t6 = /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: t5,
|
|
51
|
+
children
|
|
52
|
+
});
|
|
53
|
+
$[11] = children;
|
|
54
|
+
$[12] = t5;
|
|
55
|
+
$[13] = t6;
|
|
56
|
+
} else t6 = $[13];
|
|
57
|
+
let t7;
|
|
58
|
+
if ($[14] !== footer || $[15] !== footerClassName) {
|
|
59
|
+
t7 = footer !== void 0 && footer !== null ? /* @__PURE__ */ jsx("footer", {
|
|
60
|
+
className: cx(Card_module_default.footer, footerClassName),
|
|
61
|
+
children: footer
|
|
62
|
+
}) : null;
|
|
63
|
+
$[14] = footer;
|
|
64
|
+
$[15] = footerClassName;
|
|
65
|
+
$[16] = t7;
|
|
66
|
+
} else t7 = $[16];
|
|
67
|
+
let t8;
|
|
68
|
+
if ($[17] !== Element || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t6 || $[22] !== t7) {
|
|
69
|
+
t8 = /* @__PURE__ */ jsxs(Element, {
|
|
70
|
+
className: t2,
|
|
71
|
+
"aria-labelledby": t3,
|
|
72
|
+
children: [
|
|
73
|
+
t4,
|
|
74
|
+
t6,
|
|
75
|
+
t7
|
|
76
|
+
]
|
|
77
|
+
});
|
|
78
|
+
$[17] = Element;
|
|
79
|
+
$[18] = t2;
|
|
80
|
+
$[19] = t3;
|
|
81
|
+
$[20] = t4;
|
|
82
|
+
$[21] = t6;
|
|
83
|
+
$[22] = t7;
|
|
84
|
+
$[23] = t8;
|
|
85
|
+
} else t8 = $[23];
|
|
86
|
+
return t8;
|
|
34
87
|
}
|
|
35
88
|
//#endregion
|
|
36
89
|
export { Card };
|
package/dist/card/Card.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.js","names":["styles"],"sources":["../../src/card/Card.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Card.module.css';\n\nexport interface CardProps {\n /** Title in the header. */\n title?: ReactNode;\n /** Heading level of the title. Defaults to 2. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** Content at the end of the header: actions, a status. */\n actions?: ReactNode;\n children?: ReactNode;\n footer?: ReactNode;\n /** Element of the card: `section` (default) with a title, `div` otherwise. */\n as?: 'section' | 'div' | 'article';\n className?: string;\n headerClassName?: string;\n bodyClassName?: string;\n footerClassName?: string;\n}\n\n/** A surface that groups related content, with an optional header and footer. */\nexport function Card({\n title,\n headingLevel = 2,\n actions,\n children,\n footer,\n as,\n className,\n headerClassName,\n bodyClassName,\n footerClassName,\n}: CardProps) {\n const titleId = useId();\n const hasTitle = title !== undefined && title !== null;\n const Element = as ?? (hasTitle ? 'section' : 'div');\n const Heading = `h${headingLevel}` as const;\n return (\n <Element\n className={cx('panneau-card', styles.card, className)}\n aria-labelledby={hasTitle && Element !== 'div' ? titleId : undefined}\n >\n {hasTitle || (actions !== undefined && actions !== null) ? (\n <header className={cx(styles.header, headerClassName)}>\n {hasTitle ? (\n <Heading id={titleId} className={styles.title}>\n {title}\n </Heading>\n ) : (\n <span />\n )}\n {actions}\n </header>\n ) : null}\n <div className={cx(styles.body, bodyClassName)}>{children}</div>\n {footer !== undefined && footer !== null ? (\n <footer className={cx(styles.footer, footerClassName)}>{footer}</footer>\n ) : null}\n </Element>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Card.js","names":["ReactNode","useId","cx","styles","CardProps","title","headingLevel","actions","children","footer","as","className","headerClassName","bodyClassName","footerClassName","Card","t0","$","_c","t1","undefined","titleId","hasTitle","Element","Heading","const","t2","card","t3","t4","header","t5","body","t6","t7","t8","_c","styles"],"sources":["../../src/card/Card.tsx"],"sourcesContent":["import { type ReactNode, useId } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Card.module.css';\n\nexport interface CardProps {\n /** Title in the header. */\n title?: ReactNode;\n /** Heading level of the title. Defaults to 2. */\n headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;\n /** Content at the end of the header: actions, a status. */\n actions?: ReactNode;\n children?: ReactNode;\n footer?: ReactNode;\n /** Element of the card: `section` (default) with a title, `div` otherwise. */\n as?: 'section' | 'div' | 'article';\n className?: string;\n headerClassName?: string;\n bodyClassName?: string;\n footerClassName?: string;\n}\n\n/** A surface that groups related content, with an optional header and footer. */\nexport function Card({\n title,\n headingLevel = 2,\n actions,\n children,\n footer,\n as,\n className,\n headerClassName,\n bodyClassName,\n footerClassName,\n}: CardProps) {\n const titleId = useId();\n const hasTitle = title !== undefined && title !== null;\n const Element = as ?? (hasTitle ? 'section' : 'div');\n const Heading = `h${headingLevel}` as const;\n return (\n <Element\n className={cx('panneau-card', styles.card, className)}\n aria-labelledby={hasTitle && Element !== 'div' ? titleId : undefined}\n >\n {hasTitle || (actions !== undefined && actions !== null) ? (\n <header className={cx(styles.header, headerClassName)}>\n {hasTitle ? (\n <Heading id={titleId} className={styles.title}>\n {title}\n </Heading>\n ) : (\n <span />\n )}\n {actions}\n </header>\n ) : null}\n <div className={cx(styles.body, bodyClassName)}>{children}</div>\n {footer !== undefined && footer !== null ? (\n <footer className={cx(styles.footer, footerClassName)}>{footer}</footer>\n ) : null}\n </Element>\n );\n}\n"],"mappings":";;;;;;;AAuBA,SAAOe,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAc,MAAA,EAAAb,OAAAC,cAAAa,IAAAZ,SAAAC,UAAAC,QAAAC,IAAAC,WAAAC,iBAAAC,eAAAC,oBAAAE;CAEjB,MAAAV,eAAAa,OAAAC,KAAAA,IAAA,IAAAD;CAUA,MAAAE,UAAgBpB,MAAM;CACtB,MAAAqB,WAAiBjB,UAAUe,KAAAA,KAAaf,UAAU;CAClD,MAAAkB,UAAgBb,OAAOY,WAAA,YAAA;CACvB,MAAAE,UAAgB,IAAIlB;CAAwB,IAAAoB;CAAA,IAAAT,EAAA,OAAAN,WAAA;EAGzBe,KAAAxB,GAAG,gBAAgBC,oBAAMwB,MAAOhB,SAAS;EAACM,EAAA,KAAAN;EAAAM,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CACpC,MAAAW,K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AA,IAD3E;EAEOQ,EAAA,MAAAR;EAAAQ,EAAA,MAAAH;EAAAG,EAAA,MAAAiB;CAAA,OAAAA,KAAAjB,EAAA;CAAA,IAAAkB;CAAA,IAAAlB,EAAA,QAAAM,WAAAN,EAAA,QAAAS,MAAAT,EAAA,QAAAW,MAAAX,EAAA,QAAAY,MAAAZ,EAAA,QAAAgB,MAAAhB,EAAA,QAAAiB,IAAA;EAnBZC,KAAA,qBAAC,SAAD;GACe,WAAAT;GACM,mBAAAE;GAFrB,UAAA;IAIKC;IAYDI;IACCC;GAjBG;;EAoBEjB,EAAA,MAAAM;EAAAN,EAAA,MAAAS;EAAAT,EAAA,MAAAW;EAAAX,EAAA,MAAAY;EAAAZ,EAAA,MAAAgB;EAAAhB,EAAA,MAAAiB;EAAAjB,EAAA,MAAAkB;CAAA,OAAAA,KAAAlB,EAAA;CAAA,OApBVkB;AAoBU"}
|
package/dist/card/tokens.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/** Tokens of Card. */
|
|
2
|
-
export declare const cardTokens: import("
|
|
2
|
+
export declare const cardTokens: import("../index.js").ComponentTokens<"card", "panneau-card-radius" | "panneau-card-gap" | "panneau-card-padding-y" | "panneau-card-padding-x" | "panneau-card-border-width" | "panneau-card-title-font-weight" | "panneau-card-bg" | "panneau-card-border-color" | "panneau-card-shadow" | "panneau-card-header-padding-y" | "panneau-card-title-font-size">;
|
|
3
3
|
//# sourceMappingURL=tokens.d.ts.map
|
package/dist/card/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/card/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Card. */\nexport const cardTokens = defineComponentTokens('card', {\n /** Background. */\n bg: 'var(--panneau-color-surface)',\n /** Width of the border and of the separators. */\n 'border-width': 'var(--panneau-border-width)',\n /** Color of the border and of the separators. */\n 'border-color': 'var(--panneau-color-border)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-lg)',\n /** Shadow. */\n shadow: 'var(--panneau-shadow-sm)',\n /** Vertical padding of the header and the footer. */\n 'header-padding-y': 'var(--panneau-space-3)',\n /** Horizontal padding of every section. */\n 'padding-x': 'var(--panneau-space-4)',\n /** Font size of the title. */\n 'title-font-size': 'var(--panneau-font-size-lg)',\n /** Font weight of the title. */\n 'title-font-weight': 'var(--panneau-font-weight-bold)',\n /** Vertical padding of the body. */\n 'padding-y': 'var(--panneau-space-4)',\n /** Space between the children of the body. */\n gap: 'var(--panneau-space-4)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","cardTokens","bg","radius","shadow","gap"],"sources":["../../src/card/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Card. */\nexport const cardTokens = defineComponentTokens('card', {\n /** Background. */\n bg: 'var(--panneau-color-surface)',\n /** Width of the border and of the separators. */\n 'border-width': 'var(--panneau-border-width)',\n /** Color of the border and of the separators. */\n 'border-color': 'var(--panneau-color-border)',\n /** Corner radius. */\n radius: 'var(--panneau-radius-lg)',\n /** Shadow. */\n shadow: 'var(--panneau-shadow-sm)',\n /** Vertical padding of the header and the footer. */\n 'header-padding-y': 'var(--panneau-space-3)',\n /** Horizontal padding of every section. */\n 'padding-x': 'var(--panneau-space-4)',\n /** Font size of the title. */\n 'title-font-size': 'var(--panneau-font-size-lg)',\n /** Font weight of the title. */\n 'title-font-weight': 'var(--panneau-font-weight-bold)',\n /** Vertical padding of the body. */\n 'padding-y': 'var(--panneau-space-4)',\n /** Space between the children of the body. */\n gap: 'var(--panneau-space-4)',\n});\n"],"mappings":";;;AAGA,IAAaC,aAAaD,sBAAsB,QAAQ;;CAEpDE,IAAI;;CAEJ,gBAAgB;;CAEhB,gBAAgB;;CAEhBC,QAAQ;;CAERC,QAAQ;;CAER,oBAAoB;;CAEpB,aAAa;;CAEb,mBAAmB;;CAEnB,qBAAqB;;CAErB,aAAa;;CAEbC,KAAK;AACT,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import { type CheckboxProps as AriaCheckboxProps } from 'react-aria-components';
|
|
3
|
-
import { type ChoiceChromeProps } from './ChoiceChrome';
|
|
3
|
+
import { type ChoiceChromeProps } from './ChoiceChrome.js';
|
|
4
4
|
export interface CheckboxProps extends Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate'>, ChoiceChromeProps {
|
|
5
5
|
/** Label, next to the box. */
|
|
6
6
|
children?: ReactNode;
|
|
@@ -2,41 +2,102 @@ import { cx } from "../utils/cx.js";
|
|
|
2
2
|
import { Icon } from "../icon/Icon.js";
|
|
3
3
|
import Checkbox_module_default from "./Checkbox.module.js";
|
|
4
4
|
import { ChoiceChrome } from "./ChoiceChrome.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { Check, Minus } from "lucide-react";
|
|
6
7
|
import { Checkbox } from "react-aria-components";
|
|
7
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region src/checkbox/Checkbox.tsx
|
|
9
10
|
/** A checkbox with its label, and optional description and errors under it. */
|
|
10
|
-
function Checkbox$1(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
function Checkbox$1(t0) {
|
|
12
|
+
const $ = c(23);
|
|
13
|
+
let checkboxClassName;
|
|
14
|
+
let children;
|
|
15
|
+
let className;
|
|
16
|
+
let description;
|
|
17
|
+
let descriptionClassName;
|
|
18
|
+
let errorsClassName;
|
|
19
|
+
let props;
|
|
20
|
+
let t1;
|
|
21
|
+
if ($[0] !== t0) {
|
|
22
|
+
({children, description, errors: t1, className, checkboxClassName, descriptionClassName, errorsClassName, ...props} = t0);
|
|
23
|
+
$[0] = t0;
|
|
24
|
+
$[1] = checkboxClassName;
|
|
25
|
+
$[2] = children;
|
|
26
|
+
$[3] = className;
|
|
27
|
+
$[4] = description;
|
|
28
|
+
$[5] = descriptionClassName;
|
|
29
|
+
$[6] = errorsClassName;
|
|
30
|
+
$[7] = props;
|
|
31
|
+
$[8] = t1;
|
|
32
|
+
} else {
|
|
33
|
+
checkboxClassName = $[1];
|
|
34
|
+
children = $[2];
|
|
35
|
+
className = $[3];
|
|
36
|
+
description = $[4];
|
|
37
|
+
descriptionClassName = $[5];
|
|
38
|
+
errorsClassName = $[6];
|
|
39
|
+
props = $[7];
|
|
40
|
+
t1 = $[8];
|
|
41
|
+
}
|
|
42
|
+
let t2;
|
|
43
|
+
if ($[9] !== t1) {
|
|
44
|
+
t2 = t1 === void 0 ? [] : t1;
|
|
45
|
+
$[9] = t1;
|
|
46
|
+
$[10] = t2;
|
|
47
|
+
} else t2 = $[10];
|
|
48
|
+
const errors = t2;
|
|
49
|
+
let t3;
|
|
50
|
+
if ($[11] !== checkboxClassName || $[12] !== children || $[13] !== errors.length || $[14] !== props) {
|
|
51
|
+
t3 = (describedBy) => /* @__PURE__ */ jsx(Checkbox, {
|
|
19
52
|
...props,
|
|
20
53
|
"aria-describedby": describedBy,
|
|
21
54
|
isInvalid: errors.length > 0,
|
|
22
55
|
validationBehavior: "aria",
|
|
23
56
|
className: cx(Checkbox_module_default.control, checkboxClassName),
|
|
24
|
-
children: (
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
children
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
57
|
+
children: (t4) => {
|
|
58
|
+
const { isSelected, isIndeterminate } = t4;
|
|
59
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
|
|
60
|
+
className: Checkbox_module_default.box,
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
children: isIndeterminate ? /* @__PURE__ */ jsx(Icon, {
|
|
63
|
+
icon: Minus,
|
|
64
|
+
size: "xs"
|
|
65
|
+
}) : isSelected ? /* @__PURE__ */ jsx(Icon, {
|
|
66
|
+
icon: Check,
|
|
67
|
+
size: "xs"
|
|
68
|
+
}) : null
|
|
69
|
+
}), children !== void 0 ? /* @__PURE__ */ jsx("span", {
|
|
70
|
+
className: Checkbox_module_default.label,
|
|
71
|
+
children
|
|
72
|
+
}) : null] });
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
$[11] = checkboxClassName;
|
|
76
|
+
$[12] = children;
|
|
77
|
+
$[13] = errors.length;
|
|
78
|
+
$[14] = props;
|
|
79
|
+
$[15] = t3;
|
|
80
|
+
} else t3 = $[15];
|
|
81
|
+
let t4;
|
|
82
|
+
if ($[16] !== className || $[17] !== description || $[18] !== descriptionClassName || $[19] !== errors || $[20] !== errorsClassName || $[21] !== t3) {
|
|
83
|
+
t4 = /* @__PURE__ */ jsx(ChoiceChrome, {
|
|
84
|
+
component: "checkbox",
|
|
85
|
+
description,
|
|
86
|
+
errors,
|
|
87
|
+
className,
|
|
88
|
+
descriptionClassName,
|
|
89
|
+
errorsClassName,
|
|
90
|
+
children: t3
|
|
91
|
+
});
|
|
92
|
+
$[16] = className;
|
|
93
|
+
$[17] = description;
|
|
94
|
+
$[18] = descriptionClassName;
|
|
95
|
+
$[19] = errors;
|
|
96
|
+
$[20] = errorsClassName;
|
|
97
|
+
$[21] = t3;
|
|
98
|
+
$[22] = t4;
|
|
99
|
+
} else t4 = $[22];
|
|
100
|
+
return t4;
|
|
40
101
|
}
|
|
41
102
|
//#endregion
|
|
42
103
|
export { Checkbox$1 as Checkbox };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.js","names":["Checkbox","AriaCheckbox","styles","_Fragment"],"sources":["../../src/checkbox/Checkbox.tsx"],"sourcesContent":["import { Check, Minus } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport {\n Checkbox as AriaCheckbox,\n type CheckboxProps as AriaCheckboxProps,\n} from 'react-aria-components';\n\nimport { Icon } from '../icon/Icon';\nimport { cx } from '../utils/cx';\nimport styles from './Checkbox.module.css';\nimport { ChoiceChrome, type ChoiceChromeProps } from './ChoiceChrome';\n\nexport interface CheckboxProps\n extends\n Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate'>,\n ChoiceChromeProps {\n /** Label, next to the box. */\n children?: ReactNode;\n checkboxClassName?: string;\n}\n\n/** A checkbox with its label, and optional description and errors under it. */\nexport function Checkbox({\n children,\n description,\n errors = [],\n className,\n checkboxClassName,\n descriptionClassName,\n errorsClassName,\n ...props\n}: CheckboxProps) {\n return (\n <ChoiceChrome\n component=\"checkbox\"\n description={description}\n errors={errors}\n className={className}\n descriptionClassName={descriptionClassName}\n errorsClassName={errorsClassName}\n >\n {(describedBy) => (\n <AriaCheckbox\n {...props}\n aria-describedby={describedBy}\n isInvalid={errors.length > 0}\n validationBehavior=\"aria\"\n className={cx(styles.control, checkboxClassName)}\n >\n {({ isSelected, isIndeterminate }) => (\n <>\n <span className={styles.box} aria-hidden=\"true\">\n {isIndeterminate ? (\n <Icon icon={Minus} size=\"xs\" />\n ) : isSelected ? (\n <Icon icon={Check} size=\"xs\" />\n ) : null}\n </span>\n {children !== undefined ? (\n <span className={styles.label}>{children}</span>\n ) : null}\n </>\n )}\n </AriaCheckbox>\n )}\n </ChoiceChrome>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Checkbox.js","names":["Check","Minus","ReactNode","Checkbox","AriaCheckbox","CheckboxProps","AriaCheckboxProps","Icon","cx","styles","ChoiceChrome","ChoiceChromeProps","Omit","children","checkboxClassName","t0","$","_c","className","description","descriptionClassName","errorsClassName","props","t1","errors","t2","undefined","t3","length","describedBy","control","t4","isSelected","isIndeterminate","box","label","Checkbox","_c","AriaCheckbox","styles","_Fragment"],"sources":["../../src/checkbox/Checkbox.tsx"],"sourcesContent":["import { Check, Minus } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport {\n Checkbox as AriaCheckbox,\n type CheckboxProps as AriaCheckboxProps,\n} from 'react-aria-components';\n\nimport { Icon } from '../icon/Icon';\nimport { cx } from '../utils/cx';\nimport styles from './Checkbox.module.css';\nimport { ChoiceChrome, type ChoiceChromeProps } from './ChoiceChrome';\n\nexport interface CheckboxProps\n extends\n Omit<AriaCheckboxProps, 'className' | 'style' | 'children' | 'isInvalid' | 'validate'>,\n ChoiceChromeProps {\n /** Label, next to the box. */\n children?: ReactNode;\n checkboxClassName?: string;\n}\n\n/** A checkbox with its label, and optional description and errors under it. */\nexport function Checkbox({\n children,\n description,\n errors = [],\n className,\n checkboxClassName,\n descriptionClassName,\n errorsClassName,\n ...props\n}: CheckboxProps) {\n return (\n <ChoiceChrome\n component=\"checkbox\"\n description={description}\n errors={errors}\n className={className}\n descriptionClassName={descriptionClassName}\n errorsClassName={errorsClassName}\n >\n {(describedBy) => (\n <AriaCheckbox\n {...props}\n aria-describedby={describedBy}\n isInvalid={errors.length > 0}\n validationBehavior=\"aria\"\n className={cx(styles.control, checkboxClassName)}\n >\n {({ isSelected, isIndeterminate }) => (\n <>\n <span className={styles.box} aria-hidden=\"true\">\n {isIndeterminate ? (\n <Icon icon={Minus} size=\"xs\" />\n ) : isSelected ? (\n <Icon icon={Check} size=\"xs\" />\n ) : null}\n </span>\n {children !== undefined ? (\n <span className={styles.label}>{children}</span>\n ) : null}\n </>\n )}\n </AriaCheckbox>\n )}\n </ChoiceChrome>\n );\n}\n"],"mappings":";;;;;;;;;;AAsBA,SAAOG,WAAAY,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAH;CAAA,IAAAD;CAAA,IAAAK;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAP,EAAA,OAAAD,IAAA;EAAkB,CAAA,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A,IACV,oBAAA,QAAA;KAAiB,WAAAjB,wBAAM0B;KAAStB;IAAgB,CAAA,IADnD,IAEO,EAAA,CAAA;GACT;EAnBE,CAAA;EAsBhBG,EAAA,MAAAF;EAAAE,EAAA,MAAAH;EAAAG,EAAA,MAAAQ,OAAAI;EAAAZ,EAAA,MAAAM;EAAAN,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAE,aAAAF,EAAA,QAAAG,eAAAH,EAAA,QAAAI,wBAAAJ,EAAA,QAAAQ,UAAAR,EAAA,QAAAK,mBAAAL,EAAA,QAAAW,IAAA;EA/BLI,KAAA,oBAAC,cAAD;GACc,WAAA;GACGZ;GACLK;GACGN;GACWE;GACLC;GAEhBM,UAAAA;EARQ,CAAA;EAgCEX,EAAA,MAAAE;EAAAF,EAAA,MAAAG;EAAAH,EAAA,MAAAI;EAAAJ,EAAA,MAAAQ;EAAAR,EAAA,MAAAK;EAAAL,EAAA,MAAAW;EAAAX,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAhCfe;AAgCe"}
|
|
@@ -1,34 +1,95 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import Checkbox_module_default from "./Checkbox.module.js";
|
|
3
3
|
import Field_module_default from "../field/Field.module.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { Fragment as Fragment$1, useId } from "react";
|
|
6
7
|
//#region src/checkbox/ChoiceChrome.tsx
|
|
7
8
|
/** Description and errors under a checkbox or a switch, linked to it. */
|
|
8
|
-
function ChoiceChrome(
|
|
9
|
+
function ChoiceChrome(t0) {
|
|
10
|
+
const $ = c(24);
|
|
11
|
+
const { component, description, errors: t1, className, descriptionClassName, errorsClassName, children } = t0;
|
|
12
|
+
let t2;
|
|
13
|
+
if ($[0] !== t1) {
|
|
14
|
+
t2 = t1 === void 0 ? [] : t1;
|
|
15
|
+
$[0] = t1;
|
|
16
|
+
$[1] = t2;
|
|
17
|
+
} else t2 = $[1];
|
|
18
|
+
const errors = t2;
|
|
9
19
|
const id = useId();
|
|
10
20
|
const descriptionId = description !== void 0 && description !== null ? `${id}-description` : null;
|
|
11
21
|
const errorsId = errors.length > 0 ? `${id}-errors` : null;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
let t3;
|
|
23
|
+
if ($[2] !== descriptionId || $[3] !== errorsId) {
|
|
24
|
+
t3 = [descriptionId, errorsId].filter(Boolean);
|
|
25
|
+
$[2] = descriptionId;
|
|
26
|
+
$[3] = errorsId;
|
|
27
|
+
$[4] = t3;
|
|
28
|
+
} else t3 = $[4];
|
|
29
|
+
const describedBy = t3.join(" ");
|
|
30
|
+
const t4 = component !== void 0 && `panneau-${component}`;
|
|
31
|
+
let t5;
|
|
32
|
+
if ($[5] !== className || $[6] !== t4) {
|
|
33
|
+
t5 = cx(t4, Checkbox_module_default.field, className);
|
|
34
|
+
$[5] = className;
|
|
35
|
+
$[6] = t4;
|
|
36
|
+
$[7] = t5;
|
|
37
|
+
} else t5 = $[7];
|
|
38
|
+
const t6 = describedBy !== "" ? describedBy : void 0;
|
|
39
|
+
let t7;
|
|
40
|
+
if ($[8] !== children || $[9] !== t6) {
|
|
41
|
+
t7 = children(t6);
|
|
42
|
+
$[8] = children;
|
|
43
|
+
$[9] = t6;
|
|
44
|
+
$[10] = t7;
|
|
45
|
+
} else t7 = $[10];
|
|
46
|
+
let t8;
|
|
47
|
+
if ($[11] !== description || $[12] !== descriptionClassName || $[13] !== descriptionId) {
|
|
48
|
+
t8 = descriptionId !== null ? /* @__PURE__ */ jsx("div", {
|
|
49
|
+
id: descriptionId,
|
|
50
|
+
className: cx(Field_module_default.description, descriptionClassName),
|
|
51
|
+
children: description
|
|
52
|
+
}) : null;
|
|
53
|
+
$[11] = description;
|
|
54
|
+
$[12] = descriptionClassName;
|
|
55
|
+
$[13] = descriptionId;
|
|
56
|
+
$[14] = t8;
|
|
57
|
+
} else t8 = $[14];
|
|
58
|
+
let t9;
|
|
59
|
+
if ($[15] !== errors || $[16] !== errorsClassName || $[17] !== errorsId) {
|
|
60
|
+
t9 = errorsId !== null ? /* @__PURE__ */ jsx("div", {
|
|
61
|
+
id: errorsId,
|
|
62
|
+
className: cx(Field_module_default.errors, errorsClassName),
|
|
63
|
+
children: errors.map(_temp)
|
|
64
|
+
}) : null;
|
|
65
|
+
$[15] = errors;
|
|
66
|
+
$[16] = errorsClassName;
|
|
67
|
+
$[17] = errorsId;
|
|
68
|
+
$[18] = t9;
|
|
69
|
+
} else t9 = $[18];
|
|
70
|
+
let t10;
|
|
71
|
+
if ($[19] !== t5 || $[20] !== t7 || $[21] !== t8 || $[22] !== t9) {
|
|
72
|
+
t10 = /* @__PURE__ */ jsxs("div", {
|
|
73
|
+
className: t5,
|
|
74
|
+
children: [
|
|
75
|
+
t7,
|
|
76
|
+
t8,
|
|
77
|
+
t9
|
|
78
|
+
]
|
|
79
|
+
});
|
|
80
|
+
$[19] = t5;
|
|
81
|
+
$[20] = t7;
|
|
82
|
+
$[21] = t8;
|
|
83
|
+
$[22] = t9;
|
|
84
|
+
$[23] = t10;
|
|
85
|
+
} else t10 = $[23];
|
|
86
|
+
return t10;
|
|
87
|
+
}
|
|
88
|
+
function _temp(error, index) {
|
|
89
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [index > 0 ? " " : null, /* @__PURE__ */ jsx("span", {
|
|
90
|
+
className: Field_module_default.error,
|
|
91
|
+
children: error
|
|
92
|
+
})] }, index);
|
|
32
93
|
}
|
|
33
94
|
//#endregion
|
|
34
95
|
export { ChoiceChrome };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChoiceChrome.js","names":["styles","fieldStyles","Fragment"],"sources":["../../src/checkbox/ChoiceChrome.tsx"],"sourcesContent":["import { Fragment, type ReactNode, useId } from 'react';\n\nimport { fieldStyles } from '../field/FieldParts';\nimport { cx } from '../utils/cx';\nimport styles from './Checkbox.module.css';\n\nexport interface ChoiceChromeProps {\n /** The component, for its `panneau-<component>` class: `checkbox` or `switch`. */\n component?: string;\n /** Help text under the control. */\n description?: ReactNode;\n /** Error messages. Any message makes the control invalid. */\n errors?: readonly string[];\n className?: string;\n descriptionClassName?: string;\n errorsClassName?: string;\n}\n\n/** Description and errors under a checkbox or a switch, linked to it. */\nexport function ChoiceChrome({\n component,\n description,\n errors = [],\n className,\n descriptionClassName,\n errorsClassName,\n children,\n}: ChoiceChromeProps & { children: (describedBy: string | undefined) => ReactNode }) {\n const id = useId();\n const descriptionId =\n description !== undefined && description !== null ? `${id}-description` : null;\n const errorsId = errors.length > 0 ? `${id}-errors` : null;\n const describedBy = [descriptionId, errorsId].filter(Boolean).join(' ');\n return (\n <div\n className={cx(\n component !== undefined && `panneau-${component}`,\n styles.field,\n className,\n )}\n >\n {children(describedBy !== '' ? describedBy : undefined)}\n {descriptionId !== null ? (\n <div\n id={descriptionId}\n className={cx(fieldStyles.description, descriptionClassName)}\n >\n {description}\n </div>\n ) : null}\n {errorsId !== null ? (\n <div id={errorsId} className={cx(fieldStyles.errors, errorsClassName)}>\n {errors.map((error, index) => (\n <Fragment key={index}>\n {/* A space between messages, for assistive technologies. */}\n {index > 0 ? ' ' : null}\n <span className={fieldStyles.error}>{error}</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChoiceChrome.js","names":["Fragment","ReactNode","useId","fieldStyles","cx","styles","ChoiceChromeProps","component","description","errors","className","descriptionClassName","errorsClassName","ChoiceChrome","t0","$","_c","t1","children","t2","undefined","id","descriptionId","errorsId","length","t3","filter","Boolean","describedBy","join","t4","t5","field","t6","t7","t8","t9","map","_temp","t10","error","index","_c","styles","fieldStyles","Fragment"],"sources":["../../src/checkbox/ChoiceChrome.tsx"],"sourcesContent":["import { Fragment, type ReactNode, useId } from 'react';\n\nimport { fieldStyles } from '../field/FieldParts';\nimport { cx } from '../utils/cx';\nimport styles from './Checkbox.module.css';\n\nexport interface ChoiceChromeProps {\n /** The component, for its `panneau-<component>` class: `checkbox` or `switch`. */\n component?: string;\n /** Help text under the control. */\n description?: ReactNode;\n /** Error messages. Any message makes the control invalid. */\n errors?: readonly string[];\n className?: string;\n descriptionClassName?: string;\n errorsClassName?: string;\n}\n\n/** Description and errors under a checkbox or a switch, linked to it. */\nexport function ChoiceChrome({\n component,\n description,\n errors = [],\n className,\n descriptionClassName,\n errorsClassName,\n children,\n}: ChoiceChromeProps & { children: (describedBy: string | undefined) => ReactNode }) {\n const id = useId();\n const descriptionId =\n description !== undefined && description !== null ? `${id}-description` : null;\n const errorsId = errors.length > 0 ? `${id}-errors` : null;\n const describedBy = [descriptionId, errorsId].filter(Boolean).join(' ');\n return (\n <div\n className={cx(\n component !== undefined && `panneau-${component}`,\n styles.field,\n className,\n )}\n >\n {children(describedBy !== '' ? describedBy : undefined)}\n {descriptionId !== null ? (\n <div\n id={descriptionId}\n className={cx(fieldStyles.description, descriptionClassName)}\n >\n {description}\n </div>\n ) : null}\n {errorsId !== null ? (\n <div id={errorsId} className={cx(fieldStyles.errors, errorsClassName)}>\n {errors.map((error, index) => (\n <Fragment key={index}>\n {/* A space between messages, for assistive technologies. */}\n {index > 0 ? ' ' : null}\n <span className={fieldStyles.error}>{error}</span>\n </Fragment>\n ))}\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;AAmBA,SAAOa,aAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAsB,MAAA,EAAAT,WAAAC,aAAAC,QAAAQ,IAA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|
|
2
|
-
export declare const checkboxTokens: import("
|
|
2
|
+
export declare const checkboxTokens: import("../index.js").ComponentTokens<"checkbox", "panneau-checkbox-size" | "panneau-checkbox-radius" | "panneau-checkbox-bg" | "panneau-checkbox-border-color" | "panneau-checkbox-checked-color" | "panneau-checkbox-checked-bg">;
|
|
3
3
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/checkbox/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Checkbox. */\nexport const checkboxTokens = defineComponentTokens('checkbox', {\n /** Size of the box. */\n size: '1.125rem',\n /** Color of the check mark. */\n 'checked-color': 'var(--panneau-color-accent-text)',\n /** Background of the box. */\n bg: 'var(--panneau-color-surface)',\n /** Border color of the box. */\n 'border-color': 'var(--panneau-color-border-control)',\n /** Corner radius of the box. */\n radius: 'var(--panneau-radius-sm)',\n /** Background and border color of a checked box. */\n 'checked-bg': 'var(--panneau-color-accent)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","checkboxTokens","size","bg","radius"],"sources":["../../src/checkbox/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Checkbox. */\nexport const checkboxTokens = defineComponentTokens('checkbox', {\n /** Size of the box. */\n size: '1.125rem',\n /** Color of the check mark. */\n 'checked-color': 'var(--panneau-color-accent-text)',\n /** Background of the box. */\n bg: 'var(--panneau-color-surface)',\n /** Border color of the box. */\n 'border-color': 'var(--panneau-color-border-control)',\n /** Corner radius of the box. */\n radius: 'var(--panneau-radius-sm)',\n /** Background and border color of a checked box. */\n 'checked-bg': 'var(--panneau-color-accent)',\n});\n"],"mappings":";;;AAGA,IAAaC,iBAAiBD,sBAAsB,YAAY;;CAE5DE,MAAM;;CAEN,iBAAiB;;CAEjBC,IAAI;;CAEJ,gBAAgB;;CAEhBC,QAAQ;;CAER,cAAc;AAClB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComboBoxProps as AriaComboBoxProps } from 'react-aria-components';
|
|
2
|
-
import { type FieldChromeProps } from '../field/FieldParts';
|
|
2
|
+
import { type FieldChromeProps } from '../field/FieldParts.js';
|
|
3
3
|
/** An item that a combo box can pick. */
|
|
4
4
|
export interface ComboBoxItem {
|
|
5
5
|
id: string;
|