@seanyeh77/ui 0.43.1 → 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 +6 -3
- package/dist/components/Alert/Alert.js +18 -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 +3 -2
- package/dist/components/DangerZone/DangerZone.js +3 -2
- package/dist/components/DangerZone/DangerZone.js.map +1 -1
- package/dist/components/DataTable/DataTable.d.ts +16 -4
- package/dist/components/DataTable/DataTable.js +346 -208
- 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 +9 -7
- 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 +46 -14
- package/dist/components/Dialog/Dialog.js.map +1 -1
- package/dist/components/Drawer/Drawer.d.ts +18 -5
- package/dist/components/Drawer/Drawer.js +87 -24
- package/dist/components/Drawer/Drawer.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +2 -2
- package/dist/components/EmptyState/EmptyState.js +3 -2
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/ErrorPage/ErrorPage.d.ts +4 -0
- package/dist/components/ErrorPage/ErrorPage.js +2 -1
- package/dist/components/ErrorPage/ErrorPage.js.map +1 -1
- package/dist/components/EventTimeline/EventTimeline.d.ts +23 -5
- package/dist/components/EventTimeline/EventTimeline.js +64 -20
- package/dist/components/EventTimeline/EventTimeline.js.map +1 -1
- package/dist/components/FileUpload/FileUpload.d.ts +10 -2
- package/dist/components/FileUpload/FileUpload.js +5 -2
- 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 +10 -6
- package/dist/components/InlineCode/InlineCode.js.map +1 -1
- package/dist/components/KpiCard/KpiCard.d.ts +7 -3
- package/dist/components/KpiCard/KpiCard.js +40 -25
- package/dist/components/KpiCard/KpiCard.js.map +1 -1
- package/dist/components/LayerGraph/LayerGraph.d.ts +68 -23
- package/dist/components/LayerGraph/LayerGraph.js +178 -97
- 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 +20 -2
- 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 +4 -0
- package/dist/components/NotificationBell/NotificationBell.js +4 -3
- 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 +33 -4
- package/dist/components/SettingsLayout/SettingsLayout.js +62 -14
- 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 +8 -1
- package/dist/components/Tabs/Tabs.js +6 -3
- 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 -9
- package/dist/components/TextArea/TextArea.js +25 -12
- 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 +56 -3
- package/dist/components/Toast/Toast.js +191 -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 +8 -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 +6 -1
- package/dist/css/Card.css +8 -8
- package/dist/css/Checkbox.css +20 -0
- package/dist/css/CodeView.css +3 -2
- package/dist/css/DangerZone.css +5 -3
- package/dist/css/DataTable.css +303 -69
- package/dist/css/DatePicker.css +1 -0
- package/dist/css/DateRangePicker.css +24 -2
- package/dist/css/Drawer.css +31 -0
- package/dist/css/EmptyState.css +1 -0
- package/dist/css/ErrorPage.css +4 -1
- package/dist/css/EventTimeline.css +34 -5
- package/dist/css/FileUpload.css +1 -0
- 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 +13 -1
- package/dist/css/LayerGraph.css +40 -15
- package/dist/css/Link.css +23 -0
- package/dist/css/LoginCard.css +17 -11
- package/dist/css/Markdown.css +31 -2
- package/dist/css/Menu.css +0 -2
- package/dist/css/Meter.css +16 -0
- package/dist/css/MultiSelect.css +1 -0
- package/dist/css/NotificationBell.css +1 -0
- package/dist/css/PageHeader.css +50 -0
- package/dist/css/ProgressBar.css +12 -0
- package/dist/css/ProjectSwitcher.css +25 -23
- package/dist/css/RelativeTime.css +2 -0
- package/dist/css/SegmentedControl.css +38 -10
- package/dist/css/Select.css +1 -0
- package/dist/css/SettingsLayout.css +29 -8
- package/dist/css/SideNav.css +4 -1
- package/dist/css/Skeleton.css +22 -1
- package/dist/css/Suggestion.css +1 -1
- package/dist/css/Switch.css +27 -0
- package/dist/css/Tabs.css +8 -7
- package/dist/css/Tag.css +19 -12
- package/dist/css/Term.css +1 -1
- package/dist/css/TextArea.css +1 -0
- package/dist/css/TextField.css +1 -0
- package/dist/css/Toast.css +101 -4
- package/dist/css/TopBar.css +21 -2
- package/dist/css/Tour.css +1 -1
- package/dist/css/TreeList.css +7 -3
- package/dist/css/Workbench.css +13 -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 +15 -5
- 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 +13 -6
- 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/codeSpans.js +20 -0
- package/dist/internal/codeSpans.js.map +1 -0
- 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 +1296 -400
- 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 -3
- 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 +9 -8
- 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 -2
- package/docs/DataColors.md +2 -2
- package/docs/DataTable.md +29 -141
- package/docs/DatePicker.md +1 -0
- package/docs/DateRangePicker.md +3 -0
- package/docs/DetailList.md +9 -9
- package/docs/Dialog.md +8 -4
- package/docs/Drawer.md +7 -4
- package/docs/ErrorPage.md +1 -1
- package/docs/EventTimeline.md +23 -12
- package/docs/FileUpload.md +1 -1
- package/docs/FormGrid.md +2 -1
- package/docs/Format.md +5 -3
- package/docs/Graph.md +1 -1
- package/docs/Grid.md +5 -1
- package/docs/KpiCard.md +6 -4
- package/docs/LayerGraph.md +18 -53
- package/docs/LineChart.md +5 -3
- package/docs/Link.md +22 -0
- package/docs/LoginCard.md +7 -3
- package/docs/Markdown.md +3 -13
- package/docs/Menu.md +2 -0
- package/docs/Meter.md +1 -0
- package/docs/MultiSelect.md +2 -1
- package/docs/NotificationBell.md +1 -0
- 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 -1
- package/docs/SettingsLayout.md +19 -4
- package/docs/SideNav.md +1 -1
- package/docs/Skeleton.md +2 -1
- package/docs/Switch.md +3 -1
- package/docs/Tabs.md +4 -3
- package/docs/Tag.md +9 -7
- package/docs/Term.md +3 -3
- package/docs/TextArea.md +2 -1
- package/docs/TextField.md +5 -3
- package/docs/ThemePicker.md +3 -1
- package/docs/Toast.md +17 -5
- 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 -18
- 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,23 +1,64 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { tr } from "../../i18n.js";
|
|
3
3
|
import { Icon } from "../../icons/Icon.js";
|
|
4
|
-
import {
|
|
4
|
+
import { Button } from "../Button/Button.js";
|
|
5
|
+
import { devWarn } from "../../internal/dev.js";
|
|
6
|
+
import { baseReason, useOpenState } from "../../internal/open.js";
|
|
5
7
|
import { includeIcons } from "../../icons/store.js";
|
|
6
8
|
import x_default from "../../icons/ph/x.js";
|
|
9
|
+
import { codeText } from "../InlineCode/InlineCode.js";
|
|
7
10
|
import * as React from "react";
|
|
8
11
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
12
|
import { Dialog } from "@base-ui/react/dialog";
|
|
10
13
|
// src/components/Drawer/Drawer.tsx
|
|
11
14
|
includeIcons(x_default);
|
|
12
15
|
/** A 400 px panel from the right for editing one item without leaving the page. */
|
|
13
|
-
function Drawer({ open, onClose, title, actions, dirty, width, side = "right", confirmTitle, confirmText, children }) {
|
|
16
|
+
function Drawer({ open: openProp, defaultOpen, onOpenChange, onClose, title, description, actions, dirty, width, side = "right", confirmTitle, confirmText, children }) {
|
|
17
|
+
devWarn(!!onClose, "Drawer", "onClose is deprecated: use onOpenChange={(open) => !open && close()}. It still works for now.");
|
|
18
|
+
devWarn(openProp !== void 0 && !onOpenChange && !onClose, "Drawer", "a controlled drawer needs onOpenChange, or × and Esc cannot close it.");
|
|
19
|
+
const [open, setOpen] = useOpenState({
|
|
20
|
+
open: openProp,
|
|
21
|
+
defaultOpen,
|
|
22
|
+
onOpenChange
|
|
23
|
+
});
|
|
14
24
|
const [asking, setAsking] = React.useState(false);
|
|
15
|
-
const
|
|
25
|
+
const qid = React.useId();
|
|
26
|
+
const close = (reason) => {
|
|
27
|
+
setAsking(false);
|
|
28
|
+
setOpen(false, reason);
|
|
29
|
+
onClose?.();
|
|
30
|
+
};
|
|
16
31
|
const panel = React.useRef(null);
|
|
17
32
|
const firstField = () => panel.current?.querySelector(".ui-drawer-body :is(input, textarea, select, button, [tabindex]):not([disabled], [tabindex=\"-1\"]), .ui-drawer-foot button:not([disabled])") ?? true;
|
|
33
|
+
const [back, setBack] = React.useState(null);
|
|
34
|
+
const request = (reason = "cancel") => {
|
|
35
|
+
if (!dirty) return close(reason);
|
|
36
|
+
const a = document.activeElement;
|
|
37
|
+
setBack(a instanceof HTMLElement && a !== document.body ? a : null);
|
|
38
|
+
setAsking(true);
|
|
39
|
+
};
|
|
40
|
+
const keep = React.useRef(null);
|
|
41
|
+
const wasAsking = React.useRef(false);
|
|
42
|
+
React.useEffect(() => {
|
|
43
|
+
if (asking) keep.current?.focus();
|
|
44
|
+
else if (wasAsking.current && open) {
|
|
45
|
+
const f = back?.isConnected ? back : firstField();
|
|
46
|
+
if (f instanceof HTMLElement) f.focus();
|
|
47
|
+
}
|
|
48
|
+
wasAsking.current = asking;
|
|
49
|
+
}, [
|
|
50
|
+
asking,
|
|
51
|
+
back,
|
|
52
|
+
open
|
|
53
|
+
]);
|
|
54
|
+
const foot = actions ? typeof actions === "function" ? actions(() => request("cancel")) : actions : null;
|
|
18
55
|
return /* @__PURE__ */ jsx(Dialog.Root, {
|
|
19
56
|
open,
|
|
20
|
-
onOpenChange: (next) =>
|
|
57
|
+
onOpenChange: (next, details) => {
|
|
58
|
+
if (next) return;
|
|
59
|
+
if (asking) return setAsking(false);
|
|
60
|
+
request(baseReason(details?.reason));
|
|
61
|
+
},
|
|
21
62
|
children: /* @__PURE__ */ jsxs(Dialog.Portal, { children: [/* @__PURE__ */ jsx(Dialog.Backdrop, { className: "ui-drawer-backdrop" }), /* @__PURE__ */ jsxs(Dialog.Popup, {
|
|
22
63
|
ref: panel,
|
|
23
64
|
initialFocus: firstField,
|
|
@@ -26,14 +67,20 @@ function Drawer({ open, onClose, title, actions, dirty, width, side = "right", c
|
|
|
26
67
|
children: [
|
|
27
68
|
/* @__PURE__ */ jsxs("div", {
|
|
28
69
|
className: "ui-drawer-head",
|
|
29
|
-
children: [/* @__PURE__ */
|
|
30
|
-
className: "ui-drawer-
|
|
31
|
-
children:
|
|
70
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
71
|
+
className: "ui-drawer-heading",
|
|
72
|
+
children: [/* @__PURE__ */ jsx(Dialog.Title, {
|
|
73
|
+
className: "ui-drawer-title",
|
|
74
|
+
children: title
|
|
75
|
+
}), description ? /* @__PURE__ */ jsx(Dialog.Description, {
|
|
76
|
+
className: "ui-drawer-desc",
|
|
77
|
+
children: codeText(description)
|
|
78
|
+
}) : null]
|
|
32
79
|
}), /* @__PURE__ */ jsx("button", {
|
|
33
80
|
type: "button",
|
|
34
81
|
className: "ui-drawer-close ui-dialog-close",
|
|
35
82
|
"aria-label": tr("關閉"),
|
|
36
|
-
onClick: request,
|
|
83
|
+
onClick: () => request("close"),
|
|
37
84
|
children: /* @__PURE__ */ jsx(Icon, { name: "x" })
|
|
38
85
|
})]
|
|
39
86
|
}),
|
|
@@ -41,23 +88,39 @@ function Drawer({ open, onClose, title, actions, dirty, width, side = "right", c
|
|
|
41
88
|
className: "ui-drawer-body",
|
|
42
89
|
children
|
|
43
90
|
}),
|
|
44
|
-
|
|
91
|
+
asking ? /* @__PURE__ */ jsxs("div", {
|
|
92
|
+
className: "ui-drawer-foot is-asking",
|
|
93
|
+
role: "group",
|
|
94
|
+
"aria-labelledby": qid,
|
|
95
|
+
"aria-describedby": qid + "-t",
|
|
96
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
97
|
+
className: "ui-drawer-ask",
|
|
98
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
99
|
+
id: qid,
|
|
100
|
+
className: "ui-drawer-ask-title",
|
|
101
|
+
children: confirmTitle || tr("放棄未儲存的變更?")
|
|
102
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
103
|
+
id: qid + "-t",
|
|
104
|
+
className: "ui-drawer-ask-text",
|
|
105
|
+
children: codeText(confirmText || tr("關閉後,剛才的修改不會保留。"))
|
|
106
|
+
})]
|
|
107
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
108
|
+
className: "ui-drawer-ask-actions",
|
|
109
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
110
|
+
ref: keep,
|
|
111
|
+
onClick: () => setAsking(false),
|
|
112
|
+
children: tr("繼續編輯")
|
|
113
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
114
|
+
variant: "danger",
|
|
115
|
+
confirmed: true,
|
|
116
|
+
onClick: () => close("confirm"),
|
|
117
|
+
children: tr("放棄")
|
|
118
|
+
})]
|
|
119
|
+
})]
|
|
120
|
+
}) : foot ? /* @__PURE__ */ jsx("div", {
|
|
45
121
|
className: "ui-drawer-foot",
|
|
46
|
-
children:
|
|
47
|
-
}) : null
|
|
48
|
-
/* @__PURE__ */ jsx(Dialog$1, {
|
|
49
|
-
open: asking,
|
|
50
|
-
onClose: () => setAsking(false),
|
|
51
|
-
title: confirmTitle || tr("放棄未儲存的變更?"),
|
|
52
|
-
tone: "danger",
|
|
53
|
-
cancelLabel: tr("繼續編輯"),
|
|
54
|
-
confirmLabel: tr("放棄"),
|
|
55
|
-
onConfirm: () => {
|
|
56
|
-
setAsking(false);
|
|
57
|
-
onClose();
|
|
58
|
-
},
|
|
59
|
-
children: confirmText || tr("關閉後,剛才的修改不會保留。")
|
|
60
|
-
})
|
|
122
|
+
children: foot
|
|
123
|
+
}) : null
|
|
61
124
|
]
|
|
62
125
|
})] })
|
|
63
126
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Drawer.js","names":["phX","Base"
|
|
1
|
+
{"version":3,"file":"Drawer.js","names":["phX","Base"],"sources":["../../../src/components/Drawer/Drawer.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Dialog as Base } from '@base-ui/react/dialog';\nimport { tr } from '../../i18n';\nimport { Icon } from '../../icons/Icon';\nimport { Button } from '../Button/Button';\nimport { devWarn } from '../../internal/dev';\nimport { baseReason, useOpenState, type OpenChangeReason } from '../../internal/open';\nimport { includeIcons } from '../../icons/store';\nimport phX from '../../icons/ph/x';\nimport { codeText } from '../InlineCode/InlineCode';\n\nincludeIcons(phX);\n\nexport interface DrawerProps {\n /** Controlled: shown while true. Leave it out (with defaultOpen) to let the drawer keep its own state. */\n open?: boolean;\n /** Uncontrolled: whether it starts open. */\n defaultOpen?: boolean;\n /** Called with false (and why) on ×, Esc, a press on the backdrop and requestClose, after the unsaved-changes check. */\n onOpenChange?: (open: boolean, reason?: OpenChangeReason) => void;\n /** @deprecated use onOpenChange. Called when the drawer closes. */\n onClose?: () => void;\n /** The drawer's heading and name. */\n title: string;\n /** One sentence under the title on what the drawer is for; read with the title when it opens (aria-describedby). */\n description?: string;\n /** Footer buttons: secondary first, primary last. Pass a function to get requestClose for your 取消 button: it\n * asks before discarding unsaved changes, like × and Esc. */\n actions?: React.ReactNode | ((requestClose: () => void) => React.ReactNode);\n /** Unsaved changes: closing asks 「放棄未儲存的變更?」 first, in the drawer's footer. */\n dirty?: boolean;\n /** px. Default 400. */\n width?: number;\n /** Which edge it slides in from. Default 'right'; 'left' for navigation opened from a menu button at the left. */\n side?: 'right' | 'left';\n /** The question of the close confirmation. Default 「放棄未儲存的變更?」. */\n confirmTitle?: string;\n /** The sentence of the close confirmation; `backticks` are code. */\n confirmText?: string;\n /** The form or details; the buttons stay fixed at the bottom. */\n children?: React.ReactNode;\n}\n\n/** A 400 px panel from the right for editing one item without leaving the page. */\nexport function Drawer({\n open: openProp,\n defaultOpen,\n onOpenChange,\n onClose,\n title,\n description,\n actions,\n dirty,\n width,\n side = 'right',\n confirmTitle,\n confirmText,\n children,\n}: DrawerProps) {\n devWarn(!!onClose, 'Drawer', 'onClose is deprecated: use onOpenChange={(open) => !open && close()}. It still works for now.');\n devWarn(openProp !== undefined && !onOpenChange && !onClose, 'Drawer', 'a controlled drawer needs onOpenChange, or × and Esc cannot close it.');\n const [open, setOpen] = useOpenState({ open: openProp, defaultOpen, onOpenChange });\n const [asking, setAsking] = React.useState(false);\n const qid = React.useId();\n const close = (reason: OpenChangeReason) => {\n setAsking(false);\n setOpen(false, reason);\n onClose?.();\n };\n // Unsaved changes: the question replaces the footer, in the drawer, instead of a dialog over the whole page.\n const panel = React.useRef<HTMLDivElement>(null);\n // Focus the first field (or action), not the close button.\n const firstField = () =>\n panel.current?.querySelector<HTMLElement>(\n '.ui-drawer-body :is(input, textarea, select, button, [tabindex]):not([disabled], [tabindex=\"-1\"]), .ui-drawer-foot button:not([disabled])',\n ) ?? true;\n // Where focus was before the question, to go back to after 繼續編輯.\n const [back, setBack] = React.useState<HTMLElement | null>(null);\n const request = (reason: OpenChangeReason = 'cancel') => {\n if (!dirty) return close(reason);\n const a = document.activeElement;\n setBack(a instanceof HTMLElement && a !== document.body ? a : null);\n setAsking(true);\n };\n const keep = React.useRef<HTMLButtonElement>(null);\n const wasAsking = React.useRef(false);\n React.useEffect(() => {\n if (asking) keep.current?.focus();\n // Back to editing: focus returns to where it was before the question (the × or the field), not to the page.\n else if (wasAsking.current && open) {\n const f = back?.isConnected ? back : firstField();\n if (f instanceof HTMLElement) f.focus();\n }\n wasAsking.current = asking;\n }, [asking, back, open]);\n const foot = actions ? (typeof actions === 'function' ? actions(() => request('cancel')) : actions) : null;\n return (\n <Base.Root\n open={open}\n onOpenChange={(next, details) => {\n if (next) return;\n // Esc while asking: back to editing.\n if (asking) return setAsking(false);\n request(baseReason(details?.reason));\n }}\n >\n <Base.Portal>\n <Base.Backdrop className=\"ui-drawer-backdrop\" />\n <Base.Popup ref={panel} initialFocus={firstField} className={side === 'left' ? 'ui-drawer is-left' : 'ui-drawer'} style={width ? { width } : undefined}>\n <div className=\"ui-drawer-head\">\n <div className=\"ui-drawer-heading\">\n <Base.Title className=\"ui-drawer-title\">{title}</Base.Title>\n {description ? <Base.Description className=\"ui-drawer-desc\">{codeText(description)}</Base.Description> : null}\n </div>\n <button type=\"button\" className=\"ui-drawer-close ui-dialog-close\" aria-label={tr('關閉')} onClick={() => request('close')}>\n <Icon name=\"x\" />\n </button>\n </div>\n <div className=\"ui-drawer-body\">{children}</div>\n {asking ? (\n <div className=\"ui-drawer-foot is-asking\" role=\"group\" aria-labelledby={qid} aria-describedby={qid + '-t'}>\n <div className=\"ui-drawer-ask\">\n <div id={qid} className=\"ui-drawer-ask-title\">\n {confirmTitle || tr('放棄未儲存的變更?')}\n </div>\n <div id={qid + '-t'} className=\"ui-drawer-ask-text\">\n {codeText(confirmText || tr('關閉後,剛才的修改不會保留。'))}\n </div>\n </div>\n <div className=\"ui-drawer-ask-actions\">\n <Button ref={keep} onClick={() => setAsking(false)}>\n {tr('繼續編輯')}\n </Button>\n <Button variant=\"danger\" confirmed onClick={() => close('confirm')}>\n {tr('放棄')}\n </Button>\n </div>\n </div>\n ) : foot ? (\n <div className=\"ui-drawer-foot\">{foot}</div>\n ) : null}\n </Base.Popup>\n </Base.Portal>\n </Base.Root>\n );\n}\n"],"mappings":"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"}
|
|
@@ -2,9 +2,9 @@ import * as React from "react";
|
|
|
2
2
|
export interface EmptyStateProps {
|
|
3
3
|
/** What is empty, stated: 「還沒有專案」. */
|
|
4
4
|
title: string;
|
|
5
|
-
/** One sentence on what to do. */
|
|
5
|
+
/** One sentence on what to do; `backticks` are code. */
|
|
6
6
|
description?: string;
|
|
7
|
-
/** Numbered first steps. */
|
|
7
|
+
/** Numbered first steps; `backticks` are code. */
|
|
8
8
|
steps?: string[];
|
|
9
9
|
/** Index of the current step. Default 0. */
|
|
10
10
|
current?: number;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
+
import { codeText } from "../InlineCode/InlineCode.js";
|
|
2
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
4
|
// src/components/EmptyState/EmptyState.tsx
|
|
4
5
|
/** What a list or page shows when it has nothing yet: what is missing and the first step. */
|
|
@@ -12,7 +13,7 @@ function EmptyState({ title, description, steps = [], current = 0, action }) {
|
|
|
12
13
|
}),
|
|
13
14
|
description ? /* @__PURE__ */ jsx("p", {
|
|
14
15
|
className: "ui-empty-desc",
|
|
15
|
-
children: description
|
|
16
|
+
children: codeText(description)
|
|
16
17
|
}) : null,
|
|
17
18
|
steps.length ? /* @__PURE__ */ jsx("ol", {
|
|
18
19
|
className: "ui-steps",
|
|
@@ -22,7 +23,7 @@ function EmptyState({ title, description, steps = [], current = 0, action }) {
|
|
|
22
23
|
children: [/* @__PURE__ */ jsx("span", {
|
|
23
24
|
className: "ui-step-num",
|
|
24
25
|
children: i + 1
|
|
25
|
-
}), /* @__PURE__ */ jsx("span", { children: s })]
|
|
26
|
+
}), /* @__PURE__ */ jsx("span", { children: codeText(s) })]
|
|
26
27
|
}, i))
|
|
27
28
|
}) : null,
|
|
28
29
|
action ?? null
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import type * as React from 'react';\n\nexport interface EmptyStateProps {\n /** What is empty, stated: 「還沒有專案」. */\n title: string;\n /** One sentence on what to do. */\n description?: string;\n /** Numbered first steps. */\n steps?: string[];\n /** Index of the current step. Default 0. */\n current?: number;\n /** The one button that starts the first step. */\n action?: React.ReactNode;\n}\n\n/** What a list or page shows when it has nothing yet: what is missing and the first step. */\nexport function EmptyState({ title, description, steps = [], current = 0, action }: EmptyStateProps) {\n return (\n <div className=\"ui-empty\">\n <div className=\"ui-empty-title\">{title}</div>\n {description ? <p className=\"ui-empty-desc\">{description}</p> : null}\n {steps.length ? (\n <ol className=\"ui-steps\">\n {steps.map((s, i) => (\n <li key={i} className={i === current ? 'is-current' : undefined} aria-current={i === current ? 'step' : undefined}>\n <span className=\"ui-step-num\">{i + 1}</span>\n <span>{s}</span>\n </li>\n ))}\n </ol>\n ) : null}\n {action ?? null}\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import type * as React from 'react';\nimport { codeText } from '../InlineCode/InlineCode';\n\nexport interface EmptyStateProps {\n /** What is empty, stated: 「還沒有專案」. */\n title: string;\n /** One sentence on what to do; `backticks` are code. */\n description?: string;\n /** Numbered first steps; `backticks` are code. */\n steps?: string[];\n /** Index of the current step. Default 0. */\n current?: number;\n /** The one button that starts the first step. */\n action?: React.ReactNode;\n}\n\n/** What a list or page shows when it has nothing yet: what is missing and the first step. */\nexport function EmptyState({ title, description, steps = [], current = 0, action }: EmptyStateProps) {\n return (\n <div className=\"ui-empty\">\n <div className=\"ui-empty-title\">{title}</div>\n {description ? <p className=\"ui-empty-desc\">{codeText(description)}</p> : null}\n {steps.length ? (\n <ol className=\"ui-steps\">\n {steps.map((s, i) => (\n <li key={i} className={i === current ? 'is-current' : undefined} aria-current={i === current ? 'step' : undefined}>\n <span className=\"ui-step-num\">{i + 1}</span>\n <span>{codeText(s)}</span>\n </li>\n ))}\n </ol>\n ) : null}\n {action ?? null}\n </div>\n );\n}\n"],"mappings":";;;;;AAiBA,SAAgB,WAAW,EAAE,OAAO,aAAa,QAAQ,CAAC,GAAG,UAAU,GAAG,UAA2B;CACnG,OACE,qBAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACE,oBAAC,OAAD;IAAK,WAAU;IAAkB,UAAA;GAAW,CAAA;GAC3C,cAAc,oBAAC,KAAD;IAAG,WAAU;IAAiB,UAAA,SAAS,WAAW;GAAK,CAAA,IAAI;GACzE,MAAM,SACL,oBAAC,MAAD;IAAI,WAAU;IACX,UAAA,MAAM,KAAK,GAAG,MACb,qBAAC,MAAD;KAAY,WAAW,MAAM,UAAU,eAAe,KAAA;KAAW,gBAAc,MAAM,UAAU,SAAS,KAAA;KAAxG,UAAA,CACE,oBAAC,QAAD;MAAM,WAAU;MAAe,UAAA,IAAI;KAAQ,CAAA,GAC3C,oBAAC,QAAD,EAAA,UAAO,SAAS,CAAC,EAAQ,CAAA,CACvB;IAHK,GAAA,CAGL,CACL;GACC,CAAA,IACF;GACH,UAAU;EACR;;AAET"}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
export interface ErrorPageProps {
|
|
2
2
|
/** 404, 403 and 500 come with their own title and sentence. */
|
|
3
3
|
code: number;
|
|
4
|
+
/** Default: the standard wording for the code, e.g. 「找不到這個頁面」 for 404. */
|
|
4
5
|
title?: string;
|
|
6
|
+
/** One sentence on what happened and what to do; `backticks` are code. */
|
|
5
7
|
description?: string;
|
|
6
8
|
/** Default: history.back(). */
|
|
7
9
|
onBack?: () => void;
|
|
10
|
+
/** Called by 「回到首頁」 instead of following homeHref. */
|
|
8
11
|
onHome?: () => void;
|
|
9
12
|
/** Default '/'. */
|
|
10
13
|
homeHref?: string;
|
|
14
|
+
/** Extra class on the root element. */
|
|
11
15
|
className?: string;
|
|
12
16
|
}
|
|
13
17
|
/** A whole page for 404, 403 and 500: the code, a title, one sentence, then 「回上一頁」 and 「回首頁」. */
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { tr } from "../../i18n.js";
|
|
3
3
|
import { cx } from "../../internal/util.js";
|
|
4
4
|
import { Button } from "../Button/Button.js";
|
|
5
|
+
import { codeText } from "../InlineCode/InlineCode.js";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
7
|
// src/components/ErrorPage/ErrorPage.tsx
|
|
7
8
|
const ERR_COPY = {
|
|
@@ -26,7 +27,7 @@ function ErrorPage({ code, title, description, onBack, onHome, homeHref = "/", c
|
|
|
26
27
|
}),
|
|
27
28
|
/* @__PURE__ */ jsx("p", {
|
|
28
29
|
className: "ui-errorpage-desc",
|
|
29
|
-
children: description || (copy ? tr(copy[1]) : "")
|
|
30
|
+
children: codeText(description || (copy ? tr(copy[1]) : ""))
|
|
30
31
|
}),
|
|
31
32
|
/* @__PURE__ */ jsxs("div", {
|
|
32
33
|
className: "ui-errorpage-actions",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPage.js","names":[],"sources":["../../../src/components/ErrorPage/ErrorPage.tsx"],"sourcesContent":["import { tr } from '../../i18n';\nimport { cx } from '../../internal/util';\nimport { Button } from '../Button/Button';\n\nconst ERR_COPY: Record<number, [string, string]> = {\n 404: ['找不到這個頁面', '網址可能打錯了,或這個頁面已經移除。'],\n 500: ['伺服器暫時無法回應', '這個問題已經記錄下來,請稍後重新整理再試。'],\n 403: ['沒有權限查看這個頁面', '請向管理員申請權限,或切換成有權限的帳號。'],\n};\n\nexport interface ErrorPageProps {\n /** 404, 403 and 500 come with their own title and sentence. */\n code: number;\n title?: string;\n description?: string;\n /** Default: history.back(). */\n onBack?: () => void;\n onHome?: () => void;\n /** Default '/'. */\n homeHref?: string;\n className?: string;\n}\n\n/** A whole page for 404, 403 and 500: the code, a title, one sentence, then 「回上一頁」 and 「回首頁」. */\nexport function ErrorPage({ code, title, description, onBack, onHome, homeHref = '/', className }: ErrorPageProps) {\n const copy = ERR_COPY[code];\n return (\n <main className={cx('ui-errorpage', className)}>\n <div className=\"ui-errorpage-code\" aria-hidden=\"true\">\n {code}\n </div>\n <h1 className=\"ui-errorpage-title\">{title || (copy ? tr(copy[0]) : tr('發生錯誤'))}</h1>\n <p className=\"ui-errorpage-desc\">{description || (copy ? tr(copy[1]) : '')}</p>\n <div className=\"ui-errorpage-actions\">\n <Button onClick={onBack ?? (() => history.back())}>{tr('回上一頁')}</Button>\n <Button variant=\"primary\" onClick={onHome ?? (() => (location.href = homeHref))}>\n {tr('回首頁')}\n </Button>\n </div>\n </main>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ErrorPage.js","names":[],"sources":["../../../src/components/ErrorPage/ErrorPage.tsx"],"sourcesContent":["import { tr } from '../../i18n';\nimport { cx } from '../../internal/util';\nimport { Button } from '../Button/Button';\nimport { codeText } from '../InlineCode/InlineCode';\n\nconst ERR_COPY: Record<number, [string, string]> = {\n 404: ['找不到這個頁面', '網址可能打錯了,或這個頁面已經移除。'],\n 500: ['伺服器暫時無法回應', '這個問題已經記錄下來,請稍後重新整理再試。'],\n 403: ['沒有權限查看這個頁面', '請向管理員申請權限,或切換成有權限的帳號。'],\n};\n\nexport interface ErrorPageProps {\n /** 404, 403 and 500 come with their own title and sentence. */\n code: number;\n /** Default: the standard wording for the code, e.g. 「找不到這個頁面」 for 404. */\n title?: string;\n /** One sentence on what happened and what to do; `backticks` are code. */\n description?: string;\n /** Default: history.back(). */\n onBack?: () => void;\n /** Called by 「回到首頁」 instead of following homeHref. */\n onHome?: () => void;\n /** Default '/'. */\n homeHref?: string;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** A whole page for 404, 403 and 500: the code, a title, one sentence, then 「回上一頁」 and 「回首頁」. */\nexport function ErrorPage({ code, title, description, onBack, onHome, homeHref = '/', className }: ErrorPageProps) {\n const copy = ERR_COPY[code];\n return (\n <main className={cx('ui-errorpage', className)}>\n <div className=\"ui-errorpage-code\" aria-hidden=\"true\">\n {code}\n </div>\n <h1 className=\"ui-errorpage-title\">{title || (copy ? tr(copy[0]) : tr('發生錯誤'))}</h1>\n <p className=\"ui-errorpage-desc\">{codeText(description || (copy ? tr(copy[1]) : ''))}</p>\n <div className=\"ui-errorpage-actions\">\n <Button onClick={onBack ?? (() => history.back())}>{tr('回上一頁')}</Button>\n <Button variant=\"primary\" onClick={onHome ?? (() => (location.href = homeHref))}>\n {tr('回首頁')}\n </Button>\n </div>\n </main>\n );\n}\n"],"mappings":";;;;;;;AAKA,MAAM,WAA6C;CACjD,KAAK,CAAC,WAAW,oBAAoB;CACrC,KAAK,CAAC,aAAa,uBAAuB;CAC1C,KAAK,CAAC,cAAc,uBAAuB;AAC7C;;AAoBA,SAAgB,UAAU,EAAE,MAAM,OAAO,aAAa,QAAQ,QAAQ,WAAW,KAAK,aAA6B;CACjH,MAAM,OAAO,SAAS;CACtB,OACE,qBAAC,QAAD;EAAM,WAAW,GAAG,gBAAgB,SAAS;EAA7C,UAAA;GACE,oBAAC,OAAD;IAAK,WAAU;IAAoB,eAAY;IAC5C,UAAA;GACE,CAAA;GACL,oBAAC,MAAD;IAAI,WAAU;IAAsB,UAAA,UAAU,OAAO,GAAG,KAAK,EAAE,IAAI,GAAG,MAAM;GAAO,CAAA;GACnF,oBAAC,KAAD;IAAG,WAAU;IAAqB,UAAA,SAAS,gBAAgB,OAAO,GAAG,KAAK,EAAE,IAAI,GAAG;GAAK,CAAA;GACxF,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,QAAD;KAAQ,SAAS,iBAAiB,QAAQ,KAAK;KAAK,UAAA,GAAG,MAAM;IAAU,CAAA,GACvE,oBAAC,QAAD;KAAQ,SAAQ;KAAU,SAAS,iBAAkB,SAAS,OAAO;KAClE,UAAA,GAAG,KAAK;IACH,CAAA,CACL;;EACD;;AAEV"}
|
|
@@ -1,19 +1,37 @@
|
|
|
1
|
+
import { IconSource } from "../../icons/Icon.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** The built-in kinds of a monitoring timeline. */
|
|
1
4
|
export type EventKind = 'alert' | 'switch' | 'ai' | 'manual';
|
|
5
|
+
/** How a kind of event looks: its icon, the name read aloud, and the icon's colour. */
|
|
6
|
+
export interface TimelineKind {
|
|
7
|
+
icon: IconSource;
|
|
8
|
+
/** Read aloud for the icon: 「付款」. */
|
|
9
|
+
label: string;
|
|
10
|
+
/** Colour of the icon. Default 'neutral' (ink-muted); colour only what needs attention. */
|
|
11
|
+
tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
12
|
+
}
|
|
2
13
|
export interface TimelineEvent {
|
|
3
14
|
id?: string;
|
|
4
15
|
time: Date;
|
|
5
|
-
/** alert 告警, switch 切換, ai AI, manual
|
|
6
|
-
kind: EventKind;
|
|
7
|
-
/** What happened, one short sentence: 「F 區進氣溫度超過上限 29 °C
|
|
16
|
+
/** A key of `kinds`, or a built-in one: alert 告警, switch 切換, ai AI, manual 人工. */
|
|
17
|
+
kind: EventKind | (string & {});
|
|
18
|
+
/** What happened, one short sentence: 「F 區進氣溫度超過上限 29 °C」; `backticks` are code. */
|
|
8
19
|
text: string;
|
|
20
|
+
/** Who did it, after the sentence: 「王小明」. */
|
|
21
|
+
actor?: string;
|
|
9
22
|
}
|
|
10
23
|
export interface EventTimelineProps {
|
|
24
|
+
/** The events, newest first. */
|
|
11
25
|
events: TimelineEvent[];
|
|
12
26
|
/** What the list is, for screen readers, e.g. 「近 4 小時的事件」. */
|
|
13
27
|
label: string;
|
|
14
28
|
/** Shown when there are no events, e.g. 「近 4 小時沒有事件」. Default 「沒有事件」. */
|
|
15
29
|
empty?: string;
|
|
30
|
+
/** Your own kinds (an order's 建立, 付款, 出貨…), added to the built-in four. */
|
|
31
|
+
kinds?: Record<string, TimelineKind>;
|
|
32
|
+
/** Extra class on the root element. */
|
|
16
33
|
className?: string;
|
|
17
34
|
}
|
|
18
|
-
/** Events newest first, one row each: the time (Geist Mono), an icon for the kind, and
|
|
19
|
-
|
|
35
|
+
/** Events newest first, one row each: the time (Geist Mono), an icon for the kind, what happened and who did it. When
|
|
36
|
+
* the events span several days, a date heads each day. */
|
|
37
|
+
export declare function EventTimeline({ events, label, empty, kinds, className }: EventTimelineProps): React.JSX.Element;
|
|
@@ -1,46 +1,60 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cx } from "../../internal/util.js";
|
|
3
|
-
import {
|
|
3
|
+
import { devWarn } from "../../internal/dev.js";
|
|
4
|
+
import { format, sameDay } from "../../format.js";
|
|
4
5
|
import { tr } from "../../i18n.js";
|
|
5
|
-
import {
|
|
6
|
+
import { IconOf } from "../../icons/Icon.js";
|
|
6
7
|
import { includeIcons } from "../../icons/store.js";
|
|
7
8
|
import arrows_left_right_default from "../../icons/ph/arrows-left-right.js";
|
|
8
9
|
import sparkle_default from "../../icons/ph/sparkle.js";
|
|
9
10
|
import user_default from "../../icons/ph/user.js";
|
|
10
11
|
import warning_default from "../../icons/ph/warning.js";
|
|
12
|
+
import { codeText } from "../InlineCode/InlineCode.js";
|
|
13
|
+
import * as React from "react";
|
|
11
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
15
|
// src/components/EventTimeline/EventTimeline.tsx
|
|
13
16
|
includeIcons(arrows_left_right_default, sparkle_default, user_default, warning_default);
|
|
14
|
-
const
|
|
17
|
+
const BUILT_IN = {
|
|
15
18
|
alert: {
|
|
16
19
|
icon: "warning",
|
|
17
|
-
|
|
20
|
+
label: "告警",
|
|
21
|
+
tone: "warning"
|
|
18
22
|
},
|
|
19
23
|
switch: {
|
|
20
24
|
icon: "arrows-left-right",
|
|
21
|
-
|
|
25
|
+
label: "切換",
|
|
26
|
+
tone: "info"
|
|
22
27
|
},
|
|
23
28
|
ai: {
|
|
24
29
|
icon: "sparkle",
|
|
25
|
-
|
|
30
|
+
label: "AI"
|
|
26
31
|
},
|
|
27
32
|
manual: {
|
|
28
33
|
icon: "user",
|
|
29
|
-
|
|
34
|
+
label: "人工"
|
|
30
35
|
}
|
|
31
36
|
};
|
|
32
|
-
/** Events newest first, one row each: the time (Geist Mono), an icon for the kind, and
|
|
33
|
-
|
|
37
|
+
/** Events newest first, one row each: the time (Geist Mono), an icon for the kind, what happened and who did it. When
|
|
38
|
+
* the events span several days, a date heads each day. */
|
|
39
|
+
function EventTimeline({ events, label, empty, kinds, className }) {
|
|
34
40
|
const list = [...events].sort((a, b) => b.time.getTime() - a.time.getTime());
|
|
41
|
+
const all = {
|
|
42
|
+
...BUILT_IN,
|
|
43
|
+
...kinds
|
|
44
|
+
};
|
|
45
|
+
const unknown = list.find((e) => !all[e.kind]);
|
|
46
|
+
devWarn(unknown, "EventTimeline", `kind "${String(unknown?.kind)}" is not defined. Add it to \`kinds\`: { ${String(unknown?.kind)}: { icon, label } }.`);
|
|
35
47
|
if (!list.length) return /* @__PURE__ */ jsx("p", {
|
|
36
48
|
className: cx("ui-events-empty", className),
|
|
37
49
|
children: empty ?? tr("沒有事件")
|
|
38
50
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
51
|
+
const row = (e, i) => {
|
|
52
|
+
const k = all[e.kind] ?? {
|
|
53
|
+
icon: "M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z",
|
|
54
|
+
label: e.kind
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
57
|
+
className: cx("is-" + e.kind, k.tone && k.tone !== "neutral" && "is-tone-" + k.tone),
|
|
44
58
|
children: [
|
|
45
59
|
/* @__PURE__ */ jsx("time", {
|
|
46
60
|
className: "ui-events-time",
|
|
@@ -50,18 +64,48 @@ function EventTimeline({ events, label, empty, className }) {
|
|
|
50
64
|
/* @__PURE__ */ jsx("span", {
|
|
51
65
|
className: "ui-events-kind",
|
|
52
66
|
role: "img",
|
|
53
|
-
"aria-label": tr(
|
|
54
|
-
children: /* @__PURE__ */ jsx(
|
|
55
|
-
|
|
67
|
+
"aria-label": tr(k.label),
|
|
68
|
+
children: /* @__PURE__ */ jsx(IconOf, {
|
|
69
|
+
icon: k.icon,
|
|
56
70
|
size: 20
|
|
57
71
|
})
|
|
58
72
|
}),
|
|
59
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ jsxs("span", {
|
|
60
74
|
className: "ui-events-text",
|
|
61
|
-
children: e.text
|
|
75
|
+
children: [codeText(e.text), e.actor ? /* @__PURE__ */ jsx("span", {
|
|
76
|
+
className: "ui-events-actor",
|
|
77
|
+
children: e.actor
|
|
78
|
+
}) : null]
|
|
62
79
|
})
|
|
63
80
|
]
|
|
64
|
-
}, e.id ?? i)
|
|
81
|
+
}, e.id ?? i);
|
|
82
|
+
};
|
|
83
|
+
const days = [];
|
|
84
|
+
for (const e of list) {
|
|
85
|
+
const last = days[days.length - 1];
|
|
86
|
+
if (last && sameDay(last[0].time, e.time)) last.push(e);
|
|
87
|
+
else days.push([e]);
|
|
88
|
+
}
|
|
89
|
+
if (days.length === 1) return /* @__PURE__ */ jsx("ol", {
|
|
90
|
+
className: cx("ui-events", className),
|
|
91
|
+
"aria-label": label,
|
|
92
|
+
children: list.map(row)
|
|
93
|
+
});
|
|
94
|
+
return /* @__PURE__ */ jsx("div", {
|
|
95
|
+
className: cx("ui-events", "is-days", className),
|
|
96
|
+
role: "group",
|
|
97
|
+
"aria-label": label,
|
|
98
|
+
children: days.map((day) => {
|
|
99
|
+
const date = format.date(day[0].time);
|
|
100
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsx("div", {
|
|
101
|
+
className: "ui-events-date",
|
|
102
|
+
children: date
|
|
103
|
+
}), /* @__PURE__ */ jsx("ol", {
|
|
104
|
+
className: "ui-events-day",
|
|
105
|
+
"aria-label": date,
|
|
106
|
+
children: day.map(row)
|
|
107
|
+
})] }, date);
|
|
108
|
+
})
|
|
65
109
|
});
|
|
66
110
|
}
|
|
67
111
|
export { EventTimeline };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EventTimeline.js","names":["phArrowsLeftRight","phSparkle","phUser","phWarning"],"sources":["../../../src/components/EventTimeline/EventTimeline.tsx"],"sourcesContent":["import { cx } from '../../internal/util';\nimport { format } from '../../format';\nimport { tr } from '../../i18n';\nimport {
|
|
1
|
+
{"version":3,"file":"EventTimeline.js","names":["phArrowsLeftRight","phSparkle","phUser","phWarning"],"sources":["../../../src/components/EventTimeline/EventTimeline.tsx"],"sourcesContent":["import * as React from 'react';\nimport { cx } from '../../internal/util';\nimport { devWarn } from '../../internal/dev';\nimport { format, sameDay } from '../../format';\nimport { tr } from '../../i18n';\nimport { IconOf, type IconSource } from '../../icons/Icon';\nimport { includeIcons } from '../../icons/store';\nimport phArrowsLeftRight from '../../icons/ph/arrows-left-right';\nimport phSparkle from '../../icons/ph/sparkle';\nimport phUser from '../../icons/ph/user';\nimport phWarning from '../../icons/ph/warning';\nimport { codeText } from '../InlineCode/InlineCode';\n\nincludeIcons(phArrowsLeftRight, phSparkle, phUser, phWarning);\n\n/** The built-in kinds of a monitoring timeline. */\nexport type EventKind = 'alert' | 'switch' | 'ai' | 'manual';\n\n/** How a kind of event looks: its icon, the name read aloud, and the icon's colour. */\nexport interface TimelineKind {\n icon: IconSource;\n /** Read aloud for the icon: 「付款」. */\n label: string;\n /** Colour of the icon. Default 'neutral' (ink-muted); colour only what needs attention. */\n tone?: 'neutral' | 'info' | 'success' | 'warning' | 'danger';\n}\n\nexport interface TimelineEvent {\n id?: string;\n time: Date;\n /** A key of `kinds`, or a built-in one: alert 告警, switch 切換, ai AI, manual 人工. */\n kind: EventKind | (string & {});\n /** What happened, one short sentence: 「F 區進氣溫度超過上限 29 °C」; `backticks` are code. */\n text: string;\n /** Who did it, after the sentence: 「王小明」. */\n actor?: string;\n}\n\nexport interface EventTimelineProps {\n /** The events, newest first. */\n events: TimelineEvent[];\n /** What the list is, for screen readers, e.g. 「近 4 小時的事件」. */\n label: string;\n /** Shown when there are no events, e.g. 「近 4 小時沒有事件」. Default 「沒有事件」. */\n empty?: string;\n /** Your own kinds (an order's 建立, 付款, 出貨…), added to the built-in four. */\n kinds?: Record<string, TimelineKind>;\n /** Extra class on the root element. */\n className?: string;\n}\n\nconst BUILT_IN: Record<EventKind, TimelineKind> = {\n alert: { icon: 'warning', label: '告警', tone: 'warning' },\n switch: { icon: 'arrows-left-right', label: '切換', tone: 'info' },\n ai: { icon: 'sparkle', label: 'AI' },\n manual: { icon: 'user', label: '人工' },\n};\n\n/** Events newest first, one row each: the time (Geist Mono), an icon for the kind, what happened and who did it. When\n * the events span several days, a date heads each day. */\nexport function EventTimeline({ events, label, empty, kinds, className }: EventTimelineProps) {\n const list = [...events].sort((a, b) => b.time.getTime() - a.time.getTime());\n const all: Record<string, TimelineKind> = { ...BUILT_IN, ...kinds };\n const unknown = list.find((e) => !all[e.kind]);\n devWarn(unknown, 'EventTimeline', `kind \"${String(unknown?.kind)}\" is not defined. Add it to \\`kinds\\`: { ${String(unknown?.kind)}: { icon, label } }.`);\n if (!list.length) return <p className={cx('ui-events-empty', className)}>{empty ?? tr('沒有事件')}</p>;\n const row = (e: TimelineEvent, i: number) => {\n const k: TimelineKind = all[e.kind] ?? { icon: 'M12 8a4 4 0 1 0 0 8a4 4 0 1 0 0-8z', label: e.kind };\n return (\n <li key={e.id ?? i} className={cx('is-' + e.kind, k.tone && k.tone !== 'neutral' && 'is-tone-' + k.tone)}>\n <time className=\"ui-events-time\" dateTime={e.time.toISOString()}>\n {format.time(e.time)}\n </time>\n <span className=\"ui-events-kind\" role=\"img\" aria-label={tr(k.label)}>\n <IconOf icon={k.icon} size={20} />\n </span>\n <span className=\"ui-events-text\">\n {codeText(e.text)}\n {e.actor ? <span className=\"ui-events-actor\">{e.actor}</span> : null}\n </span>\n </li>\n );\n };\n const days: TimelineEvent[][] = [];\n for (const e of list) {\n const last = days[days.length - 1];\n if (last && sameDay(last[0].time, e.time)) last.push(e);\n else days.push([e]);\n }\n if (days.length === 1)\n return (\n <ol className={cx('ui-events', className)} aria-label={label}>\n {list.map(row)}\n </ol>\n );\n return (\n <div className={cx('ui-events', 'is-days', className)} role=\"group\" aria-label={label}>\n {days.map((day) => {\n const date = format.date(day[0].time);\n return (\n <React.Fragment key={date}>\n <div className=\"ui-events-date\">{date}</div>\n <ol className=\"ui-events-day\" aria-label={date}>\n {day.map(row)}\n </ol>\n </React.Fragment>\n );\n })}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAaA,aAAaA,2BAAmBC,iBAAWC,cAAQC,eAAS;AAsC5D,MAAM,WAA4C;CAChD,OAAO;EAAE,MAAM;EAAW,OAAO;EAAM,MAAM;CAAU;CACvD,QAAQ;EAAE,MAAM;EAAqB,OAAO;EAAM,MAAM;CAAO;CAC/D,IAAI;EAAE,MAAM;EAAW,OAAO;CAAK;CACnC,QAAQ;EAAE,MAAM;EAAQ,OAAO;CAAK;AACtC;;;AAIA,SAAgB,cAAc,EAAE,QAAQ,OAAO,OAAO,OAAO,aAAiC;CAC5F,MAAM,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC,MAAM,GAAG,MAAM,EAAE,KAAK,QAAQ,IAAI,EAAE,KAAK,QAAQ,CAAC;CAC3E,MAAM,MAAoC;EAAE,GAAG;EAAU,GAAG;CAAM;CAClE,MAAM,UAAU,KAAK,MAAM,MAAM,CAAC,IAAI,EAAE,KAAK;CAC7C,QAAQ,SAAS,iBAAiB,SAAS,OAAO,SAAS,IAAI,EAAE,2CAA2C,OAAO,SAAS,IAAI,EAAE,qBAAqB;CACvJ,IAAI,CAAC,KAAK,QAAQ,OAAO,oBAAC,KAAD;EAAG,WAAW,GAAG,mBAAmB,SAAS;EAAI,UAAA,SAAS,GAAG,MAAM;CAAK,CAAA;CACjG,MAAM,OAAO,GAAkB,MAAc;EAC3C,MAAM,IAAkB,IAAI,EAAE,SAAS;GAAE,MAAM;GAAsC,OAAO,EAAE;EAAK;EACnG,OACE,qBAAC,MAAD;GAAoB,WAAW,GAAG,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,aAAa,aAAa,EAAE,IAAI;GAAvG,UAAA;IACE,oBAAC,QAAD;KAAM,WAAU;KAAiB,UAAU,EAAE,KAAK,YAAY;KAC3D,UAAA,OAAO,KAAK,EAAE,IAAI;IACf,CAAA;IACN,oBAAC,QAAD;KAAM,WAAU;KAAiB,MAAK;KAAM,cAAY,GAAG,EAAE,KAAK;KAChE,UAAA,oBAAC,QAAD;MAAQ,MAAM,EAAE;MAAM,MAAM;KAAK,CAAA;IAC7B,CAAA;IACN,qBAAC,QAAD;KAAM,WAAU;KAAhB,UAAA,CACG,SAAS,EAAE,IAAI,GACf,EAAE,QAAQ,oBAAC,QAAD;MAAM,WAAU;MAAmB,UAAA,EAAE;KAAY,CAAA,IAAI,IAC5D;;GACJ;EAXK,GAAA,EAAE,MAAM,CAWb;CAER;CACA,MAAM,OAA0B,CAAC;CACjC,KAAK,MAAM,KAAK,MAAM;EACpB,MAAM,OAAO,KAAK,KAAK,SAAS;EAChC,IAAI,QAAQ,QAAQ,KAAK,EAAE,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK,KAAK,CAAC;OACjD,KAAK,KAAK,CAAC,CAAC,CAAC;CACpB;CACA,IAAI,KAAK,WAAW,GAClB,OACE,oBAAC,MAAD;EAAI,WAAW,GAAG,aAAa,SAAS;EAAG,cAAY;EACpD,UAAA,KAAK,IAAI,GAAG;CACX,CAAA;CAER,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,aAAa,WAAW,SAAS;EAAG,MAAK;EAAQ,cAAY;EAC7E,UAAA,KAAK,KAAK,QAAQ;GACjB,MAAM,OAAO,OAAO,KAAK,IAAI,EAAE,CAAC,IAAI;GACpC,OACE,qBAAC,MAAM,UAAP,EAAA,UAAA,CACE,oBAAC,OAAD;IAAK,WAAU;IAAkB,UAAA;GAAU,CAAA,GAC3C,oBAAC,MAAD;IAAI,WAAU;IAAgB,cAAY;IACvC,UAAA,IAAI,IAAI,GAAG;GACV,CAAA,CACU,EAAA,GALK,IAKL;EAEpB,CAAC;CACE,CAAA;AAET"}
|
|
@@ -6,21 +6,29 @@ export interface UploadFile {
|
|
|
6
6
|
size?: string;
|
|
7
7
|
/** 0 to 100 while uploading. */
|
|
8
8
|
progress?: number;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/** 'danger': the upload failed; write why in `error`. ('error' is the old name of 'danger'.) */
|
|
10
|
+
status?: 'uploading' | 'done' | 'danger' | 'error';
|
|
11
|
+
/** The cause and the fix, shown in red; `backticks` are code. */
|
|
11
12
|
error?: string;
|
|
12
13
|
}
|
|
13
14
|
export interface FileUploadProps {
|
|
15
|
+
/** The field's label above the drop zone. */
|
|
14
16
|
label?: string;
|
|
17
|
+
/** The files added so far, with their upload progress and status. */
|
|
15
18
|
files?: UploadFile[];
|
|
19
|
+
/** Called with the files the person picked or dropped; upload them and update files. */
|
|
16
20
|
onAdd?: (files: File[]) => void;
|
|
21
|
+
/** Called by a file's × button. */
|
|
17
22
|
onRemove?: (file: UploadFile) => void;
|
|
23
|
+
/** Called by 「重試」 on a file whose status is danger. */
|
|
18
24
|
onRetry?: (file: UploadFile) => void;
|
|
19
25
|
/** Written inside the drop zone, e.g. 「每個最大 100 MB」. */
|
|
20
26
|
limitText?: string;
|
|
27
|
+
/** File types the picker offers, as in <input accept>, e.g. ".pdf,image/*". */
|
|
21
28
|
accept?: string;
|
|
22
29
|
/** Default true. */
|
|
23
30
|
multiple?: boolean;
|
|
31
|
+
/** Extra class on the root element. */
|
|
24
32
|
className?: string;
|
|
25
33
|
}
|
|
26
34
|
/** A one-line drop zone and a list of files with progress. The upload itself is yours: pass files with progress and status. */
|
|
@@ -2,18 +2,21 @@
|
|
|
2
2
|
import { tr } from "../../i18n.js";
|
|
3
3
|
import { Icon } from "../../icons/Icon.js";
|
|
4
4
|
import { cx } from "../../internal/util.js";
|
|
5
|
+
import { devWarn } from "../../internal/dev.js";
|
|
5
6
|
import { FieldLabel } from "../../internal/Field.js";
|
|
6
7
|
import { ProgressBar } from "../ProgressBar/ProgressBar.js";
|
|
7
8
|
import { includeIcons } from "../../icons/store.js";
|
|
8
9
|
import file_default from "../../icons/ph/file.js";
|
|
9
10
|
import upload_simple_default from "../../icons/ph/upload-simple.js";
|
|
10
11
|
import x_default from "../../icons/ph/x.js";
|
|
12
|
+
import { codeText } from "../InlineCode/InlineCode.js";
|
|
11
13
|
import * as React from "react";
|
|
12
14
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
15
|
// src/components/FileUpload/FileUpload.tsx
|
|
14
16
|
includeIcons(file_default, upload_simple_default, x_default);
|
|
15
17
|
/** A one-line drop zone and a list of files with progress. The upload itself is yours: pass files with progress and status. */
|
|
16
18
|
function FileUpload({ label, files = [], onAdd, onRemove, onRetry, limitText, accept, multiple = true, className }) {
|
|
19
|
+
devWarn(() => files.some((f) => f.status === "error"), "FileUpload", "status: 'error' is the old name, kept for now. Write status: 'danger', the tone name the other components use.");
|
|
17
20
|
const [drag, setDrag] = React.useState(false);
|
|
18
21
|
const input = React.useRef(null);
|
|
19
22
|
const add = (list) => {
|
|
@@ -70,7 +73,7 @@ function FileUpload({ label, files = [], onAdd, onRemove, onRetry, limitText, ac
|
|
|
70
73
|
files.length ? /* @__PURE__ */ jsx("ul", {
|
|
71
74
|
className: "ui-upload-list",
|
|
72
75
|
children: files.map((fl) => {
|
|
73
|
-
const fail = fl.status === "error";
|
|
76
|
+
const fail = fl.status === "danger" || fl.status === "error";
|
|
74
77
|
return /* @__PURE__ */ jsxs("li", {
|
|
75
78
|
className: cx("ui-upload-item", fail && "is-error"),
|
|
76
79
|
children: [
|
|
@@ -96,7 +99,7 @@ function FileUpload({ label, files = [], onAdd, onRemove, onRetry, limitText, ac
|
|
|
96
99
|
}) : /* @__PURE__ */ jsxs("div", {
|
|
97
100
|
className: "ui-upload-error",
|
|
98
101
|
role: "alert",
|
|
99
|
-
children: [fl.error || tr("上傳失敗,請再試一次。"), onRetry ? /* @__PURE__ */ jsx("button", {
|
|
102
|
+
children: [codeText(fl.error || tr("上傳失敗,請再試一次。")), onRetry ? /* @__PURE__ */ jsx("button", {
|
|
100
103
|
type: "button",
|
|
101
104
|
className: "ui-link-btn",
|
|
102
105
|
onClick: () => onRetry(fl),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileUpload.js","names":["phFile","phUploadSimple","phX"],"sources":["../../../src/components/FileUpload/FileUpload.tsx"],"sourcesContent":["import * as React from 'react';\nimport { tr } from '../../i18n';\nimport { Icon } from '../../icons/Icon';\nimport { cx } from '../../internal/util';\nimport { FieldLabel } from '../../internal/Field';\nimport { ProgressBar } from '../ProgressBar/ProgressBar';\nimport { includeIcons } from '../../icons/store';\nimport phFile from '../../icons/ph/file';\nimport phUploadSimple from '../../icons/ph/upload-simple';\nimport phX from '../../icons/ph/x';\n\nincludeIcons(phFile, phUploadSimple, phX);\n\nexport interface UploadFile {\n id?: string | number;\n name: string;\n /** format.fileSize(bytes), e.g. 「1.2 MB」. */\n size?: string;\n /** 0 to 100 while uploading. */\n progress?: number;\n status?: 'uploading' | 'done' | 'error';\n /** The cause and the fix, shown in red. */\n error?: string;\n}\n\nexport interface FileUploadProps {\n label?: string;\n files?: UploadFile[];\n onAdd?: (files: File[]) => void;\n onRemove?: (file: UploadFile) => void;\n onRetry?: (file: UploadFile) => void;\n /** Written inside the drop zone, e.g. 「每個最大 100 MB」. */\n limitText?: string;\n accept?: string;\n /** Default true. */\n multiple?: boolean;\n className?: string;\n}\n\n/** A one-line drop zone and a list of files with progress. The upload itself is yours: pass files with progress and status. */\nexport function FileUpload({ label, files = [], onAdd, onRemove, onRetry, limitText, accept, multiple = true, className }: FileUploadProps) {\n const [drag, setDrag] = React.useState(false);\n const input = React.useRef<HTMLInputElement>(null);\n const add = (list: FileList | null) => {\n const arr = Array.from(list ?? []);\n if (arr.length) onAdd?.(arr);\n };\n return (\n <div className={cx('ui-upload', className)}>\n {label ? <FieldLabel>{label}</FieldLabel> : null}\n <div\n className={cx('ui-dropline', drag && 'is-drag')}\n onDragOver={(e) => {\n e.preventDefault();\n setDrag(true);\n }}\n onDragLeave={() => setDrag(false)}\n onDrop={(e) => {\n e.preventDefault();\n setDrag(false);\n add(e.dataTransfer.files);\n }}\n >\n <Icon name=\"upload-simple\" size={18} />\n <span className=\"ui-dropline-text\">\n {tr('拖放檔案,或 ')}\n <button type=\"button\" className=\"ui-link-btn\" onClick={() => input.current?.click()}>\n {tr('選擇檔案')}\n </button>\n </span>\n {limitText ? <span className=\"ui-dropline-limit\">{limitText}</span> : null}\n <input\n ref={input}\n type=\"file\"\n multiple={multiple}\n accept={accept}\n hidden\n onChange={(e) => {\n add(e.target.files);\n e.target.value = '';\n }}\n />\n </div>\n {files.length ? (\n <ul className=\"ui-upload-list\">\n {files.map((fl) => {\n const fail = fl.status === 'error';\n return (\n <li key={fl.id ?? fl.name} className={cx('ui-upload-item', fail && 'is-error')}>\n <Icon name=\"file\" size={20} className=\"ui-upload-icon\" />\n <div className=\"ui-upload-body\">\n <div className=\"ui-upload-row\">\n <span className=\"ui-upload-name\">{fl.name}</span>\n {fl.size ? <span className=\"ui-upload-size\">{fl.size}</span> : null}\n </div>\n {!fail ? (\n <ProgressBar value={fl.status === 'done' ? 100 : fl.progress || 0} aria-label={tr('{name} 上傳進度', { name: fl.name })} />\n ) : (\n <div className=\"ui-upload-error\" role=\"alert\">\n {fl.error || tr('上傳失敗,請再試一次。')}\n {onRetry ? (\n <button type=\"button\" className=\"ui-link-btn\" onClick={() => onRetry(fl)}>\n {tr('重試')}\n </button>\n ) : null}\n </div>\n )}\n </div>\n {onRemove ? (\n <button type=\"button\" className=\"ui-dialog-close\" aria-label={tr('移除 {name}', { name: fl.name })} onClick={() => onRemove(fl)}>\n <Icon name=\"x\" size={16} />\n </button>\n ) : null}\n </li>\n );\n })}\n </ul>\n ) : null}\n </div>\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"FileUpload.js","names":["phFile","phUploadSimple","phX"],"sources":["../../../src/components/FileUpload/FileUpload.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 { FieldLabel } from '../../internal/Field';\nimport { ProgressBar } from '../ProgressBar/ProgressBar';\nimport { includeIcons } from '../../icons/store';\nimport phFile from '../../icons/ph/file';\nimport phUploadSimple from '../../icons/ph/upload-simple';\nimport phX from '../../icons/ph/x';\nimport { codeText } from '../InlineCode/InlineCode';\n\nincludeIcons(phFile, phUploadSimple, phX);\n\nexport interface UploadFile {\n id?: string | number;\n name: string;\n /** format.fileSize(bytes), e.g. 「1.2 MB」. */\n size?: string;\n /** 0 to 100 while uploading. */\n progress?: number;\n /** 'danger': the upload failed; write why in `error`. ('error' is the old name of 'danger'.) */\n status?: 'uploading' | 'done' | 'danger' | 'error';\n /** The cause and the fix, shown in red; `backticks` are code. */\n error?: string;\n}\n\nexport interface FileUploadProps {\n /** The field's label above the drop zone. */\n label?: string;\n /** The files added so far, with their upload progress and status. */\n files?: UploadFile[];\n /** Called with the files the person picked or dropped; upload them and update files. */\n onAdd?: (files: File[]) => void;\n /** Called by a file's × button. */\n onRemove?: (file: UploadFile) => void;\n /** Called by 「重試」 on a file whose status is danger. */\n onRetry?: (file: UploadFile) => void;\n /** Written inside the drop zone, e.g. 「每個最大 100 MB」. */\n limitText?: string;\n /** File types the picker offers, as in <input accept>, e.g. \".pdf,image/*\". */\n accept?: string;\n /** Default true. */\n multiple?: boolean;\n /** Extra class on the root element. */\n className?: string;\n}\n\n/** A one-line drop zone and a list of files with progress. The upload itself is yours: pass files with progress and status. */\nexport function FileUpload({ label, files = [], onAdd, onRemove, onRetry, limitText, accept, multiple = true, className }: FileUploadProps) {\n devWarn(\n () => files.some((f) => f.status === 'error'),\n 'FileUpload',\n \"status: 'error' is the old name, kept for now. Write status: 'danger', the tone name the other components use.\",\n );\n const [drag, setDrag] = React.useState(false);\n const input = React.useRef<HTMLInputElement>(null);\n const add = (list: FileList | null) => {\n const arr = Array.from(list ?? []);\n if (arr.length) onAdd?.(arr);\n };\n return (\n <div className={cx('ui-upload', className)}>\n {label ? <FieldLabel>{label}</FieldLabel> : null}\n <div\n className={cx('ui-dropline', drag && 'is-drag')}\n onDragOver={(e) => {\n e.preventDefault();\n setDrag(true);\n }}\n onDragLeave={() => setDrag(false)}\n onDrop={(e) => {\n e.preventDefault();\n setDrag(false);\n add(e.dataTransfer.files);\n }}\n >\n <Icon name=\"upload-simple\" size={18} />\n <span className=\"ui-dropline-text\">\n {tr('拖放檔案,或 ')}\n <button type=\"button\" className=\"ui-link-btn\" onClick={() => input.current?.click()}>\n {tr('選擇檔案')}\n </button>\n </span>\n {limitText ? <span className=\"ui-dropline-limit\">{limitText}</span> : null}\n <input\n ref={input}\n type=\"file\"\n multiple={multiple}\n accept={accept}\n hidden\n onChange={(e) => {\n add(e.target.files);\n e.target.value = '';\n }}\n />\n </div>\n {files.length ? (\n <ul className=\"ui-upload-list\">\n {files.map((fl) => {\n const fail = fl.status === 'danger' || fl.status === 'error';\n return (\n <li key={fl.id ?? fl.name} className={cx('ui-upload-item', fail && 'is-error')}>\n <Icon name=\"file\" size={20} className=\"ui-upload-icon\" />\n <div className=\"ui-upload-body\">\n <div className=\"ui-upload-row\">\n <span className=\"ui-upload-name\">{fl.name}</span>\n {fl.size ? <span className=\"ui-upload-size\">{fl.size}</span> : null}\n </div>\n {!fail ? (\n <ProgressBar value={fl.status === 'done' ? 100 : fl.progress || 0} aria-label={tr('{name} 上傳進度', { name: fl.name })} />\n ) : (\n <div className=\"ui-upload-error\" role=\"alert\">\n {codeText(fl.error || tr('上傳失敗,請再試一次。'))}\n {onRetry ? (\n <button type=\"button\" className=\"ui-link-btn\" onClick={() => onRetry(fl)}>\n {tr('重試')}\n </button>\n ) : null}\n </div>\n )}\n </div>\n {onRemove ? (\n <button type=\"button\" className=\"ui-dialog-close\" aria-label={tr('移除 {name}', { name: fl.name })} onClick={() => onRemove(fl)}>\n <Icon name=\"x\" size={16} />\n </button>\n ) : null}\n </li>\n );\n })}\n </ul>\n ) : null}\n </div>\n );\n}\n"],"mappings":"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"}
|