@techsio/ui-kit 0.53.0 → 0.54.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/dist/atoms/button.js +3 -2
- package/dist/atoms/checkbox.js +1 -1
- package/dist/atoms/input.js +6 -2
- package/dist/atoms/numeric-input.js +91 -36
- package/dist/atoms/skeleton.js +1 -1
- package/dist/atoms/textarea.js +6 -2
- package/dist/internal/organisms/sidebar.styles.js +1 -1
- package/dist/molecules/accordion.js +2 -3
- package/dist/molecules/cascade-select.js +2 -2
- package/dist/molecules/color-select.js +2 -2
- package/dist/molecules/combobox.js +2 -2
- package/dist/molecules/date-picker.js +7 -7
- package/dist/molecules/dialog.js +3 -3
- package/dist/molecules/file-upload.js +1 -1
- package/dist/molecules/form-checkbox.js +2 -2
- package/dist/molecules/phone-input.js +3 -3
- package/dist/molecules/popover.js +2 -2
- package/dist/molecules/quantity-field.js +162 -0
- package/dist/molecules/radio-card.js +7 -7
- package/dist/molecules/select.js +2 -2
- package/dist/molecules/slider.js +1 -1
- package/dist/molecules/steps.js +2 -2
- package/dist/molecules/toast.js +1 -1
- package/dist/molecules/tour.js +1 -1
- package/dist/molecules/tree-view.js +1 -1
- package/dist/organisms/data-table.js +1 -1
- package/dist/organisms/gallery.js +2 -2
- package/dist/organisms/table.js +2 -2
- package/dist/src/atoms/button.d.ts +1 -1
- package/dist/src/atoms/button.d.ts.map +1 -1
- package/dist/src/atoms/checkbox.d.ts +1 -1
- package/dist/src/atoms/input.d.ts +1 -1
- package/dist/src/atoms/input.d.ts.map +1 -1
- package/dist/src/atoms/numeric-input.d.ts +5 -5
- package/dist/src/atoms/numeric-input.d.ts.map +1 -1
- package/dist/src/atoms/skeleton.d.ts +1 -1
- package/dist/src/atoms/textarea.d.ts +1 -1
- package/dist/src/atoms/textarea.d.ts.map +1 -1
- package/dist/src/molecules/accordion.d.ts.map +1 -1
- package/dist/src/molecules/cascade-select.d.ts +1 -1
- package/dist/src/molecules/combobox.d.ts +1 -1
- package/dist/src/molecules/date-picker.d.ts +1 -1
- package/dist/src/molecules/file-upload.d.ts +1 -1
- package/dist/src/molecules/phone-input.d.ts +1 -1
- package/dist/src/molecules/popover.d.ts +1 -1
- package/dist/src/molecules/quantity-field.d.ts +30 -0
- package/dist/src/molecules/quantity-field.d.ts.map +1 -0
- package/dist/src/molecules/radio-card.d.ts +1 -1
- package/dist/src/molecules/tour.d.ts +1 -1
- package/dist/src/organisms/gallery.d.ts +1 -1
- package/dist/src/organisms/table.d.ts +1 -1
- package/dist/src/templates/accordion.d.ts +1 -1
- package/dist/src/templates/gallery.d.ts +1 -1
- package/dist/src/templates/numeric-input.d.ts +1 -1
- package/dist/src/templates/popover.d.ts +1 -1
- package/dist/src/templates/select.d.ts +1 -1
- package/dist/stories/atoms/numeric-input.stories.d.ts +4 -0
- package/dist/stories/atoms/numeric-input.stories.d.ts.map +1 -1
- package/dist/stories/changelog/changelog.stories.d.ts.map +1 -1
- package/dist/stories/molecules/form-numeric-input.stories.d.ts +1 -0
- package/dist/stories/molecules/form-numeric-input.stories.d.ts.map +1 -1
- package/dist/stories/molecules/quantity-field.stories.d.ts +16 -0
- package/dist/stories/molecules/quantity-field.stories.d.ts.map +1 -0
- package/dist/stories/templates/akros-product-card.stories.d.ts +96 -0
- package/dist/stories/templates/akros-product-card.stories.d.ts.map +1 -0
- package/dist/test/numeric-input.spec.d.ts +2 -0
- package/dist/test/numeric-input.spec.d.ts.map +1 -0
- package/dist/test/quantity-field.spec.d.ts +2 -0
- package/dist/test/quantity-field.spec.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/tokens/_base.css +14 -7
- package/src/tokens/_reset.css +66 -0
- package/src/tokens/_semantic.css +33 -43
- package/src/tokens/_tokens-base.css +3 -0
- package/src/tokens/components/_popup-surface.css +13 -3
- package/src/tokens/components/atoms/_badge.css +1 -1
- package/src/tokens/components/components.css +1 -0
- package/src/tokens/components/molecules/_drawer.css +5 -5
- package/src/tokens/components/molecules/_quantity-field.css +17 -0
- package/src/tokens/components/molecules/_vertical-navigation.css +1 -1
- package/src/tokens/components/organisms/_data-table.css +1 -1
- package/src/tokens/figma/brand-overrides.css +15 -15
- package/src/tokens/figma/variables.css +11 -11
- package/src/tokens/theme.css +1 -1
package/dist/atoms/button.js
CHANGED
|
@@ -6,7 +6,8 @@ const buttonVariants = tv({
|
|
|
6
6
|
"relative",
|
|
7
7
|
"inline-flex cursor-pointer items-center justify-center",
|
|
8
8
|
"font-medium",
|
|
9
|
-
"transition
|
|
9
|
+
"transition duration-200 motion-reduce:transition-none",
|
|
10
|
+
"motion-safe:not-disabled:active:scale-97",
|
|
10
11
|
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
|
|
11
12
|
"focus-visible:outline-button-ring",
|
|
12
13
|
"focus-visible:outline-offset-(length:--default-ring-offset)",
|
|
@@ -265,7 +266,7 @@ function Button({ variant, theme, size, block, isLoading, loadingText, icon, ico
|
|
|
265
266
|
children: isLoading ? /*#__PURE__*/ jsxs(Fragment, {
|
|
266
267
|
children: [
|
|
267
268
|
/*#__PURE__*/ jsx(Icon, {
|
|
268
|
-
className: "
|
|
269
|
+
className: "me-2",
|
|
269
270
|
icon: "token-icon-button-spinner"
|
|
270
271
|
}),
|
|
271
272
|
loadingText || children
|
package/dist/atoms/checkbox.js
CHANGED
|
@@ -23,7 +23,7 @@ const checkboxVariants = tv({
|
|
|
23
23
|
"disabled:checked:bg-checkbox-bg-disabled",
|
|
24
24
|
"disabled:checked:text-checkbox-fg-disabled",
|
|
25
25
|
"disabled:checked:border-checkbox-border-disabled",
|
|
26
|
-
"transition
|
|
26
|
+
"transition duration-200 motion-reduce:transition-none",
|
|
27
27
|
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
|
|
28
28
|
"focus-visible:outline-checkbox-ring-focus",
|
|
29
29
|
"focus-visible:outline-offset-(length:--default-ring-offset)",
|
package/dist/atoms/input.js
CHANGED
|
@@ -10,13 +10,17 @@ const inputVariants = tv({
|
|
|
10
10
|
"placeholder:text-input-fg-placeholder",
|
|
11
11
|
"border-(length:--border-width-input) border-input-border-base",
|
|
12
12
|
"rounded-input",
|
|
13
|
-
"transition
|
|
13
|
+
"transition duration-200 motion-reduce:transition-none",
|
|
14
14
|
"hover:border-input-border-hover hover:bg-input-bg-hover",
|
|
15
15
|
"focus:border-input-border-focus focus:bg-input-bg-focus",
|
|
16
16
|
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
|
|
17
17
|
"focus-visible:outline-input-ring",
|
|
18
18
|
"focus-visible:outline-offset-(length:--default-ring-offset)",
|
|
19
|
-
"disabled:cursor-not-allowed disabled:hover:bg-input-bg-disabled"
|
|
19
|
+
"disabled:cursor-not-allowed disabled:hover:bg-input-bg-disabled",
|
|
20
|
+
"user-invalid:border-(length:--border-width-validation)",
|
|
21
|
+
"user-invalid:border-input-border-danger-base",
|
|
22
|
+
"user-invalid:hover:border-input-border-danger-hover",
|
|
23
|
+
"user-invalid:focus:border-input-border-danger-focus"
|
|
20
24
|
],
|
|
21
25
|
variants: {
|
|
22
26
|
size: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { normalizeProps, useMachine } from "@zag-js/react";
|
|
3
|
-
import { createContext, useContext, useId } from "react";
|
|
3
|
+
import { createContext, useContext, useEffect, useId, useLayoutEffect, useMemo, useRef } from "react";
|
|
4
4
|
import { tv } from "../utils.js";
|
|
5
5
|
import { Button } from "./button.js";
|
|
6
6
|
import { Input } from "./input.js";
|
|
@@ -13,7 +13,7 @@ const numericInputVariants = tv({
|
|
|
13
13
|
container: [
|
|
14
14
|
"group form-control-base relative flex",
|
|
15
15
|
"border-numeric-input-border",
|
|
16
|
-
"items-center overflow-
|
|
16
|
+
"min-w-0 items-center overflow-clip",
|
|
17
17
|
"hover:border-numeric-input-border-hover",
|
|
18
18
|
"focus-within:border-numeric-input-border-focus",
|
|
19
19
|
"data-disabled:bg-numeric-input-bg-disabled",
|
|
@@ -37,7 +37,7 @@ const numericInputVariants = tv({
|
|
|
37
37
|
"hover:bg-numeric-input-input-bg-hover",
|
|
38
38
|
"disabled:hover:bg-numeric-input-input-bg",
|
|
39
39
|
"disabled:cursor-not-allowed",
|
|
40
|
-
"focus-visible:outline-
|
|
40
|
+
"focus-visible:outline-hidden",
|
|
41
41
|
"duration-0 data-invalid:focus:border-input-border-danger-focus"
|
|
42
42
|
],
|
|
43
43
|
triggerContainer: [
|
|
@@ -61,19 +61,19 @@ const numericInputVariants = tv({
|
|
|
61
61
|
root: "gap-numeric-input-sm text-numeric-input-sm",
|
|
62
62
|
container: "h-form-control-sm rounded-numeric-input-sm",
|
|
63
63
|
trigger: "text-numeric-input-sm",
|
|
64
|
-
input: "
|
|
64
|
+
input: "ps-numeric-input-input-sm text-numeric-input-sm"
|
|
65
65
|
},
|
|
66
66
|
md: {
|
|
67
67
|
root: "gap-numeric-input-md text-numeric-input-md",
|
|
68
68
|
container: "h-form-control-md rounded-numeric-input-md",
|
|
69
69
|
trigger: "text-numeric-input-md",
|
|
70
|
-
input: "
|
|
70
|
+
input: "ps-numeric-input-input-md text-numeric-input-md"
|
|
71
71
|
},
|
|
72
72
|
lg: {
|
|
73
73
|
root: "gap-numeric-input-lg text-numeric-input-lg",
|
|
74
74
|
container: "h-form-control-lg rounded-numeric-input-lg",
|
|
75
75
|
trigger: "text-numeric-input-lg",
|
|
76
|
-
input: "
|
|
76
|
+
input: "ps-numeric-input-input-lg text-numeric-input-lg"
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
},
|
|
@@ -81,65 +81,76 @@ const numericInputVariants = tv({
|
|
|
81
81
|
size: "md"
|
|
82
82
|
}
|
|
83
83
|
});
|
|
84
|
+
const triggerIconSizes = {
|
|
85
|
+
sm: "xs",
|
|
86
|
+
md: "sm",
|
|
87
|
+
lg: "md"
|
|
88
|
+
};
|
|
84
89
|
const NumericInputContext = /*#__PURE__*/ createContext(null);
|
|
85
90
|
function useNumericInputContext() {
|
|
86
91
|
const context = useContext(NumericInputContext);
|
|
87
92
|
if (!context) throw new Error("NumericInput components must be used within NumericInput.Root");
|
|
88
93
|
return context;
|
|
89
94
|
}
|
|
90
|
-
function NumericInput({ id,
|
|
95
|
+
function NumericInput({ id, size, value, defaultValue, onChange, dir = "ltr", describedBy, precision, children, ref, className, locale = "cs-CZ", ...props }) {
|
|
91
96
|
const generatedId = useId();
|
|
92
|
-
const
|
|
97
|
+
const [machineProps, elementProps] = __rspack_external__zag_js_number_input_f1a1f439.splitProps(props);
|
|
98
|
+
const { formatOptions, invalid, disabled = false, required = false, step = 1, allowMouseWheel = true, clampValueOnBlur = true, spinOnPress = true, focusInputOnChange = true } = machineProps;
|
|
93
99
|
const resolvedFormatOptions = precision ? {
|
|
94
100
|
...formatOptions ?? {},
|
|
95
101
|
maximumFractionDigits: precision
|
|
96
102
|
} : formatOptions;
|
|
97
103
|
const formatValue = (inputValue)=>{
|
|
98
|
-
if (!resolvedFormatOptions) return String(inputValue);
|
|
104
|
+
if ("string" == typeof inputValue || !resolvedFormatOptions) return String(inputValue);
|
|
99
105
|
return new Intl.NumberFormat(locale, resolvedFormatOptions).format(inputValue);
|
|
100
106
|
};
|
|
101
|
-
const stringValue = void 0 !== value ? formatValue(value) : void 0;
|
|
102
|
-
const stringDefaultValue = void 0 !== defaultValue ? formatValue(defaultValue) : void 0;
|
|
103
107
|
const service = useMachine(__rspack_external__zag_js_number_input_f1a1f439.machine, {
|
|
104
|
-
|
|
105
|
-
ids: id ? {
|
|
106
|
-
input: id
|
|
107
|
-
} : void 0,
|
|
108
|
-
min,
|
|
109
|
-
max,
|
|
110
|
-
step,
|
|
111
|
-
name,
|
|
108
|
+
...machineProps,
|
|
112
109
|
disabled,
|
|
113
|
-
locale,
|
|
114
110
|
required,
|
|
115
|
-
|
|
116
|
-
readOnly,
|
|
117
|
-
inputMode,
|
|
118
|
-
dir,
|
|
119
|
-
invalid,
|
|
120
|
-
value: stringValue,
|
|
121
|
-
defaultValue: stringDefaultValue,
|
|
111
|
+
step,
|
|
122
112
|
allowMouseWheel,
|
|
123
|
-
allowOverflow,
|
|
124
113
|
clampValueOnBlur,
|
|
125
114
|
spinOnPress,
|
|
115
|
+
focusInputOnChange,
|
|
116
|
+
id: id || generatedId,
|
|
117
|
+
ids: id ? {
|
|
118
|
+
...machineProps.ids,
|
|
119
|
+
input: id
|
|
120
|
+
} : machineProps.ids,
|
|
121
|
+
dir,
|
|
122
|
+
locale,
|
|
123
|
+
value: void 0 !== value ? formatValue(value) : void 0,
|
|
124
|
+
defaultValue: void 0 !== defaultValue ? formatValue(defaultValue) : void 0,
|
|
126
125
|
formatOptions: resolvedFormatOptions,
|
|
127
126
|
onValueChange: (details)=>{
|
|
128
127
|
onChange?.(details.valueAsNumber);
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
machineProps.onValueChange?.(details);
|
|
129
|
+
}
|
|
131
130
|
});
|
|
132
131
|
const api = __rspack_external__zag_js_number_input_f1a1f439.connect(service, normalizeProps);
|
|
132
|
+
useEffect(()=>{
|
|
133
|
+
const inputId = api.getInputProps().id;
|
|
134
|
+
const input = inputId ? service.scope.getById(inputId) : null;
|
|
135
|
+
if (input && input === service.scope.getActiveElement() && !api.focused) service.send({
|
|
136
|
+
type: "INPUT.FOCUS"
|
|
137
|
+
});
|
|
138
|
+
}, [
|
|
139
|
+
api,
|
|
140
|
+
service
|
|
141
|
+
]);
|
|
133
142
|
const styles = numericInputVariants({
|
|
134
143
|
size
|
|
135
144
|
});
|
|
145
|
+
const inputDisabled = api.getInputProps().disabled;
|
|
136
146
|
return /*#__PURE__*/ jsx(NumericInputContext.Provider, {
|
|
137
147
|
value: {
|
|
138
148
|
api,
|
|
139
149
|
size,
|
|
140
150
|
styles,
|
|
141
151
|
invalid,
|
|
142
|
-
describedBy
|
|
152
|
+
describedBy,
|
|
153
|
+
controlledValue: "string" == typeof value ? value : void 0
|
|
143
154
|
},
|
|
144
155
|
children: /*#__PURE__*/ jsx("div", {
|
|
145
156
|
className: styles.root({
|
|
@@ -147,7 +158,11 @@ function NumericInput({ id, name, size, disabled = false, required = false, patt
|
|
|
147
158
|
}),
|
|
148
159
|
ref: ref,
|
|
149
160
|
...api.getRootProps(),
|
|
150
|
-
...
|
|
161
|
+
...elementProps,
|
|
162
|
+
onWheelCapture: (event)=>{
|
|
163
|
+
if (inputDisabled || machineProps.readOnly) event.stopPropagation();
|
|
164
|
+
elementProps.onWheelCapture?.(event);
|
|
165
|
+
},
|
|
151
166
|
children: children
|
|
152
167
|
})
|
|
153
168
|
});
|
|
@@ -166,13 +181,53 @@ NumericInput.Control = function({ children, ref, className, ...props }) {
|
|
|
166
181
|
});
|
|
167
182
|
};
|
|
168
183
|
NumericInput.Input = function({ ref, className, ...props }) {
|
|
169
|
-
const { api, styles, describedBy } = useNumericInputContext();
|
|
184
|
+
const { api, styles, describedBy, controlledValue } = useNumericInputContext();
|
|
185
|
+
const inputRef = useRef(null);
|
|
186
|
+
const mergedRef = useMemo(()=>(node)=>{
|
|
187
|
+
inputRef.current = node;
|
|
188
|
+
const cleanup = "function" == typeof ref ? ref(node) : void 0;
|
|
189
|
+
if (ref && "function" != typeof ref) ref.current = node;
|
|
190
|
+
return ()=>{
|
|
191
|
+
inputRef.current = null;
|
|
192
|
+
if ("function" == typeof cleanup) cleanup();
|
|
193
|
+
else if ("function" == typeof ref) ref(null);
|
|
194
|
+
else if (ref) ref.current = null;
|
|
195
|
+
};
|
|
196
|
+
}, [
|
|
197
|
+
ref
|
|
198
|
+
]);
|
|
199
|
+
useLayoutEffect(()=>{
|
|
200
|
+
if (void 0 === controlledValue) return;
|
|
201
|
+
const view = inputRef.current?.ownerDocument.defaultView;
|
|
202
|
+
if (!view) return;
|
|
203
|
+
let cancelled = false;
|
|
204
|
+
let frame;
|
|
205
|
+
queueMicrotask(()=>{
|
|
206
|
+
if (cancelled) return;
|
|
207
|
+
frame = view.requestAnimationFrame(()=>{
|
|
208
|
+
const input = inputRef.current;
|
|
209
|
+
if (!input || input.value === controlledValue) return;
|
|
210
|
+
const start = input.selectionStart;
|
|
211
|
+
const end = input.selectionEnd;
|
|
212
|
+
const direction = input.selectionDirection;
|
|
213
|
+
input.value = controlledValue;
|
|
214
|
+
if (input.ownerDocument.activeElement === input && null !== start && null !== end) input.setSelectionRange(Math.min(start, controlledValue.length), Math.min(end, controlledValue.length), direction ?? void 0);
|
|
215
|
+
});
|
|
216
|
+
});
|
|
217
|
+
return ()=>{
|
|
218
|
+
cancelled = true;
|
|
219
|
+
if (void 0 !== frame) view.cancelAnimationFrame(frame);
|
|
220
|
+
};
|
|
221
|
+
}, [
|
|
222
|
+
api,
|
|
223
|
+
controlledValue
|
|
224
|
+
]);
|
|
170
225
|
const ariaDescribedBy = [
|
|
171
226
|
props["aria-describedby"],
|
|
172
227
|
describedBy
|
|
173
228
|
].filter(Boolean).join(" ") || void 0;
|
|
174
229
|
return /*#__PURE__*/ jsx(Input, {
|
|
175
|
-
ref: ref,
|
|
230
|
+
ref: void 0 === controlledValue ? ref : mergedRef,
|
|
176
231
|
...api.getInputProps(),
|
|
177
232
|
...props,
|
|
178
233
|
"aria-describedby": ariaDescribedBy,
|
|
@@ -183,7 +238,7 @@ NumericInput.Input = function({ ref, className, ...props }) {
|
|
|
183
238
|
};
|
|
184
239
|
NumericInput.IncrementTrigger = function({ variant = "primary", theme = "borderless", icon = "token-icon-numeric-input-increment", iconPosition = "left", iconSize, uppercase, block, isLoading, loadingText, ref, className, children, ...props }) {
|
|
185
240
|
const { api, styles, size } = useNumericInputContext();
|
|
186
|
-
const resolvedIconSize = iconSize ??
|
|
241
|
+
const resolvedIconSize = iconSize ?? triggerIconSizes[size ?? "md"];
|
|
187
242
|
return /*#__PURE__*/ jsx(Button, {
|
|
188
243
|
block: block,
|
|
189
244
|
className: styles.trigger({
|
|
@@ -206,7 +261,7 @@ NumericInput.IncrementTrigger = function({ variant = "primary", theme = "borderl
|
|
|
206
261
|
};
|
|
207
262
|
NumericInput.DecrementTrigger = function({ variant = "primary", theme = "borderless", icon = "token-icon-numeric-input-decrement", iconPosition = "left", iconSize, uppercase, block, isLoading, loadingText, ref, className, children, ...props }) {
|
|
208
263
|
const { api, styles, size } = useNumericInputContext();
|
|
209
|
-
const resolvedIconSize = iconSize ??
|
|
264
|
+
const resolvedIconSize = iconSize ?? triggerIconSizes[size ?? "md"];
|
|
210
265
|
return /*#__PURE__*/ jsx(Button, {
|
|
211
266
|
block: block,
|
|
212
267
|
className: styles.trigger({
|
package/dist/atoms/skeleton.js
CHANGED
package/dist/atoms/textarea.js
CHANGED
|
@@ -10,13 +10,17 @@ const textareaVariants = tv({
|
|
|
10
10
|
"placeholder:text-textarea-fg-placeholder",
|
|
11
11
|
"border-(length:--border-width-textarea) border-textarea-border",
|
|
12
12
|
"rounded-textarea",
|
|
13
|
-
"transition
|
|
13
|
+
"transition duration-200 motion-reduce:transition-none",
|
|
14
14
|
"hover:border-textarea-border-hover hover:bg-textarea-bg-hover",
|
|
15
15
|
"focus:border-textarea-border-focus focus:bg-textarea-bg-focus",
|
|
16
16
|
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
|
|
17
17
|
"focus-visible:outline-textarea-ring",
|
|
18
18
|
"focus-visible:outline-offset-(length:--default-ring-offset)",
|
|
19
|
-
"disabled:pointer-events-none disabled:border-textarea-border-disabled disabled:bg-textarea-bg-disabled disabled:text-textarea-fg-disabled"
|
|
19
|
+
"disabled:pointer-events-none disabled:border-textarea-border-disabled disabled:bg-textarea-bg-disabled disabled:text-textarea-fg-disabled",
|
|
20
|
+
"user-invalid:border-(length:--border-width-validation)",
|
|
21
|
+
"user-invalid:border-textarea-border-danger-base",
|
|
22
|
+
"user-invalid:hover:border-textarea-border-danger-hover",
|
|
23
|
+
"user-invalid:focus:border-textarea-border-danger-focus"
|
|
20
24
|
],
|
|
21
25
|
variants: {
|
|
22
26
|
variant: {
|
|
@@ -9,7 +9,7 @@ const sidebarVariants = tv({
|
|
|
9
9
|
desktopPanel: [
|
|
10
10
|
"group/sidebar-panel sticky top-sidebar-offset hidden h-sidebar-viewport shrink-0 flex-col overflow-hidden",
|
|
11
11
|
"sidebar-desktop:flex bg-sidebar-panel-bg text-sidebar-panel-fg",
|
|
12
|
-
"border-sidebar-panel-border transition-
|
|
12
|
+
"border-sidebar-panel-border transition-[width,background-color,border-color] duration-(--duration-sidebar) motion-reduce:transition-none",
|
|
13
13
|
"focus-visible:sidebar-focus-ring",
|
|
14
14
|
"data-[side=start]:border-e-(length:--border-width-sidebar)",
|
|
15
15
|
"data-[side=end]:border-s-(length:--border-width-sidebar)"
|
|
@@ -10,8 +10,7 @@ const accordionVariants = tv({
|
|
|
10
10
|
root: [
|
|
11
11
|
"flex w-full flex-col",
|
|
12
12
|
"rounded-accordion bg-accordion-bg",
|
|
13
|
-
"transition
|
|
14
|
-
"transition-all duration-200 motion-reduce:transition-none"
|
|
13
|
+
"transition duration-200 motion-reduce:transition-none"
|
|
15
14
|
],
|
|
16
15
|
item: "",
|
|
17
16
|
title: "grid place-items-start",
|
|
@@ -21,7 +20,7 @@ const accordionVariants = tv({
|
|
|
21
20
|
"font-accordion-title",
|
|
22
21
|
"bg-accordion-title-bg text-accordion-title-fg",
|
|
23
22
|
"hover:bg-accordion-title-bg-hover",
|
|
24
|
-
"
|
|
23
|
+
"pe-accordion-icon-right",
|
|
25
24
|
"data-[disabled=true]:cursor-not-allowed"
|
|
26
25
|
],
|
|
27
26
|
subtitle: [
|
|
@@ -23,7 +23,7 @@ const cascadeSelectVariants = tv({
|
|
|
23
23
|
"form-control-base group w-full",
|
|
24
24
|
"flex items-center justify-between gap-0",
|
|
25
25
|
"border-cascade-select-trigger-border",
|
|
26
|
-
"text-
|
|
26
|
+
"text-start font-normal",
|
|
27
27
|
"hover:border-cascade-select-trigger-border-hover",
|
|
28
28
|
"hover:bg-cascade-select-trigger-bg-hover",
|
|
29
29
|
"focus:border-cascade-select-trigger-border-focus",
|
|
@@ -48,7 +48,7 @@ const cascadeSelectVariants = tv({
|
|
|
48
48
|
"data-[validation=warning]:outline-offset-(length:--default-ring-offset)",
|
|
49
49
|
"transition-colors duration-200 motion-reduce:transition-none"
|
|
50
50
|
],
|
|
51
|
-
clearTrigger: "-translate-y-1/2 absolute
|
|
51
|
+
clearTrigger: "-translate-y-1/2 absolute end-cascade-select-right top-1/2 data-readonly:hidden",
|
|
52
52
|
content: [
|
|
53
53
|
"popup-surface-base flex w-max min-w-(--reference-width) max-w-(--available-width) overflow-x-auto",
|
|
54
54
|
"duration-200 ease-out motion-safe:transition-[opacity,display,translate,scale]",
|
|
@@ -10,8 +10,8 @@ const colorSelectVariants = tv({
|
|
|
10
10
|
cell: "grid",
|
|
11
11
|
atom: [
|
|
12
12
|
"relative cursor-pointer p-color-select-atom",
|
|
13
|
-
"aspect-square overflow-
|
|
14
|
-
"border-2 transition
|
|
13
|
+
"aspect-square min-w-0 overflow-clip",
|
|
14
|
+
"border-2 transition duration-200 motion-reduce:transition-none",
|
|
15
15
|
"border-color-select-border shadow-color-select hover:border-color-select-border-hover",
|
|
16
16
|
"focus-visible:outline-(style:--default-ring-style) focus-visible:outline-(length:--default-ring-width)",
|
|
17
17
|
"focus-visible:outline-color-select-ring",
|
|
@@ -18,7 +18,7 @@ const comboboxVariants = tv({
|
|
|
18
18
|
"block font-label text-label-md"
|
|
19
19
|
],
|
|
20
20
|
control: [
|
|
21
|
-
"form-control-base relative flex w-full items-center overflow-
|
|
21
|
+
"form-control-base relative flex w-full min-w-0 items-center overflow-clip",
|
|
22
22
|
"bg-combobox-bg-base",
|
|
23
23
|
"transition-colors duration-200 ease-in-out motion-reduce:transition-none",
|
|
24
24
|
"hover:border-combobox-border-hover hover:bg-combobox-bg-hover",
|
|
@@ -36,7 +36,7 @@ const comboboxVariants = tv({
|
|
|
36
36
|
],
|
|
37
37
|
input: [
|
|
38
38
|
"relative h-full min-w-0 flex-1 border-none bg-combobox-input-bg-base",
|
|
39
|
-
"hover:bg-combobox-input-bg-hover focus-visible:outline-
|
|
39
|
+
"hover:bg-combobox-input-bg-hover focus-visible:outline-hidden",
|
|
40
40
|
"focus:bg-combobox-input-bg-focus",
|
|
41
41
|
"placeholder:text-combobox-fg-placeholder",
|
|
42
42
|
"data-disabled:text-combobox-fg-disabled",
|
|
@@ -32,13 +32,13 @@ const datePickerVariants = tv({
|
|
|
32
32
|
"transition-colors duration-200 motion-reduce:transition-none"
|
|
33
33
|
],
|
|
34
34
|
segments: [
|
|
35
|
-
"date-picker-scrollbar-hidden flex min-w-0 flex-1 items-center overflow-x-auto overflow-y-hidden outline-
|
|
35
|
+
"date-picker-scrollbar-hidden flex min-w-0 flex-1 items-center overflow-x-auto overflow-y-hidden outline-hidden",
|
|
36
36
|
"data-disabled:overflow-hidden"
|
|
37
37
|
],
|
|
38
38
|
segmentGroup: "flex min-w-0 items-center",
|
|
39
39
|
rangeSeparator: "shrink-0 px-date-picker-range-separator text-date-picker-range-separator-fg",
|
|
40
40
|
segment: [
|
|
41
|
-
"date-picker-segment-size inline-flex shrink-0 items-center justify-center rounded-date-picker-day px-date-picker-segment tabular-nums outline-
|
|
41
|
+
"date-picker-segment-size inline-flex shrink-0 items-center justify-center rounded-date-picker-day px-date-picker-segment tabular-nums outline-hidden",
|
|
42
42
|
"data-placeholder-shown:text-date-picker-segment-fg-placeholder",
|
|
43
43
|
"focus:bg-date-picker-segment-bg-focus",
|
|
44
44
|
"data-[type=literal]:min-h-0 data-[type=literal]:min-w-0 data-[type=literal]:px-0 data-[type=literal]:text-date-picker-control-fg",
|
|
@@ -74,7 +74,7 @@ const datePickerVariants = tv({
|
|
|
74
74
|
"data-[selection-mode=range]:w-date-picker-content-range",
|
|
75
75
|
"border-(length:--border-width-date-picker-content) border-date-picker-content-border",
|
|
76
76
|
"rounded-date-picker-content bg-date-picker-content-bg text-date-picker-content-fg shadow-date-picker-content",
|
|
77
|
-
"outline-
|
|
77
|
+
"outline-hidden duration-200 ease-out",
|
|
78
78
|
"motion-safe:transition motion-reduce:transition-none",
|
|
79
79
|
"starting:-translate-y-date-picker-enter-offset starting:opacity-0"
|
|
80
80
|
],
|
|
@@ -84,7 +84,7 @@ const datePickerVariants = tv({
|
|
|
84
84
|
],
|
|
85
85
|
monthPanel: [
|
|
86
86
|
"grid min-w-0 content-start gap-date-picker-calendar",
|
|
87
|
-
"sm:data-[index=1]:border-date-picker-month-divider-border sm:data-[index=1]:border-
|
|
87
|
+
"sm:data-[index=1]:border-date-picker-month-divider-border sm:data-[index=1]:border-s sm:data-[index=1]:ps-date-picker-content"
|
|
88
88
|
],
|
|
89
89
|
view: "min-w-0",
|
|
90
90
|
viewControl: "flex min-w-0 items-center justify-between gap-date-picker-calendar",
|
|
@@ -120,8 +120,8 @@ const datePickerVariants = tv({
|
|
|
120
120
|
"data-today:border-date-picker-day-today-border",
|
|
121
121
|
"data-in-range:rounded-none data-in-range:bg-date-picker-day-bg-range",
|
|
122
122
|
"data-in-hover-range:rounded-none data-in-hover-range:bg-date-picker-day-bg-range-hover",
|
|
123
|
-
"data-range-start:rounded-date-picker-day data-range-start:rounded-
|
|
124
|
-
"data-range-end:rounded-date-picker-day data-range-end:rounded-
|
|
123
|
+
"data-range-start:rounded-date-picker-day data-range-start:rounded-e-none",
|
|
124
|
+
"data-range-end:rounded-date-picker-day data-range-end:rounded-s-none",
|
|
125
125
|
"data-range-start:bg-date-picker-day-bg-selected data-range-end:bg-date-picker-day-bg-selected",
|
|
126
126
|
"data-range-start:text-date-picker-day-fg-selected data-range-end:text-date-picker-day-fg-selected",
|
|
127
127
|
"data-selected:bg-date-picker-day-bg-selected data-selected:text-date-picker-day-fg-selected",
|
|
@@ -150,7 +150,7 @@ const datePickerVariants = tv({
|
|
|
150
150
|
timeGroup: [
|
|
151
151
|
"flex min-w-0 items-center gap-date-picker-time",
|
|
152
152
|
"data-[index=1]:border-date-picker-time-border data-[index=1]:border-t data-[index=1]:pt-date-picker-time",
|
|
153
|
-
"sm:data-[index=1]:border-
|
|
153
|
+
"sm:data-[index=1]:border-s sm:data-[index=1]:border-t-0 sm:data-[index=1]:pt-0 sm:data-[index=1]:ps-date-picker-time"
|
|
154
154
|
],
|
|
155
155
|
timeGroupLabel: "shrink-0 font-date-picker-view text-date-picker-time-label-fg text-date-picker-time-label",
|
|
156
156
|
timeFields: "flex min-w-0 items-center gap-date-picker-indicator",
|
package/dist/molecules/dialog.js
CHANGED
|
@@ -31,7 +31,7 @@ const dialogVariants = tv({
|
|
|
31
31
|
],
|
|
32
32
|
trigger: [],
|
|
33
33
|
closeTrigger: [
|
|
34
|
-
"absolute
|
|
34
|
+
"absolute end-dialog-close-trigger-offset top-dialog-close-trigger-offset"
|
|
35
35
|
],
|
|
36
36
|
actions: "mt-auto flex shrink-0 justify-end gap-dialog-actions pt-dialog-actions-top"
|
|
37
37
|
},
|
|
@@ -43,11 +43,11 @@ const dialogVariants = tv({
|
|
|
43
43
|
},
|
|
44
44
|
left: {
|
|
45
45
|
positioner: "items-stretch justify-start",
|
|
46
|
-
content: "h-full rounded-dialog-content-side border-
|
|
46
|
+
content: "h-full rounded-dialog-content-side border-s-0"
|
|
47
47
|
},
|
|
48
48
|
right: {
|
|
49
49
|
positioner: "items-stretch justify-end",
|
|
50
|
-
content: "h-full rounded-dialog-content-side border-
|
|
50
|
+
content: "h-full rounded-dialog-content-side border-e-0"
|
|
51
51
|
},
|
|
52
52
|
top: {
|
|
53
53
|
positioner: "items-start justify-stretch",
|
|
@@ -34,7 +34,7 @@ const fileUploadStyles = tv({
|
|
|
34
34
|
"data-disabled:text-file-upload-item-disabled-fg"
|
|
35
35
|
],
|
|
36
36
|
itemPreview: [
|
|
37
|
-
"flex size-file-upload-item-preview shrink-0 items-center justify-center overflow-
|
|
37
|
+
"flex size-file-upload-item-preview shrink-0 items-center justify-center overflow-clip rounded-file-upload-item-preview text-file-upload-item-preview-fg",
|
|
38
38
|
"data-disabled:text-file-upload-item-disabled-fg"
|
|
39
39
|
],
|
|
40
40
|
itemPreviewImage: "size-full object-cover",
|
|
@@ -13,7 +13,7 @@ const checkboxVariants = tv({
|
|
|
13
13
|
"rounded-checkbox border border-checkbox-border-base",
|
|
14
14
|
"bg-checkbox-bg-base",
|
|
15
15
|
"flex items-center justify-center",
|
|
16
|
-
"transition
|
|
16
|
+
"transition duration-200 motion-reduce:transition-none",
|
|
17
17
|
"data-[state=checked]:bg-checkbox-bg-checked",
|
|
18
18
|
"data-[state=checked]:border-checkbox-border-checked",
|
|
19
19
|
"data-[state=indeterminate]:bg-checkbox-bg-indeterminate",
|
|
@@ -42,7 +42,7 @@ const checkboxVariants = tv({
|
|
|
42
42
|
"data-disabled:text-label-fg-disabled"
|
|
43
43
|
],
|
|
44
44
|
hiddenInput: "sr-only",
|
|
45
|
-
textIndented: "data-[icon=false]:
|
|
45
|
+
textIndented: "data-[icon=false]:ps-form-checkbox-text-offset"
|
|
46
46
|
},
|
|
47
47
|
variants: {
|
|
48
48
|
size: {
|
|
@@ -51,7 +51,7 @@ const phoneInputVariants = tv({
|
|
|
51
51
|
],
|
|
52
52
|
control: [
|
|
53
53
|
"form-control-base",
|
|
54
|
-
"relative flex w-full items-center overflow-
|
|
54
|
+
"relative flex w-full min-w-0 items-center overflow-clip",
|
|
55
55
|
"text-phone-input-fg",
|
|
56
56
|
"hover:border-phone-input-border-hover hover:bg-phone-input-bg-hover",
|
|
57
57
|
"phone-input-focus",
|
|
@@ -84,7 +84,7 @@ const phoneInputVariants = tv({
|
|
|
84
84
|
"bg-phone-input-trigger-bg-base",
|
|
85
85
|
"hover:bg-phone-input-trigger-bg-hover",
|
|
86
86
|
"border-(length:--border-phone-input-trigger)",
|
|
87
|
-
"focus-visible:outline-
|
|
87
|
+
"focus-visible:outline-hidden",
|
|
88
88
|
"w-phone-input-trigger",
|
|
89
89
|
"focus-visible:bg-phone-input-trigger-bg-hover",
|
|
90
90
|
"rounded-e-none"
|
|
@@ -107,7 +107,7 @@ const phoneInputVariants = tv({
|
|
|
107
107
|
"placeholder:text-phone-input-fg-placeholder",
|
|
108
108
|
"hover:bg-phone-input-input-bg-hover",
|
|
109
109
|
"focus:bg-phone-input-input-bg-focus",
|
|
110
|
-
"focus-visible:outline-
|
|
110
|
+
"focus-visible:outline-hidden",
|
|
111
111
|
"disabled:text-phone-input-fg-disabled"
|
|
112
112
|
],
|
|
113
113
|
itemContent: [
|
|
@@ -20,7 +20,7 @@ const popoverVariants = tv({
|
|
|
20
20
|
"bg-popover-bg",
|
|
21
21
|
"text-popover-fg",
|
|
22
22
|
"rounded-popover",
|
|
23
|
-
"outline-
|
|
23
|
+
"outline-hidden",
|
|
24
24
|
"z-50",
|
|
25
25
|
"relative"
|
|
26
26
|
],
|
|
@@ -36,7 +36,7 @@ const popoverVariants = tv({
|
|
|
36
36
|
"leading-normal"
|
|
37
37
|
],
|
|
38
38
|
closeTrigger: [
|
|
39
|
-
"absolute
|
|
39
|
+
"absolute end-2 top-2"
|
|
40
40
|
]
|
|
41
41
|
},
|
|
42
42
|
variants: {
|