@panneau/ui 5.0.0-alpha.1 → 5.0.0-alpha.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/README.md +263 -6
- package/bin/check-theme.js +5 -0
- package/dist/alert/Alert.css +28 -42
- package/dist/alert/Alert.d.ts +18 -4
- package/dist/alert/Alert.d.ts.map +1 -1
- package/dist/alert/Alert.js +4 -3
- package/dist/alert/Alert.js.map +1 -1
- package/dist/alert/Alert.module.js +14 -16
- package/dist/alert/Alert.module.js.map +1 -1
- package/dist/alert/tokens.d.ts +3 -0
- package/dist/alert/tokens.d.ts.map +1 -0
- package/dist/alert/tokens.js +21 -0
- package/dist/alert/tokens.js.map +1 -0
- package/dist/badge/Badge.css +24 -36
- package/dist/badge/Badge.d.ts +18 -3
- package/dist/badge/Badge.d.ts.map +1 -1
- package/dist/badge/Badge.js +3 -2
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/Badge.module.js +9 -13
- package/dist/badge/Badge.module.js.map +1 -1
- package/dist/badge/tokens.d.ts +3 -0
- package/dist/badge/tokens.d.ts.map +1 -0
- package/dist/badge/tokens.js +23 -0
- package/dist/badge/tokens.js.map +1 -0
- package/dist/button/Button.css +58 -42
- package/dist/button/Button.d.ts +30 -3
- package/dist/button/Button.d.ts.map +1 -1
- package/dist/button/Button.js +27 -2
- package/dist/button/Button.js.map +1 -1
- package/dist/button/Button.module.js +14 -14
- package/dist/button/Button.module.js.map +1 -1
- package/dist/button/tokens.d.ts +3 -0
- package/dist/button/tokens.d.ts.map +1 -0
- package/dist/button/tokens.js +25 -0
- package/dist/button/tokens.js.map +1 -0
- package/dist/card/Card.css +27 -20
- package/dist/card/Card.js +1 -1
- package/dist/card/Card.js.map +1 -1
- package/dist/card/Card.module.js +5 -5
- package/dist/card/Card.module.js.map +1 -1
- package/dist/card/tokens.d.ts +3 -0
- package/dist/card/tokens.d.ts.map +1 -0
- package/dist/card/tokens.js +31 -0
- package/dist/card/tokens.js.map +1 -0
- package/dist/checkbox/Checkbox.css +22 -21
- package/dist/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/checkbox/Checkbox.js +1 -0
- package/dist/checkbox/Checkbox.js.map +1 -1
- package/dist/checkbox/Checkbox.module.js +4 -4
- package/dist/checkbox/Checkbox.module.js.map +1 -1
- package/dist/checkbox/ChoiceChrome.d.ts +3 -1
- package/dist/checkbox/ChoiceChrome.d.ts.map +1 -1
- package/dist/checkbox/ChoiceChrome.js +2 -2
- package/dist/checkbox/ChoiceChrome.js.map +1 -1
- package/dist/checkbox/tokens.d.ts +3 -0
- package/dist/checkbox/tokens.d.ts.map +1 -0
- package/dist/checkbox/tokens.js +21 -0
- package/dist/checkbox/tokens.js.map +1 -0
- package/dist/combo-box/ComboBox.css +4 -4
- package/dist/combo-box/ComboBox.js +1 -1
- package/dist/combo-box/ComboBox.js.map +1 -1
- package/dist/combo-box/ComboBox.module.js +3 -3
- package/dist/container/Container.css +32 -0
- package/dist/container/Container.d.ts +15 -0
- package/dist/container/Container.d.ts.map +1 -0
- package/dist/container/Container.js +18 -0
- package/dist/container/Container.js.map +1 -0
- package/dist/container/Container.module.js +20 -0
- package/dist/container/Container.module.js.map +1 -0
- package/dist/container/tokens.d.ts +3 -0
- package/dist/container/tokens.d.ts.map +1 -0
- package/dist/container/tokens.js +19 -0
- package/dist/container/tokens.js.map +1 -0
- package/dist/date-picker/DatePicker.css +30 -30
- package/dist/date-picker/DatePicker.js +1 -1
- package/dist/date-picker/DatePicker.js.map +1 -1
- package/dist/date-picker/DatePicker.module.js +11 -11
- package/dist/date-picker/DatePicker.module.js.map +1 -1
- package/dist/date-picker/calendarTokens.d.ts +3 -0
- package/dist/date-picker/calendarTokens.d.ts.map +1 -0
- package/dist/date-picker/calendarTokens.js +17 -0
- package/dist/date-picker/calendarTokens.js.map +1 -0
- package/dist/dialog/Dialog.css +40 -36
- package/dist/dialog/Dialog.js +1 -1
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/Dialog.module.js +11 -11
- package/dist/dialog/Dialog.module.js.map +1 -1
- package/dist/dialog/tokens.d.ts +3 -0
- package/dist/dialog/tokens.d.ts.map +1 -0
- package/dist/dialog/tokens.js +29 -0
- package/dist/dialog/tokens.js.map +1 -0
- package/dist/disclosure/Disclosure.css +12 -12
- package/dist/disclosure/Disclosure.d.ts.map +1 -1
- package/dist/disclosure/Disclosure.js +1 -1
- package/dist/disclosure/Disclosure.js.map +1 -1
- package/dist/disclosure/Disclosure.module.js +7 -7
- package/dist/disclosure/Disclosure.module.js.map +1 -1
- package/dist/disclosure/tokens.d.ts +3 -0
- package/dist/disclosure/tokens.d.ts.map +1 -0
- package/dist/disclosure/tokens.js +15 -0
- package/dist/disclosure/tokens.js.map +1 -0
- package/dist/divider/Divider.css +17 -0
- package/dist/divider/Divider.d.ts +8 -0
- package/dist/divider/Divider.d.ts.map +1 -0
- package/dist/divider/Divider.js +21 -0
- package/dist/divider/Divider.js.map +1 -0
- package/dist/divider/Divider.module.js +12 -0
- package/dist/divider/Divider.module.js.map +1 -0
- package/dist/divider/tokens.d.ts +3 -0
- package/dist/divider/tokens.d.ts.map +1 -0
- package/dist/divider/tokens.js +13 -0
- package/dist/divider/tokens.js.map +1 -0
- package/dist/field/Field.css +40 -37
- package/dist/field/Field.module.js +11 -11
- package/dist/field/Field.module.js.map +1 -1
- package/dist/field/Fieldset.js +1 -1
- package/dist/field/Fieldset.js.map +1 -1
- package/dist/field/inputTokens.d.ts +3 -0
- package/dist/field/inputTokens.d.ts.map +1 -0
- package/dist/field/inputTokens.js +21 -0
- package/dist/field/inputTokens.js.map +1 -0
- package/dist/field/tokens.d.ts +3 -0
- package/dist/field/tokens.d.ts.map +1 -0
- package/dist/field/tokens.js +15 -0
- package/dist/field/tokens.js.map +1 -0
- package/dist/grid/Grid.css +174 -0
- package/dist/grid/Grid.d.ts +28 -0
- package/dist/grid/Grid.d.ts.map +1 -0
- package/dist/grid/Grid.js +31 -0
- package/dist/grid/Grid.js.map +1 -0
- package/dist/grid/Grid.module.js +12 -0
- package/dist/grid/Grid.module.js.map +1 -0
- package/dist/grid/GridItem.css +59 -0
- package/dist/grid/GridItem.module.js +7 -0
- package/dist/grid/GridItem.module.js.map +1 -0
- package/dist/grid/tokens.d.ts +3 -0
- package/dist/grid/tokens.d.ts.map +1 -0
- package/dist/grid/tokens.js +10 -0
- package/dist/grid/tokens.js.map +1 -0
- package/dist/heading/Heading.css +52 -0
- package/dist/heading/Heading.d.ts +17 -0
- package/dist/heading/Heading.d.ts.map +1 -0
- package/dist/heading/Heading.js +17 -0
- package/dist/heading/Heading.js.map +1 -0
- package/dist/heading/Heading.module.js +16 -0
- package/dist/heading/Heading.module.js.map +1 -0
- package/dist/heading/tokens.d.ts +6 -0
- package/dist/heading/tokens.d.ts.map +1 -0
- package/dist/heading/tokens.js +66 -0
- package/dist/heading/tokens.js.map +1 -0
- package/dist/icon/Icon.css +1 -1
- package/dist/icon/Icon.js +1 -1
- package/dist/icon/Icon.js.map +1 -1
- package/dist/icon/Icon.module.js +1 -1
- package/dist/icon-button/IconButton.css +2 -2
- package/dist/icon-button/IconButton.d.ts +1 -1
- package/dist/icon-button/IconButton.d.ts.map +1 -1
- package/dist/icon-button/IconButton.js +3 -3
- package/dist/icon-button/IconButton.js.map +1 -1
- package/dist/icon-button/IconButton.module.js +2 -2
- package/dist/index.d.ts +25 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -2
- package/dist/inline/Inline.css +142 -0
- package/dist/inline/Inline.d.ts +17 -0
- package/dist/inline/Inline.d.ts.map +1 -0
- package/dist/inline/Inline.js +21 -0
- package/dist/inline/Inline.js.map +1 -0
- package/dist/inline/Inline.module.js +12 -0
- package/dist/inline/Inline.module.js.map +1 -0
- package/dist/inline/tokens.d.ts +3 -0
- package/dist/inline/tokens.d.ts.map +1 -0
- package/dist/inline/tokens.js +10 -0
- package/dist/inline/tokens.js.map +1 -0
- package/dist/layout/responsive.d.ts +38 -0
- package/dist/layout/responsive.d.ts.map +1 -0
- package/dist/layout/responsive.js +49 -0
- package/dist/layout/responsive.js.map +1 -0
- package/dist/menu/Menu.js +2 -2
- package/dist/menu/Menu.js.map +1 -1
- package/dist/number-input/NumberInput.css +12 -12
- package/dist/number-input/NumberInput.js +1 -1
- package/dist/number-input/NumberInput.js.map +1 -1
- package/dist/number-input/NumberInput.module.js +4 -4
- package/dist/number-input/NumberInput.module.js.map +1 -1
- package/dist/number-input/tokens.d.ts +3 -0
- package/dist/number-input/tokens.d.ts.map +1 -0
- package/dist/number-input/tokens.js +10 -0
- package/dist/number-input/tokens.js.map +1 -0
- package/dist/popover/Popover.css +13 -12
- package/dist/popover/Popover.js +2 -2
- package/dist/popover/Popover.js.map +1 -1
- package/dist/popover/Popover.module.js +3 -3
- package/dist/popover/Popover.module.js.map +1 -1
- package/dist/popover/tokens.d.ts +3 -0
- package/dist/popover/tokens.d.ts.map +1 -0
- package/dist/popover/tokens.js +19 -0
- package/dist/popover/tokens.js.map +1 -0
- package/dist/prose/Prose.css +141 -0
- package/dist/prose/Prose.d.ts +11 -0
- package/dist/prose/Prose.d.ts.map +1 -0
- package/dist/prose/Prose.js +18 -0
- package/dist/prose/Prose.js.map +1 -0
- package/dist/prose/Prose.module.js +8 -0
- package/dist/prose/Prose.module.js.map +1 -0
- package/dist/prose/tokens.d.ts +3 -0
- package/dist/prose/tokens.d.ts.map +1 -0
- package/dist/prose/tokens.js +33 -0
- package/dist/prose/tokens.js.map +1 -0
- package/dist/radio-group/RadioGroup.css +21 -20
- package/dist/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/radio-group/RadioGroup.js +2 -2
- package/dist/radio-group/RadioGroup.js.map +1 -1
- package/dist/radio-group/RadioGroup.module.js +6 -6
- package/dist/radio-group/RadioGroup.module.js.map +1 -1
- package/dist/radio-group/tokens.d.ts +3 -0
- package/dist/radio-group/tokens.d.ts.map +1 -0
- package/dist/radio-group/tokens.js +19 -0
- package/dist/radio-group/tokens.js.map +1 -0
- package/dist/root/PanneauRoot.css +243 -20
- package/dist/root/PanneauRoot.d.ts +28 -4
- package/dist/root/PanneauRoot.d.ts.map +1 -1
- package/dist/root/PanneauRoot.js +104 -21
- package/dist/root/PanneauRoot.js.map +1 -1
- package/dist/root/PanneauRoot.module.js +11 -3
- package/dist/root/PanneauRoot.module.js.map +1 -1
- package/dist/root/ThemeScope.d.ts +24 -0
- package/dist/root/ThemeScope.d.ts.map +1 -0
- package/dist/root/ThemeScope.js +49 -0
- package/dist/root/ThemeScope.js.map +1 -0
- package/dist/select/ListBox.css +23 -22
- package/dist/select/ListBox.module.js +12 -12
- package/dist/select/ListBox.module.js.map +1 -1
- package/dist/select/Select.js +1 -1
- package/dist/select/Select.js.map +1 -1
- package/dist/select/listBoxTokens.d.ts +3 -0
- package/dist/select/listBoxTokens.d.ts.map +1 -0
- package/dist/select/listBoxTokens.js +19 -0
- package/dist/select/listBoxTokens.js.map +1 -0
- package/dist/spinner/Spinner.css +8 -8
- package/dist/spinner/Spinner.js +1 -1
- package/dist/spinner/Spinner.js.map +1 -1
- package/dist/spinner/Spinner.module.js +5 -5
- package/dist/spinner/Spinner.module.js.map +1 -1
- package/dist/spinner/tokens.d.ts +3 -0
- package/dist/spinner/tokens.d.ts.map +1 -0
- package/dist/spinner/tokens.js +10 -0
- package/dist/spinner/tokens.js.map +1 -0
- package/dist/stack/Stack.css +135 -0
- package/dist/stack/Stack.d.ts +15 -0
- package/dist/stack/Stack.d.ts.map +1 -0
- package/dist/stack/Stack.js +21 -0
- package/dist/stack/Stack.js.map +1 -0
- package/dist/stack/Stack.module.js +8 -0
- package/dist/stack/Stack.module.js.map +1 -0
- package/dist/stack/tokens.d.ts +3 -0
- package/dist/stack/tokens.d.ts.map +1 -0
- package/dist/stack/tokens.js +10 -0
- package/dist/stack/tokens.js.map +1 -0
- package/dist/switch/Switch.css +34 -25
- package/dist/switch/Switch.d.ts.map +1 -1
- package/dist/switch/Switch.js +1 -0
- package/dist/switch/Switch.js.map +1 -1
- package/dist/switch/Switch.module.js +4 -4
- package/dist/switch/Switch.module.js.map +1 -1
- package/dist/switch/tokens.d.ts +3 -0
- package/dist/switch/tokens.d.ts.map +1 -0
- package/dist/switch/tokens.js +25 -0
- package/dist/switch/tokens.js.map +1 -0
- package/dist/tabs/Tabs.css +24 -23
- package/dist/tabs/Tabs.js +4 -4
- package/dist/tabs/Tabs.js.map +1 -1
- package/dist/tabs/Tabs.module.js +4 -4
- package/dist/tabs/Tabs.module.js.map +1 -1
- package/dist/tabs/tokens.d.ts +3 -0
- package/dist/tabs/tokens.d.ts.map +1 -0
- package/dist/tabs/tokens.js +25 -0
- package/dist/tabs/tokens.js.map +1 -0
- package/dist/text/Text.css +74 -0
- package/dist/text/Text.d.ts +27 -0
- package/dist/text/Text.d.ts.map +1 -0
- package/dist/text/Text.js +16 -0
- package/dist/text/Text.js.map +1 -0
- package/dist/text/Text.module.js +30 -0
- package/dist/text/Text.module.js.map +1 -0
- package/dist/text/tokens.d.ts +3 -0
- package/dist/text/tokens.d.ts.map +1 -0
- package/dist/text/tokens.js +10 -0
- package/dist/text/tokens.js.map +1 -0
- package/dist/text-area/TextArea.css +1 -1
- package/dist/text-area/TextArea.js +1 -1
- package/dist/text-area/TextArea.js.map +1 -1
- package/dist/text-area/TextArea.module.js +1 -1
- package/dist/text-input/TextInput.js +1 -1
- package/dist/text-input/TextInput.js.map +1 -1
- package/dist/theme/Tone.css +70 -0
- package/dist/theme/Tone.module.js +20 -0
- package/dist/theme/Tone.module.js.map +1 -0
- package/dist/theme/bootstrap.d.ts +10 -0
- package/dist/theme/bootstrap.d.ts.map +1 -1
- package/dist/theme/bootstrap.js +48 -5
- package/dist/theme/bootstrap.js.map +1 -1
- package/dist/theme/chartColors.d.ts +23 -0
- package/dist/theme/chartColors.d.ts.map +1 -0
- package/dist/theme/chartColors.js +27 -0
- package/dist/theme/chartColors.js.map +1 -0
- package/dist/theme/checkTheme.d.ts +39 -0
- package/dist/theme/checkTheme.d.ts.map +1 -0
- package/dist/theme/checkTheme.js +132 -0
- package/dist/theme/checkTheme.js.map +1 -0
- package/dist/theme/cli.d.ts +14 -0
- package/dist/theme/cli.d.ts.map +1 -0
- package/dist/theme/cli.js +61 -0
- package/dist/theme/cli.js.map +1 -0
- package/dist/theme/color.d.ts +30 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/color.js +94 -0
- package/dist/theme/color.js.map +1 -0
- package/dist/theme/colorVision.d.ts +23 -0
- package/dist/theme/colorVision.d.ts.map +1 -0
- package/dist/theme/colorVision.js +140 -0
- package/dist/theme/colorVision.js.map +1 -0
- package/dist/theme/componentTokens.d.ts +24 -0
- package/dist/theme/componentTokens.d.ts.map +1 -0
- package/dist/theme/componentTokens.js +20 -0
- package/dist/theme/componentTokens.js.map +1 -0
- package/dist/theme/components.d.ts +38 -0
- package/dist/theme/components.d.ts.map +1 -0
- package/dist/theme/components.js +65 -0
- package/dist/theme/components.js.map +1 -0
- package/dist/theme/defineTheme.d.ts +85 -0
- package/dist/theme/defineTheme.d.ts.map +1 -0
- package/dist/theme/defineTheme.js +130 -0
- package/dist/theme/defineTheme.js.map +1 -0
- package/dist/theme/fonts.d.ts +32 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +36 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/index.d.ts +13 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +10 -0
- package/dist/theme/semanticTokens.d.ts +9 -0
- package/dist/theme/semanticTokens.d.ts.map +1 -0
- package/dist/theme/semanticTokens.js +110 -0
- package/dist/theme/semanticTokens.js.map +1 -0
- package/dist/theme/theme.d.ts +61 -7
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +100 -10
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/toneClass.d.ts +8 -0
- package/dist/theme/toneClass.d.ts.map +1 -0
- package/dist/theme/toneClass.js +15 -0
- package/dist/theme/toneClass.js.map +1 -0
- package/dist/theme/tones.d.ts +89 -0
- package/dist/theme/tones.d.ts.map +1 -0
- package/dist/theme/tones.js +127 -0
- package/dist/theme/tones.js.map +1 -0
- package/dist/time-input/TimeInput.js +1 -1
- package/dist/time-input/TimeInput.js.map +1 -1
- package/dist/toast/Toast.css +22 -44
- package/dist/toast/Toast.d.ts +5 -3
- package/dist/toast/Toast.d.ts.map +1 -1
- package/dist/toast/Toast.js +4 -3
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/Toast.module.js +10 -16
- package/dist/toast/Toast.module.js.map +1 -1
- package/dist/toast/tokens.d.ts +3 -0
- package/dist/toast/tokens.d.ts.map +1 -0
- package/dist/toast/tokens.js +21 -0
- package/dist/toast/tokens.js.map +1 -0
- package/dist/tooltip/Tooltip.css +12 -11
- package/dist/tooltip/Tooltip.js +1 -1
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/Tooltip.module.js +2 -2
- package/dist/tooltip/Tooltip.module.js.map +1 -1
- package/dist/tooltip/tokens.d.ts +3 -0
- package/dist/tooltip/tokens.d.ts.map +1 -0
- package/dist/tooltip/tokens.js +21 -0
- package/dist/tooltip/tokens.js.map +1 -0
- package/dist/utils/cx.d.ts +1 -1
- package/dist/utils/cx.d.ts.map +1 -1
- package/dist/utils/cx.js +2 -2
- package/dist/utils/cx.js.map +1 -1
- package/package.json +15 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/* Doubled classes: more specific than the button's own padding, whatever the CSS order. */
|
|
2
|
-
.panneau-
|
|
2
|
+
.panneau-icon-button.panneau-icon-button {
|
|
3
3
|
width: var(--panneau-control-height);
|
|
4
4
|
padding: 0;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
.panneau-
|
|
7
|
+
.panneau-icon-button.panneau-icon-button-sm {
|
|
8
8
|
width: var(--panneau-control-height-sm);
|
|
9
9
|
}
|
|
@@ -11,5 +11,5 @@ export interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'iconEnd' |
|
|
|
11
11
|
style?: CSSProperties;
|
|
12
12
|
}
|
|
13
13
|
/** A square button with only an icon. Its label is announced and shown as a tooltip. */
|
|
14
|
-
export declare function IconButton({ icon, label,
|
|
14
|
+
export declare function IconButton({ icon, label, appearance, size, showTooltip, className, ...props }: IconButtonProps): import("react").JSX.Element;
|
|
15
15
|
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAKlD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CACzC,WAAW,EACX,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAC/D;IACG,IAAI,EAAE,aAAa,CAAC;IACpB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,wFAAwF;AACxF,wBAAgB,UAAU,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,
|
|
1
|
+
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/icon-button/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAKlD,MAAM,WAAW,eAAgB,SAAQ,IAAI,CACzC,WAAW,EACX,MAAM,GAAG,SAAS,GAAG,UAAU,GAAG,WAAW,GAAG,YAAY,CAC/D;IACG,IAAI,EAAE,aAAa,CAAC;IACpB,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,wFAAwF;AACxF,wBAAgB,UAAU,CAAC,EACvB,IAAI,EACJ,KAAK,EACL,UAAoB,EACpB,IAAW,EACX,WAAkB,EAClB,SAAS,EACT,GAAG,KAAK,EACX,EAAE,eAAe,+BAoBjB"}
|
|
@@ -5,14 +5,14 @@ import IconButton_module_default from "./IconButton.module.js";
|
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/icon-button/IconButton.tsx
|
|
7
7
|
/** A square button with only an icon. Its label is announced and shown as a tooltip. */
|
|
8
|
-
function IconButton({ icon, label,
|
|
8
|
+
function IconButton({ icon, label, appearance = "ghost", size = "md", showTooltip = true, className, ...props }) {
|
|
9
9
|
const button = /* @__PURE__ */ jsx(Button, {
|
|
10
10
|
...props,
|
|
11
|
-
|
|
11
|
+
appearance,
|
|
12
12
|
size,
|
|
13
13
|
icon,
|
|
14
14
|
"aria-label": label,
|
|
15
|
-
className: cx(IconButton_module_default.iconButton, size === "sm" && IconButton_module_default.sm, className)
|
|
15
|
+
className: cx("panneau-icon-button", IconButton_module_default.iconButton, size === "sm" && IconButton_module_default.sm, className)
|
|
16
16
|
});
|
|
17
17
|
if (!showTooltip) return button;
|
|
18
18
|
return /* @__PURE__ */ jsx(Tooltip, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.js","names":["styles"],"sources":["../../src/icon-button/IconButton.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { Button, type ButtonProps } from '../button/Button';\nimport type { IconComponent } from '../icon/Icon';\nimport { Tooltip } from '../tooltip/Tooltip';\nimport { cx } from '../utils/cx';\nimport styles from './IconButton.module.css';\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'icon' | 'iconEnd' | 'children' | 'fullWidth' | 'aria-label'\n> {\n icon: IconComponent;\n /** Accessible label, also shown as a tooltip. */\n label: string;\n /** Shows the label in a tooltip on hover and focus. Defaults to true. */\n showTooltip?: boolean;\n className?: string;\n style?: CSSProperties;\n}\n\n/** A square button with only an icon. Its label is announced and shown as a tooltip. */\nexport function IconButton({\n icon,\n label,\n
|
|
1
|
+
{"version":3,"file":"IconButton.js","names":["styles"],"sources":["../../src/icon-button/IconButton.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { Button, type ButtonProps } from '../button/Button';\nimport type { IconComponent } from '../icon/Icon';\nimport { Tooltip } from '../tooltip/Tooltip';\nimport { cx } from '../utils/cx';\nimport styles from './IconButton.module.css';\n\nexport interface IconButtonProps extends Omit<\n ButtonProps,\n 'icon' | 'iconEnd' | 'children' | 'fullWidth' | 'aria-label'\n> {\n icon: IconComponent;\n /** Accessible label, also shown as a tooltip. */\n label: string;\n /** Shows the label in a tooltip on hover and focus. Defaults to true. */\n showTooltip?: boolean;\n className?: string;\n style?: CSSProperties;\n}\n\n/** A square button with only an icon. Its label is announced and shown as a tooltip. */\nexport function IconButton({\n icon,\n label,\n appearance = 'ghost',\n size = 'md',\n showTooltip = true,\n className,\n ...props\n}: IconButtonProps) {\n const button = (\n <Button\n {...props}\n appearance={appearance}\n size={size}\n icon={icon}\n aria-label={label}\n className={cx(\n 'panneau-icon-button',\n styles.iconButton,\n size === 'sm' && styles.sm,\n className,\n )}\n />\n );\n if (!showTooltip) {\n return button;\n }\n return <Tooltip content={label}>{button}</Tooltip>;\n}\n"],"mappings":";;;;;;;AAsBA,SAAgB,WAAW,EACvB,MACA,OACA,aAAa,SACb,OAAO,MACP,cAAc,MACd,WACA,GAAG,SACa;CAChB,MAAM,SACF,oBAAC,QAAD;EACI,GAAI;EACQ;EACN;EACA;EACN,cAAY;EACZ,WAAW,GACP,uBACAA,0BAAO,YACP,SAAS,QAAQA,0BAAO,IACxB,SACJ;CAAE,CAAA;CAGV,IAAI,CAAC,aACD,OAAO;CAEX,OAAO,oBAAC,SAAD;EAAS,SAAS;EAAQ,UAAA;CAAgB,CAAA;AACrD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./IconButton.css";
|
|
2
2
|
//#region src/icon-button/IconButton.module.css
|
|
3
|
-
var iconButton = "panneau-
|
|
4
|
-
var sm = "panneau-
|
|
3
|
+
var iconButton = "panneau-icon-button";
|
|
4
|
+
var sm = "panneau-icon-button-sm";
|
|
5
5
|
var IconButton_module_default = {
|
|
6
6
|
iconButton,
|
|
7
7
|
sm
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
export { Alert, type AlertProps, type AlertTone } from './alert/Alert';
|
|
2
|
-
export { Badge, type BadgeProps, type BadgeTone } from './badge/Badge';
|
|
3
|
-
export { Button, type ButtonProps, type ButtonVariant } from './button/Button';
|
|
1
|
+
export { Alert, type AlertAppearance, type AlertProps, type AlertTone, type AlertVariants, } from './alert/Alert';
|
|
2
|
+
export { Badge, type BadgeAppearance, type BadgeProps, type BadgeTone, type BadgeVariants, } from './badge/Badge';
|
|
3
|
+
export { Button, type ButtonAppearance, type ButtonProps, type ButtonVariant, type ButtonVariants, } from './button/Button';
|
|
4
4
|
export { Card, type CardProps } from './card/Card';
|
|
5
|
+
export { Container, type ContainerProps } from './container/Container';
|
|
6
|
+
export { Divider, type DividerProps } from './divider/Divider';
|
|
7
|
+
export { Grid, GridItem, type GridItemProps, type GridProps } from './grid/Grid';
|
|
8
|
+
export { Heading, type HeadingLevel, type HeadingProps, type HeadingSize } from './heading/Heading';
|
|
5
9
|
export { Checkbox, type CheckboxProps } from './checkbox/Checkbox';
|
|
6
10
|
export { type ChoiceChromeProps } from './checkbox/ChoiceChrome';
|
|
7
11
|
export { ComboBox, type ComboBoxItem, type ComboBoxProps } from './combo-box/ComboBox';
|
|
@@ -19,14 +23,30 @@ export { NumberInput, type NumberInputProps } from './number-input/NumberInput';
|
|
|
19
23
|
export { Popover, type PopoverProps, PopoverTrigger } from './popover/Popover';
|
|
20
24
|
export { RadioGroup, type RadioGroupProps } from './radio-group/RadioGroup';
|
|
21
25
|
export { PanneauRoot, type PanneauRootProps, usePortalContainer } from './root/PanneauRoot';
|
|
26
|
+
export { ThemeScope, type ThemeScopeProps } from './root/ThemeScope';
|
|
22
27
|
export { type MultipleSelectProps, type OptionValue, Select, type SelectBaseProps, type SelectOption, type SelectProps, type SingleSelectProps, } from './select/Select';
|
|
28
|
+
export { Inline, type InlineProps } from './inline/Inline';
|
|
29
|
+
export { BREAKPOINTS, type Breakpoint, type Justification, type Responsive, type Space, } from './layout/responsive';
|
|
30
|
+
export { Prose, type ProseProps } from './prose/Prose';
|
|
23
31
|
export { Spinner, type SpinnerProps } from './spinner/Spinner';
|
|
32
|
+
export { Stack, type StackProps } from './stack/Stack';
|
|
24
33
|
export { Switch, type SwitchProps } from './switch/Switch';
|
|
25
34
|
export { Tab, TabList, type TabListProps, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, } from './tabs/Tabs';
|
|
35
|
+
export { Text, type TextFamily, type TextProps, type TextSize } from './text/Text';
|
|
26
36
|
export { TextArea, type TextAreaProps } from './text-area/TextArea';
|
|
27
37
|
export { TextInput, type TextInputProps } from './text-input/TextInput';
|
|
28
|
-
export { bootstrapTheme } from './theme/bootstrap';
|
|
29
|
-
export {
|
|
38
|
+
export { bootstrapTheme, bootstrapTone } from './theme/bootstrap';
|
|
39
|
+
export { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from './theme/chartColors';
|
|
40
|
+
export { type ThemeContrastCheck, type ThemeReport, checkTheme } from './theme/checkTheme';
|
|
41
|
+
export { type ColorDifferenceCheck, type ColorVisionDeficiency, checkColorDifferences, } from './theme/colorVision';
|
|
42
|
+
export { type Rgb } from './theme/color';
|
|
43
|
+
export { type ComponentTokens, defineComponentTokens } from './theme/componentTokens';
|
|
44
|
+
export { type ComponentTokenName, componentTokens } from './theme/components';
|
|
45
|
+
export { type PaletteTokenName, type PanneauTokens, type ThemeDefinition, type ThemeTokens, type TokenName, defineTheme, findUnknownTokens, mergeThemes, } from './theme/defineTheme';
|
|
46
|
+
export { SEMANTIC_TOKENS, type SemanticTokenName } from './theme/semanticTokens';
|
|
47
|
+
export { type ThemeFont, type ThemeFontFace, type ThemeFontStylesheet } from './theme/fonts';
|
|
48
|
+
export { type ColorScheme, type Density, type Theme } from './theme/theme';
|
|
49
|
+
export { BUILT_IN_TONES, type PanneauTones, type Tone, type ToneInput, type ToneSurfaces, type ToneValues, deriveTone, toneClassName, } from './theme/tones';
|
|
30
50
|
export { TimeInput, type TimeInputProps } from './time-input/TimeInput';
|
|
31
51
|
export { type ToastContent, type ToastOptions, type ToastTone, type Toasts, useToast, } from './toast/Toast';
|
|
32
52
|
export { Tooltip, type TooltipProps } from './tooltip/Tooltip';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Icon } from "./icon/Icon.js";
|
|
2
2
|
import { usePanneauIntl } from "./intl/usePanneauIntl.js";
|
|
3
3
|
import { Spinner } from "./spinner/Spinner.js";
|
|
4
|
+
import { BUILT_IN_TONES, deriveTone, toneClassName } from "./theme/tones.js";
|
|
4
5
|
import { Button } from "./button/Button.js";
|
|
5
6
|
import { useToast } from "./toast/Toast.js";
|
|
6
7
|
import { PanneauRoot, usePortalContainer } from "./root/PanneauRoot.js";
|
|
@@ -9,6 +10,11 @@ import { IconButton } from "./icon-button/IconButton.js";
|
|
|
9
10
|
import { Alert } from "./alert/Alert.js";
|
|
10
11
|
import { Badge } from "./badge/Badge.js";
|
|
11
12
|
import { Card } from "./card/Card.js";
|
|
13
|
+
import { Container } from "./container/Container.js";
|
|
14
|
+
import { Divider } from "./divider/Divider.js";
|
|
15
|
+
import { BREAKPOINTS } from "./layout/responsive.js";
|
|
16
|
+
import { Grid, GridItem } from "./grid/Grid.js";
|
|
17
|
+
import { Heading } from "./heading/Heading.js";
|
|
12
18
|
import { Checkbox } from "./checkbox/Checkbox.js";
|
|
13
19
|
import { Popover, PopoverTrigger } from "./popover/Popover.js";
|
|
14
20
|
import { ComboBox } from "./combo-box/ComboBox.js";
|
|
@@ -20,11 +26,23 @@ import { getNamedIcon, loadNamedIcon } from "./icon/namedIcons.js";
|
|
|
20
26
|
import { Menu, MenuItem, MenuSeparator, MenuTrigger } from "./menu/Menu.js";
|
|
21
27
|
import { NumberInput } from "./number-input/NumberInput.js";
|
|
22
28
|
import { RadioGroup } from "./radio-group/RadioGroup.js";
|
|
29
|
+
import { ThemeScope } from "./root/ThemeScope.js";
|
|
23
30
|
import { Select } from "./select/Select.js";
|
|
31
|
+
import { Inline } from "./inline/Inline.js";
|
|
32
|
+
import { Prose } from "./prose/Prose.js";
|
|
33
|
+
import { Stack } from "./stack/Stack.js";
|
|
24
34
|
import { Switch } from "./switch/Switch.js";
|
|
25
35
|
import { Tab, TabList, TabPanel, Tabs } from "./tabs/Tabs.js";
|
|
36
|
+
import { Text } from "./text/Text.js";
|
|
26
37
|
import { TextArea } from "./text-area/TextArea.js";
|
|
27
38
|
import { TextInput } from "./text-input/TextInput.js";
|
|
28
|
-
import { bootstrapTheme } from "./theme/bootstrap.js";
|
|
39
|
+
import { bootstrapTheme, bootstrapTone } from "./theme/bootstrap.js";
|
|
40
|
+
import { CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, chartColors } from "./theme/chartColors.js";
|
|
41
|
+
import { checkColorDifferences } from "./theme/colorVision.js";
|
|
42
|
+
import { checkTheme } from "./theme/checkTheme.js";
|
|
43
|
+
import { defineComponentTokens } from "./theme/componentTokens.js";
|
|
44
|
+
import { componentTokens } from "./theme/components.js";
|
|
45
|
+
import { SEMANTIC_TOKENS } from "./theme/semanticTokens.js";
|
|
46
|
+
import { defineTheme, findUnknownTokens, mergeThemes } from "./theme/defineTheme.js";
|
|
29
47
|
import { TimeInput } from "./time-input/TimeInput.js";
|
|
30
|
-
export { Alert, Badge, Button, Card, Checkbox, ComboBox, DatePicker, Dialog, DialogTrigger, Disclosure, Fieldset, Icon, IconButton, Menu, MenuItem, MenuSeparator, MenuTrigger, NumberInput, PanneauRoot, Popover, PopoverTrigger, RadioGroup, Select, Spinner, Switch, Tab, TabList, TabPanel, Tabs, TextArea, TextInput, TimeInput, Tooltip, bootstrapTheme, getNamedIcon, loadNamedIcon, usePanneauIntl, usePortalContainer, useToast };
|
|
48
|
+
export { Alert, BREAKPOINTS, BUILT_IN_TONES, Badge, Button, CHART_CATEGORICAL_COUNT, CHART_SEQUENTIAL_COUNT, Card, Checkbox, ComboBox, Container, DatePicker, Dialog, DialogTrigger, Disclosure, Divider, Fieldset, Grid, GridItem, Heading, Icon, IconButton, Inline, Menu, MenuItem, MenuSeparator, MenuTrigger, NumberInput, PanneauRoot, Popover, PopoverTrigger, Prose, RadioGroup, SEMANTIC_TOKENS, Select, Spinner, Stack, Switch, Tab, TabList, TabPanel, Tabs, Text, TextArea, TextInput, ThemeScope, TimeInput, Tooltip, bootstrapTheme, bootstrapTone, chartColors, checkColorDifferences, checkTheme, componentTokens, defineComponentTokens, defineTheme, deriveTone, findUnknownTokens, getNamedIcon, loadNamedIcon, mergeThemes, toneClassName, usePanneauIntl, usePortalContainer, useToast };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/* A horizontal row that wraps: each prop can change at the breakpoints of the nearest container. */
|
|
2
|
+
|
|
3
|
+
.panneau-inline {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-wrap: wrap;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.panneau-inline-nowrap {
|
|
10
|
+
flex-wrap: nowrap;
|
|
11
|
+
}
|
|
12
|
+
/* Responsive values are set inline; children reset them so that they aren't inherited. */
|
|
13
|
+
.panneau-inline > * {
|
|
14
|
+
--_panneau-inline-gap-base: initial;
|
|
15
|
+
--_panneau-inline-gap-sm: initial;
|
|
16
|
+
--_panneau-inline-gap-md: initial;
|
|
17
|
+
--_panneau-inline-gap-lg: initial;
|
|
18
|
+
--_panneau-inline-gap-xl: initial;
|
|
19
|
+
--_panneau-inline-align-base: initial;
|
|
20
|
+
--_panneau-inline-align-sm: initial;
|
|
21
|
+
--_panneau-inline-align-md: initial;
|
|
22
|
+
--_panneau-inline-align-lg: initial;
|
|
23
|
+
--_panneau-inline-align-xl: initial;
|
|
24
|
+
--_panneau-inline-justify-base: initial;
|
|
25
|
+
--_panneau-inline-justify-sm: initial;
|
|
26
|
+
--_panneau-inline-justify-md: initial;
|
|
27
|
+
--_panneau-inline-justify-lg: initial;
|
|
28
|
+
--_panneau-inline-justify-xl: initial;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.panneau-inline {
|
|
32
|
+
gap: var(--_panneau-inline-gap-base, var(--panneau-inline-gap, var(--panneau-space-2)));
|
|
33
|
+
align-items: var(--_panneau-inline-align-base, center);
|
|
34
|
+
justify-content: var(--_panneau-inline-justify-base, start);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@container (min-width: 40rem) {
|
|
38
|
+
.panneau-inline {
|
|
39
|
+
gap: var(
|
|
40
|
+
--_panneau-inline-gap-sm,
|
|
41
|
+
var(--_panneau-inline-gap-base, var(--panneau-inline-gap, var(--panneau-space-2)))
|
|
42
|
+
);
|
|
43
|
+
align-items: var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center));
|
|
44
|
+
justify-content: var(
|
|
45
|
+
--_panneau-inline-justify-sm,
|
|
46
|
+
var(--_panneau-inline-justify-base, start)
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@container (min-width: 48rem) {
|
|
52
|
+
.panneau-inline {
|
|
53
|
+
gap: var(
|
|
54
|
+
--_panneau-inline-gap-md,
|
|
55
|
+
var(
|
|
56
|
+
--_panneau-inline-gap-sm,
|
|
57
|
+
var(--_panneau-inline-gap-base, var(--panneau-inline-gap, var(--panneau-space-2)))
|
|
58
|
+
)
|
|
59
|
+
);
|
|
60
|
+
align-items: var(
|
|
61
|
+
--_panneau-inline-align-md,
|
|
62
|
+
var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center))
|
|
63
|
+
);
|
|
64
|
+
justify-content: var(
|
|
65
|
+
--_panneau-inline-justify-md,
|
|
66
|
+
var(--_panneau-inline-justify-sm, var(--_panneau-inline-justify-base, start))
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@container (min-width: 64rem) {
|
|
72
|
+
.panneau-inline {
|
|
73
|
+
gap: var(
|
|
74
|
+
--_panneau-inline-gap-lg,
|
|
75
|
+
var(
|
|
76
|
+
--_panneau-inline-gap-md,
|
|
77
|
+
var(
|
|
78
|
+
--_panneau-inline-gap-sm,
|
|
79
|
+
var(
|
|
80
|
+
--_panneau-inline-gap-base,
|
|
81
|
+
var(--panneau-inline-gap, var(--panneau-space-2))
|
|
82
|
+
)
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
);
|
|
86
|
+
align-items: var(
|
|
87
|
+
--_panneau-inline-align-lg,
|
|
88
|
+
var(
|
|
89
|
+
--_panneau-inline-align-md,
|
|
90
|
+
var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center))
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
justify-content: var(
|
|
94
|
+
--_panneau-inline-justify-lg,
|
|
95
|
+
var(
|
|
96
|
+
--_panneau-inline-justify-md,
|
|
97
|
+
var(--_panneau-inline-justify-sm, var(--_panneau-inline-justify-base, start))
|
|
98
|
+
)
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@container (min-width: 80rem) {
|
|
104
|
+
.panneau-inline {
|
|
105
|
+
gap: var(
|
|
106
|
+
--_panneau-inline-gap-xl,
|
|
107
|
+
var(
|
|
108
|
+
--_panneau-inline-gap-lg,
|
|
109
|
+
var(
|
|
110
|
+
--_panneau-inline-gap-md,
|
|
111
|
+
var(
|
|
112
|
+
--_panneau-inline-gap-sm,
|
|
113
|
+
var(
|
|
114
|
+
--_panneau-inline-gap-base,
|
|
115
|
+
var(--panneau-inline-gap, var(--panneau-space-2))
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
)
|
|
119
|
+
)
|
|
120
|
+
);
|
|
121
|
+
align-items: var(
|
|
122
|
+
--_panneau-inline-align-xl,
|
|
123
|
+
var(
|
|
124
|
+
--_panneau-inline-align-lg,
|
|
125
|
+
var(
|
|
126
|
+
--_panneau-inline-align-md,
|
|
127
|
+
var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center))
|
|
128
|
+
)
|
|
129
|
+
)
|
|
130
|
+
);
|
|
131
|
+
justify-content: var(
|
|
132
|
+
--_panneau-inline-justify-xl,
|
|
133
|
+
var(
|
|
134
|
+
--_panneau-inline-justify-lg,
|
|
135
|
+
var(
|
|
136
|
+
--_panneau-inline-justify-md,
|
|
137
|
+
var(--_panneau-inline-justify-sm, var(--_panneau-inline-justify-base, start))
|
|
138
|
+
)
|
|
139
|
+
)
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import { type Justification, type Responsive, type Space } from '../layout/responsive';
|
|
3
|
+
export interface InlineProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Element to render. Defaults to `div`. */
|
|
5
|
+
as?: 'div' | 'section' | 'header' | 'footer' | 'nav' | 'ul' | 'ol' | 'span';
|
|
6
|
+
/** Space between items, from the space scale. Defaults to the `--panneau-inline-gap` token. */
|
|
7
|
+
gap?: Responsive<Space>;
|
|
8
|
+
/** Vertical alignment of the items. Defaults to `center`. */
|
|
9
|
+
align?: Responsive<'start' | 'center' | 'end' | 'stretch' | 'baseline'>;
|
|
10
|
+
/** Horizontal distribution of the items. Defaults to `start`. */
|
|
11
|
+
justify?: Responsive<Justification>;
|
|
12
|
+
/** Items wrap to the next line when they don't fit. Defaults to `true`. */
|
|
13
|
+
wrap?: boolean;
|
|
14
|
+
}
|
|
15
|
+
/** Items side by side, wrapping when they don't fit, like Bootstrap's `.hstack`. */
|
|
16
|
+
export declare function Inline({ as: Element, gap, align, justify, wrap, className, style, ...props }: InlineProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Inline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Inline.d.ts","sourceRoot":"","sources":["../../src/inline/Inline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EACH,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,KAAK,EAKb,MAAM,sBAAsB,CAAC;AAI9B,MAAM,WAAW,WAAY,SAAQ,cAAc,CAAC,WAAW,CAAC;IAC5D,4CAA4C;IAC5C,EAAE,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC;IAC5E,+FAA+F;IAC/F,GAAG,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;IACxB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,UAAU,CAAC,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,GAAG,UAAU,CAAC,CAAC;IACxE,iEAAiE;IACjE,OAAO,CAAC,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC;IACpC,2EAA2E;IAC3E,IAAI,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,oFAAoF;AACpF,wBAAgB,MAAM,CAAC,EACnB,EAAE,EAAE,OAAe,EACnB,GAAG,EACH,KAAK,EACL,OAAO,EACP,IAAW,EACX,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACX,EAAE,WAAW,+BAeb"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { justification, responsiveVariables, space, withVariables } from "../layout/responsive.js";
|
|
3
|
+
import Inline_module_default from "./Inline.module.js";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
//#region src/inline/Inline.tsx
|
|
6
|
+
/** Items side by side, wrapping when they don't fit, like Bootstrap's `.hstack`. */
|
|
7
|
+
function Inline({ as: Element = "div", gap, align, justify, wrap = true, className, style, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Element, {
|
|
9
|
+
...props,
|
|
10
|
+
className: cx("panneau-inline", Inline_module_default.inline, !wrap && Inline_module_default.nowrap, className),
|
|
11
|
+
style: withVariables([
|
|
12
|
+
responsiveVariables("inline", "gap", gap, space),
|
|
13
|
+
responsiveVariables("inline", "align", align, String),
|
|
14
|
+
responsiveVariables("inline", "justify", justify, justification)
|
|
15
|
+
], style)
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
export { Inline };
|
|
20
|
+
|
|
21
|
+
//# sourceMappingURL=Inline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Inline.js","names":["styles"],"sources":["../../src/inline/Inline.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport {\n type Justification,\n type Responsive,\n type Space,\n justification,\n responsiveVariables,\n space,\n withVariables,\n} from '../layout/responsive';\nimport { cx } from '../utils/cx';\nimport styles from './Inline.module.css';\n\nexport interface InlineProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'header' | 'footer' | 'nav' | 'ul' | 'ol' | 'span';\n /** Space between items, from the space scale. Defaults to the `--panneau-inline-gap` token. */\n gap?: Responsive<Space>;\n /** Vertical alignment of the items. Defaults to `center`. */\n align?: Responsive<'start' | 'center' | 'end' | 'stretch' | 'baseline'>;\n /** Horizontal distribution of the items. Defaults to `start`. */\n justify?: Responsive<Justification>;\n /** Items wrap to the next line when they don't fit. Defaults to `true`. */\n wrap?: boolean;\n}\n\n/** Items side by side, wrapping when they don't fit, like Bootstrap's `.hstack`. */\nexport function Inline({\n as: Element = 'div',\n gap,\n align,\n justify,\n wrap = true,\n className,\n style,\n ...props\n}: InlineProps) {\n return (\n <Element\n {...props}\n className={cx('panneau-inline', styles.inline, !wrap && styles.nowrap, className)}\n style={withVariables(\n [\n responsiveVariables('inline', 'gap', gap, space),\n responsiveVariables('inline', 'align', align, String),\n responsiveVariables('inline', 'justify', justify, justification),\n ],\n style,\n )}\n />\n );\n}\n"],"mappings":";;;;;;AA4BA,SAAgB,OAAO,EACnB,IAAI,UAAU,OACd,KACA,OACA,SACA,OAAO,MACP,WACA,OACA,GAAG,SACS;CACZ,OACI,oBAAC,SAAD;EACI,GAAI;EACJ,WAAW,GAAG,kBAAkBA,sBAAO,QAAQ,CAAC,QAAQA,sBAAO,QAAQ,SAAS;EAChF,OAAO,cACH;GACI,oBAAoB,UAAU,OAAO,KAAK,KAAK;GAC/C,oBAAoB,UAAU,SAAS,OAAO,MAAM;GACpD,oBAAoB,UAAU,WAAW,SAAS,aAAa;EAAC,GAEpE,KACJ;CAAE,CAAA;AAGd"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import "./Inline.css";
|
|
2
|
+
//#region src/inline/Inline.module.css
|
|
3
|
+
var inline = "panneau-inline";
|
|
4
|
+
var nowrap = "panneau-inline-nowrap";
|
|
5
|
+
var Inline_module_default = {
|
|
6
|
+
inline,
|
|
7
|
+
nowrap
|
|
8
|
+
};
|
|
9
|
+
//#endregion
|
|
10
|
+
export { Inline_module_default as default, inline, nowrap };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=Inline.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Inline.module.js","names":[],"sources":["../../src/inline/Inline.module.css"],"sourcesContent":["/* A horizontal row that wraps: each prop can change at the breakpoints of the nearest container. */\n\n.inline {\n display: flex;\n flex-wrap: wrap;\n min-width: 0;\n}\n\n.nowrap {\n flex-wrap: nowrap;\n}\n/* Responsive values are set inline; children reset them so that they aren't inherited. */\n.inline > * {\n --_panneau-inline-gap-base: initial;\n --_panneau-inline-gap-sm: initial;\n --_panneau-inline-gap-md: initial;\n --_panneau-inline-gap-lg: initial;\n --_panneau-inline-gap-xl: initial;\n --_panneau-inline-align-base: initial;\n --_panneau-inline-align-sm: initial;\n --_panneau-inline-align-md: initial;\n --_panneau-inline-align-lg: initial;\n --_panneau-inline-align-xl: initial;\n --_panneau-inline-justify-base: initial;\n --_panneau-inline-justify-sm: initial;\n --_panneau-inline-justify-md: initial;\n --_panneau-inline-justify-lg: initial;\n --_panneau-inline-justify-xl: initial;\n}\n\n.inline {\n gap: var(--_panneau-inline-gap-base, var(--panneau-inline-gap, var(--panneau-space-2)));\n align-items: var(--_panneau-inline-align-base, center);\n justify-content: var(--_panneau-inline-justify-base, start);\n}\n\n@container (min-width: 40rem) {\n .inline {\n gap: var(\n --_panneau-inline-gap-sm,\n var(--_panneau-inline-gap-base, var(--panneau-inline-gap, var(--panneau-space-2)))\n );\n align-items: var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center));\n justify-content: var(\n --_panneau-inline-justify-sm,\n var(--_panneau-inline-justify-base, start)\n );\n }\n}\n\n@container (min-width: 48rem) {\n .inline {\n gap: var(\n --_panneau-inline-gap-md,\n var(\n --_panneau-inline-gap-sm,\n var(--_panneau-inline-gap-base, var(--panneau-inline-gap, var(--panneau-space-2)))\n )\n );\n align-items: var(\n --_panneau-inline-align-md,\n var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center))\n );\n justify-content: var(\n --_panneau-inline-justify-md,\n var(--_panneau-inline-justify-sm, var(--_panneau-inline-justify-base, start))\n );\n }\n}\n\n@container (min-width: 64rem) {\n .inline {\n gap: var(\n --_panneau-inline-gap-lg,\n var(\n --_panneau-inline-gap-md,\n var(\n --_panneau-inline-gap-sm,\n var(\n --_panneau-inline-gap-base,\n var(--panneau-inline-gap, var(--panneau-space-2))\n )\n )\n )\n );\n align-items: var(\n --_panneau-inline-align-lg,\n var(\n --_panneau-inline-align-md,\n var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center))\n )\n );\n justify-content: var(\n --_panneau-inline-justify-lg,\n var(\n --_panneau-inline-justify-md,\n var(--_panneau-inline-justify-sm, var(--_panneau-inline-justify-base, start))\n )\n );\n }\n}\n\n@container (min-width: 80rem) {\n .inline {\n gap: var(\n --_panneau-inline-gap-xl,\n var(\n --_panneau-inline-gap-lg,\n var(\n --_panneau-inline-gap-md,\n var(\n --_panneau-inline-gap-sm,\n var(\n --_panneau-inline-gap-base,\n var(--panneau-inline-gap, var(--panneau-space-2))\n )\n )\n )\n )\n );\n align-items: var(\n --_panneau-inline-align-xl,\n var(\n --_panneau-inline-align-lg,\n var(\n --_panneau-inline-align-md,\n var(--_panneau-inline-align-sm, var(--_panneau-inline-align-base, center))\n )\n )\n );\n justify-content: var(\n --_panneau-inline-justify-xl,\n var(\n --_panneau-inline-justify-lg,\n var(\n --_panneau-inline-justify-md,\n var(--_panneau-inline-justify-sm, var(--_panneau-inline-justify-base, start))\n )\n )\n );\n }\n}\n"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/inline/tokens.ts"],"names":[],"mappings":"AAEA,wBAAwB;AACxB,eAAO,MAAM,YAAY,8DAGvB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defineComponentTokens } from "../theme/componentTokens.js";
|
|
2
|
+
//#region src/inline/tokens.ts
|
|
3
|
+
/** Tokens of Inline. */
|
|
4
|
+
var inlineTokens = defineComponentTokens("inline", {
|
|
5
|
+
/** Space between items, in both directions, when the `gap` prop is not set. */
|
|
6
|
+
gap: "var(--panneau-space-2)" });
|
|
7
|
+
//#endregion
|
|
8
|
+
export { inlineTokens };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/inline/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Inline. */\nexport const inlineTokens = defineComponentTokens('inline', {\n /** Space between items, in both directions, when the `gap` prop is not set. */\n gap: 'var(--panneau-space-2)',\n});\n"],"mappings":";;;AAGA,IAAa,eAAe,sBAAsB,UAAU;;AAExD,KAAK,yBACT,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Breakpoints of the layout primitives, like Bootstrap's `$grid-breakpoints`: the minimum width of
|
|
4
|
+
* the nearest container at which a responsive value applies. They are constants, since CSS
|
|
5
|
+
* variables can't be used in queries; the stylesheets of the primitives use the same values.
|
|
6
|
+
*/
|
|
7
|
+
export declare const BREAKPOINTS: Readonly<{
|
|
8
|
+
sm: "40rem";
|
|
9
|
+
md: "48rem";
|
|
10
|
+
lg: "64rem";
|
|
11
|
+
xl: "80rem";
|
|
12
|
+
}>;
|
|
13
|
+
/** A breakpoint: `sm`, `md`, `lg` or `xl`. */
|
|
14
|
+
export type Breakpoint = keyof typeof BREAKPOINTS;
|
|
15
|
+
/**
|
|
16
|
+
* A value, or values by breakpoint: `{ base: 1, md: 2, lg: 3 }`. Each value applies from its
|
|
17
|
+
* breakpoint up, until a larger one sets another. Breakpoints are widths of the nearest container
|
|
18
|
+
* (`PanneauRoot`, `Container`, a form, a list), not of the viewport, so that a grid in a narrow
|
|
19
|
+
* sidebar behaves as on a phone.
|
|
20
|
+
*/
|
|
21
|
+
export type Responsive<T> = T | Partial<Record<'base' | Breakpoint, T>>;
|
|
22
|
+
/** A step of the space scale of the theme (`--panneau-space-<step>`), or 0. */
|
|
23
|
+
export type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10;
|
|
24
|
+
/** The CSS value of a step of the space scale. */
|
|
25
|
+
export declare function space(step: Space): string;
|
|
26
|
+
/**
|
|
27
|
+
* The inline variables of a responsive prop, `--_panneau-<component>-<prop>-<breakpoint>`, which
|
|
28
|
+
* the static rules of the component read in each container query. Unset breakpoints fall back to
|
|
29
|
+
* smaller ones in CSS.
|
|
30
|
+
*/
|
|
31
|
+
export declare function responsiveVariables<T>(component: string, prop: string, value: Responsive<T> | undefined, toCss: (value: T) => string): Record<string, string>;
|
|
32
|
+
/** Merges inline variables with the `style` prop, which wins. */
|
|
33
|
+
export declare function withVariables(variables: Record<string, string>[], style: CSSProperties | undefined): CSSProperties | undefined;
|
|
34
|
+
/** How the primitives distribute items along their axis: `between` is `space-between`. */
|
|
35
|
+
export type Justification = 'start' | 'center' | 'end' | 'between';
|
|
36
|
+
/** The CSS value of a justification. */
|
|
37
|
+
export declare function justification(value: Justification): string;
|
|
38
|
+
//# sourceMappingURL=responsive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive.d.ts","sourceRoot":"","sources":["../../src/layout/responsive.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C;;;;GAIG;AACH,eAAO,MAAM,WAAW;;;;;EAKtB,CAAC;AAEH,8CAA8C;AAC9C,MAAM,MAAM,UAAU,GAAG,MAAM,OAAO,WAAW,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,UAAU,EAAE,CAAC,CAAC,CAAC,CAAC;AAExE,+EAA+E;AAC/E,MAAM,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC;AAEvD,kDAAkD;AAClD,wBAAgB,KAAK,CAAC,IAAI,EAAE,KAAK,GAAG,MAAM,CAEzC;AAQD;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EACjC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,EAChC,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,MAAM,GAC5B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAexB;AAED,iEAAiE;AACjE,wBAAgB,aAAa,CACzB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EACnC,KAAK,EAAE,aAAa,GAAG,SAAS,GACjC,aAAa,GAAG,SAAS,CAG3B;AAED,0FAA0F;AAC1F,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAEnE,wCAAwC;AACxC,wBAAgB,aAAa,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,CAE1D"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
//#region src/layout/responsive.ts
|
|
2
|
+
/**
|
|
3
|
+
* Breakpoints of the layout primitives, like Bootstrap's `$grid-breakpoints`: the minimum width of
|
|
4
|
+
* the nearest container at which a responsive value applies. They are constants, since CSS
|
|
5
|
+
* variables can't be used in queries; the stylesheets of the primitives use the same values.
|
|
6
|
+
*/
|
|
7
|
+
var BREAKPOINTS = Object.freeze({
|
|
8
|
+
sm: "40rem",
|
|
9
|
+
md: "48rem",
|
|
10
|
+
lg: "64rem",
|
|
11
|
+
xl: "80rem"
|
|
12
|
+
});
|
|
13
|
+
/** The CSS value of a step of the space scale. */
|
|
14
|
+
function space(step) {
|
|
15
|
+
return step === 0 ? "0" : `var(--panneau-space-${step})`;
|
|
16
|
+
}
|
|
17
|
+
var KEYS = ["base", ...Object.keys(BREAKPOINTS)];
|
|
18
|
+
function isByBreakpoint(value) {
|
|
19
|
+
return typeof value === "object" && value !== null;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The inline variables of a responsive prop, `--_panneau-<component>-<prop>-<breakpoint>`, which
|
|
23
|
+
* the static rules of the component read in each container query. Unset breakpoints fall back to
|
|
24
|
+
* smaller ones in CSS.
|
|
25
|
+
*/
|
|
26
|
+
function responsiveVariables(component, prop, value, toCss) {
|
|
27
|
+
if (value === void 0) return {};
|
|
28
|
+
const values = isByBreakpoint(value) ? value : { base: value };
|
|
29
|
+
return Object.fromEntries(KEYS.flatMap((key) => {
|
|
30
|
+
const item = values[key];
|
|
31
|
+
return item !== void 0 ? [[`--_panneau-${component}-${prop}-${key}`, toCss(item)]] : [];
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
/** Merges inline variables with the `style` prop, which wins. */
|
|
35
|
+
function withVariables(variables, style) {
|
|
36
|
+
const merged = Object.assign({}, ...variables);
|
|
37
|
+
return Object.keys(merged).length > 0 ? {
|
|
38
|
+
...merged,
|
|
39
|
+
...style
|
|
40
|
+
} : style;
|
|
41
|
+
}
|
|
42
|
+
/** The CSS value of a justification. */
|
|
43
|
+
function justification(value) {
|
|
44
|
+
return value === "between" ? "space-between" : value;
|
|
45
|
+
}
|
|
46
|
+
//#endregion
|
|
47
|
+
export { BREAKPOINTS, justification, responsiveVariables, space, withVariables };
|
|
48
|
+
|
|
49
|
+
//# sourceMappingURL=responsive.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"responsive.js","names":[],"sources":["../../src/layout/responsive.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\n/**\n * Breakpoints of the layout primitives, like Bootstrap's `$grid-breakpoints`: the minimum width of\n * the nearest container at which a responsive value applies. They are constants, since CSS\n * variables can't be used in queries; the stylesheets of the primitives use the same values.\n */\nexport const BREAKPOINTS = Object.freeze({\n sm: '40rem',\n md: '48rem',\n lg: '64rem',\n xl: '80rem',\n});\n\n/** A breakpoint: `sm`, `md`, `lg` or `xl`. */\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * A value, or values by breakpoint: `{ base: 1, md: 2, lg: 3 }`. Each value applies from its\n * breakpoint up, until a larger one sets another. Breakpoints are widths of the nearest container\n * (`PanneauRoot`, `Container`, a form, a list), not of the viewport, so that a grid in a narrow\n * sidebar behaves as on a phone.\n */\nexport type Responsive<T> = T | Partial<Record<'base' | Breakpoint, T>>;\n\n/** A step of the space scale of the theme (`--panneau-space-<step>`), or 0. */\nexport type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10;\n\n/** The CSS value of a step of the space scale. */\nexport function space(step: Space): string {\n return step === 0 ? '0' : `var(--panneau-space-${step})`;\n}\n\nconst KEYS = ['base', ...(Object.keys(BREAKPOINTS) as Breakpoint[])] as const;\n\nfunction isByBreakpoint<T>(value: Responsive<T>): value is Partial<Record<'base' | Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * The inline variables of a responsive prop, `--_panneau-<component>-<prop>-<breakpoint>`, which\n * the static rules of the component read in each container query. Unset breakpoints fall back to\n * smaller ones in CSS.\n */\nexport function responsiveVariables<T>(\n component: string,\n prop: string,\n value: Responsive<T> | undefined,\n toCss: (value: T) => string,\n): Record<string, string> {\n if (value === undefined) {\n return {};\n }\n const values: Partial<Record<'base' | Breakpoint, T>> = isByBreakpoint(value)\n ? value\n : { base: value };\n return Object.fromEntries(\n KEYS.flatMap((key) => {\n const item = values[key];\n return item !== undefined\n ? [[`--_panneau-${component}-${prop}-${key}`, toCss(item)]]\n : [];\n }),\n );\n}\n\n/** Merges inline variables with the `style` prop, which wins. */\nexport function withVariables(\n variables: Record<string, string>[],\n style: CSSProperties | undefined,\n): CSSProperties | undefined {\n const merged = Object.assign({}, ...variables) as Record<string, string>;\n return Object.keys(merged).length > 0 ? { ...merged, ...style } : style;\n}\n\n/** How the primitives distribute items along their axis: `between` is `space-between`. */\nexport type Justification = 'start' | 'center' | 'end' | 'between';\n\n/** The CSS value of a justification. */\nexport function justification(value: Justification): string {\n return value === 'between' ? 'space-between' : value;\n}\n"],"mappings":";;;;;;AAOA,IAAa,cAAc,OAAO,OAAO;CACrC,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;AACR,CAAC;;AAiBD,SAAgB,MAAM,MAAqB;CACvC,OAAO,SAAS,IAAI,MAAM,uBAAuB,KAAI;AACzD;AAEA,IAAM,OAAO,CAAC,QAAQ,GAAI,OAAO,KAAK,WAAW,CAAkB;AAEnE,SAAS,eAAkB,OAAwE;CAC/F,OAAO,OAAO,UAAU,YAAY,UAAU;AAClD;;;;;;AAOA,SAAgB,oBACZ,WACA,MACA,OACA,OACsB;CACtB,IAAI,UAAU,KAAA,GACV,OAAO,CAAC;CAEZ,MAAM,SAAkD,eAAe,KAAK,IACtE,QACA,EAAE,MAAM,MAAM;CACpB,OAAO,OAAO,YACV,KAAK,SAAS,QAAQ;EAClB,MAAM,OAAO,OAAO;EACpB,OAAO,SAAS,KAAA,IACV,CAAC,CAAC,cAAc,UAAS,GAAI,KAAI,GAAI,OAAO,MAAM,IAAI,CAAC,CAAC,IACxD,CAAA;CACV,CAAC,CACL;AACJ;;AAGA,SAAgB,cACZ,WACA,OACyB;CACzB,MAAM,SAAS,OAAO,OAAO,CAAC,GAAG,GAAG,SAAS;CAC7C,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC,SAAS,IAAI;EAAE,GAAG;EAAQ,GAAG;CAAM,IAAI;AACtE;;AAMA,SAAgB,cAAc,OAA8B;CACxD,OAAO,UAAU,YAAY,kBAAkB;AACnD"}
|
package/dist/menu/Menu.js
CHANGED
|
@@ -16,7 +16,7 @@ function Menu$1({ className, popoverClassName, placement = "bottom start", ...pr
|
|
|
16
16
|
className: popoverClassName,
|
|
17
17
|
children: /* @__PURE__ */ jsx(Menu, {
|
|
18
18
|
...props,
|
|
19
|
-
className: cx(ListBox_module_default.listBox, className)
|
|
19
|
+
className: cx("panneau-menu", ListBox_module_default.listBox, className)
|
|
20
20
|
})
|
|
21
21
|
});
|
|
22
22
|
}
|
|
@@ -25,7 +25,7 @@ function MenuItem$1({ children, icon, description, isDanger = false, className,
|
|
|
25
25
|
return /* @__PURE__ */ jsxs(MenuItem, {
|
|
26
26
|
...props,
|
|
27
27
|
textValue: textValue ?? (typeof children === "string" ? children : void 0),
|
|
28
|
-
className: cx(ListBox_module_default.item, className),
|
|
28
|
+
className: cx("panneau-menu-item", ListBox_module_default.item, className),
|
|
29
29
|
"data-danger": isDanger || void 0,
|
|
30
30
|
children: [icon !== void 0 ? /* @__PURE__ */ jsx(Icon, { icon }) : null, /* @__PURE__ */ jsxs("span", {
|
|
31
31
|
className: ListBox_module_default.itemText,
|
package/dist/menu/Menu.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Menu.js","names":["Menu","AriaMenu","styles","MenuItem","AriaMenuItem","_c"],"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n type MenuItemProps as AriaMenuItemProps,\n type MenuProps as AriaMenuProps,\n Separator,\n Text,\n} from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { PopoverSurface } from '../popover/Popover';\nimport styles from '../select/ListBox.module.css';\nimport { cx } from '../utils/cx';\n\nexport interface MenuProps<T extends object> extends Omit<AriaMenuProps<T>, 'className' | 'style'> {\n className?: string;\n popoverClassName?: string;\n placement?: 'bottom start' | 'bottom end' | 'top start' | 'top end';\n}\n\n/**\n * A menu of actions, inside a `MenuTrigger` with its button as the first child. Arrow keys move\n * between items, and typing a letter jumps to an item.\n */\nexport function Menu<T extends object>({\n className,\n popoverClassName,\n placement = 'bottom start',\n ...props\n}: MenuProps<T>) {\n return (\n <PopoverSurface placement={placement} className={popoverClassName}>\n <AriaMenu {...props} className={cx(styles.listBox, className)} />\n </PopoverSurface>\n );\n}\n\nexport interface MenuItemProps extends Omit<AriaMenuItemProps, 'className' | 'style' | 'children'> {\n children?: ReactNode;\n icon?: IconComponent;\n description?: string;\n /** Styles the item as destructive. */\n isDanger?: boolean;\n className?: string;\n}\n\n/** An item of a `Menu`. */\nexport function MenuItem({\n children,\n icon,\n description,\n isDanger = false,\n className,\n textValue,\n ...props\n}: MenuItemProps) {\n return (\n <AriaMenuItem\n {...props}\n textValue={textValue ?? (typeof children === 'string' ? children : undefined)}\n className={cx(styles.item, className)}\n data-danger={isDanger || undefined}\n >\n {icon !== undefined ? <Icon icon={icon} /> : null}\n <span className={styles.itemText}>\n <Text slot=\"label\" className={styles.itemLabel}>\n {children}\n </Text>\n {description !== undefined ? (\n <Text slot=\"description\" className={styles.itemDescription}>\n {description}\n </Text>\n ) : null}\n </span>\n </AriaMenuItem>\n );\n}\n\n/** A line between groups of menu items. */\nexport function MenuSeparator() {\n return <Separator className={styles.separator} />;\n}\n\nexport { MenuTrigger } from 'react-aria-components';\n"],"mappings":";;;;;;;;;;;;AAyBA,SAAgBA,OAAuB,EACnC,WACA,kBACA,YAAY,gBACZ,GAAG,SACU;CACb,OACI,oBAAC,gBAAD;EAA2B;EAAW,WAAW;EAC7C,UAAA,oBAACC,MAAD;GAAU,GAAI;GAAO,WAAW,
|
|
1
|
+
{"version":3,"file":"Menu.js","names":["Menu","AriaMenu","styles","MenuItem","AriaMenuItem","_c"],"sources":["../../src/menu/Menu.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport {\n Menu as AriaMenu,\n MenuItem as AriaMenuItem,\n type MenuItemProps as AriaMenuItemProps,\n type MenuProps as AriaMenuProps,\n Separator,\n Text,\n} from 'react-aria-components';\n\nimport { Icon, type IconComponent } from '../icon/Icon';\nimport { PopoverSurface } from '../popover/Popover';\nimport styles from '../select/ListBox.module.css';\nimport { cx } from '../utils/cx';\n\nexport interface MenuProps<T extends object> extends Omit<AriaMenuProps<T>, 'className' | 'style'> {\n className?: string;\n popoverClassName?: string;\n placement?: 'bottom start' | 'bottom end' | 'top start' | 'top end';\n}\n\n/**\n * A menu of actions, inside a `MenuTrigger` with its button as the first child. Arrow keys move\n * between items, and typing a letter jumps to an item.\n */\nexport function Menu<T extends object>({\n className,\n popoverClassName,\n placement = 'bottom start',\n ...props\n}: MenuProps<T>) {\n return (\n <PopoverSurface placement={placement} className={popoverClassName}>\n <AriaMenu {...props} className={cx('panneau-menu', styles.listBox, className)} />\n </PopoverSurface>\n );\n}\n\nexport interface MenuItemProps extends Omit<AriaMenuItemProps, 'className' | 'style' | 'children'> {\n children?: ReactNode;\n icon?: IconComponent;\n description?: string;\n /** Styles the item as destructive. */\n isDanger?: boolean;\n className?: string;\n}\n\n/** An item of a `Menu`. */\nexport function MenuItem({\n children,\n icon,\n description,\n isDanger = false,\n className,\n textValue,\n ...props\n}: MenuItemProps) {\n return (\n <AriaMenuItem\n {...props}\n textValue={textValue ?? (typeof children === 'string' ? children : undefined)}\n className={cx('panneau-menu-item', styles.item, className)}\n data-danger={isDanger || undefined}\n >\n {icon !== undefined ? <Icon icon={icon} /> : null}\n <span className={styles.itemText}>\n <Text slot=\"label\" className={styles.itemLabel}>\n {children}\n </Text>\n {description !== undefined ? (\n <Text slot=\"description\" className={styles.itemDescription}>\n {description}\n </Text>\n ) : null}\n </span>\n </AriaMenuItem>\n );\n}\n\n/** A line between groups of menu items. */\nexport function MenuSeparator() {\n return <Separator className={styles.separator} />;\n}\n\nexport { MenuTrigger } from 'react-aria-components';\n"],"mappings":";;;;;;;;;;;;AAyBA,SAAgBA,OAAuB,EACnC,WACA,kBACA,YAAY,gBACZ,GAAG,SACU;CACb,OACI,oBAAC,gBAAD;EAA2B;EAAW,WAAW;EAC7C,UAAA,oBAACC,MAAD;GAAU,GAAI;GAAO,WAAW,GAAG,gBAAgBC,uBAAO,SAAS,SAAS;EAAE,CAAA;CAClE,CAAA;AAExB;;AAYA,SAAgBC,WAAS,EACrB,UACA,MACA,aACA,WAAW,OACX,WACA,WACA,GAAG,SACW;CACd,OACI,qBAACC,UAAD;EACI,GAAI;EACJ,WAAW,cAAc,OAAO,aAAa,WAAW,WAAW,KAAA;EACnE,WAAW,GAAG,qBAAqBF,uBAAO,MAAM,SAAS;EACzD,eAAa,YAAY,KAAA;EAJ7B,UAAA,CAMK,SAAS,KAAA,IAAY,oBAAC,MAAD,EAAY,KAAK,CAAA,IAAM,MAC7C,qBAAC,QAAD;GAAM,WAAWA,uBAAO;GAAxB,UAAA,CACI,oBAAC,MAAD;IAAM,MAAK;IAAQ,WAAWA,uBAAO;IAChC;GACC,CAAA,GACL,gBAAgB,KAAA,IACb,oBAAC,MAAD;IAAM,MAAK;IAAc,WAAWA,uBAAO;IACtC,UAAA;GACC,CAAA,IACN,IACF;EACI,CAAA,CAAA;;AAEtB;;AAGA,SAAO,gBAAA;CAAA,MAAA,IAAAG,EAAA,CAAA;CAAA,IAAA;CAAA,IAAA,EAAA,OAAA,OAAA,IAAA,2BAAA,GAAA;EACI,KAAA,oBAAC,WAAD,EAAsB,WAAAH,uBAAM,UAAU,CAAA;EAAI,EAAA,KAAA;CAAA,OAAA,KAAA,EAAA;CAAA,OAA1C;AAA0C"}
|