@panneau/ui 5.0.0-alpha.4 → 5.0.0-alpha.42
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 +138 -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/bar-chart/BarChart.css +76 -0
- package/dist/bar-chart/BarChart.d.ts +33 -0
- package/dist/bar-chart/BarChart.d.ts.map +1 -0
- package/dist/bar-chart/BarChart.js +151 -0
- package/dist/bar-chart/BarChart.js.map +1 -0
- package/dist/bar-chart/BarChart.module.js +26 -0
- package/dist/bar-chart/BarChart.module.js.map +1 -0
- package/dist/bar-chart/tokens.d.ts +3 -0
- package/dist/bar-chart/tokens.d.ts.map +1 -0
- package/dist/bar-chart/tokens.js +17 -0
- package/dist/bar-chart/tokens.js.map +1 -0
- 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/chart-legend/ChartLegend.css +73 -0
- package/dist/chart-legend/ChartLegend.d.ts +32 -0
- package/dist/chart-legend/ChartLegend.d.ts.map +1 -0
- package/dist/chart-legend/ChartLegend.js +76 -0
- package/dist/chart-legend/ChartLegend.js.map +1 -0
- package/dist/chart-legend/ChartLegend.module.js +26 -0
- package/dist/chart-legend/ChartLegend.module.js.map +1 -0
- 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 +56 -4
- package/dist/date-picker/DatePicker.d.ts +16 -3
- package/dist/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/date-picker/DatePicker.js +359 -72
- package/dist/date-picker/DatePicker.js.map +1 -1
- package/dist/date-picker/DatePicker.module.js +8 -2
- 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 +44 -5
- 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 +71 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +25 -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 +314 -0
- package/dist/line-chart/LineChart.d.ts +84 -0
- package/dist/line-chart/LineChart.d.ts.map +1 -0
- package/dist/line-chart/LineChart.js +626 -0
- package/dist/line-chart/LineChart.js.map +1 -0
- package/dist/line-chart/LineChart.module.js +73 -0
- package/dist/line-chart/LineChart.module.js.map +1 -0
- package/dist/line-chart/geometry.d.ts +37 -0
- package/dist/line-chart/geometry.d.ts.map +1 -0
- package/dist/line-chart/geometry.js +115 -0
- package/dist/line-chart/geometry.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 +23 -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/meter/Meter.css +23 -0
- package/dist/meter/Meter.d.ts +26 -0
- package/dist/meter/Meter.d.ts.map +1 -0
- package/dist/meter/Meter.js +99 -0
- package/dist/meter/Meter.js.map +1 -0
- package/dist/meter/Meter.module.js +16 -0
- package/dist/meter/Meter.module.js.map +1 -0
- package/dist/meter/tokens.d.ts +3 -0
- package/dist/meter/tokens.d.ts.map +1 -0
- package/dist/meter/tokens.js +15 -0
- package/dist/meter/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 +7 -2
- 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 +214 -9
- package/dist/radio-group/RadioGroup.d.ts +34 -5
- package/dist/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/radio-group/RadioGroup.js +258 -43
- package/dist/radio-group/RadioGroup.js.map +1 -1
- package/dist/radio-group/RadioGroup.module.js +22 -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 +31 -3
- package/dist/radio-group/tokens.js.map +1 -1
- package/dist/root/PanneauRoot.css +35 -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/sparkline/Sparkline.css +44 -0
- package/dist/sparkline/Sparkline.d.ts +23 -0
- package/dist/sparkline/Sparkline.d.ts.map +1 -0
- package/dist/sparkline/Sparkline.js +164 -0
- package/dist/sparkline/Sparkline.js.map +1 -0
- package/dist/sparkline/Sparkline.module.js +20 -0
- package/dist/sparkline/Sparkline.module.js.map +1 -0
- package/dist/sparkline/tokens.d.ts +3 -0
- package/dist/sparkline/tokens.d.ts.map +1 -0
- package/dist/sparkline/tokens.js +17 -0
- package/dist/sparkline/tokens.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 +79 -0
- package/dist/stat/Stat.d.ts +49 -0
- package/dist/stat/Stat.d.ts.map +1 -0
- package/dist/stat/Stat.js +127 -0
- package/dist/stat/Stat.js.map +1 -0
- package/dist/stat/Stat.module.js +28 -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 +24 -11
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +26 -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 +10 -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 +180 -19
- package/dist/toast/Toast.d.ts +61 -10
- package/dist/toast/Toast.d.ts.map +1 -1
- package/dist/toast/Toast.js +246 -70
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/Toast.module.js +6 -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.css +1 -1
- package/dist/tooltip/Tooltip.js +38 -8
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/Tooltip.module.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
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
.panneau-bar-chart-chart {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--panneau-bar-chart-gap, var(--panneau-space-3));
|
|
5
|
+
min-width: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
padding: 0;
|
|
8
|
+
list-style: none;
|
|
9
|
+
font-size: var(--panneau-bar-chart-font-size, var(--panneau-font-size-sm));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.panneau-bar-chart-row {
|
|
13
|
+
display: flex;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
gap: var(--panneau-space-1);
|
|
16
|
+
min-width: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.panneau-bar-chart-text {
|
|
20
|
+
display: flex;
|
|
21
|
+
align-items: baseline;
|
|
22
|
+
justify-content: space-between;
|
|
23
|
+
gap: var(--panneau-space-3);
|
|
24
|
+
min-width: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.panneau-bar-chart-label {
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
color: var(--panneau-color-text);
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
text-overflow: ellipsis;
|
|
32
|
+
white-space: nowrap;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
a.panneau-bar-chart-label:hover,
|
|
36
|
+
a.panneau-bar-chart-label[data-hovered] {
|
|
37
|
+
text-decoration: underline;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.panneau-bar-chart-label[data-focus-visible] {
|
|
41
|
+
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
42
|
+
outline-offset: 2px;
|
|
43
|
+
border-radius: var(--panneau-radius-sm);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.panneau-bar-chart-value {
|
|
47
|
+
flex-shrink: 0;
|
|
48
|
+
font-variant-numeric: var(--panneau-font-numeric);
|
|
49
|
+
font-weight: var(--panneau-font-weight-medium);
|
|
50
|
+
color: var(--panneau-color-text);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.panneau-bar-chart-track {
|
|
54
|
+
height: var(--panneau-bar-chart-bar-height, 0.5rem);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/* A bar on the categorical chart color of the chart, or the solid color of its tone. */
|
|
58
|
+
.panneau-bar-chart-bar {
|
|
59
|
+
height: 100%;
|
|
60
|
+
min-width: 2px;
|
|
61
|
+
background-color: var(--_panneau-bar-chart-color);
|
|
62
|
+
border-radius: var(--panneau-bar-chart-bar-radius, var(--panneau-radius-full));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.panneau-bar-chart-toned .panneau-bar-chart-bar {
|
|
66
|
+
background-color: var(--panneau-tone-solid);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* The rest, after the parts: it steps back. */
|
|
70
|
+
.panneau-bar-chart-other .panneau-bar-chart-label {
|
|
71
|
+
color: var(--panneau-color-text-muted);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.panneau-bar-chart-other .panneau-bar-chart-bar {
|
|
75
|
+
background-color: var(--panneau-color-border-control);
|
|
76
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Tone } from '../theme/tones.js';
|
|
2
|
+
/** A bar of a `BarChart`: a part of the total. */
|
|
3
|
+
export interface BarChartItem {
|
|
4
|
+
/** What the part is: `Failed`. */
|
|
5
|
+
label: string;
|
|
6
|
+
value: number;
|
|
7
|
+
/** Colors the bar with the solid color of a tone, as the tone of an option of a `select`. */
|
|
8
|
+
tone?: Tone | undefined;
|
|
9
|
+
/** Makes the label a link: to the list of what the bar counts. */
|
|
10
|
+
href?: string | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface BarChartProps {
|
|
13
|
+
/** What the chart shows: the name of its list, for assistive technologies. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** The parts, in any order: the largest are drawn first. Left `undefined` while they load. */
|
|
16
|
+
items?: BarChartItem[] | undefined;
|
|
17
|
+
/** The rest of the total, past the items: a last row, "Other", whatever its size. */
|
|
18
|
+
other?: number | null | undefined;
|
|
19
|
+
/** Formats a value. Defaults to a number of the locale. */
|
|
20
|
+
formatValue?: (value: number) => string;
|
|
21
|
+
/** The categorical color of the bars without a tone, from 0. Defaults to the first. */
|
|
22
|
+
color?: number;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Horizontal bars of the parts of a total, the largest first, each with its label and its value
|
|
27
|
+
* formatted for the locale, and the rest of the total last, as "Other". Bars are on the categorical
|
|
28
|
+
* chart colors of the theme, or the color of their tone, and as long as their value against the
|
|
29
|
+
* largest one. Assistive technologies read a list of labels and values; the bars are hidden from
|
|
30
|
+
* them.
|
|
31
|
+
*/
|
|
32
|
+
export declare function BarChart({ label, items, other, formatValue, color, className, }: BarChartProps): import("react").JSX.Element;
|
|
33
|
+
//# sourceMappingURL=BarChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.d.ts","sourceRoot":"","sources":["../../src/bar-chart/BarChart.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,kDAAkD;AAClD,MAAM,WAAW,YAAY;IACzB,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,IAAI,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC;IACxB,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B;AAED,MAAM,WAAW,aAAa;IAC1B,8EAA8E;IAC9E,KAAK,EAAE,MAAM,CAAC;IACd,8FAA8F;IAC9F,KAAK,CAAC,EAAE,YAAY,EAAE,GAAG,SAAS,CAAC;IACnC,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAClC,2DAA2D;IAC3D,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,uFAAuF;IACvF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EACrB,KAAK,EACL,KAAK,EACL,KAAK,EACL,WAAW,EACX,KAAS,EACT,SAAS,GACZ,EAAE,aAAa,+BAoEf"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { messages } from "../intl/messages.js";
|
|
3
|
+
import { usePanneauIntl } from "../intl/usePanneauIntl.js";
|
|
4
|
+
import { toneClass } from "../theme/toneClass.js";
|
|
5
|
+
import { Skeleton } from "../skeleton/Skeleton.js";
|
|
6
|
+
import { chartColors } from "../theme/chartColors.js";
|
|
7
|
+
import BarChart_module_default from "./BarChart.module.js";
|
|
8
|
+
import { c } from "react/compiler-runtime";
|
|
9
|
+
import { Link } from "react-aria-components";
|
|
10
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
|
+
//#region src/bar-chart/BarChart.tsx
|
|
12
|
+
/** Rows of the skeleton. */
|
|
13
|
+
var SKELETON_ROWS = [
|
|
14
|
+
80,
|
|
15
|
+
55,
|
|
16
|
+
30
|
|
17
|
+
];
|
|
18
|
+
/**
|
|
19
|
+
* Horizontal bars of the parts of a total, the largest first, each with its label and its value
|
|
20
|
+
* formatted for the locale, and the rest of the total last, as "Other". Bars are on the categorical
|
|
21
|
+
* chart colors of the theme, or the color of their tone, and as long as their value against the
|
|
22
|
+
* largest one. Assistive technologies read a list of labels and values; the bars are hidden from
|
|
23
|
+
* them.
|
|
24
|
+
*/
|
|
25
|
+
function BarChart(t0) {
|
|
26
|
+
const $ = c(23);
|
|
27
|
+
const { label, items, other, formatValue, color: t1, className } = t0;
|
|
28
|
+
const color = t1 === void 0 ? 0 : t1;
|
|
29
|
+
const intl = usePanneauIntl();
|
|
30
|
+
let t2;
|
|
31
|
+
if ($[0] !== formatValue || $[1] !== intl) {
|
|
32
|
+
t2 = formatValue ?? ((value) => intl.formatNumber(value));
|
|
33
|
+
$[0] = formatValue;
|
|
34
|
+
$[1] = intl;
|
|
35
|
+
$[2] = t2;
|
|
36
|
+
} else t2 = $[2];
|
|
37
|
+
const format = t2;
|
|
38
|
+
let t3;
|
|
39
|
+
if ($[3] !== color) {
|
|
40
|
+
t3 = chartColors.categorical(color);
|
|
41
|
+
$[3] = color;
|
|
42
|
+
$[4] = t3;
|
|
43
|
+
} else t3 = $[4];
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[5] !== t3) {
|
|
46
|
+
t4 = { "--_panneau-bar-chart-color": t3 };
|
|
47
|
+
$[5] = t3;
|
|
48
|
+
$[6] = t4;
|
|
49
|
+
} else t4 = $[6];
|
|
50
|
+
const style = t4;
|
|
51
|
+
if (items === void 0) {
|
|
52
|
+
let t5;
|
|
53
|
+
if ($[7] !== className) {
|
|
54
|
+
t5 = cx("panneau-bar-chart", BarChart_module_default.chart, className);
|
|
55
|
+
$[7] = className;
|
|
56
|
+
$[8] = t5;
|
|
57
|
+
} else t5 = $[8];
|
|
58
|
+
let t6;
|
|
59
|
+
if ($[9] === Symbol.for("react.memo_cache_sentinel")) {
|
|
60
|
+
t6 = SKELETON_ROWS.map(_temp);
|
|
61
|
+
$[9] = t6;
|
|
62
|
+
} else t6 = $[9];
|
|
63
|
+
let t7;
|
|
64
|
+
if ($[10] !== style || $[11] !== t5) {
|
|
65
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
66
|
+
className: t5,
|
|
67
|
+
style,
|
|
68
|
+
children: t6
|
|
69
|
+
});
|
|
70
|
+
$[10] = style;
|
|
71
|
+
$[11] = t5;
|
|
72
|
+
$[12] = t7;
|
|
73
|
+
} else t7 = $[12];
|
|
74
|
+
return t7;
|
|
75
|
+
}
|
|
76
|
+
const rest = other !== void 0 && other !== null && other > 0 ? other : null;
|
|
77
|
+
let t5;
|
|
78
|
+
if ($[13] !== className || $[14] !== format || $[15] !== intl || $[16] !== items || $[17] !== label || $[18] !== rest || $[19] !== style) {
|
|
79
|
+
const sorted = [...items].sort(_temp2);
|
|
80
|
+
const largest = Math.max(0, rest ?? 0, ...sorted.map(_temp3));
|
|
81
|
+
const rows = [...sorted, ...rest !== null ? [{
|
|
82
|
+
label: intl.formatMessage(messages.barChartOther),
|
|
83
|
+
value: rest,
|
|
84
|
+
isOther: true
|
|
85
|
+
}] : []];
|
|
86
|
+
let t6;
|
|
87
|
+
if ($[21] !== className) {
|
|
88
|
+
t6 = cx("panneau-bar-chart", BarChart_module_default.chart, className);
|
|
89
|
+
$[21] = className;
|
|
90
|
+
$[22] = t6;
|
|
91
|
+
} else t6 = $[22];
|
|
92
|
+
t5 = /* @__PURE__ */ jsx("ul", {
|
|
93
|
+
"aria-label": label,
|
|
94
|
+
className: t6,
|
|
95
|
+
style,
|
|
96
|
+
children: rows.map((row, index) => /* @__PURE__ */ jsxs("li", {
|
|
97
|
+
className: cx(BarChart_module_default.row, row.isOther === true && BarChart_module_default.other, row.tone !== void 0 && BarChart_module_default.toned, row.tone !== void 0 && toneClass(row.tone)),
|
|
98
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
99
|
+
className: BarChart_module_default.text,
|
|
100
|
+
children: [row.href !== void 0 ? /* @__PURE__ */ jsx(Link, {
|
|
101
|
+
href: row.href,
|
|
102
|
+
className: BarChart_module_default.label,
|
|
103
|
+
children: row.label
|
|
104
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
105
|
+
className: BarChart_module_default.label,
|
|
106
|
+
children: row.label
|
|
107
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
108
|
+
className: BarChart_module_default.value,
|
|
109
|
+
children: format(row.value)
|
|
110
|
+
})]
|
|
111
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: BarChart_module_default.track,
|
|
113
|
+
"aria-hidden": "true",
|
|
114
|
+
children: row.value > 0 && largest > 0 ? /* @__PURE__ */ jsx("div", {
|
|
115
|
+
className: BarChart_module_default.bar,
|
|
116
|
+
style: { width: `${row.value / largest * 100}%` }
|
|
117
|
+
}) : null
|
|
118
|
+
})]
|
|
119
|
+
}, `${index}-${row.label}`))
|
|
120
|
+
});
|
|
121
|
+
$[13] = className;
|
|
122
|
+
$[14] = format;
|
|
123
|
+
$[15] = intl;
|
|
124
|
+
$[16] = items;
|
|
125
|
+
$[17] = label;
|
|
126
|
+
$[18] = rest;
|
|
127
|
+
$[19] = style;
|
|
128
|
+
$[20] = t5;
|
|
129
|
+
} else t5 = $[20];
|
|
130
|
+
return t5;
|
|
131
|
+
}
|
|
132
|
+
function _temp3(item) {
|
|
133
|
+
return item.value;
|
|
134
|
+
}
|
|
135
|
+
function _temp2(a, b) {
|
|
136
|
+
return b.value - a.value;
|
|
137
|
+
}
|
|
138
|
+
function _temp(width) {
|
|
139
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
140
|
+
className: BarChart_module_default.row,
|
|
141
|
+
children: [/* @__PURE__ */ jsx(Skeleton, { width: `${width / 2 + 20}%` }), /* @__PURE__ */ jsx(Skeleton, {
|
|
142
|
+
shape: "rect",
|
|
143
|
+
width: `${width}%`,
|
|
144
|
+
height: "var(--panneau-bar-chart-bar-height, 0.5rem)"
|
|
145
|
+
})]
|
|
146
|
+
}, width);
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
export { BarChart };
|
|
150
|
+
|
|
151
|
+
//# sourceMappingURL=BarChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.js","names":["CSSProperties","Link","messages","usePanneauIntl","Skeleton","chartColors","toneClass","Tone","cx","styles","BarChartItem","label","value","tone","href","BarChartProps","items","other","formatValue","color","className","SKELETON_ROWS","BarChart","t0","$","_c","t1","undefined","intl","t2","formatNumber","format","t3","categorical","t4","style","t5","chart","t6","Symbol","for","map","_temp","t7","rest","sorted","sort","_temp2","largest","Math","max","_temp3","rows","formatMessage","barChartOther","isOther","row","index","toned","text","track","bar","width","item","a","b","_c","styles"],"sources":["../../src/bar-chart/BarChart.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\nimport { Link } from 'react-aria-components';\n\nimport { messages } from '../intl/messages';\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { chartColors } from '../theme/chartColors';\nimport { toneClass } from '../theme/toneClass';\nimport type { Tone } from '../theme/tones';\nimport { cx } from '../utils/cx';\nimport styles from './BarChart.module.css';\n\n/** A bar of a `BarChart`: a part of the total. */\nexport interface BarChartItem {\n /** What the part is: `Failed`. */\n label: string;\n value: number;\n /** Colors the bar with the solid color of a tone, as the tone of an option of a `select`. */\n tone?: Tone | undefined;\n /** Makes the label a link: to the list of what the bar counts. */\n href?: string | undefined;\n}\n\nexport interface BarChartProps {\n /** What the chart shows: the name of its list, for assistive technologies. */\n label: string;\n /** The parts, in any order: the largest are drawn first. Left `undefined` while they load. */\n items?: BarChartItem[] | undefined;\n /** The rest of the total, past the items: a last row, \"Other\", whatever its size. */\n other?: number | null | undefined;\n /** Formats a value. Defaults to a number of the locale. */\n formatValue?: (value: number) => string;\n /** The categorical color of the bars without a tone, from 0. Defaults to the first. */\n color?: number;\n className?: string;\n}\n\n/** Rows of the skeleton. */\nconst SKELETON_ROWS = [80, 55, 30];\n\n/**\n * Horizontal bars of the parts of a total, the largest first, each with its label and its value\n * formatted for the locale, and the rest of the total last, as \"Other\". Bars are on the categorical\n * chart colors of the theme, or the color of their tone, and as long as their value against the\n * largest one. Assistive technologies read a list of labels and values; the bars are hidden from\n * them.\n */\nexport function BarChart({\n label,\n items,\n other,\n formatValue,\n color = 0,\n className,\n}: BarChartProps) {\n const intl = usePanneauIntl();\n const format = formatValue ?? ((value: number) => intl.formatNumber(value));\n const style = { '--_panneau-bar-chart-color': chartColors.categorical(color) } as CSSProperties;\n if (items === undefined) {\n return (\n <div className={cx('panneau-bar-chart', styles.chart, className)} style={style}>\n {SKELETON_ROWS.map((width) => (\n <div key={width} className={styles.row}>\n <Skeleton width={`${width / 2 + 20}%`} />\n <Skeleton\n shape=\"rect\"\n width={`${width}%`}\n height=\"var(--panneau-bar-chart-bar-height, 0.5rem)\"\n />\n </div>\n ))}\n </div>\n );\n }\n const rest = other !== undefined && other !== null && other > 0 ? other : null;\n // The largest first; equal parts keep their order\n const sorted = [...items].sort((a, b) => b.value - a.value);\n const largest = Math.max(0, rest ?? 0, ...sorted.map((item) => item.value));\n const rows: (BarChartItem & { isOther?: boolean })[] = [\n ...sorted,\n ...(rest !== null\n ? [{ label: intl.formatMessage(messages.barChartOther), value: rest, isOther: true }]\n : []),\n ];\n return (\n <ul\n aria-label={label}\n className={cx('panneau-bar-chart', styles.chart, className)}\n style={style}\n >\n {rows.map((row, index) => (\n <li\n key={`${index}-${row.label}`}\n className={cx(\n styles.row,\n row.isOther === true && styles.other,\n row.tone !== undefined && styles.toned,\n row.tone !== undefined && toneClass(row.tone),\n )}\n >\n <div className={styles.text}>\n {row.href !== undefined ? (\n <Link href={row.href} className={styles.label}>\n {row.label}\n </Link>\n ) : (\n <span className={styles.label}>{row.label}</span>\n )}\n <span className={styles.value}>{format(row.value)}</span>\n </div>\n <div className={styles.track} aria-hidden=\"true\">\n {row.value > 0 && largest > 0 ? (\n <div\n className={styles.bar}\n style={{ width: `${(row.value / largest) * 100}%` }}\n />\n ) : null}\n </div>\n </li>\n ))}\n </ul>\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import "./BarChart.css";
|
|
2
|
+
//#region src/bar-chart/BarChart.module.css
|
|
3
|
+
var chart = "panneau-bar-chart-chart";
|
|
4
|
+
var row = "panneau-bar-chart-row";
|
|
5
|
+
var text = "panneau-bar-chart-text";
|
|
6
|
+
var label = "panneau-bar-chart-label";
|
|
7
|
+
var value = "panneau-bar-chart-value";
|
|
8
|
+
var track = "panneau-bar-chart-track";
|
|
9
|
+
var bar = "panneau-bar-chart-bar";
|
|
10
|
+
var toned = "panneau-bar-chart-toned";
|
|
11
|
+
var other = "panneau-bar-chart-other";
|
|
12
|
+
var BarChart_module_default = {
|
|
13
|
+
chart,
|
|
14
|
+
row,
|
|
15
|
+
text,
|
|
16
|
+
label,
|
|
17
|
+
value,
|
|
18
|
+
track,
|
|
19
|
+
bar,
|
|
20
|
+
toned,
|
|
21
|
+
other
|
|
22
|
+
};
|
|
23
|
+
//#endregion
|
|
24
|
+
export { bar, chart, BarChart_module_default as default, label, other, row, text, toned, track, value };
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=BarChart.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BarChart.module.js","names":[],"sources":["../../src/bar-chart/BarChart.module.css"],"sourcesContent":[".chart {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-bar-chart-gap, var(--panneau-space-3));\n min-width: 0;\n margin: 0;\n padding: 0;\n list-style: none;\n font-size: var(--panneau-bar-chart-font-size, var(--panneau-font-size-sm));\n}\n\n.row {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n}\n\n.text {\n display: flex;\n align-items: baseline;\n justify-content: space-between;\n gap: var(--panneau-space-3);\n min-width: 0;\n}\n\n.label {\n overflow: hidden;\n color: var(--panneau-color-text);\n text-decoration: none;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\na.label:hover,\na.label[data-hovered] {\n text-decoration: underline;\n}\n\n.label[data-focus-visible] {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n border-radius: var(--panneau-radius-sm);\n}\n\n.value {\n flex-shrink: 0;\n font-variant-numeric: var(--panneau-font-numeric);\n font-weight: var(--panneau-font-weight-medium);\n color: var(--panneau-color-text);\n}\n\n.track {\n height: var(--panneau-bar-chart-bar-height, 0.5rem);\n}\n\n/* A bar on the categorical chart color of the chart, or the solid color of its tone. */\n.bar {\n height: 100%;\n min-width: 2px;\n background-color: var(--_panneau-bar-chart-color);\n border-radius: var(--panneau-bar-chart-bar-radius, var(--panneau-radius-full));\n}\n\n.toned .bar {\n background-color: var(--panneau-tone-solid);\n}\n\n/* The rest, after the parts: it steps back. */\n.other .label {\n color: var(--panneau-color-text-muted);\n}\n\n.other .bar {\n background-color: var(--panneau-color-border-control);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Tokens of BarChart. */
|
|
2
|
+
export declare const barChartTokens: import("../index.js").ComponentTokens<"bar-chart", "panneau-bar-chart-gap" | "panneau-bar-chart-font-size" | "panneau-bar-chart-bar-height" | "panneau-bar-chart-bar-radius">;
|
|
3
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/bar-chart/tokens.ts"],"names":[],"mappings":"AAEA,0BAA0B;AAC1B,eAAO,MAAM,cAAc,sKASzB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineComponentTokens } from "../theme/componentTokens.js";
|
|
2
|
+
//#region src/bar-chart/tokens.ts
|
|
3
|
+
/** Tokens of BarChart. */
|
|
4
|
+
var barChartTokens = defineComponentTokens("bar-chart", {
|
|
5
|
+
/** Height of a bar. */
|
|
6
|
+
"bar-height": "0.5rem",
|
|
7
|
+
/** Corners of a bar. */
|
|
8
|
+
"bar-radius": "var(--panneau-radius-full)",
|
|
9
|
+
/** Space between the rows. */
|
|
10
|
+
gap: "var(--panneau-space-3)",
|
|
11
|
+
/** Font size of the labels and the values. */
|
|
12
|
+
"font-size": "var(--panneau-font-size-sm)"
|
|
13
|
+
});
|
|
14
|
+
//#endregion
|
|
15
|
+
export { barChartTokens };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=tokens.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","barChartTokens","gap"],"sources":["../../src/bar-chart/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of BarChart. */\nexport const barChartTokens = defineComponentTokens('bar-chart', {\n /** Height of a bar. */\n 'bar-height': '0.5rem',\n /** Corners of a bar. */\n 'bar-radius': 'var(--panneau-radius-full)',\n /** Space between the rows. */\n gap: 'var(--panneau-space-3)',\n /** Font size of the labels and the values. */\n 'font-size': 'var(--panneau-font-size-sm)',\n});\n"],"mappings":";;;AAGA,IAAaC,iBAAiBD,sBAAsB,aAAa;;CAE7D,cAAc;;CAEd,cAAc;;CAEdE,KAAK;;CAEL,aAAa;AACjB,CAAC"}
|
package/dist/button/Button.css
CHANGED
|
@@ -23,10 +23,21 @@
|
|
|
23
23
|
transition:
|
|
24
24
|
background-color var(--panneau-duration),
|
|
25
25
|
border-color var(--panneau-duration),
|
|
26
|
-
color var(--panneau-duration)
|
|
26
|
+
color var(--panneau-duration),
|
|
27
|
+
scale var(--panneau-duration);
|
|
27
28
|
-webkit-tap-highlight-color: transparent;
|
|
28
29
|
}
|
|
29
30
|
|
|
31
|
+
.panneau-button[data-pressed]:not([data-disabled]) {
|
|
32
|
+
scale: var(--panneau-button-pressed-scale, 1);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@media (prefers-reduced-motion: reduce) {
|
|
36
|
+
.panneau-button[data-pressed]:not([data-disabled]) {
|
|
37
|
+
scale: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
30
41
|
.panneau-button[data-focus-visible] {
|
|
31
42
|
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
32
43
|
outline-offset: 2px;
|
|
@@ -56,6 +67,7 @@
|
|
|
56
67
|
.panneau-button-solid {
|
|
57
68
|
color: var(--panneau-tone-solid-text);
|
|
58
69
|
background-color: var(--panneau-tone-solid);
|
|
70
|
+
border-color: var(--panneau-button-solid-border-color, transparent);
|
|
59
71
|
}
|
|
60
72
|
|
|
61
73
|
.panneau-button-solid[data-hovered],
|
package/dist/button/Button.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CSSProperties, ReactNode } from 'react';
|
|
2
2
|
import { type ButtonProps as AriaButtonProps } from 'react-aria-components';
|
|
3
|
-
import { type IconComponent } from '../icon/Icon';
|
|
4
|
-
import type { Tone } from '../theme/tones';
|
|
5
|
-
|
|
3
|
+
import { type IconComponent } from '../icon/Icon.js';
|
|
4
|
+
import type { Tone } from '../theme/tones.js';
|
|
5
|
+
declare const styles: Readonly<Record<string, string>>;
|
|
6
6
|
/** How a button uses its tone, like Bootstrap's `.btn-*` and `.btn-outline-*`. */
|
|
7
7
|
export type ButtonAppearance = 'solid' | 'outline' | 'subtle' | 'ghost';
|
|
8
8
|
/**
|
|
@@ -26,7 +26,8 @@ export interface ButtonVariants {
|
|
|
26
26
|
* @deprecated Use `tone` and `appearance`.
|
|
27
27
|
*/
|
|
28
28
|
export type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
29
|
-
|
|
29
|
+
/** The look of a button, shared by `Button` and `LinkButton`. */
|
|
30
|
+
export interface ButtonStyleProps {
|
|
30
31
|
/** Defaults to `neutral`. */
|
|
31
32
|
tone?: Tone;
|
|
32
33
|
/** Defaults to `outline` for the neutral tone, and `solid` for the others. */
|
|
@@ -40,14 +41,27 @@ export interface ButtonProps extends Omit<AriaButtonProps, 'className' | 'style'
|
|
|
40
41
|
iconEnd?: IconComponent;
|
|
41
42
|
/** Takes the full width of its container. */
|
|
42
43
|
fullWidth?: boolean;
|
|
44
|
+
}
|
|
45
|
+
export interface ButtonProps extends ButtonStyleProps, Omit<AriaButtonProps, 'className' | 'style' | 'children'> {
|
|
46
|
+
/** The keys that do what the button does, such as `Control+Enter`. */
|
|
47
|
+
'aria-keyshortcuts'?: string;
|
|
43
48
|
children?: ReactNode;
|
|
44
49
|
className?: string;
|
|
45
50
|
style?: CSSProperties;
|
|
46
51
|
}
|
|
52
|
+
/** The class names of a button from its style props, for `Button` and `LinkButton`. */
|
|
53
|
+
export declare function getButtonClassName({ tone, appearance, variant, size, fullWidth, className, }: Pick<ButtonStyleProps, 'tone' | 'appearance' | 'variant' | 'size' | 'fullWidth'> & {
|
|
54
|
+
className?: string | undefined;
|
|
55
|
+
}): string;
|
|
56
|
+
/** The icons and label of a button. */
|
|
57
|
+
export declare function ButtonContent({ icon, iconEnd, size, children, }: Pick<ButtonStyleProps, 'icon' | 'iconEnd' | 'size'> & {
|
|
58
|
+
children?: ReactNode;
|
|
59
|
+
}): import("react").JSX.Element;
|
|
47
60
|
/**
|
|
48
61
|
* A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses
|
|
49
|
-
* while assistive technologies announce the pending state.
|
|
62
|
+
* while assistive technologies announce the pending state. `aria-keyshortcuts` gives the keys
|
|
63
|
+
* that do what it does.
|
|
50
64
|
*/
|
|
51
|
-
export declare function Button({ tone, appearance, variant, size, icon, iconEnd, fullWidth, isPending, children, className, ...props }: ButtonProps): import("react").JSX.Element;
|
|
65
|
+
export declare function Button({ tone, appearance, variant, size, icon, iconEnd, fullWidth, isPending, children, className, 'aria-keyshortcuts': keyShortcuts, render, ...props }: ButtonProps): import("react").JSX.Element;
|
|
52
66
|
export { styles as buttonStyles };
|
|
53
67
|
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAwB,KAAK,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElG,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExE;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,cAAc;CAAG;AAElC;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAazE,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../src/button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACtD,OAAO,EAAwB,KAAK,WAAW,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElG,OAAO,EAAQ,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,MAAM,MAAM,qBAAqB,CAAC;AAEzC,kFAAkF;AAClF,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CAAC;AAExE;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,cAAc;CAAG;AAElC;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAazE,iEAAiE;AACjE,MAAM,WAAW,gBAAgB;IAC7B,6BAA6B;IAC7B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,8EAA8E;IAC9E,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,mFAAmF;IACnF,OAAO,CAAC,EAAE,aAAa,GAAG,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,6BAA6B;IAC7B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,4BAA4B;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,6CAA6C;IAC7C,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,WACb,SAAQ,gBAAgB,EAAE,IAAI,CAAC,eAAe,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,CAAC;IACnF,sEAAsE;IACtE,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,uFAAuF;AACvF,wBAAgB,kBAAkB,CAAC,EAC/B,IAAI,EACJ,UAAU,EACV,OAAO,EACP,IAAW,EACX,SAAiB,EACjB,SAAS,GACZ,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC,GAAG;IAClF,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC,GAAG,MAAM,CAeT;AAED,uCAAuC;AACvC,wBAAgB,aAAa,CAAC,EAC1B,IAAI,EACJ,OAAO,EACP,IAAW,EACX,QAAQ,GACX,EAAE,IAAI,CAAC,gBAAgB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,GAAG;IAAE,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,+BAUhF;AAED;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,EACnB,IAAI,EACJ,UAAU,EACV,OAAO,EACP,IAAW,EACX,IAAI,EACJ,OAAO,EACP,SAAiB,EACjB,SAAiB,EACjB,QAAQ,EACR,SAAS,EACT,mBAAmB,EAAE,YAAY,EACjC,MAAM,EACN,GAAG,KAAK,EACX,EAAE,WAAW,+BAqCb;AAED,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,CAAC"}
|
package/dist/button/Button.js
CHANGED
|
@@ -3,6 +3,7 @@ import { Icon } from "../icon/Icon.js";
|
|
|
3
3
|
import { Spinner } from "../spinner/Spinner.js";
|
|
4
4
|
import { toneClass } from "../theme/toneClass.js";
|
|
5
5
|
import Button_module_default from "./Button.module.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
6
7
|
import { Button } from "react-aria-components";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region src/button/Button.tsx
|
|
@@ -27,38 +28,184 @@ var ALIASES = {
|
|
|
27
28
|
function isAlias(variant) {
|
|
28
29
|
return Object.hasOwn(ALIASES, variant);
|
|
29
30
|
}
|
|
30
|
-
/**
|
|
31
|
-
|
|
32
|
-
* while assistive technologies announce the pending state.
|
|
33
|
-
*/
|
|
34
|
-
function Button$1({ tone, appearance, variant, size = "md", icon, iconEnd, fullWidth = false, isPending = false, children, className, ...props }) {
|
|
31
|
+
/** The class names of a button from its style props, for `Button` and `LinkButton`. */
|
|
32
|
+
function getButtonClassName({ tone, appearance, variant, size = "md", fullWidth = false, className }) {
|
|
35
33
|
const alias = variant !== void 0 && isAlias(variant) ? ALIASES[variant] : void 0;
|
|
36
34
|
const resolvedTone = tone ?? alias?.tone ?? "neutral";
|
|
37
35
|
const resolvedAppearance = appearance ?? alias?.appearance ?? (resolvedTone === "neutral" ? "outline" : "solid");
|
|
38
|
-
return
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
36
|
+
return cx("panneau-button", Button_module_default.button, toneClass(resolvedTone), Button_module_default[resolvedAppearance], variant !== void 0 && alias === void 0 && `panneau-button-variant-${variant}`, size === "sm" && Button_module_default.sm, fullWidth && Button_module_default.fullWidth, className);
|
|
37
|
+
}
|
|
38
|
+
/** The icons and label of a button. */
|
|
39
|
+
function ButtonContent(t0) {
|
|
40
|
+
const $ = c(10);
|
|
41
|
+
const { icon, iconEnd, size: t1, children } = t0;
|
|
42
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
43
|
+
let t2;
|
|
44
|
+
if ($[0] !== icon || $[1] !== size) {
|
|
45
|
+
t2 = icon !== void 0 ? /* @__PURE__ */ jsx(Icon, {
|
|
46
|
+
icon,
|
|
47
|
+
size: size === "sm" ? "sm" : "md"
|
|
48
|
+
}) : null;
|
|
49
|
+
$[0] = icon;
|
|
50
|
+
$[1] = size;
|
|
51
|
+
$[2] = t2;
|
|
52
|
+
} else t2 = $[2];
|
|
53
|
+
let t3;
|
|
54
|
+
if ($[3] !== iconEnd || $[4] !== size) {
|
|
55
|
+
t3 = iconEnd !== void 0 ? /* @__PURE__ */ jsx(Icon, {
|
|
56
|
+
icon: iconEnd,
|
|
57
|
+
size: size === "sm" ? "sm" : "md"
|
|
58
|
+
}) : null;
|
|
59
|
+
$[3] = iconEnd;
|
|
60
|
+
$[4] = size;
|
|
61
|
+
$[5] = t3;
|
|
62
|
+
} else t3 = $[5];
|
|
63
|
+
let t4;
|
|
64
|
+
if ($[6] !== children || $[7] !== t2 || $[8] !== t3) {
|
|
65
|
+
t4 = /* @__PURE__ */ jsxs("span", {
|
|
43
66
|
className: Button_module_default.content,
|
|
44
67
|
children: [
|
|
45
|
-
|
|
46
|
-
icon,
|
|
47
|
-
size: size === "sm" ? "sm" : "md"
|
|
48
|
-
}) : null,
|
|
68
|
+
t2,
|
|
49
69
|
children,
|
|
50
|
-
|
|
51
|
-
icon: iconEnd,
|
|
52
|
-
size: size === "sm" ? "sm" : "md"
|
|
53
|
-
}) : null
|
|
70
|
+
t3
|
|
54
71
|
]
|
|
55
|
-
})
|
|
72
|
+
});
|
|
73
|
+
$[6] = children;
|
|
74
|
+
$[7] = t2;
|
|
75
|
+
$[8] = t3;
|
|
76
|
+
$[9] = t4;
|
|
77
|
+
} else t4 = $[9];
|
|
78
|
+
return t4;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A button. With `isPending`, it shows a spinner, keeps its size and focus, and ignores presses
|
|
82
|
+
* while assistive technologies announce the pending state. `aria-keyshortcuts` gives the keys
|
|
83
|
+
* that do what it does.
|
|
84
|
+
*/
|
|
85
|
+
function Button$1(t0) {
|
|
86
|
+
const $ = c(39);
|
|
87
|
+
let appearance;
|
|
88
|
+
let children;
|
|
89
|
+
let className;
|
|
90
|
+
let icon;
|
|
91
|
+
let iconEnd;
|
|
92
|
+
let keyShortcuts;
|
|
93
|
+
let props;
|
|
94
|
+
let render;
|
|
95
|
+
let t1;
|
|
96
|
+
let t2;
|
|
97
|
+
let t3;
|
|
98
|
+
let tone;
|
|
99
|
+
let variant;
|
|
100
|
+
if ($[0] !== t0) {
|
|
101
|
+
({tone, appearance, variant, size: t1, icon, iconEnd, fullWidth: t2, isPending: t3, children, className, "aria-keyshortcuts": keyShortcuts, render, ...props} = t0);
|
|
102
|
+
$[0] = t0;
|
|
103
|
+
$[1] = appearance;
|
|
104
|
+
$[2] = children;
|
|
105
|
+
$[3] = className;
|
|
106
|
+
$[4] = icon;
|
|
107
|
+
$[5] = iconEnd;
|
|
108
|
+
$[6] = keyShortcuts;
|
|
109
|
+
$[7] = props;
|
|
110
|
+
$[8] = render;
|
|
111
|
+
$[9] = t1;
|
|
112
|
+
$[10] = t2;
|
|
113
|
+
$[11] = t3;
|
|
114
|
+
$[12] = tone;
|
|
115
|
+
$[13] = variant;
|
|
116
|
+
} else {
|
|
117
|
+
appearance = $[1];
|
|
118
|
+
children = $[2];
|
|
119
|
+
className = $[3];
|
|
120
|
+
icon = $[4];
|
|
121
|
+
iconEnd = $[5];
|
|
122
|
+
keyShortcuts = $[6];
|
|
123
|
+
props = $[7];
|
|
124
|
+
render = $[8];
|
|
125
|
+
t1 = $[9];
|
|
126
|
+
t2 = $[10];
|
|
127
|
+
t3 = $[11];
|
|
128
|
+
tone = $[12];
|
|
129
|
+
variant = $[13];
|
|
130
|
+
}
|
|
131
|
+
const size = t1 === void 0 ? "md" : t1;
|
|
132
|
+
const fullWidth = t2 === void 0 ? false : t2;
|
|
133
|
+
const isPending = t3 === void 0 ? false : t3;
|
|
134
|
+
let t4;
|
|
135
|
+
if ($[14] !== keyShortcuts || $[15] !== render) {
|
|
136
|
+
t4 = keyShortcuts === void 0 ? render : (domProps, values) => {
|
|
137
|
+
const withShortcuts = {
|
|
138
|
+
...domProps,
|
|
139
|
+
"aria-keyshortcuts": keyShortcuts
|
|
140
|
+
};
|
|
141
|
+
return render !== void 0 ? render(withShortcuts, values) : /* @__PURE__ */ jsx("button", { ...withShortcuts });
|
|
142
|
+
};
|
|
143
|
+
$[14] = keyShortcuts;
|
|
144
|
+
$[15] = render;
|
|
145
|
+
$[16] = t4;
|
|
146
|
+
} else t4 = $[16];
|
|
147
|
+
let t5;
|
|
148
|
+
if ($[17] !== appearance || $[18] !== className || $[19] !== fullWidth || $[20] !== isPending || $[21] !== size || $[22] !== tone || $[23] !== variant) {
|
|
149
|
+
t5 = getButtonClassName({
|
|
150
|
+
tone,
|
|
151
|
+
appearance,
|
|
152
|
+
variant,
|
|
153
|
+
size,
|
|
154
|
+
fullWidth,
|
|
155
|
+
className: cx(isPending && Button_module_default.pending, className)
|
|
156
|
+
});
|
|
157
|
+
$[17] = appearance;
|
|
158
|
+
$[18] = className;
|
|
159
|
+
$[19] = fullWidth;
|
|
160
|
+
$[20] = isPending;
|
|
161
|
+
$[21] = size;
|
|
162
|
+
$[22] = tone;
|
|
163
|
+
$[23] = variant;
|
|
164
|
+
$[24] = t5;
|
|
165
|
+
} else t5 = $[24];
|
|
166
|
+
let t6;
|
|
167
|
+
if ($[25] !== children || $[26] !== icon || $[27] !== iconEnd || $[28] !== size) {
|
|
168
|
+
t6 = /* @__PURE__ */ jsx(ButtonContent, {
|
|
169
|
+
icon,
|
|
170
|
+
iconEnd,
|
|
171
|
+
size,
|
|
172
|
+
children
|
|
173
|
+
});
|
|
174
|
+
$[25] = children;
|
|
175
|
+
$[26] = icon;
|
|
176
|
+
$[27] = iconEnd;
|
|
177
|
+
$[28] = size;
|
|
178
|
+
$[29] = t6;
|
|
179
|
+
} else t6 = $[29];
|
|
180
|
+
let t7;
|
|
181
|
+
if ($[30] !== isPending) {
|
|
182
|
+
t7 = isPending ? /* @__PURE__ */ jsx("span", {
|
|
56
183
|
className: Button_module_default.spinner,
|
|
57
184
|
children: /* @__PURE__ */ jsx(Spinner, { size: "sm" })
|
|
58
|
-
}) : null
|
|
59
|
-
|
|
185
|
+
}) : null;
|
|
186
|
+
$[30] = isPending;
|
|
187
|
+
$[31] = t7;
|
|
188
|
+
} else t7 = $[31];
|
|
189
|
+
let t8;
|
|
190
|
+
if ($[32] !== isPending || $[33] !== props || $[34] !== t4 || $[35] !== t5 || $[36] !== t6 || $[37] !== t7) {
|
|
191
|
+
t8 = /* @__PURE__ */ jsxs(Button, {
|
|
192
|
+
...props,
|
|
193
|
+
render: t4,
|
|
194
|
+
isPending,
|
|
195
|
+
className: t5,
|
|
196
|
+
children: [t6, t7]
|
|
197
|
+
});
|
|
198
|
+
$[32] = isPending;
|
|
199
|
+
$[33] = props;
|
|
200
|
+
$[34] = t4;
|
|
201
|
+
$[35] = t5;
|
|
202
|
+
$[36] = t6;
|
|
203
|
+
$[37] = t7;
|
|
204
|
+
$[38] = t8;
|
|
205
|
+
} else t8 = $[38];
|
|
206
|
+
return t8;
|
|
60
207
|
}
|
|
61
208
|
//#endregion
|
|
62
|
-
export { Button$1 as Button, Button_module_default as buttonStyles };
|
|
209
|
+
export { Button$1 as Button, ButtonContent, Button_module_default as buttonStyles, getButtonClassName };
|
|
63
210
|
|
|
64
211
|
//# sourceMappingURL=Button.js.map
|