@panneau/ui 5.0.0-alpha.0 → 5.0.0-alpha.10
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 +380 -7
- package/bin/check-theme.js +5 -0
- package/dist/alert/Alert.css +28 -42
- package/dist/alert/Alert.d.ts +19 -5
- package/dist/alert/Alert.d.ts.map +1 -1
- package/dist/alert/Alert.js +110 -41
- 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 +35 -6
- 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 +32 -5
- package/dist/button/Button.d.ts.map +1 -1
- package/dist/button/Button.js +136 -17
- 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 +76 -23
- 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 +1 -1
- package/dist/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/checkbox/Checkbox.js +87 -25
- package/dist/checkbox/Checkbox.js.map +1 -1
- package/dist/checkbox/Checkbox.module.js +6 -6
- 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 +82 -21
- 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.d.ts +1 -1
- package/dist/combo-box/ComboBox.js +291 -79
- package/dist/combo-box/ComboBox.js.map +1 -1
- package/dist/combo-box/ComboBox.module.js +3 -3
- package/dist/command-palette/CommandPalette.css +299 -0
- package/dist/command-palette/CommandPalette.d.ts +37 -0
- package/dist/command-palette/CommandPalette.d.ts.map +1 -0
- package/dist/command-palette/CommandPalette.js +497 -0
- package/dist/command-palette/CommandPalette.js.map +1 -0
- package/dist/command-palette/CommandPalette.module.js +62 -0
- package/dist/command-palette/CommandPalette.module.js.map +1 -0
- package/dist/command-palette/match.d.ts +39 -0
- package/dist/command-palette/match.d.ts.map +1 -0
- package/dist/command-palette/match.js +44 -0
- package/dist/command-palette/match.js.map +1 -0
- package/dist/command-palette/tokens.d.ts +3 -0
- package/dist/command-palette/tokens.d.ts.map +1 -0
- package/dist/command-palette/tokens.js +23 -0
- package/dist/command-palette/tokens.js.map +1 -0
- package/dist/command-palette/useCommandShortcut.d.ts +12 -0
- package/dist/command-palette/useCommandShortcut.d.ts.map +1 -0
- package/dist/command-palette/useCommandShortcut.js +48 -0
- package/dist/command-palette/useCommandShortcut.js.map +1 -0
- 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 +61 -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 +70 -30
- package/dist/date-picker/DatePicker.d.ts +3 -2
- package/dist/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/date-picker/DatePicker.js +279 -72
- package/dist/date-picker/DatePicker.js.map +1 -1
- package/dist/date-picker/DatePicker.module.js +16 -12
- 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 +80 -37
- package/dist/dialog/Dialog.d.ts +15 -3
- package/dist/dialog/Dialog.d.ts.map +1 -1
- package/dist/dialog/Dialog.js +159 -30
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/Dialog.module.js +21 -13
- 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 +31 -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 +132 -28
- 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 +65 -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 +49 -37
- package/dist/field/Field.module.js +11 -11
- package/dist/field/Field.module.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 +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 +140 -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 +52 -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 +36 -11
- package/dist/icon/Icon.js.map +1 -1
- package/dist/icon/Icon.module.js +1 -1
- package/dist/icon/lucideIconLoader.d.ts +9 -0
- package/dist/icon/lucideIconLoader.d.ts.map +1 -0
- package/dist/icon/lucideIconLoader.js +22 -0
- package/dist/icon/lucideIconLoader.js.map +1 -0
- package/dist/icon/namedIcons.d.ts +23 -0
- package/dist/icon/namedIcons.d.ts.map +1 -0
- package/dist/icon/namedIcons.js +165 -0
- package/dist/icon/namedIcons.js.map +1 -0
- package/dist/icon-button/IconButton.css +2 -2
- package/dist/icon-button/IconButton.d.ts +3 -3
- package/dist/icon-button/IconButton.d.ts.map +1 -1
- package/dist/icon-button/IconButton.js +70 -13
- package/dist/icon-button/IconButton.js.map +1 -1
- package/dist/icon-button/IconButton.module.js +2 -2
- package/dist/index.d.ts +61 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -4
- 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 +79 -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/intl/usePanneauIntl.js.map +1 -1
- 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/locales/index.js.map +1 -1
- package/dist/menu/Menu.css +84 -0
- package/dist/menu/Menu.d.ts +34 -7
- package/dist/menu/Menu.d.ts.map +1 -1
- package/dist/menu/Menu.js +243 -32
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/Menu.module.js +22 -0
- package/dist/menu/Menu.module.js.map +1 -0
- package/dist/menu/tokens.d.ts +3 -0
- package/dist/menu/tokens.d.ts.map +1 -0
- package/dist/menu/tokens.js +31 -0
- package/dist/menu/tokens.js.map +1 -0
- package/dist/named-icons/index.d.ts +2 -0
- package/dist/named-icons/index.d.ts.map +1 -0
- package/dist/named-icons/index.js +1 -0
- package/dist/number-input/NumberInput.css +30 -12
- 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/NumberInput.module.js +7 -5
- 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/pill-trigger/PillTrigger.css +104 -0
- package/dist/pill-trigger/PillTrigger.d.ts +20 -0
- package/dist/pill-trigger/PillTrigger.d.ts.map +1 -0
- package/dist/pill-trigger/PillTrigger.js +94 -0
- package/dist/pill-trigger/PillTrigger.js.map +1 -0
- package/dist/pill-trigger/PillTrigger.module.js +18 -0
- package/dist/pill-trigger/PillTrigger.module.js.map +1 -0
- package/dist/pill-trigger/tokens.d.ts +3 -0
- package/dist/pill-trigger/tokens.d.ts.map +1 -0
- package/dist/pill-trigger/tokens.js +37 -0
- package/dist/pill-trigger/tokens.js.map +1 -0
- package/dist/popover/Popover.css +18 -12
- package/dist/popover/Popover.d.ts.map +1 -1
- package/dist/popover/Popover.js +116 -20
- package/dist/popover/Popover.js.map +1 -1
- package/dist/popover/Popover.module.js +7 -5
- 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 +49 -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 +111 -20
- package/dist/radio-group/RadioGroup.d.ts +24 -5
- package/dist/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/radio-group/RadioGroup.js +214 -43
- package/dist/radio-group/RadioGroup.js.map +1 -1
- package/dist/radio-group/RadioGroup.module.js +18 -8
- 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 +39 -0
- package/dist/radio-group/tokens.js.map +1 -0
- package/dist/root/PanneauRoot.css +243 -20
- package/dist/root/PanneauRoot.d.ts +57 -4
- package/dist/root/PanneauRoot.d.ts.map +1 -1
- package/dist/root/PanneauRoot.js +325 -46
- 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 +132 -0
- package/dist/root/ThemeScope.js.map +1 -0
- package/dist/segmented-control/SegmentedControl.css +83 -0
- package/dist/segmented-control/SegmentedControl.d.ts +35 -0
- package/dist/segmented-control/SegmentedControl.d.ts.map +1 -0
- package/dist/segmented-control/SegmentedControl.js +142 -0
- package/dist/segmented-control/SegmentedControl.js.map +1 -0
- package/dist/segmented-control/SegmentedControl.module.js +16 -0
- package/dist/segmented-control/SegmentedControl.module.js.map +1 -0
- package/dist/segmented-control/tokens.d.ts +3 -0
- package/dist/segmented-control/tokens.d.ts.map +1 -0
- package/dist/segmented-control/tokens.js +29 -0
- package/dist/segmented-control/tokens.js.map +1 -0
- package/dist/select/ListBox.css +46 -23
- package/dist/select/ListBox.module.js +13 -13
- package/dist/select/ListBox.module.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 +3 -0
- package/dist/select/listBoxTokens.d.ts.map +1 -0
- package/dist/select/listBoxTokens.js +21 -0
- package/dist/select/listBoxTokens.js.map +1 -0
- 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.css +84 -0
- package/dist/slider/Slider.d.ts +20 -0
- package/dist/slider/Slider.d.ts.map +1 -0
- package/dist/slider/Slider.js +248 -0
- package/dist/slider/Slider.js.map +1 -0
- package/dist/slider/Slider.module.js +20 -0
- package/dist/slider/Slider.module.js.map +1 -0
- package/dist/spinner/Spinner.css +8 -8
- package/dist/spinner/Spinner.js +49 -9
- 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 +74 -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 +1 -1
- package/dist/switch/Switch.d.ts.map +1 -1
- package/dist/switch/Switch.js +69 -11
- package/dist/switch/Switch.js.map +1 -1
- package/dist/switch/Switch.module.js +6 -5
- 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 +5 -5
- 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/tags-input/TagsInput.css +60 -0
- package/dist/tags-input/TagsInput.d.ts +32 -0
- package/dist/tags-input/TagsInput.d.ts.map +1 -0
- package/dist/tags-input/TagsInput.js +316 -0
- package/dist/tags-input/TagsInput.js.map +1 -0
- package/dist/tags-input/TagsInput.module.js +20 -0
- package/dist/tags-input/TagsInput.module.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 +81 -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.d.ts +1 -1
- package/dist/text-area/TextArea.js +135 -28
- package/dist/text-area/TextArea.js.map +1 -1
- package/dist/text-area/TextArea.module.js +3 -3
- package/dist/text-area/TextArea.module.js.map +1 -1
- package/dist/text-input/TextInput.d.ts +1 -1
- package/dist/text-input/TextInput.d.ts.map +1 -1
- package/dist/text-input/TextInput.js +164 -47
- 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 +11 -1
- 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 +43 -0
- package/dist/theme/components.d.ts.map +1 -0
- package/dist/theme/components.js +75 -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.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.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 +5 -4
- 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 +38 -8
- 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/dist/utils/events.d.ts +4 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/dist/utils/events.js +9 -0
- package/dist/utils/events.js.map +1 -0
- package/package.json +22 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/heading/tokens.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,eAAO,MAAM,aAAa,ggCAuDxB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { defineComponentTokens } from "../theme/componentTokens.js";
|
|
2
|
+
//#region src/heading/tokens.ts
|
|
3
|
+
/**
|
|
4
|
+
* Tokens of Heading, like Bootstrap's `$headings-*` and `$display-font-sizes`. `Prose` applies
|
|
5
|
+
* them to the headings of rich content too.
|
|
6
|
+
*/
|
|
7
|
+
var headingTokens = defineComponentTokens("heading", {
|
|
8
|
+
/** Font family of sizes 1 to 4. */
|
|
9
|
+
"font-family": "var(--panneau-font-family-heading)",
|
|
10
|
+
/** Font family of the display sizes. */
|
|
11
|
+
"display-font-family": "var(--panneau-font-family-display)",
|
|
12
|
+
/** Text color. */
|
|
13
|
+
color: "inherit",
|
|
14
|
+
/** Font size of the level 1. */
|
|
15
|
+
"1-font-size": "1.75rem",
|
|
16
|
+
/** Font weight of the level 1. */
|
|
17
|
+
"1-font-weight": "var(--panneau-font-weight-bold)",
|
|
18
|
+
/** Line height of the level 1. */
|
|
19
|
+
"1-line-height": "var(--panneau-line-height-tight)",
|
|
20
|
+
/** Letter spacing of the level 1. */
|
|
21
|
+
"1-letter-spacing": "-0.015em",
|
|
22
|
+
/** Font size of the level 2. */
|
|
23
|
+
"2-font-size": "1.375rem",
|
|
24
|
+
/** Font weight of the level 2. */
|
|
25
|
+
"2-font-weight": "var(--panneau-font-weight-bold)",
|
|
26
|
+
/** Line height of the level 2. */
|
|
27
|
+
"2-line-height": "var(--panneau-line-height-tight)",
|
|
28
|
+
/** Letter spacing of the level 2. */
|
|
29
|
+
"2-letter-spacing": "-0.01em",
|
|
30
|
+
/** Font size of the level 3. */
|
|
31
|
+
"3-font-size": "1.125rem",
|
|
32
|
+
/** Font weight of the level 3. */
|
|
33
|
+
"3-font-weight": "var(--panneau-font-weight-bold)",
|
|
34
|
+
/** Line height of the level 3. */
|
|
35
|
+
"3-line-height": "var(--panneau-line-height-tight)",
|
|
36
|
+
/** Letter spacing of the level 3. */
|
|
37
|
+
"3-letter-spacing": "normal",
|
|
38
|
+
/** Font size of the level 4 (and 5, 6). */
|
|
39
|
+
"4-font-size": "var(--panneau-font-size-lg)",
|
|
40
|
+
/** Font weight of the level 4 (and 5, 6). */
|
|
41
|
+
"4-font-weight": "var(--panneau-font-weight-bold)",
|
|
42
|
+
/** Line height of the level 4 (and 5, 6). */
|
|
43
|
+
"4-line-height": "var(--panneau-line-height-tight)",
|
|
44
|
+
/** Letter spacing of the level 4 (and 5, 6). */
|
|
45
|
+
"4-letter-spacing": "normal",
|
|
46
|
+
/** Font size of the display size 1. */
|
|
47
|
+
"display-1-font-size": "3rem",
|
|
48
|
+
/** Font weight of the display size 1. */
|
|
49
|
+
"display-1-font-weight": "var(--panneau-font-weight-bold)",
|
|
50
|
+
/** Line height of the display size 1. */
|
|
51
|
+
"display-1-line-height": "1.1",
|
|
52
|
+
/** Letter spacing of the display size 1. */
|
|
53
|
+
"display-1-letter-spacing": "-0.025em",
|
|
54
|
+
/** Font size of the display size 2. */
|
|
55
|
+
"display-2-font-size": "2.25rem",
|
|
56
|
+
/** Font weight of the display size 2. */
|
|
57
|
+
"display-2-font-weight": "var(--panneau-font-weight-bold)",
|
|
58
|
+
/** Line height of the display size 2. */
|
|
59
|
+
"display-2-line-height": "1.15",
|
|
60
|
+
/** Letter spacing of the display size 2. */
|
|
61
|
+
"display-2-letter-spacing": "-0.02em"
|
|
62
|
+
});
|
|
63
|
+
//#endregion
|
|
64
|
+
export { headingTokens };
|
|
65
|
+
|
|
66
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","headingTokens","color"],"sources":["../../src/heading/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/**\n * Tokens of Heading, like Bootstrap's `$headings-*` and `$display-font-sizes`. `Prose` applies\n * them to the headings of rich content too.\n */\nexport const headingTokens = defineComponentTokens('heading', {\n /** Font family of sizes 1 to 4. */\n 'font-family': 'var(--panneau-font-family-heading)',\n /** Font family of the display sizes. */\n 'display-font-family': 'var(--panneau-font-family-display)',\n /** Text color. */\n color: 'inherit',\n /** Font size of the level 1. */\n '1-font-size': '1.75rem',\n /** Font weight of the level 1. */\n '1-font-weight': 'var(--panneau-font-weight-bold)',\n /** Line height of the level 1. */\n '1-line-height': 'var(--panneau-line-height-tight)',\n /** Letter spacing of the level 1. */\n '1-letter-spacing': '-0.015em',\n /** Font size of the level 2. */\n '2-font-size': '1.375rem',\n /** Font weight of the level 2. */\n '2-font-weight': 'var(--panneau-font-weight-bold)',\n /** Line height of the level 2. */\n '2-line-height': 'var(--panneau-line-height-tight)',\n /** Letter spacing of the level 2. */\n '2-letter-spacing': '-0.01em',\n /** Font size of the level 3. */\n '3-font-size': '1.125rem',\n /** Font weight of the level 3. */\n '3-font-weight': 'var(--panneau-font-weight-bold)',\n /** Line height of the level 3. */\n '3-line-height': 'var(--panneau-line-height-tight)',\n /** Letter spacing of the level 3. */\n '3-letter-spacing': 'normal',\n /** Font size of the level 4 (and 5, 6). */\n '4-font-size': 'var(--panneau-font-size-lg)',\n /** Font weight of the level 4 (and 5, 6). */\n '4-font-weight': 'var(--panneau-font-weight-bold)',\n /** Line height of the level 4 (and 5, 6). */\n '4-line-height': 'var(--panneau-line-height-tight)',\n /** Letter spacing of the level 4 (and 5, 6). */\n '4-letter-spacing': 'normal',\n /** Font size of the display size 1. */\n 'display-1-font-size': '3rem',\n /** Font weight of the display size 1. */\n 'display-1-font-weight': 'var(--panneau-font-weight-bold)',\n /** Line height of the display size 1. */\n 'display-1-line-height': '1.1',\n /** Letter spacing of the display size 1. */\n 'display-1-letter-spacing': '-0.025em',\n /** Font size of the display size 2. */\n 'display-2-font-size': '2.25rem',\n /** Font weight of the display size 2. */\n 'display-2-font-weight': 'var(--panneau-font-weight-bold)',\n /** Line height of the display size 2. */\n 'display-2-line-height': '1.15',\n /** Letter spacing of the display size 2. */\n 'display-2-letter-spacing': '-0.02em',\n});\n"],"mappings":";;;;;;AAMA,IAAaC,gBAAgBD,sBAAsB,WAAW;;CAE1D,eAAe;;CAEf,uBAAuB;;CAEvBE,OAAO;;CAEP,eAAe;;CAEf,iBAAiB;;CAEjB,iBAAiB;;CAEjB,oBAAoB;;CAEpB,eAAe;;CAEf,iBAAiB;;CAEjB,iBAAiB;;CAEjB,oBAAoB;;CAEpB,eAAe;;CAEf,iBAAiB;;CAEjB,iBAAiB;;CAEjB,oBAAoB;;CAEpB,eAAe;;CAEf,iBAAiB;;CAEjB,iBAAiB;;CAEjB,oBAAoB;;CAEpB,uBAAuB;;CAEvB,yBAAyB;;CAEzB,yBAAyB;;CAEzB,4BAA4B;;CAE5B,uBAAuB;;CAEvB,yBAAyB;;CAEzB,yBAAyB;;CAEzB,4BAA4B;AAChC,CAAC"}
|
package/dist/icon/Icon.css
CHANGED
package/dist/icon/Icon.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import Icon_module_default from "./Icon.module.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/icon/Icon.tsx
|
|
5
6
|
var SIZES = {
|
|
@@ -10,18 +11,42 @@ var SIZES = {
|
|
|
10
11
|
xl: 24
|
|
11
12
|
};
|
|
12
13
|
/** Renders an icon of the icon set (Lucide) at a size of the scale, decorative by default. */
|
|
13
|
-
function Icon(
|
|
14
|
+
function Icon(t0) {
|
|
15
|
+
const $ = c(10);
|
|
16
|
+
const { icon: Component, size: t1, label, className } = t0;
|
|
17
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
14
18
|
const pixels = typeof size === "number" ? size : SIZES[size];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
const t2 = pixels < 16;
|
|
20
|
+
let t3;
|
|
21
|
+
if ($[0] !== className) {
|
|
22
|
+
t3 = cx("panneau-icon", Icon_module_default.icon, className);
|
|
23
|
+
$[0] = className;
|
|
24
|
+
$[1] = t3;
|
|
25
|
+
} else t3 = $[1];
|
|
26
|
+
const t4 = label === void 0 ? "true" : void 0;
|
|
27
|
+
const t5 = label !== void 0 ? "img" : void 0;
|
|
28
|
+
let t6;
|
|
29
|
+
if ($[2] !== Component || $[3] !== label || $[4] !== pixels || $[5] !== t2 || $[6] !== t3 || $[7] !== t4 || $[8] !== t5) {
|
|
30
|
+
t6 = /* @__PURE__ */ jsx(Component, {
|
|
31
|
+
size: pixels,
|
|
32
|
+
strokeWidth: 2,
|
|
33
|
+
absoluteStrokeWidth: t2,
|
|
34
|
+
className: t3,
|
|
35
|
+
"aria-hidden": t4,
|
|
36
|
+
"aria-label": label,
|
|
37
|
+
role: t5,
|
|
38
|
+
focusable: "false"
|
|
39
|
+
});
|
|
40
|
+
$[2] = Component;
|
|
41
|
+
$[3] = label;
|
|
42
|
+
$[4] = pixels;
|
|
43
|
+
$[5] = t2;
|
|
44
|
+
$[6] = t3;
|
|
45
|
+
$[7] = t4;
|
|
46
|
+
$[8] = t5;
|
|
47
|
+
$[9] = t6;
|
|
48
|
+
} else t6 = $[9];
|
|
49
|
+
return t6;
|
|
25
50
|
}
|
|
26
51
|
//#endregion
|
|
27
52
|
export { Icon };
|
package/dist/icon/Icon.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.js","names":["styles"],"sources":["../../src/icon/Icon.tsx"],"sourcesContent":["import type { ComponentType } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Icon.module.css';\n\n/**\n * An icon component: any Lucide icon (`import { Pencil } from 'lucide-react'`), or a component\n * with the same props.\n */\nexport type IconComponent = ComponentType<{\n size?: number | string;\n strokeWidth?: number | string;\n absoluteStrokeWidth?: boolean;\n className?: string;\n 'aria-hidden'?: boolean | 'true' | 'false';\n 'aria-label'?: string;\n role?: string;\n focusable?: boolean | 'true' | 'false';\n}>;\n\nexport type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nconst SIZES: Record<IconSize, number> = { xs: 12, sm: 14, md: 16, lg: 20, xl: 24 };\n\nexport interface IconProps {\n /** The icon: a Lucide icon component. */\n icon: IconComponent;\n /** Defaults to `md` (16px). A number is in pixels. */\n size?: IconSize | number;\n /**\n * Accessible label. Icons without a label are decorative and hidden from assistive\n * technologies, which is right next to a text that says the same.\n */\n label?: string;\n className?: string;\n}\n\n/** Renders an icon of the icon set (Lucide) at a size of the scale, decorative by default. */\nexport function Icon({ icon: Component, size = 'md', label, className }: IconProps) {\n const pixels = typeof size === 'number' ? size : SIZES[size];\n return (\n <Component\n size={pixels}\n strokeWidth={2}\n absoluteStrokeWidth={pixels < 16}\n className={cx(styles.icon, className)}\n aria-hidden={label === undefined ? 'true' : undefined}\n aria-label={label}\n role={label !== undefined ? 'img' : undefined}\n focusable=\"false\"\n />\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Icon.js","names":["ComponentType","cx","styles","IconComponent","size","strokeWidth","absoluteStrokeWidth","className","role","focusable","IconSize","SIZES","Record","xs","sm","md","lg","xl","IconProps","icon","label","Icon","t0","$","_c","Component","t1","undefined","pixels","t2","t3","t4","t5","t6","_c","styles"],"sources":["../../src/icon/Icon.tsx"],"sourcesContent":["import type { ComponentType } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Icon.module.css';\n\n/**\n * An icon component: any Lucide icon (`import { Pencil } from 'lucide-react'`), or a component\n * with the same props.\n */\nexport type IconComponent = ComponentType<{\n size?: number | string;\n strokeWidth?: number | string;\n absoluteStrokeWidth?: boolean;\n className?: string;\n 'aria-hidden'?: boolean | 'true' | 'false';\n 'aria-label'?: string;\n role?: string;\n focusable?: boolean | 'true' | 'false';\n}>;\n\nexport type IconSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';\n\nconst SIZES: Record<IconSize, number> = { xs: 12, sm: 14, md: 16, lg: 20, xl: 24 };\n\nexport interface IconProps {\n /** The icon: a Lucide icon component. */\n icon: IconComponent;\n /** Defaults to `md` (16px). A number is in pixels. */\n size?: IconSize | number;\n /**\n * Accessible label. Icons without a label are decorative and hidden from assistive\n * technologies, which is right next to a text that says the same.\n */\n label?: string;\n className?: string;\n}\n\n/** Renders an icon of the icon set (Lucide) at a size of the scale, decorative by default. */\nexport function Icon({ icon: Component, size = 'md', label, className }: IconProps) {\n const pixels = typeof size === 'number' ? size : SIZES[size];\n return (\n <Component\n size={pixels}\n strokeWidth={2}\n absoluteStrokeWidth={pixels < 16}\n className={cx('panneau-icon', styles.icon, className)}\n aria-hidden={label === undefined ? 'true' : undefined}\n aria-label={label}\n role={label !== undefined ? 'img' : undefined}\n focusable=\"false\"\n />\n );\n}\n"],"mappings":";;;;;AAsBA,IAAMW,QAAkC;CAAEE,IAAI;CAAIC,IAAI;CAAIC,IAAI;CAAIC,IAAI;CAAIC,IAAI;AAAG;;AAgBjF,SAAOI,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAc,MAAA,EAAAL,MAAAM,WAAArB,MAAAsB,IAAAN,OAAAb,cAAAe;CAAmB,MAAAlB,OAAAsB,OAAAC,KAAAA,IAAA,OAAAD;CACpC,MAAAE,SAAe,OAAOxB,SAAS,WAAhBA,OAAkCO,MAAMP;CAK1B,MAAAyB,KAAAD,SAAS;CAAE,IAAAE;CAAA,IAAAP,EAAA,OAAAhB,WAAA;EACrBuB,KAAA7B,GAAG,gBAAgBC,oBAAMiB,MAAOZ,SAAS;EAACgB,EAAA,KAAAhB;EAAAgB,EAAA,KAAAO;CAAA,OAAAA,KAAAP,EAAA;CACxC,MAAAQ,KAAAX,UAAUO,KAAAA,IAAV,SAAAA,KAAAA;CAEP,MAAAK,KAAAZ,UAAUO,KAAAA,IAAV,QAAAA,KAAAA;CAAuC,IAAAM;CAAA,IAAAV,EAAA,OAAAE,aAAAF,EAAA,OAAAH,SAAAG,EAAA,OAAAK,UAAAL,EAAA,OAAAM,MAAAN,EAAA,OAAAO,MAAAP,EAAA,OAAAQ,MAAAR,EAAA,OAAAS,IAAA;EAPjDC,KAAA,oBAAC,WAAD;GACUL,MAAAA;GACO,aAAA;GACQ,qBAAAC;GACV,WAAAC;GACE,eAAAC;GACDX,cAAAA;GACN,MAAAY;GACI,WAAA;EAAO,CAAA;EACnBT,EAAA,KAAAE;EAAAF,EAAA,KAAAH;EAAAG,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;EAAAT,EAAA,KAAAU;CAAA,OAAAA,KAAAV,EAAA;CAAA,OATFU;AASE"}
|
package/dist/icon/Icon.module.js
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { NamedIconLoader } from './namedIcons.js';
|
|
2
|
+
/**
|
|
3
|
+
* Loads any Lucide icon by its name (the names of lucide.dev/icons). Each icon is its own chunk,
|
|
4
|
+
* and so is the list of names, loaded the first time an icon is named. Bundlers emit a chunk per
|
|
5
|
+
* Lucide icon for it, so it lives in its own entry point: only apps that pass it to `PanneauRoot`
|
|
6
|
+
* pay for it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const lucideIconLoader: NamedIconLoader;
|
|
9
|
+
//# sourceMappingURL=lucideIconLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucideIconLoader.d.ts","sourceRoot":"","sources":["../../src/icon/lucideIconLoader.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAMpD;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,eAY9B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region src/icon/lucideIconLoader.ts
|
|
2
|
+
var imports = null;
|
|
3
|
+
/**
|
|
4
|
+
* Loads any Lucide icon by its name (the names of lucide.dev/icons). Each icon is its own chunk,
|
|
5
|
+
* and so is the list of names, loaded the first time an icon is named. Bundlers emit a chunk per
|
|
6
|
+
* Lucide icon for it, so it lives in its own entry point: only apps that pass it to `PanneauRoot`
|
|
7
|
+
* pay for it.
|
|
8
|
+
*/
|
|
9
|
+
var lucideIconLoader = (name) => {
|
|
10
|
+
imports ??= import("lucide-react/dynamicIconImports.mjs").then((module) => module.default, (error) => {
|
|
11
|
+
imports = null;
|
|
12
|
+
throw error;
|
|
13
|
+
});
|
|
14
|
+
return imports.then((all) => {
|
|
15
|
+
const load = Object.hasOwn(all, name) ? all[name] : void 0;
|
|
16
|
+
return load !== void 0 ? load().then((module) => module.default) : null;
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
//#endregion
|
|
20
|
+
export { lucideIconLoader };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=lucideIconLoader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lucideIconLoader.js","names":["IconComponent","NamedIconLoader","IconImports","Readonly","Record","Promise","default","imports","lucideIconLoader","name","then","module","error","all","load","Object","hasOwn","undefined"],"sources":["../../src/icon/lucideIconLoader.ts"],"sourcesContent":["import type { IconComponent } from './Icon';\nimport type { NamedIconLoader } from './namedIcons';\n\ntype IconImports = Readonly<Record<string, () => Promise<{ default: IconComponent }>>>;\n\nlet imports: Promise<IconImports> | null = null;\n\n/**\n * Loads any Lucide icon by its name (the names of lucide.dev/icons). Each icon is its own chunk,\n * and so is the list of names, loaded the first time an icon is named. Bundlers emit a chunk per\n * Lucide icon for it, so it lives in its own entry point: only apps that pass it to `PanneauRoot`\n * pay for it.\n */\nexport const lucideIconLoader: NamedIconLoader = (name) => {\n imports ??= import('lucide-react/dynamicIconImports.mjs').then(\n (module) => module.default as unknown as IconImports,\n (error: unknown) => {\n imports = null;\n throw error;\n },\n );\n return imports.then((all) => {\n const load = Object.hasOwn(all, name) ? all[name] : undefined;\n return load !== undefined ? load().then((module) => module.default) : null;\n });\n};\n"],"mappings":";AAKA,IAAIO,UAAuC;;;;;;;AAQ3C,IAAaC,oBAAqCC,SAAS;CACvDF,YAAY,OAAO,sCAAsC,CAACG,MACrDC,WAAWA,OAAOL,UAClBM,UAAmB;EAChBL,UAAU;EACV,MAAMK;CACV,CACJ;CACA,OAAOL,QAAQG,MAAMG,QAAQ;EACzB,MAAMC,OAAOC,OAAOC,OAAOH,KAAKJ,IAAI,IAAII,IAAIJ,QAAQQ,KAAAA;EACpD,OAAOH,SAASG,KAAAA,IAAYH,KAAK,CAAC,CAACJ,MAAMC,WAAWA,OAAOL,OAAO,IAAI;CAC1E,CAAC;AACL"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IconComponent } from './Icon.js';
|
|
2
|
+
/**
|
|
3
|
+
* Loads an icon component from its name, as definitions name icons (`"icon": "send"`), or
|
|
4
|
+
* resolves with `null` for a name it doesn't know. `lucideIconLoader` of `@panneau/ui/named-icons`
|
|
5
|
+
* loads any Lucide icon; an app can load only the icons its definitions use.
|
|
6
|
+
*/
|
|
7
|
+
export type NamedIconLoader = (name: string) => Promise<IconComponent | null>;
|
|
8
|
+
/** The loader of named icons, set by `PanneauRoot`'s `iconLoader`. */
|
|
9
|
+
export declare const NamedIconLoaderContext: import("react").Context<NamedIconLoader | null>;
|
|
10
|
+
/**
|
|
11
|
+
* Loads an icon by its name with a loader, once per loader and name, and resolves with its
|
|
12
|
+
* component, or with `null` for a name the loader doesn't know.
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadNamedIcon(name: string, loader: NamedIconLoader): Promise<IconComponent | null>;
|
|
15
|
+
/**
|
|
16
|
+
* An icon component for an icon name, as definitions name them (`"icon": "send"`). It goes
|
|
17
|
+
* wherever an icon component goes (`<Button icon={getNamedIcon('send')}>`), and is the same
|
|
18
|
+
* component for the same name. It loads the icon with the `iconLoader` of `PanneauRoot` the first
|
|
19
|
+
* time it renders, and renders an empty space of the same size until then, or without a loader. A
|
|
20
|
+
* name the loader doesn't know renders nothing.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getNamedIcon(name: string): IconComponent;
|
|
23
|
+
//# sourceMappingURL=namedIcons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namedIcons.d.ts","sourceRoot":"","sources":["../../src/icon/namedIcons.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC;AAU9E,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,iDAA8C,CAAC;AA2BlF;;;GAGG;AACH,wBAAgB,aAAa,CACzB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,eAAe,GACxB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CA2B/B;AAID;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,CAkDxD"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { createContext, use, useEffect, useSyncExternalStore } from "react";
|
|
4
|
+
//#region src/icon/namedIcons.tsx
|
|
5
|
+
/** Icons by name, for each loader. */
|
|
6
|
+
var caches = /* @__PURE__ */ new WeakMap();
|
|
7
|
+
var components = /* @__PURE__ */ new Map();
|
|
8
|
+
var listeners = /* @__PURE__ */ new Set();
|
|
9
|
+
/** The loader of named icons, set by `PanneauRoot`'s `iconLoader`. */
|
|
10
|
+
var NamedIconLoaderContext = createContext(null);
|
|
11
|
+
function cache(loader) {
|
|
12
|
+
let entries = caches.get(loader);
|
|
13
|
+
if (entries === void 0) {
|
|
14
|
+
entries = /* @__PURE__ */ new Map();
|
|
15
|
+
caches.set(loader, entries);
|
|
16
|
+
}
|
|
17
|
+
return entries;
|
|
18
|
+
}
|
|
19
|
+
function subscribe(listener) {
|
|
20
|
+
listeners.add(listener);
|
|
21
|
+
return () => {
|
|
22
|
+
listeners.delete(listener);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function setEntry(loader, name, entry) {
|
|
26
|
+
if (entry === void 0) cache(loader).delete(name);
|
|
27
|
+
else cache(loader).set(name, entry);
|
|
28
|
+
listeners.forEach((listener) => listener());
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Loads an icon by its name with a loader, once per loader and name, and resolves with its
|
|
32
|
+
* component, or with `null` for a name the loader doesn't know.
|
|
33
|
+
*/
|
|
34
|
+
function loadNamedIcon(name, loader) {
|
|
35
|
+
const entry = cache(loader).get(name);
|
|
36
|
+
if (entry?.status === "loaded") return Promise.resolve(entry.icon);
|
|
37
|
+
if (entry?.status === "missing") return Promise.resolve(null);
|
|
38
|
+
if (entry === void 0) setEntry(loader, name, { status: "loading" });
|
|
39
|
+
return loader(name).then((icon) => {
|
|
40
|
+
if (icon === null) {
|
|
41
|
+
console.warn(`[panneau] No icon named "${name}".`);
|
|
42
|
+
setEntry(loader, name, { status: "missing" });
|
|
43
|
+
} else setEntry(loader, name, {
|
|
44
|
+
status: "loaded",
|
|
45
|
+
icon
|
|
46
|
+
});
|
|
47
|
+
return icon;
|
|
48
|
+
}, (error) => {
|
|
49
|
+
setEntry(loader, name, void 0);
|
|
50
|
+
throw error;
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
var warnedWithoutLoader = false;
|
|
54
|
+
/**
|
|
55
|
+
* An icon component for an icon name, as definitions name them (`"icon": "send"`). It goes
|
|
56
|
+
* wherever an icon component goes (`<Button icon={getNamedIcon('send')}>`), and is the same
|
|
57
|
+
* component for the same name. It loads the icon with the `iconLoader` of `PanneauRoot` the first
|
|
58
|
+
* time it renders, and renders an empty space of the same size until then, or without a loader. A
|
|
59
|
+
* name the loader doesn't know renders nothing.
|
|
60
|
+
*/
|
|
61
|
+
function getNamedIcon(name) {
|
|
62
|
+
const existing = components.get(name);
|
|
63
|
+
if (existing !== void 0) return existing;
|
|
64
|
+
const NamedIcon = (t0) => {
|
|
65
|
+
const $ = c(21);
|
|
66
|
+
let className;
|
|
67
|
+
let props;
|
|
68
|
+
let t1;
|
|
69
|
+
if ($[0] !== t0) {
|
|
70
|
+
({size: t1, className, ...props} = t0);
|
|
71
|
+
$[0] = t0;
|
|
72
|
+
$[1] = className;
|
|
73
|
+
$[2] = props;
|
|
74
|
+
$[3] = t1;
|
|
75
|
+
} else {
|
|
76
|
+
className = $[1];
|
|
77
|
+
props = $[2];
|
|
78
|
+
t1 = $[3];
|
|
79
|
+
}
|
|
80
|
+
const size = t1 === void 0 ? 24 : t1;
|
|
81
|
+
const loader = use(NamedIconLoaderContext);
|
|
82
|
+
let t2;
|
|
83
|
+
let t3;
|
|
84
|
+
if ($[4] !== loader) {
|
|
85
|
+
t2 = () => loader !== null ? cache(loader).get(name) : void 0;
|
|
86
|
+
t3 = () => loader !== null ? cache(loader).get(name) : void 0;
|
|
87
|
+
$[4] = loader;
|
|
88
|
+
$[5] = t2;
|
|
89
|
+
$[6] = t3;
|
|
90
|
+
} else {
|
|
91
|
+
t2 = $[5];
|
|
92
|
+
t3 = $[6];
|
|
93
|
+
}
|
|
94
|
+
const entry = useSyncExternalStore(subscribe, t2, t3);
|
|
95
|
+
let t4;
|
|
96
|
+
let t5;
|
|
97
|
+
if ($[7] !== loader) {
|
|
98
|
+
t4 = () => {
|
|
99
|
+
if (loader === null) {
|
|
100
|
+
if (!warnedWithoutLoader) {
|
|
101
|
+
warnedWithoutLoader = true;
|
|
102
|
+
console.warn(`[panneau] The icon "${name}" is named, but PanneauRoot has no iconLoader: pass lucideIconLoader from @panneau/ui/named-icons.`);
|
|
103
|
+
}
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (cache(loader).get(name) === void 0) loadNamedIcon(name, loader).catch(_temp);
|
|
107
|
+
};
|
|
108
|
+
t5 = [loader];
|
|
109
|
+
$[7] = loader;
|
|
110
|
+
$[8] = t4;
|
|
111
|
+
$[9] = t5;
|
|
112
|
+
} else {
|
|
113
|
+
t4 = $[8];
|
|
114
|
+
t5 = $[9];
|
|
115
|
+
}
|
|
116
|
+
useEffect(t4, t5);
|
|
117
|
+
if (entry?.status === "loaded") {
|
|
118
|
+
const Loaded = entry.icon;
|
|
119
|
+
let t6;
|
|
120
|
+
if ($[10] !== Loaded || $[11] !== className || $[12] !== props || $[13] !== size) {
|
|
121
|
+
t6 = /* @__PURE__ */ jsx(Loaded, {
|
|
122
|
+
size,
|
|
123
|
+
className,
|
|
124
|
+
...props
|
|
125
|
+
});
|
|
126
|
+
$[10] = Loaded;
|
|
127
|
+
$[11] = className;
|
|
128
|
+
$[12] = props;
|
|
129
|
+
$[13] = size;
|
|
130
|
+
$[14] = t6;
|
|
131
|
+
} else t6 = $[14];
|
|
132
|
+
return t6;
|
|
133
|
+
}
|
|
134
|
+
if (entry?.status === "missing") return null;
|
|
135
|
+
const { "aria-hidden": hidden, "aria-label": label, role } = props;
|
|
136
|
+
let t6;
|
|
137
|
+
if ($[15] !== className || $[16] !== hidden || $[17] !== label || $[18] !== role || $[19] !== size) {
|
|
138
|
+
t6 = /* @__PURE__ */ jsx("svg", {
|
|
139
|
+
width: size,
|
|
140
|
+
height: size,
|
|
141
|
+
viewBox: "0 0 24 24",
|
|
142
|
+
className,
|
|
143
|
+
"aria-hidden": hidden,
|
|
144
|
+
"aria-label": label,
|
|
145
|
+
role,
|
|
146
|
+
"data-loading": ""
|
|
147
|
+
});
|
|
148
|
+
$[15] = className;
|
|
149
|
+
$[16] = hidden;
|
|
150
|
+
$[17] = label;
|
|
151
|
+
$[18] = role;
|
|
152
|
+
$[19] = size;
|
|
153
|
+
$[20] = t6;
|
|
154
|
+
} else t6 = $[20];
|
|
155
|
+
return t6;
|
|
156
|
+
};
|
|
157
|
+
NamedIcon.displayName = `NamedIcon(${name})`;
|
|
158
|
+
components.set(name, NamedIcon);
|
|
159
|
+
return NamedIcon;
|
|
160
|
+
}
|
|
161
|
+
function _temp() {}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { NamedIconLoaderContext, getNamedIcon, loadNamedIcon };
|
|
164
|
+
|
|
165
|
+
//# sourceMappingURL=namedIcons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"namedIcons.js","names":["createContext","use","useEffect","useSyncExternalStore","IconComponent","NamedIconLoader","name","Promise","Entry","status","icon","caches","WeakMap","Map","components","listeners","Set","NamedIconLoaderContext","cache","loader","entries","get","undefined","set","subscribe","listener","add","delete","setEntry","entry","forEach","loadNamedIcon","resolve","then","console","warn","error","warnedWithoutLoader","getNamedIcon","existing","NamedIcon","t0","$","_c","className","props","t1","size","t2","t3","t4","t5","catch","_temp","Loaded","t6","hidden","label","role","displayName","_c"],"sources":["../../src/icon/namedIcons.tsx"],"sourcesContent":["import { createContext, use, useEffect, useSyncExternalStore } from 'react';\n\nimport type { IconComponent } from './Icon';\n\n/**\n * Loads an icon component from its name, as definitions name icons (`\"icon\": \"send\"`), or\n * resolves with `null` for a name it doesn't know. `lucideIconLoader` of `@panneau/ui/named-icons`\n * loads any Lucide icon; an app can load only the icons its definitions use.\n */\nexport type NamedIconLoader = (name: string) => Promise<IconComponent | null>;\n\ntype Entry =\n { status: 'loading' } | { status: 'loaded'; icon: IconComponent } | { status: 'missing' };\n\n/** Icons by name, for each loader. */\nconst caches = new WeakMap<NamedIconLoader, Map<string, Entry>>();\nconst components = new Map<string, IconComponent>();\nconst listeners = new Set<() => void>();\n\n/** The loader of named icons, set by `PanneauRoot`'s `iconLoader`. */\nexport const NamedIconLoaderContext = createContext<NamedIconLoader | null>(null);\n\nfunction cache(loader: NamedIconLoader): Map<string, Entry> {\n let entries = caches.get(loader);\n if (entries === undefined) {\n entries = new Map();\n caches.set(loader, entries);\n }\n return entries;\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n}\n\nfunction setEntry(loader: NamedIconLoader, name: string, entry: Entry | undefined) {\n if (entry === undefined) {\n cache(loader).delete(name);\n } else {\n cache(loader).set(name, entry);\n }\n listeners.forEach((listener) => listener());\n}\n\n/**\n * Loads an icon by its name with a loader, once per loader and name, and resolves with its\n * component, or with `null` for a name the loader doesn't know.\n */\nexport function loadNamedIcon(\n name: string,\n loader: NamedIconLoader,\n): Promise<IconComponent | null> {\n const entry = cache(loader).get(name);\n if (entry?.status === 'loaded') {\n return Promise.resolve(entry.icon);\n }\n if (entry?.status === 'missing') {\n return Promise.resolve(null);\n }\n if (entry === undefined) {\n setEntry(loader, name, { status: 'loading' });\n }\n return loader(name).then(\n (icon) => {\n if (icon === null) {\n console.warn(`[panneau] No icon named \"${name}\".`);\n setEntry(loader, name, { status: 'missing' });\n } else {\n setEntry(loader, name, { status: 'loaded', icon });\n }\n return icon;\n },\n (error: unknown) => {\n // A chunk that failed to load (offline): the icon is loaded again when it mounts.\n setEntry(loader, name, undefined);\n throw error;\n },\n );\n}\n\nlet warnedWithoutLoader = false;\n\n/**\n * An icon component for an icon name, as definitions name them (`\"icon\": \"send\"`). It goes\n * wherever an icon component goes (`<Button icon={getNamedIcon('send')}>`), and is the same\n * component for the same name. It loads the icon with the `iconLoader` of `PanneauRoot` the first\n * time it renders, and renders an empty space of the same size until then, or without a loader. A\n * name the loader doesn't know renders nothing.\n */\nexport function getNamedIcon(name: string): IconComponent {\n const existing = components.get(name);\n if (existing !== undefined) {\n return existing;\n }\n const NamedIcon: IconComponent = ({ size = 24, className, ...props }) => {\n const loader = use(NamedIconLoaderContext);\n const entry = useSyncExternalStore(\n subscribe,\n () => (loader !== null ? cache(loader).get(name) : undefined),\n () => (loader !== null ? cache(loader).get(name) : undefined),\n );\n useEffect(() => {\n if (loader === null) {\n if (!warnedWithoutLoader) {\n warnedWithoutLoader = true;\n console.warn(\n `[panneau] The icon \"${name}\" is named, but PanneauRoot has no iconLoader: pass lucideIconLoader from @panneau/ui/named-icons.`,\n );\n }\n return;\n }\n if (cache(loader).get(name) === undefined) {\n loadNamedIcon(name, loader).catch(() => undefined);\n }\n }, [loader]);\n if (entry?.status === 'loaded') {\n const Loaded = entry.icon;\n return <Loaded size={size} className={className} {...props} />;\n }\n if (entry?.status === 'missing') {\n return null;\n }\n const { 'aria-hidden': hidden, 'aria-label': label, role } = props;\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 24 24\"\n className={className}\n aria-hidden={hidden}\n aria-label={label}\n role={role}\n data-loading=\"\"\n />\n );\n };\n NamedIcon.displayName = `NamedIcon(${name})`;\n components.set(name, NamedIcon);\n return NamedIcon;\n}\n"],"mappings":"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"}
|
|
@@ -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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CSSProperties } from 'react';
|
|
2
|
-
import { type ButtonProps } from '../button/Button';
|
|
3
|
-
import type { IconComponent } from '../icon/Icon';
|
|
2
|
+
import { type ButtonProps } from '../button/Button.js';
|
|
3
|
+
import type { IconComponent } from '../icon/Icon.js';
|
|
4
4
|
export interface IconButtonProps extends Omit<ButtonProps, 'icon' | 'iconEnd' | 'children' | 'fullWidth' | 'aria-label'> {
|
|
5
5
|
icon: IconComponent;
|
|
6
6
|
/** Accessible label, also shown as a tooltip. */
|
|
@@ -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"}
|
|
@@ -2,23 +2,80 @@ import { cx } from "../utils/cx.js";
|
|
|
2
2
|
import { Button } from "../button/Button.js";
|
|
3
3
|
import { Tooltip } from "../tooltip/Tooltip.js";
|
|
4
4
|
import IconButton_module_default from "./IconButton.module.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
//#region src/icon-button/IconButton.tsx
|
|
7
8
|
/** A square button with only an icon. Its label is announced and shown as a tooltip. */
|
|
8
|
-
function IconButton(
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
function IconButton(t0) {
|
|
10
|
+
const $ = c(21);
|
|
11
|
+
let className;
|
|
12
|
+
let icon;
|
|
13
|
+
let label;
|
|
14
|
+
let props;
|
|
15
|
+
let t1;
|
|
16
|
+
let t2;
|
|
17
|
+
let t3;
|
|
18
|
+
if ($[0] !== t0) {
|
|
19
|
+
({icon, label, appearance: t1, size: t2, showTooltip: t3, className, ...props} = t0);
|
|
20
|
+
$[0] = t0;
|
|
21
|
+
$[1] = className;
|
|
22
|
+
$[2] = icon;
|
|
23
|
+
$[3] = label;
|
|
24
|
+
$[4] = props;
|
|
25
|
+
$[5] = t1;
|
|
26
|
+
$[6] = t2;
|
|
27
|
+
$[7] = t3;
|
|
28
|
+
} else {
|
|
29
|
+
className = $[1];
|
|
30
|
+
icon = $[2];
|
|
31
|
+
label = $[3];
|
|
32
|
+
props = $[4];
|
|
33
|
+
t1 = $[5];
|
|
34
|
+
t2 = $[6];
|
|
35
|
+
t3 = $[7];
|
|
36
|
+
}
|
|
37
|
+
const appearance = t1 === void 0 ? "ghost" : t1;
|
|
38
|
+
const size = t2 === void 0 ? "md" : t2;
|
|
39
|
+
const showTooltip = t3 === void 0 ? true : t3;
|
|
40
|
+
const t4 = size === "sm" && IconButton_module_default.sm;
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[8] !== className || $[9] !== t4) {
|
|
43
|
+
t5 = cx("panneau-icon-button", IconButton_module_default.iconButton, t4, className);
|
|
44
|
+
$[8] = className;
|
|
45
|
+
$[9] = t4;
|
|
46
|
+
$[10] = t5;
|
|
47
|
+
} else t5 = $[10];
|
|
48
|
+
let t6;
|
|
49
|
+
if ($[11] !== appearance || $[12] !== icon || $[13] !== label || $[14] !== props || $[15] !== size || $[16] !== t5) {
|
|
50
|
+
t6 = /* @__PURE__ */ jsx(Button, {
|
|
51
|
+
...props,
|
|
52
|
+
appearance,
|
|
53
|
+
size,
|
|
54
|
+
icon,
|
|
55
|
+
"aria-label": label,
|
|
56
|
+
className: t5
|
|
57
|
+
});
|
|
58
|
+
$[11] = appearance;
|
|
59
|
+
$[12] = icon;
|
|
60
|
+
$[13] = label;
|
|
61
|
+
$[14] = props;
|
|
62
|
+
$[15] = size;
|
|
63
|
+
$[16] = t5;
|
|
64
|
+
$[17] = t6;
|
|
65
|
+
} else t6 = $[17];
|
|
66
|
+
const button = t6;
|
|
17
67
|
if (!showTooltip) return button;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
68
|
+
let t7;
|
|
69
|
+
if ($[18] !== button || $[19] !== label) {
|
|
70
|
+
t7 = /* @__PURE__ */ jsx(Tooltip, {
|
|
71
|
+
content: label,
|
|
72
|
+
children: button
|
|
73
|
+
});
|
|
74
|
+
$[18] = button;
|
|
75
|
+
$[19] = label;
|
|
76
|
+
$[20] = t7;
|
|
77
|
+
} else t7 = $[20];
|
|
78
|
+
return t7;
|
|
22
79
|
}
|
|
23
80
|
//#endregion
|
|
24
81
|
export { IconButton };
|
|
@@ -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":["CSSProperties","Button","ButtonProps","IconComponent","Tooltip","cx","styles","IconButtonProps","Omit","icon","label","showTooltip","className","style","IconButton","t0","$","_c","props","t1","t2","t3","appearance","size","undefined","t4","sm","t5","iconButton","t6","button","t7","_c","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,SAAOc,WAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAL;CAAA,IAAAH;CAAA,IAAAC;CAAA,IAAAQ;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAL,EAAA,OAAAD,IAAA;EAAoB,CAAA,CAAAN,MAAAC,OAAAY,YAAAH,IAAAI,MAAAH,IAAAT,aAAAU,IAAAT,WAAA,GAAAM,SAAAH;EAQTC,EAAA,KAAAD;EAAAC,EAAA,KAAAJ;EAAAI,EAAA,KAAAP;EAAAO,EAAA,KAAAN;EAAAM,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAI;EAAAJ,EAAA,KAAAK;CAAA,OAAA;EAAAT,YAAAI,EAAA;EAAAP,OAAAO,EAAA;EAAAN,QAAAM,EAAA;EAAAE,QAAAF,EAAA;EAAAG,KAAAH,EAAA;EAAAI,KAAAJ,EAAA;EAAAK,KAAAL,EAAA;CAAA;CALd,MAAAM,aAAAH,OAAAK,KAAAA,IAAA,UAAAL;CACA,MAAAI,OAAAH,OAAAI,KAAAA,IAAA,OAAAJ;CACA,MAAAT,cAAAU,OAAAG,KAAAA,IAAA,OAAAH;CAcY,MAAAI,KAAAF,SAAS,QAAQjB,0BAAMoB;CAAG,IAAAC;CAAA,IAAAX,EAAA,OAAAJ,aAAAI,EAAA,OAAAS,IAAA;EAHnBE,KAAAtB,GACP,uBACAC,0BAAMsB,YACNH,IACAb,SACJ;EAACI,EAAA,KAAAJ;EAAAI,EAAA,KAAAS;EAAAT,EAAA,MAAAW;CAAA,OAAAA,KAAAX,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,QAAAM,cAAAN,EAAA,QAAAP,QAAAO,EAAA,QAAAN,SAAAM,EAAA,QAAAE,SAAAF,EAAA,QAAAO,QAAAP,EAAA,QAAAW,IAAA;EAXLE,KAAA,oBAAC,QAAD;GAAO,GACCX;GACQI;GACNC;GACAd;GACMC,cAAAA;GACD,WAAAiB;EAKV,CAAA;EACHX,EAAA,MAAAM;EAAAN,EAAA,MAAAP;EAAAO,EAAA,MAAAN;EAAAM,EAAA,MAAAE;EAAAF,EAAA,MAAAO;EAAAP,EAAA,MAAAW;EAAAX,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAbN,MAAAc,SACID;CAcJ,IAAI,CAAClB,aAAW,OACLmB;CACV,IAAAC;CAAA,IAAAf,EAAA,QAAAc,UAAAd,EAAA,QAAAN,OAAA;EACMqB,KAAA,oBAAC,SAAD;GAAkBrB,SAAAA;GAAQoB,UAAAA;EAAlB,CAAA;EAAmCd,EAAA,MAAAc;EAAAd,EAAA,MAAAN;EAAAM,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAA3Ce;AAA2C"}
|
|
@@ -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
|