@panneau/ui 5.0.0-alpha.2 → 5.0.0-alpha.20
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 +144 -15
- 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/badge/Badge.d.ts +1 -1
- package/dist/badge/Badge.js +34 -6
- package/dist/badge/Badge.js.map +1 -1
- package/dist/badge/tokens.d.ts +1 -1
- package/dist/badge/tokens.js.map +1 -1
- package/dist/button/Button.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/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.js.map +1 -1
- package/dist/card/Card.js +76 -23
- package/dist/card/Card.js.map +1 -1
- package/dist/card/tokens.d.ts +1 -1
- package/dist/card/tokens.js.map +1 -1
- package/dist/checkbox/Checkbox.css +9 -9
- package/dist/checkbox/Checkbox.d.ts +1 -1
- package/dist/checkbox/Checkbox.js +87 -26
- package/dist/checkbox/Checkbox.js.map +1 -1
- package/dist/checkbox/Checkbox.module.js +3 -3
- 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.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 +40 -0
- package/dist/date-picker/DatePicker.d.ts +3 -2
- package/dist/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/date-picker/DatePicker.js +279 -72
- package/dist/date-picker/DatePicker.js.map +1 -1
- package/dist/date-picker/DatePicker.module.js +5 -1
- package/dist/date-picker/DatePicker.module.js.map +1 -1
- package/dist/date-picker/calendarTokens.d.ts +1 -1
- package/dist/date-picker/calendarTokens.js.map +1 -1
- package/dist/date-range-picker/DateRangePicker.css +37 -0
- package/dist/date-range-picker/DateRangePicker.d.ts +41 -0
- package/dist/date-range-picker/DateRangePicker.d.ts.map +1 -0
- package/dist/date-range-picker/DateRangePicker.js +438 -0
- package/dist/date-range-picker/DateRangePicker.js.map +1 -0
- package/dist/date-range-picker/DateRangePicker.module.js +20 -0
- package/dist/date-range-picker/DateRangePicker.module.js.map +1 -0
- package/dist/dialog/Dialog.css +41 -2
- package/dist/dialog/Dialog.d.ts +15 -3
- package/dist/dialog/Dialog.d.ts.map +1 -1
- package/dist/dialog/Dialog.js +161 -32
- package/dist/dialog/Dialog.js.map +1 -1
- package/dist/dialog/Dialog.module.js +10 -2
- package/dist/dialog/Dialog.module.js.map +1 -1
- package/dist/dialog/tokens.d.ts +1 -1
- package/dist/dialog/tokens.d.ts.map +1 -1
- package/dist/dialog/tokens.js +2 -0
- package/dist/dialog/tokens.js.map +1 -1
- package/dist/disclosure/Disclosure.js +132 -28
- package/dist/disclosure/Disclosure.js.map +1 -1
- package/dist/disclosure/tokens.d.ts +1 -1
- package/dist/disclosure/tokens.js.map +1 -1
- package/dist/divider/Divider.js +55 -11
- package/dist/divider/Divider.js.map +1 -1
- package/dist/divider/tokens.d.ts +1 -1
- package/dist/divider/tokens.js.map +1 -1
- package/dist/field/Field.css +26 -0
- 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.js.map +1 -1
- package/dist/field/tokens.d.ts +1 -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.js +36 -11
- package/dist/icon/Icon.js.map +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 +16 -9
- package/dist/icon/namedIcons.d.ts.map +1 -1
- package/dist/icon/namedIcons.js +121 -46
- package/dist/icon/namedIcons.js.map +1 -1
- 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 +65 -52
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +19 -6
- package/dist/inline/Inline.d.ts +1 -1
- package/dist/inline/Inline.js +65 -7
- package/dist/inline/Inline.js.map +1 -1
- package/dist/inline/tokens.d.ts +1 -1
- package/dist/inline/tokens.js.map +1 -1
- package/dist/intl/usePanneauIntl.js.map +1 -1
- package/dist/layout/responsive.js.map +1 -1
- package/dist/line-chart/LineChart.css +84 -0
- package/dist/line-chart/LineChart.d.ts +26 -0
- package/dist/line-chart/LineChart.d.ts.map +1 -0
- package/dist/line-chart/LineChart.js +327 -0
- package/dist/line-chart/LineChart.js.map +1 -0
- package/dist/line-chart/LineChart.module.js +28 -0
- package/dist/line-chart/LineChart.module.js.map +1 -0
- package/dist/line-chart/tokens.d.ts +3 -0
- package/dist/line-chart/tokens.d.ts.map +1 -0
- package/dist/line-chart/tokens.js +19 -0
- package/dist/line-chart/tokens.js.map +1 -0
- package/dist/locales/index.js.map +1 -1
- package/dist/menu/Menu.css +84 -0
- package/dist/menu/Menu.d.ts +34 -7
- package/dist/menu/Menu.d.ts.map +1 -1
- package/dist/menu/Menu.js +243 -32
- package/dist/menu/Menu.js.map +1 -1
- package/dist/menu/Menu.module.js +22 -0
- package/dist/menu/Menu.module.js.map +1 -0
- package/dist/menu/tokens.d.ts +3 -0
- package/dist/menu/tokens.d.ts.map +1 -0
- package/dist/menu/tokens.js +31 -0
- package/dist/menu/tokens.js.map +1 -0
- package/dist/named-icons/index.d.ts +2 -0
- package/dist/named-icons/index.d.ts.map +1 -0
- package/dist/named-icons/index.js +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/CalendarDate.js +136 -0
- package/dist/node_modules/@internationalized/date/dist/private/CalendarDate.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js +117 -0
- package/dist/node_modules/@internationalized/date/dist/private/calendars/GregorianCalendar.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/conversion.js +116 -0
- package/dist/node_modules/@internationalized/date/dist/private/conversion.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/manipulation.js +206 -0
- package/dist/node_modules/@internationalized/date/dist/private/manipulation.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/queries.js +26 -0
- package/dist/node_modules/@internationalized/date/dist/private/queries.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/string.js +19 -0
- package/dist/node_modules/@internationalized/date/dist/private/string.js.map +1 -0
- package/dist/node_modules/@internationalized/date/dist/private/utils.js +8 -0
- package/dist/node_modules/@internationalized/date/dist/private/utils.js.map +1 -0
- package/dist/number-input/NumberInput.css +18 -0
- package/dist/number-input/NumberInput.d.ts +1 -1
- package/dist/number-input/NumberInput.js +232 -60
- package/dist/number-input/NumberInput.js.map +1 -1
- package/dist/number-input/NumberInput.module.js +3 -1
- package/dist/number-input/NumberInput.module.js.map +1 -1
- package/dist/number-input/tokens.d.ts +1 -1
- package/dist/number-input/tokens.js.map +1 -1
- package/dist/pill-trigger/PillTrigger.css +104 -0
- package/dist/pill-trigger/PillTrigger.d.ts +20 -0
- package/dist/pill-trigger/PillTrigger.d.ts.map +1 -0
- package/dist/pill-trigger/PillTrigger.js +94 -0
- package/dist/pill-trigger/PillTrigger.js.map +1 -0
- package/dist/pill-trigger/PillTrigger.module.js +18 -0
- package/dist/pill-trigger/PillTrigger.module.js.map +1 -0
- package/dist/pill-trigger/tokens.d.ts +3 -0
- package/dist/pill-trigger/tokens.d.ts.map +1 -0
- package/dist/pill-trigger/tokens.js +37 -0
- package/dist/pill-trigger/tokens.js.map +1 -0
- package/dist/popover/Popover.css +5 -0
- package/dist/popover/Popover.d.ts.map +1 -1
- package/dist/popover/Popover.js +116 -20
- package/dist/popover/Popover.js.map +1 -1
- package/dist/popover/Popover.module.js +4 -2
- package/dist/popover/Popover.module.js.map +1 -1
- package/dist/popover/tokens.d.ts +1 -1
- package/dist/popover/tokens.js.map +1 -1
- package/dist/prose/Prose.js +36 -5
- package/dist/prose/Prose.js.map +1 -1
- package/dist/prose/tokens.d.ts +1 -1
- package/dist/prose/tokens.js.map +1 -1
- package/dist/radio-group/RadioGroup.css +90 -0
- package/dist/radio-group/RadioGroup.d.ts +24 -5
- package/dist/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/radio-group/RadioGroup.js +214 -43
- package/dist/radio-group/RadioGroup.js.map +1 -1
- package/dist/radio-group/RadioGroup.module.js +12 -2
- package/dist/radio-group/RadioGroup.module.js.map +1 -1
- package/dist/radio-group/tokens.d.ts +2 -2
- package/dist/radio-group/tokens.d.ts.map +1 -1
- package/dist/radio-group/tokens.js +22 -2
- package/dist/radio-group/tokens.js.map +1 -1
- package/dist/root/PanneauRoot.css +24 -0
- package/dist/root/PanneauRoot.d.ts +40 -4
- package/dist/root/PanneauRoot.d.ts.map +1 -1
- package/dist/root/PanneauRoot.js +284 -82
- 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 +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 +75 -1
- package/dist/select/ListBox.module.js +9 -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 +335 -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 +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.js +49 -9
- package/dist/spinner/Spinner.js.map +1 -1
- package/dist/spinner/tokens.d.ts +1 -1
- package/dist/spinner/tokens.js.map +1 -1
- package/dist/stack/Stack.d.ts +1 -1
- package/dist/stack/Stack.js +60 -7
- package/dist/stack/Stack.js.map +1 -1
- package/dist/stack/tokens.d.ts +1 -1
- package/dist/stack/tokens.js.map +1 -1
- package/dist/stat/Stat.css +45 -0
- package/dist/stat/Stat.d.ts +27 -0
- package/dist/stat/Stat.d.ts.map +1 -0
- package/dist/stat/Stat.js +87 -0
- package/dist/stat/Stat.js.map +1 -0
- package/dist/stat/Stat.module.js +18 -0
- package/dist/stat/Stat.module.js.map +1 -0
- package/dist/stat/tokens.d.ts +3 -0
- package/dist/stat/tokens.d.ts.map +1 -0
- package/dist/stat/tokens.js +21 -0
- package/dist/stat/tokens.js.map +1 -0
- package/dist/switch/Switch.css +8 -8
- package/dist/switch/Switch.d.ts +1 -1
- package/dist/switch/Switch.js +69 -12
- package/dist/switch/Switch.js.map +1 -1
- package/dist/switch/Switch.module.js +3 -2
- package/dist/switch/Switch.module.js.map +1 -1
- package/dist/switch/tokens.d.ts +1 -1
- package/dist/switch/tokens.js.map +1 -1
- package/dist/tabs/Tabs.js +1 -1
- package/dist/tabs/Tabs.js.map +1 -1
- package/dist/tabs/tokens.d.ts +1 -1
- package/dist/tabs/tokens.js.map +1 -1
- 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.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.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 +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 +2 -2
- package/dist/theme/checkTheme.d.ts.map +1 -1
- package/dist/theme/checkTheme.js +24 -0
- 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.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 +10 -3
- package/dist/theme/components.d.ts.map +1 -1
- package/dist/theme/components.js +14 -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/semanticTokens.d.ts +1 -1
- package/dist/theme/semanticTokens.d.ts.map +1 -1
- package/dist/theme/semanticTokens.js +6 -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 +131 -15
- package/dist/toast/Toast.d.ts +47 -10
- package/dist/toast/Toast.d.ts.map +1 -1
- package/dist/toast/Toast.js +191 -66
- package/dist/toast/Toast.js.map +1 -1
- package/dist/toast/Toast.module.js +5 -3
- package/dist/toast/Toast.module.js.map +1 -1
- package/dist/toast/tokens.d.ts +1 -1
- package/dist/toast/tokens.js +1 -1
- package/dist/toast/tokens.js.map +1 -1
- package/dist/tooltip/Tooltip.js +38 -8
- package/dist/tooltip/Tooltip.js.map +1 -1
- package/dist/tooltip/tokens.d.ts +1 -1
- package/dist/tooltip/tokens.js.map +1 -1
- package/dist/utils/cx.js.map +1 -1
- package/dist/utils/events.d.ts +4 -0
- package/dist/utils/events.d.ts.map +1 -0
- package/dist/utils/events.js +9 -0
- package/dist/utils/events.js.map +1 -0
- package/package.json +10 -5
package/dist/inline/Inline.js
CHANGED
|
@@ -1,19 +1,77 @@
|
|
|
1
1
|
import { cx } from "../utils/cx.js";
|
|
2
2
|
import { justification, responsiveVariables, space, withVariables } from "../layout/responsive.js";
|
|
3
3
|
import Inline_module_default from "./Inline.module.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
//#region src/inline/Inline.tsx
|
|
6
7
|
/** Items side by side, wrapping when they don't fit, like Bootstrap's `.hstack`. */
|
|
7
|
-
function Inline(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
function Inline(t0) {
|
|
9
|
+
const $ = c(22);
|
|
10
|
+
let align;
|
|
11
|
+
let className;
|
|
12
|
+
let gap;
|
|
13
|
+
let justify;
|
|
14
|
+
let props;
|
|
15
|
+
let style;
|
|
16
|
+
let t1;
|
|
17
|
+
let t2;
|
|
18
|
+
if ($[0] !== t0) {
|
|
19
|
+
({as: t1, gap, align, justify, wrap: t2, className, style, ...props} = t0);
|
|
20
|
+
$[0] = t0;
|
|
21
|
+
$[1] = align;
|
|
22
|
+
$[2] = className;
|
|
23
|
+
$[3] = gap;
|
|
24
|
+
$[4] = justify;
|
|
25
|
+
$[5] = props;
|
|
26
|
+
$[6] = style;
|
|
27
|
+
$[7] = t1;
|
|
28
|
+
$[8] = t2;
|
|
29
|
+
} else {
|
|
30
|
+
align = $[1];
|
|
31
|
+
className = $[2];
|
|
32
|
+
gap = $[3];
|
|
33
|
+
justify = $[4];
|
|
34
|
+
props = $[5];
|
|
35
|
+
style = $[6];
|
|
36
|
+
t1 = $[7];
|
|
37
|
+
t2 = $[8];
|
|
38
|
+
}
|
|
39
|
+
const Element = t1 === void 0 ? "div" : t1;
|
|
40
|
+
const t3 = !(t2 === void 0 ? true : t2) && Inline_module_default.nowrap;
|
|
41
|
+
let t4;
|
|
42
|
+
if ($[9] !== className || $[10] !== t3) {
|
|
43
|
+
t4 = cx("panneau-inline", Inline_module_default.inline, t3, className);
|
|
44
|
+
$[9] = className;
|
|
45
|
+
$[10] = t3;
|
|
46
|
+
$[11] = t4;
|
|
47
|
+
} else t4 = $[11];
|
|
48
|
+
let t5;
|
|
49
|
+
if ($[12] !== align || $[13] !== gap || $[14] !== justify || $[15] !== style) {
|
|
50
|
+
t5 = withVariables([
|
|
12
51
|
responsiveVariables("inline", "gap", gap, space),
|
|
13
52
|
responsiveVariables("inline", "align", align, String),
|
|
14
53
|
responsiveVariables("inline", "justify", justify, justification)
|
|
15
|
-
], style)
|
|
16
|
-
|
|
54
|
+
], style);
|
|
55
|
+
$[12] = align;
|
|
56
|
+
$[13] = gap;
|
|
57
|
+
$[14] = justify;
|
|
58
|
+
$[15] = style;
|
|
59
|
+
$[16] = t5;
|
|
60
|
+
} else t5 = $[16];
|
|
61
|
+
let t6;
|
|
62
|
+
if ($[17] !== Element || $[18] !== props || $[19] !== t4 || $[20] !== t5) {
|
|
63
|
+
t6 = /* @__PURE__ */ jsx(Element, {
|
|
64
|
+
...props,
|
|
65
|
+
className: t4,
|
|
66
|
+
style: t5
|
|
67
|
+
});
|
|
68
|
+
$[17] = Element;
|
|
69
|
+
$[18] = props;
|
|
70
|
+
$[19] = t4;
|
|
71
|
+
$[20] = t5;
|
|
72
|
+
$[21] = t6;
|
|
73
|
+
} else t6 = $[21];
|
|
74
|
+
return t6;
|
|
17
75
|
}
|
|
18
76
|
//#endregion
|
|
19
77
|
export { Inline };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Inline.js","names":["styles"],"sources":["../../src/inline/Inline.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport {\n type Justification,\n type Responsive,\n type Space,\n justification,\n responsiveVariables,\n space,\n withVariables,\n} from '../layout/responsive';\nimport { cx } from '../utils/cx';\nimport styles from './Inline.module.css';\n\nexport interface InlineProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'header' | 'footer' | 'nav' | 'ul' | 'ol' | 'span';\n /** Space between items, from the space scale. Defaults to the `--panneau-inline-gap` token. */\n gap?: Responsive<Space>;\n /** Vertical alignment of the items. Defaults to `center`. */\n align?: Responsive<'start' | 'center' | 'end' | 'stretch' | 'baseline'>;\n /** Horizontal distribution of the items. Defaults to `start`. */\n justify?: Responsive<Justification>;\n /** Items wrap to the next line when they don't fit. Defaults to `true`. */\n wrap?: boolean;\n}\n\n/** Items side by side, wrapping when they don't fit, like Bootstrap's `.hstack`. */\nexport function Inline({\n as: Element = 'div',\n gap,\n align,\n justify,\n wrap = true,\n className,\n style,\n ...props\n}: InlineProps) {\n return (\n <Element\n {...props}\n className={cx('panneau-inline', styles.inline, !wrap && styles.nowrap, className)}\n style={withVariables(\n [\n responsiveVariables('inline', 'gap', gap, space),\n responsiveVariables('inline', 'align', align, String),\n responsiveVariables('inline', 'justify', justify, justification),\n ],\n style,\n )}\n />\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"Inline.js","names":["HTMLAttributes","Justification","Responsive","Space","justification","responsiveVariables","space","withVariables","cx","styles","InlineProps","HTMLElement","as","gap","align","justify","wrap","Inline","t0","$","_c","className","props","style","t1","t2","Element","undefined","t3","nowrap","t4","inline","t5","String","t6","_c","styles"],"sources":["../../src/inline/Inline.tsx"],"sourcesContent":["import type { HTMLAttributes } from 'react';\n\nimport {\n type Justification,\n type Responsive,\n type Space,\n justification,\n responsiveVariables,\n space,\n withVariables,\n} from '../layout/responsive';\nimport { cx } from '../utils/cx';\nimport styles from './Inline.module.css';\n\nexport interface InlineProps extends HTMLAttributes<HTMLElement> {\n /** Element to render. Defaults to `div`. */\n as?: 'div' | 'section' | 'header' | 'footer' | 'nav' | 'ul' | 'ol' | 'span';\n /** Space between items, from the space scale. Defaults to the `--panneau-inline-gap` token. */\n gap?: Responsive<Space>;\n /** Vertical alignment of the items. Defaults to `center`. */\n align?: Responsive<'start' | 'center' | 'end' | 'stretch' | 'baseline'>;\n /** Horizontal distribution of the items. Defaults to `start`. */\n justify?: Responsive<Justification>;\n /** Items wrap to the next line when they don't fit. Defaults to `true`. */\n wrap?: boolean;\n}\n\n/** Items side by side, wrapping when they don't fit, like Bootstrap's `.hstack`. */\nexport function Inline({\n as: Element = 'div',\n gap,\n align,\n justify,\n wrap = true,\n className,\n style,\n ...props\n}: InlineProps) {\n return (\n <Element\n {...props}\n className={cx('panneau-inline', styles.inline, !wrap && styles.nowrap, className)}\n style={withVariables(\n [\n responsiveVariables('inline', 'gap', gap, space),\n responsiveVariables('inline', 'align', align, String),\n responsiveVariables('inline', 'justify', justify, justification),\n ],\n style,\n )}\n />\n );\n}\n"],"mappings":";;;;;;;AA4BA,SAAOiB,OAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAA,IAAAN;CAAA,IAAAO;CAAA,IAAAR;CA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AAA,MAAAJ;EAAAI,EAAA,MAAAI;EAAAJ,EAAA,MAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAO,WAAAP,EAAA,QAAAG,SAAAH,EAAA,QAAAW,MAAAX,EAAA,QAAAa,IAAA;EAVLE,KAAA,oBAAC,SAAD;GAAQ,GACAZ;GACO,WAAAQ;GACJ,OAAAE;EAON,CAAA;EACHb,EAAA,MAAAO;EAAAP,EAAA,MAAAG;EAAAH,EAAA,MAAAW;EAAAX,EAAA,MAAAa;EAAAb,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,OAXFe;AAWE"}
|
package/dist/inline/tokens.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","names":[],"sources":["../../src/inline/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Inline. */\nexport const inlineTokens = defineComponentTokens('inline', {\n /** Space between items, in both directions, when the `gap` prop is not set. */\n gap: 'var(--panneau-space-2)',\n});\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"tokens.js","names":["defineComponentTokens","inlineTokens","gap"],"sources":["../../src/inline/tokens.ts"],"sourcesContent":["import { defineComponentTokens } from '../theme/componentTokens';\n\n/** Tokens of Inline. */\nexport const inlineTokens = defineComponentTokens('inline', {\n /** Space between items, in both directions, when the `gap` prop is not set. */\n gap: 'var(--panneau-space-2)',\n});\n"],"mappings":";;;AAGA,IAAaC,eAAeD,sBAAsB,UAAU;;AAExDE,KAAK,yBACT,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePanneauIntl.js","names":[],"sources":["../../src/intl/usePanneauIntl.ts"],"sourcesContent":["import { use } from 'react';\nimport { IntlContext, type IntlShape, createIntl, createIntlCache } from 'react-intl';\n\nlet fallback: IntlShape | null = null;\n\n/**\n * The react-intl object of the closest `IntlProvider`. Without a provider, an English one with the\n * default messages, so that Panneau components also render outside of an internationalized app.\n */\nexport function usePanneauIntl(): IntlShape {\n const intl = use(IntlContext) as IntlShape | null | undefined;\n if (intl !== null && intl !== undefined) {\n return intl;\n }\n fallback ??= createIntl({ locale: 'en', defaultLocale: 'en', messages: {} }, createIntlCache());\n return fallback;\n}\n"],"mappings":";;;AAGA,
|
|
1
|
+
{"version":3,"file":"usePanneauIntl.js","names":["use","IntlContext","IntlShape","createIntl","createIntlCache","fallback","usePanneauIntl","intl","undefined","locale","defaultLocale","messages"],"sources":["../../src/intl/usePanneauIntl.ts"],"sourcesContent":["import { use } from 'react';\nimport { IntlContext, type IntlShape, createIntl, createIntlCache } from 'react-intl';\n\nlet fallback: IntlShape | null = null;\n\n/**\n * The react-intl object of the closest `IntlProvider`. Without a provider, an English one with the\n * default messages, so that Panneau components also render outside of an internationalized app.\n */\nexport function usePanneauIntl(): IntlShape {\n const intl = use(IntlContext) as IntlShape | null | undefined;\n if (intl !== null && intl !== undefined) {\n return intl;\n }\n fallback ??= createIntl({ locale: 'en', defaultLocale: 'en', messages: {} }, createIntlCache());\n return fallback;\n}\n"],"mappings":";;;AAGA,IAAIK,WAA6B;;;;;AAMjC,SAAgBC,iBAA4B;CACxC,MAAMC,OAAOP,IAAIC,WAAW;CAC5B,IAAIM,SAAS,QAAQA,SAASC,KAAAA,GAC1B,OAAOD;CAEXF,aAAaF,WAAW;EAAEM,QAAQ;EAAMC,eAAe;EAAMC,UAAU,CAAC;CAAE,GAAGP,gBAAgB,CAAC;CAC9F,OAAOC;AACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responsive.js","names":[],"sources":["../../src/layout/responsive.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\n/**\n * Breakpoints of the layout primitives, like Bootstrap's `$grid-breakpoints`: the minimum width of\n * the nearest container at which a responsive value applies. They are constants, since CSS\n * variables can't be used in queries; the stylesheets of the primitives use the same values.\n */\nexport const BREAKPOINTS = Object.freeze({\n sm: '40rem',\n md: '48rem',\n lg: '64rem',\n xl: '80rem',\n});\n\n/** A breakpoint: `sm`, `md`, `lg` or `xl`. */\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * A value, or values by breakpoint: `{ base: 1, md: 2, lg: 3 }`. Each value applies from its\n * breakpoint up, until a larger one sets another. Breakpoints are widths of the nearest container\n * (`PanneauRoot`, `Container`, a form, a list), not of the viewport, so that a grid in a narrow\n * sidebar behaves as on a phone.\n */\nexport type Responsive<T> = T | Partial<Record<'base' | Breakpoint, T>>;\n\n/** A step of the space scale of the theme (`--panneau-space-<step>`), or 0. */\nexport type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10;\n\n/** The CSS value of a step of the space scale. */\nexport function space(step: Space): string {\n return step === 0 ? '0' : `var(--panneau-space-${step})`;\n}\n\nconst KEYS = ['base', ...(Object.keys(BREAKPOINTS) as Breakpoint[])] as const;\n\nfunction isByBreakpoint<T>(value: Responsive<T>): value is Partial<Record<'base' | Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * The inline variables of a responsive prop, `--_panneau-<component>-<prop>-<breakpoint>`, which\n * the static rules of the component read in each container query. Unset breakpoints fall back to\n * smaller ones in CSS.\n */\nexport function responsiveVariables<T>(\n component: string,\n prop: string,\n value: Responsive<T> | undefined,\n toCss: (value: T) => string,\n): Record<string, string> {\n if (value === undefined) {\n return {};\n }\n const values: Partial<Record<'base' | Breakpoint, T>> = isByBreakpoint(value)\n ? value\n : { base: value };\n return Object.fromEntries(\n KEYS.flatMap((key) => {\n const item = values[key];\n return item !== undefined\n ? [[`--_panneau-${component}-${prop}-${key}`, toCss(item)]]\n : [];\n }),\n );\n}\n\n/** Merges inline variables with the `style` prop, which wins. */\nexport function withVariables(\n variables: Record<string, string>[],\n style: CSSProperties | undefined,\n): CSSProperties | undefined {\n const merged = Object.assign({}, ...variables) as Record<string, string>;\n return Object.keys(merged).length > 0 ? { ...merged, ...style } : style;\n}\n\n/** How the primitives distribute items along their axis: `between` is `space-between`. */\nexport type Justification = 'start' | 'center' | 'end' | 'between';\n\n/** The CSS value of a justification. */\nexport function justification(value: Justification): string {\n return value === 'between' ? 'space-between' : value;\n}\n"],"mappings":";;;;;;AAOA,
|
|
1
|
+
{"version":3,"file":"responsive.js","names":["CSSProperties","BREAKPOINTS","Object","freeze","sm","md","lg","xl","Breakpoint","Responsive","T","Partial","Record","Space","space","step","KEYS","keys","const","isByBreakpoint","value","responsiveVariables","component","prop","toCss","undefined","values","base","fromEntries","flatMap","key","item","withVariables","variables","style","merged","assign","length","Justification","justification"],"sources":["../../src/layout/responsive.ts"],"sourcesContent":["import type { CSSProperties } from 'react';\n\n/**\n * Breakpoints of the layout primitives, like Bootstrap's `$grid-breakpoints`: the minimum width of\n * the nearest container at which a responsive value applies. They are constants, since CSS\n * variables can't be used in queries; the stylesheets of the primitives use the same values.\n */\nexport const BREAKPOINTS = Object.freeze({\n sm: '40rem',\n md: '48rem',\n lg: '64rem',\n xl: '80rem',\n});\n\n/** A breakpoint: `sm`, `md`, `lg` or `xl`. */\nexport type Breakpoint = keyof typeof BREAKPOINTS;\n\n/**\n * A value, or values by breakpoint: `{ base: 1, md: 2, lg: 3 }`. Each value applies from its\n * breakpoint up, until a larger one sets another. Breakpoints are widths of the nearest container\n * (`PanneauRoot`, `Container`, a form, a list), not of the viewport, so that a grid in a narrow\n * sidebar behaves as on a phone.\n */\nexport type Responsive<T> = T | Partial<Record<'base' | Breakpoint, T>>;\n\n/** A step of the space scale of the theme (`--panneau-space-<step>`), or 0. */\nexport type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10;\n\n/** The CSS value of a step of the space scale. */\nexport function space(step: Space): string {\n return step === 0 ? '0' : `var(--panneau-space-${step})`;\n}\n\nconst KEYS = ['base', ...(Object.keys(BREAKPOINTS) as Breakpoint[])] as const;\n\nfunction isByBreakpoint<T>(value: Responsive<T>): value is Partial<Record<'base' | Breakpoint, T>> {\n return typeof value === 'object' && value !== null;\n}\n\n/**\n * The inline variables of a responsive prop, `--_panneau-<component>-<prop>-<breakpoint>`, which\n * the static rules of the component read in each container query. Unset breakpoints fall back to\n * smaller ones in CSS.\n */\nexport function responsiveVariables<T>(\n component: string,\n prop: string,\n value: Responsive<T> | undefined,\n toCss: (value: T) => string,\n): Record<string, string> {\n if (value === undefined) {\n return {};\n }\n const values: Partial<Record<'base' | Breakpoint, T>> = isByBreakpoint(value)\n ? value\n : { base: value };\n return Object.fromEntries(\n KEYS.flatMap((key) => {\n const item = values[key];\n return item !== undefined\n ? [[`--_panneau-${component}-${prop}-${key}`, toCss(item)]]\n : [];\n }),\n );\n}\n\n/** Merges inline variables with the `style` prop, which wins. */\nexport function withVariables(\n variables: Record<string, string>[],\n style: CSSProperties | undefined,\n): CSSProperties | undefined {\n const merged = Object.assign({}, ...variables) as Record<string, string>;\n return Object.keys(merged).length > 0 ? { ...merged, ...style } : style;\n}\n\n/** How the primitives distribute items along their axis: `between` is `space-between`. */\nexport type Justification = 'start' | 'center' | 'end' | 'between';\n\n/** The CSS value of a justification. */\nexport function justification(value: Justification): string {\n return value === 'between' ? 'space-between' : value;\n}\n"],"mappings":";;;;;;AAOA,IAAaC,cAAcC,OAAOC,OAAO;CACrCC,IAAI;CACJC,IAAI;CACJC,IAAI;CACJC,IAAI;AACR,CAAC;;AAiBD,SAAgBO,MAAMC,MAAqB;CACvC,OAAOA,SAAS,IAAI,MAAM,uBAAuBA,KAAI;AACzD;AAEA,IAAMC,OAAO,CAAC,QAAQ,GAAId,OAAOe,KAAKhB,WAAW,CAAkB;AAEnE,SAASkB,eAAkBC,OAAwE;CAC/F,OAAO,OAAOA,UAAU,YAAYA,UAAU;AAClD;;;;;;AAOA,SAAgBC,oBACZC,WACAC,MACAH,OACAI,OACsB;CACtB,IAAIJ,UAAUK,KAAAA,GACV,OAAO,CAAC;CAEZ,MAAMC,SAAkDP,eAAeC,KAAK,IACtEA,QACA,EAAEO,MAAMP,MAAM;CACpB,OAAOlB,OAAO0B,YACVZ,KAAKa,SAASC,QAAQ;EAClB,MAAMC,OAAOL,OAAOI;EACpB,OAAOC,SAASN,KAAAA,IACV,CAAC,CAAC,cAAcH,UAAS,GAAIC,KAAI,GAAIO,OAAON,MAAMO,IAAI,CAAC,CAAC,IACxD,CAAA;CACV,CAAC,CACL;AACJ;;AAGA,SAAgBC,cACZC,WACAC,OACyB;CACzB,MAAMC,SAASjC,OAAOkC,OAAO,CAAC,GAAG,GAAGH,SAAS;CAC7C,OAAO/B,OAAOe,KAAKkB,MAAM,CAAC,CAACE,SAAS,IAAI;EAAE,GAAGF;EAAQ,GAAGD;CAAM,IAAIA;AACtE;;AAMA,SAAgBK,cAAcnB,OAA8B;CACxD,OAAOA,UAAU,YAAY,kBAAkBA;AACnD"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
.panneau-line-chart-chart {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: var(--panneau-space-1);
|
|
5
|
+
min-width: 0;
|
|
6
|
+
margin: 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.panneau-line-chart-plot {
|
|
10
|
+
position: relative;
|
|
11
|
+
height: var(--_panneau-line-chart-height, var(--panneau-line-chart-height, 8rem));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.panneau-line-chart-svg {
|
|
15
|
+
display: block;
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
overflow: visible;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.panneau-line-chart-baseline {
|
|
22
|
+
stroke: var(--panneau-color-border);
|
|
23
|
+
stroke-width: 1px;
|
|
24
|
+
vector-effect: non-scaling-stroke;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.panneau-line-chart-area {
|
|
28
|
+
fill: var(--_panneau-line-chart-color);
|
|
29
|
+
fill-opacity: var(--panneau-line-chart-area-opacity, 0.12);
|
|
30
|
+
stroke: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.panneau-line-chart-line {
|
|
34
|
+
fill: none;
|
|
35
|
+
stroke: var(--_panneau-line-chart-color);
|
|
36
|
+
stroke-width: var(--panneau-line-chart-line-width, 2px);
|
|
37
|
+
stroke-linejoin: round;
|
|
38
|
+
stroke-linecap: round;
|
|
39
|
+
vector-effect: non-scaling-stroke;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* A path of no length with a round cap: a dot that the stretched plot doesn't deform. */
|
|
43
|
+
.panneau-line-chart-dot {
|
|
44
|
+
fill: none;
|
|
45
|
+
stroke: var(--_panneau-line-chart-color);
|
|
46
|
+
stroke-width: var(--panneau-line-chart-dot-size, 6px);
|
|
47
|
+
stroke-linecap: round;
|
|
48
|
+
vector-effect: non-scaling-stroke;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.panneau-line-chart-max,
|
|
52
|
+
.panneau-line-chart-labels {
|
|
53
|
+
font-size: var(--panneau-line-chart-label-font-size, var(--panneau-font-size-xs));
|
|
54
|
+
font-variant-numeric: var(--panneau-font-numeric);
|
|
55
|
+
color: var(--panneau-color-text-muted);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.panneau-line-chart-max {
|
|
59
|
+
position: absolute;
|
|
60
|
+
inset-block-start: 0;
|
|
61
|
+
inset-inline-start: 0;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
transform: translateY(-50%);
|
|
64
|
+
padding-inline-end: var(--panneau-space-1);
|
|
65
|
+
background-color: var(--panneau-card-bg, var(--panneau-color-surface));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.panneau-line-chart-labels {
|
|
69
|
+
display: flex;
|
|
70
|
+
justify-content: space-between;
|
|
71
|
+
gap: var(--panneau-space-2);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.panneau-line-chart-visually-hidden {
|
|
75
|
+
position: absolute;
|
|
76
|
+
width: 1px;
|
|
77
|
+
height: 1px;
|
|
78
|
+
padding: 0;
|
|
79
|
+
margin: -1px;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
clip-path: inset(50%);
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
border: 0;
|
|
84
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/** A point of a `LineChart`. */
|
|
2
|
+
export interface LineChartPoint {
|
|
3
|
+
/** What the point is, under the chart and in its table: a day, a week, a month. */
|
|
4
|
+
label: string;
|
|
5
|
+
value: number;
|
|
6
|
+
}
|
|
7
|
+
export interface LineChartProps {
|
|
8
|
+
/** What the chart shows: the caption of its table, for assistive technologies. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** The points, in order. Left `undefined` while they load: a skeleton of the plot. */
|
|
11
|
+
points?: LineChartPoint[] | undefined;
|
|
12
|
+
/** Formats a value, in the table and the top of the scale. Defaults to a number of the locale. */
|
|
13
|
+
formatValue?: (value: number) => string;
|
|
14
|
+
/** Height of the plot, without the labels: `'10rem'`. Defaults to the `height` token. */
|
|
15
|
+
height?: string;
|
|
16
|
+
/** The categorical color of the line, from 0. Defaults to the first. */
|
|
17
|
+
color?: number;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A line of values over time, on the categorical chart colors of the theme: the line, the area
|
|
22
|
+
* under it, the top of its scale, and the labels of its first and last points. The plot is hidden
|
|
23
|
+
* from assistive technologies, which read the values in a table instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare function LineChart({ label, points, formatValue, height, color, className, }: LineChartProps): import("react").JSX.Element;
|
|
26
|
+
//# sourceMappingURL=LineChart.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.d.ts","sourceRoot":"","sources":["../../src/line-chart/LineChart.tsx"],"names":[],"mappings":"AAQA,gCAAgC;AAChC,MAAM,WAAW,cAAc;IAC3B,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC3B,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,MAAM,CAAC,EAAE,cAAc,EAAE,GAAG,SAAS,CAAC;IACtC,kGAAkG;IAClG,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACxC,yFAAyF;IACzF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAKD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,MAAM,EACN,WAAW,EACX,MAAM,EACN,KAAS,EACT,SAAS,GACZ,EAAE,cAAc,+BAuFhB"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { cx } from "../utils/cx.js";
|
|
2
|
+
import { usePanneauIntl } from "../intl/usePanneauIntl.js";
|
|
3
|
+
import { Skeleton } from "../skeleton/Skeleton.js";
|
|
4
|
+
import { chartColors } from "../theme/chartColors.js";
|
|
5
|
+
import LineChart_module_default from "./LineChart.module.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
7
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
//#region src/line-chart/LineChart.tsx
|
|
9
|
+
/** Points get dots up to this count: past it, only the last one has one. */
|
|
10
|
+
var MAX_DOTS = 31;
|
|
11
|
+
/**
|
|
12
|
+
* A line of values over time, on the categorical chart colors of the theme: the line, the area
|
|
13
|
+
* under it, the top of its scale, and the labels of its first and last points. The plot is hidden
|
|
14
|
+
* from assistive technologies, which read the values in a table instead.
|
|
15
|
+
*/
|
|
16
|
+
function LineChart(t0) {
|
|
17
|
+
const $ = c(91);
|
|
18
|
+
const { label, points, formatValue, height, color: t1, className } = t0;
|
|
19
|
+
const color = t1 === void 0 ? 0 : t1;
|
|
20
|
+
const intl = usePanneauIntl();
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[0] !== formatValue || $[1] !== intl) {
|
|
23
|
+
t2 = formatValue ?? ((value) => intl.formatNumber(value));
|
|
24
|
+
$[0] = formatValue;
|
|
25
|
+
$[1] = intl;
|
|
26
|
+
$[2] = t2;
|
|
27
|
+
} else t2 = $[2];
|
|
28
|
+
const format = t2;
|
|
29
|
+
let t3;
|
|
30
|
+
if ($[3] !== color) {
|
|
31
|
+
t3 = chartColors.categorical(color);
|
|
32
|
+
$[3] = color;
|
|
33
|
+
$[4] = t3;
|
|
34
|
+
} else t3 = $[4];
|
|
35
|
+
let t4;
|
|
36
|
+
if ($[5] !== height) {
|
|
37
|
+
t4 = height !== void 0 ? { "--_panneau-line-chart-height": height } : {};
|
|
38
|
+
$[5] = height;
|
|
39
|
+
$[6] = t4;
|
|
40
|
+
} else t4 = $[6];
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[7] !== t3 || $[8] !== t4) {
|
|
43
|
+
t5 = {
|
|
44
|
+
"--_panneau-line-chart-color": t3,
|
|
45
|
+
...t4
|
|
46
|
+
};
|
|
47
|
+
$[7] = t3;
|
|
48
|
+
$[8] = t4;
|
|
49
|
+
$[9] = t5;
|
|
50
|
+
} else t5 = $[9];
|
|
51
|
+
const style = t5;
|
|
52
|
+
if (points === void 0) {
|
|
53
|
+
let t6;
|
|
54
|
+
if ($[10] !== className) {
|
|
55
|
+
t6 = cx("panneau-line-chart", LineChart_module_default.chart, className);
|
|
56
|
+
$[10] = className;
|
|
57
|
+
$[11] = t6;
|
|
58
|
+
} else t6 = $[11];
|
|
59
|
+
let t7;
|
|
60
|
+
let t8;
|
|
61
|
+
if ($[12] === Symbol.for("react.memo_cache_sentinel")) {
|
|
62
|
+
t7 = /* @__PURE__ */ jsx("div", {
|
|
63
|
+
className: LineChart_module_default.plot,
|
|
64
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
65
|
+
shape: "rect",
|
|
66
|
+
height: "100%"
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
t8 = /* @__PURE__ */ jsx(Skeleton, { width: "100%" });
|
|
70
|
+
$[12] = t7;
|
|
71
|
+
$[13] = t8;
|
|
72
|
+
} else {
|
|
73
|
+
t7 = $[12];
|
|
74
|
+
t8 = $[13];
|
|
75
|
+
}
|
|
76
|
+
let t9;
|
|
77
|
+
if ($[14] !== style || $[15] !== t6) {
|
|
78
|
+
t9 = /* @__PURE__ */ jsxs("div", {
|
|
79
|
+
className: t6,
|
|
80
|
+
style,
|
|
81
|
+
children: [t7, t8]
|
|
82
|
+
});
|
|
83
|
+
$[14] = style;
|
|
84
|
+
$[15] = t6;
|
|
85
|
+
$[16] = t9;
|
|
86
|
+
} else t9 = $[16];
|
|
87
|
+
return t9;
|
|
88
|
+
}
|
|
89
|
+
let first;
|
|
90
|
+
let last;
|
|
91
|
+
let t10;
|
|
92
|
+
let t6;
|
|
93
|
+
let t7;
|
|
94
|
+
let t8;
|
|
95
|
+
let t9;
|
|
96
|
+
if ($[17] !== className || $[18] !== format || $[19] !== points || $[20] !== style) {
|
|
97
|
+
const values = points.map(_temp);
|
|
98
|
+
const low = Math.min(0, ...values);
|
|
99
|
+
const high = Math.max(low + 1, ...values);
|
|
100
|
+
const top = high + (high - low) * .08;
|
|
101
|
+
let t11;
|
|
102
|
+
if ($[28] !== points.length) {
|
|
103
|
+
t11 = (index) => points.length === 1 ? 50 : index / (points.length - 1) * 100;
|
|
104
|
+
$[28] = points.length;
|
|
105
|
+
$[29] = t11;
|
|
106
|
+
} else t11 = $[29];
|
|
107
|
+
const x = t11;
|
|
108
|
+
let t12;
|
|
109
|
+
if ($[30] !== low || $[31] !== top) {
|
|
110
|
+
t12 = (value_0) => 100 - (value_0 - low) / (top - low) * 100;
|
|
111
|
+
$[30] = low;
|
|
112
|
+
$[31] = top;
|
|
113
|
+
$[32] = t12;
|
|
114
|
+
} else t12 = $[32];
|
|
115
|
+
const y = t12;
|
|
116
|
+
let t13;
|
|
117
|
+
if ($[33] !== points || $[34] !== x || $[35] !== y) {
|
|
118
|
+
let t14;
|
|
119
|
+
if ($[37] !== x || $[38] !== y) {
|
|
120
|
+
t14 = (point_0, index_0) => `${index_0 === 0 ? "M" : "L"}${x(index_0)},${y(point_0.value)}`;
|
|
121
|
+
$[37] = x;
|
|
122
|
+
$[38] = y;
|
|
123
|
+
$[39] = t14;
|
|
124
|
+
} else t14 = $[39];
|
|
125
|
+
t13 = points.map(t14).join(" ");
|
|
126
|
+
$[33] = points;
|
|
127
|
+
$[34] = x;
|
|
128
|
+
$[35] = y;
|
|
129
|
+
$[36] = t13;
|
|
130
|
+
} else t13 = $[36];
|
|
131
|
+
const line = t13;
|
|
132
|
+
const zero = y(Math.max(low, 0));
|
|
133
|
+
first = points[0];
|
|
134
|
+
let t14;
|
|
135
|
+
if ($[40] !== points) {
|
|
136
|
+
t14 = points.at(-1);
|
|
137
|
+
$[40] = points;
|
|
138
|
+
$[41] = t14;
|
|
139
|
+
} else t14 = $[41];
|
|
140
|
+
last = t14;
|
|
141
|
+
if ($[42] !== className) {
|
|
142
|
+
t9 = cx("panneau-line-chart", LineChart_module_default.chart, className);
|
|
143
|
+
$[42] = className;
|
|
144
|
+
$[43] = t9;
|
|
145
|
+
} else t9 = $[43];
|
|
146
|
+
t10 = style;
|
|
147
|
+
t6 = LineChart_module_default.plot;
|
|
148
|
+
let t15;
|
|
149
|
+
if ($[44] !== zero) {
|
|
150
|
+
t15 = /* @__PURE__ */ jsx("line", {
|
|
151
|
+
className: LineChart_module_default.baseline,
|
|
152
|
+
x1: "0",
|
|
153
|
+
x2: "100",
|
|
154
|
+
y1: zero,
|
|
155
|
+
y2: zero
|
|
156
|
+
});
|
|
157
|
+
$[44] = zero;
|
|
158
|
+
$[45] = t15;
|
|
159
|
+
} else t15 = $[45];
|
|
160
|
+
let t16;
|
|
161
|
+
if ($[46] !== line || $[47] !== points.length || $[48] !== x || $[49] !== zero) {
|
|
162
|
+
t16 = points.length > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", {
|
|
163
|
+
className: LineChart_module_default.area,
|
|
164
|
+
d: `${line} L${x(points.length - 1)},${zero} L${x(0)},${zero} Z`
|
|
165
|
+
}), /* @__PURE__ */ jsx("path", {
|
|
166
|
+
className: LineChart_module_default.line,
|
|
167
|
+
d: line
|
|
168
|
+
})] }) : null;
|
|
169
|
+
$[46] = line;
|
|
170
|
+
$[47] = points.length;
|
|
171
|
+
$[48] = x;
|
|
172
|
+
$[49] = zero;
|
|
173
|
+
$[50] = t16;
|
|
174
|
+
} else t16 = $[50];
|
|
175
|
+
let t17;
|
|
176
|
+
if ($[51] !== format || $[52] !== points || $[53] !== x || $[54] !== y) {
|
|
177
|
+
let t18;
|
|
178
|
+
if ($[56] !== format || $[57] !== points.length || $[58] !== x || $[59] !== y) {
|
|
179
|
+
t18 = (point_1, index_1) => points.length <= MAX_DOTS || index_1 === points.length - 1 ? /* @__PURE__ */ jsx("path", {
|
|
180
|
+
className: LineChart_module_default.dot,
|
|
181
|
+
d: `M${x(index_1)},${y(point_1.value)} h0`,
|
|
182
|
+
children: /* @__PURE__ */ jsx("title", { children: `${point_1.label}: ${format(point_1.value)}` })
|
|
183
|
+
}, point_1.label) : null;
|
|
184
|
+
$[56] = format;
|
|
185
|
+
$[57] = points.length;
|
|
186
|
+
$[58] = x;
|
|
187
|
+
$[59] = y;
|
|
188
|
+
$[60] = t18;
|
|
189
|
+
} else t18 = $[60];
|
|
190
|
+
t17 = points.map(t18);
|
|
191
|
+
$[51] = format;
|
|
192
|
+
$[52] = points;
|
|
193
|
+
$[53] = x;
|
|
194
|
+
$[54] = y;
|
|
195
|
+
$[55] = t17;
|
|
196
|
+
} else t17 = $[55];
|
|
197
|
+
if ($[61] !== t15 || $[62] !== t16 || $[63] !== t17) {
|
|
198
|
+
t7 = /* @__PURE__ */ jsxs("svg", {
|
|
199
|
+
className: LineChart_module_default.svg,
|
|
200
|
+
viewBox: "0 0 100 100",
|
|
201
|
+
preserveAspectRatio: "none",
|
|
202
|
+
"aria-hidden": "true",
|
|
203
|
+
focusable: "false",
|
|
204
|
+
children: [
|
|
205
|
+
t15,
|
|
206
|
+
t16,
|
|
207
|
+
t17
|
|
208
|
+
]
|
|
209
|
+
});
|
|
210
|
+
$[61] = t15;
|
|
211
|
+
$[62] = t16;
|
|
212
|
+
$[63] = t17;
|
|
213
|
+
$[64] = t7;
|
|
214
|
+
} else t7 = $[64];
|
|
215
|
+
t8 = points.length > 0 ? /* @__PURE__ */ jsx("span", {
|
|
216
|
+
className: LineChart_module_default.max,
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
children: format(Math.max(...values))
|
|
219
|
+
}) : null;
|
|
220
|
+
$[17] = className;
|
|
221
|
+
$[18] = format;
|
|
222
|
+
$[19] = points;
|
|
223
|
+
$[20] = style;
|
|
224
|
+
$[21] = first;
|
|
225
|
+
$[22] = last;
|
|
226
|
+
$[23] = t10;
|
|
227
|
+
$[24] = t6;
|
|
228
|
+
$[25] = t7;
|
|
229
|
+
$[26] = t8;
|
|
230
|
+
$[27] = t9;
|
|
231
|
+
} else {
|
|
232
|
+
first = $[21];
|
|
233
|
+
last = $[22];
|
|
234
|
+
t10 = $[23];
|
|
235
|
+
t6 = $[24];
|
|
236
|
+
t7 = $[25];
|
|
237
|
+
t8 = $[26];
|
|
238
|
+
t9 = $[27];
|
|
239
|
+
}
|
|
240
|
+
let t11;
|
|
241
|
+
if ($[65] !== t6 || $[66] !== t7 || $[67] !== t8) {
|
|
242
|
+
t11 = /* @__PURE__ */ jsxs("div", {
|
|
243
|
+
className: t6,
|
|
244
|
+
children: [t7, t8]
|
|
245
|
+
});
|
|
246
|
+
$[65] = t6;
|
|
247
|
+
$[66] = t7;
|
|
248
|
+
$[67] = t8;
|
|
249
|
+
$[68] = t11;
|
|
250
|
+
} else t11 = $[68];
|
|
251
|
+
let t12;
|
|
252
|
+
if ($[69] !== first || $[70] !== last || $[71] !== points.length) {
|
|
253
|
+
t12 = first !== void 0 && last !== void 0 ? /* @__PURE__ */ jsxs("div", {
|
|
254
|
+
className: LineChart_module_default.labels,
|
|
255
|
+
"aria-hidden": "true",
|
|
256
|
+
children: [/* @__PURE__ */ jsx("span", { children: first.label }), points.length > 1 ? /* @__PURE__ */ jsx("span", { children: last.label }) : null]
|
|
257
|
+
}) : null;
|
|
258
|
+
$[69] = first;
|
|
259
|
+
$[70] = last;
|
|
260
|
+
$[71] = points.length;
|
|
261
|
+
$[72] = t12;
|
|
262
|
+
} else t12 = $[72];
|
|
263
|
+
let t13;
|
|
264
|
+
if ($[73] !== label) {
|
|
265
|
+
t13 = /* @__PURE__ */ jsx("caption", { children: label });
|
|
266
|
+
$[73] = label;
|
|
267
|
+
$[74] = t13;
|
|
268
|
+
} else t13 = $[74];
|
|
269
|
+
let t14;
|
|
270
|
+
if ($[75] !== format || $[76] !== points) {
|
|
271
|
+
let t15;
|
|
272
|
+
if ($[78] !== format) {
|
|
273
|
+
t15 = (point_2) => /* @__PURE__ */ jsxs("tr", { children: [/* @__PURE__ */ jsx("th", {
|
|
274
|
+
scope: "row",
|
|
275
|
+
children: point_2.label
|
|
276
|
+
}), /* @__PURE__ */ jsx("td", { children: format(point_2.value) })] }, point_2.label);
|
|
277
|
+
$[78] = format;
|
|
278
|
+
$[79] = t15;
|
|
279
|
+
} else t15 = $[79];
|
|
280
|
+
t14 = points.map(t15);
|
|
281
|
+
$[75] = format;
|
|
282
|
+
$[76] = points;
|
|
283
|
+
$[77] = t14;
|
|
284
|
+
} else t14 = $[77];
|
|
285
|
+
let t15;
|
|
286
|
+
if ($[80] !== t14) {
|
|
287
|
+
t15 = /* @__PURE__ */ jsx("tbody", { children: t14 });
|
|
288
|
+
$[80] = t14;
|
|
289
|
+
$[81] = t15;
|
|
290
|
+
} else t15 = $[81];
|
|
291
|
+
let t16;
|
|
292
|
+
if ($[82] !== t13 || $[83] !== t15) {
|
|
293
|
+
t16 = /* @__PURE__ */ jsxs("table", {
|
|
294
|
+
className: LineChart_module_default.visuallyHidden,
|
|
295
|
+
children: [t13, t15]
|
|
296
|
+
});
|
|
297
|
+
$[82] = t13;
|
|
298
|
+
$[83] = t15;
|
|
299
|
+
$[84] = t16;
|
|
300
|
+
} else t16 = $[84];
|
|
301
|
+
let t17;
|
|
302
|
+
if ($[85] !== t10 || $[86] !== t11 || $[87] !== t12 || $[88] !== t16 || $[89] !== t9) {
|
|
303
|
+
t17 = /* @__PURE__ */ jsxs("figure", {
|
|
304
|
+
className: t9,
|
|
305
|
+
style: t10,
|
|
306
|
+
children: [
|
|
307
|
+
t11,
|
|
308
|
+
t12,
|
|
309
|
+
t16
|
|
310
|
+
]
|
|
311
|
+
});
|
|
312
|
+
$[85] = t10;
|
|
313
|
+
$[86] = t11;
|
|
314
|
+
$[87] = t12;
|
|
315
|
+
$[88] = t16;
|
|
316
|
+
$[89] = t9;
|
|
317
|
+
$[90] = t17;
|
|
318
|
+
} else t17 = $[90];
|
|
319
|
+
return t17;
|
|
320
|
+
}
|
|
321
|
+
function _temp(point) {
|
|
322
|
+
return point.value;
|
|
323
|
+
}
|
|
324
|
+
//#endregion
|
|
325
|
+
export { LineChart };
|
|
326
|
+
|
|
327
|
+
//# sourceMappingURL=LineChart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.js","names":["CSSProperties","usePanneauIntl","Skeleton","chartColors","cx","styles","LineChartPoint","label","value","LineChartProps","points","formatValue","height","color","className","MAX_DOTS","LineChart","t0","$","_c","t1","undefined","intl","t2","formatNumber","format","t3","categorical","t4","t5","style","t6","chart","t7","t8","Symbol","for","plot","t9","first","last","t10","values","map","_temp","low","Math","min","high","max","top","t11","length","index","x","t12","value_0","y","t13","t14","point_0","index_0","point","join","line","zero","at","t15","baseline","t16","area","t17","t18","point_1","index_1","dot","svg","labels","point_2","visuallyHidden","_c","styles","_Fragment"],"sources":["../../src/line-chart/LineChart.tsx"],"sourcesContent":["import type { CSSProperties } from 'react';\n\nimport { usePanneauIntl } from '../intl/usePanneauIntl';\nimport { Skeleton } from '../skeleton/Skeleton';\nimport { chartColors } from '../theme/chartColors';\nimport { cx } from '../utils/cx';\nimport styles from './LineChart.module.css';\n\n/** A point of a `LineChart`. */\nexport interface LineChartPoint {\n /** What the point is, under the chart and in its table: a day, a week, a month. */\n label: string;\n value: number;\n}\n\nexport interface LineChartProps {\n /** What the chart shows: the caption of its table, for assistive technologies. */\n label: string;\n /** The points, in order. Left `undefined` while they load: a skeleton of the plot. */\n points?: LineChartPoint[] | undefined;\n /** Formats a value, in the table and the top of the scale. Defaults to a number of the locale. */\n formatValue?: (value: number) => string;\n /** Height of the plot, without the labels: `'10rem'`. Defaults to the `height` token. */\n height?: string;\n /** The categorical color of the line, from 0. Defaults to the first. */\n color?: number;\n className?: string;\n}\n\n/** Points get dots up to this count: past it, only the last one has one. */\nconst MAX_DOTS = 31;\n\n/**\n * A line of values over time, on the categorical chart colors of the theme: the line, the area\n * under it, the top of its scale, and the labels of its first and last points. The plot is hidden\n * from assistive technologies, which read the values in a table instead.\n */\nexport function LineChart({\n label,\n points,\n formatValue,\n height,\n color = 0,\n className,\n}: LineChartProps) {\n const intl = usePanneauIntl();\n const format = formatValue ?? ((value: number) => intl.formatNumber(value));\n const style = {\n '--_panneau-line-chart-color': chartColors.categorical(color),\n ...(height !== undefined ? { '--_panneau-line-chart-height': height } : {}),\n } as CSSProperties;\n if (points === undefined) {\n return (\n <div className={cx('panneau-line-chart', styles.chart, className)} style={style}>\n <div className={styles.plot}>\n <Skeleton shape=\"rect\" height=\"100%\" />\n </div>\n <Skeleton width=\"100%\" />\n </div>\n );\n }\n const values = points.map((point) => point.value);\n const low = Math.min(0, ...values);\n const high = Math.max(low + 1, ...values);\n // Room above the highest point, for the width of the line and its dot\n const top = high + (high - low) * 0.08;\n const x = (index: number) => (points.length === 1 ? 50 : (index / (points.length - 1)) * 100);\n const y = (value: number) => 100 - ((value - low) / (top - low)) * 100;\n const line = points\n .map((point, index) => `${index === 0 ? 'M' : 'L'}${x(index)},${y(point.value)}`)\n .join(' ');\n const zero = y(Math.max(low, 0));\n const first = points[0];\n const last = points.at(-1);\n return (\n <figure className={cx('panneau-line-chart', styles.chart, className)} style={style}>\n <div className={styles.plot}>\n <svg\n className={styles.svg}\n viewBox=\"0 0 100 100\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <line className={styles.baseline} x1=\"0\" x2=\"100\" y1={zero} y2={zero} />\n {points.length > 1 ? (\n <>\n <path\n className={styles.area}\n d={`${line} L${x(points.length - 1)},${zero} L${x(0)},${zero} Z`}\n />\n <path className={styles.line} d={line} />\n </>\n ) : null}\n {points.map((point, index) =>\n points.length <= MAX_DOTS || index === points.length - 1 ? (\n <path\n key={point.label}\n className={styles.dot}\n d={`M${x(index)},${y(point.value)} h0`}\n >\n <title>{`${point.label}: ${format(point.value)}`}</title>\n </path>\n ) : null,\n )}\n </svg>\n {points.length > 0 ? (\n <span className={styles.max} aria-hidden=\"true\">\n {format(Math.max(...values))}\n </span>\n ) : null}\n </div>\n {first !== undefined && last !== undefined ? (\n <div className={styles.labels} aria-hidden=\"true\">\n <span>{first.label}</span>\n {points.length > 1 ? <span>{last.label}</span> : null}\n </div>\n ) : null}\n <table className={styles.visuallyHidden}>\n <caption>{label}</caption>\n <tbody>\n {points.map((point) => (\n <tr key={point.label}>\n <th scope=\"row\">{point.label}</th>\n <td>{format(point.value)}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </figure>\n );\n}\n"],"mappings":";;;;;;;;;AA8BA,IAAMe,WAAW;;;;;;AAOjB,SAAOC,UAAAC,IAAA;CAAA,MAAAC,IAAAC,EAAA,EAAA;CAAmB,MAAA,EAAAZ,OAAAG,QAAAC,aAAAC,QAAAC,OAAAO,IAAAN,cAAAG;CAKtB,MAAAJ,QAAAO,OAAAC,KAAAA,IAAA,IAAAD;CAGA,MAAAE,OAAarB,eAAe;CAAE,IAAAsB;CAAA,IAAAL,EAAA,OAAAP,eAAAO,EAAA,O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4
|
+
var plot = "panneau-line-chart-plot";
|
|
5
|
+
var svg = "panneau-line-chart-svg";
|
|
6
|
+
var baseline = "panneau-line-chart-baseline";
|
|
7
|
+
var area = "panneau-line-chart-area";
|
|
8
|
+
var line = "panneau-line-chart-line";
|
|
9
|
+
var dot = "panneau-line-chart-dot";
|
|
10
|
+
var max = "panneau-line-chart-max";
|
|
11
|
+
var labels = "panneau-line-chart-labels";
|
|
12
|
+
var visuallyHidden = "panneau-line-chart-visually-hidden";
|
|
13
|
+
var LineChart_module_default = {
|
|
14
|
+
chart,
|
|
15
|
+
plot,
|
|
16
|
+
svg,
|
|
17
|
+
baseline,
|
|
18
|
+
area,
|
|
19
|
+
line,
|
|
20
|
+
dot,
|
|
21
|
+
max,
|
|
22
|
+
labels,
|
|
23
|
+
visuallyHidden
|
|
24
|
+
};
|
|
25
|
+
//#endregion
|
|
26
|
+
export { area, baseline, chart, LineChart_module_default as default, dot, labels, line, max, plot, svg, visuallyHidden };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=LineChart.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LineChart.module.js","names":[],"sources":["../../src/line-chart/LineChart.module.css"],"sourcesContent":[".chart {\n display: flex;\n flex-direction: column;\n gap: var(--panneau-space-1);\n min-width: 0;\n margin: 0;\n}\n\n.plot {\n position: relative;\n height: var(--_panneau-line-chart-height, var(--panneau-line-chart-height, 8rem));\n}\n\n.svg {\n display: block;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.baseline {\n stroke: var(--panneau-color-border);\n stroke-width: 1px;\n vector-effect: non-scaling-stroke;\n}\n\n.area {\n fill: var(--_panneau-line-chart-color);\n fill-opacity: var(--panneau-line-chart-area-opacity, 0.12);\n stroke: none;\n}\n\n.line {\n fill: none;\n stroke: var(--_panneau-line-chart-color);\n stroke-width: var(--panneau-line-chart-line-width, 2px);\n stroke-linejoin: round;\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n}\n\n/* A path of no length with a round cap: a dot that the stretched plot doesn't deform. */\n.dot {\n fill: none;\n stroke: var(--_panneau-line-chart-color);\n stroke-width: var(--panneau-line-chart-dot-size, 6px);\n stroke-linecap: round;\n vector-effect: non-scaling-stroke;\n}\n\n.max,\n.labels {\n font-size: var(--panneau-line-chart-label-font-size, var(--panneau-font-size-xs));\n font-variant-numeric: var(--panneau-font-numeric);\n color: var(--panneau-color-text-muted);\n}\n\n.max {\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n line-height: 1;\n transform: translateY(-50%);\n padding-inline-end: var(--panneau-space-1);\n background-color: var(--panneau-card-bg, var(--panneau-color-surface));\n}\n\n.labels {\n display: flex;\n justify-content: space-between;\n gap: var(--panneau-space-2);\n}\n\n.visuallyHidden {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n"],"mappings":""}
|