@primecoderin/fast-ui-react 0.0.0-stage → 0.1.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/CHANGELOG.md +90 -0
- package/LICENSE +21 -0
- package/README.md +180 -3
- package/dist/_virtual/_rolldown/runtime.js +12 -0
- package/dist/charts.d.ts +7 -0
- package/dist/charts.js +7 -0
- package/dist/components/Avatar/Avatar.d.ts +12 -0
- package/dist/components/Avatar/Avatar.js +92 -0
- package/dist/components/Button/Button.d.ts +44 -0
- package/dist/components/Button/Button.js +221 -0
- package/dist/components/Checkbox/CheckboxBox.d.ts +33 -0
- package/dist/components/Checkbox/CheckboxBox.js +148 -0
- package/dist/components/CodeSnippet/CodeSnippet.d.ts +26 -0
- package/dist/components/CodeSnippet/CodeSnippet.js +153 -0
- package/dist/components/Collapsible/Collapsible.d.ts +20 -0
- package/dist/components/Collapsible/Collapsible.js +97 -0
- package/dist/components/Container/Container.d.ts +301 -0
- package/dist/components/Container/Container.js +20 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.d.ts +22 -0
- package/dist/components/FloatingActionButton/FloatingActionButton.js +141 -0
- package/dist/components/Grid/Grid.d.ts +311 -0
- package/dist/components/Grid/Grid.js +30 -0
- package/dist/components/IconTile/IconTile.d.ts +12 -0
- package/dist/components/IconTile/IconTile.js +70 -0
- package/dist/components/InlineError/InlineError.d.ts +9 -0
- package/dist/components/InlineError/InlineError.js +62 -0
- package/dist/components/Kbd/Kbd.d.ts +11 -0
- package/dist/components/Kbd/Kbd.js +31 -0
- package/dist/components/Link/Link.d.ts +18 -0
- package/dist/components/Link/Link.js +68 -0
- package/dist/components/Menu/ContextMenu.d.ts +18 -0
- package/dist/components/Menu/ContextMenu.js +68 -0
- package/dist/components/Menu/Menu.d.ts +86 -0
- package/dist/components/Menu/Menu.js +394 -0
- package/dist/components/OtpInput/OtpInput.d.ts +32 -0
- package/dist/components/OtpInput/OtpInput.js +177 -0
- package/dist/components/Popover/HoverPopover.d.ts +22 -0
- package/dist/components/Popover/HoverPopover.js +74 -0
- package/dist/components/Popover/Popover.d.ts +21 -0
- package/dist/components/Popover/Popover.js +64 -0
- package/dist/components/ProgressBar/ProgressBar.d.ts +17 -0
- package/dist/components/ProgressBar/ProgressBar.js +44 -0
- package/dist/components/Rating/Rating.d.ts +49 -0
- package/dist/components/Rating/Rating.js +241 -0
- package/dist/components/ScrollArea/ScrollArea.d.ts +23 -0
- package/dist/components/ScrollArea/ScrollArea.js +90 -0
- package/dist/components/SegmentedControl/SegmentedControl.d.ts +29 -0
- package/dist/components/SegmentedControl/SegmentedControl.js +99 -0
- package/dist/components/Separator/Separator.d.ts +9 -0
- package/dist/components/Separator/Separator.js +34 -0
- package/dist/components/Skeleton/Skeleton.d.ts +31 -0
- package/dist/components/Skeleton/Skeleton.js +152 -0
- package/dist/components/Slider/Slider.d.ts +54 -0
- package/dist/components/Slider/Slider.js +178 -0
- package/dist/components/Spinner/Spinner.d.ts +17 -0
- package/dist/components/Spinner/Spinner.js +118 -0
- package/dist/components/Stack/Stack.d.ts +302 -0
- package/dist/components/Stack/Stack.js +14 -0
- package/dist/components/StateIcon/StateIcon.d.ts +11 -0
- package/dist/components/StateIcon/StateIcon.js +65 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +19 -0
- package/dist/components/StatusBadge/StatusBadge.js +82 -0
- package/dist/components/Tabs/Tabs.d.ts +28 -0
- package/dist/components/Tabs/Tabs.js +109 -0
- package/dist/components/Tag/Tag.d.ts +11 -0
- package/dist/components/Tag/Tag.js +66 -0
- package/dist/components/Toast/AppToaster.d.ts +8 -0
- package/dist/components/Toast/AppToaster.js +135 -0
- package/dist/components/Toast/toast-manager.d.ts +28 -0
- package/dist/components/Toast/toast-manager.js +47 -0
- package/dist/components/ToggleButton/ToggleButton.d.ts +26 -0
- package/dist/components/ToggleButton/ToggleButton.js +106 -0
- package/dist/components/ToggleGroup/ToggleGroup.d.ts +32 -0
- package/dist/components/ToggleGroup/ToggleGroup.js +79 -0
- package/dist/components/Tooltip/Tooltip.d.ts +16 -0
- package/dist/components/Tooltip/Tooltip.js +58 -0
- package/dist/components/Tooltip/TooltipGroup.d.ts +22 -0
- package/dist/components/Tooltip/TooltipGroup.js +65 -0
- package/dist/components/Typography/Typography.d.ts +17 -0
- package/dist/components/Typography/Typography.js +100 -0
- package/dist/editor-forms.d.ts +1 -0
- package/dist/editor-forms.js +1 -0
- package/dist/editor.d.ts +1 -0
- package/dist/editor.js +1 -0
- package/dist/fonts/LICENSE +93 -0
- package/dist/fonts/inter-cyrillic-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-cyrillic-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-greek-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-vietnamese-wght-normal.woff2 +0 -0
- package/dist/fonts.css +69 -0
- package/dist/forms.d.ts +22 -0
- package/dist/forms.js +23 -0
- package/dist/foundation.css +23 -0
- package/dist/global.css +116 -0
- package/dist/hooks/useAppToast.d.ts +12 -0
- package/dist/hooks/useAppToast.js +29 -0
- package/dist/icons/icons.d.ts +43 -0
- package/dist/icons/icons.js +44 -0
- package/dist/index.d.ts +106 -0
- package/dist/index.js +101 -0
- package/dist/patterns/Accordion/Accordion.d.ts +35 -0
- package/dist/patterns/Accordion/Accordion.js +139 -0
- package/dist/patterns/Alert/Alert.d.ts +38 -0
- package/dist/patterns/Alert/Alert.js +151 -0
- package/dist/patterns/AppShell/AppShell.d.ts +39 -0
- package/dist/patterns/AppShell/AppShell.js +218 -0
- package/dist/patterns/Breadcrumbs/Breadcrumbs.d.ts +21 -0
- package/dist/patterns/Breadcrumbs/Breadcrumbs.js +73 -0
- package/dist/patterns/Calendar/Calendar.d.ts +59 -0
- package/dist/patterns/Calendar/Calendar.js +283 -0
- package/dist/patterns/Calendar/DateRangePicker.d.ts +53 -0
- package/dist/patterns/Calendar/DateRangePicker.js +266 -0
- package/dist/patterns/Calendar/FormDateRangeField.d.ts +24 -0
- package/dist/patterns/Calendar/FormDateRangeField.js +138 -0
- package/dist/patterns/Card/Card.d.ts +26 -0
- package/dist/patterns/Card/Card.js +125 -0
- package/dist/patterns/Carousel/Carousel.d.ts +33 -0
- package/dist/patterns/Carousel/Carousel.js +127 -0
- package/dist/patterns/Cascader/Cascader.d.ts +53 -0
- package/dist/patterns/Cascader/Cascader.js +371 -0
- package/dist/patterns/Cascader/FormCascaderField.d.ts +21 -0
- package/dist/patterns/Cascader/FormCascaderField.js +130 -0
- package/dist/patterns/Charts/AreaChart.d.ts +13 -0
- package/dist/patterns/Charts/AreaChart.js +220 -0
- package/dist/patterns/Charts/BarChart.d.ts +11 -0
- package/dist/patterns/Charts/BarChart.js +220 -0
- package/dist/patterns/Charts/DonutChart.d.ts +37 -0
- package/dist/patterns/Charts/DonutChart.js +215 -0
- package/dist/patterns/Charts/GaugeChart.d.ts +44 -0
- package/dist/patterns/Charts/GaugeChart.js +210 -0
- package/dist/patterns/Charts/LineChart.d.ts +14 -0
- package/dist/patterns/Charts/LineChart.js +222 -0
- package/dist/patterns/Charts/Sparkline.d.ts +24 -0
- package/dist/patterns/Charts/Sparkline.js +81 -0
- package/dist/patterns/Charts/chart-parts.d.ts +139 -0
- package/dist/patterns/Charts/chart-parts.js +385 -0
- package/dist/patterns/Charts/gauge-math.d.ts +20 -0
- package/dist/patterns/Charts/gauge-math.js +21 -0
- package/dist/patterns/Charts/sparkline-path.d.ts +11 -0
- package/dist/patterns/Charts/sparkline-path.js +24 -0
- package/dist/patterns/ColorPicker/ColorPicker.d.ts +50 -0
- package/dist/patterns/ColorPicker/ColorPicker.js +590 -0
- package/dist/patterns/ColorPicker/FormColorField.d.ts +21 -0
- package/dist/patterns/ColorPicker/FormColorField.js +130 -0
- package/dist/patterns/ColorPicker/color-value.d.ts +19 -0
- package/dist/patterns/ColorPicker/color-value.js +72 -0
- package/dist/patterns/Combobox/Autocomplete.d.ts +48 -0
- package/dist/patterns/Combobox/Autocomplete.js +158 -0
- package/dist/patterns/Combobox/Combobox.d.ts +52 -0
- package/dist/patterns/Combobox/Combobox.js +195 -0
- package/dist/patterns/Combobox/ComboboxPopup.d.ts +24 -0
- package/dist/patterns/Combobox/ComboboxPopup.js +107 -0
- package/dist/patterns/Combobox/FormAutocompleteField.d.ts +17 -0
- package/dist/patterns/Combobox/FormAutocompleteField.js +119 -0
- package/dist/patterns/Combobox/FormComboboxField.d.ts +18 -0
- package/dist/patterns/Combobox/FormComboboxField.js +119 -0
- package/dist/patterns/Combobox/FormMultiSelectField.d.ts +18 -0
- package/dist/patterns/Combobox/FormMultiSelectField.js +119 -0
- package/dist/patterns/Combobox/MultiSelect.d.ts +54 -0
- package/dist/patterns/Combobox/MultiSelect.js +175 -0
- package/dist/patterns/CommandPalette/CommandPalette.d.ts +50 -0
- package/dist/patterns/CommandPalette/CommandPalette.js +193 -0
- package/dist/patterns/DataTable/DataTable.d.ts +107 -0
- package/dist/patterns/DataTable/DataTable.js +364 -0
- package/dist/patterns/DateTimePicker/DateTimePanel.d.ts +28 -0
- package/dist/patterns/DateTimePicker/DateTimePanel.js +444 -0
- package/dist/patterns/DateTimePicker/DateTimePicker.d.ts +75 -0
- package/dist/patterns/DateTimePicker/DateTimePicker.js +271 -0
- package/dist/patterns/DateTimePicker/FormDateTimeField.d.ts +32 -0
- package/dist/patterns/DateTimePicker/FormDateTimeField.js +148 -0
- package/dist/patterns/DateTimePicker/TimeSliders.d.ts +14 -0
- package/dist/patterns/DateTimePicker/TimeSliders.js +206 -0
- package/dist/patterns/DateTimePicker/picker-labels.d.ts +30 -0
- package/dist/patterns/DateTimePicker/picker-labels.js +23 -0
- package/dist/patterns/DateTimePicker/picker-values.d.ts +98 -0
- package/dist/patterns/DateTimePicker/picker-values.js +194 -0
- package/dist/patterns/DescriptionList/DescriptionList.d.ts +20 -0
- package/dist/patterns/DescriptionList/DescriptionList.js +57 -0
- package/dist/patterns/Dialog/Dialog.d.ts +26 -0
- package/dist/patterns/Dialog/Dialog.js +212 -0
- package/dist/patterns/Drawer/Drawer.d.ts +33 -0
- package/dist/patterns/Drawer/Drawer.js +153 -0
- package/dist/patterns/EmptyState/EmptyState.d.ts +35 -0
- package/dist/patterns/EmptyState/EmptyState.js +44 -0
- package/dist/patterns/FileUpload/FileUpload.d.ts +87 -0
- package/dist/patterns/FileUpload/FileUpload.js +417 -0
- package/dist/patterns/FileUpload/FormFileUploadField.d.ts +19 -0
- package/dist/patterns/FileUpload/FormFileUploadField.js +117 -0
- package/dist/patterns/FileUpload/add-files.d.ts +26 -0
- package/dist/patterns/FileUpload/add-files.js +35 -0
- package/dist/patterns/FileUpload/file-size.d.ts +14 -0
- package/dist/patterns/FileUpload/file-size.js +44 -0
- package/dist/patterns/FormField/CheckboxField.d.ts +26 -0
- package/dist/patterns/FormField/CheckboxField.js +97 -0
- package/dist/patterns/FormField/FieldFrame.d.ts +85 -0
- package/dist/patterns/FormField/FieldFrame.js +257 -0
- package/dist/patterns/FormField/FormCheckboxField.d.ts +17 -0
- package/dist/patterns/FormField/FormCheckboxField.js +92 -0
- package/dist/patterns/FormField/FormRadioGroupField.d.ts +16 -0
- package/dist/patterns/FormField/FormRadioGroupField.js +97 -0
- package/dist/patterns/FormField/FormRatingField.d.ts +19 -0
- package/dist/patterns/FormField/FormRatingField.js +119 -0
- package/dist/patterns/FormField/FormSelectField.d.ts +16 -0
- package/dist/patterns/FormField/FormSelectField.js +91 -0
- package/dist/patterns/FormField/FormSliderField.d.ts +22 -0
- package/dist/patterns/FormField/FormSliderField.js +128 -0
- package/dist/patterns/FormField/FormSwitchField.d.ts +19 -0
- package/dist/patterns/FormField/FormSwitchField.js +88 -0
- package/dist/patterns/FormField/FormTextAreaField.d.ts +12 -0
- package/dist/patterns/FormField/FormTextAreaField.js +91 -0
- package/dist/patterns/FormField/FormTextField.d.ts +23 -0
- package/dist/patterns/FormField/FormTextField.js +103 -0
- package/dist/patterns/FormField/RadioGroupField.d.ts +38 -0
- package/dist/patterns/FormField/RadioGroupField.js +201 -0
- package/dist/patterns/FormField/SelectField.d.ts +43 -0
- package/dist/patterns/FormField/SelectField.js +211 -0
- package/dist/patterns/FormField/SwitchField.d.ts +27 -0
- package/dist/patterns/FormField/SwitchField.js +105 -0
- package/dist/patterns/FormField/TextAreaField.d.ts +37 -0
- package/dist/patterns/FormField/TextAreaField.js +134 -0
- package/dist/patterns/FormField/TextField.d.ts +51 -0
- package/dist/patterns/FormField/TextField.js +256 -0
- package/dist/patterns/FormField/error-message.d.ts +6 -0
- package/dist/patterns/FormField/error-message.js +8 -0
- package/dist/patterns/FormField/field-styles.d.ts +44 -0
- package/dist/patterns/FormField/field-styles.js +89 -0
- package/dist/patterns/FormField/field-types.d.ts +4 -0
- package/dist/patterns/FormField/use-field-ids.d.ts +18 -0
- package/dist/patterns/FormField/use-field-ids.js +53 -0
- package/dist/patterns/List/List.d.ts +38 -0
- package/dist/patterns/List/List.js +174 -0
- package/dist/patterns/MentionsInput/FormMentionsField.d.ts +18 -0
- package/dist/patterns/MentionsInput/FormMentionsField.js +124 -0
- package/dist/patterns/MentionsInput/MentionsInput.d.ts +57 -0
- package/dist/patterns/MentionsInput/MentionsInput.js +133 -0
- package/dist/patterns/MentionsInput/mention-text.d.ts +24 -0
- package/dist/patterns/MentionsInput/mention-text.js +31 -0
- package/dist/patterns/Menubar/Menubar.d.ts +22 -0
- package/dist/patterns/Menubar/Menubar.js +79 -0
- package/dist/patterns/NavigationMenu/NavigationMenu.d.ts +27 -0
- package/dist/patterns/NavigationMenu/NavigationMenu.js +104 -0
- package/dist/patterns/NumberField/FormNumberField.d.ts +18 -0
- package/dist/patterns/NumberField/FormNumberField.js +119 -0
- package/dist/patterns/NumberField/NumberField.d.ts +57 -0
- package/dist/patterns/NumberField/NumberField.js +242 -0
- package/dist/patterns/Pagination/Pagination.d.ts +31 -0
- package/dist/patterns/Pagination/Pagination.js +275 -0
- package/dist/patterns/Pagination/page-items.d.ts +18 -0
- package/dist/patterns/Pagination/page-items.js +40 -0
- package/dist/patterns/PhoneField/FormPhoneField.d.ts +22 -0
- package/dist/patterns/PhoneField/FormPhoneField.js +97 -0
- package/dist/patterns/PhoneField/PhoneField.d.ts +60 -0
- package/dist/patterns/PhoneField/PhoneField.js +448 -0
- package/dist/patterns/PhoneField/phone-value.d.ts +26 -0
- package/dist/patterns/PhoneField/phone-value.js +38 -0
- package/dist/patterns/QRCode/QRCode.d.ts +37 -0
- package/dist/patterns/QRCode/QRCode.js +120 -0
- package/dist/patterns/QRCode/qr-path.d.ts +7 -0
- package/dist/patterns/QRCode/qr-path.js +25 -0
- package/dist/patterns/ResizablePanels/ResizablePanels.d.ts +34 -0
- package/dist/patterns/ResizablePanels/ResizablePanels.js +175 -0
- package/dist/patterns/ResizablePanels/panel-sizes.d.ts +31 -0
- package/dist/patterns/ResizablePanels/panel-sizes.js +54 -0
- package/dist/patterns/RichTextEditor/FormRichTextField.d.ts +18 -0
- package/dist/patterns/RichTextEditor/FormRichTextField.js +118 -0
- package/dist/patterns/RichTextEditor/RichTextEditor.d.ts +71 -0
- package/dist/patterns/RichTextEditor/RichTextEditor.js +453 -0
- package/dist/patterns/SearchInput/SearchInput.d.ts +26 -0
- package/dist/patterns/SearchInput/SearchInput.js +98 -0
- package/dist/patterns/SideNav/SideNav.d.ts +50 -0
- package/dist/patterns/SideNav/SideNav.js +269 -0
- package/dist/patterns/Stat/Stat.d.ts +51 -0
- package/dist/patterns/Stat/Stat.js +292 -0
- package/dist/patterns/Stepper/Stepper.d.ts +35 -0
- package/dist/patterns/Stepper/Stepper.js +110 -0
- package/dist/patterns/TagGroup/TagGroup.d.ts +44 -0
- package/dist/patterns/TagGroup/TagGroup.js +151 -0
- package/dist/patterns/TagsInput/FormTagsInputField.d.ts +18 -0
- package/dist/patterns/TagsInput/FormTagsInputField.js +124 -0
- package/dist/patterns/TagsInput/TagsInput.d.ts +51 -0
- package/dist/patterns/TagsInput/TagsInput.js +97 -0
- package/dist/patterns/Timeline/Timeline.d.ts +29 -0
- package/dist/patterns/Timeline/Timeline.js +85 -0
- package/dist/patterns/Toolbar/Toolbar.d.ts +31 -0
- package/dist/patterns/Toolbar/Toolbar.js +105 -0
- package/dist/patterns/Tour/Tour.d.ts +38 -0
- package/dist/patterns/Tour/Tour.js +333 -0
- package/dist/patterns/TransferList/FormTransferListField.d.ts +19 -0
- package/dist/patterns/TransferList/FormTransferListField.js +117 -0
- package/dist/patterns/TransferList/TransferList.d.ts +53 -0
- package/dist/patterns/TransferList/TransferList.js +441 -0
- package/dist/patterns/TreeSelect/FormTreeSelectField.d.ts +28 -0
- package/dist/patterns/TreeSelect/FormTreeSelectField.js +88 -0
- package/dist/patterns/TreeSelect/TreeSelect.d.ts +49 -0
- package/dist/patterns/TreeSelect/TreeSelect.js +375 -0
- package/dist/patterns/TreeView/TreeView.d.ts +40 -0
- package/dist/patterns/TreeView/TreeView.js +296 -0
- package/dist/provider/DesignSystemProvider.d.ts +54 -0
- package/dist/provider/DesignSystemProvider.js +270 -0
- package/dist/provider/nonce.d.ts +7 -0
- package/dist/provider/nonce.js +13 -0
- package/dist/styles.css +2 -0
- package/dist/theme/chart-palette.d.ts +51 -0
- package/dist/theme/chart-palette.js +112 -0
- package/dist/theme/create-theme.d.ts +52 -0
- package/dist/theme/create-theme.js +75 -0
- package/dist/theme/style-element.d.ts +28 -0
- package/dist/theme/style-element.js +79 -0
- package/dist/theme/tenant-branding.d.ts +48 -0
- package/dist/theme/tenant-branding.js +65 -0
- package/dist/theme/theme-switch.d.ts +25 -0
- package/dist/theme/theme-switch.js +90 -0
- package/dist/theme/token-names.d.ts +3 -0
- package/dist/theme/token-names.js +166 -0
- package/dist/theme.css +241 -0
- package/dist/tokens.css +383 -0
- package/dist/types/direction.d.ts +4 -0
- package/dist/types/tone.d.ts +7 -0
- package/dist/utils/cn.d.ts +7 -0
- package/dist/utils/cn.js +50 -0
- package/dist/utils/first-field.d.ts +8 -0
- package/dist/utils/first-field.js +10 -0
- package/dist/utils/layout.d.ts +33 -0
- package/dist/utils/layout.js +30 -0
- package/dist/utils/popup.d.ts +12 -0
- package/dist/utils/popup.js +27 -0
- package/docs/accessibility.md +61 -0
- package/docs/advanced-components.md +38 -0
- package/docs/ai-assistants.md +44 -0
- package/docs/architecture.md +65 -0
- package/docs/browser-support.md +30 -0
- package/docs/charts.md +56 -0
- package/docs/components.md +2928 -0
- package/docs/conventions.md +19 -0
- package/docs/customization.md +79 -0
- package/docs/dates-files-data.md +48 -0
- package/docs/design-principles.md +50 -0
- package/docs/faq.md +68 -0
- package/docs/forms.md +114 -0
- package/docs/getting-started.md +64 -0
- package/docs/icons.md +48 -0
- package/docs/internationalization.md +64 -0
- package/docs/layout-and-navigation.md +51 -0
- package/docs/nextjs.md +69 -0
- package/docs/releasing.md +41 -0
- package/docs/testing.md +242 -0
- package/docs/theming.md +118 -0
- package/docs/typescript.md +62 -0
- package/llms-full.txt +4574 -0
- package/llms.txt +52 -0
- package/package.json +166 -6
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** The texts of the shell. The design system has no i18n, so the caller supplies them. */
|
|
3
|
+
export interface AppShellLabels {
|
|
4
|
+
/** The drawer's accessible name on a narrow screen, e.g. "Main navigation". */
|
|
5
|
+
navigation: string;
|
|
6
|
+
/** Accessible name of the header button that opens the navigation on a narrow screen, e.g. "Open menu". */
|
|
7
|
+
openNavigation: string;
|
|
8
|
+
/**
|
|
9
|
+
* Accessible name of the button at the top of the narrow screen's drawer that closes it, e.g. "Close menu". A
|
|
10
|
+
* touch screen reader has no Escape key and cannot find the dimmed page to tap: this button is its way out.
|
|
11
|
+
*/
|
|
12
|
+
closeNavigation: string;
|
|
13
|
+
/** A link at the very start of the page that jumps past the header and navigation, e.g. "Skip to content". Leave it out for none. */
|
|
14
|
+
skipToContent?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface AppShellProps {
|
|
17
|
+
/** The header: the app's name, search, the account menu. It is a sticky bar the page scrolls under. */
|
|
18
|
+
header: ReactNode;
|
|
19
|
+
/** The navigation, usually a SideNav. It is a column on a wide screen and the content of a drawer on a narrow one. */
|
|
20
|
+
nav: ReactNode;
|
|
21
|
+
/** The page. It is the `<main>`. */
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
labels: AppShellLabels;
|
|
24
|
+
/** Whether the navigation drawer is open (on a narrow screen). */
|
|
25
|
+
navOpen: boolean;
|
|
26
|
+
/** Called when the drawer should open or close: the header button, a click outside, Escape. */
|
|
27
|
+
onNavOpenChange: (open: boolean) => void;
|
|
28
|
+
/** Make the navigation column narrow, for icons only (pass the same to SideNav's `collapsed`). */
|
|
29
|
+
navCollapsed?: boolean | undefined;
|
|
30
|
+
className?: string | undefined;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The frame of an application: a sticky header, the navigation down the side, and the page. From the `md`
|
|
34
|
+
* breakpoint the navigation is a column beside the page (`--fast-size-sidenav` wide, `--fast-size-sidenav-collapsed`
|
|
35
|
+
* when collapsed); on a narrower screen it is a drawer that the header's menu button opens and its own close button,
|
|
36
|
+
* Escape or a tap on the page closes, and that closes by itself if the window grows. The page is a `<main>` that a
|
|
37
|
+
* skip link reaches. The sizes are tokens.
|
|
38
|
+
*/
|
|
39
|
+
export declare const AppShell: ({ header, nav, children, labels, navOpen, onNavOpenChange, navCollapsed, className }: AppShellProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { useEffect, useId } from "react";
|
|
4
|
+
import { Menu, X } from "lucide-react";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
import { Button } from "../../components/Button/Button.js";
|
|
7
|
+
import { Drawer } from "../Drawer/Drawer.js";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
// src/patterns/AppShell/AppShell.tsx
|
|
10
|
+
/** The width from which the navigation is a column beside the page instead of a drawer: Tailwind's `md`. */
|
|
11
|
+
var WIDE_QUERY = "(min-width: 48rem)";
|
|
12
|
+
/**
|
|
13
|
+
* The frame of an application: a sticky header, the navigation down the side, and the page. From the `md`
|
|
14
|
+
* breakpoint the navigation is a column beside the page (`--fast-size-sidenav` wide, `--fast-size-sidenav-collapsed`
|
|
15
|
+
* when collapsed); on a narrower screen it is a drawer that the header's menu button opens and its own close button,
|
|
16
|
+
* Escape or a tap on the page closes, and that closes by itself if the window grows. The page is a `<main>` that a
|
|
17
|
+
* skip link reaches. The sizes are tokens.
|
|
18
|
+
*/
|
|
19
|
+
var AppShell = (t0) => {
|
|
20
|
+
const $ = c(49);
|
|
21
|
+
const { header, nav, children, labels, navOpen, onNavOpenChange, navCollapsed: t1, className } = t0;
|
|
22
|
+
const navCollapsed = t1 === void 0 ? false : t1;
|
|
23
|
+
const mainId = useId();
|
|
24
|
+
let t2;
|
|
25
|
+
let t3;
|
|
26
|
+
if ($[0] !== onNavOpenChange) {
|
|
27
|
+
t2 = () => {
|
|
28
|
+
const wide = window.matchMedia(WIDE_QUERY);
|
|
29
|
+
const closeWhenWide = () => {
|
|
30
|
+
if (wide.matches) onNavOpenChange(false);
|
|
31
|
+
};
|
|
32
|
+
wide.addEventListener("change", closeWhenWide);
|
|
33
|
+
return () => {
|
|
34
|
+
wide.removeEventListener("change", closeWhenWide);
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
t3 = [onNavOpenChange];
|
|
38
|
+
$[0] = onNavOpenChange;
|
|
39
|
+
$[1] = t2;
|
|
40
|
+
$[2] = t3;
|
|
41
|
+
} else {
|
|
42
|
+
t2 = $[1];
|
|
43
|
+
t3 = $[2];
|
|
44
|
+
}
|
|
45
|
+
useEffect(t2, t3);
|
|
46
|
+
let t4;
|
|
47
|
+
if ($[3] !== className) {
|
|
48
|
+
t4 = cn("flex min-h-dvh flex-col bg-canvas text-fg", className);
|
|
49
|
+
$[3] = className;
|
|
50
|
+
$[4] = t4;
|
|
51
|
+
} else t4 = $[4];
|
|
52
|
+
let t5;
|
|
53
|
+
if ($[5] !== labels.skipToContent || $[6] !== mainId) {
|
|
54
|
+
t5 = labels.skipToContent ? /* @__PURE__ */ jsx("a", {
|
|
55
|
+
href: `#${mainId}`,
|
|
56
|
+
className: "sr-only z-1300 rounded-md bg-surface px-4 py-2 text-body-sm font-medium text-primary-text shadow-md focus:not-sr-only focus:fixed focus:start-3 focus:top-3 focus:ring-2 focus:ring-focus",
|
|
57
|
+
children: labels.skipToContent
|
|
58
|
+
}) : null;
|
|
59
|
+
$[5] = labels.skipToContent;
|
|
60
|
+
$[6] = mainId;
|
|
61
|
+
$[7] = t5;
|
|
62
|
+
} else t5 = $[7];
|
|
63
|
+
let t6;
|
|
64
|
+
if ($[8] === Symbol.for("react.memo_cache_sentinel")) {
|
|
65
|
+
t6 = /* @__PURE__ */ jsx(Menu, {});
|
|
66
|
+
$[8] = t6;
|
|
67
|
+
} else t6 = $[8];
|
|
68
|
+
let t7;
|
|
69
|
+
if ($[9] !== onNavOpenChange) {
|
|
70
|
+
t7 = () => {
|
|
71
|
+
onNavOpenChange(true);
|
|
72
|
+
};
|
|
73
|
+
$[9] = onNavOpenChange;
|
|
74
|
+
$[10] = t7;
|
|
75
|
+
} else t7 = $[10];
|
|
76
|
+
let t8;
|
|
77
|
+
if ($[11] !== labels.openNavigation || $[12] !== navOpen || $[13] !== t7) {
|
|
78
|
+
t8 = /* @__PURE__ */ jsx(Button, {
|
|
79
|
+
variant: "subtle",
|
|
80
|
+
size: "small",
|
|
81
|
+
className: "md:hidden",
|
|
82
|
+
"aria-label": labels.openNavigation,
|
|
83
|
+
"aria-expanded": navOpen,
|
|
84
|
+
icon: t6,
|
|
85
|
+
onClick: t7
|
|
86
|
+
});
|
|
87
|
+
$[11] = labels.openNavigation;
|
|
88
|
+
$[12] = navOpen;
|
|
89
|
+
$[13] = t7;
|
|
90
|
+
$[14] = t8;
|
|
91
|
+
} else t8 = $[14];
|
|
92
|
+
let t9;
|
|
93
|
+
if ($[15] !== header || $[16] !== t8) {
|
|
94
|
+
t9 = /* @__PURE__ */ jsxs("header", {
|
|
95
|
+
className: "sticky top-0 z-(--fast-z-sticky) flex h-(--fast-size-header) shrink-0 items-center gap-2 border-b border-line bg-surface px-4",
|
|
96
|
+
children: [t8, header]
|
|
97
|
+
});
|
|
98
|
+
$[15] = header;
|
|
99
|
+
$[16] = t8;
|
|
100
|
+
$[17] = t9;
|
|
101
|
+
} else t9 = $[17];
|
|
102
|
+
const t10 = navCollapsed ? "w-(--fast-size-sidenav-collapsed)" : "w-(--fast-size-sidenav)";
|
|
103
|
+
let t11;
|
|
104
|
+
if ($[18] !== t10) {
|
|
105
|
+
t11 = cn("hidden shrink-0 border-e border-line bg-surface transition-[width] duration-200 ease-standard motion-reduce:transition-none md:block", t10);
|
|
106
|
+
$[18] = t10;
|
|
107
|
+
$[19] = t11;
|
|
108
|
+
} else t11 = $[19];
|
|
109
|
+
let t12;
|
|
110
|
+
if ($[20] !== nav) {
|
|
111
|
+
t12 = /* @__PURE__ */ jsx("div", {
|
|
112
|
+
className: "sticky top-(--fast-size-header) flex h-[calc(100dvh-var(--fast-size-header))] flex-col overflow-hidden",
|
|
113
|
+
children: nav
|
|
114
|
+
});
|
|
115
|
+
$[20] = nav;
|
|
116
|
+
$[21] = t12;
|
|
117
|
+
} else t12 = $[21];
|
|
118
|
+
let t13;
|
|
119
|
+
if ($[22] !== t11 || $[23] !== t12) {
|
|
120
|
+
t13 = /* @__PURE__ */ jsx("aside", {
|
|
121
|
+
className: t11,
|
|
122
|
+
children: t12
|
|
123
|
+
});
|
|
124
|
+
$[22] = t11;
|
|
125
|
+
$[23] = t12;
|
|
126
|
+
$[24] = t13;
|
|
127
|
+
} else t13 = $[24];
|
|
128
|
+
let t14;
|
|
129
|
+
if ($[25] !== children || $[26] !== mainId) {
|
|
130
|
+
t14 = /* @__PURE__ */ jsx("main", {
|
|
131
|
+
id: mainId,
|
|
132
|
+
tabIndex: -1,
|
|
133
|
+
className: "min-w-0 flex-1 outline-none",
|
|
134
|
+
children
|
|
135
|
+
});
|
|
136
|
+
$[25] = children;
|
|
137
|
+
$[26] = mainId;
|
|
138
|
+
$[27] = t14;
|
|
139
|
+
} else t14 = $[27];
|
|
140
|
+
let t15;
|
|
141
|
+
if ($[28] !== t13 || $[29] !== t14) {
|
|
142
|
+
t15 = /* @__PURE__ */ jsxs("div", {
|
|
143
|
+
className: "flex min-h-0 flex-1",
|
|
144
|
+
children: [t13, t14]
|
|
145
|
+
});
|
|
146
|
+
$[28] = t13;
|
|
147
|
+
$[29] = t14;
|
|
148
|
+
$[30] = t15;
|
|
149
|
+
} else t15 = $[30];
|
|
150
|
+
let t16;
|
|
151
|
+
if ($[31] === Symbol.for("react.memo_cache_sentinel")) {
|
|
152
|
+
t16 = /* @__PURE__ */ jsx(X, {});
|
|
153
|
+
$[31] = t16;
|
|
154
|
+
} else t16 = $[31];
|
|
155
|
+
let t17;
|
|
156
|
+
if ($[32] !== onNavOpenChange) {
|
|
157
|
+
t17 = () => {
|
|
158
|
+
onNavOpenChange(false);
|
|
159
|
+
};
|
|
160
|
+
$[32] = onNavOpenChange;
|
|
161
|
+
$[33] = t17;
|
|
162
|
+
} else t17 = $[33];
|
|
163
|
+
let t18;
|
|
164
|
+
if ($[34] !== labels.closeNavigation || $[35] !== t17) {
|
|
165
|
+
t18 = /* @__PURE__ */ jsx("div", {
|
|
166
|
+
className: "flex shrink-0 justify-end px-3 pt-3",
|
|
167
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
168
|
+
variant: "subtle",
|
|
169
|
+
size: "small",
|
|
170
|
+
"aria-label": labels.closeNavigation,
|
|
171
|
+
icon: t16,
|
|
172
|
+
onClick: t17
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
$[34] = labels.closeNavigation;
|
|
176
|
+
$[35] = t17;
|
|
177
|
+
$[36] = t18;
|
|
178
|
+
} else t18 = $[36];
|
|
179
|
+
let t19;
|
|
180
|
+
if ($[37] !== labels.navigation || $[38] !== nav || $[39] !== navOpen || $[40] !== onNavOpenChange || $[41] !== t18) {
|
|
181
|
+
t19 = /* @__PURE__ */ jsxs(Drawer, {
|
|
182
|
+
open: navOpen,
|
|
183
|
+
onOpenChange: onNavOpenChange,
|
|
184
|
+
title: labels.navigation,
|
|
185
|
+
hideTitle: true,
|
|
186
|
+
side: "start",
|
|
187
|
+
padding: "none",
|
|
188
|
+
className: "md:hidden",
|
|
189
|
+
children: [t18, nav]
|
|
190
|
+
});
|
|
191
|
+
$[37] = labels.navigation;
|
|
192
|
+
$[38] = nav;
|
|
193
|
+
$[39] = navOpen;
|
|
194
|
+
$[40] = onNavOpenChange;
|
|
195
|
+
$[41] = t18;
|
|
196
|
+
$[42] = t19;
|
|
197
|
+
} else t19 = $[42];
|
|
198
|
+
let t20;
|
|
199
|
+
if ($[43] !== t15 || $[44] !== t19 || $[45] !== t4 || $[46] !== t5 || $[47] !== t9) {
|
|
200
|
+
t20 = /* @__PURE__ */ jsxs("div", {
|
|
201
|
+
className: t4,
|
|
202
|
+
children: [
|
|
203
|
+
t5,
|
|
204
|
+
t9,
|
|
205
|
+
t15,
|
|
206
|
+
t19
|
|
207
|
+
]
|
|
208
|
+
});
|
|
209
|
+
$[43] = t15;
|
|
210
|
+
$[44] = t19;
|
|
211
|
+
$[45] = t4;
|
|
212
|
+
$[46] = t5;
|
|
213
|
+
$[47] = t9;
|
|
214
|
+
$[48] = t20;
|
|
215
|
+
} else t20 = $[48];
|
|
216
|
+
return t20;
|
|
217
|
+
};
|
|
218
|
+
export { AppShell };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ReactElement } from "react";
|
|
2
|
+
export interface BreadcrumbItem {
|
|
3
|
+
label: string;
|
|
4
|
+
/** Where it goes. The last item is the current page and needs none. */
|
|
5
|
+
href?: string | undefined;
|
|
6
|
+
/** The app's router link, `<RouterLink to="/orders" />`, to render in place of the plain `<a>`. */
|
|
7
|
+
render?: ReactElement | undefined;
|
|
8
|
+
}
|
|
9
|
+
export interface BreadcrumbsProps {
|
|
10
|
+
/** The path from the top to the current page, in order. The last item is the current page. */
|
|
11
|
+
items: readonly BreadcrumbItem[];
|
|
12
|
+
/** Accessible name of the navigation, e.g. "Breadcrumb". */
|
|
13
|
+
"aria-label": string;
|
|
14
|
+
className?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The path to the current page: each ancestor a link, the page itself plain text marked `aria-current="page"`. It
|
|
18
|
+
* is a `<nav>` with an ordered list, so a screen reader announces how many levels there are. The separator
|
|
19
|
+
* points the way the page reads.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Breadcrumbs: ({ items, "aria-label": ariaLabel, className }: BreadcrumbsProps) => import("react").JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
3
|
+
import { ChevronRight } from "lucide-react";
|
|
4
|
+
import { cn } from "../../utils/cn.js";
|
|
5
|
+
import { Link } from "../../components/Link/Link.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/patterns/Breadcrumbs/Breadcrumbs.tsx
|
|
8
|
+
/**
|
|
9
|
+
* The path to the current page: each ancestor a link, the page itself plain text marked `aria-current="page"`. It
|
|
10
|
+
* is a `<nav>` with an ordered list, so a screen reader announces how many levels there are. The separator
|
|
11
|
+
* points the way the page reads.
|
|
12
|
+
*/
|
|
13
|
+
var Breadcrumbs = (t0) => {
|
|
14
|
+
const $ = c(10);
|
|
15
|
+
const { items, "aria-label": ariaLabel, className } = t0;
|
|
16
|
+
let t1;
|
|
17
|
+
if ($[0] !== items) {
|
|
18
|
+
let t2;
|
|
19
|
+
if ($[2] !== items.length) {
|
|
20
|
+
t2 = (item, index) => {
|
|
21
|
+
const isLast = index === items.length - 1;
|
|
22
|
+
return /* @__PURE__ */ jsxs("li", {
|
|
23
|
+
className: "inline-flex items-center gap-1.5",
|
|
24
|
+
children: [isLast ? /* @__PURE__ */ jsx("span", {
|
|
25
|
+
"aria-current": "page",
|
|
26
|
+
className: "font-medium text-fg",
|
|
27
|
+
children: item.label
|
|
28
|
+
}) : item.href || item.render ? /* @__PURE__ */ jsx(Link, {
|
|
29
|
+
tone: "inherit",
|
|
30
|
+
...item.href ? { href: item.href } : {},
|
|
31
|
+
...item.render ? { render: item.render } : {},
|
|
32
|
+
className: cn("font-normal text-fg-secondary hover:text-fg"),
|
|
33
|
+
children: item.label
|
|
34
|
+
}) : /* @__PURE__ */ jsx("span", {
|
|
35
|
+
className: "text-fg-secondary",
|
|
36
|
+
children: item.label
|
|
37
|
+
}), isLast ? null : /* @__PURE__ */ jsx(ChevronRight, {
|
|
38
|
+
"aria-hidden": "true",
|
|
39
|
+
className: "size-3.5 shrink-0 text-fg-tertiary rtl:rotate-180"
|
|
40
|
+
})]
|
|
41
|
+
}, `${item.label}-${String(index)}`);
|
|
42
|
+
};
|
|
43
|
+
$[2] = items.length;
|
|
44
|
+
$[3] = t2;
|
|
45
|
+
} else t2 = $[3];
|
|
46
|
+
t1 = items.map(t2);
|
|
47
|
+
$[0] = items;
|
|
48
|
+
$[1] = t1;
|
|
49
|
+
} else t1 = $[1];
|
|
50
|
+
let t2;
|
|
51
|
+
if ($[4] !== t1) {
|
|
52
|
+
t2 = /* @__PURE__ */ jsx("ol", {
|
|
53
|
+
className: "m-0 flex list-none flex-wrap items-center gap-x-1.5 gap-y-1 p-0 text-body-sm",
|
|
54
|
+
children: t1
|
|
55
|
+
});
|
|
56
|
+
$[4] = t1;
|
|
57
|
+
$[5] = t2;
|
|
58
|
+
} else t2 = $[5];
|
|
59
|
+
let t3;
|
|
60
|
+
if ($[6] !== ariaLabel || $[7] !== className || $[8] !== t2) {
|
|
61
|
+
t3 = /* @__PURE__ */ jsx("nav", {
|
|
62
|
+
"aria-label": ariaLabel,
|
|
63
|
+
className,
|
|
64
|
+
children: t2
|
|
65
|
+
});
|
|
66
|
+
$[6] = ariaLabel;
|
|
67
|
+
$[7] = className;
|
|
68
|
+
$[8] = t2;
|
|
69
|
+
$[9] = t3;
|
|
70
|
+
} else t3 = $[9];
|
|
71
|
+
return t3;
|
|
72
|
+
};
|
|
73
|
+
export { Breadcrumbs };
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Locale } from "date-fns";
|
|
2
|
+
import { type DateTimePickerLabels } from "../DateTimePicker/picker-labels.js";
|
|
3
|
+
/** The texts the calendar shows and announces. The same keys as the date picker's labels, so one set serves both. */
|
|
4
|
+
export type CalendarLabels = Pick<DateTimePickerLabels, "previousMonth" | "nextMonth" | "previousYear" | "nextYear" | "chooseMonth" | "backToCalendar">;
|
|
5
|
+
/**
|
|
6
|
+
* A range of days: "yyyy-MM-dd" each. `end` is empty while only the first day has been picked. A day that cannot be
|
|
7
|
+
* read, or does not exist ("2026-02-31"), counts as empty.
|
|
8
|
+
*/
|
|
9
|
+
export interface DateRangeValue {
|
|
10
|
+
start: string;
|
|
11
|
+
end: string;
|
|
12
|
+
}
|
|
13
|
+
interface CalendarBaseProps {
|
|
14
|
+
/** The earliest day that can be picked, "yyyy-MM-dd". Earlier days are greyed out. */
|
|
15
|
+
min?: string | undefined;
|
|
16
|
+
/** The latest day that can be picked, "yyyy-MM-dd". */
|
|
17
|
+
max?: string | undefined;
|
|
18
|
+
/** The texts, in the user's language. English if omitted. */
|
|
19
|
+
labels?: CalendarLabels | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* date-fns' locale for the names of months and days and the first day of the week (Monday for `de`), such as `he`
|
|
22
|
+
* from "date-fns/locale/he". English, with weeks from Sunday, if omitted.
|
|
23
|
+
*/
|
|
24
|
+
locale?: Locale | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* The month shown first when nothing is picked, as a day or a month: "2026-10-24" or "2026-10". Today's month if
|
|
27
|
+
* omitted or unreadable.
|
|
28
|
+
*/
|
|
29
|
+
defaultMonth?: string | undefined;
|
|
30
|
+
/** Accessible name of the calendar's group, when it has no heading of its own. */
|
|
31
|
+
"aria-label"?: string | undefined;
|
|
32
|
+
/** Classes for the calendar's box, e.g. a margin or a width. */
|
|
33
|
+
className?: string | undefined;
|
|
34
|
+
}
|
|
35
|
+
export interface CalendarSingleProps extends CalendarBaseProps {
|
|
36
|
+
/** One day. */
|
|
37
|
+
mode?: "single" | undefined;
|
|
38
|
+
/** The picked day, "yyyy-MM-dd", or an empty string for none. A day that cannot be read, or does not exist, is none. */
|
|
39
|
+
value: string;
|
|
40
|
+
/** Called with the day the person picks. */
|
|
41
|
+
onValueChange: (value: string) => void;
|
|
42
|
+
}
|
|
43
|
+
export interface CalendarRangeProps extends CalendarBaseProps {
|
|
44
|
+
/** A range: the first click picks the start, the second the end. */
|
|
45
|
+
mode: "range";
|
|
46
|
+
/** The picked range: `start` and `end` empty for none, `end` empty while only the start is picked. */
|
|
47
|
+
value: DateRangeValue;
|
|
48
|
+
/** Called with the range as it grows: the start alone after the first click, then both. */
|
|
49
|
+
onValueChange: (value: DateRangeValue) => void;
|
|
50
|
+
}
|
|
51
|
+
export type CalendarProps = CalendarSingleProps | CalendarRangeProps;
|
|
52
|
+
/**
|
|
53
|
+
* A month of days on show, to pick one day or a range: the date picker's calendar, inline. The arrow buttons and
|
|
54
|
+
* Page Up and Page Down change the month, the month's name opens a list of months and years, and the arrow keys
|
|
55
|
+
* move between days (the other way in right to left). A range is two clicks, the start and then the end; a click
|
|
56
|
+
* before the start begins again. The weeks start on the locale's first day of the week.
|
|
57
|
+
*/
|
|
58
|
+
export declare const Calendar: (props: CalendarProps) => import("react").JSX.Element;
|
|
59
|
+
export {};
|