@seanyeh77/ui 0.44.0 → 0.45.0
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/LICENSE +21 -0
- package/README.md +1 -1
- package/dist/bundle.js +20 -20
- package/dist/components/AccentPicker/AccentPicker.d.ts +1 -0
- package/dist/components/AccentPicker/AccentPicker.js +92 -72
- package/dist/components/AccentPicker/AccentPicker.js.map +1 -1
- package/dist/components/ActionBar/ActionBar.d.ts +2 -0
- package/dist/components/ActionBar/ActionBar.js.map +1 -1
- package/dist/components/AiMark/AiMark.d.ts +1 -0
- package/dist/components/AiMark/AiMark.js.map +1 -1
- package/dist/components/Alert/Alert.d.ts +5 -2
- package/dist/components/Alert/Alert.js +17 -14
- package/dist/components/Alert/Alert.js.map +1 -1
- package/dist/components/AppShell/AppShell.d.ts +10 -4
- package/dist/components/AppShell/AppShell.js +30 -19
- package/dist/components/AppShell/AppShell.js.map +1 -1
- package/dist/components/Badge/Badge.d.ts +24 -7
- package/dist/components/Badge/Badge.js +78 -21
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/BarChart/BarChart.d.ts +14 -1
- package/dist/components/BarChart/BarChart.js +88 -59
- package/dist/components/BarChart/BarChart.js.map +1 -1
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +1 -0
- package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
- package/dist/components/Button/Button.d.ts +4 -1
- package/dist/components/Button/Button.js +17 -3
- package/dist/components/Button/Button.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +11 -2
- package/dist/components/Calendar/Calendar.js +16 -5
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Card/Card.d.ts +1 -0
- package/dist/components/Card/Card.js.map +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +24 -8
- package/dist/components/Checkbox/Checkbox.js +22 -9
- package/dist/components/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/CodeView/CodeView.d.ts +3 -0
- package/dist/components/CodeView/CodeView.js +6 -6
- package/dist/components/CodeView/CodeView.js.map +1 -1
- package/dist/components/CommandPalette/CommandPalette.d.ts +16 -4
- package/dist/components/CommandPalette/CommandPalette.js +38 -11
- package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
- package/dist/components/ConsoleLayout/ConsoleLayout.d.ts +2 -3
- package/dist/components/ConsoleLayout/ConsoleLayout.js +4 -1
- package/dist/components/ConsoleLayout/ConsoleLayout.js.map +1 -1
- package/dist/components/DangerZone/DangerZone.d.ts +2 -1
- package/dist/components/DangerZone/DangerZone.js +1 -1
- package/dist/components/DangerZone/DangerZone.js.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +8 -1
- package/dist/components/DataTable/DataTable.js +213 -167
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/SortButton.js +48 -5
- package/dist/components/DataTable/SortButton.js.map +1 -1
- package/dist/components/DataTable/filters.js +2 -1
- package/dist/components/DataTable/filters.js.map +1 -1
- package/dist/components/DataTable/parts.js +1 -1
- package/dist/components/DataTable/parts.js.map +1 -1
- package/dist/components/DataTable/types.d.ts +10 -3
- package/dist/components/DatePicker/DatePicker.d.ts +7 -5
- package/dist/components/DatePicker/DatePicker.js +16 -6
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +12 -7
- package/dist/components/DateRangePicker/DateRangePicker.js +81 -45
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/DetailList/DetailList.d.ts +2 -0
- package/dist/components/DetailList/DetailList.js.map +1 -1
- package/dist/components/Dialog/Dialog.d.ts +56 -20
- package/dist/components/Dialog/Dialog.js +45 -14
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +17 -5
- package/dist/components/Drawer/Drawer.js +86 -24
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/ErrorPage/ErrorPage.d.ts +3 -0
- package/dist/components/ErrorPage/ErrorPage.js.map +1 -1
- package/dist/components/EventTimeline/EventTimeline.d.ts +22 -4
- package/dist/components/EventTimeline/EventTimeline.js +63 -20
- package/dist/components/EventTimeline/EventTimeline.js.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +9 -1
- package/dist/components/FileUpload/FileUpload.js +3 -1
- package/dist/components/FileUpload/FileUpload.js.map +1 -1
- package/dist/components/FormGrid/FormGrid.d.ts +3 -1
- package/dist/components/FormGrid/FormGrid.js +5 -2
- package/dist/components/FormGrid/FormGrid.js.map +1 -1
- package/dist/components/Graph/Graph.d.ts +1 -0
- package/dist/components/Graph/Graph.js +8 -4
- package/dist/components/Graph/Graph.js.map +1 -1
- package/dist/components/Grid/Grid.d.ts +11 -4
- package/dist/components/Grid/Grid.js +14 -2
- package/dist/components/Grid/Grid.js.map +1 -1
- package/dist/components/IconButton/IconButton.d.ts +2 -1
- package/dist/components/IconButton/IconButton.js +10 -1
- package/dist/components/IconButton/IconButton.js.map +1 -1
- package/dist/components/InlineCode/InlineCode.d.ts +6 -0
- package/dist/components/InlineCode/InlineCode.js.map +1 -1
- package/dist/components/KpiCard/KpiCard.d.ts +5 -1
- package/dist/components/KpiCard/KpiCard.js +35 -21
- package/dist/components/KpiCard/KpiCard.js.map +1 -1
- package/dist/components/LayerGraph/LayerGraph.d.ts +68 -23
- package/dist/components/LayerGraph/LayerGraph.js +159 -88
- package/dist/components/LayerGraph/LayerGraph.js.map +1 -1
- package/dist/components/LineChart/LineChart.d.ts +10 -3
- package/dist/components/LineChart/LineChart.js +55 -23
- package/dist/components/LineChart/LineChart.js.map +1 -1
- package/dist/components/Link/Link.d.ts +17 -0
- package/dist/components/Link/Link.js +47 -0
- package/dist/components/Link/Link.js.map +1 -0
- package/dist/components/LoadingBar/LoadingBar.d.ts +1 -0
- package/dist/components/LoadingBar/LoadingBar.js.map +1 -1
- package/dist/components/LoginCard/LoginCard.d.ts +9 -3
- package/dist/components/LoginCard/LoginCard.js +99 -78
- package/dist/components/LoginCard/LoginCard.js.map +1 -1
- package/dist/components/Markdown/Markdown.d.ts +1 -0
- package/dist/components/Markdown/Markdown.js +1 -1
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Menu/Menu.d.ts +4 -2
- package/dist/components/Menu/Menu.js +43 -33
- package/dist/components/Menu/Menu.js.map +1 -1
- package/dist/components/Meter/Meter.d.ts +4 -0
- package/dist/components/Meter/Meter.js.map +1 -1
- package/dist/components/MobileTabBar/MobileTabBar.d.ts +3 -0
- package/dist/components/MobileTabBar/MobileTabBar.js.map +1 -1
- package/dist/components/MultiSelect/MultiSelect.d.ts +7 -6
- package/dist/components/MultiSelect/MultiSelect.js +27 -9
- package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/NotificationBell/NotificationBell.d.ts +3 -0
- package/dist/components/NotificationBell/NotificationBell.js +2 -2
- package/dist/components/NotificationBell/NotificationBell.js.map +1 -1
- package/dist/components/PageHeader/PageHeader.d.ts +34 -0
- package/dist/components/PageHeader/PageHeader.js +68 -0
- package/dist/components/PageHeader/PageHeader.js.map +1 -0
- package/dist/components/Popover/Popover.d.ts +11 -4
- package/dist/components/Popover/Popover.js +17 -7
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +2 -0
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/ProgressRing/ProgressRing.d.ts +1 -0
- package/dist/components/ProgressRing/ProgressRing.js.map +1 -1
- package/dist/components/ProjectSwitcher/ProjectSwitcher.d.ts +5 -1
- package/dist/components/ProjectSwitcher/ProjectSwitcher.js +16 -3
- package/dist/components/ProjectSwitcher/ProjectSwitcher.js.map +1 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +22 -5
- package/dist/components/RadioGroup/RadioGroup.js +48 -47
- package/dist/components/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/components/RelativeTime/RelativeTime.d.ts +10 -0
- package/dist/components/RelativeTime/RelativeTime.js +44 -0
- package/dist/components/RelativeTime/RelativeTime.js.map +1 -0
- package/dist/components/SearchField/SearchField.d.ts +2 -0
- package/dist/components/SearchField/SearchField.js.map +1 -1
- package/dist/components/Section/Section.d.ts +4 -0
- package/dist/components/Section/Section.js +8 -22
- package/dist/components/Section/Section.js.map +1 -1
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +22 -9
- package/dist/components/SegmentedControl/SegmentedControl.js +20 -19
- package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -1
- package/dist/components/Select/Select.d.ts +7 -11
- package/dist/components/Select/Select.js +7 -3
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/SettingsLayout/SettingsLayout.d.ts +32 -3
- package/dist/components/SettingsLayout/SettingsLayout.js +60 -13
- package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -1
- package/dist/components/SideNav/SideNav.d.ts +2 -0
- package/dist/components/SideNav/SideNav.js +3 -3
- package/dist/components/SideNav/SideNav.js.map +1 -1
- package/dist/components/SplitPane/SplitPane.d.ts +1 -0
- package/dist/components/SplitPane/SplitPane.js.map +1 -1
- package/dist/components/StatusBand/StatusBand.d.ts +1 -0
- package/dist/components/StatusBand/StatusBand.js.map +1 -1
- package/dist/components/Suggestion/Suggestion.d.ts +6 -0
- package/dist/components/Suggestion/Suggestion.js.map +1 -1
- package/dist/components/Switch/Switch.d.ts +13 -3
- package/dist/components/Switch/Switch.js +16 -7
- package/dist/components/Switch/Switch.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +4 -0
- package/dist/components/Tabs/Tabs.js +1 -1
- package/dist/components/Tabs/Tabs.js.map +1 -1
- package/dist/components/Tag/Tag.d.ts +15 -7
- package/dist/components/Tag/Tag.js +22 -10
- package/dist/components/Tag/Tag.js.map +1 -1
- package/dist/components/Term/Term.d.ts +8 -3
- package/dist/components/Term/Term.js +1 -1
- package/dist/components/Term/Term.js.map +1 -1
- package/dist/components/TextArea/TextArea.d.ts +6 -10
- package/dist/components/TextArea/TextArea.js +22 -10
- package/dist/components/TextArea/TextArea.js.map +1 -1
- package/dist/components/TextField/TextField.d.ts +8 -11
- package/dist/components/TextField/TextField.js +9 -7
- package/dist/components/TextField/TextField.js.map +1 -1
- package/dist/components/ThemePicker/ThemePicker.d.ts +1 -0
- package/dist/components/ThemePicker/ThemePicker.js +35 -34
- package/dist/components/ThemePicker/ThemePicker.js.map +1 -1
- package/dist/components/TimeControl/TimeControl.d.ts +1 -0
- package/dist/components/TimeControl/TimeControl.js.map +1 -1
- package/dist/components/Toast/Toast.d.ts +55 -2
- package/dist/components/Toast/Toast.js +190 -8
- package/dist/components/Toast/Toast.js.map +1 -1
- package/dist/components/TopBar/TopBar.d.ts +6 -2
- package/dist/components/TopBar/TopBar.js +7 -1
- package/dist/components/TopBar/TopBar.js.map +1 -1
- package/dist/components/Tour/Tour.d.ts +14 -3
- package/dist/components/Tour/Tour.js +26 -14
- package/dist/components/Tour/Tour.js.map +1 -1
- package/dist/components/TreeList/TreeList.d.ts +28 -4
- package/dist/components/TreeList/TreeList.js +32 -20
- package/dist/components/TreeList/TreeList.js.map +1 -1
- package/dist/components/Workbench/Workbench.d.ts +1 -0
- package/dist/components/Workbench/Workbench.js +24 -12
- package/dist/components/Workbench/Workbench.js.map +1 -1
- package/dist/components/ZoneMap/ZoneMap.d.ts +12 -2
- package/dist/components/ZoneMap/ZoneMap.js +13 -5
- package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
- package/dist/components/useFormErrors/useFormErrors.d.ts +20 -0
- package/dist/components/useFormErrors/useFormErrors.js +55 -0
- package/dist/components/useFormErrors/useFormErrors.js.map +1 -0
- package/dist/css/AccentPicker.css +1 -0
- package/dist/css/Alert.css +7 -19
- package/dist/css/AppShell.css +1 -0
- package/dist/css/Badge.css +19 -45
- package/dist/css/BarChart.css +21 -3
- package/dist/css/Button.css +5 -1
- package/dist/css/Card.css +8 -8
- package/dist/css/Checkbox.css +19 -0
- package/dist/css/CodeView.css +2 -1
- package/dist/css/DangerZone.css +4 -3
- package/dist/css/DataTable.css +129 -34
- package/dist/css/DateRangePicker.css +23 -2
- package/dist/css/Drawer.css +30 -0
- package/dist/css/ErrorPage.css +3 -1
- package/dist/css/EventTimeline.css +33 -5
- package/dist/css/FormGrid.css +12 -3
- package/dist/css/Graph.css +9 -1
- package/dist/css/Grid.css +8 -0
- package/dist/css/KpiCard.css +12 -1
- package/dist/css/LayerGraph.css +40 -15
- package/dist/css/Link.css +23 -0
- package/dist/css/LoginCard.css +16 -11
- package/dist/css/Markdown.css +2 -1
- package/dist/css/Menu.css +0 -2
- package/dist/css/Meter.css +16 -0
- package/dist/css/PageHeader.css +50 -0
- package/dist/css/ProgressBar.css +12 -0
- package/dist/css/ProjectSwitcher.css +23 -26
- package/dist/css/RelativeTime.css +2 -0
- package/dist/css/SegmentedControl.css +38 -10
- package/dist/css/SettingsLayout.css +28 -8
- package/dist/css/SideNav.css +4 -1
- package/dist/css/Skeleton.css +22 -1
- package/dist/css/Switch.css +27 -0
- package/dist/css/Tabs.css +2 -1
- package/dist/css/Tag.css +19 -12
- package/dist/css/Toast.css +100 -4
- package/dist/css/TopBar.css +21 -2
- package/dist/css/TreeList.css +6 -3
- package/dist/css/Workbench.css +1 -1
- package/dist/css/ZoneMap.css +0 -1
- package/dist/css/base.css +45 -0
- package/dist/css/end.css +119 -5
- package/dist/deprecated.d.ts +3 -0
- package/dist/deprecated.js +13 -0
- package/dist/deprecated.js.map +1 -0
- package/dist/fonts.css +2 -7543
- package/dist/format.d.ts +3 -1
- package/dist/format.js +12 -4
- package/dist/format.js.map +1 -1
- package/dist/generated/themeDefaults.d.ts +8 -0
- package/dist/generated/themeDefaults.js +35 -0
- package/dist/generated/themeDefaults.js.map +1 -0
- package/dist/i18n.d.ts +7 -2
- package/dist/i18n.js +65 -10
- package/dist/i18n.js.map +1 -1
- package/dist/icons/Icon.d.ts +3 -1
- package/dist/icons/Icon.js.map +1 -1
- package/dist/index.d.ts +23 -14
- package/dist/index.js +14 -8
- package/dist/internal/Field.d.ts +19 -0
- package/dist/internal/Field.js +10 -4
- package/dist/internal/Field.js.map +1 -1
- package/dist/internal/FloatingPanel.js +2 -1
- package/dist/internal/FloatingPanel.js.map +1 -1
- package/dist/internal/chart.d.ts +4 -0
- package/dist/internal/chart.js +89 -19
- package/dist/internal/chart.js.map +1 -1
- package/dist/internal/dev.js +9 -4
- package/dist/internal/dev.js.map +1 -1
- package/dist/internal/focus.js +27 -3
- package/dist/internal/focus.js.map +1 -1
- package/dist/internal/focusMain.js +6 -2
- package/dist/internal/focusMain.js.map +1 -1
- package/dist/internal/open.d.ts +14 -0
- package/dist/internal/open.js +28 -0
- package/dist/internal/open.js.map +1 -0
- package/dist/internal/roving.js +37 -0
- package/dist/internal/roving.js.map +1 -0
- package/dist/internal/shell.js +12 -0
- package/dist/internal/shell.js.map +1 -0
- package/dist/internal/stored.js +89 -0
- package/dist/internal/stored.js.map +1 -0
- package/dist/internal/tableTools.js +46 -4
- package/dist/internal/tableTools.js.map +1 -1
- package/dist/internal/util.js +8 -17
- package/dist/internal/util.js.map +1 -1
- package/dist/locale.d.ts +17 -0
- package/dist/locale.js +29 -0
- package/dist/locale.js.map +1 -0
- package/dist/styles.css +944 -231
- package/dist/theme.d.ts +23 -5
- package/dist/theme.js +85 -25
- package/dist/theme.js.map +1 -1
- package/dist/tokens.css +3 -0
- package/docs/AccentPicker.md +3 -1
- package/docs/Alert.md +4 -4
- package/docs/AppShell.md +11 -10
- package/docs/Badge.md +26 -16
- package/docs/BarChart.md +7 -4
- package/docs/Button.md +4 -5
- package/docs/Calendar.md +2 -2
- package/docs/Card.md +8 -7
- package/docs/Checkbox.md +4 -1
- package/docs/CodeView.md +30 -43
- package/docs/CommandPalette.md +3 -2
- package/docs/ConsoleLayout.md +5 -5
- package/docs/DangerZone.md +3 -3
- package/docs/DataColors.md +2 -2
- package/docs/DataTable.md +26 -148
- package/docs/DatePicker.md +1 -1
- package/docs/DateRangePicker.md +3 -0
- package/docs/DetailList.md +9 -9
- package/docs/Dialog.md +8 -5
- package/docs/Drawer.md +7 -5
- package/docs/EmptyState.md +0 -1
- package/docs/ErrorPage.md +1 -2
- package/docs/EventTimeline.md +23 -13
- package/docs/FileUpload.md +1 -2
- package/docs/FormGrid.md +2 -1
- package/docs/Format.md +4 -2
- package/docs/Graph.md +1 -1
- package/docs/Grid.md +5 -1
- package/docs/KpiCard.md +6 -5
- package/docs/LayerGraph.md +18 -53
- package/docs/LineChart.md +5 -3
- package/docs/Link.md +22 -0
- package/docs/LoginCard.md +7 -4
- package/docs/Markdown.md +2 -15
- package/docs/Menu.md +2 -0
- package/docs/Meter.md +1 -0
- package/docs/MultiSelect.md +2 -2
- package/docs/NotificationBell.md +1 -1
- package/docs/PageHeader.md +34 -0
- package/docs/Popover.md +3 -1
- package/docs/ProgressBar.md +3 -1
- package/docs/ProjectSwitcher.md +14 -14
- package/docs/RadioGroup.md +2 -0
- package/docs/RelativeTime.md +23 -0
- package/docs/Section.md +1 -1
- package/docs/SegmentedControl.md +9 -6
- package/docs/Select.md +2 -2
- package/docs/SettingsLayout.md +19 -5
- package/docs/SideNav.md +1 -1
- package/docs/Skeleton.md +2 -1
- package/docs/Switch.md +3 -1
- package/docs/Tabs.md +2 -1
- package/docs/Tag.md +9 -7
- package/docs/Term.md +3 -4
- package/docs/TextArea.md +2 -2
- package/docs/TextField.md +5 -4
- package/docs/ThemePicker.md +3 -1
- package/docs/Toast.md +17 -6
- package/docs/TopBar.md +8 -5
- package/docs/Tour.md +3 -2
- package/docs/TreeList.md +10 -37
- package/docs/Workbench.md +1 -48
- package/docs/ZoneMap.md +5 -5
- package/docs/agents.md +82 -0
- package/docs/code.md +2 -2
- package/docs/components.json +314 -0
- package/docs/data.md +9 -19
- package/docs/forms.md +6 -5
- package/docs/guidelines.md +39 -31
- package/docs/icons.md +9 -0
- package/docs/layout.md +16 -20
- package/docs/motion.md +31 -56
- package/docs/theme.md +15 -18
- package/docs/useFormErrors.md +35 -0
- package/package.json +8 -7
- package/dist/bundle.js.map +0 -1
- package/dist/fonts/LICENSE-OFL.txt +0 -93
- package/dist/fonts/geist-mono-cyrillic-400-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-500-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-600-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-700-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-ext-500-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-ext-600-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-400-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-500-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-600-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-700-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-ext-600-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-latin-ext-700-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-symbols2-400-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-symbols2-500-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-symbols2-600-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-symbols2-700-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-vietnamese-400-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-vietnamese-500-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-vietnamese-600-normal.woff2 +0 -0
- package/dist/fonts/geist-mono-vietnamese-700-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-400-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-500-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-600-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-700-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-400-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-500-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-600-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-ext-700-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-400-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-500-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-600-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-700-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-400-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-500-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-600-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-700-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-400-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-500-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-600-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-700-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-600-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-700-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-400-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-500-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-600-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-0-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-0-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-0-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-0-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-1-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-1-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-1-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-1-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-10-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-10-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-10-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-10-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-101-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-101-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-101-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-101-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-102-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-102-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-102-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-102-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-103-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-103-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-103-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-103-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-104-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-104-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-104-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-104-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-105-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-105-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-105-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-105-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-106-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-106-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-106-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-106-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-107-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-107-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-107-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-107-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-108-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-108-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-108-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-108-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-109-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-109-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-109-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-109-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-11-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-11-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-11-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-11-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-110-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-110-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-110-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-110-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-111-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-111-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-111-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-111-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-112-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-112-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-112-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-112-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-113-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-113-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-113-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-113-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-114-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-114-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-114-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-114-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-115-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-115-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-115-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-115-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-116-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-116-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-116-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-116-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-117-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-117-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-117-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-117-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-118-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-118-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-118-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-118-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-119-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-119-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-119-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-119-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-12-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-12-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-12-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-12-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-120-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-120-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-120-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-120-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-121-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-121-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-121-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-121-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-122-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-122-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-122-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-122-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-123-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-123-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-123-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-123-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-2-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-2-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-2-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-2-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-23-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-23-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-23-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-23-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-24-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-24-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-24-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-24-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-25-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-25-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-25-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-25-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-26-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-26-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-26-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-26-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-27-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-27-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-27-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-27-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-28-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-28-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-28-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-28-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-29-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-29-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-29-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-29-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-30-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-30-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-30-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-30-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-31-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-31-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-31-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-31-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-32-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-32-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-32-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-32-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-33-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-33-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-33-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-33-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-34-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-34-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-34-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-34-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-35-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-35-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-35-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-35-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-36-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-36-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-36-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-36-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-37-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-37-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-37-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-37-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-38-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-38-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-38-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-38-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-39-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-39-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-39-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-39-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-4-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-4-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-4-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-4-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-40-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-40-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-40-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-40-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-41-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-41-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-41-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-41-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-42-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-42-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-42-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-42-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-43-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-43-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-43-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-43-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-44-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-44-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-44-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-44-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-45-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-45-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-45-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-45-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-46-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-46-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-46-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-46-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-47-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-47-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-47-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-47-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-48-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-48-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-48-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-48-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-49-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-49-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-49-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-49-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-50-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-50-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-50-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-50-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-51-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-51-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-51-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-51-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-52-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-52-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-52-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-52-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-53-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-53-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-53-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-53-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-54-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-54-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-54-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-54-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-55-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-55-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-55-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-55-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-56-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-56-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-56-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-56-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-57-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-57-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-57-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-57-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-58-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-58-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-58-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-58-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-59-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-59-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-59-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-59-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-60-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-60-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-60-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-60-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-61-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-61-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-61-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-61-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-62-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-62-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-62-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-62-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-63-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-63-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-63-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-63-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-64-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-64-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-64-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-64-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-65-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-65-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-65-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-65-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-66-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-66-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-66-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-66-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-67-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-67-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-67-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-67-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-68-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-68-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-68-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-68-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-69-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-69-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-69-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-69-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-70-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-70-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-70-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-70-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-71-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-71-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-71-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-71-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-72-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-72-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-72-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-72-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-73-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-73-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-73-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-73-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-74-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-74-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-74-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-74-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-75-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-75-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-75-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-75-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-76-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-76-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-76-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-76-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-77-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-77-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-77-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-77-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-78-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-78-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-78-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-78-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-79-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-79-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-79-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-79-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-80-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-80-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-80-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-80-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-81-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-81-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-81-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-81-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-82-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-82-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-82-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-82-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-83-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-83-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-83-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-83-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-84-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-84-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-84-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-84-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-85-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-85-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-85-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-85-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-86-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-86-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-86-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-86-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-87-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-87-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-87-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-87-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-88-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-88-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-88-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-88-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-89-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-89-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-89-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-89-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-90-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-90-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-90-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-90-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-91-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-91-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-91-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-91-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-92-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-92-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-92-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-92-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-93-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-93-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-93-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-93-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-94-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-94-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-94-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-94-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-95-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-95-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-95-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-95-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-96-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-96-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-96-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-96-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-cyrillic-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-cyrillic-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-cyrillic-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-cyrillic-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-ext-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-ext-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-ext-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-latin-ext-700-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-vietnamese-400-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-vietnamese-500-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-vietnamese-600-normal.woff2 +0 -0
- package/dist/fonts/noto-sans-tc-vietnamese-700-normal.woff2 +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { ChartFormat } from "../../internal/chart.js";
|
|
1
2
|
import { StatusBandProps } from "../StatusBand/StatusBand.js";
|
|
2
3
|
import * as React from "react";
|
|
3
4
|
export interface LineSeries {
|
|
5
|
+
/** The series' name: the legend, the tooltip and the data table. */
|
|
4
6
|
name: string;
|
|
5
7
|
/** One value per label; null where there is none (a forecast ahead of the measurements, a gap). */
|
|
6
8
|
values: (number | null)[];
|
|
@@ -19,6 +21,7 @@ export interface LineBand {
|
|
|
19
21
|
label: string;
|
|
20
22
|
}
|
|
21
23
|
export interface LineThreshold {
|
|
24
|
+
/** The level, in the chart's unit. */
|
|
22
25
|
value: number;
|
|
23
26
|
/** Written on the line at the right, e.g. 「上限 29 °C」. */
|
|
24
27
|
label: string;
|
|
@@ -32,11 +35,13 @@ export interface LineChartProps {
|
|
|
32
35
|
labels: string[];
|
|
33
36
|
/** Describes the chart for screen readers. */
|
|
34
37
|
label: string;
|
|
35
|
-
/** After each value in the tooltip. */
|
|
38
|
+
/** After each value in the tooltip, and above the y axis, e.g. 「°C」. */
|
|
36
39
|
unit?: string;
|
|
37
40
|
/** Decimals of the values in the tooltip. Default 0. */
|
|
38
41
|
decimals?: number;
|
|
39
|
-
/**
|
|
42
|
+
/** 'compact': the axis and the tooltip write 40 萬 and 1.5 億 (400K in English) instead of 400,000. Default 'number'. */
|
|
43
|
+
format?: ChartFormat;
|
|
44
|
+
/** Top of the y axis. Default: the first round tick at or above the largest value. */
|
|
40
45
|
max?: number;
|
|
41
46
|
/** Bottom of the y axis. Default 0; set it for values far from 0, such as temperatures. */
|
|
42
47
|
min?: number;
|
|
@@ -58,6 +63,7 @@ export interface LineChartProps {
|
|
|
58
63
|
/** A playhead at this point, for replaying: an accent line with a round handle on the x axis. Dragging (mouse,
|
|
59
64
|
* touch) or ← → Home End on the chart move it. */
|
|
60
65
|
playhead?: number;
|
|
66
|
+
/** The playhead moved (drag, ← → Home End): the new point's index. */
|
|
61
67
|
onPlayheadChange?: (at: number) => void;
|
|
62
68
|
/** A large figure above the chart, e.g. 「省 186 kWh(約 12%)」. */
|
|
63
69
|
headline?: React.ReactNode;
|
|
@@ -68,6 +74,7 @@ export interface LineChartProps {
|
|
|
68
74
|
height?: number;
|
|
69
75
|
/** A status band under the x axis, aligned with the points (StatusBand without its own spacing). */
|
|
70
76
|
status?: Omit<StatusBandProps, 'count' | 'times' | 'legend' | 'className'>;
|
|
77
|
+
/** Extra class on the root element. */
|
|
71
78
|
className?: string;
|
|
72
79
|
}
|
|
73
|
-
export declare function LineChart({ series, labels, label, unit, decimals, max, min, labelEvery, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, height, className }: LineChartProps): React.JSX.Element;
|
|
80
|
+
export declare function LineChart({ series, labels, label, unit, decimals, format: fmt, max, min, labelEvery, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, height, className }: LineChartProps): React.JSX.Element;
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { ChartTip,
|
|
2
|
+
import { ChartTable, ChartTip, axisTicks, chartKey, chartNumber, seriesColor, smoothPath, ticksDecimals, useAxisWidth } from "../../internal/chart.js";
|
|
3
3
|
import { cx, digits } from "../../internal/util.js";
|
|
4
|
-
import { format } from "../../format.js";
|
|
5
4
|
import { tr } from "../../i18n.js";
|
|
6
5
|
import { announce } from "../../announce.js";
|
|
7
6
|
import { StatusBand, StatusLegend } from "../StatusBand/StatusBand.js";
|
|
8
7
|
import * as React from "react";
|
|
9
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
9
|
// src/components/LineChart/LineChart.tsx
|
|
11
|
-
/** Plot geometry in px:
|
|
12
|
-
const L = 40;
|
|
10
|
+
/** Plot geometry in px: the 現在 label above T, the playhead handle below B. The y labels' width is measured. */
|
|
13
11
|
const T = 10;
|
|
14
12
|
const BELOW = 30;
|
|
15
13
|
/** Runs of consecutive points that have values. */
|
|
@@ -28,7 +26,7 @@ function runs(values, X, Y) {
|
|
|
28
26
|
/** A trend over time: smooth lines, 5 grid lines, a guide and tooltip on hover. For monitoring it can also compare a
|
|
29
27
|
* forecast with what happened (band, now, thresholds, marker) and replay with a playhead. */
|
|
30
28
|
const colorOf = (s, i) => s?.color ? seriesColor(s.color - 1) : seriesColor(i);
|
|
31
|
-
function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelEvery = 1, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, height = 240, className }) {
|
|
29
|
+
function LineChart({ series, labels, label, unit, decimals, format: fmt, max, min = 0, labelEvery = 1, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, height = 240, className }) {
|
|
32
30
|
const [hi, setHi] = React.useState(-1);
|
|
33
31
|
const plot = React.useRef(null);
|
|
34
32
|
const [W, setW] = React.useState(640);
|
|
@@ -44,27 +42,34 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
44
42
|
ro.observe(el);
|
|
45
43
|
return () => ro.disconnect();
|
|
46
44
|
}, []);
|
|
45
|
+
const all = series.flatMap((s) => s.values.filter((v) => v != null));
|
|
46
|
+
const ticks = axisTicks(min, Math.max(min + 1, ...all, ...(thresholds ?? []).map((t) => t.value)), {
|
|
47
|
+
top: max,
|
|
48
|
+
dec: decimals
|
|
49
|
+
});
|
|
50
|
+
const top = ticks[ticks.length - 1];
|
|
51
|
+
const tickDec = fmt === "compact" ? void 0 : ticksDecimals(ticks);
|
|
52
|
+
const tickText = ticks.map((v) => chartNumber(v, fmt, tickDec));
|
|
53
|
+
const L = useAxisWidth(plot, tickText, W) + 8;
|
|
47
54
|
const R = W - 10;
|
|
48
55
|
const B = height - BELOW;
|
|
49
56
|
const stripes = "ui-stripes-" + React.useId().replace(/:/g, "");
|
|
50
57
|
const dragging = React.useRef(false);
|
|
51
|
-
const all = series.flatMap((s) => s.values.filter((v) => v != null));
|
|
52
|
-
const top = max ?? niceMax(Math.max(min + 1, ...all, ...(thresholds ?? []).map((t) => t.value)) - min) + min;
|
|
53
58
|
const n = labels.length || series[0]?.values.length || 0;
|
|
54
59
|
const step = (R - L) / Math.max(1, n - 1);
|
|
55
60
|
const X = (i) => L + i * step;
|
|
56
61
|
const Y = (v) => B - (v - min) / (top - min) * (B - T);
|
|
57
|
-
const ticks = TICKS.map((f) => min + f * (top - min));
|
|
58
62
|
const suffix = unit ? " " + unit : "";
|
|
59
|
-
const num = (v) => v == null ? "—" :
|
|
63
|
+
const num = (v) => v == null ? "—" : chartNumber(v, fmt, decimals) + suffix;
|
|
60
64
|
const replay = playhead != null && !!onPlayheadChange;
|
|
61
|
-
const
|
|
65
|
+
const pointText = (j) => (labels[j] ?? "") + tr(":") + series.filter((s) => s.values[j] != null).map((s) => (series.length > 1 ? s.name + " " : "") + num(s.values[j])).join(tr(","));
|
|
66
|
+
const show = (j, say = true) => {
|
|
62
67
|
setHi(j);
|
|
63
|
-
|
|
68
|
+
if (say) announce(pointText(j));
|
|
64
69
|
};
|
|
65
70
|
const move = (j) => {
|
|
66
71
|
if (replay) onPlayheadChange(j);
|
|
67
|
-
show(j);
|
|
72
|
+
show(j, !replay);
|
|
68
73
|
};
|
|
69
74
|
const at = (e) => {
|
|
70
75
|
const r = e.currentTarget.getBoundingClientRect();
|
|
@@ -75,6 +80,7 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
75
80
|
left: (L - step / 2) / W * 100 + "%",
|
|
76
81
|
right: (W - R - step / 2) / W * 100 + "%"
|
|
77
82
|
};
|
|
83
|
+
const xLabelShift = (x) => `translateX(clamp(${-x}px, -50%, calc(${W - x}px - 100%)))`;
|
|
78
84
|
const legend = series.length > 1 || band;
|
|
79
85
|
const widest = Math.max(0, ...labels.map((lb) => lb.length)) * 7.5 + 12;
|
|
80
86
|
const every = Math.max(labelEvery, Math.ceil(n * widest / Math.max(1, R - L) / labelEvery) * labelEvery);
|
|
@@ -130,15 +136,30 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
130
136
|
}
|
|
131
137
|
}), s.name] }, i)), band ? /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", { className: cx("ui-chart-swatch", "is-band", "is-" + band.tone) }), band.label] }) : null]
|
|
132
138
|
}) : null,
|
|
139
|
+
unit ? /* @__PURE__ */ jsx("div", {
|
|
140
|
+
className: "ui-chart-axisunit",
|
|
141
|
+
"aria-hidden": "true",
|
|
142
|
+
children: unit
|
|
143
|
+
}) : null,
|
|
133
144
|
/* @__PURE__ */ jsxs("div", {
|
|
134
145
|
ref: plot,
|
|
135
146
|
className: cx("ui-chart-plot", replay && "is-replay"),
|
|
136
147
|
tabIndex: n ? 0 : void 0,
|
|
137
|
-
|
|
148
|
+
...replay ? {
|
|
149
|
+
role: "slider",
|
|
150
|
+
"aria-valuemin": 0,
|
|
151
|
+
"aria-valuemax": Math.max(0, n - 1),
|
|
152
|
+
"aria-valuenow": playhead,
|
|
153
|
+
"aria-valuetext": pointText(playhead),
|
|
154
|
+
"aria-orientation": "horizontal"
|
|
155
|
+
} : {
|
|
156
|
+
role: "application",
|
|
157
|
+
"aria-roledescription": tr("折線圖")
|
|
158
|
+
},
|
|
138
159
|
"aria-label": label,
|
|
139
160
|
"aria-description": replay ? tr("左右方向鍵移動播放頭") : tr("左右方向鍵查看每一個時間點的數值"),
|
|
140
161
|
onMouseLeave: () => !dragging.current && setHi(-1),
|
|
141
|
-
onFocus: () => hi < 0 && n && show(replay ? playhead : 0),
|
|
162
|
+
onFocus: () => hi < 0 && n && show(replay ? playhead : 0, !replay),
|
|
142
163
|
onBlur: () => setHi(-1),
|
|
143
164
|
onKeyDown: (e) => {
|
|
144
165
|
const to = chartKey(e, replay ? playhead : hi, n);
|
|
@@ -193,11 +214,11 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
193
214
|
y2: Y(v),
|
|
194
215
|
className: i ? "ui-chart-grid" : "ui-chart-axis"
|
|
195
216
|
}), /* @__PURE__ */ jsx("text", {
|
|
196
|
-
x:
|
|
217
|
+
x: L - 8,
|
|
197
218
|
y: Y(v) + 4,
|
|
198
219
|
textAnchor: "end",
|
|
199
220
|
className: "ui-chart-tick",
|
|
200
|
-
children:
|
|
221
|
+
children: tickText[i]
|
|
201
222
|
})] }, i)),
|
|
202
223
|
bandShapes.map((s, i) => /* @__PURE__ */ jsx("path", {
|
|
203
224
|
d: s.d,
|
|
@@ -318,17 +339,28 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
318
339
|
})
|
|
319
340
|
}) : null,
|
|
320
341
|
/* @__PURE__ */ jsx("div", {
|
|
321
|
-
className: "ui-chart-xlabels",
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
342
|
+
className: "ui-chart-xlabels is-placed",
|
|
343
|
+
"aria-hidden": "true",
|
|
344
|
+
children: labels.map((lb, j) => every > 1 && j % every ? null : /* @__PURE__ */ jsx("span", {
|
|
345
|
+
style: {
|
|
346
|
+
left: X(j) / W * 100 + "%",
|
|
347
|
+
transform: xLabelShift(X(j))
|
|
348
|
+
},
|
|
349
|
+
children: digits(lb)
|
|
350
|
+
}, j))
|
|
327
351
|
}),
|
|
328
352
|
status ? /* @__PURE__ */ jsx(StatusLegend, {
|
|
329
353
|
classes: status.classes,
|
|
330
354
|
label: status.label
|
|
331
|
-
}) : null
|
|
355
|
+
}) : null,
|
|
356
|
+
/* @__PURE__ */ jsx(ChartTable, {
|
|
357
|
+
caption: label,
|
|
358
|
+
head: [tr("時間點"), ...series.map((s) => unit ? tr("{name}({unit})", {
|
|
359
|
+
name: s.name,
|
|
360
|
+
unit
|
|
361
|
+
}) : s.name)],
|
|
362
|
+
rows: labels.map((lb, j) => [lb, ...series.map((s) => s.values[j] == null ? "—" : chartNumber(s.values[j], fmt, decimals))])
|
|
363
|
+
})
|
|
332
364
|
]
|
|
333
365
|
});
|
|
334
366
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LineChart.js","names":[],"sources":["../../../src/components/LineChart/LineChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport { ChartTip, TICKS, chartKey, tickDecimals, niceMax, seriesColor, smoothPath, type Point } from '../../internal/chart';\nimport { cx, digits } from '../../internal/util';\nimport { format } from '../../format';\nimport { tr } from '../../i18n';\nimport { announce } from '../../announce';\nimport { StatusBand, StatusLegend, type StatusBandProps } from '../StatusBand/StatusBand';\n\nexport interface LineSeries {\n name: string;\n /** One value per label; null where there is none (a forecast ahead of the measurements, a gap). */\n values: (number | null)[];\n /** A dashed line, e.g. a forecast or a baseline; the legend shows it dashed too. */\n dashed?: boolean;\n /** Which chart color (chart-1 to chart-4) instead of the series' place, e.g. 3 for a forecast, 4 for a baseline. */\n color?: 1 | 2 | 3 | 4;\n}\n\nexport interface LineBand {\n /** The two series (indexes in series) the band fills between, e.g. [0, 1] for actual and forecast. */\n between: [number, number];\n /** `diverge`: orange where the first is above the second, blue where below (diverge-pos / diverge-neg, 30%).\n * `success`: success at 28%, for what was saved between actual use and a baseline. */\n tone: 'diverge' | 'success';\n /** Its entry in the legend, e.g. 「實際偏高/偏低」 or 「省下的電」. */\n label: string;\n}\n\nexport interface LineThreshold {\n value: number;\n /** Written on the line at the right, e.g. 「上限 29 °C」. */\n label: string;\n /** `warning` for a level to watch, `danger` for a limit. */\n tone: 'warning' | 'danger';\n}\n\nexport interface LineChartProps {\n /** Up to 4 series (chart-1 to chart-4); a legend with each name appears for 2 or more. */\n series: LineSeries[];\n /** One label per point on the x axis. */\n labels: string[];\n /** Describes the chart for screen readers. */\n label: string;\n /** After each value in the tooltip. */\n unit?: string;\n /** Decimals of the values in the tooltip. Default 0. */\n decimals?: number;\n /** Top of the y axis. Default: a round number above the largest value. */\n max?: number;\n /** Bottom of the y axis. Default 0; set it for values far from 0, such as temperatures. */\n min?: number;\n /** Show every nth x label when they would crowd. */\n labelEvery?: number;\n /** Fills between two series: the one exception to lines without fills (actual and forecast, use and baseline). */\n band?: LineBand;\n /** The point that is now: a 「現在」 line, and the part after it striped as forecast. */\n now?: number;\n /** Horizontal dashed lines for levels, e.g. a warning level and a limit. */\n thresholds?: LineThreshold[];\n /** One forecast point ahead, e.g. the next round: a hollow circle with its label. Its color is the series'. */\n marker?: { at: number; value: number; label: string; series?: number };\n /** A playhead at this point, for replaying: an accent line with a round handle on the x axis. Dragging (mouse,\n * touch) or ← → Home End on the chart move it. */\n playhead?: number;\n onPlayheadChange?: (at: number) => void;\n /** A large figure above the chart, e.g. 「省 186 kWh(約 12%)」. */\n headline?: React.ReactNode;\n /** Shown in place of the lines when no series has a value. Default 「這段時間沒有資料」. */\n empty?: string;\n /** Height of the plot in px, axes included (x labels, the status band and the legend come on top). Default 240.\n * Text in the chart stays at its own size however wide the chart is. */\n height?: number;\n /** A status band under the x axis, aligned with the points (StatusBand without its own spacing). */\n status?: Omit<StatusBandProps, 'count' | 'times' | 'legend' | 'className'>;\n className?: string;\n}\n\n/** Plot geometry in px: y labels left of L, the 現在 label above T, the playhead handle below B. */\nconst L = 40;\nconst T = 10;\nconst BELOW = 30;\n\n/** Runs of consecutive points that have values. */\nfunction runs(values: (number | null)[], X: (i: number) => number, Y: (v: number) => number): Point[][] {\n const out: Point[][] = [];\n let cur: Point[] = [];\n values.forEach((v, i) => {\n if (v == null || Number.isNaN(v)) {\n if (cur.length) out.push(cur);\n cur = [];\n } else cur.push([X(i), Y(v)]);\n });\n if (cur.length) out.push(cur);\n return out;\n}\n\n/** A trend over time: smooth lines, 5 grid lines, a guide and tooltip on hover. For monitoring it can also compare a\n * forecast with what happened (band, now, thresholds, marker) and replay with a playhead. */\nconst colorOf = (s: LineSeries | undefined, i: number) => (s?.color ? seriesColor(s.color - 1) : seriesColor(i));\n\nexport function LineChart({\n series,\n labels,\n label,\n unit,\n decimals,\n max,\n min = 0,\n labelEvery = 1,\n band,\n now,\n thresholds,\n marker,\n playhead,\n onPlayheadChange,\n headline,\n status,\n empty,\n height = 240,\n className,\n}: LineChartProps) {\n const [hi, setHi] = React.useState(-1);\n const plot = React.useRef<HTMLDivElement>(null);\n const [W, setW] = React.useState(640);\n React.useLayoutEffect(() => {\n const el = plot.current;\n if (!el) return;\n const fit = () => {\n if (el.clientWidth > 0) setW(el.clientWidth);\n };\n fit();\n if (typeof ResizeObserver !== 'function') return;\n const ro = new ResizeObserver(fit);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n const R = W - 10;\n const B = height - BELOW;\n const stripes = 'ui-stripes-' + React.useId().replace(/:/g, '');\n const dragging = React.useRef(false);\n const all = series.flatMap((s) => s.values.filter((v): v is number => v != null));\n const top = max ?? niceMax(Math.max(min + 1, ...all, ...(thresholds ?? []).map((t) => t.value)) - min) + min;\n const n = labels.length || series[0]?.values.length || 0;\n const step = (R - L) / Math.max(1, n - 1);\n const X = (i: number) => L + i * step;\n const Y = (v: number) => B - ((v - min) / (top - min)) * (B - T);\n const ticks = TICKS.map((f) => min + f * (top - min));\n const suffix = unit ? ' ' + unit : '';\n const num = (v: number | null | undefined) => (v == null ? '—' : format.number(v, decimals) + suffix);\n const replay = playhead != null && !!onPlayheadChange;\n const show = (j: number) => {\n setHi(j);\n announce(\n labels[j] +\n tr(':') +\n series\n .filter((s) => s.values[j] != null)\n .map((s) => (series.length > 1 ? s.name + ' ' : '') + num(s.values[j]))\n .join(tr(',')),\n );\n };\n const move = (j: number) => {\n if (replay) onPlayheadChange(j);\n show(j);\n };\n const at = (e: React.PointerEvent<HTMLElement>) => {\n const r = e.currentTarget.getBoundingClientRect();\n const x = ((e.clientX - r.left) / r.width) * W;\n return Math.max(0, Math.min(n - 1, Math.round((x - L) / step)));\n };\n const edge = { left: ((L - step / 2) / W) * 100 + '%', right: ((W - R - step / 2) / W) * 100 + '%' };\n const legend = series.length > 1 || band;\n // Fewer x labels when they would touch: Geist Mono 12 px is about 7.5 px a character, 12 px between labels.\n const widest = Math.max(0, ...labels.map((lb) => lb.length)) * 7.5 + 12;\n const every = Math.max(labelEvery, Math.ceil((n * widest) / Math.max(1, R - L) / labelEvery) * labelEvery);\n // The marker's label goes left of the point when it would run past the right edge (CJK about 14 px a character).\n const markerLeft = marker ? X(marker.at) + 10 + [...marker.label].reduce((w, c) => w + (c.charCodeAt(0) > 0x2e80 ? 14 : 8), 0) > W : false;\n // Band: one quadrilateral per step where both series have values, colored by which one is higher.\n const bandShapes: { d: string; up: boolean }[] = [];\n if (band) {\n const a = series[band.between[0]]?.values ?? [];\n const b = series[band.between[1]]?.values ?? [];\n for (let i = 0; i < n - 1; i++) {\n const a0 = a[i],\n a1 = a[i + 1],\n b0 = b[i],\n b1 = b[i + 1];\n if (a0 == null || a1 == null || b0 == null || b1 == null) continue;\n bandShapes.push({\n d: `M${X(i)},${Y(a0)} L${X(i + 1)},${Y(a1)} L${X(i + 1)},${Y(b1)} L${X(i)},${Y(b0)} Z`,\n up: a0 + a1 >= b0 + b1,\n });\n }\n }\n const tipRows = (j: number) => {\n const rows = series\n .map((s, i) => ({ color: colorOf(series[i], i), name: s.name, value: s.values[j] }))\n .filter((r) => r.value != null)\n .map((r) => ({ ...r, value: num(r.value) }));\n if (band) {\n const a = series[band.between[0]]?.values[j];\n const b = series[band.between[1]]?.values[j];\n if (a != null && b != null) rows.push({ color: '', name: tr('差'), value: (a - b > 0 ? '+' : '') + num(a - b) });\n }\n return rows;\n };\n const shown = hi >= 0 ? hi : -1;\n return (\n <div className={cx('ui-chart', className)}>\n {headline ? <div className=\"ui-chart-headline\">{headline}</div> : null}\n {legend ? (\n <div className=\"ui-chart-legend\">\n {series.map((s, i) => (\n <span key={i}>\n <span\n className={cx('ui-chart-swatch', s.dashed && 'is-dashed')}\n style={{ background: s.dashed ? undefined : colorOf(series[i], i), color: colorOf(series[i], i) }}\n />\n {s.name}\n </span>\n ))}\n {band ? (\n <span>\n <span className={cx('ui-chart-swatch', 'is-band', 'is-' + band.tone)} />\n {band.label}\n </span>\n ) : null}\n </div>\n ) : null}\n <div\n ref={plot}\n className={cx('ui-chart-plot', replay && 'is-replay')}\n tabIndex={n ? 0 : undefined}\n role=\"group\"\n aria-label={label}\n aria-description={replay ? tr('左右方向鍵移動播放頭') : tr('左右方向鍵查看每一個時間點的數值')}\n onMouseLeave={() => !dragging.current && setHi(-1)}\n // The keyboard sees the values too: ← → move between points, each read aloud as it shows.\n onFocus={() => hi < 0 && n && show(replay ? playhead : 0)}\n onBlur={() => setHi(-1)}\n onKeyDown={(e) => {\n const to = chartKey(e, replay ? playhead : hi, n);\n if (to != null) move(to);\n }}\n onPointerDown={\n replay\n ? (e) => {\n if (e.button !== 0) return;\n dragging.current = true;\n try {\n e.currentTarget.setPointerCapture?.(e.pointerId);\n } catch {\n /* a pointer the browser no longer tracks: dragging still works inside the chart */\n }\n move(at(e));\n }\n : undefined\n }\n onPointerMove={\n replay\n ? (e) => {\n if (dragging.current) move(at(e));\n }\n : undefined\n }\n onPointerUp={() => {\n dragging.current = false;\n }}\n onPointerCancel={() => {\n dragging.current = false;\n }}\n >\n {/* The group around it carries the name and the keys. */}\n <svg viewBox={`0 0 ${W} ${height}`} width=\"100%\" height={height} aria-hidden=\"true\">\n {now != null && now < n - 1 ? (\n <>\n {/* After now everything is forecast: the same 45° stripes as ui-forecast (4 px line, 9 px period). */}\n <defs>\n <pattern id={stripes} width=\"9\" height=\"9\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(45)\">\n <rect width=\"4\" height=\"9\" className=\"ui-chart-stripe\" />\n </pattern>\n </defs>\n <rect x={X(now)} y={T} width={R - X(now)} height={B - T} fill={`url(#${stripes})`} />\n </>\n ) : null}\n {ticks.map((v, i) => (\n <g key={i}>\n <line x1={L} x2={R} y1={Y(v)} y2={Y(v)} className={i ? 'ui-chart-grid' : 'ui-chart-axis'} />\n <text x={L - 8} y={Y(v) + 4} textAnchor=\"end\" className=\"ui-chart-tick\">\n {format.number(v, tickDecimals(top - min))}\n </text>\n </g>\n ))}\n {bandShapes.map((s, i) => (\n <path key={i} d={s.d} className={cx('ui-chart-band', band?.tone === 'success' ? 'is-success' : s.up ? 'is-pos' : 'is-neg')} />\n ))}\n {(thresholds ?? []).map((t, i) => (\n <g key={i} className={'ui-chart-threshold is-' + t.tone}>\n <line x1={L} x2={R} y1={Y(t.value)} y2={Y(t.value)} />\n <text x={R - 2} y={Y(t.value) - 5} textAnchor=\"end\">\n {t.label}\n </text>\n </g>\n ))}\n {series.map((s, i) =>\n runs(s.values, X, Y).map((pts, k) => (\n <path\n key={i + '-' + k}\n d={smoothPath(pts)}\n pathLength={s.dashed ? undefined : 1}\n className={cx('ui-chart-line', s.dashed && 'is-dashed')}\n style={{ stroke: colorOf(series[i], i), animationDelay: i * 150 + 'ms' }}\n />\n )),\n )}\n {now != null ? (\n <g className=\"ui-chart-now\">\n <line x1={X(now)} x2={X(now)} y1={T - 4} y2={B} />\n <text x={X(now)} y={T - 8} textAnchor=\"middle\">\n {tr('現在')}\n </text>\n </g>\n ) : null}\n {marker ? (\n <g className=\"ui-chart-marker\">\n <circle\n cx={X(marker.at)}\n cy={Y(marker.value)}\n r={5.5}\n style={{ stroke: colorOf(series[marker.series ?? series.length - 1], marker.series ?? series.length - 1) }}\n />\n <text x={X(marker.at) + (markerLeft ? -10 : 10)} y={Y(marker.value) + 20} textAnchor={markerLeft ? 'end' : 'start'}>\n {marker.label}\n </text>\n </g>\n ) : null}\n {replay ? (\n <g className=\"ui-chart-playhead\">\n <line x1={X(playhead)} x2={X(playhead)} y1={T} y2={B} />\n <circle cx={X(playhead)} cy={B} r={8} />\n </g>\n ) : null}\n </svg>\n <div className=\"ui-chart-hit\" style={{ ...edge, bottom: BELOW }}>\n {labels.map((_, j) => (\n <div key={j} onMouseEnter={() => !dragging.current && setHi(j)} className=\"ui-chart-col\">\n {shown === j ? (\n <>\n <div className=\"ui-chart-guide\" />\n {series.map((s, i) => {\n const v = s.values[j];\n return v == null ? null : (\n <span key={i} className=\"ui-chart-dot\" style={{ top: (Y(v) / B) * 100 + '%', background: colorOf(series[i], i) }} />\n );\n })}\n </>\n ) : null}\n </div>\n ))}\n </div>\n {!all.length ? <div className=\"ui-chart-empty\">{empty ?? tr('這段時間沒有資料')}</div> : null}\n {shown >= 0 ? (\n <ChartTip\n title={labels[shown]}\n style={{ left: (X(shown) / W) * 100 + '%', transform: shown > n * 0.65 ? 'translateX(calc(-100% - 12px))' : 'translateX(12px)' }}\n rows={tipRows(shown)}\n />\n ) : null}\n </div>\n {status ? (\n <div style={{ marginLeft: edge.left, marginRight: edge.right }}>\n <StatusBand {...status} count={n} times={labels} legend={false} className=\"is-attached\" />\n </div>\n ) : null}\n <div className=\"ui-chart-xlabels\" style={{ marginLeft: edge.left, marginRight: edge.right }}>\n {labels.map((lb, j) => (\n <span key={j}>{every > 1 && j % every ? '' : digits(lb)}</span>\n ))}\n </div>\n {status ? <StatusLegend classes={status.classes} label={status.label} /> : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;AA8EA,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,QAAQ;;AAGd,SAAS,KAAK,QAA2B,GAA0B,GAAqC;CACtG,MAAM,MAAiB,CAAC;CACxB,IAAI,MAAe,CAAC;CACpB,OAAO,SAAS,GAAG,MAAM;EACvB,IAAI,KAAK,QAAQ,OAAO,MAAM,CAAC,GAAG;GAChC,IAAI,IAAI,QAAQ,IAAI,KAAK,GAAG;GAC5B,MAAM,CAAC;EACT,OAAO,IAAI,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;CAC9B,CAAC;CACD,IAAI,IAAI,QAAQ,IAAI,KAAK,GAAG;CAC5B,OAAO;AACT;;;AAIA,MAAM,WAAW,GAA2B,MAAe,GAAG,QAAQ,YAAY,EAAE,QAAQ,CAAC,IAAI,YAAY,CAAC;AAE9G,SAAgB,UAAU,EACxB,QACA,QACA,OACA,MACA,UACA,KACA,MAAM,GACN,aAAa,GACb,MACA,KAC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AmB;MAC/H,MAAM,QAAQ,KAAK;KACpB,CAAA,IACC;IACD;;GACJ,SACC,oBAAC,OAAD;IAAK,OAAO;KAAE,YAAY,KAAK;KAAM,aAAa,KAAK;IAAM;IAC3D,UAAA,oBAAC,YAAD;KAAY,GAAI;KAAQ,OAAO;KAAG,OAAO;KAAQ,QAAQ;KAAO,WAAU;IAAe,CAAA;GACtF,CAAA,IACH;GACJ,oBAAC,OAAD;IAAK,WAAU;IAAmB,OAAO;KAAE,YAAY,KAAK;KAAM,aAAa,KAAK;IAAM;IACvF,UAAA,OAAO,KAAK,IAAI,MACf,oBAAC,QAAD,EAAA,UAAe,QAAQ,KAAK,IAAI,QAAQ,KAAK,OAAO,EAAE,EAAQ,GAAnD,CAAmD,CAC/D;GACE,CAAA;GACJ,SAAS,oBAAC,cAAD;IAAc,SAAS,OAAO;IAAS,OAAO,OAAO;GAAQ,CAAA,IAAI;EACxE;;AAET"}
|
|
1
|
+
{"version":3,"file":"LineChart.js","names":[],"sources":["../../../src/components/LineChart/LineChart.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n ChartTable,\n ChartTip,\n axisTicks,\n chartKey,\n chartNumber,\n seriesColor,\n smoothPath,\n ticksDecimals,\n useAxisWidth,\n type ChartFormat,\n type Point,\n} from '../../internal/chart';\nimport { cx, digits } from '../../internal/util';\nimport { tr } from '../../i18n';\nimport { announce } from '../../announce';\nimport { StatusBand, StatusLegend, type StatusBandProps } from '../StatusBand/StatusBand';\n\nexport interface LineSeries {\n /** The series' name: the legend, the tooltip and the data table. */\n name: string;\n /** One value per label; null where there is none (a forecast ahead of the measurements, a gap). */\n values: (number | null)[];\n /** A dashed line, e.g. a forecast or a baseline; the legend shows it dashed too. */\n dashed?: boolean;\n /** Which chart color (chart-1 to chart-4) instead of the series' place, e.g. 3 for a forecast, 4 for a baseline. */\n color?: 1 | 2 | 3 | 4;\n}\n\nexport interface LineBand {\n /** The two series (indexes in series) the band fills between, e.g. [0, 1] for actual and forecast. */\n between: [number, number];\n /** `diverge`: orange where the first is above the second, blue where below (diverge-pos / diverge-neg, 30%).\n * `success`: success at 28%, for what was saved between actual use and a baseline. */\n tone: 'diverge' | 'success';\n /** Its entry in the legend, e.g. 「實際偏高/偏低」 or 「省下的電」. */\n label: string;\n}\n\nexport interface LineThreshold {\n /** The level, in the chart's unit. */\n value: number;\n /** Written on the line at the right, e.g. 「上限 29 °C」. */\n label: string;\n /** `warning` for a level to watch, `danger` for a limit. */\n tone: 'warning' | 'danger';\n}\n\nexport interface LineChartProps {\n /** Up to 4 series (chart-1 to chart-4); a legend with each name appears for 2 or more. */\n series: LineSeries[];\n /** One label per point on the x axis. */\n labels: string[];\n /** Describes the chart for screen readers. */\n label: string;\n /** After each value in the tooltip, and above the y axis, e.g. 「°C」. */\n unit?: string;\n /** Decimals of the values in the tooltip. Default 0. */\n decimals?: number;\n /** 'compact': the axis and the tooltip write 40 萬 and 1.5 億 (400K in English) instead of 400,000. Default 'number'. */\n format?: ChartFormat;\n /** Top of the y axis. Default: the first round tick at or above the largest value. */\n max?: number;\n /** Bottom of the y axis. Default 0; set it for values far from 0, such as temperatures. */\n min?: number;\n /** Show every nth x label when they would crowd. */\n labelEvery?: number;\n /** Fills between two series: the one exception to lines without fills (actual and forecast, use and baseline). */\n band?: LineBand;\n /** The point that is now: a 「現在」 line, and the part after it striped as forecast. */\n now?: number;\n /** Horizontal dashed lines for levels, e.g. a warning level and a limit. */\n thresholds?: LineThreshold[];\n /** One forecast point ahead, e.g. the next round: a hollow circle with its label. Its color is the series'. */\n marker?: { at: number; value: number; label: string; series?: number };\n /** A playhead at this point, for replaying: an accent line with a round handle on the x axis. Dragging (mouse,\n * touch) or ← → Home End on the chart move it. */\n playhead?: number;\n /** The playhead moved (drag, ← → Home End): the new point's index. */\n onPlayheadChange?: (at: number) => void;\n /** A large figure above the chart, e.g. 「省 186 kWh(約 12%)」. */\n headline?: React.ReactNode;\n /** Shown in place of the lines when no series has a value. Default 「這段時間沒有資料」. */\n empty?: string;\n /** Height of the plot in px, axes included (x labels, the status band and the legend come on top). Default 240.\n * Text in the chart stays at its own size however wide the chart is. */\n height?: number;\n /** A status band under the x axis, aligned with the points (StatusBand without its own spacing). */\n status?: Omit<StatusBandProps, 'count' | 'times' | 'legend' | 'className'>;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** Plot geometry in px: the 現在 label above T, the playhead handle below B. The y labels' width is measured. */\nconst T = 10;\nconst BELOW = 30;\n\n/** Runs of consecutive points that have values. */\nfunction runs(values: (number | null)[], X: (i: number) => number, Y: (v: number) => number): Point[][] {\n const out: Point[][] = [];\n let cur: Point[] = [];\n values.forEach((v, i) => {\n if (v == null || Number.isNaN(v)) {\n if (cur.length) out.push(cur);\n cur = [];\n } else cur.push([X(i), Y(v)]);\n });\n if (cur.length) out.push(cur);\n return out;\n}\n\n/** A trend over time: smooth lines, 5 grid lines, a guide and tooltip on hover. For monitoring it can also compare a\n * forecast with what happened (band, now, thresholds, marker) and replay with a playhead. */\nconst colorOf = (s: LineSeries | undefined, i: number) => (s?.color ? seriesColor(s.color - 1) : seriesColor(i));\n\nexport function LineChart({\n series,\n labels,\n label,\n unit,\n decimals,\n format: fmt,\n max,\n min = 0,\n labelEvery = 1,\n band,\n now,\n thresholds,\n marker,\n playhead,\n onPlayheadChange,\n headline,\n status,\n empty,\n height = 240,\n className,\n}: LineChartProps) {\n const [hi, setHi] = React.useState(-1);\n const plot = React.useRef<HTMLDivElement>(null);\n const [W, setW] = React.useState(640);\n React.useLayoutEffect(() => {\n const el = plot.current;\n if (!el) return;\n const fit = () => {\n if (el.clientWidth > 0) setW(el.clientWidth);\n };\n fit();\n if (typeof ResizeObserver !== 'function') return;\n const ro = new ResizeObserver(fit);\n ro.observe(el);\n return () => ro.disconnect();\n }, []);\n const all = series.flatMap((s) => s.values.filter((v): v is number => v != null));\n const ticks = axisTicks(min, Math.max(min + 1, ...all, ...(thresholds ?? []).map((t) => t.value)), { top: max, dec: decimals });\n const top = ticks[ticks.length - 1];\n const tickDec = fmt === 'compact' ? undefined : ticksDecimals(ticks);\n const tickText = ticks.map((v) => chartNumber(v, fmt, tickDec));\n // The y labels' own width (measured): 「400,000」 or 「40 萬」 never touches the card's edge.\n const L = useAxisWidth(plot, tickText, W) + 8;\n const R = W - 10;\n const B = height - BELOW;\n const stripes = 'ui-stripes-' + React.useId().replace(/:/g, '');\n const dragging = React.useRef(false);\n const n = labels.length || series[0]?.values.length || 0;\n const step = (R - L) / Math.max(1, n - 1);\n const X = (i: number) => L + i * step;\n const Y = (v: number) => B - ((v - min) / (top - min)) * (B - T);\n const suffix = unit ? ' ' + unit : '';\n const num = (v: number | null | undefined) => (v == null ? '—' : chartNumber(v, fmt, decimals) + suffix);\n const replay = playhead != null && !!onPlayheadChange;\n // 「13:30:實際 25.5 °C,預測 26 °C」: the point's time and every series' value there.\n const pointText = (j: number) =>\n (labels[j] ?? '') +\n tr(':') +\n series\n .filter((s) => s.values[j] != null)\n .map((s) => (series.length > 1 ? s.name + ' ' : '') + num(s.values[j]))\n .join(tr(','));\n const show = (j: number, say = true) => {\n setHi(j);\n if (say) announce(pointText(j));\n };\n // A slider says its own value (aria-valuetext) when it changes: no live-region message on top of it.\n const move = (j: number) => {\n if (replay) onPlayheadChange(j);\n show(j, !replay);\n };\n const at = (e: React.PointerEvent<HTMLElement>) => {\n const r = e.currentTarget.getBoundingClientRect();\n const x = ((e.clientX - r.left) / r.width) * W;\n return Math.max(0, Math.min(n - 1, Math.round((x - L) / step)));\n };\n const edge = { left: ((L - step / 2) / W) * 100 + '%', right: ((W - R - step / 2) / W) * 100 + '%' };\n // An x label centred under its point, moved inside when it would run past the chart's left or right edge.\n const xLabelShift = (x: number) => `translateX(clamp(${-x}px, -50%, calc(${W - x}px - 100%)))`;\n const legend = series.length > 1 || band;\n // Fewer x labels when they would touch: Geist Mono 12 px is about 7.5 px a character, 12 px between labels.\n const widest = Math.max(0, ...labels.map((lb) => lb.length)) * 7.5 + 12;\n const every = Math.max(labelEvery, Math.ceil((n * widest) / Math.max(1, R - L) / labelEvery) * labelEvery);\n // The marker's label goes left of the point when it would run past the right edge (CJK about 14 px a character).\n const markerLeft = marker ? X(marker.at) + 10 + [...marker.label].reduce((w, c) => w + (c.charCodeAt(0) > 0x2e80 ? 14 : 8), 0) > W : false;\n // Band: one quadrilateral per step where both series have values, colored by which one is higher.\n const bandShapes: { d: string; up: boolean }[] = [];\n if (band) {\n const a = series[band.between[0]]?.values ?? [];\n const b = series[band.between[1]]?.values ?? [];\n for (let i = 0; i < n - 1; i++) {\n const a0 = a[i],\n a1 = a[i + 1],\n b0 = b[i],\n b1 = b[i + 1];\n if (a0 == null || a1 == null || b0 == null || b1 == null) continue;\n bandShapes.push({\n d: `M${X(i)},${Y(a0)} L${X(i + 1)},${Y(a1)} L${X(i + 1)},${Y(b1)} L${X(i)},${Y(b0)} Z`,\n up: a0 + a1 >= b0 + b1,\n });\n }\n }\n const tipRows = (j: number) => {\n const rows = series\n .map((s, i) => ({ color: colorOf(series[i], i), name: s.name, value: s.values[j] }))\n .filter((r) => r.value != null)\n .map((r) => ({ ...r, value: num(r.value) }));\n if (band) {\n const a = series[band.between[0]]?.values[j];\n const b = series[band.between[1]]?.values[j];\n if (a != null && b != null) rows.push({ color: '', name: tr('差'), value: (a - b > 0 ? '+' : '') + num(a - b) });\n }\n return rows;\n };\n const shown = hi >= 0 ? hi : -1;\n return (\n <div className={cx('ui-chart', className)}>\n {headline ? <div className=\"ui-chart-headline\">{headline}</div> : null}\n {legend ? (\n <div className=\"ui-chart-legend\">\n {series.map((s, i) => (\n <span key={i}>\n <span\n className={cx('ui-chart-swatch', s.dashed && 'is-dashed')}\n style={{ background: s.dashed ? undefined : colorOf(series[i], i), color: colorOf(series[i], i) }}\n />\n {s.name}\n </span>\n ))}\n {band ? (\n <span>\n <span className={cx('ui-chart-swatch', 'is-band', 'is-' + band.tone)} />\n {band.label}\n </span>\n ) : null}\n </div>\n ) : null}\n {unit ? (\n <div className=\"ui-chart-axisunit\" aria-hidden=\"true\">\n {unit}\n </div>\n ) : null}\n <div\n ref={plot}\n className={cx('ui-chart-plot', replay && 'is-replay')}\n tabIndex={n ? 0 : undefined}\n // Replay: a slider over the points (its value read as 「時間:數值」). Reading points: an application, so screen\n // readers pass the arrow keys on; the values are also in the data table after the chart.\n {...(replay\n ? {\n role: 'slider',\n 'aria-valuemin': 0,\n 'aria-valuemax': Math.max(0, n - 1),\n 'aria-valuenow': playhead,\n 'aria-valuetext': pointText(playhead),\n 'aria-orientation': 'horizontal' as const,\n }\n : { role: 'application', 'aria-roledescription': tr('折線圖') })}\n aria-label={label}\n aria-description={replay ? tr('左右方向鍵移動播放頭') : tr('左右方向鍵查看每一個時間點的數值')}\n onMouseLeave={() => !dragging.current && setHi(-1)}\n // The keyboard sees the values too: ← → move between points, each read aloud as it shows.\n onFocus={() => hi < 0 && n && show(replay ? playhead : 0, !replay)}\n onBlur={() => setHi(-1)}\n onKeyDown={(e) => {\n const to = chartKey(e, replay ? playhead : hi, n);\n if (to != null) move(to);\n }}\n onPointerDown={\n replay\n ? (e) => {\n if (e.button !== 0) return;\n dragging.current = true;\n try {\n e.currentTarget.setPointerCapture?.(e.pointerId);\n } catch {\n /* a pointer the browser no longer tracks: dragging still works inside the chart */\n }\n move(at(e));\n }\n : undefined\n }\n onPointerMove={\n replay\n ? (e) => {\n if (dragging.current) move(at(e));\n }\n : undefined\n }\n onPointerUp={() => {\n dragging.current = false;\n }}\n onPointerCancel={() => {\n dragging.current = false;\n }}\n >\n {/* The group around it carries the name and the keys. */}\n <svg viewBox={`0 0 ${W} ${height}`} width=\"100%\" height={height} aria-hidden=\"true\">\n {now != null && now < n - 1 ? (\n <>\n {/* After now everything is forecast: the same 45° stripes as ui-forecast (4 px line, 9 px period). */}\n <defs>\n <pattern id={stripes} width=\"9\" height=\"9\" patternUnits=\"userSpaceOnUse\" patternTransform=\"rotate(45)\">\n <rect width=\"4\" height=\"9\" className=\"ui-chart-stripe\" />\n </pattern>\n </defs>\n <rect x={X(now)} y={T} width={R - X(now)} height={B - T} fill={`url(#${stripes})`} />\n </>\n ) : null}\n {ticks.map((v, i) => (\n <g key={i}>\n <line x1={L} x2={R} y1={Y(v)} y2={Y(v)} className={i ? 'ui-chart-grid' : 'ui-chart-axis'} />\n <text x={L - 8} y={Y(v) + 4} textAnchor=\"end\" className=\"ui-chart-tick\">\n {tickText[i]}\n </text>\n </g>\n ))}\n {bandShapes.map((s, i) => (\n <path key={i} d={s.d} className={cx('ui-chart-band', band?.tone === 'success' ? 'is-success' : s.up ? 'is-pos' : 'is-neg')} />\n ))}\n {(thresholds ?? []).map((t, i) => (\n <g key={i} className={'ui-chart-threshold is-' + t.tone}>\n <line x1={L} x2={R} y1={Y(t.value)} y2={Y(t.value)} />\n <text x={R - 2} y={Y(t.value) - 5} textAnchor=\"end\">\n {t.label}\n </text>\n </g>\n ))}\n {series.map((s, i) =>\n runs(s.values, X, Y).map((pts, k) => (\n <path\n key={i + '-' + k}\n d={smoothPath(pts)}\n pathLength={s.dashed ? undefined : 1}\n className={cx('ui-chart-line', s.dashed && 'is-dashed')}\n style={{ stroke: colorOf(series[i], i), animationDelay: i * 150 + 'ms' }}\n />\n )),\n )}\n {now != null ? (\n <g className=\"ui-chart-now\">\n <line x1={X(now)} x2={X(now)} y1={T - 4} y2={B} />\n <text x={X(now)} y={T - 8} textAnchor=\"middle\">\n {tr('現在')}\n </text>\n </g>\n ) : null}\n {marker ? (\n <g className=\"ui-chart-marker\">\n <circle\n cx={X(marker.at)}\n cy={Y(marker.value)}\n r={5.5}\n style={{ stroke: colorOf(series[marker.series ?? series.length - 1], marker.series ?? series.length - 1) }}\n />\n <text x={X(marker.at) + (markerLeft ? -10 : 10)} y={Y(marker.value) + 20} textAnchor={markerLeft ? 'end' : 'start'}>\n {marker.label}\n </text>\n </g>\n ) : null}\n {replay ? (\n <g className=\"ui-chart-playhead\">\n <line x1={X(playhead)} x2={X(playhead)} y1={T} y2={B} />\n <circle cx={X(playhead)} cy={B} r={8} />\n </g>\n ) : null}\n </svg>\n <div className=\"ui-chart-hit\" style={{ ...edge, bottom: BELOW }}>\n {labels.map((_, j) => (\n <div key={j} onMouseEnter={() => !dragging.current && setHi(j)} className=\"ui-chart-col\">\n {shown === j ? (\n <>\n <div className=\"ui-chart-guide\" />\n {series.map((s, i) => {\n const v = s.values[j];\n return v == null ? null : (\n <span key={i} className=\"ui-chart-dot\" style={{ top: (Y(v) / B) * 100 + '%', background: colorOf(series[i], i) }} />\n );\n })}\n </>\n ) : null}\n </div>\n ))}\n </div>\n {!all.length ? <div className=\"ui-chart-empty\">{empty ?? tr('這段時間沒有資料')}</div> : null}\n {shown >= 0 ? (\n <ChartTip\n title={labels[shown]}\n style={{ left: (X(shown) / W) * 100 + '%', transform: shown > n * 0.65 ? 'translateX(calc(-100% - 12px))' : 'translateX(12px)' }}\n rows={tipRows(shown)}\n />\n ) : null}\n </div>\n {status ? (\n <div style={{ marginLeft: edge.left, marginRight: edge.right }}>\n <StatusBand {...status} count={n} times={labels} legend={false} className=\"is-attached\" />\n </div>\n ) : null}\n <div className=\"ui-chart-xlabels is-placed\" aria-hidden=\"true\">\n {labels.map((lb, j) =>\n every > 1 && j % every ? null : (\n <span key={j} style={{ left: (X(j) / W) * 100 + '%', transform: xLabelShift(X(j)) }}>\n {digits(lb)}\n </span>\n ),\n )}\n </div>\n {status ? <StatusLegend classes={status.classes} label={status.label} /> : null}\n <ChartTable\n caption={label}\n head={[tr('時間點'), ...series.map((s) => (unit ? tr('{name}({unit})', { name: s.name, unit }) : s.name))]}\n rows={labels.map((lb, j) => [lb, ...series.map((s) => (s.values[j] == null ? '—' : chartNumber(s.values[j] as number, fmt, decimals)))])}\n />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AA+FA,MAAM,IAAI;AACV,MAAM,QAAQ;;AAGd,SAAS,KAAK,QAA2B,GAA0B,GAAqC;CACtG,MAAM,MAAiB,CAAC;CACxB,IAAI,MAAe,CAAC;CACpB,OAAO,SAAS,GAAG,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AU;IAAe,CAAA;GACtF,CAAA,IACH;GACJ,oBAAC,OAAD;IAAK,WAAU;IAA6B,eAAY;IACrD,UAAA,OAAO,KAAK,IAAI,MACf,QAAQ,KAAK,IAAI,QAAQ,OACvB,oBAAC,QAAD;KAAc,OAAO;MAAE,MAAO,EAAE,CAAC,IAAI,IAAK,MAAM;MAAK,WAAW,YAAY,EAAE,CAAC,CAAC;KAAE;KAC/E,UAAA,OAAO,EAAE;IACN,GAFK,CAEL,CAEV;GACG,CAAA;GACJ,SAAS,oBAAC,cAAD;IAAc,SAAS,OAAO;IAAS,OAAO,OAAO;GAAQ,CAAA,IAAI;GAC3E,oBAAC,YAAD;IACE,SAAS;IACT,MAAM,CAAC,GAAG,KAAK,GAAG,GAAG,OAAO,KAAK,MAAO,OAAO,GAAG,kBAAkB;KAAE,MAAM,EAAE;KAAM;IAAK,CAAC,IAAI,EAAE,IAAK,CAAC;IACtG,MAAM,OAAO,KAAK,IAAI,MAAM,CAAC,IAAI,GAAG,OAAO,KAAK,MAAO,EAAE,OAAO,MAAM,OAAO,MAAM,YAAY,EAAE,OAAO,IAAc,KAAK,QAAQ,CAAE,CAAC,CAAC;GACxI,CAAA;EACE;;AAET"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'target'> {
|
|
3
|
+
/** Where it goes. With `render`, give the address to the router link instead. */
|
|
4
|
+
href?: string;
|
|
5
|
+
/** Another site: opens in a new tab, with an arrow icon and 「在新分頁開啟」 read aloud. */
|
|
6
|
+
external?: boolean;
|
|
7
|
+
/** A router's link to render instead of `<a>`, e.g. `<NextLink href="/orders" />`: it gets the class, the text
|
|
8
|
+
* and the other props. */
|
|
9
|
+
render?: React.ReactElement<Record<string, unknown>>;
|
|
10
|
+
/** The link text: say where it goes (「查看訂單」), not 「點這裡」. */
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/** Ref to the anchor. */
|
|
13
|
+
ref?: React.Ref<HTMLAnchorElement>;
|
|
14
|
+
}
|
|
15
|
+
/** A text link: accent text, underlined, the focus outline. A router link goes in `render`; an action that does not
|
|
16
|
+
* go anywhere is a Button variant="quiet". */
|
|
17
|
+
export declare function Link({ href, external, render, className, children, ...rest }: LinkProps): React.JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { tr } from "../../i18n.js";
|
|
3
|
+
import { Icon } from "../../icons/Icon.js";
|
|
4
|
+
import { cx } from "../../internal/util.js";
|
|
5
|
+
import { devWarn } from "../../internal/dev.js";
|
|
6
|
+
import { includeIcons } from "../../icons/store.js";
|
|
7
|
+
import arrow_square_out_default from "../../icons/ph/arrow-square-out.js";
|
|
8
|
+
import * as React from "react";
|
|
9
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
// src/components/Link/Link.tsx
|
|
11
|
+
includeIcons(arrow_square_out_default);
|
|
12
|
+
/** A text link: accent text, underlined, the focus outline. A router link goes in `render`; an action that does not
|
|
13
|
+
* go anywhere is a Button variant="quiet". */
|
|
14
|
+
function Link({ href, external, render, className, children, ...rest }) {
|
|
15
|
+
devWarn(!href && !render, "Link", "a Link without `href` or `render` goes nowhere. Give it `href`, a router link in `render`, or use Button variant=\"quiet\" for an action.");
|
|
16
|
+
const props = {
|
|
17
|
+
...rest,
|
|
18
|
+
className: cx("ui-textlink", external && "is-external", className),
|
|
19
|
+
...href !== void 0 ? { href } : null,
|
|
20
|
+
...external ? {
|
|
21
|
+
target: "_blank",
|
|
22
|
+
rel: rest.rel ?? "noopener noreferrer"
|
|
23
|
+
} : null
|
|
24
|
+
};
|
|
25
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [children, external ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Icon, {
|
|
26
|
+
name: "arrow-square-out",
|
|
27
|
+
size: 16,
|
|
28
|
+
className: "ui-textlink-icon"
|
|
29
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "ui-visually-hidden",
|
|
31
|
+
children: tr("(在新分頁開啟)")
|
|
32
|
+
})] }) : null] });
|
|
33
|
+
if (render) {
|
|
34
|
+
const own = render.props;
|
|
35
|
+
return React.cloneElement(render, {
|
|
36
|
+
...props,
|
|
37
|
+
className: cx(props.className, own.className)
|
|
38
|
+
}, content);
|
|
39
|
+
}
|
|
40
|
+
return /* @__PURE__ */ jsx("a", {
|
|
41
|
+
...props,
|
|
42
|
+
children: content
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
export { Link };
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=Link.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Link.js","names":["phArrowSquareOut"],"sources":["../../../src/components/Link/Link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { tr } from '../../i18n';\nimport { Icon } from '../../icons/Icon';\nimport { cx } from '../../internal/util';\nimport { devWarn } from '../../internal/dev';\nimport { includeIcons } from '../../icons/store';\nimport phArrowSquareOut from '../../icons/ph/arrow-square-out';\n\nincludeIcons(phArrowSquareOut);\n\nexport interface LinkProps extends Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'target'> {\n /** Where it goes. With `render`, give the address to the router link instead. */\n href?: string;\n /** Another site: opens in a new tab, with an arrow icon and 「在新分頁開啟」 read aloud. */\n external?: boolean;\n /** A router's link to render instead of `<a>`, e.g. `<NextLink href=\"/orders\" />`: it gets the class, the text\n * and the other props. */\n render?: React.ReactElement<Record<string, unknown>>;\n /** The link text: say where it goes (「查看訂單」), not 「點這裡」. */\n children: React.ReactNode;\n /** Ref to the anchor. */\n ref?: React.Ref<HTMLAnchorElement>;\n}\n\n/** A text link: accent text, underlined, the focus outline. A router link goes in `render`; an action that does not\n * go anywhere is a Button variant=\"quiet\". */\nexport function Link({ href, external, render, className, children, ...rest }: LinkProps) {\n devWarn(\n !href && !render,\n 'Link',\n 'a Link without `href` or `render` goes nowhere. Give it `href`, a router link in `render`, or use Button variant=\"quiet\" for an action.',\n );\n const props: Record<string, unknown> = {\n ...rest,\n className: cx('ui-textlink', external && 'is-external', className),\n ...(href !== undefined ? { href } : null),\n ...(external ? { target: '_blank', rel: rest.rel ?? 'noopener noreferrer' } : null),\n };\n const content = (\n <>\n {children}\n {external ? (\n <>\n <Icon name=\"arrow-square-out\" size={16} className=\"ui-textlink-icon\" />\n <span className=\"ui-visually-hidden\">{tr('(在新分頁開啟)')}</span>\n </>\n ) : null}\n </>\n );\n if (render) {\n const own = render.props;\n return React.cloneElement(render, { ...props, className: cx(props.className as string, own.className as string | undefined) }, content);\n }\n return <a {...props}>{content}</a>;\n}\n"],"mappings":";;;;;;;;;;AAQA,aAAaA,wBAAgB;;;AAkB7B,SAAgB,KAAK,EAAE,MAAM,UAAU,QAAQ,WAAW,UAAU,GAAG,QAAmB;CACxF,QACE,CAAC,QAAQ,CAAC,QACV,QACA,2IACF;CACA,MAAM,QAAiC;EACrC,GAAG;EACH,WAAW,GAAG,eAAe,YAAY,eAAe,SAAS;EACjE,GAAI,SAAS,KAAA,IAAY,EAAE,KAAK,IAAI;EACpC,GAAI,WAAW;GAAE,QAAQ;GAAU,KAAK,KAAK,OAAO;EAAsB,IAAI;CAChF;CACA,MAAM,UACJ,qBAAA,UAAA,EAAA,UAAA,CACG,UACA,WACC,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,MAAD;EAAM,MAAK;EAAmB,MAAM;EAAI,WAAU;CAAoB,CAAA,GACtE,oBAAC,QAAD;EAAM,WAAU;EAAsB,UAAA,GAAG,UAAU;CAAQ,CAAA,CAC3D,EAAA,CAAA,IACA,IACJ,EAAA,CAAA;CAEJ,IAAI,QAAQ;EACV,MAAM,MAAM,OAAO;EACnB,OAAO,MAAM,aAAa,QAAQ;GAAE,GAAG;GAAO,WAAW,GAAG,MAAM,WAAqB,IAAI,SAA+B;EAAE,GAAG,OAAO;CACxI;CACA,OAAO,oBAAC,KAAD;EAAG,GAAI;EAAQ,UAAA;CAAW,CAAA;AACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LoadingBar.js","names":[],"sources":["../../../src/components/LoadingBar/LoadingBar.tsx"],"sourcesContent":["import { tr } from '../../i18n';\nimport { cx } from '../../internal/util';\n\nexport interface LoadingBarProps {\n /** Announced to screen readers. Default 「載入中」. */\n label?: string;\n className?: string;\n}\n\n/** Loading with no known end: a drop moving along a thin bar. */\nexport function LoadingBar({ label, className }: LoadingBarProps) {\n return (\n <div className={cx('ui-loading', className)} role=\"progressbar\" aria-label={label || tr('載入中')} aria-busy=\"true\">\n <div className=\"ui-loading-drop\" />\n </div>\n );\n}\n"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"LoadingBar.js","names":[],"sources":["../../../src/components/LoadingBar/LoadingBar.tsx"],"sourcesContent":["import { tr } from '../../i18n';\nimport { cx } from '../../internal/util';\n\nexport interface LoadingBarProps {\n /** Announced to screen readers. Default 「載入中」. */\n label?: string;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** Loading with no known end: a drop moving along a thin bar. */\nexport function LoadingBar({ label, className }: LoadingBarProps) {\n return (\n <div className={cx('ui-loading', className)} role=\"progressbar\" aria-label={label || tr('載入中')} aria-busy=\"true\">\n <div className=\"ui-loading-drop\" />\n </div>\n );\n}\n"],"mappings":";;;;;;AAWA,SAAgB,WAAW,EAAE,OAAO,aAA8B;CAChE,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,cAAc,SAAS;EAAG,MAAK;EAAc,cAAY,SAAS,GAAG,KAAK;EAAG,aAAU;EACxG,UAAA,oBAAC,OAAD,EAAK,WAAU,kBAAmB,CAAA;CAC/B,CAAA;AAET"}
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
export interface LoginCardProps {
|
|
3
|
-
/**
|
|
3
|
+
/** The product's mark (an <svg> or <img>, 32 px tall) beside the brand name. */
|
|
4
|
+
logo?: React.ReactNode;
|
|
5
|
+
/** Product name above the title. */
|
|
4
6
|
brand?: React.ReactNode;
|
|
5
7
|
/** Default 「登入」. */
|
|
6
8
|
title?: string;
|
|
9
|
+
/** Receives the account and password when both are filled. */
|
|
7
10
|
onSubmit: (v: {
|
|
8
11
|
account: string;
|
|
9
12
|
password: string;
|
|
10
13
|
}) => void;
|
|
11
|
-
/** Errors from your sign-in check, shown under each field: the cause and the fix; `backticks` are code.
|
|
14
|
+
/** Errors from your sign-in check, shown under each field: the cause and the fix; `backticks` are code. Focus moves to
|
|
15
|
+
* the first field with an error when it arrives. */
|
|
12
16
|
error?: {
|
|
13
17
|
account?: string;
|
|
14
18
|
password?: string;
|
|
15
19
|
} | null;
|
|
16
20
|
/** Adds 「忘記密碼」 beside the password label. */
|
|
17
21
|
forgotHref?: string;
|
|
22
|
+
/** The sign-in is running: the button shows a spinner and ignores presses, keeping focus. */
|
|
18
23
|
loading?: boolean;
|
|
24
|
+
/** Extra class on the root element. */
|
|
19
25
|
className?: string;
|
|
20
26
|
}
|
|
21
|
-
/** A centered sign-in
|
|
27
|
+
/** A centered sign-in page: account, password with show-password, 「忘記密碼」 beside the password label, errors under each
|
|
22
28
|
* field. Pass error = { account, password } from your sign-in check. */
|
|
23
29
|
export declare function LoginCard(p: LoginCardProps): React.JSX.Element;
|