@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
package/dist/theme/tones.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tones.js","names":[],"sources":["../../src/theme/tones.ts"],"sourcesContent":["import {\n type Rgb,\n WHITE,\n contrastRatio,\n ensureContrast,\n mixColors,\n parseColor,\n readableTextColor,\n toHex,\n} from './color';\n\n/**\n * The tones that components accept (`tone=\"success\"`), like Bootstrap's `$theme-colors`. A theme\n * adds its own; declare them here so that `tone=\"signal\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface PanneauTones {\n * signal: true;\n * }\n * }\n * ```\n */\nexport interface PanneauTones {\n neutral: true;\n accent: true;\n success: true;\n warning: true;\n danger: true;\n info: true;\n}\n\n/** A tone name: a built-in tone, or one declared in `PanneauTones`. */\nexport type Tone = keyof PanneauTones & string;\n\n
|
|
1
|
+
{"version":3,"file":"tones.js","names":["Rgb","WHITE","contrastRatio","ensureContrast","mixColors","parseColor","readableTextColor","toHex","PanneauTones","neutral","accent","success","warning","danger","info","muted","Tone","BUILT_IN_TONES","const","ToneValues","text","subtle","border","outline","solid","solidHover","solidText","ToneInput","dark","Partial","TONE_VARIABLES","Readonly","Record","toneClassName","tone","SURFACES","light","r","g","b","ToneSurfaces","SUBTLE_AMOUNTS","MIN_CONTRAST_RATIO","deriveTone","color","surfaces","amount","parsed","values","darker","hover","shared","readable","scheme","resolveTone","input"],"sources":["../../src/theme/tones.ts"],"sourcesContent":["import {\n type Rgb,\n WHITE,\n contrastRatio,\n ensureContrast,\n mixColors,\n parseColor,\n readableTextColor,\n toHex,\n} from './color';\n\n/**\n * The tones that components accept (`tone=\"success\"`), like Bootstrap's `$theme-colors`. A theme\n * adds its own; declare them here so that `tone=\"signal\"` type-checks:\n *\n * ```ts\n * declare module '@panneau/ui' {\n * interface PanneauTones {\n * signal: true;\n * }\n * }\n * ```\n */\nexport interface PanneauTones {\n neutral: true;\n accent: true;\n success: true;\n warning: true;\n danger: true;\n info: true;\n muted: true;\n}\n\n/** A tone name: a built-in tone, or one declared in `PanneauTones`. */\nexport type Tone = keyof PanneauTones & string;\n\n/**\n * The tones Panneau defines, from the semantic tokens of the theme. What each one means for a state\n * is written once, in the protocol's docs (\"Tones\"):\n *\n * - `neutral`: not started, waiting, a category (Draft, Pending);\n * - `info`: in progress or coming (In progress, Scheduled);\n * - `success`: done, live, in good shape (Published, Paid);\n * - `warning`: needs attention soon (Expires soon, Low stock);\n * - `danger`: a problem to fix now (Failed, Overdue);\n * - `muted`: over, no longer active (Archived, Cancelled);\n * - `accent`: never a state, the main action of a screen.\n */\nexport const BUILT_IN_TONES = [\n 'neutral',\n 'accent',\n 'success',\n 'warning',\n 'danger',\n 'info',\n 'muted',\n] as const;\n\n/** The colors of a tone, as CSS values. */\nexport type ToneValues = {\n /** Text and icons on surfaces: the outline, subtle and ghost appearances. */\n text: string;\n /** Background of the subtle appearance. */\n subtle: string;\n /** Border of the subtle appearance. */\n border: string;\n /** Border of the outline appearance. */\n outline: string;\n /** Background of the solid appearance. */\n solid: string;\n /** Background of the solid appearance on hover and press. */\n solidHover: string;\n /** Text on the solid appearance. */\n solidText: string;\n};\n\n/**\n * A tone of a theme: one color, from which Panneau derives the others (`'#f25c05'`), or every\n * value, with optional overrides for the dark scheme.\n */\nexport type ToneInput = string | (ToneValues & { dark?: Partial<ToneValues> });\n\n/** The local CSS variables of a tone, which components read. */\nexport const TONE_VARIABLES: Readonly<Record<keyof ToneValues, string>> = {\n text: 'panneau-tone-text',\n subtle: 'panneau-tone-subtle',\n border: 'panneau-tone-border',\n outline: 'panneau-tone-outline',\n solid: 'panneau-tone-solid',\n solidHover: 'panneau-tone-solid-hover',\n solidText: 'panneau-tone-solid-text',\n};\n\n/** The class that applies a tone: `panneau-tone-<tone>`. */\nexport function toneClassName(tone: string): string {\n return `panneau-tone-${tone}`;\n}\n\n/** Surfaces text must be readable on, in each scheme of the default theme. */\nconst SURFACES: Record<'light' | 'dark', Rgb> = { light: WHITE, dark: { r: 24, g: 24, b: 27 } };\n\n/** The surfaces of a theme, in each scheme, when it sets ones Panneau can read. */\nexport type ToneSurfaces = Partial<Record<'light' | 'dark', Rgb>>;\n\n/** How much of the tone's color the subtle background mixes into the surface, per scheme. */\nexport const SUBTLE_AMOUNTS = { light: 0.12, dark: 0.22 };\n\n/** Text must reach this contrast ratio (WCAG AA for normal text). */\nexport const MIN_CONTRAST_RATIO = 4.5;\n\n/**\n * The values of a tone, in both schemes, from one color: Panneau's `button-variant()` and\n * `color-contrast()`.\n *\n * - The solid background is the color, with white or black text, whichever reads better, and a\n * hover 15% darker (or lighter, when the text is black and darker would hurt it).\n * - The text color is the color, darkened (light scheme) or lightened (dark scheme) until it\n * reaches 4.5:1 against the subtle background, which is tinted, and so against the surface too.\n * - The subtle background and the border are mixed with the surface in CSS, so they follow the\n * surface of any theme.\n *\n * A color Panneau can't read (a CSS variable, a named color) is used as is, with `color-mix()` for\n * the hover and white text: `checkTheme()` reports it as unchecked.\n *\n * Text is made readable on the surfaces of the default theme, or on those given, which themes pass\n * so that a tone stays readable on their own surfaces.\n */\nexport function deriveTone(\n color: string,\n surfaces: ToneSurfaces = {},\n): { light: ToneValues; dark: ToneValues } {\n const subtle = (amount: number) =>\n `color-mix(in srgb, ${color} ${amount}%, var(--panneau-color-surface))`;\n const parsed = parseColor(color);\n if (parsed === null) {\n const values: ToneValues = {\n text: color,\n subtle: subtle(SUBTLE_AMOUNTS.light * 100),\n border: subtle(45),\n outline: color,\n solid: color,\n solidHover: `color-mix(in srgb, ${color}, #000 15%)`,\n solidText: '#fff',\n };\n return { light: values, dark: { ...values, subtle: subtle(SUBTLE_AMOUNTS.dark * 100) } };\n }\n const solidText = readableTextColor(parsed);\n const darker = mixColors(parsed, { r: 0, g: 0, b: 0 }, 0.15);\n const hover =\n contrastRatio(solidText, darker) >= contrastRatio(solidText, parsed)\n ? darker\n : mixColors(parsed, WHITE, 0.15);\n const solid = toHex(parsed);\n const shared = {\n solid,\n solidHover: toHex(hover),\n solidText: toHex(solidText),\n };\n // Readable on the subtle background, which is closer to the text color than the surface.\n const readable = (scheme: 'light' | 'dark') =>\n toHex(\n ensureContrast(\n parsed,\n mixColors(surfaces[scheme] ?? SURFACES[scheme], parsed, SUBTLE_AMOUNTS[scheme]),\n MIN_CONTRAST_RATIO,\n ),\n );\n const light = readable('light');\n const dark = readable('dark');\n return {\n light: {\n ...shared,\n text: light,\n outline: light,\n subtle: subtle(SUBTLE_AMOUNTS.light * 100),\n border: subtle(45),\n },\n dark: {\n ...shared,\n text: dark,\n outline: dark,\n subtle: subtle(SUBTLE_AMOUNTS.dark * 100),\n border: subtle(55),\n },\n };\n}\n\n/** The values of a tone input, in both schemes, derived on the given surfaces if it is one color. */\nexport function resolveTone(\n input: ToneInput,\n surfaces: ToneSurfaces = {},\n): { light: ToneValues; dark: ToneValues } {\n if (typeof input === 'string') {\n return deriveTone(input, surfaces);\n }\n const { dark, ...light } = input;\n return { light, dark: { ...light, ...dark } };\n}\n"],"mappings":";;;;;;;;;;;;;;AAgDA,IAAaiB,iBAAiB;CAC1B;CACA;CACA;CACA;CACA;CACA;CACA;AAAO;;AA4BX,IAAaa,iBAA6D;CACtEV,MAAM;CACNC,QAAQ;CACRC,QAAQ;CACRC,SAAS;CACTC,OAAO;CACPC,YAAY;CACZC,WAAW;AACf;;AAGA,SAAgBO,cAAcC,MAAsB;CAChD,OAAO,gBAAgBA;AAC3B;;AAGA,IAAMC,WAA0C;CAAEC,OAAOnC;CAAO2B,MAAM;EAAES,GAAG;EAAIC,GAAG;EAAIC,GAAG;CAAG;AAAE;;AAM9F,IAAaE,iBAAiB;CAAEL,OAAO;CAAMR,MAAM;AAAK;;AAGxD,IAAac,qBAAqB;;;;;;;;;;;;;;;;;;AAmBlC,SAAgBC,WACZC,OACAC,WAAyB,CAAC,GACa;CACvC,MAAMxB,UAAUyB,WACZ,sBAAsBF,MAAK,GAAIE,OAAM;CACzC,MAAMC,SAAS1C,WAAWuC,KAAK;CAC/B,IAAIG,WAAW,MAAM;EACjB,MAAMC,SAAqB;GACvB5B,MAAMwB;GACNvB,QAAQA,OAAOoB,eAAeL,QAAQ,GAAG;GACzCd,QAAQD,OAAO,EAAE;GACjBE,SAASqB;GACTpB,OAAOoB;GACPnB,YAAY,sBAAsBmB,MAAK;GACvClB,WAAW;EACf;EACA,OAAO;GAAEU,OAAOY;GAAQpB,MAAM;IAAE,GAAGoB;IAAQ3B,QAAQA,OAAOoB,eAAeb,OAAO,GAAG;GAAE;EAAE;CAC3F;CACA,MAAMF,YAAYpB,kBAAkByC,MAAM;CAC1C,MAAME,SAAS7C,UAAU2C,QAAQ;EAAEV,GAAG;EAAGC,GAAG;EAAGC,GAAG;CAAE,GAAG,GAAI;CAC3D,MAAMW,QACFhD,cAAcwB,WAAWuB,MAAM,KAAK/C,cAAcwB,WAAWqB,MAAM,IAC7DE,SACA7C,UAAU2C,QAAQ9C,OAAO,GAAI;CAEvC,MAAMkD,SAAS;EACX3B,OAFUjB,MAAMwC,MAEhBvB;EACAC,YAAYlB,MAAM2C,KAAK;EACvBxB,WAAWnB,MAAMmB,SAAS;CAC9B;CAEA,MAAM0B,YAAYC,WACd9C,MACIJ,eACI4C,QACA3C,UAAUyC,SAASQ,WAAWlB,SAASkB,SAASN,QAAQN,eAAeY,OAAO,GAC9EX,kBACJ,CACJ;CACJ,MAAMN,QAAQgB,SAAS,OAAO;CAC9B,MAAMxB,OAAOwB,SAAS,MAAM;CAC5B,OAAO;EACHhB,OAAO;GACH,GAAGe;GACH/B,MAAMgB;GACNb,SAASa;GACTf,QAAQA,OAAOoB,eAAeL,QAAQ,GAAG;GACzCd,QAAQD,OAAO,EAAE;EACrB;EACAO,MAAM;GACF,GAAGuB;GACH/B,MAAMQ;GACNL,SAASK;GACTP,QAAQA,OAAOoB,eAAeb,OAAO,GAAG;GACxCN,QAAQD,OAAO,EAAE;EACrB;CACJ;AACJ;;AAGA,SAAgBiC,YACZC,OACAV,WAAyB,CAAC,GACa;CACvC,IAAI,OAAOU,UAAU,UACjB,OAAOZ,WAAWY,OAAOV,QAAQ;CAErC,MAAM,EAAEjB,MAAM,GAAGQ,UAAUmB;CAC3B,OAAO;EAAEnB;EAAOR,MAAM;GAAE,GAAGQ;GAAO,GAAGR;EAAK;CAAE;AAChD"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TimeFieldProps, type TimeValue } from 'react-aria-components';
|
|
2
|
-
import { type FieldChromeProps } from '../field/FieldParts';
|
|
2
|
+
import { type FieldChromeProps } from '../field/FieldParts.js';
|
|
3
3
|
export interface TimeInputProps extends Omit<TimeFieldProps<TimeValue>, 'className' | 'style' | 'children' | 'isInvalid' | 'validate'>, FieldChromeProps {
|
|
4
4
|
controlClassName?: string;
|
|
5
5
|
}
|
|
@@ -2,41 +2,148 @@ import { cx } from "../utils/cx.js";
|
|
|
2
2
|
import Field_module_default from "../field/Field.module.js";
|
|
3
3
|
import { FieldDescription, FieldErrors, FieldLabel } from "../field/FieldParts.js";
|
|
4
4
|
import DatePicker_module_default from "../date-picker/DatePicker.module.js";
|
|
5
|
+
import { c } from "react/compiler-runtime";
|
|
5
6
|
import { DateInput, DateSegment, TimeField } from "react-aria-components";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
//#region src/time-input/TimeInput.tsx
|
|
8
9
|
/** A time of day, typed segment by segment in the format of the locale. */
|
|
9
|
-
function TimeInput(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
]
|
|
10
|
+
function TimeInput(t0) {
|
|
11
|
+
const $ = c(41);
|
|
12
|
+
let className;
|
|
13
|
+
let controlClassName;
|
|
14
|
+
let description;
|
|
15
|
+
let descriptionClassName;
|
|
16
|
+
let errorsClassName;
|
|
17
|
+
let isReadOnly;
|
|
18
|
+
let isRequired;
|
|
19
|
+
let label;
|
|
20
|
+
let labelClassName;
|
|
21
|
+
let props;
|
|
22
|
+
let t1;
|
|
23
|
+
if ($[0] !== t0) {
|
|
24
|
+
({label, description, errors: t1, isRequired, isReadOnly, className, labelClassName, descriptionClassName, errorsClassName, controlClassName, ...props} = t0);
|
|
25
|
+
$[0] = t0;
|
|
26
|
+
$[1] = className;
|
|
27
|
+
$[2] = controlClassName;
|
|
28
|
+
$[3] = description;
|
|
29
|
+
$[4] = descriptionClassName;
|
|
30
|
+
$[5] = errorsClassName;
|
|
31
|
+
$[6] = isReadOnly;
|
|
32
|
+
$[7] = isRequired;
|
|
33
|
+
$[8] = label;
|
|
34
|
+
$[9] = labelClassName;
|
|
35
|
+
$[10] = props;
|
|
36
|
+
$[11] = t1;
|
|
37
|
+
} else {
|
|
38
|
+
className = $[1];
|
|
39
|
+
controlClassName = $[2];
|
|
40
|
+
description = $[3];
|
|
41
|
+
descriptionClassName = $[4];
|
|
42
|
+
errorsClassName = $[5];
|
|
43
|
+
isReadOnly = $[6];
|
|
44
|
+
isRequired = $[7];
|
|
45
|
+
label = $[8];
|
|
46
|
+
labelClassName = $[9];
|
|
47
|
+
props = $[10];
|
|
48
|
+
t1 = $[11];
|
|
49
|
+
}
|
|
50
|
+
let t2;
|
|
51
|
+
if ($[12] !== t1) {
|
|
52
|
+
t2 = t1 === void 0 ? [] : t1;
|
|
53
|
+
$[12] = t1;
|
|
54
|
+
$[13] = t2;
|
|
55
|
+
} else t2 = $[13];
|
|
56
|
+
const errors = t2;
|
|
57
|
+
const t3 = errors.length > 0;
|
|
58
|
+
let t4;
|
|
59
|
+
if ($[14] !== className) {
|
|
60
|
+
t4 = cx("panneau-time-input", Field_module_default.field, className);
|
|
61
|
+
$[14] = className;
|
|
62
|
+
$[15] = t4;
|
|
63
|
+
} else t4 = $[15];
|
|
64
|
+
let t5;
|
|
65
|
+
if ($[16] !== isRequired || $[17] !== label || $[18] !== labelClassName) {
|
|
66
|
+
t5 = /* @__PURE__ */ jsx(FieldLabel, {
|
|
67
|
+
isRequired,
|
|
68
|
+
className: labelClassName,
|
|
69
|
+
children: label
|
|
70
|
+
});
|
|
71
|
+
$[16] = isRequired;
|
|
72
|
+
$[17] = label;
|
|
73
|
+
$[18] = labelClassName;
|
|
74
|
+
$[19] = t5;
|
|
75
|
+
} else t5 = $[19];
|
|
76
|
+
let t6;
|
|
77
|
+
if ($[20] !== controlClassName) {
|
|
78
|
+
t6 = cx(Field_module_default.control, DatePicker_module_default.input, controlClassName);
|
|
79
|
+
$[20] = controlClassName;
|
|
80
|
+
$[21] = t6;
|
|
81
|
+
} else t6 = $[21];
|
|
82
|
+
const t7 = isReadOnly || void 0;
|
|
83
|
+
let t8;
|
|
84
|
+
if ($[22] !== t6 || $[23] !== t7) {
|
|
85
|
+
t8 = /* @__PURE__ */ jsx(DateInput, {
|
|
86
|
+
className: t6,
|
|
87
|
+
"data-readonly": t7,
|
|
88
|
+
children: _temp
|
|
89
|
+
});
|
|
90
|
+
$[22] = t6;
|
|
91
|
+
$[23] = t7;
|
|
92
|
+
$[24] = t8;
|
|
93
|
+
} else t8 = $[24];
|
|
94
|
+
let t9;
|
|
95
|
+
if ($[25] !== description || $[26] !== descriptionClassName) {
|
|
96
|
+
t9 = /* @__PURE__ */ jsx(FieldDescription, {
|
|
97
|
+
className: descriptionClassName,
|
|
98
|
+
children: description
|
|
99
|
+
});
|
|
100
|
+
$[25] = description;
|
|
101
|
+
$[26] = descriptionClassName;
|
|
102
|
+
$[27] = t9;
|
|
103
|
+
} else t9 = $[27];
|
|
104
|
+
let t10;
|
|
105
|
+
if ($[28] !== errors || $[29] !== errorsClassName) {
|
|
106
|
+
t10 = /* @__PURE__ */ jsx(FieldErrors, {
|
|
107
|
+
errors,
|
|
108
|
+
className: errorsClassName
|
|
109
|
+
});
|
|
110
|
+
$[28] = errors;
|
|
111
|
+
$[29] = errorsClassName;
|
|
112
|
+
$[30] = t10;
|
|
113
|
+
} else t10 = $[30];
|
|
114
|
+
let t11;
|
|
115
|
+
if ($[31] !== isReadOnly || $[32] !== isRequired || $[33] !== props || $[34] !== t10 || $[35] !== t3 || $[36] !== t4 || $[37] !== t5 || $[38] !== t8 || $[39] !== t9) {
|
|
116
|
+
t11 = /* @__PURE__ */ jsxs(TimeField, {
|
|
117
|
+
...props,
|
|
118
|
+
isRequired,
|
|
119
|
+
isReadOnly,
|
|
120
|
+
isInvalid: t3,
|
|
121
|
+
validationBehavior: "aria",
|
|
122
|
+
className: t4,
|
|
123
|
+
children: [
|
|
124
|
+
t5,
|
|
125
|
+
t8,
|
|
126
|
+
t9,
|
|
127
|
+
t10
|
|
128
|
+
]
|
|
129
|
+
});
|
|
130
|
+
$[31] = isReadOnly;
|
|
131
|
+
$[32] = isRequired;
|
|
132
|
+
$[33] = props;
|
|
133
|
+
$[34] = t10;
|
|
134
|
+
$[35] = t3;
|
|
135
|
+
$[36] = t4;
|
|
136
|
+
$[37] = t5;
|
|
137
|
+
$[38] = t8;
|
|
138
|
+
$[39] = t9;
|
|
139
|
+
$[40] = t11;
|
|
140
|
+
} else t11 = $[40];
|
|
141
|
+
return t11;
|
|
142
|
+
}
|
|
143
|
+
function _temp(segment) {
|
|
144
|
+
return /* @__PURE__ */ jsx(DateSegment, {
|
|
145
|
+
segment,
|
|
146
|
+
className: DatePicker_module_default.segment
|
|
40
147
|
});
|
|
41
148
|
}
|
|
42
149
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.js","names":["fieldStyles","datePickerStyles"],"sources":["../../src/time-input/TimeInput.tsx"],"sourcesContent":["import {\n DateInput,\n DateSegment,\n TimeField,\n type TimeFieldProps,\n type TimeValue,\n} from 'react-aria-components';\n\nimport datePickerStyles from '../date-picker/DatePicker.module.css';\nimport {\n type FieldChromeProps,\n FieldDescription,\n FieldErrors,\n FieldLabel,\n fieldStyles,\n} from '../field/FieldParts';\nimport { cx } from '../utils/cx';\n\nexport interface TimeInputProps\n extends\n Omit<\n TimeFieldProps<TimeValue>,\n 'className' | 'style' | 'children' | 'isInvalid' | 'validate'\n >,\n FieldChromeProps {\n controlClassName?: string;\n}\n\n/** A time of day, typed segment by segment in the format of the locale. */\nexport function TimeInput({\n label,\n description,\n errors = [],\n isRequired,\n isReadOnly,\n className,\n labelClassName,\n descriptionClassName,\n errorsClassName,\n controlClassName,\n ...props\n}: TimeInputProps) {\n return (\n <TimeField\n {...props}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={errors.length > 0}\n validationBehavior=\"aria\"\n className={cx('panneau-time-input', fieldStyles.field, className)}\n >\n <FieldLabel isRequired={isRequired} className={labelClassName}>\n {label}\n </FieldLabel>\n <DateInput\n className={cx(fieldStyles.control, datePickerStyles.input, controlClassName)}\n data-readonly={isReadOnly || undefined}\n >\n {(segment) => (\n <DateSegment segment={segment} className={datePickerStyles.segment} />\n )}\n </DateInput>\n <FieldDescription className={descriptionClassName}>{description}</FieldDescription>\n <FieldErrors errors={errors} className={errorsClassName} />\n </TimeField>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"TimeInput.js","names":["DateInput","DateSegment","TimeField","TimeFieldProps","TimeValue","datePickerStyles","FieldChromeProps","FieldDescription","FieldErrors","FieldLabel","fieldStyles","cx","TimeInputProps","Omit","controlClassName","TimeInput","t0","$","_c","className","description","descriptionClassName","errorsClassName","isReadOnly","isRequired","label","labelClassName","props","t1","errors","t2","undefined","t3","length","t4","field","t5","t6","control","input","t7","t8","_temp","t9","t10","t11","segment","_c","fieldStyles","datePickerStyles"],"sources":["../../src/time-input/TimeInput.tsx"],"sourcesContent":["import {\n DateInput,\n DateSegment,\n TimeField,\n type TimeFieldProps,\n type TimeValue,\n} from 'react-aria-components';\n\nimport datePickerStyles from '../date-picker/DatePicker.module.css';\nimport {\n type FieldChromeProps,\n FieldDescription,\n FieldErrors,\n FieldLabel,\n fieldStyles,\n} from '../field/FieldParts';\nimport { cx } from '../utils/cx';\n\nexport interface TimeInputProps\n extends\n Omit<\n TimeFieldProps<TimeValue>,\n 'className' | 'style' | 'children' | 'isInvalid' | 'validate'\n >,\n FieldChromeProps {\n controlClassName?: string;\n}\n\n/** A time of day, typed segment by segment in the format of the locale. */\nexport function TimeInput({\n label,\n description,\n errors = [],\n isRequired,\n isReadOnly,\n className,\n labelClassName,\n descriptionClassName,\n errorsClassName,\n controlClassName,\n ...props\n}: TimeInputProps) {\n return (\n <TimeField\n {...props}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={errors.length > 0}\n validationBehavior=\"aria\"\n className={cx('panneau-time-input', fieldStyles.field, className)}\n >\n <FieldLabel isRequired={isRequired} className={labelClassName}>\n {label}\n </FieldLabel>\n <DateInput\n className={cx(fieldStyles.control, datePickerStyles.input, controlClassName)}\n data-readonly={isReadOnly || undefined}\n >\n {(segment) => (\n <DateSegment segment={segment} className={datePickerStyles.segment} />\n )}\n </DateInput>\n <FieldDescription className={descriptionClassName}>{description}</FieldDescription>\n <FieldErrors errors={errors} className={errorsClassName} />\n </TimeField>\n );\n}\n"],"mappings":"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"}
|
package/dist/toast/Toast.css
CHANGED
|
@@ -1,44 +1,195 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/*
|
|
2
|
+
* The region carries the root's class (tokens), since React Aria renders it in the body. Toasts show
|
|
3
|
+
* at the bottom, centered, above what sticks to the bottom of the page (--panneau-bottom-offset,
|
|
4
|
+
* set by useToastOffset()), or at the bottom or top of the end side (data-placement). React Aria
|
|
5
|
+
* renders them newest first, each in a list item with `display: contents`.
|
|
6
|
+
*/
|
|
2
7
|
.panneau-toast-region.panneau-toast-region {
|
|
3
8
|
position: fixed;
|
|
4
|
-
inset-block-end: var(--panneau-space-4);
|
|
5
|
-
inset-inline
|
|
9
|
+
inset-block-end: calc(var(--panneau-bottom-offset, 0px) + var(--panneau-space-4));
|
|
10
|
+
inset-inline: 0;
|
|
6
11
|
z-index: var(--panneau-z-toast);
|
|
7
|
-
display:
|
|
8
|
-
|
|
9
|
-
|
|
12
|
+
display: grid;
|
|
13
|
+
grid-template-columns: minmax(0, 1fr);
|
|
14
|
+
align-items: end;
|
|
10
15
|
width: min(var(--panneau-toast-width, 24rem), calc(100vw - 2 * var(--panneau-space-4)));
|
|
16
|
+
margin-inline: auto;
|
|
11
17
|
background: transparent;
|
|
12
18
|
outline: none;
|
|
13
19
|
}
|
|
14
20
|
|
|
21
|
+
.panneau-toast-region[data-placement='bottom-end'] {
|
|
22
|
+
inset-inline: auto var(--panneau-space-4);
|
|
23
|
+
margin-inline: 0;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.panneau-toast-region[data-placement='top-end'] {
|
|
27
|
+
inset-block: var(--panneau-space-4) auto;
|
|
28
|
+
inset-inline: auto var(--panneau-space-4);
|
|
29
|
+
align-items: start;
|
|
30
|
+
margin-inline: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
15
33
|
.panneau-toast-region[data-focus-visible] {
|
|
16
34
|
outline: var(--panneau-focus-width) solid var(--panneau-color-focus);
|
|
17
35
|
outline-offset: 4px;
|
|
18
36
|
}
|
|
19
37
|
|
|
38
|
+
/* On a phone, the whole width at the bottom (or the top). */
|
|
20
39
|
@media (max-width: 30rem) {
|
|
21
|
-
.panneau-toast-region.panneau-toast-region
|
|
40
|
+
.panneau-toast-region.panneau-toast-region,
|
|
41
|
+
.panneau-toast-region.panneau-toast-region[data-placement] {
|
|
22
42
|
inset-inline: var(--panneau-space-2);
|
|
23
|
-
inset-block-end: var(--panneau-space-2);
|
|
24
43
|
width: auto;
|
|
44
|
+
margin-inline: 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.panneau-toast-region.panneau-toast-region:not([data-placement='top-end']) {
|
|
48
|
+
inset-block: auto calc(var(--panneau-bottom-offset, 0px) + var(--panneau-space-2));
|
|
25
49
|
}
|
|
26
50
|
}
|
|
27
51
|
|
|
28
52
|
.panneau-toast {
|
|
53
|
+
--toast-rise: 1rem;
|
|
54
|
+
|
|
29
55
|
display: flex;
|
|
56
|
+
grid-area: 1 / 1;
|
|
30
57
|
align-items: flex-start;
|
|
58
|
+
position: relative;
|
|
31
59
|
gap: var(--panneau-space-3);
|
|
32
|
-
|
|
60
|
+
/* The buttons have room of their own: the toast is as high as them, plus a small margin. */
|
|
61
|
+
padding: var(--panneau-space-2) var(--panneau-space-2) var(--panneau-space-2)
|
|
33
62
|
var(--panneau-space-4);
|
|
63
|
+
/* The colored edge follows the rounded corners. */
|
|
64
|
+
overflow: hidden;
|
|
34
65
|
color: var(--panneau-color-text);
|
|
35
66
|
background-color: var(--panneau-toast-bg, var(--panneau-color-surface-raised));
|
|
36
67
|
border: var(--panneau-border-width) solid
|
|
37
68
|
var(--panneau-toast-border-color, var(--panneau-color-border));
|
|
38
|
-
border-inline-start-width: var(--panneau-toast-tone-width, 4px);
|
|
39
69
|
border-radius: var(--panneau-toast-radius, var(--panneau-radius-lg));
|
|
40
70
|
box-shadow: var(--panneau-toast-shadow, var(--panneau-shadow-lg));
|
|
41
71
|
outline: none;
|
|
72
|
+
transition:
|
|
73
|
+
transform var(--panneau-duration) var(--panneau-ease-out),
|
|
74
|
+
opacity var(--panneau-duration) var(--panneau-ease-out);
|
|
75
|
+
animation: panneau-toast-rise calc(2 * var(--panneau-duration)) var(--panneau-ease-out);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.panneau-toast-region[data-placement='top-end'] .panneau-toast {
|
|
79
|
+
--toast-rise: -1rem;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
@keyframes panneau-toast-rise {
|
|
83
|
+
from {
|
|
84
|
+
opacity: 0;
|
|
85
|
+
transform: translateY(var(--toast-rise));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/*
|
|
90
|
+
* Folded: the newest in front, the older ones behind it, peeking out a little. Hovered or focused,
|
|
91
|
+
* the region unfolds them in a column, the newest closest to the edge of the screen.
|
|
92
|
+
*/
|
|
93
|
+
.panneau-toast-region li:nth-child(1) > .panneau-toast {
|
|
94
|
+
z-index: 3;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.panneau-toast-region li:nth-child(2) > .panneau-toast {
|
|
98
|
+
z-index: 2;
|
|
99
|
+
transform: translateY(calc(-1 * var(--panneau-space-2))) scale(0.95);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.panneau-toast-region li:nth-child(3) > .panneau-toast {
|
|
103
|
+
z-index: 1;
|
|
104
|
+
transform: translateY(calc(-2 * var(--panneau-space-2))) scale(0.9);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.panneau-toast-region[data-placement='top-end'] li:nth-child(2) > .panneau-toast {
|
|
108
|
+
transform: translateY(var(--panneau-space-2)) scale(0.95);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.panneau-toast-region[data-placement='top-end'] li:nth-child(3) > .panneau-toast {
|
|
112
|
+
transform: translateY(calc(2 * var(--panneau-space-2))) scale(0.9);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.panneau-toast-region li:nth-child(n + 2) > .panneau-toast > * {
|
|
116
|
+
opacity: 0;
|
|
117
|
+
transition: opacity var(--panneau-duration) var(--panneau-ease-out);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.panneau-toast-region:is(:hover, :focus-within, [data-hovered], [data-focused]) {
|
|
121
|
+
gap: var(--panneau-space-2);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.panneau-toast-region:is(:hover, :focus-within, [data-hovered], [data-focused]) li > .panneau-toast {
|
|
125
|
+
transform: none;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.panneau-toast-region:is(:hover, :focus-within, [data-hovered], [data-focused]) li > .panneau-toast > * {
|
|
129
|
+
opacity: 1;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.panneau-toast-region:not([data-placement='top-end']):is(:hover, :focus-within, [data-hovered], [data-focused])
|
|
133
|
+
li:nth-child(1)
|
|
134
|
+
> .panneau-toast {
|
|
135
|
+
grid-area: 3 / 1;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.panneau-toast-region:not([data-placement='top-end']):is(:hover, :focus-within, [data-hovered], [data-focused])
|
|
139
|
+
li:nth-child(2)
|
|
140
|
+
> .panneau-toast {
|
|
141
|
+
grid-area: 2 / 1;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.panneau-toast-region:not([data-placement='top-end']):is(:hover, :focus-within, [data-hovered], [data-focused])
|
|
145
|
+
li:nth-child(3)
|
|
146
|
+
> .panneau-toast {
|
|
147
|
+
grid-area: 1 / 1;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.panneau-toast-region[data-placement='top-end']:is(:hover, :focus-within, [data-hovered], [data-focused])
|
|
151
|
+
li
|
|
152
|
+
> .panneau-toast {
|
|
153
|
+
grid-area: auto;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
/*
|
|
157
|
+
* In the view transition of a change of the toasts (wrapToastUpdate()): a toast that closes fades
|
|
158
|
+
* out and drops a little, the others move into their place. One that opens keeps its own rise.
|
|
159
|
+
* Only the toasts are captured: the page itself isn't, so it doesn't cross-fade. The durations are written here,
|
|
160
|
+
* since these pseudo-elements live on the document, outside the root and its tokens.
|
|
161
|
+
*/
|
|
162
|
+
html:active-view-transition-type(panneau-toast) {
|
|
163
|
+
view-transition-name: none;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
html:active-view-transition-type(panneau-toast)::view-transition-group(*) {
|
|
167
|
+
animation-duration: 200ms;
|
|
168
|
+
animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
html:active-view-transition-type(panneau-toast)::view-transition-new(*):only-child {
|
|
172
|
+
animation: none;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
html:active-view-transition-type(panneau-toast)::view-transition-old(*):only-child {
|
|
176
|
+
animation: panneau-toast-toast-leave 150ms cubic-bezier(0.55, 0, 1, 0.45) forwards;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
@keyframes panneau-toast-toast-leave {
|
|
180
|
+
to {
|
|
181
|
+
opacity: 0;
|
|
182
|
+
transform: translateY(0.5rem) scale(0.96);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Without motion when the system asks for less. */
|
|
187
|
+
@media (prefers-reduced-motion: reduce) {
|
|
188
|
+
.panneau-toast,
|
|
189
|
+
.panneau-toast-region li > .panneau-toast > * {
|
|
190
|
+
transition: none;
|
|
191
|
+
animation: none;
|
|
192
|
+
}
|
|
42
193
|
}
|
|
43
194
|
|
|
44
195
|
.panneau-toast[data-focus-visible] {
|
|
@@ -46,17 +197,27 @@
|
|
|
46
197
|
outline-offset: 2px;
|
|
47
198
|
}
|
|
48
199
|
|
|
200
|
+
/*
|
|
201
|
+
* The icon, the first line of the text and the buttons share one axis: the icon and the text each
|
|
202
|
+
* take the height of a small button, centered in it. A longer text wraps below that first line.
|
|
203
|
+
*/
|
|
49
204
|
.panneau-toast-icon {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
.
|
|
55
|
-
|
|
205
|
+
display: flex;
|
|
206
|
+
flex: 0 0 auto;
|
|
207
|
+
align-items: center;
|
|
208
|
+
height: var(--panneau-control-height-sm);
|
|
209
|
+
/* A success or an info keeps the neutral look, with its icon in the color of its tone. */
|
|
210
|
+
color: var(--panneau-tone-text);
|
|
56
211
|
}
|
|
57
212
|
|
|
58
|
-
|
|
59
|
-
|
|
213
|
+
/* Only what needs a look, a warning or an error, colors its edge: a straight band at the start. */
|
|
214
|
+
.panneau-toast-edge::before {
|
|
215
|
+
position: absolute;
|
|
216
|
+
inset-block: 0;
|
|
217
|
+
inset-inline-start: 0;
|
|
218
|
+
width: var(--panneau-toast-tone-width, 4px);
|
|
219
|
+
content: '';
|
|
220
|
+
background-color: var(--panneau-tone-text);
|
|
60
221
|
}
|
|
61
222
|
|
|
62
223
|
.panneau-toast-content {
|
|
@@ -65,7 +226,7 @@
|
|
|
65
226
|
flex-direction: column;
|
|
66
227
|
gap: var(--panneau-space-1);
|
|
67
228
|
min-width: 0;
|
|
68
|
-
padding-
|
|
229
|
+
padding-block: calc((var(--panneau-control-height-sm) - 1lh) / 2);
|
|
69
230
|
}
|
|
70
231
|
|
|
71
232
|
.panneau-toast-title {
|
package/dist/toast/Toast.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { type ReactNode } from 'react';
|
|
2
|
-
import type { Tone } from '../theme/tones';
|
|
1
|
+
import { type ReactNode, type RefObject } from 'react';
|
|
2
|
+
import type { Tone } from '../theme/tones.js';
|
|
3
3
|
/** @deprecated Use `Tone`. */
|
|
4
4
|
export type ToastTone = Tone;
|
|
5
|
-
/**
|
|
5
|
+
/**
|
|
6
|
+
* What a toast says: what was done to what ("“Spring contest” saved", "3 entries archived"), and
|
|
7
|
+
* the next step when there is one.
|
|
8
|
+
*/
|
|
6
9
|
export interface ToastContent {
|
|
7
10
|
title: string;
|
|
8
11
|
description?: string;
|
|
9
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Defaults to `neutral`. A success keeps the neutral look with its icon; only `warning` and
|
|
14
|
+
* `danger` color the edge.
|
|
15
|
+
*/
|
|
10
16
|
tone?: Tone;
|
|
11
|
-
/**
|
|
17
|
+
/**
|
|
18
|
+
* A button in the toast that leads to the result ("Open", "Show", "Download") or undoes what was
|
|
19
|
+
* done ("Undo"). The toast closes when it is pressed.
|
|
20
|
+
*/
|
|
12
21
|
action?: {
|
|
13
22
|
label: string;
|
|
14
23
|
onAction: () => void;
|
|
@@ -16,26 +25,68 @@ export interface ToastContent {
|
|
|
16
25
|
}
|
|
17
26
|
export interface ToastOptions {
|
|
18
27
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
28
|
+
* A toast with the key of one already shown replaces it instead of adding another: "Saved"
|
|
29
|
+
* once, however many saves. `show()` returns it.
|
|
30
|
+
*/
|
|
31
|
+
key?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Milliseconds before the toast closes by itself, or `null` to keep it until it is closed.
|
|
34
|
+
* Defaults to what the toast holds (`getToastTimeout()`): about 5 seconds, longer for a longer
|
|
35
|
+
* text, about 10 seconds with an action, and none for an error.
|
|
21
36
|
*/
|
|
22
37
|
timeout?: number | null;
|
|
23
38
|
onClose?: () => void;
|
|
24
39
|
}
|
|
25
40
|
export interface Toasts {
|
|
26
|
-
/** Shows a toast. Returns its key. */
|
|
41
|
+
/** Shows a toast. Returns its key: the one given in its options, or a new one. */
|
|
27
42
|
show(content: ToastContent, options?: ToastOptions): string;
|
|
28
43
|
/** Closes a toast by key. */
|
|
29
44
|
close(key: string): void;
|
|
30
45
|
}
|
|
46
|
+
/** Where toasts show: `bottom` (centered, the default), `bottom-end` or `top-end`. */
|
|
47
|
+
export type ToastPlacement = 'bottom' | 'bottom-end' | 'top-end';
|
|
48
|
+
/** At most this many toasts show at once: older ones wait for a place. */
|
|
49
|
+
export declare const MAX_VISIBLE_TOASTS = 3;
|
|
50
|
+
/**
|
|
51
|
+
* How long a toast stays, from what it holds: about 5 seconds, longer for a longer text; about 10
|
|
52
|
+
* seconds with an action, which must be reached in that time (an action to reach later belongs in
|
|
53
|
+
* the page, not in a toast that stays); and `null`, no timeout, for an error the user must read.
|
|
54
|
+
*/
|
|
55
|
+
export declare function getToastTimeout(content: ToastContent): number | null;
|
|
31
56
|
/** Shows toasts in the closest `PanneauRoot`. */
|
|
32
57
|
export declare function useToast(): Toasts;
|
|
58
|
+
/**
|
|
59
|
+
* How far the toasts rise above an element: from its top to the bottom of the viewport, when it
|
|
60
|
+
* covers the bottom of the viewport, as a sticky footer does once the page scrolls. `0` when it
|
|
61
|
+
* shows higher, as the footer of a short form does, after its last field: toasts then stay at the
|
|
62
|
+
* bottom, rather than floating where nothing is.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getToastOffset(rect: Pick<DOMRect, 'top' | 'bottom' | 'height'>, viewport: number): number;
|
|
65
|
+
/**
|
|
66
|
+
* Raises the toasts above an element that sticks to the bottom of the page, such as the footer of
|
|
67
|
+
* a form, while it is mounted and `active` and it covers the bottom of the viewport: the space it
|
|
68
|
+
* takes there becomes the `--panneau-bottom-offset` of the region. Measured again when the page
|
|
69
|
+
* scrolls or resizes. Toasts at the top ignore it.
|
|
70
|
+
*/
|
|
71
|
+
export declare function useToastOffset(ref: RefObject<HTMLElement | null>, active?: boolean): void;
|
|
72
|
+
/**
|
|
73
|
+
* Runs a change of the toasts in a view transition, where the browser has them: a toast that closes
|
|
74
|
+
* fades out, and the others slide into its place (decision 0081). At once without them, or when the
|
|
75
|
+
* system asks for less motion.
|
|
76
|
+
*/
|
|
77
|
+
export declare function wrapToastUpdate(update: () => void): void;
|
|
33
78
|
export interface ToastProviderProps {
|
|
34
79
|
children?: ReactNode;
|
|
80
|
+
/** Where the toasts show. Defaults to `bottom`. */
|
|
81
|
+
placement?: ToastPlacement;
|
|
35
82
|
/** Class names that give the region its tokens, since it renders in the body. */
|
|
36
83
|
regionClassName?: string;
|
|
37
84
|
regionProps?: Record<`data-${string}`, string | undefined>;
|
|
38
85
|
}
|
|
39
|
-
/**
|
|
40
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Holds the toasts of a `PanneauRoot` and renders them in an accessible region (decision 0062): at
|
|
88
|
+
* the bottom by default, one per key, at most three, the older ones folded behind the newest until
|
|
89
|
+
* the region is hovered or focused, where their timers pause.
|
|
90
|
+
*/
|
|
91
|
+
export declare function ToastProvider({ children, placement, regionClassName, regionProps, }: ToastProviderProps): import("react").JSX.Element;
|
|
41
92
|
//# sourceMappingURL=Toast.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/toast/Toast.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"Toast.d.ts","sourceRoot":"","sources":["../../src/toast/Toast.tsx"],"names":[],"mappings":"AACA,OAAO,EAGH,KAAK,SAAS,EACd,KAAK,SAAS,EAMjB,MAAM,OAAO,CAAC;AAgBf,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAI3C,8BAA8B;AAC9B,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC;AAE7B;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,IAAI,CAAA;KAAE,CAAC;CACpD;AAED,MAAM,WAAW,YAAY;IACzB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,MAAM;IACnB,kFAAkF;IAClF,IAAI,CAAC,OAAO,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAAC;IAC5D,6BAA6B;IAC7B,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,sFAAsF;AACtF,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC;AAEjE,0EAA0E;AAC1E,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAWpC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAWpE;AAoBD,iDAAiD;AACjD,wBAAgB,QAAQ,IAAI,MAAM,CAMjC;AAKD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAC,EAAE,QAAQ,EAAE,MAAM,UAGhG;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,SAAS,CAAC,WAAW,GAAG,IAAI,CAAC,EAAE,MAAM,UAAO,GAAG,IAAI,CAuCtF;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,IAAI,GAAG,IAAI,CAaxD;AA4DD,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,mDAAmD;IACnD,SAAS,CAAC,EAAE,cAAc,CAAC;IAC3B,iFAAiF;IACjF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC9D;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC1B,QAAQ,EACR,SAAoB,EACpB,eAAe,EACf,WAAW,GACd,EAAE,kBAAkB,+BAiFpB"}
|