@astryxdesign/core 0.1.2-canary.04e71b2 → 0.1.2-canary.05be2c6
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/Grid/Grid.d.ts.map +1 -1
- package/dist/Grid/Grid.js +24 -6
- package/dist/TimeInput/TimeInput.d.ts.map +1 -1
- package/dist/TimeInput/TimeInput.js +112 -84
- package/dist/astryx.css +4 -0
- package/dist/astryx.umd.js +38 -38
- package/dist/astryx.umd.js.map +3 -3
- package/docs.mjs +2 -2
- package/package.json +2 -4
- package/src/Field/Field.doc.mjs +59 -18
- package/src/Grid/Grid.doc.mjs +3 -0
- package/src/Grid/Grid.test.tsx +43 -30
- package/src/Grid/Grid.tsx +18 -3
- package/src/InputGroup/InputGroup.doc.mjs +111 -23
- package/src/TimeInput/TimeInput.doc.mjs +5 -0
- package/src/TimeInput/TimeInput.test.tsx +111 -0
- package/src/TimeInput/TimeInput.tsx +116 -79
- package/src/docs-script.test.mjs +50 -0
package/dist/Grid/Grid.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../src/Grid/Grid.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAG5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAI9C;;GAEG;AAEH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;AAEnE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GACnB,MAAM,GACN;IACE,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM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,EACN,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,EACH,GAAG,KAAK,EACT,EAAE,SAAS,+BA2FX;yBA9Ge,IAAI"}
|
package/dist/Grid/Grid.js
CHANGED
|
@@ -43,6 +43,26 @@ const baseStyles = {
|
|
|
43
43
|
$$css: true
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
+
|
|
47
|
+
// Dynamic track values compile to CSS variables + a class-level declaration
|
|
48
|
+
// (grid-template-columns: var(--x)) instead of a raw inline style, so
|
|
49
|
+
// consumer `xstyle` overrides — including ones inside @media queries — can
|
|
50
|
+
// still win. A raw inline `grid-template-columns` would beat any class.
|
|
51
|
+
const _temp = {
|
|
52
|
+
kJBjZk: "xhij9v2",
|
|
53
|
+
"$$css": true
|
|
54
|
+
};
|
|
55
|
+
const dynamicStyles = {
|
|
56
|
+
templateColumns: value => [{
|
|
57
|
+
kumcoG: value != null ? "xqketvx" : value,
|
|
58
|
+
$$css: true
|
|
59
|
+
}, {
|
|
60
|
+
"--x-gridTemplateColumns": value != null ? value : undefined
|
|
61
|
+
}],
|
|
62
|
+
autoRows: value => [_temp, {
|
|
63
|
+
"--x-gridAutoRows": `${value}px` != null ? `${value}px` : undefined
|
|
64
|
+
}]
|
|
65
|
+
};
|
|
46
66
|
const alignStyles = {
|
|
47
67
|
start: {
|
|
48
68
|
kGNEyG: "x7a106z",
|
|
@@ -313,12 +333,10 @@ export function Grid({
|
|
|
313
333
|
gridTemplateColumns = '1fr';
|
|
314
334
|
}
|
|
315
335
|
|
|
316
|
-
// Build inline style for dynamic values
|
|
336
|
+
// Build inline style for dynamic values. Track templates go through
|
|
337
|
+
// dynamicStyles (CSS-var indirection) so xstyle/@media overrides work;
|
|
338
|
+
// width/height stay inline as explicit caller-set dimensions.
|
|
317
339
|
const inlineStyle = {
|
|
318
|
-
gridTemplateColumns,
|
|
319
|
-
...(rowHeight != null && {
|
|
320
|
-
gridAutoRows: `${rowHeight}px`
|
|
321
|
-
}),
|
|
322
340
|
...(width != null && {
|
|
323
341
|
width: typeof width === 'number' ? `${width}px` : width
|
|
324
342
|
}),
|
|
@@ -342,7 +360,7 @@ export function Grid({
|
|
|
342
360
|
gap,
|
|
343
361
|
align,
|
|
344
362
|
justify
|
|
345
|
-
}), stylex.props(baseStyles.grid, gap != null && gapStyles[gap], rowGap != null && rowGapStyles[rowGap], columnGap != null && columnGapStyles[columnGap], align != null && alignStyles[align], justify != null && justifyStyles[justify], xstyle), className, {
|
|
363
|
+
}), stylex.props(baseStyles.grid, dynamicStyles.templateColumns(gridTemplateColumns), rowHeight != null && dynamicStyles.autoRows(rowHeight), gap != null && gapStyles[gap], rowGap != null && rowGapStyles[rowGap], columnGap != null && columnGapStyles[columnGap], align != null && alignStyles[align], justify != null && justifyStyles[justify], xstyle), className, {
|
|
346
364
|
...style,
|
|
347
365
|
...inlineStyle
|
|
348
366
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimeInput.d.ts","sourceRoot":"","sources":["../../src/TimeInput/TimeInput.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAU3C,OAAO,EAEL,KAAK,WAAW,EAMjB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"TimeInput.d.ts","sourceRoot":"","sources":["../../src/TimeInput/TimeInput.tsx"],"names":[],"mappings":"AA6BA,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAU3C,OAAO,EAEL,KAAK,WAAW,EAMjB,MAAM,UAAU,CAAC;AAIlB,OAAO,EACL,KAAK,aAAa,EAUnB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AA4D9C,QAAA,MAAM,UAAU;;;;;;;;;;;;;EAad,CAAC;AAEH,MAAM,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;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,mBAAmB,CAAC;IAEjC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;;OAKG;IACH,IAAI,CAAC,EAAE,aAAa,CAAC;IAErB;;;;OAIG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,UAAkB,EAClB,QAAgB,EAChB,YAAoB,EACpB,UAAkB,EAClB,SAAa,EACb,WAA6B,EAC7B,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,GACJ,EAAE,cAAc,+BA8VhB;yBA1Xe,SAAS"}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @file TimeInput.tsx
|
|
7
|
-
* @input Uses React, useId, useState,
|
|
7
|
+
* @input Uses React, useId, useState, useCallback, useRef, Field, Icon, InputGroupContext
|
|
8
8
|
* @output Exports TimeInput component, TimeInputProps
|
|
9
9
|
* @position Core implementation; consumed by index.ts, tested by TimeInput.test.tsx
|
|
10
10
|
*
|
|
@@ -22,12 +22,15 @@ import { colorVars, sizeVars, radiusVars, typographyVars, typeScaleVars, borderV
|
|
|
22
22
|
import { Field, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from "../Field/index.js";
|
|
23
23
|
import { Icon } from "../Icon/index.js";
|
|
24
24
|
import { Spinner } from "../Spinner/index.js";
|
|
25
|
-
import {
|
|
25
|
+
import { VisuallyHidden } from "../VisuallyHidden/index.js";
|
|
26
|
+
import { parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, adjustTime, isTimeInRange, mergeProps, mergeRefs, getInputARIA } from "../utils/index.js";
|
|
26
27
|
import { useSize } from "../SizeContext/SizeContext.js";
|
|
27
28
|
import { useInputContainer } from "../hooks/useInputContainer.js";
|
|
29
|
+
import { useInputGroup } from "../InputGroup/InputGroupContext.js";
|
|
30
|
+
import { groupStyles } from "../InputGroup/groupStyles.js";
|
|
28
31
|
import { useTooltip } from "../Tooltip/index.js";
|
|
29
32
|
import { themeProps } from "../utils/themeProps.js";
|
|
30
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
31
34
|
const sizeStyles = {
|
|
32
35
|
sm: {
|
|
33
36
|
kZKoxP: "x6k0iem",
|
|
@@ -93,10 +96,12 @@ export function TimeInput({
|
|
|
93
96
|
}) {
|
|
94
97
|
const size = useSize(sizeProp, 'md');
|
|
95
98
|
const id = useId();
|
|
99
|
+
const inputLabelID = useId();
|
|
96
100
|
const descriptionID = useId();
|
|
97
101
|
const statusMessageID = useId();
|
|
98
102
|
const inputRef = useRef(null);
|
|
99
103
|
const containerRef = useRef(null);
|
|
104
|
+
const inputGroup = useInputGroup();
|
|
100
105
|
const [, startTransition] = useTransition();
|
|
101
106
|
const [optimisticValue, setOptimisticValue] = useOptimistic(value);
|
|
102
107
|
const isBusy = isLoading || optimisticValue !== value;
|
|
@@ -125,7 +130,10 @@ export function TimeInput({
|
|
|
125
130
|
error: 'error',
|
|
126
131
|
success: 'success'
|
|
127
132
|
};
|
|
128
|
-
const
|
|
133
|
+
const {
|
|
134
|
+
ariaLabelledBy,
|
|
135
|
+
ariaDescribedBy
|
|
136
|
+
} = getInputARIA(inputLabelID, [description ? descriptionID : null, status?.message ? statusMessageID : null, showsDisabledMessage ? disabledMessageTooltip.describedBy : null], inputGroup);
|
|
129
137
|
|
|
130
138
|
// Pending input while user is typing (null = show formatted value)
|
|
131
139
|
const [pendingInput, setPendingInput] = useState(null);
|
|
@@ -273,6 +281,105 @@ export function TimeInput({
|
|
|
273
281
|
inputRef,
|
|
274
282
|
disabled: isDisabled
|
|
275
283
|
});
|
|
284
|
+
const inputWrapper = /*#__PURE__*/_jsxs("div", {
|
|
285
|
+
ref: el => {
|
|
286
|
+
containerRef.current = el;
|
|
287
|
+
// Anchor + hover/focus listeners for the disabled-message tooltip.
|
|
288
|
+
// Handlers are gated internally by isEnabled, so attaching
|
|
289
|
+
// unconditionally is safe.
|
|
290
|
+
disabledMessageTooltip.ref(el);
|
|
291
|
+
},
|
|
292
|
+
onClick: handleWrapperClick,
|
|
293
|
+
onMouseUp: handleWrapperMouseUp,
|
|
294
|
+
...mergeProps(themeProps('time-input', {
|
|
295
|
+
size,
|
|
296
|
+
status: status?.type ?? null
|
|
297
|
+
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], inputGroup && groupStyles.inGroup, xstyle), className, style),
|
|
298
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
299
|
+
...{
|
|
300
|
+
className: "x78zum5 x6s0dn4 xl56j7k x2lah0s"
|
|
301
|
+
},
|
|
302
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
303
|
+
icon: "clock",
|
|
304
|
+
size: "sm",
|
|
305
|
+
color: "secondary"
|
|
306
|
+
})
|
|
307
|
+
}), inputGroup && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
308
|
+
id: inputLabelID,
|
|
309
|
+
children: label
|
|
310
|
+
}), inputGroup && description && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
311
|
+
as: "div",
|
|
312
|
+
id: descriptionID,
|
|
313
|
+
children: description
|
|
314
|
+
}), inputGroup && status?.message && /*#__PURE__*/_jsx(VisuallyHidden, {
|
|
315
|
+
as: "div",
|
|
316
|
+
id: statusMessageID,
|
|
317
|
+
role: status.type === 'error' ? 'alert' : 'status',
|
|
318
|
+
"aria-live": status.type === 'error' ? 'assertive' : 'polite',
|
|
319
|
+
children: status.message
|
|
320
|
+
}), /*#__PURE__*/_jsx("input", {
|
|
321
|
+
ref: mergeRefs(ref, inputRef),
|
|
322
|
+
id: id,
|
|
323
|
+
type: "text",
|
|
324
|
+
value: displayValue,
|
|
325
|
+
onChange: handleInputChange,
|
|
326
|
+
onFocus: handleFocus,
|
|
327
|
+
onBlur: handleBlur,
|
|
328
|
+
onKeyDown: handleInputKeyDown,
|
|
329
|
+
placeholder: displayPlaceholder
|
|
330
|
+
// With a disabledMessage the input keeps focusability via
|
|
331
|
+
// aria-disabled so the reason is focus-discoverable; typing and
|
|
332
|
+
// arrow-key adjustment are blocked with readOnly and the guards.
|
|
333
|
+
,
|
|
334
|
+
disabled: isDisabled && !showsDisabledMessage,
|
|
335
|
+
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
336
|
+
readOnly: showsDisabledMessage || undefined,
|
|
337
|
+
autoFocus: hasAutoFocus,
|
|
338
|
+
"data-autofocus": hasAutoFocus || undefined,
|
|
339
|
+
"aria-describedby": ariaDescribedBy,
|
|
340
|
+
"aria-required": isRequired === true ? 'true' : undefined,
|
|
341
|
+
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
342
|
+
"aria-busy": isBusy || undefined,
|
|
343
|
+
"aria-labelledby": ariaLabelledBy,
|
|
344
|
+
...{
|
|
345
|
+
0: {
|
|
346
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5"
|
|
347
|
+
},
|
|
348
|
+
2: {
|
|
349
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc"
|
|
350
|
+
},
|
|
351
|
+
1: {
|
|
352
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xv1l7n4"
|
|
353
|
+
},
|
|
354
|
+
3: {
|
|
355
|
+
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc xv1l7n4"
|
|
356
|
+
}
|
|
357
|
+
}[!!isDisabled << 1 | !!!isInputValid << 0]
|
|
358
|
+
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
359
|
+
size: "sm"
|
|
360
|
+
}), hasClear && value && !isDisabled && /*#__PURE__*/_jsx("button", {
|
|
361
|
+
type: "button",
|
|
362
|
+
onClick: handleClear,
|
|
363
|
+
"aria-label": `Clear ${label}`,
|
|
364
|
+
...{
|
|
365
|
+
className: "x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto"
|
|
366
|
+
},
|
|
367
|
+
children: /*#__PURE__*/_jsx(Icon, {
|
|
368
|
+
icon: "close",
|
|
369
|
+
size: "sm",
|
|
370
|
+
color: "secondary"
|
|
371
|
+
})
|
|
372
|
+
}), status && !inputGroup && /*#__PURE__*/_jsx(Icon, {
|
|
373
|
+
icon: statusIconMap[status.type],
|
|
374
|
+
size: "md",
|
|
375
|
+
color: statusIconColorMap[status.type]
|
|
376
|
+
})]
|
|
377
|
+
});
|
|
378
|
+
if (inputGroup) {
|
|
379
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
380
|
+
children: [inputWrapper, showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
381
|
+
});
|
|
382
|
+
}
|
|
276
383
|
return /*#__PURE__*/_jsxs(Field, {
|
|
277
384
|
label: label,
|
|
278
385
|
isLabelHidden: isLabelHidden,
|
|
@@ -289,86 +396,7 @@ export function TimeInput({
|
|
|
289
396
|
} : undefined,
|
|
290
397
|
labelTooltip: labelTooltip,
|
|
291
398
|
width: width,
|
|
292
|
-
children: [
|
|
293
|
-
ref: el => {
|
|
294
|
-
containerRef.current = el;
|
|
295
|
-
// Anchor + hover/focus listeners for the disabled-message tooltip.
|
|
296
|
-
// Handlers are gated internally by isEnabled, so attaching
|
|
297
|
-
// unconditionally is safe.
|
|
298
|
-
disabledMessageTooltip.ref(el);
|
|
299
|
-
},
|
|
300
|
-
onClick: handleWrapperClick,
|
|
301
|
-
onMouseUp: handleWrapperMouseUp,
|
|
302
|
-
...mergeProps(themeProps('time-input', {
|
|
303
|
-
size,
|
|
304
|
-
status: status?.type ?? null
|
|
305
|
-
}), stylex.props(inputWrapperStyles.base, sizeStyles[size], isDisabled && inputWrapperStyles.disabled, status && inputStatusBorderStyles[status.type], status && inputStatusHoverShadowStyles[status.type], status && inputStatusFocusWithinStyles[status.type], xstyle), className, style),
|
|
306
|
-
children: [/*#__PURE__*/_jsx("div", {
|
|
307
|
-
...{
|
|
308
|
-
className: "x78zum5 x6s0dn4 xl56j7k x2lah0s"
|
|
309
|
-
},
|
|
310
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
311
|
-
icon: "clock",
|
|
312
|
-
size: "sm",
|
|
313
|
-
color: "secondary"
|
|
314
|
-
})
|
|
315
|
-
}), /*#__PURE__*/_jsx("input", {
|
|
316
|
-
ref: mergeRefs(ref, inputRef),
|
|
317
|
-
id: id,
|
|
318
|
-
type: "text",
|
|
319
|
-
value: displayValue,
|
|
320
|
-
onChange: handleInputChange,
|
|
321
|
-
onFocus: handleFocus,
|
|
322
|
-
onBlur: handleBlur,
|
|
323
|
-
onKeyDown: handleInputKeyDown,
|
|
324
|
-
placeholder: displayPlaceholder
|
|
325
|
-
// With a disabledMessage the input keeps focusability via
|
|
326
|
-
// aria-disabled so the reason is focus-discoverable; typing and
|
|
327
|
-
// arrow-key adjustment are blocked with readOnly and the guards.
|
|
328
|
-
,
|
|
329
|
-
disabled: isDisabled && !showsDisabledMessage,
|
|
330
|
-
"aria-disabled": showsDisabledMessage ? 'true' : undefined,
|
|
331
|
-
readOnly: showsDisabledMessage || undefined,
|
|
332
|
-
autoFocus: hasAutoFocus,
|
|
333
|
-
"data-autofocus": hasAutoFocus || undefined,
|
|
334
|
-
"aria-describedby": ariaDescribedBy,
|
|
335
|
-
"aria-required": isRequired === true ? 'true' : undefined,
|
|
336
|
-
"aria-invalid": status?.type === 'error' ? 'true' : undefined,
|
|
337
|
-
"aria-busy": isBusy || undefined,
|
|
338
|
-
...{
|
|
339
|
-
0: {
|
|
340
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5"
|
|
341
|
-
},
|
|
342
|
-
2: {
|
|
343
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx x1tgivj0 xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc"
|
|
344
|
-
},
|
|
345
|
-
1: {
|
|
346
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 xv1l7n4"
|
|
347
|
-
},
|
|
348
|
-
3: {
|
|
349
|
-
className: "x1lliihq x98rzlu xeuugli xc342km xng3xce x1717udv x9ynric xjm74w1 x6pjikd xw6l6zx xjbqb8w x1a2a7pz xeyghm5 x1h6gzvc xv1l7n4"
|
|
350
|
-
}
|
|
351
|
-
}[!!isDisabled << 1 | !!!isInputValid << 0]
|
|
352
|
-
}), isBusy && /*#__PURE__*/_jsx(Spinner, {
|
|
353
|
-
size: "sm"
|
|
354
|
-
}), hasClear && value && !isDisabled && /*#__PURE__*/_jsx("button", {
|
|
355
|
-
type: "button",
|
|
356
|
-
onClick: handleClear,
|
|
357
|
-
"aria-label": `Clear ${label}`,
|
|
358
|
-
...{
|
|
359
|
-
className: "x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto"
|
|
360
|
-
},
|
|
361
|
-
children: /*#__PURE__*/_jsx(Icon, {
|
|
362
|
-
icon: "close",
|
|
363
|
-
size: "sm",
|
|
364
|
-
color: "secondary"
|
|
365
|
-
})
|
|
366
|
-
}), status && /*#__PURE__*/_jsx(Icon, {
|
|
367
|
-
icon: statusIconMap[status.type],
|
|
368
|
-
size: "md",
|
|
369
|
-
color: statusIconColorMap[status.type]
|
|
370
|
-
})]
|
|
371
|
-
}), showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
399
|
+
children: [inputWrapper, showsDisabledMessage && disabledMessageTooltip.renderTooltip(disabledMessage)]
|
|
372
400
|
});
|
|
373
401
|
}
|
|
374
402
|
TimeInput.displayName = 'TimeInput';
|
package/dist/astryx.css
CHANGED
|
@@ -14,6 +14,8 @@
|
|
|
14
14
|
@property --x-counterReset { syntax: "*"; inherits: false;}
|
|
15
15
|
@property --x-fontSize { syntax: "*"; inherits: false;}
|
|
16
16
|
@property --x-gap { syntax: "*"; inherits: false;}
|
|
17
|
+
@property --x-gridAutoRows { syntax: "*"; inherits: false;}
|
|
18
|
+
@property --x-gridTemplateColumns { syntax: "*"; inherits: false;}
|
|
17
19
|
@property --x-height { syntax: "*"; inherits: false;}
|
|
18
20
|
@property --x-left { syntax: "*"; inherits: false;}
|
|
19
21
|
@property --x-marginInline { syntax: "*"; inherits: false;}
|
|
@@ -740,6 +742,7 @@
|
|
|
740
742
|
.xv8on6e:not(#\#):not(#\#):not(#\#){font-weight:var(--text-supporting-weight)}
|
|
741
743
|
.xu6a5m6:not(#\#):not(#\#):not(#\#){grid-auto-columns:1fr}
|
|
742
744
|
.x1mt1orb:not(#\#):not(#\#):not(#\#){grid-auto-flow:column}
|
|
745
|
+
.xhij9v2:not(#\#):not(#\#):not(#\#){grid-auto-rows:var(--x-gridAutoRows)}
|
|
743
746
|
.xcrlgei:not(#\#):not(#\#):not(#\#){grid-column-start:1}
|
|
744
747
|
.x1agbcgv:not(#\#):not(#\#):not(#\#){grid-row-start:1}
|
|
745
748
|
.x134kloy:not(#\#):not(#\#):not(#\#){grid-template-columns:1fr auto 1fr}
|
|
@@ -748,6 +751,7 @@
|
|
|
748
751
|
.x1wthsqz:not(#\#):not(#\#):not(#\#){grid-template-columns:auto repeat(7,1fr)}
|
|
749
752
|
.x1mzazjb:not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(7,1fr)}
|
|
750
753
|
.x189bvgu:not(#\#):not(#\#):not(#\#){grid-template-columns:repeat(auto-fill,minmax(280px,1fr))}
|
|
754
|
+
.xqketvx:not(#\#):not(#\#):not(#\#){grid-template-columns:var(--x-gridTemplateColumns)}
|
|
751
755
|
.xihq33y:not(#\#):not(#\#):not(#\#){grid-template-rows:0fr}
|
|
752
756
|
.x1tu4anv:not(#\#):not(#\#):not(#\#){grid-template-rows:1fr}
|
|
753
757
|
.xtijo5x:not(#\#):not(#\#):not(#\#){inset-inline-end:0}
|