@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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime tenant branding. The primary colour is a CSS variable, so a tenant
|
|
3
|
+
* can have its own without a rebuild: components read `bg-primary`,
|
|
4
|
+
* `text-primary-text` and friends, which resolve to `--fast-primary*`.
|
|
5
|
+
*
|
|
6
|
+
* Only `primary` is required. The hover, pressed, tint and text shades are
|
|
7
|
+
* derived from it with `color-mix`, unless the tenant supplies them, and each
|
|
8
|
+
* theme derives its own: in the light theme the text shades are mixed toward
|
|
9
|
+
* black so they stay readable on white, in the dark theme toward white so they
|
|
10
|
+
* stay readable on the dark surfaces, and the tints sink into the background.
|
|
11
|
+
* `onPrimary` is the text colour used on the primary fill and defaults to the
|
|
12
|
+
* foundation's dark text: a deep primary needs a light one.
|
|
13
|
+
*
|
|
14
|
+
* Besides the primary shades, the tokens mixed from them follow too: a selected
|
|
15
|
+
* row (`selected`), a row's hover (`surface-hover`), the first chart colour and
|
|
16
|
+
* the primary glows. The tones (success, warning, error, info ...) stay fixed.
|
|
17
|
+
*/
|
|
18
|
+
export interface TenantBranding {
|
|
19
|
+
/** The brand colour: fills, rings, the active state. Any CSS colour. */
|
|
20
|
+
primary: string;
|
|
21
|
+
/** A primary fill under the pointer. Derived when left out. */
|
|
22
|
+
primaryHover?: string | undefined;
|
|
23
|
+
/** A pressed primary fill, a checked box, the focus ring in the light theme. Derived when left out. */
|
|
24
|
+
primaryActive?: string | undefined;
|
|
25
|
+
/** The light tint: tiles, chips, the active navigation item, a selected row (light theme). Derived when left out. */
|
|
26
|
+
primaryLight?: string | undefined;
|
|
27
|
+
/** The palest tint: an info card, an expanded table row; a selected row in the dark theme. Derived when left out. */
|
|
28
|
+
primaryPale?: string | undefined;
|
|
29
|
+
/** The primary as text and links, readable on the surface. Derived when left out. */
|
|
30
|
+
primaryText?: string | undefined;
|
|
31
|
+
/** Text and icons on the primary fill. The foundation's dark text when left out. */
|
|
32
|
+
onPrimary?: string | undefined;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The stylesheet text for a branding: two rules, one per theme. The doubled `:root:root` outranks the
|
|
36
|
+
* stylesheet's own `:root` rules wherever either is loaded. `null` for a branding with a colour that is
|
|
37
|
+
* not valid CSS.
|
|
38
|
+
*/
|
|
39
|
+
export declare const brandingToCss: (branding: TenantBranding) => string | null;
|
|
40
|
+
/**
|
|
41
|
+
* Applies a tenant's branding to the page, or restores the default teal when given
|
|
42
|
+
* `null`. The shades are two rules in one <style> element, one per theme. A branding with a
|
|
43
|
+
* colour that is not valid CSS is ignored. `nonce` is the page's Content-Security-Policy nonce,
|
|
44
|
+
* put on the <style> element so a policy that allows inline styles only by nonce lets it apply.
|
|
45
|
+
* The element goes before the theme's (`applyTheme`), so where both set a token the theme's value
|
|
46
|
+
* applies, in the dark theme too.
|
|
47
|
+
*/
|
|
48
|
+
export declare const applyTenantBranding: (branding: TenantBranding | null, doc?: Document, nonce?: string) => void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BRANDING_STYLE_ID, THEME_STYLE_ID, cssRule, isSafeCssValue, setStyleElement } from "./style-element.js";
|
|
2
|
+
// src/theme/tenant-branding.ts
|
|
3
|
+
var mix = (percent, into) => `color-mix(in srgb, var(--fast-primary) ${String(percent)}%, ${into})`;
|
|
4
|
+
/** The variables a branding sets in the light theme, with how each is derived when the tenant does not give it. */
|
|
5
|
+
var lightShades = (branding) => ({
|
|
6
|
+
"--fast-primary": branding.primary,
|
|
7
|
+
"--fast-primary-hover": branding.primaryHover ?? mix(82, "#000"),
|
|
8
|
+
"--fast-primary-active": branding.primaryActive ?? mix(68, "#000"),
|
|
9
|
+
"--fast-primary-light": branding.primaryLight ?? mix(16, "#fff"),
|
|
10
|
+
"--fast-primary-pale": branding.primaryPale ?? mix(8, "#fff"),
|
|
11
|
+
"--fast-primary-text": branding.primaryText ?? mix(55, "#000"),
|
|
12
|
+
"--fast-primary-text-hover": branding.primaryText ?? mix(48, "#000"),
|
|
13
|
+
"--fast-primary-text-pressed": branding.primaryText ?? mix(40, "#000"),
|
|
14
|
+
"--fast-primary-large": branding.primaryActive ?? mix(68, "#000"),
|
|
15
|
+
"--fast-focus": branding.primaryActive ?? mix(68, "#000"),
|
|
16
|
+
...branding.onPrimary ? { "--fast-on-primary": branding.onPrimary } : {}
|
|
17
|
+
});
|
|
18
|
+
/** The same variables in the dark theme: lighter text and focus, tints that sink into the dark background. */
|
|
19
|
+
var darkShades = (branding) => ({
|
|
20
|
+
"--fast-primary": branding.primary,
|
|
21
|
+
"--fast-primary-hover": branding.primaryHover ?? mix(88, "#fff"),
|
|
22
|
+
"--fast-primary-active": branding.primaryActive ?? mix(88, "#000"),
|
|
23
|
+
"--fast-primary-light": branding.primaryLight ?? mix(24, "#000"),
|
|
24
|
+
"--fast-primary-pale": branding.primaryPale ?? mix(18, "#000"),
|
|
25
|
+
"--fast-primary-text": branding.primaryText ?? mix(60, "#fff"),
|
|
26
|
+
"--fast-primary-text-hover": branding.primaryText ?? mix(50, "#fff"),
|
|
27
|
+
"--fast-primary-text-pressed": branding.primaryText ?? mix(40, "#fff"),
|
|
28
|
+
"--fast-primary-large": branding.primaryText ?? mix(60, "#fff"),
|
|
29
|
+
"--fast-focus": branding.primaryText ?? mix(60, "#fff"),
|
|
30
|
+
...branding.onPrimary ? { "--fast-on-primary": branding.onPrimary } : {}
|
|
31
|
+
});
|
|
32
|
+
/**
|
|
33
|
+
* Whether there is a `CSS.supports` to ask. A server has no `CSS` (read through `globalThis`, as a bare `CSS` would
|
|
34
|
+
* throw there), and a page can have a partial one (a polyfill of `CSS.escape` alone), so the check is for the
|
|
35
|
+
* function itself.
|
|
36
|
+
*/
|
|
37
|
+
var canCheckColour = () => typeof globalThis.CSS?.supports === "function";
|
|
38
|
+
/** A colour as the tenant gave it: a string that cannot leave its declaration and, in a browser, is a colour. */
|
|
39
|
+
var isSafeColour = (value) => typeof value === "string" && isSafeCssValue(value) && (!canCheckColour() || CSS.supports("color", value));
|
|
40
|
+
/**
|
|
41
|
+
* Whether the branding is usable: `primary` is a colour, and every other field is a colour or left out. The
|
|
42
|
+
* values are written into a stylesheet and often arrive as data (a tenant's JSON), so anything else (an
|
|
43
|
+
* array, a number, null, a value that could close the rule) leaves the branding out altogether. The
|
|
44
|
+
* structural check holds anywhere; `CSS.supports` adds the colour check where there is a browser to ask, so
|
|
45
|
+
* the check also runs on a server, which has no `CSS`, or beside a partial `CSS` polyfill.
|
|
46
|
+
*/
|
|
47
|
+
var isValidBranding = (branding) => typeof branding === "object" && branding !== null && isSafeColour(branding.primary) && Object.values(branding).every((value) => value === void 0 || isSafeColour(value));
|
|
48
|
+
/**
|
|
49
|
+
* The stylesheet text for a branding: two rules, one per theme. The doubled `:root:root` outranks the
|
|
50
|
+
* stylesheet's own `:root` rules wherever either is loaded. `null` for a branding with a colour that is
|
|
51
|
+
* not valid CSS.
|
|
52
|
+
*/
|
|
53
|
+
var brandingToCss = (branding) => isValidBranding(branding) ? [cssRule(":root:root", lightShades(branding)), cssRule(":root:root[data-theme=\"dark\"]", darkShades(branding))].join("\n") : null;
|
|
54
|
+
/**
|
|
55
|
+
* Applies a tenant's branding to the page, or restores the default teal when given
|
|
56
|
+
* `null`. The shades are two rules in one <style> element, one per theme. A branding with a
|
|
57
|
+
* colour that is not valid CSS is ignored. `nonce` is the page's Content-Security-Policy nonce,
|
|
58
|
+
* put on the <style> element so a policy that allows inline styles only by nonce lets it apply.
|
|
59
|
+
* The element goes before the theme's (`applyTheme`), so where both set a token the theme's value
|
|
60
|
+
* applies, in the dark theme too.
|
|
61
|
+
*/
|
|
62
|
+
var applyTenantBranding = (branding, doc = document, nonce) => {
|
|
63
|
+
setStyleElement(doc, BRANDING_STYLE_ID, branding ? brandingToCss(branding) : null, nonce, THEME_STYLE_ID);
|
|
64
|
+
};
|
|
65
|
+
export { applyTenantBranding, brandingToCss };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { ThemeMode, ThemePreference } from "../types/direction.js";
|
|
2
|
+
/**
|
|
3
|
+
* Applies a theme to the page. A change from one theme to the other cross-fades the whole page
|
|
4
|
+
* (a View Transition, styled in global.css), so every part changes together. Without View
|
|
5
|
+
* Transitions, or with reduced motion, the page switches in one frame.
|
|
6
|
+
*
|
|
7
|
+
* The page's `data-theme` changes only when a cross-fade swaps the page, a moment after it starts.
|
|
8
|
+
* A change asked for meanwhile (light, dark, light in quick succession) is not compared with that
|
|
9
|
+
* stale attribute: it is recorded, and the cross-fade already under way applies the latest one.
|
|
10
|
+
*
|
|
11
|
+
* `nonce` is the page's Content-Security-Policy nonce, put on the <style> element this adds for a moment.
|
|
12
|
+
*/
|
|
13
|
+
export declare const applyThemeMode: (themeMode: ThemeMode, nonce?: string) => void;
|
|
14
|
+
/**
|
|
15
|
+
* Puts the page's `data-theme` back to `theme`, the value it had before (`null`: no attribute), at once and
|
|
16
|
+
* without a cross-fade. A cross-fade still under way applies it in place of the theme it was started for. The
|
|
17
|
+
* provider calls this when it unmounts.
|
|
18
|
+
*/
|
|
19
|
+
export declare const restoreThemeAttribute: (theme: string | null, nonce?: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Applies a theme preference. A theme is applied as `applyThemeMode` does. `"system"` applies the
|
|
22
|
+
* operating system's light or dark setting now and again whenever the setting changes. Returns a
|
|
23
|
+
* function that stops following the system (it does nothing for a fixed theme).
|
|
24
|
+
*/
|
|
25
|
+
export declare const applyThemePreference: (preference: ThemePreference, nonce?: string) => (() => void);
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
// src/theme/theme-switch.ts
|
|
2
|
+
var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
3
|
+
var DARK_SCHEME_QUERY = "(prefers-color-scheme: dark)";
|
|
4
|
+
/**
|
|
5
|
+
* Sets `data-theme` on <html>, or removes it for `null`, with every CSS transition switched off for that one
|
|
6
|
+
* style change.
|
|
7
|
+
* Many components fade their colours on hover (`transition-colors`), and those transitions would
|
|
8
|
+
* also run when the theme variables change: they would fade from the old theme's colours while the
|
|
9
|
+
* rest of the page switches at once, which looks like a flicker. Reading a computed style makes the
|
|
10
|
+
* browser apply the new theme while the override is in place; the override is removed a frame later.
|
|
11
|
+
* The override carries the page's CSP `nonce`, so a policy that allows inline styles only by nonce lets it apply.
|
|
12
|
+
*/
|
|
13
|
+
var setThemeWithoutTransitions = (root, theme, nonce) => {
|
|
14
|
+
const override = document.createElement("style");
|
|
15
|
+
if (nonce) override.nonce = nonce;
|
|
16
|
+
override.textContent = "*,*::before,*::after{transition:none!important}";
|
|
17
|
+
document.head.append(override);
|
|
18
|
+
if (theme === null) root.removeAttribute("data-theme");
|
|
19
|
+
else root.setAttribute("data-theme", theme);
|
|
20
|
+
window.getComputedStyle(root).color;
|
|
21
|
+
requestAnimationFrame(() => {
|
|
22
|
+
override.remove();
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var ignoreSkippedTransition = () => void 0;
|
|
26
|
+
/**
|
|
27
|
+
* The `data-theme` asked for last, `null` for none (`restoreThemeAttribute` may ask for that, or for a value of
|
|
28
|
+
* the app's own). A cross-fade in progress applies this one when it swaps the page.
|
|
29
|
+
*/
|
|
30
|
+
var requestedTheme = null;
|
|
31
|
+
/** True from the start of a cross-fade until it has swapped the page. */
|
|
32
|
+
var isFadePending = false;
|
|
33
|
+
/**
|
|
34
|
+
* Applies a theme to the page. A change from one theme to the other cross-fades the whole page
|
|
35
|
+
* (a View Transition, styled in global.css), so every part changes together. Without View
|
|
36
|
+
* Transitions, or with reduced motion, the page switches in one frame.
|
|
37
|
+
*
|
|
38
|
+
* The page's `data-theme` changes only when a cross-fade swaps the page, a moment after it starts.
|
|
39
|
+
* A change asked for meanwhile (light, dark, light in quick succession) is not compared with that
|
|
40
|
+
* stale attribute: it is recorded, and the cross-fade already under way applies the latest one.
|
|
41
|
+
*
|
|
42
|
+
* `nonce` is the page's Content-Security-Policy nonce, put on the <style> element this adds for a moment.
|
|
43
|
+
*/
|
|
44
|
+
var applyThemeMode = (themeMode, nonce) => {
|
|
45
|
+
const root = document.documentElement;
|
|
46
|
+
requestedTheme = themeMode;
|
|
47
|
+
if (isFadePending || root.dataset["theme"] === themeMode) return;
|
|
48
|
+
if (!(typeof document.startViewTransition === "function" && !window.matchMedia(REDUCED_MOTION_QUERY).matches && root.dataset["theme"] !== void 0)) {
|
|
49
|
+
setThemeWithoutTransitions(root, themeMode, nonce);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
isFadePending = true;
|
|
53
|
+
document.startViewTransition(() => {
|
|
54
|
+
isFadePending = false;
|
|
55
|
+
setThemeWithoutTransitions(root, requestedTheme, nonce);
|
|
56
|
+
}).ready.catch(ignoreSkippedTransition);
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Puts the page's `data-theme` back to `theme`, the value it had before (`null`: no attribute), at once and
|
|
60
|
+
* without a cross-fade. A cross-fade still under way applies it in place of the theme it was started for. The
|
|
61
|
+
* provider calls this when it unmounts.
|
|
62
|
+
*/
|
|
63
|
+
var restoreThemeAttribute = (theme, nonce) => {
|
|
64
|
+
requestedTheme = theme;
|
|
65
|
+
const root = document.documentElement;
|
|
66
|
+
if (isFadePending || root.getAttribute("data-theme") === theme) return;
|
|
67
|
+
setThemeWithoutTransitions(root, theme, nonce);
|
|
68
|
+
};
|
|
69
|
+
var stopFollowing = () => void 0;
|
|
70
|
+
/**
|
|
71
|
+
* Applies a theme preference. A theme is applied as `applyThemeMode` does. `"system"` applies the
|
|
72
|
+
* operating system's light or dark setting now and again whenever the setting changes. Returns a
|
|
73
|
+
* function that stops following the system (it does nothing for a fixed theme).
|
|
74
|
+
*/
|
|
75
|
+
var applyThemePreference = (preference, nonce) => {
|
|
76
|
+
if (preference !== "system") {
|
|
77
|
+
applyThemeMode(preference, nonce);
|
|
78
|
+
return stopFollowing;
|
|
79
|
+
}
|
|
80
|
+
const query = window.matchMedia(DARK_SCHEME_QUERY);
|
|
81
|
+
const follow = () => {
|
|
82
|
+
applyThemeMode(query.matches ? "dark" : "light", nonce);
|
|
83
|
+
};
|
|
84
|
+
follow();
|
|
85
|
+
query.addEventListener("change", follow);
|
|
86
|
+
return () => {
|
|
87
|
+
query.removeEventListener("change", follow);
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
export { applyThemeMode, applyThemePreference, restoreThemeAttribute };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** The design tokens: each is the CSS variable `--fast-<name>`. */
|
|
2
|
+
export declare const TOKEN_NAMES: readonly ["accent", "accent-light", "accent-strong", "bg", "bg-faint", "bg-muted", "bg-subtle", "canvas", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "chart-axis", "chart-grid", "container-max", "destructive", "destructive-active", "destructive-disabled", "destructive-hover", "fg", "fg-body", "fg-disabled", "fg-inverted", "fg-secondary", "fg-tertiary", "focus", "font-family", "font-family-mono", "hero-from", "hero-to", "hero-via", "line", "line-strong", "line-subtle", "on-accent", "on-destructive", "on-primary", "overlay", "pressed", "primary", "primary-active", "primary-hover", "primary-large", "primary-light", "primary-pale", "primary-text", "primary-text-hover", "primary-text-pressed", "radius-check", "radius-lg", "radius-md", "radius-pill", "radius-sm", "radius-tile", "radius-xl", "scrim", "selected", "shadow-action", "shadow-card", "shadow-lg", "shadow-md", "shadow-modal", "shadow-nav", "shadow-primary", "shadow-sm", "shadow-tile", "shadow-up", "size-header", "size-sidenav", "size-sidenav-collapsed", "sky", "sky-text", "sky-tint", "surface", "surface-hover", "text-body", "text-body-lg", "text-body-lg-line-height", "text-body-line-height", "text-body-sm", "text-body-sm-line-height", "text-button", "text-button-font-weight", "text-button-line-height", "text-caption", "text-caption-font-weight", "text-caption-line-height", "text-dialog-title", "text-dialog-title-font-weight", "text-dialog-title-letter-spacing", "text-dialog-title-line-height", "text-display", "text-display-font-weight", "text-display-line-height", "text-figure", "text-figure-font-weight", "text-figure-line-height", "text-h1", "text-h1-font-weight", "text-h1-line-height", "text-h2", "text-h2-font-weight", "text-h2-line-height", "text-h3", "text-h3-font-weight", "text-h3-line-height", "text-h4", "text-h4-font-weight", "text-h4-line-height", "text-label", "text-label-font-weight", "text-label-line-height", "text-micro", "text-micro-line-height", "text-section", "text-section-font-weight", "text-section-line-height", "text-tiny", "text-tiny-line-height", "text-title", "text-title-font-weight", "text-title-letter-spacing", "text-title-line-height", "tone-error-border", "tone-error-solid", "tone-error-text", "tone-error-tint", "tone-error-wash", "tone-info-border", "tone-info-soft", "tone-info-solid", "tone-info-text", "tone-info-tint", "tone-info-wash", "tone-neutral-border", "tone-neutral-solid", "tone-neutral-text", "tone-neutral-tint", "tone-neutral-wash", "tone-pending-border", "tone-pending-solid", "tone-pending-text", "tone-pending-tint", "tone-pending-wash", "tone-reserved-border", "tone-reserved-solid", "tone-reserved-text", "tone-reserved-tint", "tone-reserved-wash", "tone-success-border", "tone-success-solid", "tone-success-text", "tone-success-tint", "tone-success-wash", "tone-warning-border", "tone-warning-solid", "tone-warning-text", "tone-warning-tint", "tone-warning-wash", "z-sticky"];
|
|
3
|
+
export type TokenName = (typeof TOKEN_NAMES)[number];
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
// src/theme/token-names.ts
|
|
2
|
+
/** The design tokens: each is the CSS variable `--fast-<name>`. */
|
|
3
|
+
var TOKEN_NAMES = [
|
|
4
|
+
"accent",
|
|
5
|
+
"accent-light",
|
|
6
|
+
"accent-strong",
|
|
7
|
+
"bg",
|
|
8
|
+
"bg-faint",
|
|
9
|
+
"bg-muted",
|
|
10
|
+
"bg-subtle",
|
|
11
|
+
"canvas",
|
|
12
|
+
"chart-1",
|
|
13
|
+
"chart-2",
|
|
14
|
+
"chart-3",
|
|
15
|
+
"chart-4",
|
|
16
|
+
"chart-5",
|
|
17
|
+
"chart-axis",
|
|
18
|
+
"chart-grid",
|
|
19
|
+
"container-max",
|
|
20
|
+
"destructive",
|
|
21
|
+
"destructive-active",
|
|
22
|
+
"destructive-disabled",
|
|
23
|
+
"destructive-hover",
|
|
24
|
+
"fg",
|
|
25
|
+
"fg-body",
|
|
26
|
+
"fg-disabled",
|
|
27
|
+
"fg-inverted",
|
|
28
|
+
"fg-secondary",
|
|
29
|
+
"fg-tertiary",
|
|
30
|
+
"focus",
|
|
31
|
+
"font-family",
|
|
32
|
+
"font-family-mono",
|
|
33
|
+
"hero-from",
|
|
34
|
+
"hero-to",
|
|
35
|
+
"hero-via",
|
|
36
|
+
"line",
|
|
37
|
+
"line-strong",
|
|
38
|
+
"line-subtle",
|
|
39
|
+
"on-accent",
|
|
40
|
+
"on-destructive",
|
|
41
|
+
"on-primary",
|
|
42
|
+
"overlay",
|
|
43
|
+
"pressed",
|
|
44
|
+
"primary",
|
|
45
|
+
"primary-active",
|
|
46
|
+
"primary-hover",
|
|
47
|
+
"primary-large",
|
|
48
|
+
"primary-light",
|
|
49
|
+
"primary-pale",
|
|
50
|
+
"primary-text",
|
|
51
|
+
"primary-text-hover",
|
|
52
|
+
"primary-text-pressed",
|
|
53
|
+
"radius-check",
|
|
54
|
+
"radius-lg",
|
|
55
|
+
"radius-md",
|
|
56
|
+
"radius-pill",
|
|
57
|
+
"radius-sm",
|
|
58
|
+
"radius-tile",
|
|
59
|
+
"radius-xl",
|
|
60
|
+
"scrim",
|
|
61
|
+
"selected",
|
|
62
|
+
"shadow-action",
|
|
63
|
+
"shadow-card",
|
|
64
|
+
"shadow-lg",
|
|
65
|
+
"shadow-md",
|
|
66
|
+
"shadow-modal",
|
|
67
|
+
"shadow-nav",
|
|
68
|
+
"shadow-primary",
|
|
69
|
+
"shadow-sm",
|
|
70
|
+
"shadow-tile",
|
|
71
|
+
"shadow-up",
|
|
72
|
+
"size-header",
|
|
73
|
+
"size-sidenav",
|
|
74
|
+
"size-sidenav-collapsed",
|
|
75
|
+
"sky",
|
|
76
|
+
"sky-text",
|
|
77
|
+
"sky-tint",
|
|
78
|
+
"surface",
|
|
79
|
+
"surface-hover",
|
|
80
|
+
"text-body",
|
|
81
|
+
"text-body-lg",
|
|
82
|
+
"text-body-lg-line-height",
|
|
83
|
+
"text-body-line-height",
|
|
84
|
+
"text-body-sm",
|
|
85
|
+
"text-body-sm-line-height",
|
|
86
|
+
"text-button",
|
|
87
|
+
"text-button-font-weight",
|
|
88
|
+
"text-button-line-height",
|
|
89
|
+
"text-caption",
|
|
90
|
+
"text-caption-font-weight",
|
|
91
|
+
"text-caption-line-height",
|
|
92
|
+
"text-dialog-title",
|
|
93
|
+
"text-dialog-title-font-weight",
|
|
94
|
+
"text-dialog-title-letter-spacing",
|
|
95
|
+
"text-dialog-title-line-height",
|
|
96
|
+
"text-display",
|
|
97
|
+
"text-display-font-weight",
|
|
98
|
+
"text-display-line-height",
|
|
99
|
+
"text-figure",
|
|
100
|
+
"text-figure-font-weight",
|
|
101
|
+
"text-figure-line-height",
|
|
102
|
+
"text-h1",
|
|
103
|
+
"text-h1-font-weight",
|
|
104
|
+
"text-h1-line-height",
|
|
105
|
+
"text-h2",
|
|
106
|
+
"text-h2-font-weight",
|
|
107
|
+
"text-h2-line-height",
|
|
108
|
+
"text-h3",
|
|
109
|
+
"text-h3-font-weight",
|
|
110
|
+
"text-h3-line-height",
|
|
111
|
+
"text-h4",
|
|
112
|
+
"text-h4-font-weight",
|
|
113
|
+
"text-h4-line-height",
|
|
114
|
+
"text-label",
|
|
115
|
+
"text-label-font-weight",
|
|
116
|
+
"text-label-line-height",
|
|
117
|
+
"text-micro",
|
|
118
|
+
"text-micro-line-height",
|
|
119
|
+
"text-section",
|
|
120
|
+
"text-section-font-weight",
|
|
121
|
+
"text-section-line-height",
|
|
122
|
+
"text-tiny",
|
|
123
|
+
"text-tiny-line-height",
|
|
124
|
+
"text-title",
|
|
125
|
+
"text-title-font-weight",
|
|
126
|
+
"text-title-letter-spacing",
|
|
127
|
+
"text-title-line-height",
|
|
128
|
+
"tone-error-border",
|
|
129
|
+
"tone-error-solid",
|
|
130
|
+
"tone-error-text",
|
|
131
|
+
"tone-error-tint",
|
|
132
|
+
"tone-error-wash",
|
|
133
|
+
"tone-info-border",
|
|
134
|
+
"tone-info-soft",
|
|
135
|
+
"tone-info-solid",
|
|
136
|
+
"tone-info-text",
|
|
137
|
+
"tone-info-tint",
|
|
138
|
+
"tone-info-wash",
|
|
139
|
+
"tone-neutral-border",
|
|
140
|
+
"tone-neutral-solid",
|
|
141
|
+
"tone-neutral-text",
|
|
142
|
+
"tone-neutral-tint",
|
|
143
|
+
"tone-neutral-wash",
|
|
144
|
+
"tone-pending-border",
|
|
145
|
+
"tone-pending-solid",
|
|
146
|
+
"tone-pending-text",
|
|
147
|
+
"tone-pending-tint",
|
|
148
|
+
"tone-pending-wash",
|
|
149
|
+
"tone-reserved-border",
|
|
150
|
+
"tone-reserved-solid",
|
|
151
|
+
"tone-reserved-text",
|
|
152
|
+
"tone-reserved-tint",
|
|
153
|
+
"tone-reserved-wash",
|
|
154
|
+
"tone-success-border",
|
|
155
|
+
"tone-success-solid",
|
|
156
|
+
"tone-success-text",
|
|
157
|
+
"tone-success-tint",
|
|
158
|
+
"tone-success-wash",
|
|
159
|
+
"tone-warning-border",
|
|
160
|
+
"tone-warning-solid",
|
|
161
|
+
"tone-warning-text",
|
|
162
|
+
"tone-warning-tint",
|
|
163
|
+
"tone-warning-wash",
|
|
164
|
+
"z-sticky"
|
|
165
|
+
];
|
|
166
|
+
export { TOKEN_NAMES };
|
package/dist/theme.css
ADDED
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* The Tailwind side of the design foundation. `tokens.css` holds the values as
|
|
3
|
+
* CSS variables (so they can change at runtime); this file turns them into
|
|
4
|
+
* utilities: `bg-primary`, `text-fg-secondary`, `border-line`, `rounded-lg`,
|
|
5
|
+
* `shadow-md`, `text-body-sm`, ... Tailwind's own colour, type, radius and shadow
|
|
6
|
+
* scales are emptied first, so a class that is not a design-system token (`bg-red-500`,
|
|
7
|
+
* `text-lg`) generates nothing instead of quietly leaving the design system.
|
|
8
|
+
*
|
|
9
|
+
* Spacing is Tailwind's own 4px scale: `p-2` is 8px, `gap-4` 16px, `p-6` 24px,
|
|
10
|
+
* which is the foundation's 4/8/12/16/24/32/40/48/64.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/* Dark mode follows the `data-theme` the provider puts on <html>. Most colours
|
|
14
|
+
switch through their variables; `dark:` is for the few that need more. */
|
|
15
|
+
@custom-variant dark (&:where([data-theme="dark"], [data-theme="dark"] *));
|
|
16
|
+
|
|
17
|
+
@theme {
|
|
18
|
+
--color-*: initial;
|
|
19
|
+
--font-*: initial;
|
|
20
|
+
--text-*: initial;
|
|
21
|
+
--tracking-*: initial;
|
|
22
|
+
--leading-*: initial;
|
|
23
|
+
--shadow-*: initial;
|
|
24
|
+
--inset-shadow-*: initial;
|
|
25
|
+
--drop-shadow-*: initial;
|
|
26
|
+
--text-shadow-*: initial;
|
|
27
|
+
--radius-*: initial;
|
|
28
|
+
--ease-*: initial;
|
|
29
|
+
--animate-*: initial;
|
|
30
|
+
|
|
31
|
+
/* ---------- Radius ---------- */
|
|
32
|
+
/* The radii, shadows and type scale are runtime tokens (tokens.css), mapped in the
|
|
33
|
+
`@theme inline` block below; `rounded-none` stays fixed. */
|
|
34
|
+
--radius-none: 0px;
|
|
35
|
+
|
|
36
|
+
/* ---------- Motion ---------- */
|
|
37
|
+
--ease-standard: cubic-bezier(0.2, 0, 0, 1);
|
|
38
|
+
--animate-spin: spin 0.8s linear infinite;
|
|
39
|
+
--animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
40
|
+
--animate-slide: slide 1.4s cubic-bezier(0.2, 0, 0, 1) infinite;
|
|
41
|
+
/* A toast's life bar; keep its length equal to TOAST_TIMEOUT_MS. */
|
|
42
|
+
--animate-toast-life: toast-life 5s linear forwards;
|
|
43
|
+
|
|
44
|
+
@keyframes spin {
|
|
45
|
+
to {
|
|
46
|
+
transform: rotate(360deg);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes pulse {
|
|
51
|
+
50% {
|
|
52
|
+
opacity: 0.5;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
@keyframes toast-life {
|
|
57
|
+
to {
|
|
58
|
+
transform: scaleX(0);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/* The indeterminate progress block: it travels the way the text runs. */
|
|
63
|
+
@keyframes slide {
|
|
64
|
+
to {
|
|
65
|
+
inset-inline-start: 100%;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* The colours reference runtime variables, so `inline` keeps the `var()` in the utility. */
|
|
71
|
+
@theme inline {
|
|
72
|
+
--font-sans: var(--fast-font-family);
|
|
73
|
+
--font-mono: var(--fast-font-family-mono);
|
|
74
|
+
|
|
75
|
+
/* Primary/Default, Hover, Active, Light (+ Pale and the AA text shades) */
|
|
76
|
+
--color-primary: var(--fast-primary);
|
|
77
|
+
--color-primary-hover: var(--fast-primary-hover);
|
|
78
|
+
--color-primary-active: var(--fast-primary-active);
|
|
79
|
+
--color-primary-light: var(--fast-primary-light);
|
|
80
|
+
--color-primary-pale: var(--fast-primary-pale);
|
|
81
|
+
--color-primary-text: var(--fast-primary-text);
|
|
82
|
+
--color-primary-text-hover: var(--fast-primary-text-hover);
|
|
83
|
+
--color-primary-text-pressed: var(--fast-primary-text-pressed);
|
|
84
|
+
--color-primary-large: var(--fast-primary-large);
|
|
85
|
+
--color-on-primary: var(--fast-on-primary);
|
|
86
|
+
|
|
87
|
+
--color-accent: var(--fast-accent);
|
|
88
|
+
--color-accent-light: var(--fast-accent-light);
|
|
89
|
+
--color-accent-strong: var(--fast-accent-strong);
|
|
90
|
+
--color-on-accent: var(--fast-on-accent);
|
|
91
|
+
|
|
92
|
+
/* Text: ink, body, muted, tertiary, disabled */
|
|
93
|
+
--color-fg: var(--fast-fg);
|
|
94
|
+
--color-fg-body: var(--fast-fg-body);
|
|
95
|
+
--color-fg-secondary: var(--fast-fg-secondary);
|
|
96
|
+
--color-fg-tertiary: var(--fast-fg-tertiary);
|
|
97
|
+
--color-fg-disabled: var(--fast-fg-disabled);
|
|
98
|
+
--color-fg-inverted: var(--fast-fg-inverted);
|
|
99
|
+
|
|
100
|
+
/* Background/Default, Background/Subtle, Surface/Default, Border/Default */
|
|
101
|
+
--color-page: var(--fast-bg);
|
|
102
|
+
--color-surface: var(--fast-surface);
|
|
103
|
+
--color-surface-hover: var(--fast-surface-hover);
|
|
104
|
+
--color-subtle: var(--fast-bg-subtle);
|
|
105
|
+
--color-muted: var(--fast-bg-muted);
|
|
106
|
+
--color-faint: var(--fast-bg-faint);
|
|
107
|
+
--color-pressed: var(--fast-pressed);
|
|
108
|
+
--color-canvas: var(--fast-canvas);
|
|
109
|
+
--color-line: var(--fast-line);
|
|
110
|
+
--color-line-strong: var(--fast-line-strong);
|
|
111
|
+
--color-line-subtle: var(--fast-line-subtle);
|
|
112
|
+
--color-selected: var(--fast-selected);
|
|
113
|
+
--color-overlay: var(--fast-overlay);
|
|
114
|
+
--color-scrim: var(--fast-scrim);
|
|
115
|
+
|
|
116
|
+
--color-destructive: var(--fast-destructive);
|
|
117
|
+
--color-destructive-hover: var(--fast-destructive-hover);
|
|
118
|
+
--color-destructive-active: var(--fast-destructive-active);
|
|
119
|
+
--color-destructive-disabled: var(--fast-destructive-disabled);
|
|
120
|
+
--color-on-destructive: var(--fast-on-destructive);
|
|
121
|
+
|
|
122
|
+
--color-focus: var(--fast-focus);
|
|
123
|
+
/* White on the red fill, and on the Action Card's teal ... in every theme. */
|
|
124
|
+
--color-white: #ffffff;
|
|
125
|
+
--color-black: #000000;
|
|
126
|
+
|
|
127
|
+
/* Semantic tones: success, warning, error, info, neutral, pending, reserved */
|
|
128
|
+
--color-success-solid: var(--fast-tone-success-solid);
|
|
129
|
+
--color-success-tint: var(--fast-tone-success-tint);
|
|
130
|
+
--color-success-wash: var(--fast-tone-success-wash);
|
|
131
|
+
--color-success-border: var(--fast-tone-success-border);
|
|
132
|
+
--color-success-text: var(--fast-tone-success-text);
|
|
133
|
+
--color-warning-solid: var(--fast-tone-warning-solid);
|
|
134
|
+
--color-warning-tint: var(--fast-tone-warning-tint);
|
|
135
|
+
--color-warning-wash: var(--fast-tone-warning-wash);
|
|
136
|
+
--color-warning-border: var(--fast-tone-warning-border);
|
|
137
|
+
--color-warning-text: var(--fast-tone-warning-text);
|
|
138
|
+
--color-error-solid: var(--fast-tone-error-solid);
|
|
139
|
+
--color-error-tint: var(--fast-tone-error-tint);
|
|
140
|
+
--color-error-wash: var(--fast-tone-error-wash);
|
|
141
|
+
--color-error-border: var(--fast-tone-error-border);
|
|
142
|
+
--color-error-text: var(--fast-tone-error-text);
|
|
143
|
+
--color-info-solid: var(--fast-tone-info-solid);
|
|
144
|
+
--color-info-tint: var(--fast-tone-info-tint);
|
|
145
|
+
--color-info-wash: var(--fast-tone-info-wash);
|
|
146
|
+
--color-info-border: var(--fast-tone-info-border);
|
|
147
|
+
--color-info-text: var(--fast-tone-info-text);
|
|
148
|
+
--color-info-soft: var(--fast-tone-info-soft);
|
|
149
|
+
--color-neutral-solid: var(--fast-tone-neutral-solid);
|
|
150
|
+
--color-neutral-tint: var(--fast-tone-neutral-tint);
|
|
151
|
+
--color-neutral-wash: var(--fast-tone-neutral-wash);
|
|
152
|
+
--color-neutral-border: var(--fast-tone-neutral-border);
|
|
153
|
+
--color-neutral-text: var(--fast-tone-neutral-text);
|
|
154
|
+
--color-pending-solid: var(--fast-tone-pending-solid);
|
|
155
|
+
--color-pending-tint: var(--fast-tone-pending-tint);
|
|
156
|
+
--color-pending-wash: var(--fast-tone-pending-wash);
|
|
157
|
+
--color-pending-border: var(--fast-tone-pending-border);
|
|
158
|
+
--color-pending-text: var(--fast-tone-pending-text);
|
|
159
|
+
--color-reserved-solid: var(--fast-tone-reserved-solid);
|
|
160
|
+
--color-reserved-tint: var(--fast-tone-reserved-tint);
|
|
161
|
+
--color-reserved-wash: var(--fast-tone-reserved-wash);
|
|
162
|
+
--color-reserved-border: var(--fast-tone-reserved-border);
|
|
163
|
+
--color-reserved-text: var(--fast-tone-reserved-text);
|
|
164
|
+
|
|
165
|
+
/* Decorative: a sky category, the details hero's gradient */
|
|
166
|
+
--color-sky: var(--fast-sky);
|
|
167
|
+
--color-sky-tint: var(--fast-sky-tint);
|
|
168
|
+
--color-sky-text: var(--fast-sky-text);
|
|
169
|
+
--color-hero-from: var(--fast-hero-from);
|
|
170
|
+
--color-hero-via: var(--fast-hero-via);
|
|
171
|
+
--color-hero-to: var(--fast-hero-to);
|
|
172
|
+
|
|
173
|
+
/* Radius, elevation and type scale, from the runtime tokens, so a theme can change them. */
|
|
174
|
+
--radius-check: var(--fast-radius-check);
|
|
175
|
+
--radius-sm: var(--fast-radius-sm);
|
|
176
|
+
--radius-md: var(--fast-radius-md);
|
|
177
|
+
--radius-tile: var(--fast-radius-tile);
|
|
178
|
+
--radius-lg: var(--fast-radius-lg);
|
|
179
|
+
--radius-xl: var(--fast-radius-xl);
|
|
180
|
+
--radius-pill: var(--fast-radius-pill);
|
|
181
|
+
|
|
182
|
+
--shadow-sm: var(--fast-shadow-sm);
|
|
183
|
+
--shadow-card: var(--fast-shadow-card);
|
|
184
|
+
--shadow-md: var(--fast-shadow-md);
|
|
185
|
+
--shadow-lg: var(--fast-shadow-lg);
|
|
186
|
+
--shadow-modal: var(--fast-shadow-modal);
|
|
187
|
+
--shadow-up: var(--fast-shadow-up);
|
|
188
|
+
--shadow-primary: var(--fast-shadow-primary);
|
|
189
|
+
--shadow-tile: var(--fast-shadow-tile);
|
|
190
|
+
--shadow-nav: var(--fast-shadow-nav);
|
|
191
|
+
--shadow-action: var(--fast-shadow-action);
|
|
192
|
+
|
|
193
|
+
--text-display: var(--fast-text-display);
|
|
194
|
+
--text-display--line-height: var(--fast-text-display-line-height);
|
|
195
|
+
--text-display--font-weight: var(--fast-text-display-font-weight);
|
|
196
|
+
--text-h1: var(--fast-text-h1);
|
|
197
|
+
--text-h1--line-height: var(--fast-text-h1-line-height);
|
|
198
|
+
--text-h1--font-weight: var(--fast-text-h1-font-weight);
|
|
199
|
+
--text-h2: var(--fast-text-h2);
|
|
200
|
+
--text-h2--line-height: var(--fast-text-h2-line-height);
|
|
201
|
+
--text-h2--font-weight: var(--fast-text-h2-font-weight);
|
|
202
|
+
--text-h3: var(--fast-text-h3);
|
|
203
|
+
--text-h3--line-height: var(--fast-text-h3-line-height);
|
|
204
|
+
--text-h3--font-weight: var(--fast-text-h3-font-weight);
|
|
205
|
+
--text-h4: var(--fast-text-h4);
|
|
206
|
+
--text-h4--line-height: var(--fast-text-h4-line-height);
|
|
207
|
+
--text-h4--font-weight: var(--fast-text-h4-font-weight);
|
|
208
|
+
--text-body-lg: var(--fast-text-body-lg);
|
|
209
|
+
--text-body-lg--line-height: var(--fast-text-body-lg-line-height);
|
|
210
|
+
--text-body: var(--fast-text-body);
|
|
211
|
+
--text-body--line-height: var(--fast-text-body-line-height);
|
|
212
|
+
--text-body-sm: var(--fast-text-body-sm);
|
|
213
|
+
--text-body-sm--line-height: var(--fast-text-body-sm-line-height);
|
|
214
|
+
--text-caption: var(--fast-text-caption);
|
|
215
|
+
--text-caption--line-height: var(--fast-text-caption-line-height);
|
|
216
|
+
--text-caption--font-weight: var(--fast-text-caption-font-weight);
|
|
217
|
+
--text-tiny: var(--fast-text-tiny);
|
|
218
|
+
--text-tiny--line-height: var(--fast-text-tiny-line-height);
|
|
219
|
+
--text-micro: var(--fast-text-micro);
|
|
220
|
+
--text-micro--line-height: var(--fast-text-micro-line-height);
|
|
221
|
+
--text-button: var(--fast-text-button);
|
|
222
|
+
--text-button--line-height: var(--fast-text-button-line-height);
|
|
223
|
+
--text-button--font-weight: var(--fast-text-button-font-weight);
|
|
224
|
+
--text-label: var(--fast-text-label);
|
|
225
|
+
--text-label--line-height: var(--fast-text-label-line-height);
|
|
226
|
+
--text-label--font-weight: var(--fast-text-label-font-weight);
|
|
227
|
+
--text-title: var(--fast-text-title);
|
|
228
|
+
--text-title--line-height: var(--fast-text-title-line-height);
|
|
229
|
+
--text-title--font-weight: var(--fast-text-title-font-weight);
|
|
230
|
+
--text-title--letter-spacing: var(--fast-text-title-letter-spacing);
|
|
231
|
+
--text-dialog-title: var(--fast-text-dialog-title);
|
|
232
|
+
--text-dialog-title--line-height: var(--fast-text-dialog-title-line-height);
|
|
233
|
+
--text-dialog-title--font-weight: var(--fast-text-dialog-title-font-weight);
|
|
234
|
+
--text-dialog-title--letter-spacing: var(--fast-text-dialog-title-letter-spacing);
|
|
235
|
+
--text-section: var(--fast-text-section);
|
|
236
|
+
--text-section--line-height: var(--fast-text-section-line-height);
|
|
237
|
+
--text-section--font-weight: var(--fast-text-section-font-weight);
|
|
238
|
+
--text-figure: var(--fast-text-figure);
|
|
239
|
+
--text-figure--line-height: var(--fast-text-figure-line-height);
|
|
240
|
+
--text-figure--font-weight: var(--fast-text-figure-font-weight);
|
|
241
|
+
}
|