@choco-vanille/primitives 0.0.0-stage → 0.1.0-dev.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/LICENSE +21 -0
- package/README.md +482 -2
- package/dist/components/_common/components/slot/Slot.cjs +2 -0
- package/dist/components/_common/components/slot/Slot.cjs.map +1 -0
- package/dist/components/_common/components/slot/Slot.js +10 -0
- package/dist/components/_common/components/slot/Slot.js.map +1 -0
- package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.cjs +2 -0
- package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.cjs.map +1 -0
- package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.js +18 -0
- package/dist/components/_common/components/slot/hooks/use-slot/useSlot.hook.js.map +1 -0
- package/dist/components/_common/components/slot/utils/attachRef.utils.cjs +2 -0
- package/dist/components/_common/components/slot/utils/attachRef.utils.cjs.map +1 -0
- package/dist/components/_common/components/slot/utils/attachRef.utils.js +18 -0
- package/dist/components/_common/components/slot/utils/attachRef.utils.js.map +1 -0
- package/dist/components/_common/components/slot/utils/composeRefs.utils.cjs +2 -0
- package/dist/components/_common/components/slot/utils/composeRefs.utils.cjs.map +1 -0
- package/dist/components/_common/components/slot/utils/composeRefs.utils.js +13 -0
- package/dist/components/_common/components/slot/utils/composeRefs.utils.js.map +1 -0
- package/dist/components/_common/components/slot/utils/getSlotChild.utils.cjs +2 -0
- package/dist/components/_common/components/slot/utils/getSlotChild.utils.cjs.map +1 -0
- package/dist/components/_common/components/slot/utils/getSlotChild.utils.js +9 -0
- package/dist/components/_common/components/slot/utils/getSlotChild.utils.js.map +1 -0
- package/dist/components/_common/components/slot/utils/mergeClassNames.utils.cjs +2 -0
- package/dist/components/_common/components/slot/utils/mergeClassNames.utils.cjs.map +1 -0
- package/dist/components/_common/components/slot/utils/mergeClassNames.utils.js +8 -0
- package/dist/components/_common/components/slot/utils/mergeClassNames.utils.js.map +1 -0
- package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.cjs +2 -0
- package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.cjs.map +1 -0
- package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.js +16 -0
- package/dist/components/_common/components/slot/utils/mergeSlotProps.utils.js.map +1 -0
- package/dist/components/_common/components/slot/utils/mergeStyles.utils.cjs +2 -0
- package/dist/components/_common/components/slot/utils/mergeStyles.utils.cjs.map +1 -0
- package/dist/components/_common/components/slot/utils/mergeStyles.utils.js +14 -0
- package/dist/components/_common/components/slot/utils/mergeStyles.utils.js.map +1 -0
- package/dist/components/_common/styles/style-props/styleProps.css.cjs +2 -0
- package/dist/components/_common/styles/style-props/styleProps.css.cjs.map +1 -0
- package/dist/components/_common/styles/style-props/styleProps.css.js +370 -0
- package/dist/components/_common/styles/style-props/styleProps.css.js.map +1 -0
- package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.cjs +2 -0
- package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.cjs.map +1 -0
- package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.js +5 -0
- package/dist/components/_common/utils/environment/isProcessUnavailableError.utils.js.map +1 -0
- package/dist/components/_common/utils/style-props/createStyleSet.utils.cjs +2 -0
- package/dist/components/_common/utils/style-props/createStyleSet.utils.cjs.map +1 -0
- package/dist/components/_common/utils/style-props/createStyleSet.utils.js +13 -0
- package/dist/components/_common/utils/style-props/createStyleSet.utils.js.map +1 -0
- package/dist/components/_common/utils/style-props/formatStyleValue.utils.cjs +2 -0
- package/dist/components/_common/utils/style-props/formatStyleValue.utils.cjs.map +1 -0
- package/dist/components/_common/utils/style-props/formatStyleValue.utils.js +11 -0
- package/dist/components/_common/utils/style-props/formatStyleValue.utils.js.map +1 -0
- package/dist/components/_common/utils/style-props/getClassName.utils.cjs +2 -0
- package/dist/components/_common/utils/style-props/getClassName.utils.cjs.map +1 -0
- package/dist/components/_common/utils/style-props/getClassName.utils.js +21 -0
- package/dist/components/_common/utils/style-props/getClassName.utils.js.map +1 -0
- package/dist/components/_common/utils/style-props/getElementProps.utils.cjs +2 -0
- package/dist/components/_common/utils/style-props/getElementProps.utils.cjs.map +1 -0
- package/dist/components/_common/utils/style-props/getElementProps.utils.js +39 -0
- package/dist/components/_common/utils/style-props/getElementProps.utils.js.map +1 -0
- package/dist/components/_common/utils/style-props/getTokenClassNames.utils.cjs +2 -0
- package/dist/components/_common/utils/style-props/getTokenClassNames.utils.cjs.map +1 -0
- package/dist/components/_common/utils/style-props/getTokenClassNames.utils.js +21 -0
- package/dist/components/_common/utils/style-props/getTokenClassNames.utils.js.map +1 -0
- package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.cjs +2 -0
- package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.cjs.map +1 -0
- package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.js +9 -0
- package/dist/components/_common/utils/style-props/logUnknownStyleValue.utils.js.map +1 -0
- package/dist/components/_common/utils/style-props/resolveSizeValue.utils.cjs +2 -0
- package/dist/components/_common/utils/style-props/resolveSizeValue.utils.cjs.map +1 -0
- package/dist/components/_common/utils/style-props/resolveSizeValue.utils.js +5 -0
- package/dist/components/_common/utils/style-props/resolveSizeValue.utils.js.map +1 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.cjs +2 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.cjs.map +1 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.cjs +2 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.cjs.map +1 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.js +10 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.css.js.map +1 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.js +11 -0
- package/dist/components/accessibility/visually-hidden/VisuallyHidden.js.map +1 -0
- package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.cjs +2 -0
- package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.cjs.map +1 -0
- package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.js +17 -0
- package/dist/components/accessibility/visually-hidden/utils/getVisuallyHiddenElementProps.utils.js.map +1 -0
- package/dist/components/foundation/icon/Icon.cjs +2 -0
- package/dist/components/foundation/icon/Icon.cjs.map +1 -0
- package/dist/components/foundation/icon/Icon.css.cjs +2 -0
- package/dist/components/foundation/icon/Icon.css.cjs.map +1 -0
- package/dist/components/foundation/icon/Icon.css.js +29 -0
- package/dist/components/foundation/icon/Icon.css.js.map +1 -0
- package/dist/components/foundation/icon/Icon.js +8 -0
- package/dist/components/foundation/icon/Icon.js.map +1 -0
- package/dist/components/foundation/icon/utils/getIconElementProps.utils.cjs +2 -0
- package/dist/components/foundation/icon/utils/getIconElementProps.utils.cjs.map +1 -0
- package/dist/components/foundation/icon/utils/getIconElementProps.utils.js +26 -0
- package/dist/components/foundation/icon/utils/getIconElementProps.utils.js.map +1 -0
- package/dist/components/foundation/typography/Typography.cjs +2 -0
- package/dist/components/foundation/typography/Typography.cjs.map +1 -0
- package/dist/components/foundation/typography/Typography.css.cjs +2 -0
- package/dist/components/foundation/typography/Typography.css.cjs.map +1 -0
- package/dist/components/foundation/typography/Typography.css.js +149 -0
- package/dist/components/foundation/typography/Typography.css.js.map +1 -0
- package/dist/components/foundation/typography/Typography.js +11 -0
- package/dist/components/foundation/typography/Typography.js.map +1 -0
- package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.cjs +2 -0
- package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.cjs.map +1 -0
- package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.js +9 -0
- package/dist/components/foundation/typography/utils/getTypographyElementProps.utils.js.map +1 -0
- package/dist/components/layout/box/Box.cjs +2 -0
- package/dist/components/layout/box/Box.cjs.map +1 -0
- package/dist/components/layout/box/Box.css.cjs +2 -0
- package/dist/components/layout/box/Box.css.cjs.map +1 -0
- package/dist/components/layout/box/Box.css.js +418 -0
- package/dist/components/layout/box/Box.css.js.map +1 -0
- package/dist/components/layout/box/Box.js +11 -0
- package/dist/components/layout/box/Box.js.map +1 -0
- package/dist/components/layout/box/utils/getBoxElementProps.utils.cjs +2 -0
- package/dist/components/layout/box/utils/getBoxElementProps.utils.cjs.map +1 -0
- package/dist/components/layout/box/utils/getBoxElementProps.utils.js +9 -0
- package/dist/components/layout/box/utils/getBoxElementProps.utils.js.map +1 -0
- package/dist/components/layout/flex/Flex.cjs +2 -0
- package/dist/components/layout/flex/Flex.cjs.map +1 -0
- package/dist/components/layout/flex/Flex.js +11 -0
- package/dist/components/layout/flex/Flex.js.map +1 -0
- package/dist/components/layout/flex/constants/index.cjs +2 -0
- package/dist/components/layout/flex/constants/index.cjs.map +1 -0
- package/dist/components/layout/flex/constants/index.js +5 -0
- package/dist/components/layout/flex/constants/index.js.map +1 -0
- package/dist/components/layout/flex/utils/getFlexElementProps.utils.cjs +2 -0
- package/dist/components/layout/flex/utils/getFlexElementProps.utils.cjs.map +1 -0
- package/dist/components/layout/flex/utils/getFlexElementProps.utils.js +9 -0
- package/dist/components/layout/flex/utils/getFlexElementProps.utils.js.map +1 -0
- package/dist/components/layout/grid/Grid.cjs +2 -0
- package/dist/components/layout/grid/Grid.cjs.map +1 -0
- package/dist/components/layout/grid/Grid.js +11 -0
- package/dist/components/layout/grid/Grid.js.map +1 -0
- package/dist/components/layout/grid/constants/index.cjs +2 -0
- package/dist/components/layout/grid/constants/index.cjs.map +1 -0
- package/dist/components/layout/grid/constants/index.js +5 -0
- package/dist/components/layout/grid/constants/index.js.map +1 -0
- package/dist/components/layout/grid/utils/getGridElementProps.utils.cjs +2 -0
- package/dist/components/layout/grid/utils/getGridElementProps.utils.cjs.map +1 -0
- package/dist/components/layout/grid/utils/getGridElementProps.utils.js +9 -0
- package/dist/components/layout/grid/utils/getGridElementProps.utils.js.map +1 -0
- package/dist/components/layout/separator/Separator.cjs +2 -0
- package/dist/components/layout/separator/Separator.cjs.map +1 -0
- package/dist/components/layout/separator/Separator.css.cjs +2 -0
- package/dist/components/layout/separator/Separator.css.cjs.map +1 -0
- package/dist/components/layout/separator/Separator.css.js +32 -0
- package/dist/components/layout/separator/Separator.css.js.map +1 -0
- package/dist/components/layout/separator/Separator.js +10 -0
- package/dist/components/layout/separator/Separator.js.map +1 -0
- package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.cjs +2 -0
- package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.cjs.map +1 -0
- package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.js +22 -0
- package/dist/components/layout/separator/utils/getSeparatorElementProps.utils.js.map +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +1427 -0
- package/dist/index.d.ts +1427 -0
- package/dist/index.js +8 -0
- package/dist/styles.css +2 -0
- package/package.json +89 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1427 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
import { CSSProperties } from 'react';
|
|
3
|
+
import { FC } from 'react';
|
|
4
|
+
import { FontSizeToken } from '@choco-vanille/theme';
|
|
5
|
+
import { HTMLAttributes } from 'react';
|
|
6
|
+
import { HTMLElementType } from 'react';
|
|
7
|
+
import { IconifyIcon } from '@iconify/react/offline';
|
|
8
|
+
import { ReactElement } from 'react';
|
|
9
|
+
import { Ref } from 'react';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Props of a polymorphic component rendering its single child in place of
|
|
13
|
+
* its own element (`asChild`): the props the component handles, without
|
|
14
|
+
* `as`, then the global attributes and events of HTML elements and a ref to
|
|
15
|
+
* the child's element. The child keeps its own value for any prop both
|
|
16
|
+
* give, except classes, joined, styles, merged, and event handlers, both
|
|
17
|
+
* called, the child's first.
|
|
18
|
+
*/
|
|
19
|
+
declare type AsChildProps<OwnProps> = Omit<OwnProps, 'as' | 'asChild'> & Readonly<{
|
|
20
|
+
/** No tag: the child sets the element. */
|
|
21
|
+
as?: never;
|
|
22
|
+
/** Renders the single child, with the props merged onto it. */
|
|
23
|
+
asChild: true;
|
|
24
|
+
/** Single element receiving the props, such as a router link. */
|
|
25
|
+
children: ReactElement;
|
|
26
|
+
/** Ref composed with the ref of the child, receiving its element. */
|
|
27
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
28
|
+
}> & Readonly<Omit<HTMLAttributes<HTMLElement>, keyof OwnProps | 'children' | 'className' | 'style'>>;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Base layout primitive: renders any HTML tag, a `div` by default, styled
|
|
32
|
+
* through props. Token style props (spacing, flex, grid, position, borders,
|
|
33
|
+
* shadow...) resolve to atomic classes generated at build time. The sizing
|
|
34
|
+
* props (`width`, `height` and their `min` and `max` bounds) and `color`,
|
|
35
|
+
* `backgroundColor` and `borderColor` accept any CSS value, carried by a
|
|
36
|
+
* private CSS variable set inline: a number is a length in pixels, as in
|
|
37
|
+
* `style`. Style props never reach the DOM, and the consumer's `className`
|
|
38
|
+
* and `style` are merged with the generated ones, the consumer's `style`
|
|
39
|
+
* prevailing.
|
|
40
|
+
* Every other prop (attributes, events, `ref`) is typed after the tag and
|
|
41
|
+
* forwarded to the element.
|
|
42
|
+
*
|
|
43
|
+
* With `asChild`, nothing is rendered of its own: the single child is,
|
|
44
|
+
* with the classes, styles, other props and `ref` merged onto it (see
|
|
45
|
+
* `AsChildProps`), for instance to style a router link.
|
|
46
|
+
*
|
|
47
|
+
* @param props Style props, `as` or `asChild`, and the native props of the
|
|
48
|
+
* rendered tag.
|
|
49
|
+
* @returns The styled element.
|
|
50
|
+
* @throws {Error} With `asChild`, when the children are not a single
|
|
51
|
+
* element.
|
|
52
|
+
*/
|
|
53
|
+
export declare const Box: <Tag extends BoxTag = "div">(props: BoxProps<Tag> | BoxAsChildProps) => ReactElement;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Props of a `Box` rendering its single child (`asChild`) instead of an
|
|
57
|
+
* element: its style props, without `as`, merged onto the child.
|
|
58
|
+
*/
|
|
59
|
+
export declare type BoxAsChildProps = AsChildProps<BoxOwnProps>;
|
|
60
|
+
|
|
61
|
+
/** Props a `Box` handles itself, whatever the tag it renders. */
|
|
62
|
+
declare type BoxOwnProps<Tag extends BoxTag = BoxTag> = BoxStyleProps & Readonly<{
|
|
63
|
+
/** Tag of the rendered element; a `div` when absent. */
|
|
64
|
+
as?: Tag;
|
|
65
|
+
/** Renders the single child in place of the element, with the props merged onto it. */
|
|
66
|
+
asChild?: boolean | undefined;
|
|
67
|
+
/** Classes added after the generated ones. */
|
|
68
|
+
className?: string | undefined;
|
|
69
|
+
/** Inline styles, merged after the sizing and color variables, so they prevail. */
|
|
70
|
+
style?: CSSProperties | undefined;
|
|
71
|
+
}>;
|
|
72
|
+
|
|
73
|
+
/** Token style properties of a `Box`, flattened in their emission order. */
|
|
74
|
+
declare const boxProperties: {
|
|
75
|
+
readonly boxShadow: {
|
|
76
|
+
readonly none: `var(--${string})`;
|
|
77
|
+
readonly low: `var(--${string})`;
|
|
78
|
+
readonly raised: `var(--${string})`;
|
|
79
|
+
readonly floating: `var(--${string})`;
|
|
80
|
+
readonly overlay: `var(--${string})`;
|
|
81
|
+
readonly modal: `var(--${string})`;
|
|
82
|
+
};
|
|
83
|
+
readonly cursor: readonly ["auto", "default", "pointer", "text", "move", "grab", "grabbing", "not-allowed", "wait", "progress", "help"];
|
|
84
|
+
readonly pointerEvents: readonly ["auto", "none"];
|
|
85
|
+
readonly borderStyle: readonly ["none", "solid", "dashed", "dotted"];
|
|
86
|
+
readonly borderTopWidth: {
|
|
87
|
+
readonly 0: `var(--${string})`;
|
|
88
|
+
readonly 1: `var(--${string})`;
|
|
89
|
+
readonly 2: `var(--${string})`;
|
|
90
|
+
readonly 4: `var(--${string})`;
|
|
91
|
+
};
|
|
92
|
+
readonly borderRightWidth: {
|
|
93
|
+
readonly 0: `var(--${string})`;
|
|
94
|
+
readonly 1: `var(--${string})`;
|
|
95
|
+
readonly 2: `var(--${string})`;
|
|
96
|
+
readonly 4: `var(--${string})`;
|
|
97
|
+
};
|
|
98
|
+
readonly borderBottomWidth: {
|
|
99
|
+
readonly 0: `var(--${string})`;
|
|
100
|
+
readonly 1: `var(--${string})`;
|
|
101
|
+
readonly 2: `var(--${string})`;
|
|
102
|
+
readonly 4: `var(--${string})`;
|
|
103
|
+
};
|
|
104
|
+
readonly borderLeftWidth: {
|
|
105
|
+
readonly 0: `var(--${string})`;
|
|
106
|
+
readonly 1: `var(--${string})`;
|
|
107
|
+
readonly 2: `var(--${string})`;
|
|
108
|
+
readonly 4: `var(--${string})`;
|
|
109
|
+
};
|
|
110
|
+
readonly borderTopLeftRadius: {
|
|
111
|
+
readonly none: `var(--${string})`;
|
|
112
|
+
readonly xs: `var(--${string})`;
|
|
113
|
+
readonly sm: `var(--${string})`;
|
|
114
|
+
readonly md: `var(--${string})`;
|
|
115
|
+
readonly lg: `var(--${string})`;
|
|
116
|
+
readonly xl: `var(--${string})`;
|
|
117
|
+
readonly '2xl': `var(--${string})`;
|
|
118
|
+
readonly '3xl': `var(--${string})`;
|
|
119
|
+
readonly full: `var(--${string})`;
|
|
120
|
+
};
|
|
121
|
+
readonly borderTopRightRadius: {
|
|
122
|
+
readonly none: `var(--${string})`;
|
|
123
|
+
readonly xs: `var(--${string})`;
|
|
124
|
+
readonly sm: `var(--${string})`;
|
|
125
|
+
readonly md: `var(--${string})`;
|
|
126
|
+
readonly lg: `var(--${string})`;
|
|
127
|
+
readonly xl: `var(--${string})`;
|
|
128
|
+
readonly '2xl': `var(--${string})`;
|
|
129
|
+
readonly '3xl': `var(--${string})`;
|
|
130
|
+
readonly full: `var(--${string})`;
|
|
131
|
+
};
|
|
132
|
+
readonly borderBottomRightRadius: {
|
|
133
|
+
readonly none: `var(--${string})`;
|
|
134
|
+
readonly xs: `var(--${string})`;
|
|
135
|
+
readonly sm: `var(--${string})`;
|
|
136
|
+
readonly md: `var(--${string})`;
|
|
137
|
+
readonly lg: `var(--${string})`;
|
|
138
|
+
readonly xl: `var(--${string})`;
|
|
139
|
+
readonly '2xl': `var(--${string})`;
|
|
140
|
+
readonly '3xl': `var(--${string})`;
|
|
141
|
+
readonly full: `var(--${string})`;
|
|
142
|
+
};
|
|
143
|
+
readonly borderBottomLeftRadius: {
|
|
144
|
+
readonly none: `var(--${string})`;
|
|
145
|
+
readonly xs: `var(--${string})`;
|
|
146
|
+
readonly sm: `var(--${string})`;
|
|
147
|
+
readonly md: `var(--${string})`;
|
|
148
|
+
readonly lg: `var(--${string})`;
|
|
149
|
+
readonly xl: `var(--${string})`;
|
|
150
|
+
readonly '2xl': `var(--${string})`;
|
|
151
|
+
readonly '3xl': `var(--${string})`;
|
|
152
|
+
readonly full: `var(--${string})`;
|
|
153
|
+
};
|
|
154
|
+
readonly gridTemplateColumns: {
|
|
155
|
+
readonly 7: "repeat(7, minmax(0, 1fr))";
|
|
156
|
+
readonly 8: "repeat(8, minmax(0, 1fr))";
|
|
157
|
+
readonly 9: "repeat(9, minmax(0, 1fr))";
|
|
158
|
+
readonly 10: "repeat(10, minmax(0, 1fr))";
|
|
159
|
+
readonly 11: "repeat(11, minmax(0, 1fr))";
|
|
160
|
+
readonly 12: "repeat(12, minmax(0, 1fr))";
|
|
161
|
+
readonly 1: "repeat(1, minmax(0, 1fr))";
|
|
162
|
+
readonly 2: "repeat(2, minmax(0, 1fr))";
|
|
163
|
+
readonly 3: "repeat(3, minmax(0, 1fr))";
|
|
164
|
+
readonly 4: "repeat(4, minmax(0, 1fr))";
|
|
165
|
+
readonly 5: "repeat(5, minmax(0, 1fr))";
|
|
166
|
+
readonly 6: "repeat(6, minmax(0, 1fr))";
|
|
167
|
+
};
|
|
168
|
+
readonly gridTemplateRows: {
|
|
169
|
+
readonly 1: "repeat(1, minmax(0, 1fr))";
|
|
170
|
+
readonly 2: "repeat(2, minmax(0, 1fr))";
|
|
171
|
+
readonly 3: "repeat(3, minmax(0, 1fr))";
|
|
172
|
+
readonly 4: "repeat(4, minmax(0, 1fr))";
|
|
173
|
+
readonly 5: "repeat(5, minmax(0, 1fr))";
|
|
174
|
+
readonly 6: "repeat(6, minmax(0, 1fr))";
|
|
175
|
+
};
|
|
176
|
+
readonly gridAutoFlow: readonly ["row", "column", "row dense", "column dense"];
|
|
177
|
+
readonly gridAutoColumns: readonly ["auto", "min-content", "max-content", "1fr"];
|
|
178
|
+
readonly gridAutoRows: readonly ["auto", "min-content", "max-content", "1fr"];
|
|
179
|
+
readonly alignItems: readonly ["stretch", "flex-start", "center", "flex-end", "baseline"];
|
|
180
|
+
readonly alignContent: readonly ["flex-start", "center", "flex-end", "space-between", "space-around", "space-evenly", "stretch"];
|
|
181
|
+
readonly justifyContent: readonly ["flex-start", "center", "flex-end", "space-between", "space-around", "space-evenly", "stretch"];
|
|
182
|
+
readonly justifyItems: readonly ["stretch", "start", "center", "end"];
|
|
183
|
+
readonly flexDirection: readonly ["row", "row-reverse", "column", "column-reverse"];
|
|
184
|
+
readonly flexWrap: readonly ["nowrap", "wrap", "wrap-reverse"];
|
|
185
|
+
readonly rowGap: {
|
|
186
|
+
readonly 0: `var(--${string})`;
|
|
187
|
+
readonly 1: `var(--${string})`;
|
|
188
|
+
readonly 2: `var(--${string})`;
|
|
189
|
+
readonly 4: `var(--${string})`;
|
|
190
|
+
readonly 6: `var(--${string})`;
|
|
191
|
+
readonly 8: `var(--${string})`;
|
|
192
|
+
readonly 10: `var(--${string})`;
|
|
193
|
+
readonly 12: `var(--${string})`;
|
|
194
|
+
readonly 14: `var(--${string})`;
|
|
195
|
+
readonly 16: `var(--${string})`;
|
|
196
|
+
readonly 18: `var(--${string})`;
|
|
197
|
+
readonly 20: `var(--${string})`;
|
|
198
|
+
readonly 24: `var(--${string})`;
|
|
199
|
+
readonly 28: `var(--${string})`;
|
|
200
|
+
readonly 32: `var(--${string})`;
|
|
201
|
+
readonly 36: `var(--${string})`;
|
|
202
|
+
readonly 40: `var(--${string})`;
|
|
203
|
+
readonly 44: `var(--${string})`;
|
|
204
|
+
readonly 48: `var(--${string})`;
|
|
205
|
+
readonly 56: `var(--${string})`;
|
|
206
|
+
readonly 64: `var(--${string})`;
|
|
207
|
+
readonly 80: `var(--${string})`;
|
|
208
|
+
readonly 96: `var(--${string})`;
|
|
209
|
+
readonly 112: `var(--${string})`;
|
|
210
|
+
readonly 128: `var(--${string})`;
|
|
211
|
+
};
|
|
212
|
+
readonly columnGap: {
|
|
213
|
+
readonly 0: `var(--${string})`;
|
|
214
|
+
readonly 1: `var(--${string})`;
|
|
215
|
+
readonly 2: `var(--${string})`;
|
|
216
|
+
readonly 4: `var(--${string})`;
|
|
217
|
+
readonly 6: `var(--${string})`;
|
|
218
|
+
readonly 8: `var(--${string})`;
|
|
219
|
+
readonly 10: `var(--${string})`;
|
|
220
|
+
readonly 12: `var(--${string})`;
|
|
221
|
+
readonly 14: `var(--${string})`;
|
|
222
|
+
readonly 16: `var(--${string})`;
|
|
223
|
+
readonly 18: `var(--${string})`;
|
|
224
|
+
readonly 20: `var(--${string})`;
|
|
225
|
+
readonly 24: `var(--${string})`;
|
|
226
|
+
readonly 28: `var(--${string})`;
|
|
227
|
+
readonly 32: `var(--${string})`;
|
|
228
|
+
readonly 36: `var(--${string})`;
|
|
229
|
+
readonly 40: `var(--${string})`;
|
|
230
|
+
readonly 44: `var(--${string})`;
|
|
231
|
+
readonly 48: `var(--${string})`;
|
|
232
|
+
readonly 56: `var(--${string})`;
|
|
233
|
+
readonly 64: `var(--${string})`;
|
|
234
|
+
readonly 80: `var(--${string})`;
|
|
235
|
+
readonly 96: `var(--${string})`;
|
|
236
|
+
readonly 112: `var(--${string})`;
|
|
237
|
+
readonly 128: `var(--${string})`;
|
|
238
|
+
};
|
|
239
|
+
readonly position: readonly ["static", "relative", "absolute", "fixed", "sticky"];
|
|
240
|
+
readonly top: {
|
|
241
|
+
readonly '50%': "50%";
|
|
242
|
+
readonly '100%': "100%";
|
|
243
|
+
readonly auto: "auto";
|
|
244
|
+
readonly 0: `var(--${string})`;
|
|
245
|
+
readonly 1: `var(--${string})`;
|
|
246
|
+
readonly 2: `var(--${string})`;
|
|
247
|
+
readonly 4: `var(--${string})`;
|
|
248
|
+
readonly 6: `var(--${string})`;
|
|
249
|
+
readonly 8: `var(--${string})`;
|
|
250
|
+
readonly 10: `var(--${string})`;
|
|
251
|
+
readonly 12: `var(--${string})`;
|
|
252
|
+
readonly 14: `var(--${string})`;
|
|
253
|
+
readonly 16: `var(--${string})`;
|
|
254
|
+
readonly 18: `var(--${string})`;
|
|
255
|
+
readonly 20: `var(--${string})`;
|
|
256
|
+
readonly 24: `var(--${string})`;
|
|
257
|
+
readonly 28: `var(--${string})`;
|
|
258
|
+
readonly 32: `var(--${string})`;
|
|
259
|
+
readonly 36: `var(--${string})`;
|
|
260
|
+
readonly 40: `var(--${string})`;
|
|
261
|
+
readonly 44: `var(--${string})`;
|
|
262
|
+
readonly 48: `var(--${string})`;
|
|
263
|
+
readonly 56: `var(--${string})`;
|
|
264
|
+
readonly 64: `var(--${string})`;
|
|
265
|
+
readonly 80: `var(--${string})`;
|
|
266
|
+
readonly 96: `var(--${string})`;
|
|
267
|
+
readonly 112: `var(--${string})`;
|
|
268
|
+
readonly 128: `var(--${string})`;
|
|
269
|
+
};
|
|
270
|
+
readonly right: {
|
|
271
|
+
readonly '50%': "50%";
|
|
272
|
+
readonly '100%': "100%";
|
|
273
|
+
readonly auto: "auto";
|
|
274
|
+
readonly 0: `var(--${string})`;
|
|
275
|
+
readonly 1: `var(--${string})`;
|
|
276
|
+
readonly 2: `var(--${string})`;
|
|
277
|
+
readonly 4: `var(--${string})`;
|
|
278
|
+
readonly 6: `var(--${string})`;
|
|
279
|
+
readonly 8: `var(--${string})`;
|
|
280
|
+
readonly 10: `var(--${string})`;
|
|
281
|
+
readonly 12: `var(--${string})`;
|
|
282
|
+
readonly 14: `var(--${string})`;
|
|
283
|
+
readonly 16: `var(--${string})`;
|
|
284
|
+
readonly 18: `var(--${string})`;
|
|
285
|
+
readonly 20: `var(--${string})`;
|
|
286
|
+
readonly 24: `var(--${string})`;
|
|
287
|
+
readonly 28: `var(--${string})`;
|
|
288
|
+
readonly 32: `var(--${string})`;
|
|
289
|
+
readonly 36: `var(--${string})`;
|
|
290
|
+
readonly 40: `var(--${string})`;
|
|
291
|
+
readonly 44: `var(--${string})`;
|
|
292
|
+
readonly 48: `var(--${string})`;
|
|
293
|
+
readonly 56: `var(--${string})`;
|
|
294
|
+
readonly 64: `var(--${string})`;
|
|
295
|
+
readonly 80: `var(--${string})`;
|
|
296
|
+
readonly 96: `var(--${string})`;
|
|
297
|
+
readonly 112: `var(--${string})`;
|
|
298
|
+
readonly 128: `var(--${string})`;
|
|
299
|
+
};
|
|
300
|
+
readonly bottom: {
|
|
301
|
+
readonly '50%': "50%";
|
|
302
|
+
readonly '100%': "100%";
|
|
303
|
+
readonly auto: "auto";
|
|
304
|
+
readonly 0: `var(--${string})`;
|
|
305
|
+
readonly 1: `var(--${string})`;
|
|
306
|
+
readonly 2: `var(--${string})`;
|
|
307
|
+
readonly 4: `var(--${string})`;
|
|
308
|
+
readonly 6: `var(--${string})`;
|
|
309
|
+
readonly 8: `var(--${string})`;
|
|
310
|
+
readonly 10: `var(--${string})`;
|
|
311
|
+
readonly 12: `var(--${string})`;
|
|
312
|
+
readonly 14: `var(--${string})`;
|
|
313
|
+
readonly 16: `var(--${string})`;
|
|
314
|
+
readonly 18: `var(--${string})`;
|
|
315
|
+
readonly 20: `var(--${string})`;
|
|
316
|
+
readonly 24: `var(--${string})`;
|
|
317
|
+
readonly 28: `var(--${string})`;
|
|
318
|
+
readonly 32: `var(--${string})`;
|
|
319
|
+
readonly 36: `var(--${string})`;
|
|
320
|
+
readonly 40: `var(--${string})`;
|
|
321
|
+
readonly 44: `var(--${string})`;
|
|
322
|
+
readonly 48: `var(--${string})`;
|
|
323
|
+
readonly 56: `var(--${string})`;
|
|
324
|
+
readonly 64: `var(--${string})`;
|
|
325
|
+
readonly 80: `var(--${string})`;
|
|
326
|
+
readonly 96: `var(--${string})`;
|
|
327
|
+
readonly 112: `var(--${string})`;
|
|
328
|
+
readonly 128: `var(--${string})`;
|
|
329
|
+
};
|
|
330
|
+
readonly left: {
|
|
331
|
+
readonly '50%': "50%";
|
|
332
|
+
readonly '100%': "100%";
|
|
333
|
+
readonly auto: "auto";
|
|
334
|
+
readonly 0: `var(--${string})`;
|
|
335
|
+
readonly 1: `var(--${string})`;
|
|
336
|
+
readonly 2: `var(--${string})`;
|
|
337
|
+
readonly 4: `var(--${string})`;
|
|
338
|
+
readonly 6: `var(--${string})`;
|
|
339
|
+
readonly 8: `var(--${string})`;
|
|
340
|
+
readonly 10: `var(--${string})`;
|
|
341
|
+
readonly 12: `var(--${string})`;
|
|
342
|
+
readonly 14: `var(--${string})`;
|
|
343
|
+
readonly 16: `var(--${string})`;
|
|
344
|
+
readonly 18: `var(--${string})`;
|
|
345
|
+
readonly 20: `var(--${string})`;
|
|
346
|
+
readonly 24: `var(--${string})`;
|
|
347
|
+
readonly 28: `var(--${string})`;
|
|
348
|
+
readonly 32: `var(--${string})`;
|
|
349
|
+
readonly 36: `var(--${string})`;
|
|
350
|
+
readonly 40: `var(--${string})`;
|
|
351
|
+
readonly 44: `var(--${string})`;
|
|
352
|
+
readonly 48: `var(--${string})`;
|
|
353
|
+
readonly 56: `var(--${string})`;
|
|
354
|
+
readonly 64: `var(--${string})`;
|
|
355
|
+
readonly 80: `var(--${string})`;
|
|
356
|
+
readonly 96: `var(--${string})`;
|
|
357
|
+
readonly 112: `var(--${string})`;
|
|
358
|
+
readonly 128: `var(--${string})`;
|
|
359
|
+
};
|
|
360
|
+
readonly zIndex: {
|
|
361
|
+
readonly auto: "auto";
|
|
362
|
+
readonly hide: `var(--${string})`;
|
|
363
|
+
readonly base: `var(--${string})`;
|
|
364
|
+
readonly docked: `var(--${string})`;
|
|
365
|
+
readonly sticky: `var(--${string})`;
|
|
366
|
+
readonly banner: `var(--${string})`;
|
|
367
|
+
readonly overlay: `var(--${string})`;
|
|
368
|
+
readonly modal: `var(--${string})`;
|
|
369
|
+
readonly dropdown: `var(--${string})`;
|
|
370
|
+
readonly popover: `var(--${string})`;
|
|
371
|
+
readonly toast: `var(--${string})`;
|
|
372
|
+
readonly tooltip: `var(--${string})`;
|
|
373
|
+
};
|
|
374
|
+
readonly boxSizing: readonly ["border-box", "content-box"];
|
|
375
|
+
readonly visibility: readonly ["visible", "hidden"];
|
|
376
|
+
};
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Props of a `Box` rendering `Tag`: its style props, then the attributes,
|
|
380
|
+
* events and `ref` of that tag. Style props replace the native attributes of
|
|
381
|
+
* the same name, such as `color`, `width` and `height`.
|
|
382
|
+
*/
|
|
383
|
+
export declare type BoxProps<Tag extends BoxTag = 'div'> = BoxOwnProps<Tag> & ElementModeProps & Readonly<Omit<ComponentPropsWithRef<Tag>, keyof BoxOwnProps>>;
|
|
384
|
+
|
|
385
|
+
/** Shorthand props of a `Box`, flattened in their resolution order. */
|
|
386
|
+
declare const boxShorthands: {
|
|
387
|
+
borderWidth: ("borderBottomWidth" | "borderLeftWidth" | "borderRightWidth" | "borderTopWidth")[];
|
|
388
|
+
borderRadius: ("borderBottomLeftRadius" | "borderBottomRightRadius" | "borderTopLeftRadius" | "borderTopRightRadius")[];
|
|
389
|
+
gap: ("columnGap" | "rowGap")[];
|
|
390
|
+
inset: ("bottom" | "left" | "right" | "top")[];
|
|
391
|
+
insetX: ("left" | "right")[];
|
|
392
|
+
insetY: ("bottom" | "top")[];
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Style props of a `Box`, none of which reaches the DOM as an attribute:
|
|
397
|
+
* token props, then sizing and color props, which accept any CSS value.
|
|
398
|
+
*/
|
|
399
|
+
export declare type BoxStyleProps = BoxTokenStyleProps & SizingStyleProps & ColorStyleProps;
|
|
400
|
+
|
|
401
|
+
/**
|
|
402
|
+
* HTML tag a `Box` can render: no SVG tag, no React component, and no tag
|
|
403
|
+
* of pure text (headings, paragraphs, inline phrasing), which belongs to
|
|
404
|
+
* `Typography`. Tags that commonly wrap other elements stay, such as `a`,
|
|
405
|
+
* `li` or `label`.
|
|
406
|
+
*/
|
|
407
|
+
export declare type BoxTag = Exclude<HTMLElementType, TextOnlyTag>;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Token-based style props of a `Box`: the shared ones, then those of layout
|
|
411
|
+
* containers, positioned boxes and bordered surfaces.
|
|
412
|
+
*/
|
|
413
|
+
declare type BoxTokenStyleProps = CommonStyleProps & TokenStyleProps<typeof boxProperties, typeof boxShorthands>;
|
|
414
|
+
|
|
415
|
+
/** Color props accepting any CSS value, such as a theme variable. */
|
|
416
|
+
declare type ColorStyleProps = Readonly<{
|
|
417
|
+
/** Background color; without it no background is declared. */
|
|
418
|
+
backgroundColor?: string | undefined;
|
|
419
|
+
/** Border color; without it borders keep their current color. */
|
|
420
|
+
borderColor?: string | undefined;
|
|
421
|
+
/** Text color; without it the color keeps its default or stays inherited. */
|
|
422
|
+
color?: string | undefined;
|
|
423
|
+
}>;
|
|
424
|
+
|
|
425
|
+
/** Shared composite style props, flattened. */
|
|
426
|
+
declare const commonComposites: {
|
|
427
|
+
readonly scrollbar: {
|
|
428
|
+
readonly thin: {
|
|
429
|
+
readonly '@supports': {
|
|
430
|
+
readonly 'not selector(::-webkit-scrollbar)': {
|
|
431
|
+
readonly scrollbarWidth: "thin";
|
|
432
|
+
readonly '@media': {
|
|
433
|
+
readonly "(forced-colors: none)": {
|
|
434
|
+
readonly scrollbarColor: `var(--${string}) var(--${string})`;
|
|
435
|
+
};
|
|
436
|
+
};
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
readonly '@media': {
|
|
440
|
+
readonly "(forced-colors: none)": {
|
|
441
|
+
readonly selectors: {
|
|
442
|
+
readonly '&::-webkit-scrollbar': {
|
|
443
|
+
readonly width: "0.625rem";
|
|
444
|
+
readonly height: "0.625rem";
|
|
445
|
+
readonly backgroundColor: "transparent";
|
|
446
|
+
};
|
|
447
|
+
readonly '&::-webkit-scrollbar-track': {
|
|
448
|
+
readonly backgroundColor: `var(--${string})`;
|
|
449
|
+
};
|
|
450
|
+
readonly '&::-webkit-scrollbar-thumb': {
|
|
451
|
+
readonly border: "0.125rem solid transparent";
|
|
452
|
+
readonly borderRadius: `var(--${string})`;
|
|
453
|
+
readonly backgroundColor: `var(--${string})`;
|
|
454
|
+
readonly backgroundClip: "padding-box";
|
|
455
|
+
};
|
|
456
|
+
readonly '&::-webkit-scrollbar-thumb:hover': {
|
|
457
|
+
readonly backgroundColor: `var(--${string})`;
|
|
458
|
+
};
|
|
459
|
+
readonly '&::-webkit-scrollbar-button': {
|
|
460
|
+
readonly display: "none";
|
|
461
|
+
};
|
|
462
|
+
readonly '&::-webkit-scrollbar-corner': {
|
|
463
|
+
readonly backgroundColor: "transparent";
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
};
|
|
468
|
+
};
|
|
469
|
+
};
|
|
470
|
+
};
|
|
471
|
+
|
|
472
|
+
/** Shared token style properties, flattened in their emission order. */
|
|
473
|
+
declare const commonProperties: {
|
|
474
|
+
readonly opacity: {
|
|
475
|
+
readonly hidden: `var(--${string})`;
|
|
476
|
+
readonly disabled: `var(--${string})`;
|
|
477
|
+
readonly muted: `var(--${string})`;
|
|
478
|
+
readonly visible: `var(--${string})`;
|
|
479
|
+
};
|
|
480
|
+
readonly gridColumn: readonly ["auto", "1 / -1", "span 1", "span 2", "span 3", "span 4", "span 5", "span 6", "span 7", "span 8", "span 9", "span 10", "span 11", "span 12"];
|
|
481
|
+
readonly gridRow: readonly ["auto", "1 / -1", "span 1", "span 2", "span 3", "span 4", "span 5", "span 6"];
|
|
482
|
+
readonly alignSelf: readonly ["auto", "stretch", "flex-start", "center", "flex-end", "baseline"];
|
|
483
|
+
readonly justifySelf: readonly ["auto", "stretch", "start", "center", "end"];
|
|
484
|
+
readonly flex: {
|
|
485
|
+
readonly 1: "1 1 0%";
|
|
486
|
+
readonly auto: "1 1 auto";
|
|
487
|
+
readonly initial: "0 1 auto";
|
|
488
|
+
readonly none: "none";
|
|
489
|
+
};
|
|
490
|
+
readonly flexGrow: readonly [0, 1];
|
|
491
|
+
readonly flexShrink: readonly [0, 1];
|
|
492
|
+
readonly flexBasis: {
|
|
493
|
+
readonly 0: "0";
|
|
494
|
+
readonly '100%': "100%";
|
|
495
|
+
readonly auto: "auto";
|
|
496
|
+
};
|
|
497
|
+
readonly paddingTop: {
|
|
498
|
+
readonly 0: `var(--${string})`;
|
|
499
|
+
readonly 1: `var(--${string})`;
|
|
500
|
+
readonly 2: `var(--${string})`;
|
|
501
|
+
readonly 4: `var(--${string})`;
|
|
502
|
+
readonly 6: `var(--${string})`;
|
|
503
|
+
readonly 8: `var(--${string})`;
|
|
504
|
+
readonly 10: `var(--${string})`;
|
|
505
|
+
readonly 12: `var(--${string})`;
|
|
506
|
+
readonly 14: `var(--${string})`;
|
|
507
|
+
readonly 16: `var(--${string})`;
|
|
508
|
+
readonly 18: `var(--${string})`;
|
|
509
|
+
readonly 20: `var(--${string})`;
|
|
510
|
+
readonly 24: `var(--${string})`;
|
|
511
|
+
readonly 28: `var(--${string})`;
|
|
512
|
+
readonly 32: `var(--${string})`;
|
|
513
|
+
readonly 36: `var(--${string})`;
|
|
514
|
+
readonly 40: `var(--${string})`;
|
|
515
|
+
readonly 44: `var(--${string})`;
|
|
516
|
+
readonly 48: `var(--${string})`;
|
|
517
|
+
readonly 56: `var(--${string})`;
|
|
518
|
+
readonly 64: `var(--${string})`;
|
|
519
|
+
readonly 80: `var(--${string})`;
|
|
520
|
+
readonly 96: `var(--${string})`;
|
|
521
|
+
readonly 112: `var(--${string})`;
|
|
522
|
+
readonly 128: `var(--${string})`;
|
|
523
|
+
};
|
|
524
|
+
readonly paddingRight: {
|
|
525
|
+
readonly 0: `var(--${string})`;
|
|
526
|
+
readonly 1: `var(--${string})`;
|
|
527
|
+
readonly 2: `var(--${string})`;
|
|
528
|
+
readonly 4: `var(--${string})`;
|
|
529
|
+
readonly 6: `var(--${string})`;
|
|
530
|
+
readonly 8: `var(--${string})`;
|
|
531
|
+
readonly 10: `var(--${string})`;
|
|
532
|
+
readonly 12: `var(--${string})`;
|
|
533
|
+
readonly 14: `var(--${string})`;
|
|
534
|
+
readonly 16: `var(--${string})`;
|
|
535
|
+
readonly 18: `var(--${string})`;
|
|
536
|
+
readonly 20: `var(--${string})`;
|
|
537
|
+
readonly 24: `var(--${string})`;
|
|
538
|
+
readonly 28: `var(--${string})`;
|
|
539
|
+
readonly 32: `var(--${string})`;
|
|
540
|
+
readonly 36: `var(--${string})`;
|
|
541
|
+
readonly 40: `var(--${string})`;
|
|
542
|
+
readonly 44: `var(--${string})`;
|
|
543
|
+
readonly 48: `var(--${string})`;
|
|
544
|
+
readonly 56: `var(--${string})`;
|
|
545
|
+
readonly 64: `var(--${string})`;
|
|
546
|
+
readonly 80: `var(--${string})`;
|
|
547
|
+
readonly 96: `var(--${string})`;
|
|
548
|
+
readonly 112: `var(--${string})`;
|
|
549
|
+
readonly 128: `var(--${string})`;
|
|
550
|
+
};
|
|
551
|
+
readonly paddingBottom: {
|
|
552
|
+
readonly 0: `var(--${string})`;
|
|
553
|
+
readonly 1: `var(--${string})`;
|
|
554
|
+
readonly 2: `var(--${string})`;
|
|
555
|
+
readonly 4: `var(--${string})`;
|
|
556
|
+
readonly 6: `var(--${string})`;
|
|
557
|
+
readonly 8: `var(--${string})`;
|
|
558
|
+
readonly 10: `var(--${string})`;
|
|
559
|
+
readonly 12: `var(--${string})`;
|
|
560
|
+
readonly 14: `var(--${string})`;
|
|
561
|
+
readonly 16: `var(--${string})`;
|
|
562
|
+
readonly 18: `var(--${string})`;
|
|
563
|
+
readonly 20: `var(--${string})`;
|
|
564
|
+
readonly 24: `var(--${string})`;
|
|
565
|
+
readonly 28: `var(--${string})`;
|
|
566
|
+
readonly 32: `var(--${string})`;
|
|
567
|
+
readonly 36: `var(--${string})`;
|
|
568
|
+
readonly 40: `var(--${string})`;
|
|
569
|
+
readonly 44: `var(--${string})`;
|
|
570
|
+
readonly 48: `var(--${string})`;
|
|
571
|
+
readonly 56: `var(--${string})`;
|
|
572
|
+
readonly 64: `var(--${string})`;
|
|
573
|
+
readonly 80: `var(--${string})`;
|
|
574
|
+
readonly 96: `var(--${string})`;
|
|
575
|
+
readonly 112: `var(--${string})`;
|
|
576
|
+
readonly 128: `var(--${string})`;
|
|
577
|
+
};
|
|
578
|
+
readonly paddingLeft: {
|
|
579
|
+
readonly 0: `var(--${string})`;
|
|
580
|
+
readonly 1: `var(--${string})`;
|
|
581
|
+
readonly 2: `var(--${string})`;
|
|
582
|
+
readonly 4: `var(--${string})`;
|
|
583
|
+
readonly 6: `var(--${string})`;
|
|
584
|
+
readonly 8: `var(--${string})`;
|
|
585
|
+
readonly 10: `var(--${string})`;
|
|
586
|
+
readonly 12: `var(--${string})`;
|
|
587
|
+
readonly 14: `var(--${string})`;
|
|
588
|
+
readonly 16: `var(--${string})`;
|
|
589
|
+
readonly 18: `var(--${string})`;
|
|
590
|
+
readonly 20: `var(--${string})`;
|
|
591
|
+
readonly 24: `var(--${string})`;
|
|
592
|
+
readonly 28: `var(--${string})`;
|
|
593
|
+
readonly 32: `var(--${string})`;
|
|
594
|
+
readonly 36: `var(--${string})`;
|
|
595
|
+
readonly 40: `var(--${string})`;
|
|
596
|
+
readonly 44: `var(--${string})`;
|
|
597
|
+
readonly 48: `var(--${string})`;
|
|
598
|
+
readonly 56: `var(--${string})`;
|
|
599
|
+
readonly 64: `var(--${string})`;
|
|
600
|
+
readonly 80: `var(--${string})`;
|
|
601
|
+
readonly 96: `var(--${string})`;
|
|
602
|
+
readonly 112: `var(--${string})`;
|
|
603
|
+
readonly 128: `var(--${string})`;
|
|
604
|
+
};
|
|
605
|
+
readonly marginTop: {
|
|
606
|
+
readonly auto: "auto";
|
|
607
|
+
readonly 0: `var(--${string})`;
|
|
608
|
+
readonly 1: `var(--${string})`;
|
|
609
|
+
readonly 2: `var(--${string})`;
|
|
610
|
+
readonly 4: `var(--${string})`;
|
|
611
|
+
readonly 6: `var(--${string})`;
|
|
612
|
+
readonly 8: `var(--${string})`;
|
|
613
|
+
readonly 10: `var(--${string})`;
|
|
614
|
+
readonly 12: `var(--${string})`;
|
|
615
|
+
readonly 14: `var(--${string})`;
|
|
616
|
+
readonly 16: `var(--${string})`;
|
|
617
|
+
readonly 18: `var(--${string})`;
|
|
618
|
+
readonly 20: `var(--${string})`;
|
|
619
|
+
readonly 24: `var(--${string})`;
|
|
620
|
+
readonly 28: `var(--${string})`;
|
|
621
|
+
readonly 32: `var(--${string})`;
|
|
622
|
+
readonly 36: `var(--${string})`;
|
|
623
|
+
readonly 40: `var(--${string})`;
|
|
624
|
+
readonly 44: `var(--${string})`;
|
|
625
|
+
readonly 48: `var(--${string})`;
|
|
626
|
+
readonly 56: `var(--${string})`;
|
|
627
|
+
readonly 64: `var(--${string})`;
|
|
628
|
+
readonly 80: `var(--${string})`;
|
|
629
|
+
readonly 96: `var(--${string})`;
|
|
630
|
+
readonly 112: `var(--${string})`;
|
|
631
|
+
readonly 128: `var(--${string})`;
|
|
632
|
+
};
|
|
633
|
+
readonly marginRight: {
|
|
634
|
+
readonly auto: "auto";
|
|
635
|
+
readonly 0: `var(--${string})`;
|
|
636
|
+
readonly 1: `var(--${string})`;
|
|
637
|
+
readonly 2: `var(--${string})`;
|
|
638
|
+
readonly 4: `var(--${string})`;
|
|
639
|
+
readonly 6: `var(--${string})`;
|
|
640
|
+
readonly 8: `var(--${string})`;
|
|
641
|
+
readonly 10: `var(--${string})`;
|
|
642
|
+
readonly 12: `var(--${string})`;
|
|
643
|
+
readonly 14: `var(--${string})`;
|
|
644
|
+
readonly 16: `var(--${string})`;
|
|
645
|
+
readonly 18: `var(--${string})`;
|
|
646
|
+
readonly 20: `var(--${string})`;
|
|
647
|
+
readonly 24: `var(--${string})`;
|
|
648
|
+
readonly 28: `var(--${string})`;
|
|
649
|
+
readonly 32: `var(--${string})`;
|
|
650
|
+
readonly 36: `var(--${string})`;
|
|
651
|
+
readonly 40: `var(--${string})`;
|
|
652
|
+
readonly 44: `var(--${string})`;
|
|
653
|
+
readonly 48: `var(--${string})`;
|
|
654
|
+
readonly 56: `var(--${string})`;
|
|
655
|
+
readonly 64: `var(--${string})`;
|
|
656
|
+
readonly 80: `var(--${string})`;
|
|
657
|
+
readonly 96: `var(--${string})`;
|
|
658
|
+
readonly 112: `var(--${string})`;
|
|
659
|
+
readonly 128: `var(--${string})`;
|
|
660
|
+
};
|
|
661
|
+
readonly marginBottom: {
|
|
662
|
+
readonly auto: "auto";
|
|
663
|
+
readonly 0: `var(--${string})`;
|
|
664
|
+
readonly 1: `var(--${string})`;
|
|
665
|
+
readonly 2: `var(--${string})`;
|
|
666
|
+
readonly 4: `var(--${string})`;
|
|
667
|
+
readonly 6: `var(--${string})`;
|
|
668
|
+
readonly 8: `var(--${string})`;
|
|
669
|
+
readonly 10: `var(--${string})`;
|
|
670
|
+
readonly 12: `var(--${string})`;
|
|
671
|
+
readonly 14: `var(--${string})`;
|
|
672
|
+
readonly 16: `var(--${string})`;
|
|
673
|
+
readonly 18: `var(--${string})`;
|
|
674
|
+
readonly 20: `var(--${string})`;
|
|
675
|
+
readonly 24: `var(--${string})`;
|
|
676
|
+
readonly 28: `var(--${string})`;
|
|
677
|
+
readonly 32: `var(--${string})`;
|
|
678
|
+
readonly 36: `var(--${string})`;
|
|
679
|
+
readonly 40: `var(--${string})`;
|
|
680
|
+
readonly 44: `var(--${string})`;
|
|
681
|
+
readonly 48: `var(--${string})`;
|
|
682
|
+
readonly 56: `var(--${string})`;
|
|
683
|
+
readonly 64: `var(--${string})`;
|
|
684
|
+
readonly 80: `var(--${string})`;
|
|
685
|
+
readonly 96: `var(--${string})`;
|
|
686
|
+
readonly 112: `var(--${string})`;
|
|
687
|
+
readonly 128: `var(--${string})`;
|
|
688
|
+
};
|
|
689
|
+
readonly marginLeft: {
|
|
690
|
+
readonly auto: "auto";
|
|
691
|
+
readonly 0: `var(--${string})`;
|
|
692
|
+
readonly 1: `var(--${string})`;
|
|
693
|
+
readonly 2: `var(--${string})`;
|
|
694
|
+
readonly 4: `var(--${string})`;
|
|
695
|
+
readonly 6: `var(--${string})`;
|
|
696
|
+
readonly 8: `var(--${string})`;
|
|
697
|
+
readonly 10: `var(--${string})`;
|
|
698
|
+
readonly 12: `var(--${string})`;
|
|
699
|
+
readonly 14: `var(--${string})`;
|
|
700
|
+
readonly 16: `var(--${string})`;
|
|
701
|
+
readonly 18: `var(--${string})`;
|
|
702
|
+
readonly 20: `var(--${string})`;
|
|
703
|
+
readonly 24: `var(--${string})`;
|
|
704
|
+
readonly 28: `var(--${string})`;
|
|
705
|
+
readonly 32: `var(--${string})`;
|
|
706
|
+
readonly 36: `var(--${string})`;
|
|
707
|
+
readonly 40: `var(--${string})`;
|
|
708
|
+
readonly 44: `var(--${string})`;
|
|
709
|
+
readonly 48: `var(--${string})`;
|
|
710
|
+
readonly 56: `var(--${string})`;
|
|
711
|
+
readonly 64: `var(--${string})`;
|
|
712
|
+
readonly 80: `var(--${string})`;
|
|
713
|
+
readonly 96: `var(--${string})`;
|
|
714
|
+
readonly 112: `var(--${string})`;
|
|
715
|
+
readonly 128: `var(--${string})`;
|
|
716
|
+
};
|
|
717
|
+
readonly overflowX: readonly ["visible", "hidden", "clip", "scroll", "auto"];
|
|
718
|
+
readonly overflowY: readonly ["visible", "hidden", "clip", "scroll", "auto"];
|
|
719
|
+
readonly display: readonly ["none", "block", "inline", "inline-block", "flex", "inline-flex", "grid", "inline-grid", "contents"];
|
|
720
|
+
};
|
|
721
|
+
|
|
722
|
+
/** Shared shorthand props, flattened in their resolution order. */
|
|
723
|
+
declare const commonShorthands: {
|
|
724
|
+
padding: ("paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft")[];
|
|
725
|
+
paddingX: ("paddingRight" | "paddingLeft")[];
|
|
726
|
+
paddingY: ("paddingTop" | "paddingBottom")[];
|
|
727
|
+
margin: ("marginTop" | "marginRight" | "marginBottom" | "marginLeft")[];
|
|
728
|
+
marginX: ("marginRight" | "marginLeft")[];
|
|
729
|
+
marginY: ("marginTop" | "marginBottom")[];
|
|
730
|
+
overflow: ("overflowX" | "overflowY")[];
|
|
731
|
+
};
|
|
732
|
+
|
|
733
|
+
/**
|
|
734
|
+
* Sizing properties shared by every styled component. Unlike token
|
|
735
|
+
* properties, they accept any CSS value of the property, as `style` does: a
|
|
736
|
+
* number is a length in pixels, `0` excepted. Each one is carried by a
|
|
737
|
+
* private CSS variable set inline and read by a single class in the layer of
|
|
738
|
+
* style props, so values generate no class.
|
|
739
|
+
*/
|
|
740
|
+
declare const commonSizingProperties: readonly ["width", "minWidth", "maxWidth", "height", "minHeight", "maxHeight"];
|
|
741
|
+
|
|
742
|
+
/**
|
|
743
|
+
* Token style props shared by every styled component, those setting several
|
|
744
|
+
* properties at once included, such as `scrollbar`.
|
|
745
|
+
*/
|
|
746
|
+
declare type CommonStyleProps = TokenStyleProps<typeof commonProperties, typeof commonShorthands> & TokenStyleProps<typeof commonComposites, Record<never, never>>;
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* Props of a polymorphic component rendering its own element: `asChild`
|
|
750
|
+
* is absent or false, and `as` may choose the tag.
|
|
751
|
+
*/
|
|
752
|
+
declare type ElementModeProps = Readonly<{
|
|
753
|
+
/** Renders the single child instead of an element when true; absent or false here. */
|
|
754
|
+
asChild?: false | undefined;
|
|
755
|
+
}>;
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* A `Box` laid out as a flex container by default, in a row. Only the
|
|
759
|
+
* default differs: `display` takes every value a `Box` accepts, an explicit
|
|
760
|
+
* one replaces the default (to hide the container or make it a block, for
|
|
761
|
+
* instance) and `undefined` keeps it. It renders the same tags, a `div` by
|
|
762
|
+
* default, takes every style prop of a `Box` and reuses the same atomic
|
|
763
|
+
* classes, grid container props included, which apply once `display`
|
|
764
|
+
* makes it a grid container. Item props stay available, since a `Flex` can itself be the
|
|
765
|
+
* child of a flex or grid container. Style props never reach the DOM, and every other prop
|
|
766
|
+
* (attributes, events, `ref`) is typed after the tag and forwarded to the
|
|
767
|
+
* element.
|
|
768
|
+
*
|
|
769
|
+
* With `asChild`, nothing is rendered of its own: the single child is,
|
|
770
|
+
* with the classes, styles, other props and `ref` merged onto it (see
|
|
771
|
+
* `AsChildProps`), for instance to style a router link.
|
|
772
|
+
*
|
|
773
|
+
* @param props Style props, `as` or `asChild`, and the native props of the
|
|
774
|
+
* rendered tag.
|
|
775
|
+
* @returns The flex container.
|
|
776
|
+
* @throws {Error} With `asChild`, when the children are not a single
|
|
777
|
+
* element.
|
|
778
|
+
*/
|
|
779
|
+
export declare const Flex: <Tag extends BoxTag = "div">(props: FlexProps<Tag> | FlexAsChildProps) => ReactElement;
|
|
780
|
+
|
|
781
|
+
/**
|
|
782
|
+
* Props of a `Flex` rendering its single child (`asChild`) instead of
|
|
783
|
+
* an element: those of a `Box`, merged onto the child.
|
|
784
|
+
*/
|
|
785
|
+
export declare type FlexAsChildProps = BoxAsChildProps;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* Props of a `Flex` rendering `Tag`: those of a `Box` rendering it,
|
|
789
|
+
* `display` defaulting to `flex` when absent or undefined.
|
|
790
|
+
*/
|
|
791
|
+
export declare type FlexProps<Tag extends BoxTag = 'div'> = BoxProps<Tag>;
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* A `Box` laid out as a grid container by default. Only the
|
|
795
|
+
* default differs: `display` takes every value a `Box` accepts, an explicit
|
|
796
|
+
* one replaces the default (to hide the container or make it a block, for
|
|
797
|
+
* instance) and `undefined` keeps it. It renders the same tags, a `div` by
|
|
798
|
+
* default, takes every style prop of a `Box` and reuses the same atomic
|
|
799
|
+
* classes, flex container props included, which apply once `display`
|
|
800
|
+
* makes it a flex container. Item props stay available, since a `Grid` can itself be the
|
|
801
|
+
* child of a flex or grid container. Style props never reach the DOM, and every other prop
|
|
802
|
+
* (attributes, events, `ref`) is typed after the tag and forwarded to the
|
|
803
|
+
* element.
|
|
804
|
+
*
|
|
805
|
+
* With `asChild`, nothing is rendered of its own: the single child is,
|
|
806
|
+
* with the classes, styles, other props and `ref` merged onto it (see
|
|
807
|
+
* `AsChildProps`), for instance to style a router link.
|
|
808
|
+
*
|
|
809
|
+
* @param props Style props, `as` or `asChild`, and the native props of the
|
|
810
|
+
* rendered tag.
|
|
811
|
+
* @returns The grid container.
|
|
812
|
+
* @throws {Error} With `asChild`, when the children are not a single
|
|
813
|
+
* element.
|
|
814
|
+
*/
|
|
815
|
+
export declare const Grid: <Tag extends BoxTag = "div">(props: GridProps<Tag> | GridAsChildProps) => ReactElement;
|
|
816
|
+
|
|
817
|
+
/**
|
|
818
|
+
* Props of a `Grid` rendering its single child (`asChild`) instead of
|
|
819
|
+
* an element: those of a `Box`, merged onto the child.
|
|
820
|
+
*/
|
|
821
|
+
export declare type GridAsChildProps = BoxAsChildProps;
|
|
822
|
+
|
|
823
|
+
/**
|
|
824
|
+
* Props of a `Grid` rendering `Tag`: those of a `Box` rendering it,
|
|
825
|
+
* `display` defaulting to `grid` when absent or undefined.
|
|
826
|
+
*/
|
|
827
|
+
export declare type GridProps<Tag extends BoxTag = 'div'> = BoxProps<Tag>;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Displays trusted local Iconify data as an SVG using `@iconify/react/offline`,
|
|
831
|
+
* with a font size token, CSS sizes and CSS colors. Icons are decorative
|
|
832
|
+
* unless given an accessible name.
|
|
833
|
+
*
|
|
834
|
+
* The icon draws the data given through `icon`, never fetched: the library
|
|
835
|
+
* ships no icon set, so consumers keep their own registry of `IconData` and
|
|
836
|
+
* pass its entries. The body is inserted as markup, so the data must come
|
|
837
|
+
* from a trusted source, never from user input.
|
|
838
|
+
*
|
|
839
|
+
* Without size props, the icon is `1em` high, follows the font size of its
|
|
840
|
+
* context, and its width follows the ratio of its data. `size` sets the
|
|
841
|
+
* font size of the icon to a font size token of the theme, such as `24` for
|
|
842
|
+
* `1.5rem`: both axes scale with it and the ratio is kept. `width` and `height` take any CSS value, as on
|
|
843
|
+
* `Box`, and replace the default size on their axis, `size` included; the
|
|
844
|
+
* other axis keeps its default, computed from the font size, and the
|
|
845
|
+
* drawing keeps its ratio, centered in the box. `100%` fills the container
|
|
846
|
+
* on that axis; `auto` and the content keywords come back to the default
|
|
847
|
+
* size. The icon draws with `currentColor`: it inherits the text color, and
|
|
848
|
+
* `color`, which accepts any CSS value, overrides it.
|
|
849
|
+
*
|
|
850
|
+
* The style props of `Box` apply to the `svg` box, with the same values and
|
|
851
|
+
* classes, except those of flex and grid containers: `backgroundColor`,
|
|
852
|
+
* `borderColor`, borders, radii, padding and shadow draw a badge around the
|
|
853
|
+
* drawing. The box is `content-box` by default: padding and borders add to
|
|
854
|
+
* the size, and with `boxSizing={'border-box'}` they shrink the drawing
|
|
855
|
+
* instead. The drawing is not clipped by rounded corners unless `overflow`
|
|
856
|
+
* says so, and the icon does not shrink in a flex row unless `flexShrink`
|
|
857
|
+
* says so.
|
|
858
|
+
*
|
|
859
|
+
* A non-empty `aria-label` or `aria-labelledby` makes the icon an image
|
|
860
|
+
* (`role="img"`) announced by that name. Otherwise it is decorative: hidden
|
|
861
|
+
* from assistive technologies, without role and not focusable. Every other
|
|
862
|
+
* prop (attributes, events, `ref`) is forwarded to the `svg` element, and
|
|
863
|
+
* the consumer's `className` and `style` are merged with the generated ones.
|
|
864
|
+
*
|
|
865
|
+
* @param props Icon data, style props and native props of the `svg`.
|
|
866
|
+
* @param props.icon Data of the icon to draw.
|
|
867
|
+
* @returns The icon as an inline SVG.
|
|
868
|
+
*/
|
|
869
|
+
export declare const Icon: FC<IconProps>;
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Data of one icon in the Iconify format: its SVG `body`, without the `svg`
|
|
873
|
+
* element, and its `width` and `height` in viewBox units (16 when absent).
|
|
874
|
+
* The body is inserted as markup: it must come from a trusted, local source,
|
|
875
|
+
* never from user input.
|
|
876
|
+
*/
|
|
877
|
+
export declare type IconData = IconifyIcon;
|
|
878
|
+
|
|
879
|
+
/**
|
|
880
|
+
* Native attributes an `Icon` does not accept: it sets the accessibility
|
|
881
|
+
* attributes itself, renders the content of its data, and leaves no room for
|
|
882
|
+
* the rendering options of Iconify that native SVG attributes would trigger.
|
|
883
|
+
*/
|
|
884
|
+
declare type IconExcludedAttribute = 'aria-hidden' | 'children' | 'dangerouslySetInnerHTML' | 'focusable' | 'mode' | 'onLoad' | 'role' | 'rotate';
|
|
885
|
+
|
|
886
|
+
/**
|
|
887
|
+
* Props of `Box` an `Icon` does not expose: those of flex and grid
|
|
888
|
+
* containers, gaps included. The content of an `svg` is drawn from its
|
|
889
|
+
* viewBox, never laid out by CSS, so they would have no effect. This module
|
|
890
|
+
* is only read at build time and never reaches the published bundle.
|
|
891
|
+
*/
|
|
892
|
+
declare const iconOmittedProperties: readonly ["rowGap", "columnGap", "gap", "flexDirection", "flexWrap", "alignItems", "alignContent", "justifyContent", "justifyItems", "gridTemplateColumns", "gridTemplateRows", "gridAutoFlow", "gridAutoColumns", "gridAutoRows"];
|
|
893
|
+
|
|
894
|
+
/** Props an `Icon` handles itself. */
|
|
895
|
+
declare type IconOwnProps = IconStyleProps & Readonly<{
|
|
896
|
+
/** Data of the icon to draw, from a trusted local source. */
|
|
897
|
+
icon: IconData;
|
|
898
|
+
/** Classes added after the generated ones. */
|
|
899
|
+
className?: string | undefined;
|
|
900
|
+
/** Inline styles, merged after the sizing and color variables, so they prevail. */
|
|
901
|
+
style?: CSSProperties | undefined;
|
|
902
|
+
}>;
|
|
903
|
+
|
|
904
|
+
/**
|
|
905
|
+
* Props of an `Icon`: its own props, then the attributes, events and `ref`
|
|
906
|
+
* of the rendered `svg`. `aria-label` or `aria-labelledby` name the icon
|
|
907
|
+
* and make it an image; without them it is decorative.
|
|
908
|
+
*/
|
|
909
|
+
export declare type IconProps = IconOwnProps & Readonly<Omit<ComponentPropsWithRef<'svg'>, keyof IconOwnProps | IconExcludedAttribute>>;
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* Value of the `size` of an `Icon`: a font size token of the theme, such as
|
|
913
|
+
* `24` for `1.5rem`. The icon is `1em` high, so the font size it sets sizes
|
|
914
|
+
* it.
|
|
915
|
+
*/
|
|
916
|
+
export declare type IconSize = FontSizeToken;
|
|
917
|
+
|
|
918
|
+
/**
|
|
919
|
+
* Style props of an `Icon`, none of which reaches the DOM as an attribute:
|
|
920
|
+
* those of `Box`, with the same values and classes, except the props of
|
|
921
|
+
* flex and grid containers; then `size`, a font size token. The sizing
|
|
922
|
+
* props, `color`, `backgroundColor` and `borderColor` accept any CSS value.
|
|
923
|
+
* Without `width` and `height`, the icon is `1em` high, of the font size
|
|
924
|
+
* `size` sets or it inherits, and its width follows the ratio of its data.
|
|
925
|
+
*/
|
|
926
|
+
export declare type IconStyleProps = Omit<BoxStyleProps, (typeof iconOmittedProperties)[number]> & Readonly<{
|
|
927
|
+
/** Font size token the `1em` size of the icon follows; inherited when absent. */
|
|
928
|
+
size?: IconSize | undefined;
|
|
929
|
+
}>;
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* Draws a line between groups of content, one space unit thick, in the
|
|
933
|
+
* border color of the theme, and without margins: space it with the margin
|
|
934
|
+
* props or with the `gap` of its container.
|
|
935
|
+
*
|
|
936
|
+
* Horizontal by default, it renders an `hr`, whose default margins and
|
|
937
|
+
* borders are reset, stretched along the width of a flex column even when
|
|
938
|
+
* its items are aligned otherwise; with `orientation={'vertical'}`, it
|
|
939
|
+
* renders a `div`, stretched along the height of the flex row holding it
|
|
940
|
+
* (outside a flex row, give it a `height`). `alignSelf` overrides both.
|
|
941
|
+
*
|
|
942
|
+
* It is decorative by default: `role="none"` and `aria-hidden="true"` hide
|
|
943
|
+
* it from assistive technologies, without `aria-orientation`. With
|
|
944
|
+
* `decorative={false}`, it is announced as a separator, for groups of
|
|
945
|
+
* content or of menu items that screen readers must tell apart: the
|
|
946
|
+
* horizontal `hr` keeps its implicit role, and the vertical `div` gets
|
|
947
|
+
* `role="separator"` and `aria-orientation="vertical"`.
|
|
948
|
+
*
|
|
949
|
+
* The margin, sizing and placement props of `Box` apply, with the same values
|
|
950
|
+
* and classes: the sizing props accept any CSS value, a number being a
|
|
951
|
+
* length in pixels. `color`, which accepts any CSS value, colors the line:
|
|
952
|
+
* the line is drawn in the current color, so a class of the consumer
|
|
953
|
+
* setting `color` colors it too. Every other prop (attributes, events, `ref`) is forwarded to the
|
|
954
|
+
* element, and the consumer's `className` and `style` are merged with the
|
|
955
|
+
* generated ones. There is no `asChild`: the element and its role follow
|
|
956
|
+
* the orientation, and a separator has no content a child could provide.
|
|
957
|
+
*
|
|
958
|
+
* @param props Orientation, style props and native props of the element.
|
|
959
|
+
* @param props.orientation Direction of the line; `horizontal` when absent.
|
|
960
|
+
* @returns The separator.
|
|
961
|
+
*/
|
|
962
|
+
export declare const Separator: FC<SeparatorProps>;
|
|
963
|
+
|
|
964
|
+
/**
|
|
965
|
+
* Native attributes a `Separator` does not accept: it sets its role and
|
|
966
|
+
* accessibility attributes from `orientation` and `decorative`, and renders
|
|
967
|
+
* no content. `color`, a style prop, replaces the obsolete attribute of
|
|
968
|
+
* the same name.
|
|
969
|
+
*/
|
|
970
|
+
declare type SeparatorExcludedAttribute = 'aria-hidden' | 'aria-orientation' | 'children' | 'dangerouslySetInnerHTML' | 'role';
|
|
971
|
+
|
|
972
|
+
/**
|
|
973
|
+
* Direction of the line a `Separator` draws: across its container
|
|
974
|
+
* (`horizontal`) or along the height of a flex row (`vertical`).
|
|
975
|
+
*/
|
|
976
|
+
export declare type SeparatorOrientation = 'horizontal' | 'vertical';
|
|
977
|
+
|
|
978
|
+
/** Props a `Separator` handles itself. */
|
|
979
|
+
declare type SeparatorOwnProps = SeparatorStyleProps & Readonly<{
|
|
980
|
+
/** Direction of the line; `horizontal` when absent. */
|
|
981
|
+
orientation?: SeparatorOrientation | undefined;
|
|
982
|
+
/** Hides the separator from assistive technologies unless false; decorative when absent. */
|
|
983
|
+
decorative?: boolean | undefined;
|
|
984
|
+
/** Classes added after the generated ones. */
|
|
985
|
+
className?: string | undefined;
|
|
986
|
+
/** Inline styles, merged after the sizing and color variables, so they prevail. */
|
|
987
|
+
style?: CSSProperties | undefined;
|
|
988
|
+
}>;
|
|
989
|
+
|
|
990
|
+
/** Token style properties of a `Separator`, flattened. */
|
|
991
|
+
declare const separatorProperties: {
|
|
992
|
+
readonly gridColumn: readonly ["auto", "1 / -1", "span 1", "span 2", "span 3", "span 4", "span 5", "span 6", "span 7", "span 8", "span 9", "span 10", "span 11", "span 12"];
|
|
993
|
+
readonly gridRow: readonly ["auto", "1 / -1", "span 1", "span 2", "span 3", "span 4", "span 5", "span 6"];
|
|
994
|
+
readonly alignSelf: readonly ["auto", "stretch", "flex-start", "center", "flex-end", "baseline"];
|
|
995
|
+
readonly justifySelf: readonly ["auto", "stretch", "start", "center", "end"];
|
|
996
|
+
readonly marginTop: {
|
|
997
|
+
readonly auto: "auto";
|
|
998
|
+
readonly 0: `var(--${string})`;
|
|
999
|
+
readonly 1: `var(--${string})`;
|
|
1000
|
+
readonly 2: `var(--${string})`;
|
|
1001
|
+
readonly 4: `var(--${string})`;
|
|
1002
|
+
readonly 6: `var(--${string})`;
|
|
1003
|
+
readonly 8: `var(--${string})`;
|
|
1004
|
+
readonly 10: `var(--${string})`;
|
|
1005
|
+
readonly 12: `var(--${string})`;
|
|
1006
|
+
readonly 14: `var(--${string})`;
|
|
1007
|
+
readonly 16: `var(--${string})`;
|
|
1008
|
+
readonly 18: `var(--${string})`;
|
|
1009
|
+
readonly 20: `var(--${string})`;
|
|
1010
|
+
readonly 24: `var(--${string})`;
|
|
1011
|
+
readonly 28: `var(--${string})`;
|
|
1012
|
+
readonly 32: `var(--${string})`;
|
|
1013
|
+
readonly 36: `var(--${string})`;
|
|
1014
|
+
readonly 40: `var(--${string})`;
|
|
1015
|
+
readonly 44: `var(--${string})`;
|
|
1016
|
+
readonly 48: `var(--${string})`;
|
|
1017
|
+
readonly 56: `var(--${string})`;
|
|
1018
|
+
readonly 64: `var(--${string})`;
|
|
1019
|
+
readonly 80: `var(--${string})`;
|
|
1020
|
+
readonly 96: `var(--${string})`;
|
|
1021
|
+
readonly 112: `var(--${string})`;
|
|
1022
|
+
readonly 128: `var(--${string})`;
|
|
1023
|
+
};
|
|
1024
|
+
readonly marginRight: {
|
|
1025
|
+
readonly auto: "auto";
|
|
1026
|
+
readonly 0: `var(--${string})`;
|
|
1027
|
+
readonly 1: `var(--${string})`;
|
|
1028
|
+
readonly 2: `var(--${string})`;
|
|
1029
|
+
readonly 4: `var(--${string})`;
|
|
1030
|
+
readonly 6: `var(--${string})`;
|
|
1031
|
+
readonly 8: `var(--${string})`;
|
|
1032
|
+
readonly 10: `var(--${string})`;
|
|
1033
|
+
readonly 12: `var(--${string})`;
|
|
1034
|
+
readonly 14: `var(--${string})`;
|
|
1035
|
+
readonly 16: `var(--${string})`;
|
|
1036
|
+
readonly 18: `var(--${string})`;
|
|
1037
|
+
readonly 20: `var(--${string})`;
|
|
1038
|
+
readonly 24: `var(--${string})`;
|
|
1039
|
+
readonly 28: `var(--${string})`;
|
|
1040
|
+
readonly 32: `var(--${string})`;
|
|
1041
|
+
readonly 36: `var(--${string})`;
|
|
1042
|
+
readonly 40: `var(--${string})`;
|
|
1043
|
+
readonly 44: `var(--${string})`;
|
|
1044
|
+
readonly 48: `var(--${string})`;
|
|
1045
|
+
readonly 56: `var(--${string})`;
|
|
1046
|
+
readonly 64: `var(--${string})`;
|
|
1047
|
+
readonly 80: `var(--${string})`;
|
|
1048
|
+
readonly 96: `var(--${string})`;
|
|
1049
|
+
readonly 112: `var(--${string})`;
|
|
1050
|
+
readonly 128: `var(--${string})`;
|
|
1051
|
+
};
|
|
1052
|
+
readonly marginBottom: {
|
|
1053
|
+
readonly auto: "auto";
|
|
1054
|
+
readonly 0: `var(--${string})`;
|
|
1055
|
+
readonly 1: `var(--${string})`;
|
|
1056
|
+
readonly 2: `var(--${string})`;
|
|
1057
|
+
readonly 4: `var(--${string})`;
|
|
1058
|
+
readonly 6: `var(--${string})`;
|
|
1059
|
+
readonly 8: `var(--${string})`;
|
|
1060
|
+
readonly 10: `var(--${string})`;
|
|
1061
|
+
readonly 12: `var(--${string})`;
|
|
1062
|
+
readonly 14: `var(--${string})`;
|
|
1063
|
+
readonly 16: `var(--${string})`;
|
|
1064
|
+
readonly 18: `var(--${string})`;
|
|
1065
|
+
readonly 20: `var(--${string})`;
|
|
1066
|
+
readonly 24: `var(--${string})`;
|
|
1067
|
+
readonly 28: `var(--${string})`;
|
|
1068
|
+
readonly 32: `var(--${string})`;
|
|
1069
|
+
readonly 36: `var(--${string})`;
|
|
1070
|
+
readonly 40: `var(--${string})`;
|
|
1071
|
+
readonly 44: `var(--${string})`;
|
|
1072
|
+
readonly 48: `var(--${string})`;
|
|
1073
|
+
readonly 56: `var(--${string})`;
|
|
1074
|
+
readonly 64: `var(--${string})`;
|
|
1075
|
+
readonly 80: `var(--${string})`;
|
|
1076
|
+
readonly 96: `var(--${string})`;
|
|
1077
|
+
readonly 112: `var(--${string})`;
|
|
1078
|
+
readonly 128: `var(--${string})`;
|
|
1079
|
+
};
|
|
1080
|
+
readonly marginLeft: {
|
|
1081
|
+
readonly auto: "auto";
|
|
1082
|
+
readonly 0: `var(--${string})`;
|
|
1083
|
+
readonly 1: `var(--${string})`;
|
|
1084
|
+
readonly 2: `var(--${string})`;
|
|
1085
|
+
readonly 4: `var(--${string})`;
|
|
1086
|
+
readonly 6: `var(--${string})`;
|
|
1087
|
+
readonly 8: `var(--${string})`;
|
|
1088
|
+
readonly 10: `var(--${string})`;
|
|
1089
|
+
readonly 12: `var(--${string})`;
|
|
1090
|
+
readonly 14: `var(--${string})`;
|
|
1091
|
+
readonly 16: `var(--${string})`;
|
|
1092
|
+
readonly 18: `var(--${string})`;
|
|
1093
|
+
readonly 20: `var(--${string})`;
|
|
1094
|
+
readonly 24: `var(--${string})`;
|
|
1095
|
+
readonly 28: `var(--${string})`;
|
|
1096
|
+
readonly 32: `var(--${string})`;
|
|
1097
|
+
readonly 36: `var(--${string})`;
|
|
1098
|
+
readonly 40: `var(--${string})`;
|
|
1099
|
+
readonly 44: `var(--${string})`;
|
|
1100
|
+
readonly 48: `var(--${string})`;
|
|
1101
|
+
readonly 56: `var(--${string})`;
|
|
1102
|
+
readonly 64: `var(--${string})`;
|
|
1103
|
+
readonly 80: `var(--${string})`;
|
|
1104
|
+
readonly 96: `var(--${string})`;
|
|
1105
|
+
readonly 112: `var(--${string})`;
|
|
1106
|
+
readonly 128: `var(--${string})`;
|
|
1107
|
+
};
|
|
1108
|
+
};
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Props of a `Separator`: its own props, then the global attributes and
|
|
1112
|
+
* events of HTML elements and a ref to the rendered `hr` or `div`.
|
|
1113
|
+
*/
|
|
1114
|
+
export declare type SeparatorProps = SeparatorOwnProps & Readonly<Omit<HTMLAttributes<HTMLElement>, keyof SeparatorOwnProps | SeparatorExcludedAttribute>> & Readonly<{
|
|
1115
|
+
/** Ref receiving the rendered element: an `hr`, or a `div` when vertical. */
|
|
1116
|
+
ref?: Ref<HTMLElement> | undefined;
|
|
1117
|
+
}>;
|
|
1118
|
+
|
|
1119
|
+
/** Shorthand props of a `Separator`, flattened. */
|
|
1120
|
+
declare const separatorShorthands: {
|
|
1121
|
+
margin: ("marginTop" | "marginRight" | "marginBottom" | "marginLeft")[];
|
|
1122
|
+
marginX: ("marginRight" | "marginLeft")[];
|
|
1123
|
+
marginY: ("marginTop" | "marginBottom")[];
|
|
1124
|
+
};
|
|
1125
|
+
|
|
1126
|
+
/**
|
|
1127
|
+
* Style props of a `Separator`, none of which reaches the DOM as an
|
|
1128
|
+
* attribute: the shared margin, sizing and placement props, with the same
|
|
1129
|
+
* values and classes as on `Box`, then `color`, the color of the line. The
|
|
1130
|
+
* sizing props and `color` accept any CSS value.
|
|
1131
|
+
*/
|
|
1132
|
+
export declare type SeparatorStyleProps = TokenStyleProps<typeof separatorProperties, typeof separatorShorthands> & SizingStyleProps & Pick<ColorStyleProps, 'color'>;
|
|
1133
|
+
|
|
1134
|
+
/** Sizing property shared by every styled component. */
|
|
1135
|
+
declare type SizingProperty = (typeof commonSizingProperties)[number];
|
|
1136
|
+
|
|
1137
|
+
/**
|
|
1138
|
+
* Sizing props accepting any CSS value of their property, typed as in
|
|
1139
|
+
* `style`: a number is a length in pixels, `0` excepted, such as `320` for
|
|
1140
|
+
* `320px`, and a string is used as given, such as `'50%'`, `'20rem'`,
|
|
1141
|
+
* `'100dvh'` or `'calc(100% - 2rem)'`. A prop that is absent or undefined
|
|
1142
|
+
* declares nothing, so the size keeps its default or comes from another
|
|
1143
|
+
* rule.
|
|
1144
|
+
*/
|
|
1145
|
+
declare type SizingStyleProps = Readonly<Pick<CSSProperties, SizingProperty>>;
|
|
1146
|
+
|
|
1147
|
+
/** Values a property accepts: the items of a list, the keys of a scale. */
|
|
1148
|
+
declare type StylePropertyValue<Values> = Values extends readonly (infer Item)[] ? Item : keyof Values;
|
|
1149
|
+
|
|
1150
|
+
/** Tag of pure text, rendered by `Typography` only. */
|
|
1151
|
+
declare type TextOnlyTag = (typeof textOnlyTags)[number];
|
|
1152
|
+
|
|
1153
|
+
/**
|
|
1154
|
+
* Tags of pure text: headings, paragraphs and inline phrasing. Only
|
|
1155
|
+
* `Typography` renders them.
|
|
1156
|
+
*/
|
|
1157
|
+
declare const textOnlyTags: readonly ["h1", "h2", "h3", "h4", "h5", "h6", "p", "strong", "b", "em", "i", "small", "mark", "code", "kbd", "samp", "abbr", "cite", "q", "del", "ins", "sub", "sup", "time", "u", "s"];
|
|
1158
|
+
|
|
1159
|
+
/** Tag holding text, rendered by `Typography`. */
|
|
1160
|
+
declare type TextTag = (typeof textTags)[number];
|
|
1161
|
+
|
|
1162
|
+
/**
|
|
1163
|
+
* Tags a `Typography` renders: pure text, then tags holding text that
|
|
1164
|
+
* commonly wrap other elements too, which `Box` renders as well.
|
|
1165
|
+
*/
|
|
1166
|
+
declare const textTags: readonly ["h1", "h2", "h3", "h4", "h5", "h6", "p", "strong", "b", "em", "i", "small", "mark", "code", "kbd", "samp", "abbr", "cite", "q", "del", "ins", "sub", "sup", "time", "u", "s", "span", "blockquote", "pre", "figcaption", "a", "label", "li", "dt", "dd", "legend", "caption"];
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* Token-based style props derived from the properties atomic classes are
|
|
1170
|
+
* generated from: each prop accepts a single value of its finite set, mostly
|
|
1171
|
+
* theme tokens, and resolves to static classes. A shorthand accepts the
|
|
1172
|
+
* values of the properties it sets.
|
|
1173
|
+
*/
|
|
1174
|
+
declare type TokenStyleProps<Properties, Shorthands extends Readonly<Record<string, readonly (keyof Properties)[]>>> = Readonly<{
|
|
1175
|
+
[Property in keyof Properties]?: StylePropertyValue<Properties[Property]> | undefined;
|
|
1176
|
+
} & {
|
|
1177
|
+
[Shorthand in keyof Shorthands]?: StylePropertyValue<Properties[Shorthands[Shorthand][number]]> | undefined;
|
|
1178
|
+
}>;
|
|
1179
|
+
|
|
1180
|
+
/**
|
|
1181
|
+
* Text primitive: renders any text tag, a `p` by default, with the default
|
|
1182
|
+
* style of that tag, built from the theme tokens. The style follows the tag:
|
|
1183
|
+
* there is no variant. Style props override it: text and font props, the
|
|
1184
|
+
* shared spacing, sizing and placement props, and `color`. The sizing props
|
|
1185
|
+
* and `color` accept any CSS value, a sizing number being a length in
|
|
1186
|
+
* pixels, as in `style`. Their classes sit in a later cascade layer than the
|
|
1187
|
+
* tag styles, so a prop always prevails. Style props never reach the DOM,
|
|
1188
|
+
* and the consumer's `className` and `style` are merged with the generated
|
|
1189
|
+
* ones, the consumer's `style` prevailing.
|
|
1190
|
+
* Every other prop (attributes, events, `ref`) is typed after the tag and
|
|
1191
|
+
* forwarded to the element.
|
|
1192
|
+
*
|
|
1193
|
+
* `maxLines` truncates the text after a number of lines, with an ellipsis.
|
|
1194
|
+
* It turns the element into a block, so an inline tag such as `span` or `a`
|
|
1195
|
+
* leaves the flow of its sentence; inside a flex or grid container the text
|
|
1196
|
+
* shrinks with its track without further setup. `1` keeps the text on a
|
|
1197
|
+
* single line, aligned to the start whatever `textAlign`, and cuts it where
|
|
1198
|
+
* it overflows, descenders and accents left uncut; `2` to `6` clamp it after
|
|
1199
|
+
* that many lines, a word longer than the line breaking anywhere.
|
|
1200
|
+
* Truncation is only visual: the full text stays available to assistive
|
|
1201
|
+
* technologies, and sighted users need another way to read it.
|
|
1202
|
+
*
|
|
1203
|
+
* With `asChild`, nothing is rendered of its own: the single child is, with
|
|
1204
|
+
* the classes, styles, other props and `ref` merged onto it, for instance
|
|
1205
|
+
* to style a router link. No tag style applies then, since the child sets
|
|
1206
|
+
* the element: only the style props do.
|
|
1207
|
+
*
|
|
1208
|
+
* @param props Style props, `as` or `asChild`, and the native props of the
|
|
1209
|
+
* rendered tag.
|
|
1210
|
+
* @returns The styled text element.
|
|
1211
|
+
* @throws {Error} With `asChild`, when the children are not a single
|
|
1212
|
+
* element.
|
|
1213
|
+
*/
|
|
1214
|
+
export declare const Typography: <Tag extends TypographyTag = "p">(props: TypographyProps<Tag> | TypographyAsChildProps) => ReactElement;
|
|
1215
|
+
|
|
1216
|
+
/**
|
|
1217
|
+
* Props of a `Typography` rendering its single child (`asChild`) instead of
|
|
1218
|
+
* an element: its style props, without `as`, merged onto the child. No tag
|
|
1219
|
+
* style applies, since the child sets the element: only the style props do.
|
|
1220
|
+
*/
|
|
1221
|
+
export declare type TypographyAsChildProps = AsChildProps<TypographyOwnProps>;
|
|
1222
|
+
|
|
1223
|
+
/** Composite style props of a `Typography`, flattened. */
|
|
1224
|
+
declare const typographyComposites: {
|
|
1225
|
+
readonly maxLines: {
|
|
1226
|
+
readonly 1: {
|
|
1227
|
+
readonly display: "block";
|
|
1228
|
+
readonly minWidth: 0;
|
|
1229
|
+
readonly overflowX: "clip";
|
|
1230
|
+
readonly overflowY: "visible";
|
|
1231
|
+
readonly whiteSpace: "nowrap";
|
|
1232
|
+
readonly textOverflow: "ellipsis";
|
|
1233
|
+
readonly textAlign: "start";
|
|
1234
|
+
};
|
|
1235
|
+
readonly 2: {
|
|
1236
|
+
readonly display: "-webkit-box";
|
|
1237
|
+
readonly WebkitBoxOrient: "vertical";
|
|
1238
|
+
readonly WebkitLineClamp: 2;
|
|
1239
|
+
readonly lineClamp: 2;
|
|
1240
|
+
readonly overflow: "hidden";
|
|
1241
|
+
readonly overflowWrap: "anywhere";
|
|
1242
|
+
};
|
|
1243
|
+
readonly 3: {
|
|
1244
|
+
readonly display: "-webkit-box";
|
|
1245
|
+
readonly WebkitBoxOrient: "vertical";
|
|
1246
|
+
readonly WebkitLineClamp: 3;
|
|
1247
|
+
readonly lineClamp: 3;
|
|
1248
|
+
readonly overflow: "hidden";
|
|
1249
|
+
readonly overflowWrap: "anywhere";
|
|
1250
|
+
};
|
|
1251
|
+
readonly 4: {
|
|
1252
|
+
readonly display: "-webkit-box";
|
|
1253
|
+
readonly WebkitBoxOrient: "vertical";
|
|
1254
|
+
readonly WebkitLineClamp: 4;
|
|
1255
|
+
readonly lineClamp: 4;
|
|
1256
|
+
readonly overflow: "hidden";
|
|
1257
|
+
readonly overflowWrap: "anywhere";
|
|
1258
|
+
};
|
|
1259
|
+
readonly 5: {
|
|
1260
|
+
readonly display: "-webkit-box";
|
|
1261
|
+
readonly WebkitBoxOrient: "vertical";
|
|
1262
|
+
readonly WebkitLineClamp: 5;
|
|
1263
|
+
readonly lineClamp: 5;
|
|
1264
|
+
readonly overflow: "hidden";
|
|
1265
|
+
readonly overflowWrap: "anywhere";
|
|
1266
|
+
};
|
|
1267
|
+
readonly 6: {
|
|
1268
|
+
readonly display: "-webkit-box";
|
|
1269
|
+
readonly WebkitBoxOrient: "vertical";
|
|
1270
|
+
readonly WebkitLineClamp: 6;
|
|
1271
|
+
readonly lineClamp: 6;
|
|
1272
|
+
readonly overflow: "hidden";
|
|
1273
|
+
readonly overflowWrap: "anywhere";
|
|
1274
|
+
};
|
|
1275
|
+
};
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
/** Props a `Typography` handles itself, whatever the tag it renders. */
|
|
1279
|
+
declare type TypographyOwnProps<Tag extends TypographyTag = TypographyTag> = TypographyStyleProps & Readonly<{
|
|
1280
|
+
/** Tag of the rendered element, which sets its style; `p` when absent. */
|
|
1281
|
+
as?: Tag;
|
|
1282
|
+
/** Renders the single child in place of the element, without tag style. */
|
|
1283
|
+
asChild?: boolean | undefined;
|
|
1284
|
+
/** Classes added after the generated ones. */
|
|
1285
|
+
className?: string | undefined;
|
|
1286
|
+
/** Inline styles, merged after the sizing and color variables, so they prevail. */
|
|
1287
|
+
style?: CSSProperties | undefined;
|
|
1288
|
+
}>;
|
|
1289
|
+
|
|
1290
|
+
/** Token style properties of a `Typography`, in their emission order. */
|
|
1291
|
+
declare const typographyProperties: {
|
|
1292
|
+
readonly textAlign: readonly ["start", "center", "end", "justify"];
|
|
1293
|
+
readonly textTransform: readonly ["none", "uppercase", "lowercase", "capitalize"];
|
|
1294
|
+
readonly textDecoration: readonly ["none", "underline", "line-through"];
|
|
1295
|
+
readonly whiteSpace: readonly ["normal", "nowrap", "pre", "pre-wrap", "pre-line", "break-spaces"];
|
|
1296
|
+
readonly textWrap: readonly ["wrap", "nowrap", "balance", "pretty"];
|
|
1297
|
+
readonly wordBreak: readonly ["normal", "break-all", "keep-all"];
|
|
1298
|
+
readonly overflowWrap: readonly ["normal", "break-word", "anywhere"];
|
|
1299
|
+
readonly fontFamily: {
|
|
1300
|
+
readonly sans: `var(--${string})`;
|
|
1301
|
+
readonly serif: `var(--${string})`;
|
|
1302
|
+
readonly mono: `var(--${string})`;
|
|
1303
|
+
};
|
|
1304
|
+
readonly fontSize: {
|
|
1305
|
+
readonly 10: `var(--${string})`;
|
|
1306
|
+
readonly 12: `var(--${string})`;
|
|
1307
|
+
readonly 14: `var(--${string})`;
|
|
1308
|
+
readonly 16: `var(--${string})`;
|
|
1309
|
+
readonly 18: `var(--${string})`;
|
|
1310
|
+
readonly 20: `var(--${string})`;
|
|
1311
|
+
readonly 24: `var(--${string})`;
|
|
1312
|
+
readonly 28: `var(--${string})`;
|
|
1313
|
+
readonly 32: `var(--${string})`;
|
|
1314
|
+
readonly 36: `var(--${string})`;
|
|
1315
|
+
readonly 40: `var(--${string})`;
|
|
1316
|
+
readonly 48: `var(--${string})`;
|
|
1317
|
+
readonly 60: `var(--${string})`;
|
|
1318
|
+
readonly 72: `var(--${string})`;
|
|
1319
|
+
};
|
|
1320
|
+
readonly fontWeight: {
|
|
1321
|
+
readonly regular: `var(--${string})`;
|
|
1322
|
+
readonly medium: `var(--${string})`;
|
|
1323
|
+
readonly semibold: `var(--${string})`;
|
|
1324
|
+
readonly bold: `var(--${string})`;
|
|
1325
|
+
};
|
|
1326
|
+
readonly fontStyle: readonly ["normal", "italic"];
|
|
1327
|
+
readonly lineHeight: {
|
|
1328
|
+
readonly none: `var(--${string})`;
|
|
1329
|
+
readonly tight: `var(--${string})`;
|
|
1330
|
+
readonly snug: `var(--${string})`;
|
|
1331
|
+
readonly normal: `var(--${string})`;
|
|
1332
|
+
readonly relaxed: `var(--${string})`;
|
|
1333
|
+
};
|
|
1334
|
+
readonly letterSpacing: {
|
|
1335
|
+
readonly tighter: `var(--${string})`;
|
|
1336
|
+
readonly tight: `var(--${string})`;
|
|
1337
|
+
readonly normal: `var(--${string})`;
|
|
1338
|
+
readonly wide: `var(--${string})`;
|
|
1339
|
+
readonly wider: `var(--${string})`;
|
|
1340
|
+
readonly widest: `var(--${string})`;
|
|
1341
|
+
};
|
|
1342
|
+
};
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Props of a `Typography` rendering `Tag`: its style props, then the
|
|
1346
|
+
* attributes, events and `ref` of that tag. `color` replaces the native
|
|
1347
|
+
* attribute of the same name.
|
|
1348
|
+
*/
|
|
1349
|
+
export declare type TypographyProps<Tag extends TypographyTag = 'p'> = TypographyOwnProps<Tag> & ElementModeProps & Readonly<Omit<ComponentPropsWithRef<Tag>, keyof TypographyOwnProps>>;
|
|
1350
|
+
|
|
1351
|
+
/**
|
|
1352
|
+
* Style props of a `Typography`, each overriding the default style of the
|
|
1353
|
+
* rendered tag; none reaches the DOM as an attribute.
|
|
1354
|
+
*/
|
|
1355
|
+
export declare type TypographyStyleProps = TypographyTokenStyleProps & SizingStyleProps & Pick<ColorStyleProps, 'color'>;
|
|
1356
|
+
|
|
1357
|
+
/** Text tag a `Typography` can render. */
|
|
1358
|
+
export declare type TypographyTag = TextTag;
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* Token-based style props of a `Typography`: the shared ones, then those of
|
|
1362
|
+
* text, fonts and truncation.
|
|
1363
|
+
*/
|
|
1364
|
+
declare type TypographyTokenStyleProps = CommonStyleProps & TokenStyleProps<typeof typographyProperties, Record<never, never>> & TokenStyleProps<typeof typographyComposites, Record<never, never>>;
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Hides its content from the screen while keeping it in the accessibility
|
|
1368
|
+
* tree, so screen readers still announce it: a skip link, the end of a
|
|
1369
|
+
* visible text that an `aria-label` would replace, a heading that
|
|
1370
|
+
* structures a page without being displayed, or the label of a field. A
|
|
1371
|
+
* button that only shows an icon needs none: an `aria-label` names it. It
|
|
1372
|
+
* renders any HTML tag, a `span` by default, out of the flow, one pixel
|
|
1373
|
+
* wide and clipped to nothing. The hiding styles sit in the base cascade
|
|
1374
|
+
* layer.
|
|
1375
|
+
*
|
|
1376
|
+
* With `focusable`, the element shows again while it or one of its
|
|
1377
|
+
* descendants has the focus, with the styles its own classes give it: a
|
|
1378
|
+
* "Skip to content" link appears when reached with the keyboard. It does not
|
|
1379
|
+
* make the element focusable: render a focusable element, such as a link, or
|
|
1380
|
+
* wrap one.
|
|
1381
|
+
*
|
|
1382
|
+
* It takes no style props. Every other prop (attributes, events, `ref`) is
|
|
1383
|
+
* typed after the tag and forwarded to the element; the consumer's
|
|
1384
|
+
* `className` follows the hiding class, and `style` is kept as given. With
|
|
1385
|
+
* `asChild`, nothing is rendered of its own: the single child is, with the
|
|
1386
|
+
* hiding class, other props and `ref` merged onto it (see `AsChildProps`),
|
|
1387
|
+
* for instance a router link used as a skip link.
|
|
1388
|
+
*
|
|
1389
|
+
* @param props `focusable`, `as` or `asChild`, and the native props of the
|
|
1390
|
+
* rendered tag.
|
|
1391
|
+
* @returns The visually hidden element.
|
|
1392
|
+
* @throws {Error} With `asChild`, when the children are not a single
|
|
1393
|
+
* element.
|
|
1394
|
+
*/
|
|
1395
|
+
export declare const VisuallyHidden: <Tag extends VisuallyHiddenTag = "span">(props: VisuallyHiddenProps<Tag> | VisuallyHiddenAsChildProps) => ReactElement;
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Props of a `VisuallyHidden` rendering its single child (`asChild`)
|
|
1399
|
+
* instead of an element: `focusable`, without `as`, merged onto the child
|
|
1400
|
+
* with the hiding class.
|
|
1401
|
+
*/
|
|
1402
|
+
export declare type VisuallyHiddenAsChildProps = AsChildProps<VisuallyHiddenOwnProps>;
|
|
1403
|
+
|
|
1404
|
+
/** Props a `VisuallyHidden` handles itself, whatever the tag it renders. */
|
|
1405
|
+
declare type VisuallyHiddenOwnProps<Tag extends VisuallyHiddenTag = VisuallyHiddenTag> = Readonly<{
|
|
1406
|
+
/** Tag of the rendered element; a `span` when absent. */
|
|
1407
|
+
as?: Tag;
|
|
1408
|
+
/** Renders the single child in place of the element, with the props merged onto it. */
|
|
1409
|
+
asChild?: boolean | undefined;
|
|
1410
|
+
/** Shows the element while it or a descendant has the focus when true; always hidden when absent. */
|
|
1411
|
+
focusable?: boolean | undefined;
|
|
1412
|
+
/** Classes added after the hiding class. */
|
|
1413
|
+
className?: string | undefined;
|
|
1414
|
+
/** Inline styles; a property they set prevails over the hiding styles. */
|
|
1415
|
+
style?: CSSProperties | undefined;
|
|
1416
|
+
}>;
|
|
1417
|
+
|
|
1418
|
+
/**
|
|
1419
|
+
* Props of a `VisuallyHidden` rendering `Tag`: `focusable`, then the
|
|
1420
|
+
* attributes, events and `ref` of that tag. It takes no style props.
|
|
1421
|
+
*/
|
|
1422
|
+
export declare type VisuallyHiddenProps<Tag extends VisuallyHiddenTag = 'span'> = VisuallyHiddenOwnProps<Tag> & ElementModeProps & Readonly<Omit<ComponentPropsWithRef<Tag>, keyof VisuallyHiddenOwnProps>>;
|
|
1423
|
+
|
|
1424
|
+
/** HTML tag a `VisuallyHidden` can render: any of them, no SVG tag. */
|
|
1425
|
+
export declare type VisuallyHiddenTag = HTMLElementType;
|
|
1426
|
+
|
|
1427
|
+
export { }
|