@panneau/ui 5.0.0-alpha.3 → 5.0.0-alpha.31
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 +129 -4
- package/dist/alert/Alert.d.ts +2 -2
- package/dist/alert/Alert.js +108 -40
- package/dist/alert/Alert.js.map +1 -1
- package/dist/alert/tokens.d.ts +1 -1
- package/dist/alert/tokens.js.map +1 -1
- package/dist/aside/Aside.css +255 -0
- package/dist/aside/Aside.d.ts +86 -0
- package/dist/aside/Aside.d.ts.map +1 -0
- package/dist/aside/Aside.js +403 -0
- package/dist/aside/Aside.js.map +1 -0
- package/dist/aside/Aside.module.js +46 -0
- package/dist/aside/Aside.module.js.map +1 -0
- package/dist/aside/tokens.d.ts +3 -0
- package/dist/aside/tokens.d.ts.map +1 -0
- package/dist/aside/tokens.js +23 -0
- package/dist/aside/tokens.js.map +1 -0
- package/dist/badge/Badge.d.ts +1 -1
- package/dist/badge/Badge.js +34 -6
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/tokens.d.ts +1 -1
- package/dist/badge/tokens.js.map +1 -1
- package/dist/button/Button.css +13 -1
- package/dist/button/Button.d.ts +20 -6
- package/dist/button/Button.d.ts.map +1 -1
- package/dist/button/Button.js +169 -22
- package/dist/button/Button.js.map +1 -1
- package/dist/button/Button.module.js.map +1 -1
- package/dist/button/LinkButton.d.ts +22 -0
- package/dist/button/LinkButton.d.ts.map +1 -0
- package/dist/button/LinkButton.js +113 -0
- package/dist/button/LinkButton.js.map +1 -0
- package/dist/button/tokens.d.ts +1 -1
- package/dist/button/tokens.d.ts.map +1 -1
- package/dist/button/tokens.js +4 -0
- package/dist/button/tokens.js.map +1 -1
- package/dist/card/Card.css +1 -0
- package/dist/card/Card.js +76 -23
- package/dist/card/Card.js.map +1 -1
- package/dist/card/Card.module.js.map +1 -1
- package/dist/card/tokens.d.ts +1 -1
- package/dist/card/tokens.js.map +1 -1
- package/dist/checkbox/Checkbox.css +15 -16
- package/dist/checkbox/Checkbox.d.ts +1 -1
- package/dist/checkbox/Checkbox.js +86 -25
- package/dist/checkbox/Checkbox.js.map +1 -1
- package/dist/checkbox/Checkbox.module.js.map +1 -1
- package/dist/checkbox/ChoiceChrome.js +82 -21
- package/dist/checkbox/ChoiceChrome.js.map +1 -1
- package/dist/checkbox/tokens.d.ts +1 -1
- package/dist/checkbox/tokens.js +2 -2
- package/dist/checkbox/tokens.js.map +1 -1
- package/dist/combo-box/ComboBox.css +10 -0
- package/dist/combo-box/ComboBox.d.ts +7 -2
- package/dist/combo-box/ComboBox.d.ts.map +1 -1
- package/dist/combo-box/ComboBox.js +310 -78
- package/dist/combo-box/ComboBox.js.map +1 -1
- package/dist/combo-box/ComboBox.module.js +4 -2
- package/dist/combo-box/ComboBox.module.js.map +1 -1
- 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.js +48 -5
- package/dist/container/Container.js.map +1 -1
- package/dist/container/tokens.d.ts +1 -1
- package/dist/container/tokens.js.map +1 -1
- package/dist/date-picker/DatePicker.css +50 -4
- 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 +5 -1
- package/dist/date-picker/DatePicker.module.js.map +1 -1
- package/dist/date-picker/calendarTokens.d.ts +1 -1
- package/dist/date-picker/calendarTokens.js +2 -2
- package/dist/date-picker/calendarTokens.js.map +1 -1
- package/dist/date-range-picker/DateRangePicker.css +37 -0
- package/dist/date-range-picker/DateRangePicker.d.ts +41 -0
- package/dist/date-range-picker/DateRangePicker.d.ts.map +1 -0
- package/dist/date-range-picker/DateRangePicker.js +438 -0
- package/dist/date-range-picker/DateRangePicker.js.map +1 -0
- package/dist/date-range-picker/DateRangePicker.module.js +20 -0
- package/dist/date-range-picker/DateRangePicker.module.js.map +1 -0
- package/dist/dialog/Dialog.css +41 -2
- package/dist/dialog/Dialog.d.ts +15 -3
- package/dist/dialog/Dialog.d.ts.map +1 -1
- package/dist/dialog/Dialog.js +161 -32
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/Dialog.module.js +10 -2
- package/dist/dialog/Dialog.module.js.map +1 -1
- package/dist/dialog/tokens.d.ts +1 -1
- package/dist/dialog/tokens.d.ts.map +1 -1
- package/dist/dialog/tokens.js +2 -0
- package/dist/dialog/tokens.js.map +1 -1
- package/dist/disclosure/Disclosure.js +132 -28
- package/dist/disclosure/Disclosure.js.map +1 -1
- package/dist/disclosure/tokens.d.ts +1 -1
- package/dist/disclosure/tokens.js.map +1 -1
- package/dist/divider/Divider.js +55 -11
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/tokens.d.ts +1 -1
- package/dist/divider/tokens.js.map +1 -1
- package/dist/field/Field.css +30 -4
- package/dist/field/Field.module.js +6 -2
- 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.d.ts +6 -1
- package/dist/field/Fieldset.d.ts.map +1 -1
- package/dist/field/Fieldset.js +132 -33
- package/dist/field/Fieldset.js.map +1 -1
- package/dist/field/inputTokens.d.ts +1 -1
- package/dist/field/inputTokens.d.ts.map +1 -1
- package/dist/field/inputTokens.js +7 -1
- package/dist/field/inputTokens.js.map +1 -1
- package/dist/field/tokens.d.ts +1 -1
- package/dist/field/tokens.d.ts.map +1 -1
- package/dist/field/tokens.js +3 -1
- package/dist/field/tokens.js.map +1 -1
- package/dist/grid/Grid.d.ts +1 -1
- package/dist/grid/Grid.js +123 -14
- package/dist/grid/Grid.js.map +1 -1
- package/dist/grid/tokens.d.ts +1 -1
- package/dist/grid/tokens.js.map +1 -1
- package/dist/heading/Heading.js +41 -6
- package/dist/heading/Heading.js.map +1 -1
- package/dist/heading/tokens.d.ts +1 -1
- package/dist/heading/tokens.js.map +1 -1
- package/dist/icon/Icon.css +5 -0
- package/dist/icon/Icon.d.ts +5 -1
- package/dist/icon/Icon.d.ts.map +1 -1
- package/dist/icon/Icon.js +38 -12
- package/dist/icon/Icon.js.map +1 -1
- package/dist/icon/Icon.module.js.map +1 -1
- package/dist/icon/lucideIconLoader.d.ts +1 -1
- package/dist/icon/lucideIconLoader.js.map +1 -1
- package/dist/icon/namedIcons.d.ts +1 -1
- package/dist/icon/namedIcons.js +87 -26
- package/dist/icon/namedIcons.js.map +1 -1
- package/dist/icon/tokens.d.ts +3 -0
- package/dist/icon/tokens.d.ts.map +1 -0
- package/dist/icon/tokens.js +13 -0
- package/dist/icon/tokens.js.map +1 -0
- package/dist/icon-button/IconButton.d.ts +2 -2
- package/dist/icon-button/IconButton.js +70 -13
- package/dist/icon-button/IconButton.js.map +1 -1
- package/dist/index.d.ts +67 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -6
- package/dist/inline/Inline.d.ts +1 -1
- package/dist/inline/Inline.js +65 -7
- package/dist/inline/Inline.js.map +1 -1
- package/dist/inline/tokens.d.ts +1 -1
- package/dist/inline/tokens.js.map +1 -1
- package/dist/intl/usePanneauIntl.js.map +1 -1
- package/dist/layout/responsive.js.map +1 -1
- package/dist/line-chart/LineChart.css +84 -0
- package/dist/line-chart/LineChart.d.ts +26 -0
- package/dist/line-chart/LineChart.d.ts.map +1 -0
- package/dist/line-chart/LineChart.js +327 -0
- package/dist/line-chart/LineChart.js.map +1 -0
- package/dist/line-chart/LineChart.module.js +28 -0
- package/dist/line-chart/LineChart.module.js.map +1 -0
- package/dist/line-chart/tokens.d.ts +3 -0
- package/dist/line-chart/tokens.d.ts.map +1 -0
- package/dist/line-chart/tokens.js +19 -0
- package/dist/line-chart/tokens.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 +1 -1
- package/dist/node_modules/@internationalized/date/dist/private/CalendarDate.js +136 -0
- package/dist/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +117 -0
- package/dist/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/conversion.js +116 -0
- package/dist/node_modules/@internationalized/date/dist/private/conversion.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/manipulation.js +206 -0
- package/dist/node_modules/@internationalized/date/dist/private/manipulation.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/queries.js +26 -0
- package/dist/node_modules/@internationalized/date/dist/private/queries.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/string.js +19 -0
- package/dist/node_modules/@internationalized/date/dist/private/string.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/utils.js +8 -0
- package/dist/node_modules/@internationalized/date/dist/private/utils.js.map +1 -0
- package/dist/number-input/NumberInput.css +18 -0
- 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 +3 -1
- package/dist/number-input/NumberInput.module.js.map +1 -1
- package/dist/number-input/tokens.d.ts +1 -1
- package/dist/number-input/tokens.js.map +1 -1
- package/dist/pill-trigger/PillTrigger.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 +5 -0
- 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 +4 -2
- package/dist/popover/Popover.module.js.map +1 -1
- package/dist/popover/tokens.d.ts +1 -1
- package/dist/popover/tokens.js.map +1 -1
- package/dist/prose/Prose.js +36 -5
- package/dist/prose/Prose.js.map +1 -1
- package/dist/prose/tokens.d.ts +1 -1
- package/dist/prose/tokens.js.map +1 -1
- package/dist/radio-group/RadioGroup.css +99 -9
- 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 +12 -2
- package/dist/radio-group/RadioGroup.module.js.map +1 -1
- package/dist/radio-group/tokens.d.ts +2 -2
- package/dist/radio-group/tokens.d.ts.map +1 -1
- package/dist/radio-group/tokens.js +23 -3
- package/dist/radio-group/tokens.js.map +1 -1
- package/dist/root/PanneauRoot.css +29 -0
- package/dist/root/PanneauRoot.d.ts +37 -6
- package/dist/root/PanneauRoot.d.ts.map +1 -1
- package/dist/root/PanneauRoot.js +283 -85
- package/dist/root/PanneauRoot.js.map +1 -1
- package/dist/root/PanneauRoot.module.js.map +1 -1
- package/dist/root/ThemeScope.d.ts +1 -1
- package/dist/root/ThemeScope.d.ts.map +1 -1
- package/dist/root/ThemeScope.js +110 -27
- package/dist/root/ThemeScope.js.map +1 -1
- package/dist/segmented-control/SegmentedControl.css +87 -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 +33 -0
- package/dist/segmented-control/tokens.js.map +1 -0
- package/dist/select/ListBox.css +86 -1
- package/dist/select/ListBox.module.js +11 -3
- package/dist/select/ListBox.module.js.map +1 -1
- package/dist/select/Select.d.ts +14 -1
- package/dist/select/Select.d.ts.map +1 -1
- package/dist/select/Select.js +352 -92
- package/dist/select/Select.js.map +1 -1
- package/dist/select/listBoxTokens.d.ts +1 -1
- package/dist/select/listBoxTokens.d.ts.map +1 -1
- package/dist/select/listBoxTokens.js +2 -0
- package/dist/select/listBoxTokens.js.map +1 -1
- package/dist/skeleton/LoadingRegion.d.ts +16 -0
- package/dist/skeleton/LoadingRegion.d.ts.map +1 -0
- package/dist/skeleton/LoadingRegion.js +65 -0
- package/dist/skeleton/LoadingRegion.js.map +1 -0
- package/dist/skeleton/Skeleton.css +62 -0
- package/dist/skeleton/Skeleton.d.ts +25 -0
- package/dist/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/skeleton/Skeleton.js +106 -0
- package/dist/skeleton/Skeleton.js.map +1 -0
- package/dist/skeleton/Skeleton.module.js +22 -0
- package/dist/skeleton/Skeleton.module.js.map +1 -0
- package/dist/skeleton/tokens.d.ts +3 -0
- package/dist/skeleton/tokens.d.ts.map +1 -0
- package/dist/skeleton/tokens.js +15 -0
- package/dist/skeleton/tokens.js.map +1 -0
- package/dist/slider/Slider.css +94 -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 +21 -6
- package/dist/spinner/Spinner.d.ts.map +1 -1
- package/dist/spinner/Spinner.js +60 -10
- package/dist/spinner/Spinner.js.map +1 -1
- package/dist/spinner/Spinner.module.js +5 -1
- package/dist/spinner/Spinner.module.js.map +1 -1
- package/dist/spinner/tokens.d.ts +1 -1
- package/dist/spinner/tokens.js.map +1 -1
- package/dist/stack/Stack.d.ts +1 -1
- package/dist/stack/Stack.js +60 -7
- package/dist/stack/Stack.js.map +1 -1
- package/dist/stack/tokens.d.ts +1 -1
- package/dist/stack/tokens.js.map +1 -1
- package/dist/stat/Stat.css +45 -0
- package/dist/stat/Stat.d.ts +27 -0
- package/dist/stat/Stat.d.ts.map +1 -0
- package/dist/stat/Stat.js +87 -0
- package/dist/stat/Stat.js.map +1 -0
- package/dist/stat/Stat.module.js +18 -0
- package/dist/stat/Stat.module.js.map +1 -0
- package/dist/stat/tokens.d.ts +3 -0
- package/dist/stat/tokens.d.ts.map +1 -0
- package/dist/stat/tokens.js +21 -0
- package/dist/stat/tokens.js.map +1 -0
- package/dist/switch/Switch.css +16 -10
- package/dist/switch/Switch.d.ts +1 -1
- package/dist/switch/Switch.js +68 -11
- package/dist/switch/Switch.js.map +1 -1
- package/dist/switch/Switch.module.js.map +1 -1
- package/dist/switch/tokens.d.ts +1 -1
- package/dist/switch/tokens.d.ts.map +1 -1
- package/dist/switch/tokens.js +4 -2
- package/dist/switch/tokens.js.map +1 -1
- package/dist/tabs/Tabs.css +11 -4
- package/dist/tabs/Tabs.js +1 -1
- package/dist/tabs/Tabs.js.map +1 -1
- package/dist/tabs/Tabs.module.js.map +1 -1
- package/dist/tabs/tokens.d.ts +1 -1
- package/dist/tabs/tokens.js +1 -1
- package/dist/tabs/tokens.js.map +1 -1
- package/dist/tags-input/TagsInput.css +73 -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.d.ts +1 -1
- package/dist/text/Text.js +70 -5
- package/dist/text/Text.js.map +1 -1
- package/dist/text/tokens.d.ts +1 -1
- package/dist/text/tokens.js.map +1 -1
- package/dist/text-area/TextArea.d.ts +1 -1
- package/dist/text-area/TextArea.js +135 -28
- package/dist/text-area/TextArea.js.map +1 -1
- package/dist/text-input/TextInput.d.ts +7 -3
- 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 +14 -0
- package/dist/theme/Tone.module.js +4 -2
- package/dist/theme/Tone.module.js.map +1 -1
- package/dist/theme/bootstrap.d.ts +2 -2
- package/dist/theme/bootstrap.d.ts.map +1 -1
- package/dist/theme/bootstrap.js +6 -0
- package/dist/theme/bootstrap.js.map +1 -1
- package/dist/theme/chartColors.js.map +1 -1
- package/dist/theme/checkTheme.d.ts +6 -4
- package/dist/theme/checkTheme.d.ts.map +1 -1
- package/dist/theme/checkTheme.js +54 -7
- package/dist/theme/checkTheme.js.map +1 -1
- package/dist/theme/cli.d.ts +2 -2
- package/dist/theme/cli.js.map +1 -1
- package/dist/theme/color.d.ts +13 -0
- package/dist/theme/color.d.ts.map +1 -1
- package/dist/theme/color.js +41 -1
- package/dist/theme/color.js.map +1 -1
- package/dist/theme/colorVision.d.ts +1 -1
- package/dist/theme/colorVision.js.map +1 -1
- package/dist/theme/componentTokens.js.map +1 -1
- package/dist/theme/components.d.ts +21 -11
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +20 -0
- package/dist/theme/components.js.map +1 -1
- package/dist/theme/defineTheme.d.ts +5 -5
- package/dist/theme/defineTheme.js.map +1 -1
- package/dist/theme/fonts.js.map +1 -1
- package/dist/theme/index.d.ts +12 -12
- package/dist/theme/index.js +1 -1
- package/dist/theme/selectedTokens.d.ts +11 -0
- package/dist/theme/selectedTokens.d.ts.map +1 -0
- package/dist/theme/selectedTokens.js +23 -0
- package/dist/theme/selectedTokens.js.map +1 -0
- package/dist/theme/semanticTokens.d.ts +1 -1
- package/dist/theme/semanticTokens.d.ts.map +1 -1
- package/dist/theme/semanticTokens.js +7 -0
- package/dist/theme/semanticTokens.js.map +1 -1
- package/dist/theme/theme.d.ts +2 -2
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/toneClass.d.ts +1 -1
- package/dist/theme/toneClass.js.map +1 -1
- package/dist/theme/tones.d.ts +15 -3
- package/dist/theme/tones.d.ts.map +1 -1
- package/dist/theme/tones.js +14 -2
- package/dist/theme/tones.js.map +1 -1
- package/dist/time-input/TimeInput.d.ts +1 -1
- package/dist/time-input/TimeInput.js +138 -31
- package/dist/time-input/TimeInput.js.map +1 -1
- package/dist/toast/Toast.css +150 -19
- package/dist/toast/Toast.d.ts +55 -10
- package/dist/toast/Toast.d.ts.map +1 -1
- package/dist/toast/Toast.js +226 -70
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/Toast.module.js +5 -3
- package/dist/toast/Toast.module.js.map +1 -1
- package/dist/toast/tokens.d.ts +1 -1
- package/dist/toast/tokens.js +1 -1
- package/dist/toast/tokens.js.map +1 -1
- package/dist/tooltip/Tooltip.js +38 -8
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/tokens.d.ts +1 -1
- package/dist/tooltip/tokens.js.map +1 -1
- package/dist/utils/cx.js.map +1 -1
- package/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/dist/utils/preference.d.ts +7 -0
- package/dist/utils/preference.d.ts.map +1 -0
- package/dist/utils/preference.js +54 -0
- package/dist/utils/preference.js.map +1 -0
- package/package.json +5 -5
package/dist/grid/Grid.js
CHANGED
|
@@ -2,28 +2,137 @@ import { cx } from "../utils/cx.js";
|
|
|
2
2
|
import { responsiveVariables, space, withVariables } from "../layout/responsive.js";
|
|
3
3
|
import Grid_module_default from "./Grid.module.js";
|
|
4
4
|
import GridItem_module_default from "./GridItem.module.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
//#region src/grid/Grid.tsx
|
|
7
8
|
/** Cells in columns: a fixed number per breakpoint, or as many as fit. */
|
|
8
|
-
function Grid(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
function Grid(t0) {
|
|
10
|
+
const $ = c(23);
|
|
11
|
+
let align;
|
|
12
|
+
let className;
|
|
13
|
+
let columns;
|
|
14
|
+
let gap;
|
|
15
|
+
let minItemWidth;
|
|
16
|
+
let props;
|
|
17
|
+
let style;
|
|
18
|
+
let t1;
|
|
19
|
+
if ($[0] !== t0) {
|
|
20
|
+
({as: t1, columns, minItemWidth, gap, align, className, style, ...props} = t0);
|
|
21
|
+
$[0] = t0;
|
|
22
|
+
$[1] = align;
|
|
23
|
+
$[2] = className;
|
|
24
|
+
$[3] = columns;
|
|
25
|
+
$[4] = gap;
|
|
26
|
+
$[5] = minItemWidth;
|
|
27
|
+
$[6] = props;
|
|
28
|
+
$[7] = style;
|
|
29
|
+
$[8] = t1;
|
|
30
|
+
} else {
|
|
31
|
+
align = $[1];
|
|
32
|
+
className = $[2];
|
|
33
|
+
columns = $[3];
|
|
34
|
+
gap = $[4];
|
|
35
|
+
minItemWidth = $[5];
|
|
36
|
+
props = $[6];
|
|
37
|
+
style = $[7];
|
|
38
|
+
t1 = $[8];
|
|
39
|
+
}
|
|
40
|
+
const Element = t1 === void 0 ? "div" : t1;
|
|
41
|
+
const t2 = minItemWidth !== void 0 && Grid_module_default.auto;
|
|
42
|
+
let t3;
|
|
43
|
+
if ($[9] !== className || $[10] !== t2) {
|
|
44
|
+
t3 = cx("panneau-grid", Grid_module_default.grid, t2, className);
|
|
45
|
+
$[9] = className;
|
|
46
|
+
$[10] = t2;
|
|
47
|
+
$[11] = t3;
|
|
48
|
+
} else t3 = $[11];
|
|
49
|
+
let t4;
|
|
50
|
+
if ($[12] !== align || $[13] !== columns || $[14] !== gap || $[15] !== minItemWidth || $[16] !== style) {
|
|
51
|
+
t4 = withVariables([
|
|
52
|
+
responsiveVariables("grid", "columns", columns, _temp),
|
|
14
53
|
minItemWidth !== void 0 ? { "--_panneau-grid-min-item-width": minItemWidth } : {},
|
|
15
54
|
responsiveVariables("grid", "gap", gap, space),
|
|
16
55
|
responsiveVariables("grid", "align", align, String)
|
|
17
|
-
], style)
|
|
18
|
-
|
|
56
|
+
], style);
|
|
57
|
+
$[12] = align;
|
|
58
|
+
$[13] = columns;
|
|
59
|
+
$[14] = gap;
|
|
60
|
+
$[15] = minItemWidth;
|
|
61
|
+
$[16] = style;
|
|
62
|
+
$[17] = t4;
|
|
63
|
+
} else t4 = $[17];
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[18] !== Element || $[19] !== props || $[20] !== t3 || $[21] !== t4) {
|
|
66
|
+
t5 = /* @__PURE__ */ jsx(Element, {
|
|
67
|
+
...props,
|
|
68
|
+
className: t3,
|
|
69
|
+
style: t4
|
|
70
|
+
});
|
|
71
|
+
$[18] = Element;
|
|
72
|
+
$[19] = props;
|
|
73
|
+
$[20] = t3;
|
|
74
|
+
$[21] = t4;
|
|
75
|
+
$[22] = t5;
|
|
76
|
+
} else t5 = $[22];
|
|
77
|
+
return t5;
|
|
78
|
+
}
|
|
79
|
+
function _temp(count) {
|
|
80
|
+
return String(Math.max(1, Math.floor(count)));
|
|
19
81
|
}
|
|
20
82
|
/** A cell of a `Grid` that spans several columns, per breakpoint. */
|
|
21
|
-
function GridItem(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
83
|
+
function GridItem(t0) {
|
|
84
|
+
const $ = c(16);
|
|
85
|
+
let className;
|
|
86
|
+
let props;
|
|
87
|
+
let span;
|
|
88
|
+
let style;
|
|
89
|
+
let t1;
|
|
90
|
+
if ($[0] !== t0) {
|
|
91
|
+
({as: t1, span, className, style, ...props} = t0);
|
|
92
|
+
$[0] = t0;
|
|
93
|
+
$[1] = className;
|
|
94
|
+
$[2] = props;
|
|
95
|
+
$[3] = span;
|
|
96
|
+
$[4] = style;
|
|
97
|
+
$[5] = t1;
|
|
98
|
+
} else {
|
|
99
|
+
className = $[1];
|
|
100
|
+
props = $[2];
|
|
101
|
+
span = $[3];
|
|
102
|
+
style = $[4];
|
|
103
|
+
t1 = $[5];
|
|
104
|
+
}
|
|
105
|
+
const Element = t1 === void 0 ? "div" : t1;
|
|
106
|
+
let t2;
|
|
107
|
+
if ($[6] !== className) {
|
|
108
|
+
t2 = cx("panneau-grid-item", GridItem_module_default["grid-item"], className);
|
|
109
|
+
$[6] = className;
|
|
110
|
+
$[7] = t2;
|
|
111
|
+
} else t2 = $[7];
|
|
112
|
+
let t3;
|
|
113
|
+
if ($[8] !== span || $[9] !== style) {
|
|
114
|
+
t3 = withVariables([responsiveVariables("grid-item", "span", span, _temp2)], style);
|
|
115
|
+
$[8] = span;
|
|
116
|
+
$[9] = style;
|
|
117
|
+
$[10] = t3;
|
|
118
|
+
} else t3 = $[10];
|
|
119
|
+
let t4;
|
|
120
|
+
if ($[11] !== Element || $[12] !== props || $[13] !== t2 || $[14] !== t3) {
|
|
121
|
+
t4 = /* @__PURE__ */ jsx(Element, {
|
|
122
|
+
...props,
|
|
123
|
+
className: t2,
|
|
124
|
+
style: t3
|
|
125
|
+
});
|
|
126
|
+
$[11] = Element;
|
|
127
|
+
$[12] = props;
|
|
128
|
+
$[13] = t2;
|
|
129
|
+
$[14] = t3;
|
|
130
|
+
$[15] = t4;
|
|
131
|
+
} else t4 = $[15];
|
|
132
|
+
return t4;
|
|
133
|
+
}
|
|
134
|
+
function _temp2(value) {
|
|
135
|
+
return value === "full" ? "1 / -1" : `span ${Math.max(1, Math.floor(value))}`;
|
|
27
136
|
}
|
|
28
137
|
//#endregion
|
|
29
138
|
export { Grid, GridItem };
|
package/dist/grid/Grid.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.js","names":["styles","itemStyles"],"sources":["../../src/grid/Grid.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport {\n type Responsive,\n type Space,\n responsiveVariables,\n space,\n withVariables,\n} from '../layout/responsive';\nimport { cx } from '../utils/cx';\nimport styles from './Grid.module.css';\nimport itemStyles from './GridItem.module.css';\n\nexport interface GridProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'ul' | 'ol' | 'dl';\n /** Number of equal columns: `3`, or `{ base: 1, md: 2, lg: 3 }`. Defaults to 1. */\n columns?: Responsive<number>;\n /**\n * Minimum width of a cell (`'16rem'`): as many columns as fit, like `repeat(auto-fit, ...)`.\n * It replaces `columns`.\n */\n minItemWidth?: string;\n /** Space between cells, from the space scale. Defaults to the `--panneau-grid-gap` token. */\n gap?: Responsive<Space>;\n /** Vertical alignment of the cells in their row. Defaults to `stretch`. */\n align?: Responsive<'start' | 'center' | 'end' | 'stretch'>;\n}\n\n/** Cells in columns: a fixed number per breakpoint, or as many as fit. */\nexport function Grid({\n as: Element = 'div',\n columns,\n minItemWidth,\n gap,\n align,\n className,\n style,\n ...props\n}: GridProps) {\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-grid',\n styles.grid,\n minItemWidth !== undefined && styles.auto,\n className,\n )}\n style={withVariables(\n [\n responsiveVariables('grid', 'columns', columns, (count) =>\n String(Math.max(1, Math.floor(count))),\n ),\n minItemWidth !== undefined\n ? { '--_panneau-grid-min-item-width': minItemWidth }\n : {},\n responsiveVariables('grid', 'gap', gap, space),\n responsiveVariables('grid', 'align', align, String),\n ],\n style,\n )}\n />\n );\n}\n\nexport interface GridItemProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'article' | 'li';\n /** Columns the cell spans: a number, or `full` for the whole row. Defaults to 1. */\n span?: Responsive<number | 'full'>;\n}\n\n/** A cell of a `Grid` that spans several columns, per breakpoint. */\nexport function GridItem({ as: Element = 'div', span, className, style, ...props }: GridItemProps) {\n return (\n <Element\n {...props}\n className={cx('panneau-grid-item', itemStyles['grid-item'], className)}\n style={withVariables(\n [\n responsiveVariables('grid-item', 'span', span, (value) =>\n value === 'full' ? '1 / -1' : `span ${Math.max(1, Math.floor(value))}`,\n ),\n ],\n style,\n )}\n />\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Grid.js","names":["HTMLAttributes","Responsive","Space","responsiveVariables","space","withVariables","cx","styles","itemStyles","GridProps","HTMLElement","as","columns","minItemWidth","gap","align","Grid","t0","$","_c","className","props","style","t1","Element","undefined","t2","auto","t3","grid","t4","_temp","String","t5","count","Math","max","floor","GridItemProps","span","GridItem","_temp2","value","_c","styles","itemStyles"],"sources":["../../src/grid/Grid.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport {\n type Responsive,\n type Space,\n responsiveVariables,\n space,\n withVariables,\n} from '../layout/responsive';\nimport { cx } from '../utils/cx';\nimport styles from './Grid.module.css';\nimport itemStyles from './GridItem.module.css';\n\nexport interface GridProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'ul' | 'ol' | 'dl';\n /** Number of equal columns: `3`, or `{ base: 1, md: 2, lg: 3 }`. Defaults to 1. */\n columns?: Responsive<number>;\n /**\n * Minimum width of a cell (`'16rem'`): as many columns as fit, like `repeat(auto-fit, ...)`.\n * It replaces `columns`.\n */\n minItemWidth?: string;\n /** Space between cells, from the space scale. Defaults to the `--panneau-grid-gap` token. */\n gap?: Responsive<Space>;\n /** Vertical alignment of the cells in their row. Defaults to `stretch`. */\n align?: Responsive<'start' | 'center' | 'end' | 'stretch'>;\n}\n\n/** Cells in columns: a fixed number per breakpoint, or as many as fit. */\nexport function Grid({\n as: Element = 'div',\n columns,\n minItemWidth,\n gap,\n align,\n className,\n style,\n ...props\n}: GridProps) {\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-grid',\n styles.grid,\n minItemWidth !== undefined && styles.auto,\n className,\n )}\n style={withVariables(\n [\n responsiveVariables('grid', 'columns', columns, (count) =>\n String(Math.max(1, Math.floor(count))),\n ),\n minItemWidth !== undefined\n ? { '--_panneau-grid-min-item-width': minItemWidth }\n : {},\n responsiveVariables('grid', 'gap', gap, space),\n responsiveVariables('grid', 'align', align, String),\n ],\n style,\n )}\n />\n );\n}\n\nexport interface GridItemProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'article' | 'li';\n /** Columns the cell spans: a number, or `full` for the whole row. Defaults to 1. */\n span?: Responsive<number | 'full'>;\n}\n\n/** A cell of a `Grid` that spans several columns, per breakpoint. */\nexport function GridItem({ as: Element = 'div', span, className, style, ...props }: GridItemProps) {\n return (\n <Element\n {...props}\n className={cx('panneau-grid-item', itemStyles['grid-item'], className)}\n style={withVariables(\n [\n responsiveVariables('grid-item', 'span', span, (value) =>\n value === 'full' ? '1 / -1' : `span ${Math.max(1, Math.floor(value))}`,\n ),\n ],\n style,\n )}\n />\n );\n}\n"],"mappings":"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"}
|
package/dist/grid/tokens.d.ts
CHANGED
package/dist/grid/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/grid/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Grid. */\nexport const gridTokens = defineComponentTokens('grid', {\n /** Space between cells, in both directions, when the `gap` prop is not set. */\n gap: 'var(--panneau-space-4)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","gridTokens","gap"],"sources":["../../src/grid/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Grid. */\nexport const gridTokens = defineComponentTokens('grid', {\n /** Space between cells, in both directions, when the `gap` prop is not set. */\n gap: 'var(--panneau-space-4)',\n});\n"],"mappings":";;;AAGA,IAAaC,aAAaD,sBAAsB,QAAQ;;AAEpDE,KAAK,yBACT,CAAC"}
|
package/dist/heading/Heading.js
CHANGED
|
@@ -1,15 +1,50 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import Heading_module_default from "./Heading.module.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/heading/Heading.tsx
|
|
5
6
|
/** A heading, styled by the heading tokens of the theme. */
|
|
6
|
-
function Heading(
|
|
7
|
+
function Heading(t0) {
|
|
8
|
+
const $ = c(12);
|
|
9
|
+
let className;
|
|
10
|
+
let props;
|
|
11
|
+
let size;
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== t0) {
|
|
14
|
+
({level: t1, size, className, ...props} = t0);
|
|
15
|
+
$[0] = t0;
|
|
16
|
+
$[1] = className;
|
|
17
|
+
$[2] = props;
|
|
18
|
+
$[3] = size;
|
|
19
|
+
$[4] = t1;
|
|
20
|
+
} else {
|
|
21
|
+
className = $[1];
|
|
22
|
+
props = $[2];
|
|
23
|
+
size = $[3];
|
|
24
|
+
t1 = $[4];
|
|
25
|
+
}
|
|
26
|
+
const level = t1 === void 0 ? 2 : t1;
|
|
7
27
|
const Element = `h${level}`;
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
28
|
+
const t2 = Heading_module_default[`size-${size ?? Math.min(level, 4)}`];
|
|
29
|
+
let t3;
|
|
30
|
+
if ($[5] !== className || $[6] !== t2) {
|
|
31
|
+
t3 = cx("panneau-heading", Heading_module_default.heading, t2, className);
|
|
32
|
+
$[5] = className;
|
|
33
|
+
$[6] = t2;
|
|
34
|
+
$[7] = t3;
|
|
35
|
+
} else t3 = $[7];
|
|
36
|
+
let t4;
|
|
37
|
+
if ($[8] !== Element || $[9] !== props || $[10] !== t3) {
|
|
38
|
+
t4 = /* @__PURE__ */ jsx(Element, {
|
|
39
|
+
...props,
|
|
40
|
+
className: t3
|
|
41
|
+
});
|
|
42
|
+
$[8] = Element;
|
|
43
|
+
$[9] = props;
|
|
44
|
+
$[10] = t3;
|
|
45
|
+
$[11] = t4;
|
|
46
|
+
} else t4 = $[11];
|
|
47
|
+
return t4;
|
|
13
48
|
}
|
|
14
49
|
//#endregion
|
|
15
50
|
export { Heading };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Heading.js","names":["styles"],"sources":["../../src/heading/Heading.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Heading.module.css';\n\n/** The level of a heading element: `h1` to `h6`. */\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** The visual size of a heading: 1 to 4, or a display size for hero text and stats. */\nexport type HeadingSize = 1 | 2 | 3 | 4 | 'display-1' | 'display-2';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n /** Level of the element, for the outline of the page. Defaults to 2. */\n level?: HeadingLevel;\n /**\n * Visual size, independent of the level, like Bootstrap's `.h1` and `.display-1`. Defaults to\n * the level, and to 4 for levels 5 and 6.\n */\n size?: HeadingSize;\n}\n\n/** A heading, styled by the heading tokens of the theme. */\nexport function Heading({ level = 2, size, className, ...props }: HeadingProps) {\n const Element = `h${level}` as const;\n const visualSize = size ?? Math.min(level, 4);\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-heading',\n styles.heading,\n styles[`size-${visualSize}`],\n className,\n )}\n />\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Heading.js","names":["HTMLAttributes","cx","styles","HeadingLevel","HeadingSize","HeadingProps","HTMLHeadingElement","level","size","Heading","t0","$","_c","className","props","t1","undefined","Element","const","visualSize","Math","min","t2","t3","heading","t4","_c","styles"],"sources":["../../src/heading/Heading.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport { cx } from '../utils/cx';\nimport styles from './Heading.module.css';\n\n/** The level of a heading element: `h1` to `h6`. */\nexport type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;\n\n/** The visual size of a heading: 1 to 4, or a display size for hero text and stats. */\nexport type HeadingSize = 1 | 2 | 3 | 4 | 'display-1' | 'display-2';\n\nexport interface HeadingProps extends HTMLAttributes<HTMLHeadingElement> {\n /** Level of the element, for the outline of the page. Defaults to 2. */\n level?: HeadingLevel;\n /**\n * Visual size, independent of the level, like Bootstrap's `.h1` and `.display-1`. Defaults to\n * the level, and to 4 for levels 5 and 6.\n */\n size?: HeadingSize;\n}\n\n/** A heading, styled by the heading tokens of the theme. */\nexport function Heading({ level = 2, size, className, ...props }: HeadingProps) {\n const Element = `h${level}` as const;\n const visualSize = size ?? Math.min(level, 4);\n return (\n <Element\n {...props}\n className={cx(\n 'panneau-heading',\n styles.heading,\n styles[`size-${visualSize}`],\n className,\n )}\n />\n );\n}\n"],"mappings":";;;;;;AAsBA,SAAOS,QAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAC;CAAA,IAAAC;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAJ,EAAA,OAAAD,IAAA;EAAiB,CAAA,CAAAH,OAAAQ,IAAAP,MAAAK,WAAA,GAAAC,SAAAJ;EAAsDC,EAAA,KAAAD;EAAAC,EAAA,KAAAE;EAAAF,EAAA,KAAAG;EAAAH,EAAA,KAAAH;EAAAG,EAAA,KAAAI;CAAA,OAAA;EAAAF,YAAAF,EAAA;EAAAG,QAAAH,EAAA;EAAAH,OAAAG,EAAA;EAAAI,KAAAJ,EAAA;CAAA;CAApD,MAAAJ,QAAAQ,OAAAC,KAAAA,IAAA,IAAAD;CACtB,MAAAE,UAAgB,IAAIV;CAQR,MAAAe,KAAApB,uBAAO,QAPAM,QAAQY,KAAIC,IAAKd,OAAO,CAAC;CAOJ,IAAAgB;CAAA,IAAAZ,EAAA,OAAAE,aAAAF,EAAA,OAAAW,IAAA;EAHrBC,KAAAtB,GACP,mBACAC,uBAAMsB,SACNF,IACAT,SACJ;EAACF,EAAA,KAAAE;EAAAF,EAAA,KAAAW;EAAAX,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAM,WAAAN,EAAA,OAAAG,SAAAH,EAAA,QAAAY,IAAA;EAPLE,KAAA,oBAAC,SAAD;GAAQ,GACAX;GACO,WAAAS;EAKV,CAAA;EACHZ,EAAA,KAAAM;EAAAN,EAAA,KAAAG;EAAAH,EAAA,MAAAY;EAAAZ,EAAA,MAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,OARFc;AAQE"}
|
package/dist/heading/tokens.d.ts
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
* Tokens of Heading, like Bootstrap's `$headings-*` and `$display-font-sizes`. `Prose` applies
|
|
3
3
|
* them to the headings of rich content too.
|
|
4
4
|
*/
|
|
5
|
-
export declare const headingTokens: import("
|
|
5
|
+
export declare const headingTokens: import("../index.js").ComponentTokens<"heading", "panneau-heading-color" | "panneau-heading-font-family" | "panneau-heading-display-font-family" | "panneau-heading-1-font-size" | "panneau-heading-1-font-weight" | "panneau-heading-1-line-height" | "panneau-heading-1-letter-spacing" | "panneau-heading-2-font-size" | "panneau-heading-2-font-weight" | "panneau-heading-2-line-height" | "panneau-heading-2-letter-spacing" | "panneau-heading-3-font-size" | "panneau-heading-3-font-weight" | "panneau-heading-3-line-height" | "panneau-heading-3-letter-spacing" | "panneau-heading-4-font-size" | "panneau-heading-4-font-weight" | "panneau-heading-4-line-height" | "panneau-heading-4-letter-spacing" | "panneau-heading-display-1-font-size" | "panneau-heading-display-1-font-weight" | "panneau-heading-display-1-line-height" | "panneau-heading-display-1-letter-spacing" | "panneau-heading-display-2-font-size" | "panneau-heading-display-2-font-weight" | "panneau-heading-display-2-line-height" | "panneau-heading-display-2-letter-spacing">;
|
|
6
6
|
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"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,
|
|
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
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The stroke is in units of the icon's grid, so it scales with the icon: every size has the same
|
|
3
|
+
* weight. It overrides the `stroke-width` attribute that Lucide sets.
|
|
4
|
+
*/
|
|
1
5
|
.panneau-icon {
|
|
2
6
|
display: inline-block;
|
|
3
7
|
flex: 0 0 auto;
|
|
4
8
|
vertical-align: middle;
|
|
9
|
+
stroke-width: var(--panneau-icon-stroke-width, 2);
|
|
5
10
|
}
|
package/dist/icon/Icon.d.ts
CHANGED
|
@@ -26,6 +26,10 @@ export interface IconProps {
|
|
|
26
26
|
label?: string;
|
|
27
27
|
className?: string;
|
|
28
28
|
}
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* Renders an icon of the icon set (Lucide) at a size of the scale, decorative by default. Its stroke
|
|
31
|
+
* scales with it (`--panneau-icon-stroke-width`, in units of the 24-unit grid), so that every size
|
|
32
|
+
* has the same weight.
|
|
33
|
+
*/
|
|
30
34
|
export declare function Icon({ icon: Component, size, label, className }: IconProps): import("react").JSX.Element;
|
|
31
35
|
//# sourceMappingURL=Icon.d.ts.map
|
package/dist/icon/Icon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAIxD,MAAM,WAAW,SAAS;IACtB,yCAAyC;IACzC,IAAI,EAAE,aAAa,CAAC;IACpB,sDAAsD;IACtD,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAK3C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;IACtC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC9B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;IAC3C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC;CAC1C,CAAC,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAIxD,MAAM,WAAW,SAAS;IACtB,yCAAyC;IACzC,IAAI,EAAE,aAAa,CAAC;IACpB,sDAAsD;IACtD,IAAI,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAW,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,SAAS,+BAajF"}
|
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 = {
|
|
@@ -9,19 +10,44 @@ var SIZES = {
|
|
|
9
10
|
lg: 20,
|
|
10
11
|
xl: 24
|
|
11
12
|
};
|
|
12
|
-
/**
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Renders an icon of the icon set (Lucide) at a size of the scale, decorative by default. Its stroke
|
|
15
|
+
* scales with it (`--panneau-icon-stroke-width`, in units of the 24-unit grid), so that every size
|
|
16
|
+
* has the same weight.
|
|
17
|
+
*/
|
|
18
|
+
function Icon(t0) {
|
|
19
|
+
const $ = c(9);
|
|
20
|
+
const { icon: Component, size: t1, label, className } = t0;
|
|
21
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
14
22
|
const pixels = typeof size === "number" ? size : SIZES[size];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
let t2;
|
|
24
|
+
if ($[0] !== className) {
|
|
25
|
+
t2 = cx("panneau-icon", Icon_module_default.icon, className);
|
|
26
|
+
$[0] = className;
|
|
27
|
+
$[1] = t2;
|
|
28
|
+
} else t2 = $[1];
|
|
29
|
+
const t3 = label === void 0 ? "true" : void 0;
|
|
30
|
+
const t4 = label !== void 0 ? "img" : void 0;
|
|
31
|
+
let t5;
|
|
32
|
+
if ($[2] !== Component || $[3] !== label || $[4] !== pixels || $[5] !== t2 || $[6] !== t3 || $[7] !== t4) {
|
|
33
|
+
t5 = /* @__PURE__ */ jsx(Component, {
|
|
34
|
+
size: pixels,
|
|
35
|
+
strokeWidth: 2,
|
|
36
|
+
className: t2,
|
|
37
|
+
"aria-hidden": t3,
|
|
38
|
+
"aria-label": label,
|
|
39
|
+
role: t4,
|
|
40
|
+
focusable: "false"
|
|
41
|
+
});
|
|
42
|
+
$[2] = Component;
|
|
43
|
+
$[3] = label;
|
|
44
|
+
$[4] = pixels;
|
|
45
|
+
$[5] = t2;
|
|
46
|
+
$[6] = t3;
|
|
47
|
+
$[7] = t4;
|
|
48
|
+
$[8] = t5;
|
|
49
|
+
} else t5 = $[8];
|
|
50
|
+
return t5;
|
|
25
51
|
}
|
|
26
52
|
//#endregion
|
|
27
53
|
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
|
|
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","_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/**\n * Renders an icon of the icon set (Lucide) at a size of the scale, decorative by default. Its stroke\n * scales with it (`--panneau-icon-stroke-width`, in units of the 24-unit grid), so that every size\n * has the same weight.\n */\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 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;;;;;;AAoBjF,SAAOI,KAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,CAAA;CAAc,MAAA,EAAAL,MAAAM,WAAArB,MAAAsB,IAAAN,OAAAb,cAAAe;CAAmB,MAAAlB,OAAAsB,OAAAC,KAAAA,IAAA,OAAAD;CACpC,MAAAE,SAAe,OAAOxB,SAAS,WAAhBA,OAAkCO,MAAMP;CAAM,IAAAyB;CAAA,IAAAN,EAAA,OAAAhB,WAAA;EAK1CsB,KAAA5B,GAAG,gBAAgBC,oBAAMiB,MAAOZ,SAAS;EAACgB,EAAA,KAAAhB;EAAAgB,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CACxC,MAAAO,KAAAV,UAAUO,KAAAA,IAAV,SAAAA,KAAAA;CAEP,MAAAI,KAAAX,UAAUO,KAAAA,IAAV,QAAAA,KAAAA;CAAuC,IAAAK;CAAA,IAAAT,EAAA,OAAAE,aAAAF,EAAA,OAAAH,SAAAG,EAAA,OAAAK,UAAAL,EAAA,OAAAM,MAAAN,EAAA,OAAAO,MAAAP,EAAA,OAAAQ,IAAA;EANjDC,KAAA,oBAAC,WAAD;GACUJ,MAAAA;GACO,aAAA;GACF,WAAAC;GACE,eAAAC;GACDV,cAAAA;GACN,MAAAW;GACI,WAAA;EAAO,CAAA;EACnBR,EAAA,KAAAE;EAAAF,EAAA,KAAAH;EAAAG,EAAA,KAAAK;EAAAL,EAAA,KAAAM;EAAAN,EAAA,KAAAO;EAAAP,EAAA,KAAAQ;EAAAR,EAAA,KAAAS;CAAA,OAAAA,KAAAT,EAAA;CAAA,OARFS;AAQE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.module.js","names":[],"sources":["../../src/icon/Icon.module.css"],"sourcesContent":[".icon {\n display: inline-block;\n flex: 0 0 auto;\n vertical-align: middle;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Icon.module.js","names":[],"sources":["../../src/icon/Icon.module.css"],"sourcesContent":["/*\n * The stroke is in units of the icon's grid, so it scales with the icon: every size has the same\n * weight. It overrides the `stroke-width` attribute that Lucide sets.\n */\n.icon {\n display: inline-block;\n flex: 0 0 auto;\n vertical-align: middle;\n stroke-width: var(--panneau-icon-stroke-width, 2);\n}\n"],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NamedIconLoader } from './namedIcons';
|
|
1
|
+
import type { NamedIconLoader } from './namedIcons.js';
|
|
2
2
|
/**
|
|
3
3
|
* Loads any Lucide icon by its name (the names of lucide.dev/icons). Each icon is its own chunk,
|
|
4
4
|
* and so is the list of names, loaded the first time an icon is named. Bundlers emit a chunk per
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lucideIconLoader.js","names":[],"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,
|
|
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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IconComponent } from './Icon';
|
|
1
|
+
import type { IconComponent } from './Icon.js';
|
|
2
2
|
/**
|
|
3
3
|
* Loads an icon component from its name, as definitions name icons (`"icon": "send"`), or
|
|
4
4
|
* resolves with `null` for a name it doesn't know. `lucideIconLoader` of `@panneau/ui/named-icons`
|
package/dist/icon/namedIcons.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
3
|
import { createContext, use, useEffect, useSyncExternalStore } from "react";
|
|
3
4
|
//#region src/icon/namedIcons.tsx
|
|
@@ -60,44 +61,104 @@ var warnedWithoutLoader = false;
|
|
|
60
61
|
function getNamedIcon(name) {
|
|
61
62
|
const existing = components.get(name);
|
|
62
63
|
if (existing !== void 0) return existing;
|
|
63
|
-
const NamedIcon = (
|
|
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;
|
|
64
81
|
const loader = use(NamedIconLoaderContext);
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
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;
|
|
71
105
|
}
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
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);
|
|
76
117
|
if (entry?.status === "loaded") {
|
|
77
118
|
const Loaded = entry.icon;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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;
|
|
83
133
|
}
|
|
84
134
|
if (entry?.status === "missing") return null;
|
|
85
135
|
const { "aria-hidden": hidden, "aria-label": label, role } = props;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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;
|
|
96
156
|
};
|
|
97
157
|
NamedIcon.displayName = `NamedIcon(${name})`;
|
|
98
158
|
components.set(name, NamedIcon);
|
|
99
159
|
return NamedIcon;
|
|
100
160
|
}
|
|
161
|
+
function _temp() {}
|
|
101
162
|
//#endregion
|
|
102
163
|
export { NamedIconLoaderContext, getNamedIcon, loadNamedIcon };
|
|
103
164
|
|