@panneau/ui 5.0.0-alpha.0 → 5.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +380 -7
- package/bin/check-theme.js +5 -0
- package/dist/alert/Alert.css +28 -42
- package/dist/alert/Alert.d.ts +19 -5
- package/dist/alert/Alert.d.ts.map +1 -1
- package/dist/alert/Alert.js +110 -41
- package/dist/alert/Alert.js.map +1 -1
- package/dist/alert/Alert.module.js +14 -16
- package/dist/alert/Alert.module.js.map +1 -1
- package/dist/alert/tokens.d.ts +3 -0
- package/dist/alert/tokens.d.ts.map +1 -0
- package/dist/alert/tokens.js +21 -0
- package/dist/alert/tokens.js.map +1 -0
- package/dist/badge/Badge.css +24 -36
- package/dist/badge/Badge.d.ts +18 -3
- package/dist/badge/Badge.d.ts.map +1 -1
- package/dist/badge/Badge.js +35 -6
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/Badge.module.js +9 -13
- package/dist/badge/Badge.module.js.map +1 -1
- package/dist/badge/tokens.d.ts +3 -0
- package/dist/badge/tokens.d.ts.map +1 -0
- package/dist/badge/tokens.js +23 -0
- package/dist/badge/tokens.js.map +1 -0
- package/dist/button/Button.css +58 -42
- package/dist/button/Button.d.ts +32 -5
- package/dist/button/Button.d.ts.map +1 -1
- package/dist/button/Button.js +136 -17
- package/dist/button/Button.js.map +1 -1
- package/dist/button/Button.module.js +14 -14
- package/dist/button/Button.module.js.map +1 -1
- package/dist/button/tokens.d.ts +3 -0
- package/dist/button/tokens.d.ts.map +1 -0
- package/dist/button/tokens.js +25 -0
- package/dist/button/tokens.js.map +1 -0
- package/dist/card/Card.css +27 -20
- package/dist/card/Card.js +76 -23
- package/dist/card/Card.js.map +1 -1
- package/dist/card/Card.module.js +5 -5
- package/dist/card/Card.module.js.map +1 -1
- package/dist/card/tokens.d.ts +3 -0
- package/dist/card/tokens.d.ts.map +1 -0
- package/dist/card/tokens.js +31 -0
- package/dist/card/tokens.js.map +1 -0
- package/dist/checkbox/Checkbox.css +22 -21
- package/dist/checkbox/Checkbox.d.ts +1 -1
- package/dist/checkbox/Checkbox.d.ts.map +1 -1
- package/dist/checkbox/Checkbox.js +87 -25
- package/dist/checkbox/Checkbox.js.map +1 -1
- package/dist/checkbox/Checkbox.module.js +6 -6
- package/dist/checkbox/Checkbox.module.js.map +1 -1
- package/dist/checkbox/ChoiceChrome.d.ts +3 -1
- package/dist/checkbox/ChoiceChrome.d.ts.map +1 -1
- package/dist/checkbox/ChoiceChrome.js +82 -21
- package/dist/checkbox/ChoiceChrome.js.map +1 -1
- package/dist/checkbox/tokens.d.ts +3 -0
- package/dist/checkbox/tokens.d.ts.map +1 -0
- package/dist/checkbox/tokens.js +21 -0
- package/dist/checkbox/tokens.js.map +1 -0
- package/dist/combo-box/ComboBox.css +4 -4
- package/dist/combo-box/ComboBox.d.ts +1 -1
- package/dist/combo-box/ComboBox.js +291 -79
- package/dist/combo-box/ComboBox.js.map +1 -1
- package/dist/combo-box/ComboBox.module.js +3 -3
- package/dist/command-palette/CommandPalette.css +299 -0
- package/dist/command-palette/CommandPalette.d.ts +37 -0
- package/dist/command-palette/CommandPalette.d.ts.map +1 -0
- package/dist/command-palette/CommandPalette.js +497 -0
- package/dist/command-palette/CommandPalette.js.map +1 -0
- package/dist/command-palette/CommandPalette.module.js +62 -0
- package/dist/command-palette/CommandPalette.module.js.map +1 -0
- package/dist/command-palette/match.d.ts +39 -0
- package/dist/command-palette/match.d.ts.map +1 -0
- package/dist/command-palette/match.js +44 -0
- package/dist/command-palette/match.js.map +1 -0
- package/dist/command-palette/tokens.d.ts +3 -0
- package/dist/command-palette/tokens.d.ts.map +1 -0
- package/dist/command-palette/tokens.js +23 -0
- package/dist/command-palette/tokens.js.map +1 -0
- package/dist/command-palette/useCommandShortcut.d.ts +12 -0
- package/dist/command-palette/useCommandShortcut.d.ts.map +1 -0
- package/dist/command-palette/useCommandShortcut.js +48 -0
- package/dist/command-palette/useCommandShortcut.js.map +1 -0
- package/dist/container/Container.css +32 -0
- package/dist/container/Container.d.ts +15 -0
- package/dist/container/Container.d.ts.map +1 -0
- package/dist/container/Container.js +61 -0
- package/dist/container/Container.js.map +1 -0
- package/dist/container/Container.module.js +20 -0
- package/dist/container/Container.module.js.map +1 -0
- package/dist/container/tokens.d.ts +3 -0
- package/dist/container/tokens.d.ts.map +1 -0
- package/dist/container/tokens.js +19 -0
- package/dist/container/tokens.js.map +1 -0
- package/dist/date-picker/DatePicker.css +70 -30
- package/dist/date-picker/DatePicker.d.ts +3 -2
- package/dist/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/date-picker/DatePicker.js +279 -72
- package/dist/date-picker/DatePicker.js.map +1 -1
- package/dist/date-picker/DatePicker.module.js +16 -12
- package/dist/date-picker/DatePicker.module.js.map +1 -1
- package/dist/date-picker/calendarTokens.d.ts +3 -0
- package/dist/date-picker/calendarTokens.d.ts.map +1 -0
- package/dist/date-picker/calendarTokens.js +17 -0
- package/dist/date-picker/calendarTokens.js.map +1 -0
- package/dist/dialog/Dialog.css +80 -37
- package/dist/dialog/Dialog.d.ts +15 -3
- package/dist/dialog/Dialog.d.ts.map +1 -1
- package/dist/dialog/Dialog.js +159 -30
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/Dialog.module.js +21 -13
- package/dist/dialog/Dialog.module.js.map +1 -1
- package/dist/dialog/tokens.d.ts +3 -0
- package/dist/dialog/tokens.d.ts.map +1 -0
- package/dist/dialog/tokens.js +31 -0
- package/dist/dialog/tokens.js.map +1 -0
- package/dist/disclosure/Disclosure.css +12 -12
- package/dist/disclosure/Disclosure.d.ts.map +1 -1
- package/dist/disclosure/Disclosure.js +132 -28
- package/dist/disclosure/Disclosure.js.map +1 -1
- package/dist/disclosure/Disclosure.module.js +7 -7
- package/dist/disclosure/Disclosure.module.js.map +1 -1
- package/dist/disclosure/tokens.d.ts +3 -0
- package/dist/disclosure/tokens.d.ts.map +1 -0
- package/dist/disclosure/tokens.js +15 -0
- package/dist/disclosure/tokens.js.map +1 -0
- package/dist/divider/Divider.css +17 -0
- package/dist/divider/Divider.d.ts +8 -0
- package/dist/divider/Divider.d.ts.map +1 -0
- package/dist/divider/Divider.js +65 -0
- package/dist/divider/Divider.js.map +1 -0
- package/dist/divider/Divider.module.js +12 -0
- package/dist/divider/Divider.module.js.map +1 -0
- package/dist/divider/tokens.d.ts +3 -0
- package/dist/divider/tokens.d.ts.map +1 -0
- package/dist/divider/tokens.js +13 -0
- package/dist/divider/tokens.js.map +1 -0
- package/dist/field/Field.css +49 -37
- package/dist/field/Field.module.js +11 -11
- package/dist/field/Field.module.js.map +1 -1
- package/dist/field/FieldParts.d.ts +1 -1
- package/dist/field/FieldParts.js +69 -15
- package/dist/field/FieldParts.js.map +1 -1
- package/dist/field/Fieldset.js +99 -32
- package/dist/field/Fieldset.js.map +1 -1
- package/dist/field/inputTokens.d.ts +3 -0
- package/dist/field/inputTokens.d.ts.map +1 -0
- package/dist/field/inputTokens.js +21 -0
- package/dist/field/inputTokens.js.map +1 -0
- package/dist/field/tokens.d.ts +3 -0
- package/dist/field/tokens.d.ts.map +1 -0
- package/dist/field/tokens.js +15 -0
- package/dist/field/tokens.js.map +1 -0
- package/dist/grid/Grid.css +174 -0
- package/dist/grid/Grid.d.ts +28 -0
- package/dist/grid/Grid.d.ts.map +1 -0
- package/dist/grid/Grid.js +140 -0
- package/dist/grid/Grid.js.map +1 -0
- package/dist/grid/Grid.module.js +12 -0
- package/dist/grid/Grid.module.js.map +1 -0
- package/dist/grid/GridItem.css +59 -0
- package/dist/grid/GridItem.module.js +7 -0
- package/dist/grid/GridItem.module.js.map +1 -0
- package/dist/grid/tokens.d.ts +3 -0
- package/dist/grid/tokens.d.ts.map +1 -0
- package/dist/grid/tokens.js +10 -0
- package/dist/grid/tokens.js.map +1 -0
- package/dist/heading/Heading.css +52 -0
- package/dist/heading/Heading.d.ts +17 -0
- package/dist/heading/Heading.d.ts.map +1 -0
- package/dist/heading/Heading.js +52 -0
- package/dist/heading/Heading.js.map +1 -0
- package/dist/heading/Heading.module.js +16 -0
- package/dist/heading/Heading.module.js.map +1 -0
- package/dist/heading/tokens.d.ts +6 -0
- package/dist/heading/tokens.d.ts.map +1 -0
- package/dist/heading/tokens.js +66 -0
- package/dist/heading/tokens.js.map +1 -0
- package/dist/icon/Icon.css +1 -1
- package/dist/icon/Icon.js +36 -11
- package/dist/icon/Icon.js.map +1 -1
- package/dist/icon/Icon.module.js +1 -1
- package/dist/icon/lucideIconLoader.d.ts +9 -0
- package/dist/icon/lucideIconLoader.d.ts.map +1 -0
- package/dist/icon/lucideIconLoader.js +22 -0
- package/dist/icon/lucideIconLoader.js.map +1 -0
- package/dist/icon/namedIcons.d.ts +23 -0
- package/dist/icon/namedIcons.d.ts.map +1 -0
- package/dist/icon/namedIcons.js +165 -0
- package/dist/icon/namedIcons.js.map +1 -0
- package/dist/icon-button/IconButton.css +2 -2
- package/dist/icon-button/IconButton.d.ts +3 -3
- package/dist/icon-button/IconButton.d.ts.map +1 -1
- package/dist/icon-button/IconButton.js +70 -13
- package/dist/icon-button/IconButton.js.map +1 -1
- package/dist/icon-button/IconButton.module.js +2 -2
- package/dist/index.d.ts +61 -31
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -4
- package/dist/inline/Inline.css +142 -0
- package/dist/inline/Inline.d.ts +17 -0
- package/dist/inline/Inline.d.ts.map +1 -0
- package/dist/inline/Inline.js +79 -0
- package/dist/inline/Inline.js.map +1 -0
- package/dist/inline/Inline.module.js +12 -0
- package/dist/inline/Inline.module.js.map +1 -0
- package/dist/inline/tokens.d.ts +3 -0
- package/dist/inline/tokens.d.ts.map +1 -0
- package/dist/inline/tokens.js +10 -0
- package/dist/inline/tokens.js.map +1 -0
- package/dist/intl/usePanneauIntl.js.map +1 -1
- package/dist/layout/responsive.d.ts +38 -0
- package/dist/layout/responsive.d.ts.map +1 -0
- package/dist/layout/responsive.js +49 -0
- package/dist/layout/responsive.js.map +1 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/menu/Menu.css +84 -0
- package/dist/menu/Menu.d.ts +34 -7
- package/dist/menu/Menu.d.ts.map +1 -1
- package/dist/menu/Menu.js +243 -32
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/Menu.module.js +22 -0
- package/dist/menu/Menu.module.js.map +1 -0
- package/dist/menu/tokens.d.ts +3 -0
- package/dist/menu/tokens.d.ts.map +1 -0
- package/dist/menu/tokens.js +31 -0
- package/dist/menu/tokens.js.map +1 -0
- package/dist/named-icons/index.d.ts +2 -0
- package/dist/named-icons/index.d.ts.map +1 -0
- package/dist/named-icons/index.js +1 -0
- package/dist/number-input/NumberInput.css +30 -12
- package/dist/number-input/NumberInput.d.ts +1 -1
- package/dist/number-input/NumberInput.js +232 -60
- package/dist/number-input/NumberInput.js.map +1 -1
- package/dist/number-input/NumberInput.module.js +7 -5
- package/dist/number-input/NumberInput.module.js.map +1 -1
- package/dist/number-input/tokens.d.ts +3 -0
- package/dist/number-input/tokens.d.ts.map +1 -0
- package/dist/number-input/tokens.js +10 -0
- package/dist/number-input/tokens.js.map +1 -0
- package/dist/pill-trigger/PillTrigger.css +104 -0
- package/dist/pill-trigger/PillTrigger.d.ts +20 -0
- package/dist/pill-trigger/PillTrigger.d.ts.map +1 -0
- package/dist/pill-trigger/PillTrigger.js +94 -0
- package/dist/pill-trigger/PillTrigger.js.map +1 -0
- package/dist/pill-trigger/PillTrigger.module.js +18 -0
- package/dist/pill-trigger/PillTrigger.module.js.map +1 -0
- package/dist/pill-trigger/tokens.d.ts +3 -0
- package/dist/pill-trigger/tokens.d.ts.map +1 -0
- package/dist/pill-trigger/tokens.js +37 -0
- package/dist/pill-trigger/tokens.js.map +1 -0
- package/dist/popover/Popover.css +18 -12
- package/dist/popover/Popover.d.ts.map +1 -1
- package/dist/popover/Popover.js +116 -20
- package/dist/popover/Popover.js.map +1 -1
- package/dist/popover/Popover.module.js +7 -5
- package/dist/popover/Popover.module.js.map +1 -1
- package/dist/popover/tokens.d.ts +3 -0
- package/dist/popover/tokens.d.ts.map +1 -0
- package/dist/popover/tokens.js +19 -0
- package/dist/popover/tokens.js.map +1 -0
- package/dist/prose/Prose.css +141 -0
- package/dist/prose/Prose.d.ts +11 -0
- package/dist/prose/Prose.d.ts.map +1 -0
- package/dist/prose/Prose.js +49 -0
- package/dist/prose/Prose.js.map +1 -0
- package/dist/prose/Prose.module.js +8 -0
- package/dist/prose/Prose.module.js.map +1 -0
- package/dist/prose/tokens.d.ts +3 -0
- package/dist/prose/tokens.d.ts.map +1 -0
- package/dist/prose/tokens.js +33 -0
- package/dist/prose/tokens.js.map +1 -0
- package/dist/radio-group/RadioGroup.css +111 -20
- package/dist/radio-group/RadioGroup.d.ts +24 -5
- package/dist/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/radio-group/RadioGroup.js +214 -43
- package/dist/radio-group/RadioGroup.js.map +1 -1
- package/dist/radio-group/RadioGroup.module.js +18 -8
- package/dist/radio-group/RadioGroup.module.js.map +1 -1
- package/dist/radio-group/tokens.d.ts +3 -0
- package/dist/radio-group/tokens.d.ts.map +1 -0
- package/dist/radio-group/tokens.js +39 -0
- package/dist/radio-group/tokens.js.map +1 -0
- package/dist/root/PanneauRoot.css +243 -20
- package/dist/root/PanneauRoot.d.ts +57 -4
- package/dist/root/PanneauRoot.d.ts.map +1 -1
- package/dist/root/PanneauRoot.js +325 -46
- package/dist/root/PanneauRoot.js.map +1 -1
- package/dist/root/PanneauRoot.module.js +11 -3
- package/dist/root/PanneauRoot.module.js.map +1 -1
- package/dist/root/ThemeScope.d.ts +24 -0
- package/dist/root/ThemeScope.d.ts.map +1 -0
- package/dist/root/ThemeScope.js +132 -0
- package/dist/root/ThemeScope.js.map +1 -0
- package/dist/segmented-control/SegmentedControl.css +83 -0
- package/dist/segmented-control/SegmentedControl.d.ts +35 -0
- package/dist/segmented-control/SegmentedControl.d.ts.map +1 -0
- package/dist/segmented-control/SegmentedControl.js +142 -0
- package/dist/segmented-control/SegmentedControl.js.map +1 -0
- package/dist/segmented-control/SegmentedControl.module.js +16 -0
- package/dist/segmented-control/SegmentedControl.module.js.map +1 -0
- package/dist/segmented-control/tokens.d.ts +3 -0
- package/dist/segmented-control/tokens.d.ts.map +1 -0
- package/dist/segmented-control/tokens.js +29 -0
- package/dist/segmented-control/tokens.js.map +1 -0
- package/dist/select/ListBox.css +46 -23
- package/dist/select/ListBox.module.js +13 -13
- package/dist/select/ListBox.module.js.map +1 -1
- package/dist/select/Select.d.ts +1 -1
- package/dist/select/Select.js +298 -92
- package/dist/select/Select.js.map +1 -1
- package/dist/select/listBoxTokens.d.ts +3 -0
- package/dist/select/listBoxTokens.d.ts.map +1 -0
- package/dist/select/listBoxTokens.js +21 -0
- package/dist/select/listBoxTokens.js.map +1 -0
- package/dist/skeleton/LoadingRegion.d.ts +16 -0
- package/dist/skeleton/LoadingRegion.d.ts.map +1 -0
- package/dist/skeleton/LoadingRegion.js +65 -0
- package/dist/skeleton/LoadingRegion.js.map +1 -0
- package/dist/skeleton/Skeleton.css +62 -0
- package/dist/skeleton/Skeleton.d.ts +25 -0
- package/dist/skeleton/Skeleton.d.ts.map +1 -0
- package/dist/skeleton/Skeleton.js +106 -0
- package/dist/skeleton/Skeleton.js.map +1 -0
- package/dist/skeleton/Skeleton.module.js +22 -0
- package/dist/skeleton/Skeleton.module.js.map +1 -0
- package/dist/skeleton/tokens.d.ts +3 -0
- package/dist/skeleton/tokens.d.ts.map +1 -0
- package/dist/skeleton/tokens.js +15 -0
- package/dist/skeleton/tokens.js.map +1 -0
- package/dist/slider/Slider.css +84 -0
- package/dist/slider/Slider.d.ts +20 -0
- package/dist/slider/Slider.d.ts.map +1 -0
- package/dist/slider/Slider.js +248 -0
- package/dist/slider/Slider.js.map +1 -0
- package/dist/slider/Slider.module.js +20 -0
- package/dist/slider/Slider.module.js.map +1 -0
- package/dist/spinner/Spinner.css +8 -8
- package/dist/spinner/Spinner.js +49 -9
- package/dist/spinner/Spinner.js.map +1 -1
- package/dist/spinner/Spinner.module.js +5 -5
- package/dist/spinner/Spinner.module.js.map +1 -1
- package/dist/spinner/tokens.d.ts +3 -0
- package/dist/spinner/tokens.d.ts.map +1 -0
- package/dist/spinner/tokens.js +10 -0
- package/dist/spinner/tokens.js.map +1 -0
- package/dist/stack/Stack.css +135 -0
- package/dist/stack/Stack.d.ts +15 -0
- package/dist/stack/Stack.d.ts.map +1 -0
- package/dist/stack/Stack.js +74 -0
- package/dist/stack/Stack.js.map +1 -0
- package/dist/stack/Stack.module.js +8 -0
- package/dist/stack/Stack.module.js.map +1 -0
- package/dist/stack/tokens.d.ts +3 -0
- package/dist/stack/tokens.d.ts.map +1 -0
- package/dist/stack/tokens.js +10 -0
- package/dist/stack/tokens.js.map +1 -0
- package/dist/switch/Switch.css +34 -25
- package/dist/switch/Switch.d.ts +1 -1
- package/dist/switch/Switch.d.ts.map +1 -1
- package/dist/switch/Switch.js +69 -11
- package/dist/switch/Switch.js.map +1 -1
- package/dist/switch/Switch.module.js +6 -5
- package/dist/switch/Switch.module.js.map +1 -1
- package/dist/switch/tokens.d.ts +3 -0
- package/dist/switch/tokens.d.ts.map +1 -0
- package/dist/switch/tokens.js +25 -0
- package/dist/switch/tokens.js.map +1 -0
- package/dist/tabs/Tabs.css +24 -23
- package/dist/tabs/Tabs.js +5 -5
- package/dist/tabs/Tabs.js.map +1 -1
- package/dist/tabs/Tabs.module.js +4 -4
- package/dist/tabs/Tabs.module.js.map +1 -1
- package/dist/tabs/tokens.d.ts +3 -0
- package/dist/tabs/tokens.d.ts.map +1 -0
- package/dist/tabs/tokens.js +25 -0
- package/dist/tabs/tokens.js.map +1 -0
- package/dist/tags-input/TagsInput.css +60 -0
- package/dist/tags-input/TagsInput.d.ts +32 -0
- package/dist/tags-input/TagsInput.d.ts.map +1 -0
- package/dist/tags-input/TagsInput.js +316 -0
- package/dist/tags-input/TagsInput.js.map +1 -0
- package/dist/tags-input/TagsInput.module.js +20 -0
- package/dist/tags-input/TagsInput.module.js.map +1 -0
- package/dist/text/Text.css +74 -0
- package/dist/text/Text.d.ts +27 -0
- package/dist/text/Text.d.ts.map +1 -0
- package/dist/text/Text.js +81 -0
- package/dist/text/Text.js.map +1 -0
- package/dist/text/Text.module.js +30 -0
- package/dist/text/Text.module.js.map +1 -0
- package/dist/text/tokens.d.ts +3 -0
- package/dist/text/tokens.d.ts.map +1 -0
- package/dist/text/tokens.js +10 -0
- package/dist/text/tokens.js.map +1 -0
- package/dist/text-area/TextArea.css +1 -1
- package/dist/text-area/TextArea.d.ts +1 -1
- package/dist/text-area/TextArea.js +135 -28
- package/dist/text-area/TextArea.js.map +1 -1
- package/dist/text-area/TextArea.module.js +3 -3
- package/dist/text-area/TextArea.module.js.map +1 -1
- package/dist/text-input/TextInput.d.ts +1 -1
- package/dist/text-input/TextInput.d.ts.map +1 -1
- package/dist/text-input/TextInput.js +164 -47
- package/dist/text-input/TextInput.js.map +1 -1
- package/dist/theme/Tone.css +70 -0
- package/dist/theme/Tone.module.js +20 -0
- package/dist/theme/Tone.module.js.map +1 -0
- package/dist/theme/bootstrap.d.ts +11 -1
- package/dist/theme/bootstrap.d.ts.map +1 -1
- package/dist/theme/bootstrap.js +48 -5
- package/dist/theme/bootstrap.js.map +1 -1
- package/dist/theme/chartColors.d.ts +23 -0
- package/dist/theme/chartColors.d.ts.map +1 -0
- package/dist/theme/chartColors.js +27 -0
- package/dist/theme/chartColors.js.map +1 -0
- package/dist/theme/checkTheme.d.ts +39 -0
- package/dist/theme/checkTheme.d.ts.map +1 -0
- package/dist/theme/checkTheme.js +132 -0
- package/dist/theme/checkTheme.js.map +1 -0
- package/dist/theme/cli.d.ts +14 -0
- package/dist/theme/cli.d.ts.map +1 -0
- package/dist/theme/cli.js +61 -0
- package/dist/theme/cli.js.map +1 -0
- package/dist/theme/color.d.ts +30 -0
- package/dist/theme/color.d.ts.map +1 -0
- package/dist/theme/color.js +94 -0
- package/dist/theme/color.js.map +1 -0
- package/dist/theme/colorVision.d.ts +23 -0
- package/dist/theme/colorVision.d.ts.map +1 -0
- package/dist/theme/colorVision.js +140 -0
- package/dist/theme/colorVision.js.map +1 -0
- package/dist/theme/componentTokens.d.ts +24 -0
- package/dist/theme/componentTokens.d.ts.map +1 -0
- package/dist/theme/componentTokens.js +20 -0
- package/dist/theme/componentTokens.js.map +1 -0
- package/dist/theme/components.d.ts +43 -0
- package/dist/theme/components.d.ts.map +1 -0
- package/dist/theme/components.js +75 -0
- package/dist/theme/components.js.map +1 -0
- package/dist/theme/defineTheme.d.ts +85 -0
- package/dist/theme/defineTheme.d.ts.map +1 -0
- package/dist/theme/defineTheme.js +130 -0
- package/dist/theme/defineTheme.js.map +1 -0
- package/dist/theme/fonts.d.ts +32 -0
- package/dist/theme/fonts.d.ts.map +1 -0
- package/dist/theme/fonts.js +36 -0
- package/dist/theme/fonts.js.map +1 -0
- package/dist/theme/index.d.ts +13 -0
- package/dist/theme/index.d.ts.map +1 -0
- package/dist/theme/index.js +10 -0
- package/dist/theme/semanticTokens.d.ts +9 -0
- package/dist/theme/semanticTokens.d.ts.map +1 -0
- package/dist/theme/semanticTokens.js +110 -0
- package/dist/theme/semanticTokens.js.map +1 -0
- package/dist/theme/theme.d.ts +61 -7
- package/dist/theme/theme.d.ts.map +1 -1
- package/dist/theme/theme.js +100 -10
- package/dist/theme/theme.js.map +1 -1
- package/dist/theme/toneClass.d.ts +8 -0
- package/dist/theme/toneClass.d.ts.map +1 -0
- package/dist/theme/toneClass.js +15 -0
- package/dist/theme/toneClass.js.map +1 -0
- package/dist/theme/tones.d.ts +89 -0
- package/dist/theme/tones.d.ts.map +1 -0
- package/dist/theme/tones.js +127 -0
- package/dist/theme/tones.js.map +1 -0
- package/dist/time-input/TimeInput.d.ts +1 -1
- package/dist/time-input/TimeInput.js +138 -31
- package/dist/time-input/TimeInput.js.map +1 -1
- package/dist/toast/Toast.css +22 -44
- package/dist/toast/Toast.d.ts +5 -3
- package/dist/toast/Toast.d.ts.map +1 -1
- package/dist/toast/Toast.js +5 -4
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/Toast.module.js +10 -16
- package/dist/toast/Toast.module.js.map +1 -1
- package/dist/toast/tokens.d.ts +3 -0
- package/dist/toast/tokens.d.ts.map +1 -0
- package/dist/toast/tokens.js +21 -0
- package/dist/toast/tokens.js.map +1 -0
- package/dist/tooltip/Tooltip.css +12 -11
- package/dist/tooltip/Tooltip.js +38 -8
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/Tooltip.module.js +2 -2
- package/dist/tooltip/Tooltip.module.js.map +1 -1
- package/dist/tooltip/tokens.d.ts +3 -0
- package/dist/tooltip/tokens.d.ts.map +1 -0
- package/dist/tooltip/tokens.js +21 -0
- package/dist/tooltip/tokens.js.map +1 -0
- package/dist/utils/cx.d.ts +1 -1
- package/dist/utils/cx.d.ts.map +1 -1
- package/dist/utils/cx.js +2 -2
- package/dist/utils/cx.js.map +1 -1
- package/dist/utils/events.d.ts +4 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/dist/utils/events.js +9 -0
- package/dist/utils/events.js.map +1 -0
- package/package.json +22 -5
package/dist/root/PanneauRoot.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { NamedIconLoaderContext } from "../icon/namedIcons.js";
|
|
3
|
+
import { getFontFaceCss, getFontStylesheets } from "../theme/fonts.js";
|
|
2
4
|
import { getThemeCss, hashString } from "../theme/theme.js";
|
|
3
5
|
import { ToastProvider } from "../toast/Toast.js";
|
|
4
6
|
import PanneauRoot_module_default from "./PanneauRoot.module.js";
|
|
7
|
+
import { c } from "react/compiler-runtime";
|
|
5
8
|
import { I18nProvider } from "react-aria-components";
|
|
6
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
10
|
import { getPanneauMessages } from "@panneau/intl";
|
|
8
11
|
import { createContext, use, useState } from "react";
|
|
9
12
|
import { IntlContext, IntlProvider } from "react-intl";
|
|
@@ -11,7 +14,107 @@ import { IntlContext, IntlProvider } from "react-intl";
|
|
|
11
14
|
/** `undefined` outside of a root, `null` while the root's container isn't mounted yet. */
|
|
12
15
|
var PortalContext = createContext(void 0);
|
|
13
16
|
/**
|
|
14
|
-
* The
|
|
17
|
+
* The color scheme and density in effect, which a `ThemeScope` inherits when it doesn't set them,
|
|
18
|
+
* and the nonce of the styles of themes.
|
|
19
|
+
*/
|
|
20
|
+
var ScopeContext = createContext({
|
|
21
|
+
colorScheme: "light",
|
|
22
|
+
density: "auto"
|
|
23
|
+
});
|
|
24
|
+
/**
|
|
25
|
+
* The nonce of the page's Content Security Policy, where React Aria reads it: the `nonce` (or
|
|
26
|
+
* `content`) of `<meta property="csp-nonce">` or `<meta name="csp-nonce">`, or
|
|
27
|
+
* `__webpack_nonce__`. `undefined` without one, and on the server.
|
|
28
|
+
*/
|
|
29
|
+
function getPageNonce() {
|
|
30
|
+
if (typeof document === "undefined") return;
|
|
31
|
+
const meta = document.querySelector("meta[property=\"csp-nonce\"], meta[name=\"csp-nonce\"]");
|
|
32
|
+
const nonce = meta?.nonce || meta?.content || globalThis.__webpack_nonce__;
|
|
33
|
+
return nonce !== void 0 && nonce !== "" ? nonce : void 0;
|
|
34
|
+
}
|
|
35
|
+
/** Gives overlays a container: that of a root, or of a scope. */
|
|
36
|
+
var PortalProvider = PortalContext.Provider;
|
|
37
|
+
/**
|
|
38
|
+
* The `<style>` and `<link>` elements of a theme: its CSS, scoped to `data-panneau-theme`, and its
|
|
39
|
+
* fonts. React hoists them to the head and adds each once, however many roots or scopes use it.
|
|
40
|
+
* Returns the scope of the theme too, for `data-panneau-theme`.
|
|
41
|
+
*/
|
|
42
|
+
function useThemeStyles(theme, nonce) {
|
|
43
|
+
const $ = c(17);
|
|
44
|
+
let t0;
|
|
45
|
+
let t1;
|
|
46
|
+
let t2;
|
|
47
|
+
if ($[0] !== nonce || $[1] !== theme) {
|
|
48
|
+
const css = theme !== null ? getThemeCss(theme, "§") : "";
|
|
49
|
+
const scope = css !== "" ? hashString(css) : void 0;
|
|
50
|
+
const fontCss = getFontFaceCss(theme?.fonts);
|
|
51
|
+
t2 = scope;
|
|
52
|
+
t0 = scope !== void 0 ? /* @__PURE__ */ jsx("style", {
|
|
53
|
+
href: `panneau-theme-${scope}`,
|
|
54
|
+
precedence: "panneau",
|
|
55
|
+
nonce,
|
|
56
|
+
children: css.replaceAll("§", scope)
|
|
57
|
+
}) : null;
|
|
58
|
+
t1 = fontCss !== "" ? /* @__PURE__ */ jsx("style", {
|
|
59
|
+
href: `panneau-fonts-${hashString(fontCss)}`,
|
|
60
|
+
precedence: "panneau",
|
|
61
|
+
nonce,
|
|
62
|
+
children: fontCss
|
|
63
|
+
}) : null;
|
|
64
|
+
$[0] = nonce;
|
|
65
|
+
$[1] = theme;
|
|
66
|
+
$[2] = t0;
|
|
67
|
+
$[3] = t1;
|
|
68
|
+
$[4] = t2;
|
|
69
|
+
} else {
|
|
70
|
+
t0 = $[2];
|
|
71
|
+
t1 = $[3];
|
|
72
|
+
t2 = $[4];
|
|
73
|
+
}
|
|
74
|
+
let t3;
|
|
75
|
+
if ($[5] !== nonce || $[6] !== theme?.fonts) {
|
|
76
|
+
let t4;
|
|
77
|
+
if ($[8] !== nonce) {
|
|
78
|
+
t4 = (href) => /* @__PURE__ */ jsx("link", {
|
|
79
|
+
rel: "stylesheet",
|
|
80
|
+
href,
|
|
81
|
+
precedence: "panneau",
|
|
82
|
+
nonce
|
|
83
|
+
}, href);
|
|
84
|
+
$[8] = nonce;
|
|
85
|
+
$[9] = t4;
|
|
86
|
+
} else t4 = $[9];
|
|
87
|
+
t3 = getFontStylesheets(theme?.fonts).map(t4);
|
|
88
|
+
$[5] = nonce;
|
|
89
|
+
$[6] = theme?.fonts;
|
|
90
|
+
$[7] = t3;
|
|
91
|
+
} else t3 = $[7];
|
|
92
|
+
let t4;
|
|
93
|
+
if ($[10] !== t0 || $[11] !== t1 || $[12] !== t3) {
|
|
94
|
+
t4 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
|
+
t0,
|
|
96
|
+
t1,
|
|
97
|
+
t3
|
|
98
|
+
] });
|
|
99
|
+
$[10] = t0;
|
|
100
|
+
$[11] = t1;
|
|
101
|
+
$[12] = t3;
|
|
102
|
+
$[13] = t4;
|
|
103
|
+
} else t4 = $[13];
|
|
104
|
+
let t5;
|
|
105
|
+
if ($[14] !== t2 || $[15] !== t4) {
|
|
106
|
+
t5 = {
|
|
107
|
+
scope: t2,
|
|
108
|
+
styles: t4
|
|
109
|
+
};
|
|
110
|
+
$[14] = t2;
|
|
111
|
+
$[15] = t4;
|
|
112
|
+
$[16] = t5;
|
|
113
|
+
} else t5 = $[16];
|
|
114
|
+
return t5;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* The element overlays render into: the closest `PanneauRoot`'s or `ThemeScope`'s, or `undefined` for the body
|
|
15
118
|
* without a root. It is `null` during the first render of a root: overlays wait for it, since
|
|
16
119
|
* React Aria hides everything outside of a modal from assistive technologies when it opens.
|
|
17
120
|
*/
|
|
@@ -23,15 +126,56 @@ function usePortalContainer() {
|
|
|
23
126
|
* Panneau doesn't translate gets English, so that react-intl doesn't report every message as
|
|
24
127
|
* missing.
|
|
25
128
|
*/
|
|
26
|
-
function PanneauIntlProvider(
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
129
|
+
function PanneauIntlProvider(t0) {
|
|
130
|
+
const $ = c(14);
|
|
131
|
+
const { locale: t1, messages: added, children } = t0;
|
|
132
|
+
const locale = t1 === void 0 ? "en" : t1;
|
|
133
|
+
let t2;
|
|
134
|
+
if ($[0] !== locale) {
|
|
135
|
+
t2 = getPanneauMessages(locale);
|
|
136
|
+
$[0] = locale;
|
|
137
|
+
$[1] = t2;
|
|
138
|
+
} else t2 = $[1];
|
|
139
|
+
const messages = t2;
|
|
140
|
+
let t3;
|
|
141
|
+
if ($[2] !== messages) {
|
|
142
|
+
t3 = Object.keys(messages);
|
|
143
|
+
$[2] = messages;
|
|
144
|
+
$[3] = t3;
|
|
145
|
+
} else t3 = $[3];
|
|
146
|
+
const translated = t3.length > 0;
|
|
147
|
+
const t4 = translated ? locale : "en";
|
|
148
|
+
let t5;
|
|
149
|
+
if ($[4] !== messages || $[5] !== translated) {
|
|
150
|
+
t5 = translated ? messages : getPanneauMessages("en");
|
|
151
|
+
$[4] = messages;
|
|
152
|
+
$[5] = translated;
|
|
153
|
+
$[6] = t5;
|
|
154
|
+
} else t5 = $[6];
|
|
155
|
+
let t6;
|
|
156
|
+
if ($[7] !== added || $[8] !== t5) {
|
|
157
|
+
t6 = {
|
|
158
|
+
...t5,
|
|
159
|
+
...added
|
|
160
|
+
};
|
|
161
|
+
$[7] = added;
|
|
162
|
+
$[8] = t5;
|
|
163
|
+
$[9] = t6;
|
|
164
|
+
} else t6 = $[9];
|
|
165
|
+
let t7;
|
|
166
|
+
if ($[10] !== children || $[11] !== t4 || $[12] !== t6) {
|
|
167
|
+
t7 = /* @__PURE__ */ jsx(IntlProvider, {
|
|
168
|
+
locale: t4,
|
|
169
|
+
defaultLocale: "en",
|
|
170
|
+
messages: t6,
|
|
171
|
+
children
|
|
172
|
+
});
|
|
173
|
+
$[10] = children;
|
|
174
|
+
$[11] = t4;
|
|
175
|
+
$[12] = t6;
|
|
176
|
+
$[13] = t7;
|
|
177
|
+
} else t7 = $[13];
|
|
178
|
+
return t7;
|
|
35
179
|
}
|
|
36
180
|
/**
|
|
37
181
|
* The root of every Panneau interface. It scopes the base stylesheet and the design tokens to its
|
|
@@ -40,45 +184,180 @@ function PanneauIntlProvider({ locale = "en", children }) {
|
|
|
40
184
|
* any token with its own class on the root. Without an `IntlProvider` above it, it provides one
|
|
41
185
|
* with Panneau's messages in its `locale`.
|
|
42
186
|
*/
|
|
43
|
-
function PanneauRoot(
|
|
187
|
+
function PanneauRoot(t0) {
|
|
188
|
+
const $ = c(49);
|
|
189
|
+
let children;
|
|
190
|
+
let className;
|
|
191
|
+
let givenNonce;
|
|
192
|
+
let locale;
|
|
193
|
+
let messages;
|
|
194
|
+
let props;
|
|
195
|
+
let t1;
|
|
196
|
+
let t2;
|
|
197
|
+
let t3;
|
|
198
|
+
let t4;
|
|
199
|
+
if ($[0] !== t0) {
|
|
200
|
+
({theme: t1, colorScheme: t2, density: t3, iconLoader: t4, locale, messages, nonce: givenNonce, className, children, ...props} = t0);
|
|
201
|
+
$[0] = t0;
|
|
202
|
+
$[1] = children;
|
|
203
|
+
$[2] = className;
|
|
204
|
+
$[3] = givenNonce;
|
|
205
|
+
$[4] = locale;
|
|
206
|
+
$[5] = messages;
|
|
207
|
+
$[6] = props;
|
|
208
|
+
$[7] = t1;
|
|
209
|
+
$[8] = t2;
|
|
210
|
+
$[9] = t3;
|
|
211
|
+
$[10] = t4;
|
|
212
|
+
} else {
|
|
213
|
+
children = $[1];
|
|
214
|
+
className = $[2];
|
|
215
|
+
givenNonce = $[3];
|
|
216
|
+
locale = $[4];
|
|
217
|
+
messages = $[5];
|
|
218
|
+
props = $[6];
|
|
219
|
+
t1 = $[7];
|
|
220
|
+
t2 = $[8];
|
|
221
|
+
t3 = $[9];
|
|
222
|
+
t4 = $[10];
|
|
223
|
+
}
|
|
224
|
+
const theme = t1 === void 0 ? null : t1;
|
|
225
|
+
const colorScheme = t2 === void 0 ? "light" : t2;
|
|
226
|
+
const density = t3 === void 0 ? "auto" : t3;
|
|
227
|
+
const iconLoader = t4 === void 0 ? null : t4;
|
|
228
|
+
const [pageNonce] = useState(getPageNonce);
|
|
229
|
+
const nonce = givenNonce ?? pageNonce;
|
|
44
230
|
const intl = use(IntlContext);
|
|
45
231
|
const [container, setContainer] = useState(null);
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
232
|
+
const { scope, styles: themeStyles } = useThemeStyles(theme, nonce);
|
|
233
|
+
let t5;
|
|
234
|
+
if ($[11] !== className) {
|
|
235
|
+
t5 = cx("panneau-root", PanneauRoot_module_default.root, PanneauRoot_module_default.container, className);
|
|
236
|
+
$[11] = className;
|
|
237
|
+
$[12] = t5;
|
|
238
|
+
} else t5 = $[12];
|
|
239
|
+
const t6 = locale ?? intl?.locale;
|
|
240
|
+
let t7;
|
|
241
|
+
if ($[13] !== colorScheme || $[14] !== density || $[15] !== nonce) {
|
|
242
|
+
t7 = {
|
|
243
|
+
colorScheme,
|
|
244
|
+
density,
|
|
245
|
+
nonce
|
|
246
|
+
};
|
|
247
|
+
$[13] = colorScheme;
|
|
248
|
+
$[14] = density;
|
|
249
|
+
$[15] = nonce;
|
|
250
|
+
$[16] = t7;
|
|
251
|
+
} else t7 = $[16];
|
|
252
|
+
let t8;
|
|
253
|
+
if ($[17] !== colorScheme || $[18] !== density || $[19] !== scope) {
|
|
254
|
+
t8 = {
|
|
255
|
+
"data-color-scheme": colorScheme,
|
|
256
|
+
"data-density": density,
|
|
257
|
+
"data-panneau-theme": scope
|
|
258
|
+
};
|
|
259
|
+
$[17] = colorScheme;
|
|
260
|
+
$[18] = density;
|
|
261
|
+
$[19] = scope;
|
|
262
|
+
$[20] = t8;
|
|
263
|
+
} else t8 = $[20];
|
|
264
|
+
let t9;
|
|
265
|
+
if ($[21] !== children || $[22] !== t8) {
|
|
266
|
+
t9 = /* @__PURE__ */ jsx(ToastProvider, {
|
|
267
|
+
regionClassName: PanneauRoot_module_default.root,
|
|
268
|
+
regionProps: t8,
|
|
269
|
+
children
|
|
270
|
+
});
|
|
271
|
+
$[21] = children;
|
|
272
|
+
$[22] = t8;
|
|
273
|
+
$[23] = t9;
|
|
274
|
+
} else t9 = $[23];
|
|
275
|
+
let t10;
|
|
276
|
+
if ($[24] !== container || $[25] !== t9) {
|
|
277
|
+
t10 = /* @__PURE__ */ jsx(PortalContext, {
|
|
278
|
+
value: container,
|
|
279
|
+
children: t9
|
|
280
|
+
});
|
|
281
|
+
$[24] = container;
|
|
282
|
+
$[25] = t9;
|
|
283
|
+
$[26] = t10;
|
|
284
|
+
} else t10 = $[26];
|
|
285
|
+
let t11;
|
|
286
|
+
if ($[27] !== t10 || $[28] !== t7) {
|
|
287
|
+
t11 = /* @__PURE__ */ jsx(ScopeContext, {
|
|
288
|
+
value: t7,
|
|
289
|
+
children: t10
|
|
290
|
+
});
|
|
291
|
+
$[27] = t10;
|
|
292
|
+
$[28] = t7;
|
|
293
|
+
$[29] = t11;
|
|
294
|
+
} else t11 = $[29];
|
|
295
|
+
let t12;
|
|
296
|
+
if ($[30] !== iconLoader || $[31] !== t11) {
|
|
297
|
+
t12 = /* @__PURE__ */ jsx(NamedIconLoaderContext, {
|
|
298
|
+
value: iconLoader,
|
|
299
|
+
children: t11
|
|
300
|
+
});
|
|
301
|
+
$[30] = iconLoader;
|
|
302
|
+
$[31] = t11;
|
|
303
|
+
$[32] = t12;
|
|
304
|
+
} else t12 = $[32];
|
|
305
|
+
let t13;
|
|
306
|
+
if ($[33] === Symbol.for("react.memo_cache_sentinel")) {
|
|
307
|
+
t13 = /* @__PURE__ */ jsx("div", {
|
|
308
|
+
ref: setContainer,
|
|
309
|
+
className: PanneauRoot_module_default.portal
|
|
310
|
+
});
|
|
311
|
+
$[33] = t13;
|
|
312
|
+
} else t13 = $[33];
|
|
313
|
+
let t14;
|
|
314
|
+
if ($[34] !== t12 || $[35] !== t6) {
|
|
315
|
+
t14 = /* @__PURE__ */ jsxs(I18nProvider, {
|
|
316
|
+
locale: t6,
|
|
317
|
+
children: [t12, t13]
|
|
318
|
+
});
|
|
319
|
+
$[34] = t12;
|
|
320
|
+
$[35] = t6;
|
|
321
|
+
$[36] = t14;
|
|
322
|
+
} else t14 = $[36];
|
|
323
|
+
let t15;
|
|
324
|
+
if ($[37] !== colorScheme || $[38] !== density || $[39] !== props || $[40] !== scope || $[41] !== t14 || $[42] !== t5 || $[43] !== themeStyles) {
|
|
325
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
326
|
+
...props,
|
|
327
|
+
className: t5,
|
|
328
|
+
"data-color-scheme": colorScheme,
|
|
329
|
+
"data-density": density,
|
|
330
|
+
"data-panneau-theme": scope,
|
|
331
|
+
children: [themeStyles, t14]
|
|
332
|
+
});
|
|
333
|
+
$[37] = colorScheme;
|
|
334
|
+
$[38] = density;
|
|
335
|
+
$[39] = props;
|
|
336
|
+
$[40] = scope;
|
|
337
|
+
$[41] = t14;
|
|
338
|
+
$[42] = t5;
|
|
339
|
+
$[43] = themeStyles;
|
|
340
|
+
$[44] = t15;
|
|
341
|
+
} else t15 = $[44];
|
|
342
|
+
const root = t15;
|
|
343
|
+
if (intl === null || intl === void 0) {
|
|
344
|
+
let t16;
|
|
345
|
+
if ($[45] !== locale || $[46] !== messages || $[47] !== root) {
|
|
346
|
+
t16 = /* @__PURE__ */ jsx(PanneauIntlProvider, {
|
|
347
|
+
locale,
|
|
348
|
+
messages,
|
|
349
|
+
children: root
|
|
350
|
+
});
|
|
351
|
+
$[45] = locale;
|
|
352
|
+
$[46] = messages;
|
|
353
|
+
$[47] = root;
|
|
354
|
+
$[48] = t16;
|
|
355
|
+
} else t16 = $[48];
|
|
356
|
+
return t16;
|
|
357
|
+
}
|
|
79
358
|
return root;
|
|
80
359
|
}
|
|
81
360
|
//#endregion
|
|
82
|
-
export { PanneauRoot, usePortalContainer };
|
|
361
|
+
export { PanneauRoot, PortalProvider, ScopeContext, getPageNonce, usePortalContainer, useThemeStyles };
|
|
83
362
|
|
|
84
363
|
//# sourceMappingURL=PanneauRoot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanneauRoot.js","names":["styles"],"sources":["../../src/root/PanneauRoot.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, createContext, use, useState } from 'react';\nimport { I18nProvider } from 'react-aria-components';\nimport { IntlContext, IntlProvider, type IntlShape } from 'react-intl';\n\nimport { getPanneauMessages } from '@panneau/intl';\n\nimport { type ColorScheme, type Theme, getThemeCss, hashString } from '../theme/theme';\nimport { ToastProvider } from '../toast/Toast';\nimport { cx } from '../utils/cx';\nimport styles from './PanneauRoot.module.css';\n\nexport interface PanneauRootProps extends HTMLAttributes<HTMLDivElement> {\n /** Tokens that override the default theme: `bootstrapTheme`, or a project's own. */\n theme?: Theme | null;\n /** Defaults to `light`. `auto` follows the system setting. */\n colorScheme?: ColorScheme;\n /**\n * Locale of dates and numbers in React Aria components. Defaults to the react-intl locale, or\n * to the browser's without an `IntlProvider`.\n *\n * Without an `IntlProvider` above it, the root provides one, with the messages of every Panneau\n * package in this locale (English without a locale, or for a locale Panneau doesn't translate).\n * An app with its own `IntlProvider` adds them with `withPanneauMessages()` from\n * `@panneau/intl`.\n */\n locale?: string;\n children?: ReactNode;\n}\n\n/** `undefined` outside of a root, `null` while the root's container isn't mounted yet. */\nconst PortalContext = createContext<Element | null | undefined>(undefined);\n\n/**\n * The element overlays render into: the closest `PanneauRoot`'s, or `undefined` for the body\n * without a root. It is `null` during the first render of a root: overlays wait for it, since\n * React Aria hides everything outside of a modal from assistive technologies when it opens.\n */\nexport function usePortalContainer(): Element | null | undefined {\n return use(PortalContext);\n}\n\n/**\n * An `IntlProvider` with Panneau's messages in a locale, for a root without one above it. A locale\n * Panneau doesn't translate gets English, so that react-intl doesn't report every message as\n * missing.\n */\nfunction PanneauIntlProvider({\n locale = 'en',\n children,\n}: {\n locale?: string;\n children: ReactNode;\n}) {\n const messages = getPanneauMessages(locale);\n const translated = Object.keys(messages).length > 0;\n return (\n <IntlProvider\n locale={translated ? locale : 'en'}\n defaultLocale=\"en\"\n messages={translated ? messages : getPanneauMessages('en')}\n >\n {children}\n </IntlProvider>\n );\n}\n\n/**\n * The root of every Panneau interface. It scopes the base stylesheet and the design tokens to its\n * element (no global CSS), applies a theme and a color scheme, and hosts overlays and toasts so\n * that they get the tokens too. Panneau components must render inside one. A project can override\n * any token with its own class on the root. Without an `IntlProvider` above it, it provides one\n * with Panneau's messages in its `locale`.\n */\nexport function PanneauRoot({\n theme = null,\n colorScheme = 'light',\n locale,\n className,\n children,\n ...props\n}: PanneauRootProps) {\n const intl = use(IntlContext) as IntlShape | null | undefined;\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const css = theme !== null ? getThemeCss(theme, '§') : '';\n const scope = css !== '' ? hashString(css) : undefined;\n const root = (\n <div\n {...props}\n className={cx(styles.root, className)}\n data-color-scheme={colorScheme}\n data-panneau-theme={scope}\n >\n {scope !== undefined ? (\n <style href={`panneau-theme-${scope}`} precedence=\"panneau\">\n {css.replaceAll('§', scope)}\n </style>\n ) : null}\n <I18nProvider locale={locale ?? intl?.locale}>\n <PortalContext value={container}>\n <ToastProvider\n regionClassName={styles.root}\n regionProps={{\n 'data-color-scheme': colorScheme,\n 'data-panneau-theme': scope,\n }}\n >\n {children}\n </ToastProvider>\n </PortalContext>\n <div ref={setContainer} className={styles.portal} />\n </I18nProvider>\n </div>\n );\n if (intl === null || intl === undefined) {\n return <PanneauIntlProvider locale={locale}>{root}</PanneauIntlProvider>;\n }\n return root;\n}\n"],"mappings":";;;;;;;;;;;AA8BA,IAAM,gBAAgB,cAA0C,KAAA,CAAS;;;;;;AAOzE,SAAgB,qBAAiD;CAC7D,OAAO,IAAI,aAAa;AAC5B;;;;;;AAOA,SAAS,oBAAoB,EACzB,SAAS,MACT,YAID;CACC,MAAM,WAAW,mBAAmB,MAAM;CAC1C,MAAM,aAAa,OAAO,KAAK,QAAQ,CAAC,CAAC,SAAS;CAClD,OACI,oBAAC,cAAD;EACI,QAAQ,aAAa,SAAS;EAC9B,eAAc;EACd,UAAU,aAAa,WAAW,mBAAmB,IAAI;EAExD;CACS,CAAA;AAEtB;;;;;;;;AASA,SAAgB,YAAY,EACxB,QAAQ,MACR,cAAc,SACd,QACA,WACA,UACA,GAAG,SACc;CACjB,MAAM,OAAO,IAAI,WAAW;CAC5B,MAAM,CAAC,WAAW,gBAAgB,SAAgC,IAAI;CACtE,MAAM,MAAM,UAAU,OAAO,YAAY,OAAO,GAAG,IAAI;CACvD,MAAM,QAAQ,QAAQ,KAAK,WAAW,GAAG,IAAI,KAAA;CAC7C,MAAM,OACF,qBAAC,OAAD;EACI,GAAI;EACJ,WAAW,GAAGA,2BAAO,MAAM,SAAS;EACpC,qBAAmB;EACnB,sBAAoB;EAJxB,UAAA,CAMK,UAAU,KAAA,IACP,oBAAC,SAAD;GAAO,MAAM,iBAAiB;GAAS,YAAW;GAC7C,UAAA,IAAI,WAAW,KAAK,KAAK;EACvB,CAAA,IACP,MACJ,qBAAC,cAAD;GAAc,QAAQ,UAAU,MAAM;GAAtC,UAAA,CACI,oBAAC,eAAD;IAAe,OAAO;IAClB,UAAA,oBAAC,eAAD;KACI,iBAAiBA,2BAAO;KACxB,aAAa;MACT,qBAAqB;MACrB,sBAAsB;KAC1B;KAEC;IACU,CAAA;GACJ,CAAA,GACf,oBAAC,OAAD;IAAK,KAAK;IAAc,WAAWA,2BAAO;GAAO,CAAA,CACvC;EACb,CAAA,CAAA;;CAET,IAAI,SAAS,QAAQ,SAAS,KAAA,GAC1B,OAAO,oBAAC,qBAAD;EAA6B;EAAS,UAAA;CAA0B,CAAA;CAE3E,OAAO;AACX"}
|
|
1
|
+
{"version":3,"file":"PanneauRoot.js","names":["HTMLAttributes","ReactNode","createContext","use","useState","I18nProvider","IntlContext","IntlProvider","IntlShape","getPanneauMessages","NamedIconLoader","NamedIconLoaderContext","getFontFaceCss","getFontStylesheets","ColorScheme","Density","Theme","getThemeCss","hashString","ToastProvider","cx","styles","PanneauRootProps","HTMLDivElement","theme","colorScheme","density","iconLoader","locale","messages","Readonly","Record","nonce","children","PortalContext","Element","undefined","ScopeContext","getPageNonce","document","meta","querySelector","HTMLMetaElement","content","globalThis","__webpack_nonce__","PortalProvider","Provider","useThemeStyles","$","_c","t0","t1","t2","css","scope","fontCss","fonts","replaceAll","t3","t4","href","map","t5","usePortalContainer","PanneauIntlProvider","added","Object","keys","translated","length","t6","t7","PanneauRoot","className","givenNonce","props","pageNonce","intl","container","setContainer","themeStyles","root","t8","t9","t10","t11","t12","t13","Symbol","for","portal","t14","t15","t16","_c","_Fragment","styles"],"sources":["../../src/root/PanneauRoot.tsx"],"sourcesContent":["import { type HTMLAttributes, type ReactNode, createContext, use, useState } from 'react';\nimport { I18nProvider } from 'react-aria-components';\nimport { IntlContext, IntlProvider, type IntlShape } from 'react-intl';\n\nimport { getPanneauMessages } from '@panneau/intl';\n\nimport { type NamedIconLoader, NamedIconLoaderContext } from '../icon/namedIcons';\nimport { getFontFaceCss, getFontStylesheets } from '../theme/fonts';\nimport {\n type ColorScheme,\n type Density,\n type Theme,\n getThemeCss,\n hashString,\n} from '../theme/theme';\nimport { ToastProvider } from '../toast/Toast';\nimport { cx } from '../utils/cx';\nimport styles from './PanneauRoot.module.css';\n\nexport interface PanneauRootProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Tokens, tones, variants and fonts that override the default theme: `bootstrapTheme`, or a\n * project's own (`defineTheme()`).\n */\n theme?: Theme | null;\n /** Defaults to `light`. `auto` follows the system setting. */\n colorScheme?: ColorScheme;\n /**\n * How much room controls and rows take: `compact`, `comfortable` or `touch`. Defaults to\n * `auto`: `touch` on touch screens, `comfortable` otherwise.\n */\n density?: Density;\n /**\n * Loads the icons that definitions name (`\"icon\": \"send\"`), for `getNamedIcon()`: pass\n * `lucideIconLoader` from `@panneau/ui/named-icons`, or a loader of only the icons the app\n * uses. Without it, named icons render an empty space.\n */\n iconLoader?: NamedIconLoader | null;\n /**\n * Locale of dates and numbers in React Aria components. Defaults to the react-intl locale, or\n * to the browser's without an `IntlProvider`.\n *\n * Without an `IntlProvider` above it, the root provides one, with the messages of every Panneau\n * package in this locale (English without a locale, or for a locale Panneau doesn't translate).\n * An app with its own `IntlProvider` adds them with `withPanneauMessages()` from\n * `@panneau/intl`.\n */\n locale?: string;\n /**\n * Messages added to Panneau's, by id, when the root provides the `IntlProvider`: those of\n * plugins (`loadMessages()` of `@panneau/core`). An app with its own `IntlProvider` adds them\n * to its own.\n */\n messages?: Readonly<Record<string, string>> | null;\n /**\n * The nonce of the page's Content Security Policy, set on the `<style>` and `<link>` elements of\n * themes and fonts, for a policy without `'unsafe-inline'` in `style-src`. Defaults to the\n * nonce React Aria reads too: that of `<meta property=\"csp-nonce\">`, or `__webpack_nonce__`.\n */\n nonce?: string;\n children?: ReactNode;\n}\n\n/** `undefined` outside of a root, `null` while the root's container isn't mounted yet. */\nconst PortalContext = createContext<Element | null | undefined>(undefined);\n\n/**\n * The color scheme and density in effect, which a `ThemeScope` inherits when it doesn't set them,\n * and the nonce of the styles of themes.\n */\nexport const ScopeContext = createContext<{\n colorScheme: ColorScheme;\n density: Density;\n nonce?: string | undefined;\n}>({\n colorScheme: 'light',\n density: 'auto',\n});\n\n/**\n * The nonce of the page's Content Security Policy, where React Aria reads it: the `nonce` (or\n * `content`) of `<meta property=\"csp-nonce\">` or `<meta name=\"csp-nonce\">`, or\n * `__webpack_nonce__`. `undefined` without one, and on the server.\n */\nexport function getPageNonce(): string | undefined {\n if (typeof document === 'undefined') {\n return undefined;\n }\n const meta = document.querySelector<HTMLMetaElement>(\n 'meta[property=\"csp-nonce\"], meta[name=\"csp-nonce\"]',\n );\n const nonce =\n meta?.nonce ||\n meta?.content ||\n (globalThis as { __webpack_nonce__?: string }).__webpack_nonce__;\n return nonce !== undefined && nonce !== '' ? nonce : undefined;\n}\n\n/** Gives overlays a container: that of a root, or of a scope. */\nexport const PortalProvider = PortalContext.Provider;\n\n/**\n * The `<style>` and `<link>` elements of a theme: its CSS, scoped to `data-panneau-theme`, and its\n * fonts. React hoists them to the head and adds each once, however many roots or scopes use it.\n * Returns the scope of the theme too, for `data-panneau-theme`.\n */\nexport function useThemeStyles(\n theme: Theme | null,\n nonce?: string,\n): { scope?: string; styles: ReactNode } {\n const css = theme !== null ? getThemeCss(theme, '§') : '';\n const scope = css !== '' ? hashString(css) : undefined;\n const fontCss = getFontFaceCss(theme?.fonts);\n return {\n scope,\n styles: (\n <>\n {scope !== undefined ? (\n <style href={`panneau-theme-${scope}`} precedence=\"panneau\" nonce={nonce}>\n {css.replaceAll('§', scope)}\n </style>\n ) : null}\n {fontCss !== '' ? (\n <style\n href={`panneau-fonts-${hashString(fontCss)}`}\n precedence=\"panneau\"\n nonce={nonce}\n >\n {fontCss}\n </style>\n ) : null}\n {getFontStylesheets(theme?.fonts).map((href) => (\n <link\n key={href}\n rel=\"stylesheet\"\n href={href}\n precedence=\"panneau\"\n nonce={nonce}\n />\n ))}\n </>\n ),\n };\n}\n\n/**\n * The element overlays render into: the closest `PanneauRoot`'s or `ThemeScope`'s, or `undefined` for the body\n * without a root. It is `null` during the first render of a root: overlays wait for it, since\n * React Aria hides everything outside of a modal from assistive technologies when it opens.\n */\nexport function usePortalContainer(): Element | null | undefined {\n return use(PortalContext);\n}\n\n/**\n * An `IntlProvider` with Panneau's messages in a locale, for a root without one above it. A locale\n * Panneau doesn't translate gets English, so that react-intl doesn't report every message as\n * missing.\n */\nfunction PanneauIntlProvider({\n locale = 'en',\n messages: added,\n children,\n}: {\n locale?: string;\n messages?: Readonly<Record<string, string>> | null;\n children: ReactNode;\n}) {\n const messages = getPanneauMessages(locale);\n const translated = Object.keys(messages).length > 0;\n return (\n <IntlProvider\n locale={translated ? locale : 'en'}\n defaultLocale=\"en\"\n messages={{ ...(translated ? messages : getPanneauMessages('en')), ...added }}\n >\n {children}\n </IntlProvider>\n );\n}\n\n/**\n * The root of every Panneau interface. It scopes the base stylesheet and the design tokens to its\n * element (no global CSS), applies a theme and a color scheme, and hosts overlays and toasts so\n * that they get the tokens too. Panneau components must render inside one. A project can override\n * any token with its own class on the root. Without an `IntlProvider` above it, it provides one\n * with Panneau's messages in its `locale`.\n */\nexport function PanneauRoot({\n theme = null,\n colorScheme = 'light',\n density = 'auto',\n iconLoader = null,\n locale,\n messages,\n nonce: givenNonce,\n className,\n children,\n ...props\n}: PanneauRootProps) {\n const [pageNonce] = useState(getPageNonce);\n const nonce = givenNonce ?? pageNonce;\n const intl = use(IntlContext) as IntlShape | null | undefined;\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const { scope, styles: themeStyles } = useThemeStyles(theme, nonce);\n const root = (\n <div\n {...props}\n className={cx('panneau-root', styles.root, styles.container, className)}\n data-color-scheme={colorScheme}\n data-density={density}\n data-panneau-theme={scope}\n >\n {themeStyles}\n <I18nProvider locale={locale ?? intl?.locale}>\n <NamedIconLoaderContext value={iconLoader}>\n <ScopeContext value={{ colorScheme, density, nonce }}>\n <PortalContext value={container}>\n <ToastProvider\n regionClassName={styles.root}\n regionProps={{\n 'data-color-scheme': colorScheme,\n 'data-density': density,\n 'data-panneau-theme': scope,\n }}\n >\n {children}\n </ToastProvider>\n </PortalContext>\n </ScopeContext>\n </NamedIconLoaderContext>\n <div ref={setContainer} className={styles.portal} />\n </I18nProvider>\n </div>\n );\n if (intl === null || intl === undefined) {\n return (\n <PanneauIntlProvider locale={locale} messages={messages}>\n {root}\n </PanneauIntlProvider>\n );\n }\n return root;\n}\n"],"mappings":";;;;;;;;;;;;;;AAgEA,IAAMkC,gBAAgBhC,cAA0CkC,KAAAA,CAAS;;;;;AAMzE,IAAaC,eAAenC,cAIzB;CACCuB,aAAa;CACbC,SAAS;AACb,CAAC;;;;;;AAOD,SAAgBY,eAAmC;CAC/C,IAAI,OAAOC,aAAa,aACpB;CAEJ,MAAMC,OAAOD,SAASE,cAClB,wDACJ;CACA,MAAMT,QACFQ,MAAMR,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AAA0D;EAAA,IAAA7C,EAAA,QAAArB,UAAAqB,EAAA,QAAApB,YAAAoB,EAAA,QAAAiC,MAAA;GAE/BY,MAAA,oBAAC,qBAAD;IAA6BlE;IAAkBC;IAC1CqD,UAAAA;GADe,CAAA;GAEEjC,EAAA,MAAArB;GAAAqB,EAAA,MAAApB;GAAAoB,EAAA,MAAAiC;GAAAjC,EAAA,MAAA6C;EAAA,OAAAA,MAAA7C,EAAA;EAAA,OAFtB6C;CAEsB;CAE7B,OACMZ;AAAI"}
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import "./PanneauRoot.css";
|
|
2
2
|
//#region src/root/PanneauRoot.module.css
|
|
3
|
-
var root = "panneau-root
|
|
4
|
-
var
|
|
3
|
+
var root = "panneau-root";
|
|
4
|
+
var scheme = "panneau-root-scheme";
|
|
5
|
+
var density = "panneau-root-density";
|
|
6
|
+
var container = "panneau-root-container";
|
|
7
|
+
var scope = "panneau-root-scope";
|
|
8
|
+
var portal = "panneau-root-portal";
|
|
5
9
|
var PanneauRoot_module_default = {
|
|
6
10
|
root,
|
|
11
|
+
scheme,
|
|
12
|
+
density,
|
|
13
|
+
container,
|
|
14
|
+
scope,
|
|
7
15
|
portal
|
|
8
16
|
};
|
|
9
17
|
//#endregion
|
|
10
|
-
export { PanneauRoot_module_default as default, portal, root };
|
|
18
|
+
export { container, PanneauRoot_module_default as default, density, portal, root, scheme, scope };
|
|
11
19
|
|
|
12
20
|
//# sourceMappingURL=PanneauRoot.module.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PanneauRoot.module.js","names":[],"sources":["../../src/root/PanneauRoot.module.css"],"sourcesContent":["/*\n * Design tokens of the default theme, and the base stylesheet of Panneau. Everything is scoped to\n * the root element: nothing here applies outside of it (decision 0005).\n *\n * Defaults are wrapped in :where() so that they have no specificity: a theme, or a project's own\n * class on the root, overrides any token without fighting the cascade.\n */\n\n:where(.root) {\n /* Surfaces */\n --panneau-color-bg: #ffffff;\n --panneau-color-surface: #ffffff;\n --panneau-color-surface-sunken: #f4f4f5;\n --panneau-color-surface-raised: #ffffff;\n --panneau-color-hover: rgb(24 24 27 / 0.06);\n --panneau-color-pressed: rgb(24 24 27 / 0.1);\n --panneau-color-backdrop: rgb(9 9 11 / 0.45);\n\n /* Text */\n --panneau-color-text: #18181b;\n --panneau-color-text-muted: #52525b;\n --panneau-color-link: #1d4ed8;\n\n /* Borders: separators, and the outline of controls (3:1 against the surface) */\n --panneau-color-border: #e4e4e7;\n --panneau-color-border-control: #8b8b94;\n\n /* Accent: primary buttons, checked controls, selection */\n --panneau-color-accent: #18181b;\n --panneau-color-accent-hover: #3f3f46;\n --panneau-color-accent-text: #ffffff;\n --panneau-color-accent-subtle: #f4f4f5;\n --panneau-color-focus: #2563eb;\n\n /* Tones: text on surfaces, subtle backgrounds, borders */\n --panneau-color-danger: #b91c1c;\n --panneau-color-danger-subtle: #fef2f2;\n --panneau-color-danger-border: #fca5a5;\n --panneau-color-danger-solid: #b91c1c;\n --panneau-color-danger-solid-hover: #991b1b;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #15803d;\n --panneau-color-success-subtle: #f0fdf4;\n --panneau-color-success-border: #86efac;\n --panneau-color-warning: #a16207;\n --panneau-color-warning-subtle: #fefce8;\n --panneau-color-warning-border: #fcd34d;\n --panneau-color-info: #1d4ed8;\n --panneau-color-info-subtle: #eff6ff;\n --panneau-color-info-border: #93c5fd;\n\n /* Typography */\n --panneau-font-family:\n system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n --panneau-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n --panneau-font-size-xs: 0.75rem;\n --panneau-font-size-sm: 0.8125rem;\n --panneau-font-size-md: 0.875rem;\n --panneau-font-size-lg: 1rem;\n --panneau-font-size-xl: 1.25rem;\n --panneau-font-size-control: 0.875rem;\n --panneau-line-height: 1.5;\n --panneau-line-height-tight: 1.25;\n --panneau-font-weight-normal: 400;\n --panneau-font-weight-medium: 500;\n --panneau-font-weight-bold: 600;\n\n /* Spacing, on a 4px scale */\n --panneau-space-1: 0.25rem;\n --panneau-space-2: 0.5rem;\n --panneau-space-3: 0.75rem;\n --panneau-space-4: 1rem;\n --panneau-space-5: 1.25rem;\n --panneau-space-6: 1.5rem;\n --panneau-space-8: 2rem;\n --panneau-space-10: 2.5rem;\n\n /* Shapes */\n --panneau-radius-sm: 0.25rem;\n --panneau-radius-md: 0.375rem;\n --panneau-radius-lg: 0.5rem;\n --panneau-radius-full: 9999px;\n --panneau-border-width: 1px;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.08);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.08), 0 16px 40px rgb(0 0 0 / 0.16);\n\n /* Controls */\n --panneau-control-height: 2.25rem;\n --panneau-control-height-sm: 1.875rem;\n --panneau-focus-width: 2px;\n\n /* Motion and layers */\n --panneau-duration: 150ms;\n --panneau-z-overlay: 1000;\n --panneau-z-toast: 1100;\n\n color-scheme: light;\n}\n\n:where(.root[data-color-scheme='dark']) {\n --panneau-color-bg: #09090b;\n --panneau-color-surface: #18181b;\n --panneau-color-surface-sunken: #111113;\n --panneau-color-surface-raised: #232326;\n --panneau-color-hover: rgb(255 255 255 / 0.07);\n --panneau-color-pressed: rgb(255 255 255 / 0.12);\n --panneau-color-backdrop: rgb(0 0 0 / 0.6);\n --panneau-color-text: #fafafa;\n --panneau-color-text-muted: #a1a1aa;\n --panneau-color-link: #93c5fd;\n --panneau-color-border: #2e2e33;\n --panneau-color-border-control: #71717a;\n --panneau-color-accent: #fafafa;\n --panneau-color-accent-hover: #d4d4d8;\n --panneau-color-accent-text: #18181b;\n --panneau-color-accent-subtle: #2e2e33;\n --panneau-color-focus: #60a5fa;\n --panneau-color-danger: #fca5a5;\n --panneau-color-danger-subtle: rgb(127 29 29 / 0.35);\n --panneau-color-danger-border: #b91c1c;\n --panneau-color-danger-solid: #dc2626;\n --panneau-color-danger-solid-hover: #b91c1c;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #86efac;\n --panneau-color-success-subtle: rgb(20 83 45 / 0.35);\n --panneau-color-success-border: #15803d;\n --panneau-color-warning: #fcd34d;\n --panneau-color-warning-subtle: rgb(113 63 18 / 0.35);\n --panneau-color-warning-border: #a16207;\n --panneau-color-info: #93c5fd;\n --panneau-color-info-subtle: rgb(30 58 138 / 0.35);\n --panneau-color-info-border: #1d4ed8;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);\n\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n :where(.root[data-color-scheme='auto']) {\n --panneau-color-bg: #09090b;\n --panneau-color-surface: #18181b;\n --panneau-color-surface-sunken: #111113;\n --panneau-color-surface-raised: #232326;\n --panneau-color-hover: rgb(255 255 255 / 0.07);\n --panneau-color-pressed: rgb(255 255 255 / 0.12);\n --panneau-color-backdrop: rgb(0 0 0 / 0.6);\n --panneau-color-text: #fafafa;\n --panneau-color-text-muted: #a1a1aa;\n --panneau-color-link: #93c5fd;\n --panneau-color-border: #2e2e33;\n --panneau-color-border-control: #71717a;\n --panneau-color-accent: #fafafa;\n --panneau-color-accent-hover: #d4d4d8;\n --panneau-color-accent-text: #18181b;\n --panneau-color-accent-subtle: #2e2e33;\n --panneau-color-focus: #60a5fa;\n --panneau-color-danger: #fca5a5;\n --panneau-color-danger-subtle: rgb(127 29 29 / 0.35);\n --panneau-color-danger-border: #b91c1c;\n --panneau-color-danger-solid: #dc2626;\n --panneau-color-danger-solid-hover: #b91c1c;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #86efac;\n --panneau-color-success-subtle: rgb(20 83 45 / 0.35);\n --panneau-color-success-border: #15803d;\n --panneau-color-warning: #fcd34d;\n --panneau-color-warning-subtle: rgb(113 63 18 / 0.35);\n --panneau-color-warning-border: #a16207;\n --panneau-color-info: #93c5fd;\n --panneau-color-info-subtle: rgb(30 58 138 / 0.35);\n --panneau-color-info-border: #1d4ed8;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);\n\n color-scheme: dark;\n }\n}\n\n/* Touch screens: larger targets, and 16px text in inputs so that iOS doesn't zoom on focus. */\n@media (pointer: coarse) {\n :where(.root) {\n --panneau-control-height: 2.75rem;\n --panneau-control-height-sm: 2.25rem;\n --panneau-font-size-control: 1rem;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :where(.root) {\n --panneau-duration: 0ms;\n }\n}\n\n/* Base stylesheet, scoped to the root, without specificity: components and projects override it. */\n\n.root {\n /* The class is mostly a hook for the rules below, which use :where(). */\n display: block;\n}\n\n:where(.root) {\n font-family: var(--panneau-font-family);\n font-size: var(--panneau-font-size-md);\n line-height: var(--panneau-line-height);\n color: var(--panneau-color-text);\n background-color: var(--panneau-color-bg);\n -webkit-font-smoothing: antialiased;\n -webkit-text-size-adjust: 100%;\n text-size-adjust: 100%;\n}\n\n:where(.root) :where(*, *::before, *::after) {\n box-sizing: border-box;\n}\n\n:where(.root) :where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, fieldset, legend) {\n margin: 0;\n padding: 0;\n}\n\n:where(.root) :where(fieldset) {\n border: 0;\n min-width: 0;\n}\n\n:where(.root) :where(button, input, select, textarea) {\n font: inherit;\n color: inherit;\n}\n\n:where(.root) :where(a) {\n color: var(--panneau-color-link);\n}\n\n:where(.root) :where(img, svg, video) {\n max-width: 100%;\n}\n\n:where(.root) :where(:focus-visible) {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n/* Overlays (dialogs, popovers, menus, tooltips) render here, so that they get the tokens. */\n.portal {\n display: contents;\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"PanneauRoot.module.js","names":[],"sources":["../../src/root/PanneauRoot.module.css"],"sourcesContent":["/*\n * Design tokens of the default theme, and the base stylesheet of Panneau. Everything is scoped to\n * the root element: nothing here applies outside of it (decision 0005).\n *\n * Defaults are wrapped in :where() so that they have no specificity: a theme, or a project's own\n * class on the root, overrides any token without fighting the cascade.\n */\n\n:where(.root) {\n /* Surfaces */\n --panneau-color-bg: #ffffff;\n --panneau-color-surface: #ffffff;\n --panneau-color-surface-sunken: #f4f4f5;\n --panneau-color-surface-raised: #ffffff;\n --panneau-color-hover: rgb(24 24 27 / 0.06);\n --panneau-color-pressed: rgb(24 24 27 / 0.1);\n --panneau-color-backdrop: rgb(9 9 11 / 0.45);\n\n /* Text */\n --panneau-color-text: #18181b;\n --panneau-color-text-muted: #52525b;\n --panneau-color-link: #1d4ed8;\n\n /* Borders: separators, and the outline of controls (3:1 against the surface) */\n --panneau-color-border: #e4e4e7;\n --panneau-color-border-control: #8b8b94;\n\n /* Accent: primary buttons, checked controls, selection */\n --panneau-color-accent: #18181b;\n --panneau-color-accent-hover: #3f3f46;\n --panneau-color-accent-text: #ffffff;\n --panneau-color-accent-subtle: #f4f4f5;\n --panneau-color-focus: #2563eb;\n\n /* Tones: text on surfaces, subtle backgrounds, borders */\n --panneau-color-danger: #b91c1c;\n --panneau-color-danger-subtle: #fef2f2;\n --panneau-color-danger-border: #fca5a5;\n --panneau-color-danger-solid: #b91c1c;\n --panneau-color-danger-solid-hover: #991b1b;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #15803d;\n --panneau-color-success-subtle: #f0fdf4;\n --panneau-color-success-border: #86efac;\n --panneau-color-success-solid: #15803d;\n --panneau-color-success-solid-hover: #166534;\n --panneau-color-success-solid-text: #ffffff;\n --panneau-color-warning: #a16207;\n --panneau-color-warning-subtle: #fefce8;\n --panneau-color-warning-border: #fcd34d;\n --panneau-color-warning-solid: #a16207;\n --panneau-color-warning-solid-hover: #854d0e;\n --panneau-color-warning-solid-text: #ffffff;\n --panneau-color-info: #1d4ed8;\n --panneau-color-info-subtle: #eff6ff;\n --panneau-color-info-border: #93c5fd;\n --panneau-color-info-solid: #1d4ed8;\n --panneau-color-info-solid-hover: #1e40af;\n --panneau-color-info-solid-text: #ffffff;\n\n /*\n * Data visualization: 8 categorical colors in a fixed order, a sequential ramp from low to high,\n * and a diverging pair around a neutral midpoint. Each categorical color reaches 3:1 against\n * the surface, and stays distinct under the common color vision deficiencies (chartColors.test).\n */\n --panneau-chart-categorical-1: #1c6cbb;\n --panneau-chart-categorical-2: #c47713;\n --panneau-chart-categorical-3: #d12f74;\n --panneau-chart-categorical-4: #515922;\n --panneau-chart-categorical-5: #2b9c52;\n --panneau-chart-categorical-6: #a977b3;\n --panneau-chart-categorical-7: #8f2786;\n --panneau-chart-categorical-8: #9176e8;\n --panneau-chart-sequential-1: #dbe8f6;\n --panneau-chart-sequential-2: #a3c6e9;\n --panneau-chart-sequential-3: #5f9bd6;\n --panneau-chart-sequential-4: #2c6cb0;\n --panneau-chart-sequential-5: #1a4475;\n --panneau-chart-diverging-negative: #b4501a;\n --panneau-chart-diverging-neutral: #e4e4e7;\n --panneau-chart-diverging-positive: #1c6cbb;\n\n /* Typography: font roles. Headings and display text follow the body unless a theme sets them. */\n --panneau-font-family-body:\n system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;\n --panneau-font-family-heading: var(--panneau-font-family-body);\n --panneau-font-family-display: var(--panneau-font-family-heading);\n --panneau-font-family-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n /* Deprecated alias of the body family: set --panneau-font-family-body instead. */\n --panneau-font-family: var(--panneau-font-family-body);\n /* Numbers that line up: stats, dates, ids (font-variant-numeric). */\n --panneau-font-numeric: tabular-nums;\n --panneau-font-size-xs: 0.75rem;\n --panneau-font-size-sm: 0.8125rem;\n --panneau-font-size-md: 0.875rem;\n --panneau-font-size-lg: 1rem;\n --panneau-font-size-xl: 1.25rem;\n --panneau-font-size-control: 0.875rem;\n --panneau-line-height: 1.5;\n --panneau-line-height-tight: 1.25;\n --panneau-font-weight-normal: 400;\n --panneau-font-weight-medium: 500;\n --panneau-font-weight-bold: 600;\n\n /* Spacing, on a 4px scale */\n --panneau-space-1: 0.25rem;\n --panneau-space-2: 0.5rem;\n --panneau-space-3: 0.75rem;\n --panneau-space-4: 1rem;\n --panneau-space-5: 1.25rem;\n --panneau-space-6: 1.5rem;\n --panneau-space-8: 2rem;\n --panneau-space-10: 2.5rem;\n\n /* Shapes */\n --panneau-radius-sm: 0.25rem;\n --panneau-radius-md: 0.375rem;\n --panneau-radius-lg: 0.5rem;\n --panneau-radius-full: 9999px;\n --panneau-border-width: 1px;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.08);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.08), 0 16px 40px rgb(0 0 0 / 0.16);\n\n /* Controls and rows: the comfortable density. Other densities redefine these tokens. */\n --panneau-control-height: 2.25rem;\n --panneau-control-height-sm: 1.875rem;\n --panneau-control-padding-x: 0.75rem;\n --panneau-row-padding-y: 0.5rem;\n --panneau-focus-width: 2px;\n\n /* Motion and layers */\n --panneau-duration: 150ms;\n --panneau-z-overlay: 1000;\n --panneau-z-toast: 1100;\n\n color-scheme: light;\n}\n\n/*\n * A ThemeScope with its own color scheme (.scheme) takes the light colors back, since the root\n * around it may be dark. Scopes without one inherit the colors of their parent.\n */\n:where(.scheme[data-color-scheme='light'], .scheme[data-color-scheme='auto']) {\n --panneau-chart-categorical-1: #1c6cbb;\n --panneau-chart-categorical-2: #c47713;\n --panneau-chart-categorical-3: #d12f74;\n --panneau-chart-categorical-4: #515922;\n --panneau-chart-categorical-5: #2b9c52;\n --panneau-chart-categorical-6: #a977b3;\n --panneau-chart-categorical-7: #8f2786;\n --panneau-chart-categorical-8: #9176e8;\n --panneau-chart-sequential-1: #dbe8f6;\n --panneau-chart-sequential-2: #a3c6e9;\n --panneau-chart-sequential-3: #5f9bd6;\n --panneau-chart-sequential-4: #2c6cb0;\n --panneau-chart-sequential-5: #1a4475;\n --panneau-chart-diverging-negative: #b4501a;\n --panneau-chart-diverging-neutral: #e4e4e7;\n --panneau-chart-diverging-positive: #1c6cbb;\n --panneau-color-bg: #ffffff;\n --panneau-color-surface: #ffffff;\n --panneau-color-surface-sunken: #f4f4f5;\n --panneau-color-surface-raised: #ffffff;\n --panneau-color-hover: rgb(24 24 27 / 0.06);\n --panneau-color-pressed: rgb(24 24 27 / 0.1);\n --panneau-color-backdrop: rgb(9 9 11 / 0.45);\n --panneau-color-text: #18181b;\n --panneau-color-text-muted: #52525b;\n --panneau-color-link: #1d4ed8;\n --panneau-color-border: #e4e4e7;\n --panneau-color-border-control: #8b8b94;\n --panneau-color-accent: #18181b;\n --panneau-color-accent-hover: #3f3f46;\n --panneau-color-accent-text: #ffffff;\n --panneau-color-accent-subtle: #f4f4f5;\n --panneau-color-focus: #2563eb;\n --panneau-color-danger: #b91c1c;\n --panneau-color-danger-subtle: #fef2f2;\n --panneau-color-danger-border: #fca5a5;\n --panneau-color-danger-solid: #b91c1c;\n --panneau-color-danger-solid-hover: #991b1b;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #15803d;\n --panneau-color-success-subtle: #f0fdf4;\n --panneau-color-success-border: #86efac;\n --panneau-color-warning: #a16207;\n --panneau-color-warning-subtle: #fefce8;\n --panneau-color-warning-border: #fcd34d;\n --panneau-color-info: #1d4ed8;\n --panneau-color-info-subtle: #eff6ff;\n --panneau-color-info-border: #93c5fd;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.06);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.08), 0 4px 12px rgb(0 0 0 / 0.08);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.08), 0 16px 40px rgb(0 0 0 / 0.16);\n\n color-scheme: light;\n}\n\n:where(.root[data-color-scheme='dark'], .scheme[data-color-scheme='dark']) {\n --panneau-chart-categorical-1: #61a9e3;\n --panneau-chart-categorical-2: #e5c040;\n --panneau-chart-categorical-3: #d9456a;\n --panneau-chart-categorical-4: #a1da9e;\n --panneau-chart-categorical-5: #bb6528;\n --panneau-chart-categorical-6: #a06a9b;\n --panneau-chart-categorical-7: #8c71e2;\n --panneau-chart-categorical-8: #56dfe1;\n --panneau-chart-sequential-1: #1d3550;\n --panneau-chart-sequential-2: #285684;\n --panneau-chart-sequential-3: #3d7fc2;\n --panneau-chart-sequential-4: #74abe0;\n --panneau-chart-sequential-5: #b8d6f2;\n --panneau-chart-diverging-negative: #f0884a;\n --panneau-chart-diverging-neutral: #3f3f46;\n --panneau-chart-diverging-positive: #61a9e3;\n --panneau-color-bg: #09090b;\n --panneau-color-surface: #18181b;\n --panneau-color-surface-sunken: #111113;\n --panneau-color-surface-raised: #232326;\n --panneau-color-hover: rgb(255 255 255 / 0.07);\n --panneau-color-pressed: rgb(255 255 255 / 0.12);\n --panneau-color-backdrop: rgb(0 0 0 / 0.6);\n --panneau-color-text: #fafafa;\n --panneau-color-text-muted: #a1a1aa;\n --panneau-color-link: #93c5fd;\n --panneau-color-border: #2e2e33;\n --panneau-color-border-control: #71717a;\n --panneau-color-accent: #fafafa;\n --panneau-color-accent-hover: #d4d4d8;\n --panneau-color-accent-text: #18181b;\n --panneau-color-accent-subtle: #2e2e33;\n --panneau-color-focus: #60a5fa;\n --panneau-color-danger: #fca5a5;\n --panneau-color-danger-subtle: rgb(127 29 29 / 0.35);\n --panneau-color-danger-border: #b91c1c;\n --panneau-color-danger-solid: #dc2626;\n --panneau-color-danger-solid-hover: #b91c1c;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #86efac;\n --panneau-color-success-subtle: rgb(20 83 45 / 0.35);\n --panneau-color-success-border: #15803d;\n --panneau-color-warning: #fcd34d;\n --panneau-color-warning-subtle: rgb(113 63 18 / 0.35);\n --panneau-color-warning-border: #a16207;\n --panneau-color-info: #93c5fd;\n --panneau-color-info-subtle: rgb(30 58 138 / 0.35);\n --panneau-color-info-border: #1d4ed8;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);\n\n color-scheme: dark;\n}\n\n@media (prefers-color-scheme: dark) {\n :where(.root[data-color-scheme='auto'], .scheme[data-color-scheme='auto']) {\n --panneau-chart-categorical-1: #61a9e3;\n --panneau-chart-categorical-2: #e5c040;\n --panneau-chart-categorical-3: #d9456a;\n --panneau-chart-categorical-4: #a1da9e;\n --panneau-chart-categorical-5: #bb6528;\n --panneau-chart-categorical-6: #a06a9b;\n --panneau-chart-categorical-7: #8c71e2;\n --panneau-chart-categorical-8: #56dfe1;\n --panneau-chart-sequential-1: #1d3550;\n --panneau-chart-sequential-2: #285684;\n --panneau-chart-sequential-3: #3d7fc2;\n --panneau-chart-sequential-4: #74abe0;\n --panneau-chart-sequential-5: #b8d6f2;\n --panneau-chart-diverging-negative: #f0884a;\n --panneau-chart-diverging-neutral: #3f3f46;\n --panneau-chart-diverging-positive: #61a9e3;\n --panneau-color-bg: #09090b;\n --panneau-color-surface: #18181b;\n --panneau-color-surface-sunken: #111113;\n --panneau-color-surface-raised: #232326;\n --panneau-color-hover: rgb(255 255 255 / 0.07);\n --panneau-color-pressed: rgb(255 255 255 / 0.12);\n --panneau-color-backdrop: rgb(0 0 0 / 0.6);\n --panneau-color-text: #fafafa;\n --panneau-color-text-muted: #a1a1aa;\n --panneau-color-link: #93c5fd;\n --panneau-color-border: #2e2e33;\n --panneau-color-border-control: #71717a;\n --panneau-color-accent: #fafafa;\n --panneau-color-accent-hover: #d4d4d8;\n --panneau-color-accent-text: #18181b;\n --panneau-color-accent-subtle: #2e2e33;\n --panneau-color-focus: #60a5fa;\n --panneau-color-danger: #fca5a5;\n --panneau-color-danger-subtle: rgb(127 29 29 / 0.35);\n --panneau-color-danger-border: #b91c1c;\n --panneau-color-danger-solid: #dc2626;\n --panneau-color-danger-solid-hover: #b91c1c;\n --panneau-color-danger-solid-text: #ffffff;\n --panneau-color-success: #86efac;\n --panneau-color-success-subtle: rgb(20 83 45 / 0.35);\n --panneau-color-success-border: #15803d;\n --panneau-color-warning: #fcd34d;\n --panneau-color-warning-subtle: rgb(113 63 18 / 0.35);\n --panneau-color-warning-border: #a16207;\n --panneau-color-info: #93c5fd;\n --panneau-color-info-subtle: rgb(30 58 138 / 0.35);\n --panneau-color-info-border: #1d4ed8;\n --panneau-shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);\n --panneau-shadow-md: 0 1px 3px rgb(0 0 0 / 0.4), 0 4px 12px rgb(0 0 0 / 0.4);\n --panneau-shadow-lg: 0 4px 8px rgb(0 0 0 / 0.4), 0 16px 40px rgb(0 0 0 / 0.5);\n\n color-scheme: dark;\n }\n}\n\n/*\n * Densities: compact, comfortable (the tokens above) and touch, with larger targets and 16px text in\n * inputs so that iOS doesn't zoom on focus. `auto`, the default, is touch on coarse pointers (touch\n * screens) and comfortable otherwise.\n */\n/* A ThemeScope with its own density (.density) takes the comfortable values back. */\n:where(.density[data-density='comfortable'], .density[data-density='auto']) {\n --panneau-control-height: 2.25rem;\n --panneau-control-height-sm: 1.875rem;\n --panneau-font-size-control: 0.875rem;\n --panneau-control-padding-x: 0.75rem;\n --panneau-row-padding-y: 0.5rem;\n}\n\n:where(.root[data-density='compact'], .density[data-density='compact']) {\n --panneau-control-height: 2rem;\n --panneau-control-height-sm: 1.625rem;\n --panneau-font-size-control: 0.8125rem;\n --panneau-control-padding-x: 0.5rem;\n --panneau-row-padding-y: 0.25rem;\n}\n\n:where(.root[data-density='touch'], .density[data-density='touch']) {\n --panneau-control-height: 2.75rem;\n --panneau-control-height-sm: 2.25rem;\n --panneau-font-size-control: 1rem;\n --panneau-control-padding-x: 0.75rem;\n --panneau-row-padding-y: 0.75rem;\n}\n\n@media (pointer: coarse) {\n :where(.root[data-density='auto'], .density[data-density='auto']) {\n --panneau-control-height: 2.75rem;\n --panneau-control-height-sm: 2.25rem;\n --panneau-font-size-control: 1rem;\n --panneau-control-padding-x: 0.75rem;\n --panneau-row-padding-y: 0.75rem;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n :where(.root) {\n --panneau-duration: 0ms;\n }\n}\n\n/* Base stylesheet, scoped to the root, with less weight than any class: components and projects override it. */\n\n.root {\n /* The class is mostly a hook for the rules below, which use :where(). */\n display: block;\n}\n\n/*\n * The root is a size container, so that the responsive props of layout primitives follow its width\n * rather than the viewport's. Like any size container, its width can't come from its content: in a\n * flex row or a float, give it a width. Toast regions share the tokens of .root, not this.\n */\n.container {\n container: panneau-root / inline-size;\n}\n\n:where(.root) {\n font-family: var(--panneau-font-family);\n font-size: var(--panneau-font-size-md);\n line-height: var(--panneau-line-height);\n color: var(--panneau-color-text);\n background-color: var(--panneau-color-bg);\n -webkit-font-smoothing: antialiased;\n -webkit-text-size-adjust: 100%;\n text-size-adjust: 100%;\n}\n\n:where(.root) :where(*, *::before, *::after) {\n box-sizing: border-box;\n}\n\n/*\n * Element resets weigh two element selectors, (0,0,2), by repeating :is(): more than the global\n * element rules of a site, such as Bootstrap's Reboot (`h5 { margin-bottom: 0.5rem }` weighs\n * (0,0,1)), less than any class, so that components and projects still override them.\n */\n:where(.root)\n :is(\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n p,\n ul,\n ol,\n dl,\n dd,\n figure,\n blockquote,\n pre,\n hr,\n fieldset,\n legend\n ):is(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre, hr, fieldset, legend) {\n margin: 0;\n padding: 0;\n}\n\n/* Reboot floats legends and scales their text. */\n:where(.root) :is(legend):is(legend) {\n float: none;\n width: auto;\n font-size: inherit;\n line-height: inherit;\n}\n\n/* Reboot fades rules to 25% opacity. */\n:where(.root) :is(hr):is(hr) {\n opacity: 1;\n}\n\n:where(.root) :where(fieldset) {\n border: 0;\n min-width: 0;\n}\n\n:where(.root) :where(button, input, select, textarea) {\n font: inherit;\n color: inherit;\n}\n\n:where(.root) :is(a):is(a) {\n color: var(--panneau-color-link);\n}\n\n:where(.root) :where(img, svg, video) {\n max-width: 100%;\n}\n\n:where(.root) :where(:focus-visible) {\n outline: var(--panneau-focus-width) solid var(--panneau-color-focus);\n outline-offset: 2px;\n}\n\n/*\n * A ThemeScope applies the text styles of its tokens again, since inherited values were computed\n * on the root. One with its own color scheme or theme paints its background too.\n */\n:where(.scope) {\n font-family: var(--panneau-font-family);\n font-size: var(--panneau-font-size-md);\n line-height: var(--panneau-line-height);\n color: var(--panneau-color-text);\n}\n\n:where(.scope.scheme, .scope[data-panneau-theme]) {\n background-color: var(--panneau-color-bg);\n}\n\n/* Overlays (dialogs, popovers, menus, tooltips) render here, so that they get the tokens. */\n.portal {\n display: contents;\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type HTMLAttributes, type ReactNode } from 'react';
|
|
2
|
+
import type { ColorScheme, Density, Theme } from '../theme/theme.js';
|
|
3
|
+
export interface ThemeScopeProps extends HTMLAttributes<HTMLElement> {
|
|
4
|
+
/** Element to render. Defaults to `div`. */
|
|
5
|
+
as?: 'div' | 'section' | 'aside' | 'nav' | 'header' | 'footer' | 'main' | 'article';
|
|
6
|
+
/** A theme for the subtree, over the theme of the root. */
|
|
7
|
+
theme?: Theme | null;
|
|
8
|
+
/** A color scheme for the subtree. Inherited by default. */
|
|
9
|
+
colorScheme?: ColorScheme;
|
|
10
|
+
/** A density for the subtree. Inherited by default. */
|
|
11
|
+
density?: Density;
|
|
12
|
+
children?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Applies a theme, a color scheme or a density to a subtree, like `data-bs-theme` on any element:
|
|
16
|
+
* a dark sidebar in a light app, a compact table, a preview in another brand's colors. Overlays
|
|
17
|
+
* opened inside it render in its own container, so that they keep its tokens. It must be inside a
|
|
18
|
+
* `PanneauRoot`.
|
|
19
|
+
*
|
|
20
|
+
* What it doesn't set comes from its parent: a scope with only a density keeps the colors of the
|
|
21
|
+
* theme around it.
|
|
22
|
+
*/
|
|
23
|
+
export declare function ThemeScope({ as: Element, theme, colorScheme, density, className, children, ...props }: ThemeScopeProps): import("react").JSX.Element;
|
|
24
|
+
//# sourceMappingURL=ThemeScope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThemeScope.d.ts","sourceRoot":"","sources":["../../src/root/ThemeScope.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAiB,MAAM,OAAO,CAAC;AAE3E,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAKlE,MAAM,WAAW,eAAgB,SAAQ,cAAc,CAAC,WAAW,CAAC;IAChE,4CAA4C;IAC5C,EAAE,CAAC,EAAE,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;IACpF,2DAA2D;IAC3D,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACrB,4DAA4D;IAC5D,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,uDAAuD;IACvD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,EACvB,EAAE,EAAE,OAAe,EACnB,KAAY,EACZ,WAAW,EACX,OAAO,EACP,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACX,EAAE,eAAe,+BAgCjB"}
|