@kanso-labs/kanso-ui 0.42.2 → 0.43.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -12
- package/dist/index.d.ts +2 -1
- package/dist/theme-scope.d.ts +18 -6
- package/dist/theme-scope.js +13 -6
- package/dist/theme-scope.js.map +1 -1
- package/dist/tokens/theme.d.ts +395 -0
- package/dist/tokens.json +1503 -0
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -491,6 +491,11 @@ default value — useful for discovering names, not required at runtime
|
|
|
491
491
|
import '@kanso-labs/kanso-ui/tokens.css'
|
|
492
492
|
```
|
|
493
493
|
|
|
494
|
+
The tokens themselves, as the
|
|
495
|
+
[W3C Design Tokens (DTCG)](https://design-tokens.github.io/community-group/format/)
|
|
496
|
+
source they are built from, are published as `@kanso-labs/kanso-ui/tokens.json`,
|
|
497
|
+
for a library or tool that builds its own output from the same values.
|
|
498
|
+
|
|
494
499
|
### A scheme from Material Theme Builder
|
|
495
500
|
|
|
496
501
|
The colour roles are Material Design's, so a whole scheme can come from
|
|
@@ -562,29 +567,34 @@ every colour role `tokens.css` lists.
|
|
|
562
567
|
The tokens resolve once, on `:root`, and every component inherits them already
|
|
563
568
|
resolved, so a `--kui-*` property redeclared on a smaller element — a wrapping
|
|
564
569
|
`<div>` — reaches nothing on its own. `ThemeScope` resolves them again on an
|
|
565
|
-
element of its own. An override
|
|
566
|
-
`style`, or on any element around it, reaches every
|
|
567
|
-
rest of the page keeps its own tokens:
|
|
568
|
-
|
|
569
|
-
```css
|
|
570
|
-
.accent {
|
|
571
|
-
--kui-color-primary: #7d5260;
|
|
572
|
-
--kui-color-on-primary: #ffffff;
|
|
573
|
-
}
|
|
574
|
-
```
|
|
570
|
+
element of its own. An override handed to the scope's `theme`, or declared on it
|
|
571
|
+
through `className` or `style`, or on any element around it, reaches every
|
|
572
|
+
component inside, and the rest of the page keeps its own tokens:
|
|
575
573
|
|
|
576
574
|
```tsx
|
|
577
|
-
import { Select, ThemeScope } from '@kanso-labs/kanso-ui'
|
|
575
|
+
import { type KuiTheme, Select, ThemeScope } from '@kanso-labs/kanso-ui'
|
|
576
|
+
|
|
577
|
+
const accent: KuiTheme = {
|
|
578
|
+
'--kui-color-on-primary': '#ffffff',
|
|
579
|
+
'--kui-color-primary': '#7d5260',
|
|
580
|
+
}
|
|
578
581
|
|
|
579
582
|
function Section() {
|
|
580
583
|
return (
|
|
581
|
-
<ThemeScope
|
|
584
|
+
<ThemeScope theme={accent}>
|
|
582
585
|
<Select label="Label">…</Select>
|
|
583
586
|
</ThemeScope>
|
|
584
587
|
)
|
|
585
588
|
}
|
|
586
589
|
```
|
|
587
590
|
|
|
591
|
+
`KuiTheme` is the list `tokens.css` declares, as a type: every property is
|
|
592
|
+
optional, takes a value in CSS syntax, and shows its default in an editor. A
|
|
593
|
+
class carrying the same declarations does the same job, for an app that would
|
|
594
|
+
rather keep them in a stylesheet. `theme` holds one value per property for both
|
|
595
|
+
schemes, so a theme with a light and a dark value is two maps, the scope handed
|
|
596
|
+
the one for the scheme in use.
|
|
597
|
+
|
|
588
598
|
`scheme` pins the scope to `'light'` or `'dark'`, whatever the OS asks for. Left
|
|
589
599
|
unset, the scope keeps the scheme around it, so a scope inside a dark page stays
|
|
590
600
|
dark.
|
package/dist/index.d.ts
CHANGED
|
@@ -87,5 +87,6 @@ import "./components/index.js";
|
|
|
87
87
|
import { collectionSizes } from "./layout.js";
|
|
88
88
|
import { useDragAndDrop } from "./drag/hooks.js";
|
|
89
89
|
import { Collection, DIRECTORY_DRAG_TYPE, Focusable, GridLayout, I18nProvider, Key, ListLayout, PressEvent, Pressable, RouterProvider, Selection, SharedElement, SharedElementTransition, SortDescriptor, TableLayout, TokenFieldValue, Virtualizer, VisuallyHidden, WaterfallLayout, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, useAsyncList, useDrag, useDrop, useFilter, useListData, useLocale, useTreeData } from "./react-aria.js";
|
|
90
|
+
import { KuiTheme } from "./tokens/theme.js";
|
|
90
91
|
import { ThemeScope, ThemeScopeProps } from "./theme-scope.js";
|
|
91
|
-
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, Form, type FormProps, GridLayout, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, Keycap, type KeycapProps, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
|
|
92
|
+
export { AppBar, type AppBarProps, type AppBarScroll, type AppBarScrollOptions, Autocomplete, type AutocompleteFilter, type AutocompleteProps, Avatar, type AvatarProps, Badge, type BadgeProps, Breadcrumbs, BreadcrumbsItem, type BreadcrumbsItemProps, type BreadcrumbsProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonGroupVariant, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, type CardVariant, Carousel, CarouselItem, type CarouselItemProps, type CarouselLayout, type CarouselProps, Checkbox, CheckboxGroup, type CheckboxGroupProps, type CheckboxProps, Chip, type ChipActionProps, type ChipFilterProps, ChipGroup, ChipGroupChip, type ChipGroupChipProps, type ChipGroupProps, type ChipProps, type ChipVariant, Code, type CodeProps, Collection, ColorArea, type ColorAreaProps, ColorField, type ColorFieldProps, ColorPicker, type ColorPickerProps, ColorSlider, type ColorSliderProps, ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem, type ColorSwatchPickerItemProps, type ColorSwatchPickerProps, type ColorSwatchProps, ColorWheel, type ColorWheelProps, ComboBox, type ComboBoxProps, type ComboBoxSelectionMode, Container, type ContainerProps, CopyField, type CopyFieldProps, Currency, type CurrencyProps, type CurrencySignDisplay, type CurrencyTone, DIRECTORY_DRAG_TYPE, DateField, type DateFieldProps, DatePicker, type DatePickerProps, DateRangePicker, type DateRangePickerProps, Dialog, DialogBody, DialogContent, type DialogContentProps, DialogFooter, DialogHeader, type DialogProps, DialogTitle, type DialogTitleProps, Disclosure, DisclosureGroup, type DisclosureGroupProps, DisclosureHeader, type DisclosureHeaderProps, DisclosurePanel, type DisclosurePanelProps, type DisclosureProps, DropZone, type DropZoneProps, Fab, FabMenu, FabMenuItem, type FabMenuItemProps, type FabMenuProps, type FabProps, type FabSize, type FabTone, type FabVariant, Feed, type FeedProps, type FieldVariant, FileTrigger, type FileTriggerProps, Focusable, Form, type FormProps, GridLayout, I18nProvider, IconButton, type IconButtonProps, type IconButtonSize, type IconButtonVariant, type Key, Keycap, type KeycapProps, type KuiTheme, Link, type LinkProps, type LinkTone, type LinkUnderline, List, ListBox, ListBoxItem, type ListBoxItemProps, ListBoxLoadMore, type ListBoxLoadMoreProps, type ListBoxProps, ListBoxSection, type ListBoxSectionProps, ListDetail, type ListDetailProps, ListItem, type ListItemProps, ListLayout, ListLoadMore, type ListLoadMoreProps, type ListProps, ListRow, type ListRowProps, ListSection, type ListSectionProps, LoadingIndicator, type LoadingIndicatorProps, Menu, type MenuAlign, MenuContent, type MenuContentProps, MenuItem, type MenuItemProps, MenuLoadMore, type MenuLoadMoreProps, type MenuProps, MenuSection, type MenuSectionProps, MenuSeparator, type MenuSeparatorProps, type MenuSide, MenuSubmenu, type MenuSubmenuProps, Meter, type MeterProps, type MeterTone, NavigationBar, NavigationBarItem, type NavigationItemProps as NavigationBarItemProps, type NavigationBarProps, NavigationRail, NavigationRailItem, type NavigationItemProps as NavigationRailItemProps, type NavigationRailProps, NavigationTree, NavigationTreeItem, type NavigationTreeItemProps, type NavigationTreeProps, NavigationTreeSection, type NavigationTreeSectionProps, NumberField, type NumberFieldProps, Popover, type PopoverAlign, PopoverContent, type PopoverContentProps, PopoverDescription, type PopoverDescriptionProps, type PopoverProps, type PopoverSide, type PopoverSize, PopoverTitle, type PopoverTitleProps, type PopoverTrigger, type PressEvent, Pressable, ProductIcon, type ProductIconProps, ProgressIndicator, type ProgressIndicatorProps, type ProgressIndicatorShape, type ProgressIndicatorTone, type ProgressIndicatorVariant, Radio, RadioGroup, type RadioGroupProps, type RadioProps, RangeCalendar, type RangeCalendarProps, RouterProvider, SearchField, type SearchFieldProps, SearchView, SearchViewContent, type SearchViewContentProps, type SearchViewProps, SegmentedButton, type SegmentedButtonProps, SegmentedButtonSegment, type SegmentedButtonSegmentProps, Select, type SelectProps, type Selection, Separator, type SeparatorInset, type SeparatorProps, SharedElement, SharedElementTransition, Sheet, SheetBody, SheetContent, type SheetContentProps, SheetFooter, SheetHandle, SheetHeader, type SheetProps, SheetTitle, type SheetTitleProps, Slider, type SliderProps, type SliderSize, Snackbar, type SnackbarAction, type SnackbarMessage, type SnackbarOptions, type SnackbarProps, type SnackbarQueue, type ToastRegionRenderProps as SnackbarRegionRenderProps, type SortDescriptor, SplitButton, SplitButtonAction, type SplitButtonActionProps, SplitButtonMenu, type SplitButtonMenuProps, type SplitButtonProps, type SplitButtonVariant, Stack, type StackAlign, type StackGap, type StackJustify, type StackProps, SupportingPane, type SupportingPaneProps, Switch, type SwitchProps, Table, TableBody, type TableBodyProps, TableCell, type TableCellProps, TableColumn, type TableColumnProps, TableFooter, type TableFooterProps, TableHeader, type TableHeaderProps, TableLayout, TableLoadMore, type TableLoadMoreProps, type TableProps, TableRow, type TableRowProps, Tabs, type TabsLayout, TabsList, type TabsListProps, TabsPanel, type TabsPanelProps, TabsPanels, type TabsPanelsProps, type TabsProps, TabsTab, type TabsTabProps, type TabsVariant, Tag, type TagProps, type TagTone, type TagVariant, Text, TextArea, type TextAreaProps, TextField, type TextFieldProps, type TextProps, ThemeScope, type ThemeScopeProps, TimeField, type TimeFieldProps, TimePicker, type TimePickerMode, type TimePickerProps, TokenField, type TokenFieldProps, TokenFieldValue, type TokenSegment, Toolbar, type ToolbarProps, type ToolbarTone, Tooltip, type TooltipAlign, type TooltipProps, type TooltipSide, Tree, TreeItem, type TreeItemProps, TreeLoadMore, type TreeLoadMoreProps, type TreeProps, TreeSection, type TreeSectionProps, Virtualizer, VisuallyHidden, WaterfallLayout, collectionSizes, colorScheme, getColorChannels, isDirectoryDropItem, isFileDropItem, isTextDropItem, parseColor, themeScope, useAppBarScroll, useAsyncList, useDrag, useDragAndDrop, useDrop, useFilter, useListData, useLocale, useTreeData };
|
package/dist/theme-scope.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { RenderComponentProps } from "./render/useRender.js";
|
|
2
|
+
import { KuiTheme } from "./tokens/theme.js";
|
|
2
3
|
//#region src/theme-scope.d.ts
|
|
3
4
|
type ThemeScopeProps = RenderComponentProps<'div'> & {
|
|
4
5
|
/**
|
|
@@ -10,20 +11,31 @@ type ThemeScopeProps = RenderComponentProps<'div'> & {
|
|
|
10
11
|
* pins, or the OS's.
|
|
11
12
|
*/
|
|
12
13
|
scheme?: 'dark' | 'light' | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* `--kui-*` overrides for everything inside, as a map of the custom
|
|
16
|
+
* properties `tokens.css` lists to CSS values. The scope declares them on
|
|
17
|
+
* its own element, as an override in `style` would be, with `style` winning
|
|
18
|
+
* where the two set the same property.
|
|
19
|
+
*
|
|
20
|
+
* The values hold for both schemes. To give light and dark a value each,
|
|
21
|
+
* keep two maps and hand the scope the one for the scheme in use.
|
|
22
|
+
*/
|
|
23
|
+
theme?: KuiTheme | undefined;
|
|
13
24
|
};
|
|
14
25
|
/**
|
|
15
26
|
* Themes what is inside it, overlays included.
|
|
16
27
|
*
|
|
17
|
-
* A `--kui-*` override declared on the scope — through `className`
|
|
18
|
-
* `style` — or on any element around it reaches every component inside,
|
|
28
|
+
* A `--kui-*` override declared on the scope — through `theme`, `className`
|
|
29
|
+
* or `style` — or on any element around it reaches every component inside,
|
|
19
30
|
* where on any element but `<html>` it would otherwise reach none, since the
|
|
20
31
|
* tokens resolve once on `:root`. Popovers, sheets, tooltips and toasts
|
|
21
32
|
* opened inside portal into the scope rather than into the body, so they
|
|
22
33
|
* follow it too. The rest of the page keeps its own tokens.
|
|
23
34
|
*
|
|
24
35
|
* ```tsx
|
|
25
|
-
*
|
|
26
|
-
*
|
|
36
|
+
* const accent: KuiTheme = { '--kui-color-primary': '#7d5260' }
|
|
37
|
+
*
|
|
38
|
+
* <ThemeScope scheme="dark" theme={accent}>
|
|
27
39
|
* <Select label="Label">…</Select>
|
|
28
40
|
* </ThemeScope>
|
|
29
41
|
* ```
|
|
@@ -37,7 +49,7 @@ type ThemeScopeProps = RenderComponentProps<'div'> & {
|
|
|
37
49
|
* `render` swaps the element, for a scope that should be a `<main>`, a
|
|
38
50
|
* `<section>`, or the `<body>` itself.
|
|
39
51
|
*/
|
|
40
|
-
declare function ThemeScope({ children, render, scheme, ...props }: ThemeScopeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
52
|
+
declare function ThemeScope({ children, render, scheme, theme, ...props }: ThemeScopeProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
|
|
41
53
|
//#endregion
|
|
42
|
-
export { ThemeScope, type ThemeScopeProps };
|
|
54
|
+
export { type KuiTheme, ThemeScope, type ThemeScopeProps };
|
|
43
55
|
//# sourceMappingURL=theme-scope.d.ts.map
|
package/dist/theme-scope.js
CHANGED
|
@@ -20,16 +20,17 @@ const schemes = {
|
|
|
20
20
|
/**
|
|
21
21
|
* Themes what is inside it, overlays included.
|
|
22
22
|
*
|
|
23
|
-
* A `--kui-*` override declared on the scope — through `className`
|
|
24
|
-
* `style` — or on any element around it reaches every component inside,
|
|
23
|
+
* A `--kui-*` override declared on the scope — through `theme`, `className`
|
|
24
|
+
* or `style` — or on any element around it reaches every component inside,
|
|
25
25
|
* where on any element but `<html>` it would otherwise reach none, since the
|
|
26
26
|
* tokens resolve once on `:root`. Popovers, sheets, tooltips and toasts
|
|
27
27
|
* opened inside portal into the scope rather than into the body, so they
|
|
28
28
|
* follow it too. The rest of the page keeps its own tokens.
|
|
29
29
|
*
|
|
30
30
|
* ```tsx
|
|
31
|
-
*
|
|
32
|
-
*
|
|
31
|
+
* const accent: KuiTheme = { '--kui-color-primary': '#7d5260' }
|
|
32
|
+
*
|
|
33
|
+
* <ThemeScope scheme="dark" theme={accent}>
|
|
33
34
|
* <Select label="Label">…</Select>
|
|
34
35
|
* </ThemeScope>
|
|
35
36
|
* ```
|
|
@@ -45,7 +46,7 @@ const schemes = {
|
|
|
45
46
|
*/
|
|
46
47
|
function ThemeScope(t0) {
|
|
47
48
|
const $ = c(17);
|
|
48
|
-
const { children, render, scheme, ...props$1 } = t0;
|
|
49
|
+
const { children, render, scheme, theme, ...props$1 } = t0;
|
|
49
50
|
const [container, setContainer] = useState(null);
|
|
50
51
|
let t1;
|
|
51
52
|
if ($[0] !== container) {
|
|
@@ -55,7 +56,13 @@ function ThemeScope(t0) {
|
|
|
55
56
|
} else t1 = $[1];
|
|
56
57
|
const getContainer = t1;
|
|
57
58
|
const t2 = "div";
|
|
58
|
-
const t3 = mergeStyles(props(styles.root, tokenScope, scheme !== void 0 && schemes[scheme], scheme !== void 0 && pinnedScheme[scheme]), props$1
|
|
59
|
+
const t3 = mergeStyles(props(styles.root, tokenScope, scheme !== void 0 && schemes[scheme], scheme !== void 0 && pinnedScheme[scheme]), theme === void 0 ? props$1 : {
|
|
60
|
+
...props$1,
|
|
61
|
+
style: {
|
|
62
|
+
...theme,
|
|
63
|
+
...props$1.style
|
|
64
|
+
}
|
|
65
|
+
});
|
|
59
66
|
let t4;
|
|
60
67
|
if ($[2] !== children || $[3] !== getContainer) {
|
|
61
68
|
t4 = /* @__PURE__ */ jsx(UNSAFE_PortalProvider, {
|
package/dist/theme-scope.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-scope.js","names":["c","_c","stylex","useCallback","useState","UNSAFE_PortalProvider","PortalProvider","RenderComponentProps","useRender","mergeStyles","pinnedScheme","colorDefaultsDarkTheme","colorDefaultsLightTheme","tokenScope","styles","root","kB7OPa","$$css","schemes","dark","light","ThemeScopeProps","scheme","ThemeScope","t0","$","children","render","props","container","setContainer","t1","getContainer","t2","t3","undefined","t4","t5","t6","t7","t8","defaultTagName","_c","props","stylex.props","PortalProvider"],"sources":["../src/theme-scope.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useState } from 'react';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria/PortalProvider';\nimport type { RenderComponentProps } from './render/useRender';\nimport { useRender } from './render/useRender';\nimport { mergeStyles } from './styles/merge';\nimport { pinnedScheme } from './styles/scheme';\nimport { colorDefaultsDarkTheme, colorDefaultsLightTheme, tokenScope } from './tokens/design.tokens.stylex';\n\n// The component form of `themeScope` and `colorScheme` in ./color-scheme.ts:\n// the same classes, on an element of its own, plus the one thing a class\n// cannot do — take the overlays along. A pinned scheme paints the scope's\n// surface and sets its `color-scheme` too; see src/styles/scheme.ts.\n//\n// React Aria portals every overlay to the end of `<body>` unless a portal\n// provider names another container, so a popover, a sheet, a tooltip or a\n// toast opened inside a themed element renders outside it, and keeps the\n// tokens of the page. The container here is the scope's own last child,\n// which is what makes the overlays inherit whatever the scope inherits: its\n// scheme, and the `--kui-*` overrides declared on it or on any element around\n// it. A container appended to the body and given the scope's classes would\n// carry the classes alone, losing every override declared above the scope.\n//\n// `display: contents` keeps that container out of the layout, so a scope\n// that is a grid or a flex container gains no item and no gap from it. React\n// Aria positions an overlay against the overlay's own containing block rather\n// than the container's box, so a container with no box of its own changes\n// nothing about where a popover lands.\nconst styles = {\n root: {\n kB7OPa: \"x9f619\",\n $$css: true\n }\n};\nconst schemes = {\n dark: colorDefaultsDarkTheme,\n light: colorDefaultsLightTheme\n};\ntype ThemeScopeProps = RenderComponentProps<'div'> & {\n /**\n * Pins the scope to the library's light or dark scheme, whatever the\n * reader's OS asks for. A pinned scope paints its own surface and text in\n * that scheme and sets `color-scheme` for the native controls inside, so\n * it reads on any page. Left unset, the scope paints nothing and keeps the\n * scheme around it: the one an enclosing scope or the `<html>` element\n * pins, or the OS's.\n */\n scheme?: 'dark' | 'light' | undefined;\n};\n\n/**\n * Themes what is inside it, overlays included.\n *\n * A `--kui-*` override declared on the scope — through `className
|
|
1
|
+
{"version":3,"file":"theme-scope.js","names":["c","_c","stylex","useCallback","useState","UNSAFE_PortalProvider","PortalProvider","RenderComponentProps","KuiTheme","useRender","mergeStyles","pinnedScheme","colorDefaultsDarkTheme","colorDefaultsLightTheme","tokenScope","styles","root","kB7OPa","$$css","schemes","dark","light","ThemeScopeProps","scheme","theme","ThemeScope","t0","$","children","render","props","container","setContainer","t1","getContainer","t2","t3","undefined","style","t4","t5","t6","t7","t8","defaultTagName","_c","props","stylex.props","PortalProvider"],"sources":["../src/theme-scope.tsx"],"sourcesContent":["'use client';\n\nimport * as stylex from '@stylexjs/stylex';\nimport { useCallback, useState } from 'react';\nimport { UNSAFE_PortalProvider as PortalProvider } from 'react-aria/PortalProvider';\nimport type { RenderComponentProps } from './render/useRender';\nimport type { KuiTheme } from './tokens/theme';\nimport { useRender } from './render/useRender';\nimport { mergeStyles } from './styles/merge';\nimport { pinnedScheme } from './styles/scheme';\nimport { colorDefaultsDarkTheme, colorDefaultsLightTheme, tokenScope } from './tokens/design.tokens.stylex';\n\n// The component form of `themeScope` and `colorScheme` in ./color-scheme.ts:\n// the same classes, on an element of its own, plus the one thing a class\n// cannot do — take the overlays along. A pinned scheme paints the scope's\n// surface and sets its `color-scheme` too; see src/styles/scheme.ts.\n//\n// React Aria portals every overlay to the end of `<body>` unless a portal\n// provider names another container, so a popover, a sheet, a tooltip or a\n// toast opened inside a themed element renders outside it, and keeps the\n// tokens of the page. The container here is the scope's own last child,\n// which is what makes the overlays inherit whatever the scope inherits: its\n// scheme, and the `--kui-*` overrides declared on it or on any element around\n// it. A container appended to the body and given the scope's classes would\n// carry the classes alone, losing every override declared above the scope.\n//\n// `display: contents` keeps that container out of the layout, so a scope\n// that is a grid or a flex container gains no item and no gap from it. React\n// Aria positions an overlay against the overlay's own containing block rather\n// than the container's box, so a container with no box of its own changes\n// nothing about where a popover lands.\nconst styles = {\n root: {\n kB7OPa: \"x9f619\",\n $$css: true\n }\n};\nconst schemes = {\n dark: colorDefaultsDarkTheme,\n light: colorDefaultsLightTheme\n};\ntype ThemeScopeProps = RenderComponentProps<'div'> & {\n /**\n * Pins the scope to the library's light or dark scheme, whatever the\n * reader's OS asks for. A pinned scope paints its own surface and text in\n * that scheme and sets `color-scheme` for the native controls inside, so\n * it reads on any page. Left unset, the scope paints nothing and keeps the\n * scheme around it: the one an enclosing scope or the `<html>` element\n * pins, or the OS's.\n */\n scheme?: 'dark' | 'light' | undefined;\n /**\n * `--kui-*` overrides for everything inside, as a map of the custom\n * properties `tokens.css` lists to CSS values. The scope declares them on\n * its own element, as an override in `style` would be, with `style` winning\n * where the two set the same property.\n *\n * The values hold for both schemes. To give light and dark a value each,\n * keep two maps and hand the scope the one for the scheme in use.\n */\n theme?: KuiTheme | undefined;\n};\n\n/**\n * Themes what is inside it, overlays included.\n *\n * A `--kui-*` override declared on the scope — through `theme`, `className`\n * or `style` — or on any element around it reaches every component inside,\n * where on any element but `<html>` it would otherwise reach none, since the\n * tokens resolve once on `:root`. Popovers, sheets, tooltips and toasts\n * opened inside portal into the scope rather than into the body, so they\n * follow it too. The rest of the page keeps its own tokens.\n *\n * ```tsx\n * const accent: KuiTheme = { '--kui-color-primary': '#7d5260' }\n *\n * <ThemeScope scheme=\"dark\" theme={accent}>\n * <Select label=\"Label\">…</Select>\n * </ThemeScope>\n * ```\n *\n * Because the overlays render inside the scope, an ancestor that confines\n * its descendants confines them too: a `transform` or a `filter` makes a\n * sheet's fixed scrim cover that ancestor rather than the viewport, and\n * `overflow: hidden` with a position clips a popover. Put the scope around\n * such an element rather than inside it.\n *\n * `render` swaps the element, for a scope that should be a `<main>`, a\n * `<section>`, or the `<body>` itself.\n */\nfunction ThemeScope({\n children,\n render,\n scheme,\n theme,\n ...props\n}: ThemeScopeProps) {\n // State rather than a ref, so the overlays render again once the container\n // exists. React Aria renders an overlay nowhere while `getContainer` hands\n // back nothing, and one open on the scope's first render would otherwise\n // stay that way.\n const [container, setContainer] = useState<HTMLDivElement | null>(null);\n const getContainer = useCallback(() => container, [container]);\n return useRender({\n defaultTagName: 'div',\n props: {\n ...props,\n ...mergeStyles(stylex.props(styles.root, tokenScope, scheme !== undefined && schemes[scheme], scheme !== undefined && pinnedScheme[scheme]), theme === undefined ? props : {\n ...props,\n style: {\n ...theme,\n ...props.style\n }\n }),\n children: <>\n <PortalProvider getContainer={getContainer}>\n {children}\n </PortalProvider>\n <div className=\"x9f619 xjp7ctv\" ref={setContainer} />\n </>\n },\n render\n });\n}\nexport type { KuiTheme } from './tokens/theme';\nexport type { ThemeScopeProps };\nexport { ThemeScope };"],"mappings":";;;;;;;;;;;AA+BA,MAAMe,SAAS,EACbC,MAAM;CACJC,QAAQ;CACRC,OAAO;AACT,EACF;AACA,MAAMC,UAAU;CACdC,MAAMR;CACNS,OAAOR;AACT;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,SAAAY,WAAAC,IAAA;CAAA,MAAAC,IAAA1B,EAAA,EAAA;CAAoB,MAAA,EAAA2B,UAAAC,QAAAN,QAAAC,OAAA,GAAAM,YAAAJ;CAWlB,MAAA,CAAAK,WAAAC,gBAAkC5B,SAAgC,IAAI;CAAE,IAAA6B;CAAA,IAAAN,EAAA,OAAAI,WAAA;EACvCE,WAAMF;EAASJ,EAAA,KAAAI;EAAAJ,EAAA,KAAAM;CAAA,OAAAA,KAAAN,EAAA;CAAhD,MAAAO,eAAqBD;CAEH,MAAAE,KAAA;CAGX,MAAAC,KAAA1B,YAAYR,MAAaa,OAAMC,MAAOF,YAAYS,WAAWc,KAAAA,KAAalB,QAAQI,SAASA,WAAWc,KAAAA,KAAa1B,aAAaY,OAAO,GAAGC,UAAUa,KAAAA,IAAVP,UAAA;EAAA,GACxIA;EAAKQ,OACD;GAAA,GACFd;GAAK,GACLM,QAAKQ;EACV;CACF,CAAC;CAAC,IAAAC;CAAA,IAAAZ,EAAA,OAAAC,YAAAD,EAAA,OAAAO,cAAA;EAEEK,KAAA,oBAACS,uBAAD;GAA8Bd;GAC3BN;EADY,CAAA;EAEED,EAAA,KAAAC;EAAAD,EAAA,KAAAO;EAAAP,EAAA,KAAAY;CAAA,OAAAA,KAAAZ,EAAA;CAAA,IAAAa;CAAA,IAAAb,EAAA,OAAAK,cAAA;EACjBQ,KAAA,oBAAA,OAAA;GAAe,WAAA;GAAsBR,KAAAA;EAAY,CAAA;EAAIL,EAAA,KAAAK;EAAAL,EAAA,KAAAa;CAAA,OAAAA,KAAAb,EAAA;CAAA,IAAAc;CAAA,IAAAd,EAAA,OAAAY,MAAAZ,EAAA,OAAAa,IAAA;EAJ/CC,KAAA,qBAAA,YAAA,EAAA,UAAA,CACNF,IAGAC,EAAqD,EAAA,CAAA;EACpDb,EAAA,KAAAY;EAAAZ,EAAA,KAAAa;EAAAb,EAAA,KAAAc;CAAA,OAAAA,KAAAd,EAAA;CAAA,IAAAe;CAAA,IAAAf,EAAA,QAAAG,WAAAH,EAAA,QAAAS,MAAAT,EAAA,QAAAc,IAAA;EAdAC,KAAA;GAAA,GACFZ;GAAK,GACLM;GAMDR,UACQa;EAMZ;EAACd,EAAA,MAAAG;EAAAH,EAAA,MAAAS;EAAAT,EAAA,MAAAc;EAAAd,EAAA,MAAAe;CAAA,OAAAA,KAAAf,EAAA;CAAA,IAAAgB;CAAA,IAAAhB,EAAA,QAAAE,UAAAF,EAAA,QAAAe,IAAA;EAjBcC,KAAA;GAAAC,gBACCT;GAAKL,OACdY;GAeNb;EAEH;EAACF,EAAA,MAAAE;EAAAF,EAAA,MAAAe;EAAAf,EAAA,MAAAgB;CAAA,OAAAA,KAAAhB,EAAA;CAAA,OAnBMlB,UAAUkC,EAmBhB;AAAC"}
|
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
//#region src/tokens/theme.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* A theme: any of the `--kui-*` custom properties `tokens.css` lists, each set
|
|
4
|
+
* to a value in CSS syntax. Hand one to `ThemeScope`'s `theme` prop, and every
|
|
5
|
+
* component inside reads it.
|
|
6
|
+
*
|
|
7
|
+
* The values hold for both schemes. A theme with a value of its own for light
|
|
8
|
+
* and for dark is two of these, with the scope handed the one for the scheme
|
|
9
|
+
* in use.
|
|
10
|
+
*/
|
|
11
|
+
type KuiTheme = {
|
|
12
|
+
/** Defaults to `#fef7ff` in the light scheme and `#141218` in the dark. */
|
|
13
|
+
readonly '--kui-color-background'?: string;
|
|
14
|
+
/** Defaults to `#b3261e` in the light scheme and `#f2b8b5` in the dark. */
|
|
15
|
+
readonly '--kui-color-error'?: string;
|
|
16
|
+
/** Defaults to `#f9dedc` in the light scheme and `#8c1d18` in the dark. */
|
|
17
|
+
readonly '--kui-color-error-container'?: string;
|
|
18
|
+
/** Defaults to `#f5eff7` in the light scheme and `#322f35` in the dark. */
|
|
19
|
+
readonly '--kui-color-inverse-on-surface'?: string;
|
|
20
|
+
/** Defaults to `#d0bcff` in the light scheme and `#6750a4` in the dark. */
|
|
21
|
+
readonly '--kui-color-inverse-primary'?: string;
|
|
22
|
+
/** Defaults to `#322f35` in the light scheme and `#e6e0e9` in the dark. */
|
|
23
|
+
readonly '--kui-color-inverse-surface'?: string;
|
|
24
|
+
/** Defaults to `#a04022` in the light scheme and `#ffb59f` in the dark. */
|
|
25
|
+
readonly '--kui-color-negative'?: string;
|
|
26
|
+
/** Defaults to `#ffdbd1` in the light scheme and `#81290c` in the dark. */
|
|
27
|
+
readonly '--kui-color-negative-container'?: string;
|
|
28
|
+
/** Defaults to `#1d1b20` in the light scheme and `#e6e0e9` in the dark. */
|
|
29
|
+
readonly '--kui-color-on-background'?: string;
|
|
30
|
+
/** Defaults to `#ffffff` in the light scheme and `#601410` in the dark. */
|
|
31
|
+
readonly '--kui-color-on-error'?: string;
|
|
32
|
+
/** Defaults to `#410e0b` in the light scheme and `#f9dedc` in the dark. */
|
|
33
|
+
readonly '--kui-color-on-error-container'?: string;
|
|
34
|
+
/** Defaults to `#ffffff` in the light scheme and `#5f1600` in the dark. */
|
|
35
|
+
readonly '--kui-color-on-negative'?: string;
|
|
36
|
+
/** Defaults to `#3a0a00` in the light scheme and `#ffdbd1` in the dark. */
|
|
37
|
+
readonly '--kui-color-on-negative-container'?: string;
|
|
38
|
+
/** Defaults to `#ffffff` in the light scheme and `#003827` in the dark. */
|
|
39
|
+
readonly '--kui-color-on-positive'?: string;
|
|
40
|
+
/** Defaults to `#002115` in the light scheme and `#90f6ca` in the dark. */
|
|
41
|
+
readonly '--kui-color-on-positive-container'?: string;
|
|
42
|
+
/** Defaults to `#ffffff` in the light scheme and `#381e72` in the dark. */
|
|
43
|
+
readonly '--kui-color-on-primary'?: string;
|
|
44
|
+
/** Defaults to `#21005d` in the light scheme and `#eaddff` in the dark. */
|
|
45
|
+
readonly '--kui-color-on-primary-container'?: string;
|
|
46
|
+
/** Defaults to `#21005d`. */
|
|
47
|
+
readonly '--kui-color-on-primary-fixed'?: string;
|
|
48
|
+
/** Defaults to `#4f378b`. */
|
|
49
|
+
readonly '--kui-color-on-primary-fixed-variant'?: string;
|
|
50
|
+
/** Defaults to `#ffffff` in the light scheme and `#332d41` in the dark. */
|
|
51
|
+
readonly '--kui-color-on-secondary'?: string;
|
|
52
|
+
/** Defaults to `#1d192b` in the light scheme and `#e8def8` in the dark. */
|
|
53
|
+
readonly '--kui-color-on-secondary-container'?: string;
|
|
54
|
+
/** Defaults to `#1d192b`. */
|
|
55
|
+
readonly '--kui-color-on-secondary-fixed'?: string;
|
|
56
|
+
/** Defaults to `#4a4458`. */
|
|
57
|
+
readonly '--kui-color-on-secondary-fixed-variant'?: string;
|
|
58
|
+
/** Defaults to `#1d1b20` in the light scheme and `#e6e0e9` in the dark. */
|
|
59
|
+
readonly '--kui-color-on-surface'?: string;
|
|
60
|
+
/** Defaults to `#49454f` in the light scheme and `#cac4d0` in the dark. */
|
|
61
|
+
readonly '--kui-color-on-surface-variant'?: string;
|
|
62
|
+
/** Defaults to `#ffffff` in the light scheme and `#492532` in the dark. */
|
|
63
|
+
readonly '--kui-color-on-tertiary'?: string;
|
|
64
|
+
/** Defaults to `#31111d` in the light scheme and `#ffd8e4` in the dark. */
|
|
65
|
+
readonly '--kui-color-on-tertiary-container'?: string;
|
|
66
|
+
/** Defaults to `#31111d`. */
|
|
67
|
+
readonly '--kui-color-on-tertiary-fixed'?: string;
|
|
68
|
+
/** Defaults to `#633b48`. */
|
|
69
|
+
readonly '--kui-color-on-tertiary-fixed-variant'?: string;
|
|
70
|
+
/** Defaults to `#79747e` in the light scheme and `#938f99` in the dark. */
|
|
71
|
+
readonly '--kui-color-outline'?: string;
|
|
72
|
+
/** Defaults to `#cac4d0` in the light scheme and `#49454f` in the dark. */
|
|
73
|
+
readonly '--kui-color-outline-variant'?: string;
|
|
74
|
+
/** Defaults to `#006c4d` in the light scheme and `#74d9af` in the dark. */
|
|
75
|
+
readonly '--kui-color-positive'?: string;
|
|
76
|
+
/** Defaults to `#90f6ca` in the light scheme and `#00513a` in the dark. */
|
|
77
|
+
readonly '--kui-color-positive-container'?: string;
|
|
78
|
+
/** Defaults to `#6750a4` in the light scheme and `#d0bcff` in the dark. */
|
|
79
|
+
readonly '--kui-color-primary'?: string;
|
|
80
|
+
/** Defaults to `#eaddff` in the light scheme and `#4f378b` in the dark. */
|
|
81
|
+
readonly '--kui-color-primary-container'?: string;
|
|
82
|
+
/** Defaults to `#eaddff`. */
|
|
83
|
+
readonly '--kui-color-primary-fixed'?: string;
|
|
84
|
+
/** Defaults to `#d0bcff`. */
|
|
85
|
+
readonly '--kui-color-primary-fixed-dim'?: string;
|
|
86
|
+
/** Defaults to `#000000`. */
|
|
87
|
+
readonly '--kui-color-scrim'?: string;
|
|
88
|
+
/** Defaults to `#625b71` in the light scheme and `#ccc2dc` in the dark. */
|
|
89
|
+
readonly '--kui-color-secondary'?: string;
|
|
90
|
+
/** Defaults to `#e8def8` in the light scheme and `#4a4458` in the dark. */
|
|
91
|
+
readonly '--kui-color-secondary-container'?: string;
|
|
92
|
+
/** Defaults to `#e8def8`. */
|
|
93
|
+
readonly '--kui-color-secondary-fixed'?: string;
|
|
94
|
+
/** Defaults to `#ccc2dc`. */
|
|
95
|
+
readonly '--kui-color-secondary-fixed-dim'?: string;
|
|
96
|
+
/** Defaults to `#000000`. */
|
|
97
|
+
readonly '--kui-color-shadow'?: string;
|
|
98
|
+
/** Defaults to `#fef7ff` in the light scheme and `#141218` in the dark. */
|
|
99
|
+
readonly '--kui-color-surface'?: string;
|
|
100
|
+
/** Defaults to `#fef7ff` in the light scheme and `#3b383e` in the dark. */
|
|
101
|
+
readonly '--kui-color-surface-bright'?: string;
|
|
102
|
+
/** Defaults to `#f3edf7` in the light scheme and `#211f26` in the dark. */
|
|
103
|
+
readonly '--kui-color-surface-container'?: string;
|
|
104
|
+
/** Defaults to `#ece6f0` in the light scheme and `#2b2930` in the dark. */
|
|
105
|
+
readonly '--kui-color-surface-container-high'?: string;
|
|
106
|
+
/** Defaults to `#e6e0e9` in the light scheme and `#36343b` in the dark. */
|
|
107
|
+
readonly '--kui-color-surface-container-highest'?: string;
|
|
108
|
+
/** Defaults to `#f7f2fa` in the light scheme and `#1d1b20` in the dark. */
|
|
109
|
+
readonly '--kui-color-surface-container-low'?: string;
|
|
110
|
+
/** Defaults to `#ffffff` in the light scheme and `#0f0d13` in the dark. */
|
|
111
|
+
readonly '--kui-color-surface-container-lowest'?: string;
|
|
112
|
+
/** Defaults to `#ded8e1` in the light scheme and `#141218` in the dark. */
|
|
113
|
+
readonly '--kui-color-surface-dim'?: string;
|
|
114
|
+
/** Defaults to `#6750a4` in the light scheme and `#d0bcff` in the dark. */
|
|
115
|
+
readonly '--kui-color-surface-tint'?: string;
|
|
116
|
+
/** Defaults to `#e7e0ec` in the light scheme and `#49454f` in the dark. */
|
|
117
|
+
readonly '--kui-color-surface-variant'?: string;
|
|
118
|
+
/** Defaults to `#7d5260` in the light scheme and `#efb8c8` in the dark. */
|
|
119
|
+
readonly '--kui-color-tertiary'?: string;
|
|
120
|
+
/** Defaults to `#ffd8e4` in the light scheme and `#633b48` in the dark. */
|
|
121
|
+
readonly '--kui-color-tertiary-container'?: string;
|
|
122
|
+
/** Defaults to `#ffd8e4`. */
|
|
123
|
+
readonly '--kui-color-tertiary-fixed'?: string;
|
|
124
|
+
/** Defaults to `#efb8c8`. */
|
|
125
|
+
readonly '--kui-color-tertiary-fixed-dim'?: string;
|
|
126
|
+
/** Defaults to `450ms`. */
|
|
127
|
+
readonly '--kui-motion-duration-long1'?: string;
|
|
128
|
+
/** Defaults to `500ms`. */
|
|
129
|
+
readonly '--kui-motion-duration-long2'?: string;
|
|
130
|
+
/** Defaults to `600ms`. */
|
|
131
|
+
readonly '--kui-motion-duration-long3'?: string;
|
|
132
|
+
/** Defaults to `250ms`. */
|
|
133
|
+
readonly '--kui-motion-duration-medium1'?: string;
|
|
134
|
+
/** Defaults to `300ms`. */
|
|
135
|
+
readonly '--kui-motion-duration-medium2'?: string;
|
|
136
|
+
/** Defaults to `350ms`. */
|
|
137
|
+
readonly '--kui-motion-duration-medium3'?: string;
|
|
138
|
+
/** Defaults to `100ms`. */
|
|
139
|
+
readonly '--kui-motion-duration-short1'?: string;
|
|
140
|
+
/** Defaults to `150ms`. */
|
|
141
|
+
readonly '--kui-motion-duration-short2'?: string;
|
|
142
|
+
/** Defaults to `200ms`. */
|
|
143
|
+
readonly '--kui-motion-duration-short3'?: string;
|
|
144
|
+
/** Defaults to `cubic-bezier(0.2, 0, 0, 1)`. */
|
|
145
|
+
readonly '--kui-motion-easing-emphasized'?: string;
|
|
146
|
+
/** Defaults to `cubic-bezier(0.3, 0, 0.8, 0.15)`. */
|
|
147
|
+
readonly '--kui-motion-easing-emphasized-accelerate'?: string;
|
|
148
|
+
/** Defaults to `cubic-bezier(0.05, 0.7, 0.1, 1)`. */
|
|
149
|
+
readonly '--kui-motion-easing-emphasized-decelerate'?: string;
|
|
150
|
+
/** Defaults to `cubic-bezier(0.34, 1.56, 0.64, 1)`. */
|
|
151
|
+
readonly '--kui-motion-easing-spring-fast'?: string;
|
|
152
|
+
/** Defaults to `cubic-bezier(0.16, 1, 0.3, 1)`. */
|
|
153
|
+
readonly '--kui-motion-easing-spring-slow'?: string;
|
|
154
|
+
/** Defaults to `cubic-bezier(0.2, 0, 0, 1)`. */
|
|
155
|
+
readonly '--kui-motion-easing-standard'?: string;
|
|
156
|
+
/** Defaults to `9999px`. */
|
|
157
|
+
readonly '--kui-radius-circle'?: string;
|
|
158
|
+
/** Defaults to `16px`. */
|
|
159
|
+
readonly '--kui-radius-lg'?: string;
|
|
160
|
+
/** Defaults to `12px`. */
|
|
161
|
+
readonly '--kui-radius-md'?: string;
|
|
162
|
+
/** Defaults to `0px`. */
|
|
163
|
+
readonly '--kui-radius-none'?: string;
|
|
164
|
+
/** Defaults to `9999px`. */
|
|
165
|
+
readonly '--kui-radius-pill'?: string;
|
|
166
|
+
/** Defaults to `8px`. */
|
|
167
|
+
readonly '--kui-radius-sm'?: string;
|
|
168
|
+
/** Defaults to `28px`. */
|
|
169
|
+
readonly '--kui-radius-xl'?: string;
|
|
170
|
+
/** Defaults to `4px`. */
|
|
171
|
+
readonly '--kui-radius-xs'?: string;
|
|
172
|
+
/** Defaults to `0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 1px 3px 1px rgba(0, 0, 0, 0.15)`. */
|
|
173
|
+
readonly '--kui-shadow-elevation1'?: string;
|
|
174
|
+
/** Defaults to `0px 1px 2px 0px rgba(0, 0, 0, 0.3), 0px 2px 6px 2px rgba(0, 0, 0, 0.15)`. */
|
|
175
|
+
readonly '--kui-shadow-elevation2'?: string;
|
|
176
|
+
/** Defaults to `0px 1px 3px 0px rgba(0, 0, 0, 0.3), 0px 4px 8px 3px rgba(0, 0, 0, 0.15)`. */
|
|
177
|
+
readonly '--kui-shadow-elevation3'?: string;
|
|
178
|
+
/** Defaults to `0px 2px 3px 0px rgba(0, 0, 0, 0.3), 0px 6px 10px 4px rgba(0, 0, 0, 0.15)`. */
|
|
179
|
+
readonly '--kui-shadow-elevation4'?: string;
|
|
180
|
+
/** Defaults to `0px 4px 4px 0px rgba(0, 0, 0, 0.3), 0px 8px 12px 6px rgba(0, 0, 0, 0.15)`. */
|
|
181
|
+
readonly '--kui-shadow-elevation5'?: string;
|
|
182
|
+
/** Defaults to `56px`. */
|
|
183
|
+
readonly '--kui-sizing-control-lg'?: string;
|
|
184
|
+
/** Defaults to `48px`. */
|
|
185
|
+
readonly '--kui-sizing-control-md'?: string;
|
|
186
|
+
/** Defaults to `40px`. */
|
|
187
|
+
readonly '--kui-sizing-control-sm'?: string;
|
|
188
|
+
/** Defaults to `96px`. */
|
|
189
|
+
readonly '--kui-sizing-control-xl'?: string;
|
|
190
|
+
/** Defaults to `32px`. */
|
|
191
|
+
readonly '--kui-sizing-control-xs'?: string;
|
|
192
|
+
/** Defaults to `136px`. */
|
|
193
|
+
readonly '--kui-sizing-control-xxl'?: string;
|
|
194
|
+
/** Defaults to `88px`. */
|
|
195
|
+
readonly '--kui-sizing-row-lg'?: string;
|
|
196
|
+
/** Defaults to `72px`. */
|
|
197
|
+
readonly '--kui-sizing-row-md'?: string;
|
|
198
|
+
/** Defaults to `56px`. */
|
|
199
|
+
readonly '--kui-sizing-row-sm'?: string;
|
|
200
|
+
/** Defaults to `48px`. */
|
|
201
|
+
readonly '--kui-sizing-row-xs'?: string;
|
|
202
|
+
/** Defaults to `16px`. */
|
|
203
|
+
readonly '--kui-spacing-lg'?: string;
|
|
204
|
+
/** Defaults to `12px`. */
|
|
205
|
+
readonly '--kui-spacing-md'?: string;
|
|
206
|
+
/** Defaults to `8px`. */
|
|
207
|
+
readonly '--kui-spacing-sm'?: string;
|
|
208
|
+
/** Defaults to `24px`. */
|
|
209
|
+
readonly '--kui-spacing-xl'?: string;
|
|
210
|
+
/** Defaults to `4px`. */
|
|
211
|
+
readonly '--kui-spacing-xs'?: string;
|
|
212
|
+
/** Defaults to `32px`. */
|
|
213
|
+
readonly '--kui-spacing-xxl'?: string;
|
|
214
|
+
/** Defaults to `2px`. */
|
|
215
|
+
readonly '--kui-spacing-xxs'?: string;
|
|
216
|
+
/** Defaults to `40px`. */
|
|
217
|
+
readonly '--kui-spacing-xxxl'?: string;
|
|
218
|
+
/** Defaults to `0.12`. */
|
|
219
|
+
readonly '--kui-state-layer-opacity-disabled-container'?: string;
|
|
220
|
+
/** Defaults to `0.38`. */
|
|
221
|
+
readonly '--kui-state-layer-opacity-disabled-content'?: string;
|
|
222
|
+
/** Defaults to `0.16`. */
|
|
223
|
+
readonly '--kui-state-layer-opacity-dragged'?: string;
|
|
224
|
+
/** Defaults to `0.1`. */
|
|
225
|
+
readonly '--kui-state-layer-opacity-focus'?: string;
|
|
226
|
+
/** Defaults to `0.08`. */
|
|
227
|
+
readonly '--kui-state-layer-opacity-hover'?: string;
|
|
228
|
+
/** Defaults to `0.1`. */
|
|
229
|
+
readonly '--kui-state-layer-opacity-pressed'?: string;
|
|
230
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
231
|
+
readonly '--kui-typography-body-large-font'?: string;
|
|
232
|
+
/** Defaults to `24px`. */
|
|
233
|
+
readonly '--kui-typography-body-large-line-height'?: string;
|
|
234
|
+
/** Defaults to `16px`. */
|
|
235
|
+
readonly '--kui-typography-body-large-size'?: string;
|
|
236
|
+
/** Defaults to `0.5px`. */
|
|
237
|
+
readonly '--kui-typography-body-large-tracking'?: string;
|
|
238
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
239
|
+
readonly '--kui-typography-body-large-weight'?: string;
|
|
240
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
241
|
+
readonly '--kui-typography-body-medium-font'?: string;
|
|
242
|
+
/** Defaults to `20px`. */
|
|
243
|
+
readonly '--kui-typography-body-medium-line-height'?: string;
|
|
244
|
+
/** Defaults to `14px`. */
|
|
245
|
+
readonly '--kui-typography-body-medium-size'?: string;
|
|
246
|
+
/** Defaults to `0.25px`. */
|
|
247
|
+
readonly '--kui-typography-body-medium-tracking'?: string;
|
|
248
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
249
|
+
readonly '--kui-typography-body-medium-weight'?: string;
|
|
250
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
251
|
+
readonly '--kui-typography-body-small-font'?: string;
|
|
252
|
+
/** Defaults to `16px`. */
|
|
253
|
+
readonly '--kui-typography-body-small-line-height'?: string;
|
|
254
|
+
/** Defaults to `12px`. */
|
|
255
|
+
readonly '--kui-typography-body-small-size'?: string;
|
|
256
|
+
/** Defaults to `0.4px`. */
|
|
257
|
+
readonly '--kui-typography-body-small-tracking'?: string;
|
|
258
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
259
|
+
readonly '--kui-typography-body-small-weight'?: string;
|
|
260
|
+
/** Defaults to `var(--kui-typography-font-family-brand, 'Roboto Serif', 'Iowan Old Style', Georgia, serif)`. */
|
|
261
|
+
readonly '--kui-typography-display-large-font'?: string;
|
|
262
|
+
/** Defaults to `64px`. */
|
|
263
|
+
readonly '--kui-typography-display-large-line-height'?: string;
|
|
264
|
+
/** Defaults to `57px`. */
|
|
265
|
+
readonly '--kui-typography-display-large-size'?: string;
|
|
266
|
+
/** Defaults to `-0.25px`. */
|
|
267
|
+
readonly '--kui-typography-display-large-tracking'?: string;
|
|
268
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
269
|
+
readonly '--kui-typography-display-large-weight'?: string;
|
|
270
|
+
/** Defaults to `var(--kui-typography-font-family-brand, 'Roboto Serif', 'Iowan Old Style', Georgia, serif)`. */
|
|
271
|
+
readonly '--kui-typography-display-medium-font'?: string;
|
|
272
|
+
/** Defaults to `52px`. */
|
|
273
|
+
readonly '--kui-typography-display-medium-line-height'?: string;
|
|
274
|
+
/** Defaults to `45px`. */
|
|
275
|
+
readonly '--kui-typography-display-medium-size'?: string;
|
|
276
|
+
/** Defaults to `0px`. */
|
|
277
|
+
readonly '--kui-typography-display-medium-tracking'?: string;
|
|
278
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
279
|
+
readonly '--kui-typography-display-medium-weight'?: string;
|
|
280
|
+
/** Defaults to `var(--kui-typography-font-family-brand, 'Roboto Serif', 'Iowan Old Style', Georgia, serif)`. */
|
|
281
|
+
readonly '--kui-typography-display-small-font'?: string;
|
|
282
|
+
/** Defaults to `44px`. */
|
|
283
|
+
readonly '--kui-typography-display-small-line-height'?: string;
|
|
284
|
+
/** Defaults to `36px`. */
|
|
285
|
+
readonly '--kui-typography-display-small-size'?: string;
|
|
286
|
+
/** Defaults to `0px`. */
|
|
287
|
+
readonly '--kui-typography-display-small-tracking'?: string;
|
|
288
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
289
|
+
readonly '--kui-typography-display-small-weight'?: string;
|
|
290
|
+
/** Defaults to `'Roboto Serif', 'Iowan Old Style', Georgia, serif`. */
|
|
291
|
+
readonly '--kui-typography-font-family-brand'?: string;
|
|
292
|
+
/** Defaults to `'Roboto Mono', ui-monospace, 'SF Mono', Menlo, monospace`. */
|
|
293
|
+
readonly '--kui-typography-font-family-mono'?: string;
|
|
294
|
+
/** Defaults to `'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif`. */
|
|
295
|
+
readonly '--kui-typography-font-family-plain'?: string;
|
|
296
|
+
/** Defaults to `var(--kui-typography-font-family-brand, 'Roboto Serif', 'Iowan Old Style', Georgia, serif)`. */
|
|
297
|
+
readonly '--kui-typography-headline-large-font'?: string;
|
|
298
|
+
/** Defaults to `40px`. */
|
|
299
|
+
readonly '--kui-typography-headline-large-line-height'?: string;
|
|
300
|
+
/** Defaults to `32px`. */
|
|
301
|
+
readonly '--kui-typography-headline-large-size'?: string;
|
|
302
|
+
/** Defaults to `0px`. */
|
|
303
|
+
readonly '--kui-typography-headline-large-tracking'?: string;
|
|
304
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
305
|
+
readonly '--kui-typography-headline-large-weight'?: string;
|
|
306
|
+
/** Defaults to `var(--kui-typography-font-family-brand, 'Roboto Serif', 'Iowan Old Style', Georgia, serif)`. */
|
|
307
|
+
readonly '--kui-typography-headline-medium-font'?: string;
|
|
308
|
+
/** Defaults to `36px`. */
|
|
309
|
+
readonly '--kui-typography-headline-medium-line-height'?: string;
|
|
310
|
+
/** Defaults to `28px`. */
|
|
311
|
+
readonly '--kui-typography-headline-medium-size'?: string;
|
|
312
|
+
/** Defaults to `0px`. */
|
|
313
|
+
readonly '--kui-typography-headline-medium-tracking'?: string;
|
|
314
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
315
|
+
readonly '--kui-typography-headline-medium-weight'?: string;
|
|
316
|
+
/** Defaults to `var(--kui-typography-font-family-brand, 'Roboto Serif', 'Iowan Old Style', Georgia, serif)`. */
|
|
317
|
+
readonly '--kui-typography-headline-small-font'?: string;
|
|
318
|
+
/** Defaults to `32px`. */
|
|
319
|
+
readonly '--kui-typography-headline-small-line-height'?: string;
|
|
320
|
+
/** Defaults to `24px`. */
|
|
321
|
+
readonly '--kui-typography-headline-small-size'?: string;
|
|
322
|
+
/** Defaults to `0px`. */
|
|
323
|
+
readonly '--kui-typography-headline-small-tracking'?: string;
|
|
324
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
325
|
+
readonly '--kui-typography-headline-small-weight'?: string;
|
|
326
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
327
|
+
readonly '--kui-typography-label-large-font'?: string;
|
|
328
|
+
/** Defaults to `20px`. */
|
|
329
|
+
readonly '--kui-typography-label-large-line-height'?: string;
|
|
330
|
+
/** Defaults to `14px`. */
|
|
331
|
+
readonly '--kui-typography-label-large-size'?: string;
|
|
332
|
+
/** Defaults to `0.1px`. */
|
|
333
|
+
readonly '--kui-typography-label-large-tracking'?: string;
|
|
334
|
+
/** Defaults to `var(--kui-typography-weight-medium, 500)`. */
|
|
335
|
+
readonly '--kui-typography-label-large-weight'?: string;
|
|
336
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
337
|
+
readonly '--kui-typography-label-medium-font'?: string;
|
|
338
|
+
/** Defaults to `16px`. */
|
|
339
|
+
readonly '--kui-typography-label-medium-line-height'?: string;
|
|
340
|
+
/** Defaults to `12px`. */
|
|
341
|
+
readonly '--kui-typography-label-medium-size'?: string;
|
|
342
|
+
/** Defaults to `0.5px`. */
|
|
343
|
+
readonly '--kui-typography-label-medium-tracking'?: string;
|
|
344
|
+
/** Defaults to `var(--kui-typography-weight-medium, 500)`. */
|
|
345
|
+
readonly '--kui-typography-label-medium-weight'?: string;
|
|
346
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
347
|
+
readonly '--kui-typography-label-small-font'?: string;
|
|
348
|
+
/** Defaults to `16px`. */
|
|
349
|
+
readonly '--kui-typography-label-small-line-height'?: string;
|
|
350
|
+
/** Defaults to `11px`. */
|
|
351
|
+
readonly '--kui-typography-label-small-size'?: string;
|
|
352
|
+
/** Defaults to `0.5px`. */
|
|
353
|
+
readonly '--kui-typography-label-small-tracking'?: string;
|
|
354
|
+
/** Defaults to `var(--kui-typography-weight-medium, 500)`. */
|
|
355
|
+
readonly '--kui-typography-label-small-weight'?: string;
|
|
356
|
+
/** Defaults to `var(--kui-typography-font-family-brand, 'Roboto Serif', 'Iowan Old Style', Georgia, serif)`. */
|
|
357
|
+
readonly '--kui-typography-title-large-font'?: string;
|
|
358
|
+
/** Defaults to `28px`. */
|
|
359
|
+
readonly '--kui-typography-title-large-line-height'?: string;
|
|
360
|
+
/** Defaults to `22px`. */
|
|
361
|
+
readonly '--kui-typography-title-large-size'?: string;
|
|
362
|
+
/** Defaults to `0px`. */
|
|
363
|
+
readonly '--kui-typography-title-large-tracking'?: string;
|
|
364
|
+
/** Defaults to `var(--kui-typography-weight-regular, 400)`. */
|
|
365
|
+
readonly '--kui-typography-title-large-weight'?: string;
|
|
366
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
367
|
+
readonly '--kui-typography-title-medium-font'?: string;
|
|
368
|
+
/** Defaults to `24px`. */
|
|
369
|
+
readonly '--kui-typography-title-medium-line-height'?: string;
|
|
370
|
+
/** Defaults to `16px`. */
|
|
371
|
+
readonly '--kui-typography-title-medium-size'?: string;
|
|
372
|
+
/** Defaults to `0.15px`. */
|
|
373
|
+
readonly '--kui-typography-title-medium-tracking'?: string;
|
|
374
|
+
/** Defaults to `var(--kui-typography-weight-medium, 500)`. */
|
|
375
|
+
readonly '--kui-typography-title-medium-weight'?: string;
|
|
376
|
+
/** Defaults to `var(--kui-typography-font-family-plain, 'Roboto Flex', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif)`. */
|
|
377
|
+
readonly '--kui-typography-title-small-font'?: string;
|
|
378
|
+
/** Defaults to `20px`. */
|
|
379
|
+
readonly '--kui-typography-title-small-line-height'?: string;
|
|
380
|
+
/** Defaults to `14px`. */
|
|
381
|
+
readonly '--kui-typography-title-small-size'?: string;
|
|
382
|
+
/** Defaults to `0.1px`. */
|
|
383
|
+
readonly '--kui-typography-title-small-tracking'?: string;
|
|
384
|
+
/** Defaults to `var(--kui-typography-weight-medium, 500)`. */
|
|
385
|
+
readonly '--kui-typography-title-small-weight'?: string;
|
|
386
|
+
/** Defaults to `700`. */
|
|
387
|
+
readonly '--kui-typography-weight-bold'?: string;
|
|
388
|
+
/** Defaults to `500`. */
|
|
389
|
+
readonly '--kui-typography-weight-medium'?: string;
|
|
390
|
+
/** Defaults to `400`. */
|
|
391
|
+
readonly '--kui-typography-weight-regular'?: string;
|
|
392
|
+
};
|
|
393
|
+
//#endregion
|
|
394
|
+
export type { KuiTheme };
|
|
395
|
+
//# sourceMappingURL=theme.d.ts.map
|