reshaped 3.7.4 → 3.8.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG-extra.md +3 -0
- package/CHANGELOG.md +40 -55
- package/LICENSE.md +1 -1
- package/README.md +24 -0
- package/dist/bundle.css +1 -1
- package/dist/bundle.js +10 -10
- package/dist/cjs/themes/index.d.ts +1 -0
- package/dist/cjs/themes/index.js +3 -1
- package/dist/components/Accordion/Accordion.types.d.ts +13 -2
- package/dist/components/ActionBar/ActionBar.types.d.ts +10 -0
- package/dist/components/Actionable/Actionable.types.d.ts +14 -0
- package/dist/components/Alert/Alert.types.d.ts +11 -0
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +7 -0
- package/dist/components/Avatar/Avatar.types.d.ts +18 -0
- package/dist/components/Avatar/tests/Avatar.stories.js +1 -1
- package/dist/components/Badge/Badge.types.d.ts +25 -1
- package/dist/components/Badge/tests/Badge.test.stories.js +3 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +11 -0
- package/dist/components/Button/Button.types.d.ts +20 -0
- package/dist/components/Calendar/Calendar.types.d.ts +31 -0
- package/dist/components/Calendar/tests/Calendar.stories.js +1 -1
- package/dist/components/Card/Card.types.d.ts +12 -0
- package/dist/components/Carousel/Carousel.types.d.ts +13 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +19 -0
- package/dist/components/Checkbox/tests/Checkbox.stories.js +1 -1
- package/dist/components/CheckboxGroup/CheckboxGroup.types.d.ts +10 -0
- package/dist/components/Container/Container.types.d.ts +11 -1
- package/dist/components/Dismissible/Dismissible.types.d.ts +10 -0
- package/dist/components/Divider/Divider.types.d.ts +6 -0
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +3 -0
- package/dist/components/FileUpload/FileUpload.types.d.ts +10 -0
- package/dist/components/Flyout/Flyout.types.d.ts +38 -0
- package/dist/components/Flyout/FlyoutContent.js +1 -1
- package/dist/components/FormControl/FormControl.types.d.ts +9 -0
- package/dist/components/Grid/Grid.js +3 -1
- package/dist/components/Grid/Grid.module.css +1 -1
- package/dist/components/Grid/Grid.types.d.ts +31 -0
- package/dist/components/Grid/tests/Grid.stories.d.ts +3 -0
- package/dist/components/Grid/tests/Grid.stories.js +39 -1
- package/dist/components/Hidden/Hidden.types.d.ts +4 -0
- package/dist/components/HiddenVisually/HiddenVisually.types.d.ts +1 -0
- package/dist/components/Hotkey/Hotkey.types.d.ts +4 -0
- package/dist/components/Icon/Icon.types.d.ts +6 -0
- package/dist/components/Image/Image.types.d.ts +15 -0
- package/dist/components/Link/Link.types.d.ts +7 -0
- package/dist/components/Loader/Loader.types.d.ts +5 -0
- package/dist/components/MenuItem/MenuItem.types.d.ts +13 -1
- package/dist/components/Modal/Modal.types.d.ts +19 -0
- package/dist/components/NumberField/NumberField.types.d.ts +10 -0
- package/dist/components/Overlay/Overlay.types.d.ts +13 -0
- package/dist/components/Pagination/Pagination.types.d.ts +11 -29
- package/dist/components/PinField/PinField.types.d.ts +13 -0
- package/dist/components/Popover/Popover.types.d.ts +3 -0
- package/dist/components/Progress/Progress.types.d.ts +9 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.js +13 -84
- package/dist/components/ProgressIndicator/ProgressIndicator.module.css +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.types.d.ts +8 -0
- package/dist/components/ProgressIndicator/tests/ProgressIndicator.stories.js +8 -1
- package/dist/components/Radio/Radio.types.d.ts +12 -0
- package/dist/components/RadioGroup/RadioGroup.types.d.ts +14 -0
- package/dist/components/Reshaped/Reshaped.types.d.ts +12 -0
- package/dist/components/Resizable/Resizable.types.d.ts +7 -0
- package/dist/components/Scrim/Scrim.types.d.ts +6 -1
- package/dist/components/ScrollArea/ScrollArea.types.d.ts +7 -0
- package/dist/components/Select/Select.types.d.ts +27 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +2 -0
- package/dist/components/Slider/Slider.types.d.ts +56 -0
- package/dist/components/Stepper/Stepper.types.d.ts +13 -0
- package/dist/components/Switch/Switch.types.d.ts +16 -0
- package/dist/components/Table/Table.types.d.ts +29 -0
- package/dist/components/Tabs/Tabs.module.css +1 -1
- package/dist/components/Tabs/Tabs.types.d.ts +24 -0
- package/dist/components/Tabs/TabsItem.js +2 -2
- package/dist/components/Tabs/tests/Tabs.stories.js +6 -6
- package/dist/components/Text/Text.types.d.ts +12 -0
- package/dist/components/TextArea/TextArea.types.d.ts +17 -0
- package/dist/components/TextField/TextField.types.d.ts +29 -0
- package/dist/components/Theme/Theme.js +4 -1
- package/dist/components/Theme/Theme.types.d.ts +5 -0
- package/dist/components/Timeline/Timeline.types.d.ts +7 -0
- package/dist/components/Toast/Toast.types.d.ts +18 -0
- package/dist/components/ToggleButton/ToggleButton.types.d.ts +9 -0
- package/dist/components/ToggleButtonGroup/ToggleButtonGroup.types.d.ts +8 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +5 -0
- package/dist/components/View/View.types.d.ts +56 -1
- package/dist/components/_private/Aligner/Aligner.types.d.ts +6 -0
- package/dist/themes/index.d.ts +1 -0
- package/dist/themes/index.js +1 -0
- package/package.json +21 -17
- package/LICENSE-SOURCE.md +0 -40
- package/dist/components/Grid/tests/Grid.test.stories.d.ts +0 -23
- package/dist/components/Grid/tests/Grid.test.stories.js +0 -42
@@ -1,82 +1,138 @@
|
|
1
1
|
import type * as G from "../../types/global";
|
2
2
|
export type SingleChangeArgs = {
|
3
|
+
/** Value of the slider, enables controlled mode */
|
3
4
|
value: number;
|
5
|
+
/** Minimum value of the slider */
|
4
6
|
minValue?: never;
|
7
|
+
/** Maximum value of the slider */
|
5
8
|
maxValue?: never;
|
9
|
+
/** Name of the slider input element */
|
6
10
|
name: string;
|
11
|
+
/** Name of the slider min value input element, overrides the name */
|
7
12
|
minName?: never;
|
13
|
+
/** Name of the slider max value input element, overrides the name */
|
8
14
|
maxName?: never;
|
9
15
|
};
|
10
16
|
export type RangeChangeArgs = {
|
17
|
+
/** Value of the slider, enables controlled mode */
|
11
18
|
value?: never;
|
19
|
+
/** Minimum value of the slider */
|
12
20
|
minValue: number;
|
21
|
+
/** Maximum value of the slider */
|
13
22
|
maxValue: number;
|
23
|
+
/** Name of the slider input element, overrides the name */
|
14
24
|
name: string;
|
25
|
+
/** Name of the slider min value input element, overrides the name */
|
15
26
|
minName?: never;
|
27
|
+
/** Name of the slider max value input element, overrides the name */
|
16
28
|
maxName?: never;
|
17
29
|
};
|
18
30
|
export type NameRangeChangeArgs = {
|
31
|
+
/** Value of the slider, enables controlled mode */
|
19
32
|
value?: never;
|
33
|
+
/** Minimum value of the slider */
|
20
34
|
minValue: number;
|
35
|
+
/** Maximum value of the slider */
|
21
36
|
maxValue: number;
|
37
|
+
/** Name of the slider input element */
|
22
38
|
name?: never;
|
39
|
+
/** Name of the slider min value input element, overrides the name */
|
23
40
|
minName: string;
|
41
|
+
/** Name of the slider max value input element, overrides the name */
|
24
42
|
maxName: string;
|
25
43
|
};
|
26
44
|
type SingleSelectionProps = {
|
45
|
+
/** Enables range slider with two thumbs */
|
27
46
|
range?: false;
|
47
|
+
/** Name of the slider input element */
|
28
48
|
name: string;
|
49
|
+
/** Name of the slider min value input element, overrides the name */
|
29
50
|
minName?: never;
|
51
|
+
/** Name of the slider max value input element, overrides the name */
|
30
52
|
maxName?: never;
|
53
|
+
/** Callback when the slider value changes */
|
31
54
|
onChange?: (args: SingleChangeArgs) => void;
|
55
|
+
/** Callback when the user commits the change by releasing the thumb */
|
32
56
|
onChangeCommit?: (args: SingleChangeArgs) => void;
|
33
57
|
};
|
34
58
|
type RangeSelectionProps = {
|
59
|
+
/** Enables range slider with two thumbs */
|
35
60
|
range: true;
|
61
|
+
/** Name of the slider input element */
|
36
62
|
name: string;
|
63
|
+
/** Name of the slider min value input element, overrides the name */
|
37
64
|
minName?: never;
|
65
|
+
/** Name of the slider max value input element, overrides the name */
|
38
66
|
maxName?: never;
|
67
|
+
/** Callback when the slider value changes */
|
39
68
|
onChange?: (args: RangeChangeArgs) => void;
|
69
|
+
/** Callback when the user commits the change by releasing the thumbs */
|
40
70
|
onChangeCommit?: (args: RangeChangeArgs) => void;
|
41
71
|
};
|
42
72
|
type NameRangeSelectionProps = {
|
73
|
+
/** Enables range slider with two thumbs */
|
43
74
|
range: true;
|
75
|
+
/** Name of the slider input element */
|
44
76
|
name?: never;
|
77
|
+
/** Name of the slider min value input element, overrides the name */
|
45
78
|
minName: string;
|
79
|
+
/** Name of the slider max value input element, overrides the name */
|
46
80
|
maxName: string;
|
81
|
+
/** Callback when the slider value changes */
|
47
82
|
onChange?: (args: RangeChangeArgs) => void;
|
83
|
+
/** Callback when the user commits the change by releasing the thumbs */
|
48
84
|
onChangeCommit?: (args: RangeChangeArgs) => void;
|
49
85
|
};
|
50
86
|
type ControlledSingleProps = {
|
87
|
+
/** Value of the slider, enables controlled mode */
|
51
88
|
value: number;
|
89
|
+
/** Default value of the slider, enables uncontrolled mode */
|
52
90
|
defaultValue?: never;
|
53
91
|
};
|
54
92
|
type ControlledRangeProps = {
|
93
|
+
/** Minimum value of the slider */
|
55
94
|
minValue: number;
|
95
|
+
/** Maximum value of the slider */
|
56
96
|
maxValue: number;
|
97
|
+
/** Default minimum value of the slider, enables uncontrolled mode */
|
57
98
|
defaultMinValue?: never;
|
99
|
+
/** Default maximum value of the slider, enables uncontrolled mode */
|
58
100
|
defaultMaxValue?: never;
|
59
101
|
};
|
60
102
|
type UncontrolledSingleProps = {
|
103
|
+
/** Value of the slider, enables controlled mode */
|
61
104
|
value?: never;
|
105
|
+
/** Default value of the slider, enables uncontrolled mode */
|
62
106
|
defaultValue?: number;
|
63
107
|
};
|
64
108
|
type UncontrolledRangeProps = {
|
109
|
+
/** Minimum value of the slider */
|
65
110
|
minValue?: never;
|
111
|
+
/** Maximum value of the slider */
|
66
112
|
maxValue?: never;
|
113
|
+
/** Default minimum value of the slider, enables uncontrolled mode */
|
67
114
|
defaultMinValue?: number;
|
115
|
+
/** Default maximum value of the slider, enables uncontrolled mode */
|
68
116
|
defaultMaxValue?: number;
|
69
117
|
};
|
70
118
|
type BaseProps = {
|
119
|
+
/** Step of the slider */
|
71
120
|
step?: number;
|
121
|
+
/** Disable the slider user interaction */
|
72
122
|
disabled?: boolean;
|
123
|
+
/** Minimum value of the slider */
|
73
124
|
min?: number;
|
125
|
+
/** Maximum value of the slider */
|
74
126
|
max?: number;
|
127
|
+
/** Orientation of the slider */
|
75
128
|
orientation?: "vertical" | "horizontal";
|
129
|
+
/** Render a custom value in the thumb tooltip */
|
76
130
|
renderValue?: ((args: {
|
77
131
|
value: number;
|
78
132
|
}) => string) | false;
|
133
|
+
/** Additional classname for the root element */
|
79
134
|
className?: G.ClassName;
|
135
|
+
/** Additional attributes for the root element */
|
80
136
|
attributes?: G.Attributes<"div">;
|
81
137
|
};
|
82
138
|
export type ControlledProps = BaseProps & ((ControlledSingleProps & SingleSelectionProps) | (ControlledRangeProps & (RangeSelectionProps | NameRangeSelectionProps)));
|
@@ -1,20 +1,33 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type * as G from "../../types/global";
|
3
3
|
export type Props = {
|
4
|
+
/** Id of the item to display as active */
|
4
5
|
activeId?: string | number;
|
6
|
+
/** Display variant for the item label */
|
5
7
|
labelDisplay?: G.Responsive<"inline" | "hidden">;
|
8
|
+
/** Node for inserting children */
|
6
9
|
children?: React.ReactNode;
|
10
|
+
/** Direction of the stepper */
|
7
11
|
direction?: "row" | "column";
|
12
|
+
/** Additional classname for the root element */
|
8
13
|
className?: G.ClassName;
|
14
|
+
/** Additional attributes for the root element */
|
9
15
|
attributes?: G.Attributes<"div">;
|
10
16
|
};
|
11
17
|
export type ItemProps = {
|
18
|
+
/** Id of the item, used for selecting the active item */
|
12
19
|
id?: string;
|
20
|
+
/** Indicate that the item is completed */
|
13
21
|
completed?: boolean;
|
22
|
+
/** Title of the item */
|
14
23
|
title?: React.ReactNode;
|
24
|
+
/** Subtitle of the item */
|
15
25
|
subtitle?: React.ReactNode;
|
26
|
+
/** Node for inserting children */
|
16
27
|
children?: React.ReactNode;
|
28
|
+
/** Additional classname for the root element */
|
17
29
|
className?: G.ClassName;
|
30
|
+
/** Additional attributes for the root element */
|
18
31
|
attributes?: G.Attributes<"div">;
|
19
32
|
};
|
20
33
|
export type ItemPrivateProps = ItemProps & {
|
@@ -1,25 +1,41 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import type * as G from "../../types/global";
|
3
3
|
type BaseProps = {
|
4
|
+
/** Node for inserting children */
|
4
5
|
children?: React.ReactNode;
|
6
|
+
/** Unique identifier for the switch */
|
5
7
|
id?: string;
|
8
|
+
/** Name of the switch input element */
|
6
9
|
name: string;
|
10
|
+
/** Disable the switch user interaction */
|
7
11
|
disabled?: boolean;
|
12
|
+
/** Reverse the children position */
|
8
13
|
reversed?: boolean;
|
14
|
+
/** Component size */
|
9
15
|
size?: G.Responsive<"medium" | "small" | "large">;
|
16
|
+
/** Callback when the switch value changes */
|
10
17
|
onChange?: G.ChangeHandler<boolean>;
|
18
|
+
/** Callback when the switch is focused */
|
11
19
|
onFocus?: (e: React.FocusEvent) => void;
|
20
|
+
/** Callback when the switch is blurred */
|
12
21
|
onBlur?: (e: React.FocusEvent) => void;
|
22
|
+
/** Additional classname for the root element */
|
13
23
|
className?: G.ClassName;
|
24
|
+
/** Additional attributes for the root element */
|
14
25
|
attributes?: G.Attributes<"label">;
|
26
|
+
/** Additional attributes for the input element */
|
15
27
|
inputAttributes?: G.Attributes<"input">;
|
16
28
|
};
|
17
29
|
export type ControlledProps = BaseProps & {
|
30
|
+
/** Default value of the switch, enables uncontrolled mode */
|
18
31
|
defaultChecked?: never;
|
32
|
+
/** Value of the switch, enables controlled mode */
|
19
33
|
checked: boolean;
|
20
34
|
};
|
21
35
|
export type UncontrolledProps = BaseProps & {
|
36
|
+
/** Default value of the switch, enables uncontrolled mode */
|
22
37
|
defaultChecked?: boolean;
|
38
|
+
/** Value of the switch, enables controlled mode */
|
23
39
|
checked?: boolean;
|
24
40
|
};
|
25
41
|
export type Props = ControlledProps | UncontrolledProps;
|
@@ -1,44 +1,73 @@
|
|
1
1
|
import React from "react";
|
2
2
|
import type * as G from "../../types/global";
|
3
3
|
export type Props = {
|
4
|
+
/** Add border around the table */
|
4
5
|
border?: boolean;
|
6
|
+
/** Add border between the table columns */
|
5
7
|
columnBorder?: boolean;
|
8
|
+
/** Node for inserting children */
|
6
9
|
children: React.ReactNode;
|
10
|
+
/** Additional classname for the root element */
|
7
11
|
className?: G.ClassName;
|
12
|
+
/** Additional attributes for the root element */
|
8
13
|
attributes?: G.Attributes<"div">;
|
9
14
|
};
|
10
15
|
export type RowProps = {
|
16
|
+
/** Indicate that the row is selected */
|
11
17
|
highlighted?: boolean;
|
18
|
+
/** Callback when the row is clicked */
|
12
19
|
onClick?: (e: React.MouseEvent) => void;
|
20
|
+
/** Node for inserting children */
|
13
21
|
children: React.ReactNode;
|
22
|
+
/** Additional classname for the row element */
|
14
23
|
className?: G.ClassName;
|
24
|
+
/** Additional attributes for the row element */
|
15
25
|
attributes?: G.Attributes<"tr">;
|
16
26
|
};
|
17
27
|
export type CellProps = {
|
28
|
+
/** Align the cell content */
|
18
29
|
align?: "start" | "center" | "end";
|
30
|
+
/** Align the cell content vertically */
|
19
31
|
verticalAlign?: "start" | "center" | "end";
|
32
|
+
/** Merge the cell with the cells below */
|
20
33
|
rowSpan?: number;
|
34
|
+
/** Merge the cell with the cells to the right */
|
21
35
|
colSpan?: number;
|
36
|
+
/** Padding of the cell */
|
22
37
|
padding?: number;
|
38
|
+
/** Padding of the cell inline, base unit token number multiplier */
|
23
39
|
paddingInline?: number;
|
40
|
+
/** Padding of the cell block, base unit token number multiplier */
|
24
41
|
paddingBlock?: number;
|
42
|
+
/** Width of the cell, literal css value or a base unit token number multiplier */
|
25
43
|
width?: "auto" | string | number;
|
44
|
+
/** Minimum width of the cell, literal css value or a base unit token number multiplier */
|
26
45
|
minWidth?: string | number;
|
46
|
+
/** Node for inserting children */
|
27
47
|
children?: React.ReactNode;
|
48
|
+
/** Additional classname for the cell element */
|
28
49
|
className?: G.ClassName;
|
50
|
+
/** Additional attributes for the cell element */
|
29
51
|
attributes?: G.Attributes<"td">;
|
30
52
|
};
|
31
53
|
export type HeadingProps = CellProps & {
|
54
|
+
/** Additional attributes for the heading element */
|
32
55
|
attributes?: G.Attributes<"th">;
|
33
56
|
};
|
34
57
|
export type BodyProps = {
|
58
|
+
/** Node for inserting children */
|
35
59
|
children: React.ReactNode;
|
60
|
+
/** Additional classname for the body element */
|
36
61
|
className?: G.ClassName;
|
62
|
+
/** Additional attributes for the body element */
|
37
63
|
attributes?: G.Attributes<"tbody">;
|
38
64
|
};
|
39
65
|
export type HeadProps = {
|
66
|
+
/** Node for inserting children */
|
40
67
|
children: React.ReactNode;
|
68
|
+
/** Additional classname for the head element */
|
41
69
|
className?: G.ClassName;
|
70
|
+
/** Additional attributes for the head element */
|
42
71
|
attributes?: G.Attributes<"thead">;
|
43
72
|
};
|
44
73
|
export type PrivateCellProps = CellProps & {
|
@@ -1 +1 @@
|
|
1
|
-
@property --rs-tabs-mid-l{syntax:"<length>";initial-value:-24px;inherits:false}@property --rs-tabs-stop-l{syntax:"<length>";initial-value:0;inherits:false}@property --rs-tabs-stop-r{syntax:"<length-percentage>";initial-value:100%;inherits:false}@property --rs-tabs-mid-r{syntax:"<length-percentage>";initial-value:calc(100% + 24px);inherits:false}.root{box-sizing:initial;isolation:isolate;max-width:100%}.list,.root{position:relative}.list{--rs-tabs-gap:var(--rs-unit-x6);gap:var(--rs-tabs-gap)}.inner:after{background-color:var(--rs-color-border-neutral-faded);content:"";position:absolute;z-index:2}.listItem{flex-shrink:0;position:relative}.button{overflow:hidden;position:relative;
|
1
|
+
@property --rs-tabs-mid-l{syntax:"<length>";initial-value:-24px;inherits:false}@property --rs-tabs-stop-l{syntax:"<length>";initial-value:0;inherits:false}@property --rs-tabs-stop-r{syntax:"<length-percentage>";initial-value:100%;inherits:false}@property --rs-tabs-mid-r{syntax:"<length-percentage>";initial-value:calc(100% + 24px);inherits:false}.root{box-sizing:initial;isolation:isolate;max-width:100%}.list,.root{position:relative}.list{--rs-tabs-gap:var(--rs-unit-x6);gap:var(--rs-tabs-gap)}.inner:after{background-color:var(--rs-color-border-neutral-faded);content:"";position:absolute;z-index:2}.listItem{flex-shrink:0;position:relative}.button{overflow:hidden;position:relative;z-index:1;-webkit-tap-highlight-color:transparent}.button,.buttonContent{border-radius:var(--rs-radius-medium);width:100%}.buttonContent{align-items:center;box-sizing:border-box;display:flex}.icon{color:inherit;transition:color var(--rs-duration-fast) var(--rs-easing-standard)}[data-rs-keyboard] .radio:focus+.buttonContent{box-shadow:var(--rs-focus-inset-shadow)}.icon:not(:last-child){margin-inline-end:var(--rs-unit-x2)}.item{color:var(--rs-color-foreground-neutral)}@media (hover:hover) and (pointer:fine){.item:not(.--item-disabled,.--item-active):hover{color:var(--rs-color-foreground-neutral-faded)}}.item.--item-disabled{color:var(--rs-color-foreground-disabled)}.--item-active:after{content:""}.--item-active:after,.selector{background:var(--rs-color-border-primary);border-radius:calc(var(--rs-radius-medium) - 1px);position:absolute;z-index:var(--rs-z-index-relative)}.selector{--rs-tab-selection-x:0;--rs-tab-selection-y:0;--rs-tab-selection-scale-x:0;--rs-tab-selection-scale-y:0;transform:translate(calc(var(--rs-tab-selection-x) * 1px),calc(var(--rs-tab-selection-y) * 1px)) translateZ(0);transform-origin:0 0}.--selector-hidden{visibility:hidden}.--selector-animated{transition:var(--rs-duration-medium) var(--rs-easing-decelerate);transition-property:transform,height,width;will-change:transform,height,width}.control{align-items:center;display:none;inset-block:0;opacity:0;pointer-events:none;position:absolute;transition:var(--rs-duration-medium) var(--rs-easing-decelerate);transition-property:opacity,transform;z-index:var(--rs-z-index-relative)}.control.control--active{opacity:1;pointer-events:all}[dir=rtl] .control{transform:scaleX(-1)}.control--next{inset-inline-end:0}.control--prev{inset-inline-start:0}.panel{outline:none}[data-rs-keyboard] .panel:focus{box-shadow:var(--rs-focus-shadow)}.--panel-hidden{display:none}.--scrollable .inner{overflow:auto;overflow:-moz-scrollbars-none;scrollbar-width:none;-ms-overflow-style:none;mask-image:linear-gradient(to right,transparent 0,transparent var(--rs-tabs-mid-l),#000 var(--rs-tabs-stop-l),#000 var(--rs-tabs-stop-r),transparent var(--rs-tabs-mid-r),transparent 100%);transition:var(--rs-duration-medium) var(--rs-easing-decelerate);transition-property:--rs-tabs-stop-l,--rs-tabs-stop-r,--rs-tabs-mid-l,--rs-tabs-mid-r}.--scrollable .inner::-webkit-scrollbar{display:none}.--direction-row .inner{white-space:nowrap}.--direction-row .inner:after{bottom:0;height:1px;inset-inline:0}.--direction-row .list{align-items:center;display:inline-flex;flex-wrap:nowrap;vertical-align:top}.--direction-row .--item-active:after{height:2px;inset-inline:0;bottom:0}.--direction-row .selector{bottom:0;height:2px;left:0;width:calc(var(--rs-tab-selection-scale-x) * 1px)}.--direction-row .button{box-sizing:initial;margin:var(--rs-unit-x1) calc(var(--rs-unit-x2) * -1);padding:0 var(--rs-unit-x2)}.--direction-row .buttonContent{justify-content:center;padding:var(--rs-tabs-item-p-v) 0}.--direction-column .inner:after{height:100%;inset-block:0;inset-inline-end:0;width:1px}.--direction-column .list{--rs-tabs-gap:var(--rs-unit-x1);display:flex;flex-direction:column}.--direction-column .item{padding-inline-end:var(--rs-unit-x1)}.--direction-column .--item-active:after{bottom:0}.--direction-column .--item-active:after,.--direction-column .selector{height:100%;inset-inline-end:0;width:2px}.--direction-column .selector{height:calc(var(--rs-tab-selection-scale-y) * 1px);top:0}.--direction-column .button{margin-inline-start:calc(var(--rs-unit-x2) * -1);padding:var(--rs-unit-x2);width:calc(100% + var(--rs-unit-x1))}.--direction-column .buttonContent{justify-content:flex-start}.--variant-borderless .inner:after,.--variant-pills .inner:after,.--variant-pills-elevated .inner:after{content:none}.--variant-pills .button,.--variant-pills-elevated .button{margin:0;padding:0}.--variant-pills .buttonContent,.--variant-pills-elevated .buttonContent{margin:0;padding:var(--rs-tabs-item-p-v) var(--rs-tabs-item-p-h)}@media (hover:hover) and (pointer:fine){.--variant-pills .buttonContent:hover,.--variant-pills-elevated .buttonContent:hover{background:none}}.--variant-pills-elevated .buttonContent{padding:calc(var(--rs-tabs-item-p-v) - var(--rs-unit-x1) / 2) var(--rs-tabs-item-p-h)}.--variant-pills .list,.--variant-pills-elevated .list{--rs-tabs-gap:var(--rs-unit-x1)}.--variant-pills .selector,.--variant-pills-elevated .selector{background-color:var(--rs-color-background-neutral);height:calc(var(--rs-tab-selection-scale-y) * 1px);opacity:.6;width:calc(var(--rs-tab-selection-scale-x) * 1px);z-index:0}.--direction-column.--variant-pills .selector,.--direction-column.--variant-pills-elevated .selector{left:0}.--direction-row.--variant-pills .selector,.--direction-row.--variant-pills-elevated .selector{top:0}.--variant-pills .--item-active:after,.--variant-pills-elevated .--item-active:after{background-color:var(--rs-color-background-neutral);opacity:.6;z-index:0}.--direction-column.--variant-pills .--item-active:after,.--direction-column.--variant-pills-elevated .--item-active:after{width:100%}.--direction-row.--variant-pills .--item-active:after,.--direction-row.--variant-pills-elevated .--item-active:after{height:100%}.--variant-pills-elevated .list{background:var(--rs-color-background-neutral-faded);border:2px solid transparent;border-radius:var(--rs-radius-medium)}.--variant-pills-elevated .--item-active:after,.--variant-pills-elevated .selector{background:var(--rs-color-background-elevation-raised);box-shadow:var(--rs-shadow-raised);box-sizing:border-box;opacity:1}.--size-medium{--rs-tabs-item-p-v:var(--rs-unit-x2);--rs-tabs-item-p-h:var(--rs-unit-x3)}.--size-large{--rs-tabs-item-p-v:var(--rs-unit-x3);--rs-tabs-item-p-h:var(--rs-unit-x4)}.--item-width-equal{max-width:none}.--item-width-equal .inner{flex-wrap:wrap}.--item-width-equal .list{display:flex;overflow:hidden}.--item-width-equal .listItem{flex-basis:0;flex-grow:1;margin:0}.--fade-end .inner,[dir=rtl] .--fade-start .inner{--rs-tabs-mid-r:100%;--rs-tabs-stop-r:calc(100% - var(--rs-unit-x1) * 10)}.--fade-start .inner,[dir=rtl] .--fade-end .inner{--rs-tabs-mid-l:0px;--rs-tabs-stop-l:calc(var(--rs-unit-x1) * 10)}@media (pointer:fine){.control{display:flex}.--fade-end .inner,[dir=rtl] .--fade-start .inner{--rs-tabs-mid-r:calc(100% - var(--rs-unit-x1) * 4);--rs-tabs-stop-r:calc(100% - var(--rs-unit-x1) * 10)}.--fade-start .inner,[dir=rtl] .--fade-end .inner{--rs-tabs-mid-l:calc(var(--rs-unit-x1) * 4);--rs-tabs-stop-l:calc(var(--rs-unit-x1) * 10)}}
|
@@ -9,45 +9,69 @@ export type SelectionState = {
|
|
9
9
|
status: "idle" | "prepared" | "animated";
|
10
10
|
};
|
11
11
|
export type ItemProps = {
|
12
|
+
/** Value of the item used for the active item selection */
|
12
13
|
value: string;
|
14
|
+
/** Node for inserting children */
|
13
15
|
children?: React.ReactNode;
|
16
|
+
/** Icon of the item at the start position */
|
14
17
|
icon?: IconProps["svg"];
|
18
|
+
/** Link of the item, renders as an anchor element */
|
15
19
|
href?: string;
|
20
|
+
/** Disable the item user interaction */
|
16
21
|
disabled?: boolean;
|
22
|
+
/** Additional attributes for the item element */
|
17
23
|
attributes?: G.Attributes<"div">;
|
18
24
|
};
|
19
25
|
export type ListProps = {
|
26
|
+
/** Node for inserting children */
|
20
27
|
children?: React.ReactNode;
|
28
|
+
/** Additional classname for the list element */
|
21
29
|
className?: G.ClassName;
|
30
|
+
/** Additional attributes for the list element */
|
22
31
|
attributes?: G.Attributes<"div">;
|
23
32
|
};
|
24
33
|
export type PanelProps = {
|
34
|
+
/** Value of the panel used for the active panel selection */
|
25
35
|
value: string;
|
36
|
+
/** Node for inserting children */
|
26
37
|
children?: React.ReactNode;
|
38
|
+
/** Additional classname for the panel element */
|
27
39
|
className?: G.ClassName;
|
40
|
+
/** Additional attributes for the panel element */
|
28
41
|
attributes?: G.Attributes<"div">;
|
29
42
|
};
|
30
43
|
export type BaseProps = {
|
44
|
+
/** Node for inserting children */
|
31
45
|
children?: React.ReactNode;
|
46
|
+
/** Direction of the tab buttons */
|
32
47
|
direction?: "column" | "row";
|
48
|
+
/** Equal width for the tab buttons */
|
33
49
|
itemWidth?: "equal";
|
50
|
+
/** Render variant for component */
|
34
51
|
variant?: "bordered" | "borderless" | "pills" | "pills-elevated";
|
52
|
+
/** Component size */
|
35
53
|
size?: "medium" | "large";
|
54
|
+
/** Name of the tab buttons group when used as a form control */
|
36
55
|
name?: string;
|
56
|
+
/** Callback when the active tab value changes */
|
37
57
|
onChange?: (args: {
|
38
58
|
value: string;
|
39
59
|
name?: string;
|
40
60
|
}) => void;
|
41
61
|
};
|
42
62
|
export type ControlledProps = BaseProps & {
|
63
|
+
/** Value of the active tab, enables controlled mode */
|
43
64
|
value?: string;
|
65
|
+
/** Default value of the active tab, enables uncontrolled mode */
|
44
66
|
defaultValue?: never;
|
45
67
|
};
|
46
68
|
export type PrivateControlledProps = ControlledProps & {
|
47
69
|
onSilentChange: BaseProps["onChange"];
|
48
70
|
};
|
49
71
|
export type UncontrolledProps = BaseProps & {
|
72
|
+
/** Value of the active tab, enables controlled mode */
|
50
73
|
value?: never;
|
74
|
+
/** Default value of the active tab, enables uncontrolled mode */
|
51
75
|
defaultValue?: string;
|
52
76
|
};
|
53
77
|
export type Props = ControlledProps | UncontrolledProps;
|
@@ -16,7 +16,7 @@ const TabsItem = React.forwardRef((props, ref) => {
|
|
16
16
|
const itemRef = React.useRef(null);
|
17
17
|
const active = tabsValue === value;
|
18
18
|
const visuallySelected = active && selection.status === "idle";
|
19
|
-
const itemClassNames = classNames(s.item, visuallySelected && s["--item-active"]);
|
19
|
+
const itemClassNames = classNames(s.item, visuallySelected && s["--item-active"], disabled && s["--item-disabled"]);
|
20
20
|
const isFormControl = !!name;
|
21
21
|
const tabAttributes = {
|
22
22
|
role: "tab",
|
@@ -60,7 +60,7 @@ const TabsItem = React.forwardRef((props, ref) => {
|
|
60
60
|
return;
|
61
61
|
updateRefs();
|
62
62
|
}, [active, updateRefs]);
|
63
|
-
return (_jsx("div", { ...attributes, className: itemClassNames, ref: itemRef, role: "presentation", children: _jsxs(Actionable, { ref: ref, href: href, insetFocus: true, disabled: disabled, onClick: !name ? handleChange : undefined, className:
|
63
|
+
return (_jsx("div", { ...attributes, className: itemClassNames, ref: itemRef, role: "presentation", children: _jsxs(Actionable, { ref: ref, href: href, insetFocus: true, disabled: disabled, onClick: !name ? handleChange : undefined, className: s.button, as: name ? "label" : undefined, attributes: {
|
64
64
|
...(!isFormControl && tabAttributes),
|
65
65
|
"aria-controls": panelId,
|
66
66
|
id: buttonId,
|
@@ -60,17 +60,17 @@ export const variant = {
|
|
60
60
|
name: "variant",
|
61
61
|
render: () => (<Example>
|
62
62
|
<Example.Item title="variant: default">
|
63
|
-
<Tabs>
|
63
|
+
<Tabs defaultValue="0">
|
64
64
|
<Tabs.List>
|
65
|
-
<Tabs.Item value="
|
66
|
-
<Tabs.Item value="
|
65
|
+
<Tabs.Item value="0">Long item 2</Tabs.Item>
|
66
|
+
<Tabs.Item value="1">Item 1</Tabs.Item>
|
67
67
|
<Tabs.Item value="2">Very long item 3</Tabs.Item>
|
68
68
|
</Tabs.List>
|
69
69
|
</Tabs>
|
70
70
|
</Example.Item>
|
71
71
|
|
72
72
|
<Example.Item title="variant: pills">
|
73
|
-
<Tabs variant="pills">
|
73
|
+
<Tabs variant="pills" defaultValue="0">
|
74
74
|
<Tabs.List>
|
75
75
|
<Tabs.Item value="0">Item 1</Tabs.Item>
|
76
76
|
<Tabs.Item value="1">Long item 2</Tabs.Item>
|
@@ -80,7 +80,7 @@ export const variant = {
|
|
80
80
|
</Example.Item>
|
81
81
|
|
82
82
|
<Example.Item title="variant: pills-elevated">
|
83
|
-
<Tabs variant="pills-elevated">
|
83
|
+
<Tabs variant="pills-elevated" defaultValue="0">
|
84
84
|
<Tabs.List>
|
85
85
|
<Tabs.Item value="0">Item 1</Tabs.Item>
|
86
86
|
<Tabs.Item value="1">Long item 2</Tabs.Item>
|
@@ -90,7 +90,7 @@ export const variant = {
|
|
90
90
|
</Example.Item>
|
91
91
|
|
92
92
|
<Example.Item title="variant: borderless">
|
93
|
-
<Tabs variant="borderless">
|
93
|
+
<Tabs variant="borderless" defaultValue="0">
|
94
94
|
<Tabs.List>
|
95
95
|
<Tabs.Item value="0">Item 1</Tabs.Item>
|
96
96
|
<Tabs.Item value="1">Long item 2</Tabs.Item>
|
@@ -2,16 +2,28 @@ import type React from "react";
|
|
2
2
|
import type * as G from "../../types/global";
|
3
3
|
export type Variant = "title-1" | "title-2" | "title-3" | "title-4" | "title-5" | "title-6" | "featured-1" | "featured-2" | "featured-3" | "body-1" | "body-2" | "body-3" | "caption-1" | "caption-2";
|
4
4
|
export type Props<TagName extends keyof React.JSX.IntrinsicElements = "div"> = {
|
5
|
+
/** Text render variant */
|
5
6
|
variant?: G.Responsive<Variant>;
|
7
|
+
/** Text font weight */
|
6
8
|
weight?: G.Responsive<"regular" | "medium" | "bold">;
|
9
|
+
/** Render monospace font */
|
7
10
|
monospace?: boolean;
|
11
|
+
/** Text color, based on the color tokens */
|
8
12
|
color?: "neutral" | "neutral-faded" | "critical" | "warning" | "positive" | "primary" | "disabled";
|
13
|
+
/** Text alignment */
|
9
14
|
align?: G.Responsive<"start" | "center" | "end">;
|
15
|
+
/** CSS wrapping style */
|
10
16
|
wrap?: "balance";
|
17
|
+
/** CSS text decoration style */
|
11
18
|
decoration?: "line-through";
|
19
|
+
/** Maximum number of lines to render, used for text truncation */
|
12
20
|
maxLines?: number;
|
21
|
+
/** Render as a different html tag */
|
13
22
|
as?: TagName;
|
23
|
+
/** Node for inserting children */
|
14
24
|
children?: React.ReactNode;
|
25
|
+
/** Additional classname for the root element */
|
15
26
|
className?: G.ClassName;
|
27
|
+
/** Additional attributes for the root element */
|
16
28
|
attributes?: G.Attributes<TagName>;
|
17
29
|
};
|
@@ -3,18 +3,35 @@ import type * as G from "../../types/global";
|
|
3
3
|
import { type FormControlProps } from "../FormControl";
|
4
4
|
type Size = G.Responsive<"medium" | "large" | "xlarge">;
|
5
5
|
type BaseProps = {
|
6
|
+
/** Unique identifier for the text area */
|
6
7
|
id?: string;
|
8
|
+
/** Name of the text area input element */
|
7
9
|
name: string;
|
10
|
+
/** Component size
|
11
|
+
* @default "medium"
|
12
|
+
*/
|
8
13
|
size?: Size;
|
14
|
+
/** Component render variant
|
15
|
+
* @default "outline"
|
16
|
+
*/
|
9
17
|
variant?: "outline" | "faded" | "headless";
|
18
|
+
/** Disable the text area user interaction */
|
10
19
|
disabled?: boolean;
|
20
|
+
/** Placeholder text when there is no value */
|
11
21
|
placeholder?: string;
|
22
|
+
/** Callback when the text area value changes */
|
12
23
|
onChange?: G.ChangeHandler<string, React.ChangeEvent<HTMLTextAreaElement>>;
|
24
|
+
/** Callback when the text area is focused */
|
13
25
|
onFocus?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
26
|
+
/** Callback when the text area is blurred */
|
14
27
|
onBlur?: (e: React.FocusEvent<HTMLTextAreaElement>) => void;
|
28
|
+
/** Additional classname for the root element */
|
15
29
|
className?: G.ClassName;
|
30
|
+
/** Additional attributes for the root element */
|
16
31
|
attributes?: G.Attributes<"div">;
|
32
|
+
/** Additional attributes for the input element */
|
17
33
|
inputAttributes?: G.Attributes<"textarea">;
|
34
|
+
/** Enable or disable the text area resizing, supports auto-sizing */
|
18
35
|
resize?: "none" | "auto";
|
19
36
|
} & Pick<FormControlProps, "hasError">;
|
20
37
|
export type ControlledProps = BaseProps & {
|
@@ -4,34 +4,63 @@ import type { FormControlProps } from "../FormControl";
|
|
4
4
|
import type { IconProps } from "../Icon";
|
5
5
|
type Size = G.Responsive<"small" | "medium" | "large" | "xlarge">;
|
6
6
|
export type BaseProps = {
|
7
|
+
/** Unique identifier for the text field */
|
7
8
|
id?: string;
|
9
|
+
/** Name of the text field input element */
|
8
10
|
name: string;
|
11
|
+
/** Component size
|
12
|
+
* @default "medium"
|
13
|
+
*/
|
9
14
|
size?: Size;
|
15
|
+
/** Disable the text field user interaction */
|
10
16
|
disabled?: boolean;
|
17
|
+
/** Render in the focused state */
|
11
18
|
focused?: boolean;
|
19
|
+
/** Enable multiline text field wrapping */
|
12
20
|
multiline?: boolean;
|
21
|
+
/** Change border radius to be fully rounded */
|
13
22
|
rounded?: boolean;
|
23
|
+
/** Placeholder text when there is no value */
|
14
24
|
placeholder?: string;
|
25
|
+
/** Icon of the text field at the start position */
|
15
26
|
icon?: SlotProps["icon"];
|
27
|
+
/** Icon of the text field at the end position */
|
16
28
|
endIcon?: SlotProps["icon"];
|
29
|
+
/** Node for inserting content before the text field value */
|
17
30
|
startSlot?: SlotProps["slot"];
|
31
|
+
/** Node for inserting content after the text field value */
|
18
32
|
endSlot?: SlotProps["slot"];
|
33
|
+
/** Node for inserting text content before the text field value */
|
19
34
|
prefix?: React.ReactNode;
|
35
|
+
/** Node for inserting textcontent after the text field value */
|
20
36
|
suffix?: React.ReactNode;
|
37
|
+
/** Component render variant
|
38
|
+
* @default "outline"
|
39
|
+
*/
|
21
40
|
variant?: "outline" | "faded" | "headless";
|
41
|
+
/** Callback when the text field value changes */
|
22
42
|
onChange?: G.ChangeHandler<string>;
|
43
|
+
/** Callback when the text field is focused */
|
23
44
|
onFocus?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
45
|
+
/** Callback when the text field is blurred */
|
24
46
|
onBlur?: (e: React.FocusEvent<HTMLInputElement>) => void;
|
47
|
+
/** Additional classname for the root element */
|
25
48
|
className?: G.ClassName;
|
49
|
+
/** Additional attributes for the root element */
|
26
50
|
attributes?: G.Attributes<"div">;
|
51
|
+
/** Additional attributes for the input element */
|
27
52
|
inputAttributes?: G.Attributes<"input">;
|
28
53
|
} & Pick<FormControlProps, "hasError">;
|
29
54
|
export type ControlledProps = BaseProps & {
|
55
|
+
/** Value of the text field, enables controlled mode */
|
30
56
|
value: string;
|
57
|
+
/** Default value of the text field, enables uncontrolled mode */
|
31
58
|
defaultValue?: never;
|
32
59
|
};
|
33
60
|
export type UncontrolledProps = BaseProps & {
|
61
|
+
/** Value of the text field, enables controlled mode */
|
34
62
|
value?: never;
|
63
|
+
/** Default value of the text field, enables uncontrolled mode */
|
35
64
|
defaultValue?: string;
|
36
65
|
};
|
37
66
|
export type Props = ControlledProps | UncontrolledProps;
|
@@ -45,7 +45,10 @@ export const PrivateTheme = (props) => {
|
|
45
45
|
return;
|
46
46
|
const themeRootEl = getRootThemeEl(scopeRef?.current);
|
47
47
|
const hasColorModeApplied = themeRootEl.getAttribute("data-rs-color-mode");
|
48
|
-
|
48
|
+
const themeAttribute = getThemeAttribute(usedTheme);
|
49
|
+
// Checking in case there is no global theme applied
|
50
|
+
if (themeAttribute)
|
51
|
+
themeRootEl.setAttribute("data-rs-theme", themeAttribute);
|
49
52
|
if (!hasColorModeApplied)
|
50
53
|
themeRootEl.setAttribute("data-rs-color-mode", usedColorMode);
|
51
54
|
return () => {
|
@@ -13,10 +13,15 @@ export type ThemeContextData = {
|
|
13
13
|
setRootTheme: (theme: G.Theme) => void;
|
14
14
|
};
|
15
15
|
export type Props = {
|
16
|
+
/** Name of the theme to use, enables controlled mode */
|
16
17
|
name?: G.Theme;
|
18
|
+
/** Default name of the theme to use, enables uncontrolled mode */
|
17
19
|
defaultName?: G.Theme;
|
20
|
+
/** Color mode to use */
|
18
21
|
colorMode?: G.ColorMode | "inverted";
|
22
|
+
/** Additional classname for the root element */
|
19
23
|
className?: G.ClassName;
|
24
|
+
/** Node for inserting children */
|
20
25
|
children?: React.ReactNode;
|
21
26
|
};
|
22
27
|
export type PrivateProps = Props & {
|
@@ -1,13 +1,20 @@
|
|
1
1
|
import type React from "react";
|
2
2
|
import type * as G from "../../types/global";
|
3
3
|
export type Props = {
|
4
|
+
/** Node for inserting children */
|
4
5
|
children?: React.ReactNode;
|
6
|
+
/** Additional classname for the root element */
|
5
7
|
className?: G.ClassName;
|
8
|
+
/** Additional attributes for the root element */
|
6
9
|
attributes?: G.Attributes<"ul">;
|
7
10
|
};
|
8
11
|
export type ItemProps = {
|
12
|
+
/** Node for rendering custom item markers */
|
9
13
|
markerSlot?: React.ReactNode | null;
|
14
|
+
/** Node for inserting children */
|
10
15
|
children?: React.ReactNode;
|
16
|
+
/** Additional classname for the item element */
|
11
17
|
className?: G.ClassName;
|
18
|
+
/** Additional attributes for the item element */
|
12
19
|
attributes?: G.Attributes<"li">;
|
13
20
|
};
|