@womp/kookie-ui 0.28.1 → 0.29.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/components.css +204 -6
- package/dist/cjs/components/index.js +2 -2
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/segmented-control.js +1 -1
- package/dist/cjs/components/segmented-control.js.map +3 -3
- package/dist/cjs/components/segmented-control.props.d.ts +6 -0
- package/dist/cjs/components/segmented-control.props.d.ts.map +1 -1
- package/dist/cjs/components/segmented-control.props.js +1 -1
- package/dist/cjs/components/segmented-control.props.js.map +3 -3
- package/dist/cjs/components/text-field.d.ts +11 -3
- package/dist/cjs/components/text-field.d.ts.map +1 -1
- package/dist/cjs/components/text-field.js +2 -2
- package/dist/cjs/components/text-field.js.map +3 -3
- package/dist/cjs/components/text-field.props.d.ts +30 -1
- package/dist/cjs/components/text-field.props.d.ts.map +1 -1
- package/dist/cjs/components/text-field.props.js +1 -1
- package/dist/cjs/components/text-field.props.js.map +3 -3
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/props/index.js +1 -1
- package/dist/cjs/props/index.js.map +3 -3
- package/dist/esm/chunk-A252TSYI.js +2 -0
- package/dist/esm/chunk-A252TSYI.js.map +7 -0
- package/dist/esm/chunk-FIMFM25N.js +2 -0
- package/dist/esm/chunk-FIMFM25N.js.map +7 -0
- package/dist/esm/chunk-GPZHRZBE.js +6 -0
- package/dist/esm/chunk-GPZHRZBE.js.map +7 -0
- package/dist/esm/chunk-TSS4K2U5.js +3 -0
- package/dist/esm/{chunk-W4Z6ORYO.js.map → chunk-TSS4K2U5.js.map} +3 -3
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/segmented-control.js +1 -1
- package/dist/esm/components/segmented-control.props.d.ts +6 -0
- package/dist/esm/components/segmented-control.props.d.ts.map +1 -1
- package/dist/esm/components/segmented-control.props.js +1 -1
- package/dist/esm/components/text-field.d.ts +11 -3
- package/dist/esm/components/text-field.d.ts.map +1 -1
- package/dist/esm/components/text-field.js +1 -1
- package/dist/esm/components/text-field.props.d.ts +30 -1
- package/dist/esm/components/text-field.props.d.ts.map +1 -1
- package/dist/esm/components/text-field.props.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/props/index.js +1 -1
- package/package.json +1 -1
- package/src/components/segmented-control.css +43 -0
- package/src/components/segmented-control.props.tsx +5 -0
- package/src/components/select.css +2 -2
- package/src/components/text-area.css +2 -2
- package/src/components/text-field.css +140 -2
- package/src/components/text-field.props.tsx +16 -1
- package/src/components/text-field.tsx +48 -4
- package/src/styles/tokens/shadow.css +7 -2
- package/styles.css +206 -6
- package/tokens/base.css +2 -0
- package/tokens.css +2 -0
- package/dist/esm/chunk-2ZLMWYJ6.js +0 -2
- package/dist/esm/chunk-2ZLMWYJ6.js.map +0 -7
- package/dist/esm/chunk-BP64M73W.js +0 -2
- package/dist/esm/chunk-BP64M73W.js.map +0 -7
- package/dist/esm/chunk-W4Z6ORYO.js +0 -3
- package/dist/esm/chunk-ZOUIIO4C.js +0 -6
- package/dist/esm/chunk-ZOUIIO4C.js.map +0 -7
|
@@ -354,14 +354,14 @@
|
|
|
354
354
|
* *
|
|
355
355
|
***************************************************************************************************/
|
|
356
356
|
|
|
357
|
-
/* Raised variant: the default. The surface colour with --
|
|
357
|
+
/* Raised variant: the default. The surface colour with --field-chrome. */
|
|
358
358
|
.kui-TextAreaRoot:where(.kui-variant-raised) {
|
|
359
359
|
--text-area-border-width: 1px;
|
|
360
360
|
--v-selection-color: var(--focus-a5);
|
|
361
361
|
--v-focus-color: var(--focus-8);
|
|
362
362
|
|
|
363
363
|
background-color: var(--field-fill);
|
|
364
|
-
box-shadow: var(--
|
|
364
|
+
box-shadow: var(--field-chrome);
|
|
365
365
|
|
|
366
366
|
& :where(.kui-TextAreaInput) {
|
|
367
367
|
&::placeholder {
|
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
|
|
395
|
-
/* raised: the default. The surface colour with --
|
|
395
|
+
/* raised: the default. The surface colour with --field-chrome. */
|
|
396
396
|
|
|
397
397
|
.kui-TextFieldRoot:where(.kui-variant-raised) {
|
|
398
398
|
--text-field-selection-color: var(--focus-a5);
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
--text-field-border-width: 1px;
|
|
401
401
|
|
|
402
402
|
background-color: var(--field-fill);
|
|
403
|
-
box-shadow: var(--
|
|
403
|
+
box-shadow: var(--field-chrome);
|
|
404
404
|
|
|
405
405
|
/* Hover effects */
|
|
406
406
|
@media (hover: hover) {
|
|
@@ -738,3 +738,141 @@
|
|
|
738
738
|
filter: none;
|
|
739
739
|
}
|
|
740
740
|
}
|
|
741
|
+
|
|
742
|
+
/***************************************************************************************************
|
|
743
|
+
* *
|
|
744
|
+
* GROUP *
|
|
745
|
+
* *
|
|
746
|
+
***************************************************************************************************/
|
|
747
|
+
|
|
748
|
+
/*
|
|
749
|
+
* TextField.Group joins its fields into one control, such as X, Y and Z. The group draws the
|
|
750
|
+
* variant's edge once, over the fields, so a field's fill never covers it. Each field keeps its
|
|
751
|
+
* fill, hover and focus ring; its own edge goes, its inner corners are square, and a hairline
|
|
752
|
+
* divides it from the one before.
|
|
753
|
+
*/
|
|
754
|
+
|
|
755
|
+
/* stylelint-disable selector-max-specificity */
|
|
756
|
+
|
|
757
|
+
.kui-TextFieldGroup {
|
|
758
|
+
display: grid;
|
|
759
|
+
grid-auto-flow: column;
|
|
760
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
761
|
+
position: relative;
|
|
762
|
+
isolation: isolate;
|
|
763
|
+
border-radius: var(--text-field-border-radius);
|
|
764
|
+
|
|
765
|
+
&::after {
|
|
766
|
+
content: '';
|
|
767
|
+
position: absolute;
|
|
768
|
+
inset: 0;
|
|
769
|
+
z-index: 2;
|
|
770
|
+
border-radius: inherit;
|
|
771
|
+
box-shadow: var(--text-field-group-edge);
|
|
772
|
+
pointer-events: none;
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
@breakpoints {
|
|
777
|
+
.kui-TextFieldGroup {
|
|
778
|
+
&:where(.kui-r-size-1) {
|
|
779
|
+
--text-field-border-radius: var(--radius-control-1);
|
|
780
|
+
}
|
|
781
|
+
&:where(.kui-r-size-2) {
|
|
782
|
+
--text-field-border-radius: var(--radius-control-2);
|
|
783
|
+
}
|
|
784
|
+
&:where(.kui-r-size-3) {
|
|
785
|
+
--text-field-border-radius: var(--radius-control-3);
|
|
786
|
+
}
|
|
787
|
+
&:where(.kui-r-size-4) {
|
|
788
|
+
--text-field-border-radius: var(--radius-control-4);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/* Each variant's edge and divider are the ones its single field draws. */
|
|
794
|
+
.kui-TextFieldGroup:where(.kui-variant-raised) {
|
|
795
|
+
--text-field-group-edge: var(--field-chrome);
|
|
796
|
+
--text-field-group-divider: var(--neutral-a4);
|
|
797
|
+
|
|
798
|
+
&:where([data-disabled]) {
|
|
799
|
+
--text-field-group-edge: inset 0 0 0 1px var(--field-edge-disabled);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
.kui-TextFieldGroup:where(.kui-variant-outline, .kui-variant-surface) {
|
|
804
|
+
--text-field-group-edge: inset 0 0 0 1px var(--accent-6);
|
|
805
|
+
--text-field-group-divider: var(--accent-6);
|
|
806
|
+
|
|
807
|
+
&:where([data-disabled]) {
|
|
808
|
+
--text-field-group-edge: inset 0 0 0 1px var(--neutral-a6);
|
|
809
|
+
--text-field-group-divider: var(--neutral-a6);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.kui-TextFieldGroup:where(.kui-variant-soft) {
|
|
814
|
+
--text-field-group-edge: none;
|
|
815
|
+
--text-field-group-divider: var(--accent-a5);
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/* ghost: the dividers alone. Each field keeps its ghost hover and focus fill. */
|
|
819
|
+
.kui-TextFieldGroup:where(.kui-variant-ghost) {
|
|
820
|
+
--text-field-group-edge: none;
|
|
821
|
+
--text-field-group-divider: var(--neutral-a5);
|
|
822
|
+
}
|
|
823
|
+
|
|
824
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot {
|
|
825
|
+
position: relative;
|
|
826
|
+
border-radius: 0;
|
|
827
|
+
box-shadow: none;
|
|
828
|
+
|
|
829
|
+
/* The focus ring and an invalid edge draw above the group's edge. */
|
|
830
|
+
&:focus-within {
|
|
831
|
+
z-index: 3;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper:first-child > .kui-TextFieldRoot {
|
|
836
|
+
border-start-start-radius: var(--text-field-border-radius);
|
|
837
|
+
border-end-start-radius: var(--text-field-border-radius);
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper:last-child > .kui-TextFieldRoot {
|
|
841
|
+
border-start-end-radius: var(--text-field-border-radius);
|
|
842
|
+
border-end-end-radius: var(--text-field-border-radius);
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper + .kui-TextFieldWrapper > .kui-TextFieldRoot::before {
|
|
846
|
+
content: '';
|
|
847
|
+
position: absolute;
|
|
848
|
+
z-index: 1;
|
|
849
|
+
inset-block: 0;
|
|
850
|
+
inset-inline-start: 0;
|
|
851
|
+
width: 1px;
|
|
852
|
+
background-color: var(--text-field-group-divider);
|
|
853
|
+
pointer-events: none;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
/* A focused field's ring is its edge, so the hairlines on either side of it step back. */
|
|
857
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot:focus-within::before,
|
|
858
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper:has(> .kui-TextFieldRoot:focus-within) + .kui-TextFieldWrapper > .kui-TextFieldRoot::before {
|
|
859
|
+
opacity: 0;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/* An invalid field keeps its red edge, on its own segment only. */
|
|
863
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot:has(> .kui-TextFieldInput[aria-invalid='true']) {
|
|
864
|
+
z-index: 3;
|
|
865
|
+
box-shadow: inset 0 0 0 1px var(--red-6);
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
@media (forced-colors: active) {
|
|
870
|
+
.kui-TextFieldGroup {
|
|
871
|
+
border: 1px solid CanvasText;
|
|
872
|
+
}
|
|
873
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot {
|
|
874
|
+
border: none;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
/* stylelint-enable selector-max-specificity */
|
|
@@ -30,6 +30,21 @@ const textFieldRootPropDefs = {
|
|
|
30
30
|
'aria-labelledby': PropDef<string | undefined>;
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
// Ghost is the dividers alone: no fill, no edge.
|
|
34
|
+
const groupVariants = ['raised', 'surface', 'soft', 'outline', 'ghost'] as const;
|
|
35
|
+
|
|
36
|
+
const textFieldGroupPropDefs = {
|
|
37
|
+
size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },
|
|
38
|
+
variant: { type: 'enum', className: 'kui-variant', values: groupVariants, default: 'raised' },
|
|
39
|
+
disabled: { type: 'boolean', default: false },
|
|
40
|
+
...colorPropDef,
|
|
41
|
+
...radiusPropDef,
|
|
42
|
+
} satisfies {
|
|
43
|
+
size: PropDef<(typeof sizes)[number]>;
|
|
44
|
+
variant: PropDef<(typeof groupVariants)[number]>;
|
|
45
|
+
disabled: PropDef<boolean>;
|
|
46
|
+
};
|
|
47
|
+
|
|
33
48
|
const sides = ['left', 'right'] as const;
|
|
34
49
|
|
|
35
50
|
const textFieldSlotPropDefs = {
|
|
@@ -75,4 +90,4 @@ interface TextFieldSlotScrubProps {
|
|
|
75
90
|
|
|
76
91
|
export type { TextFieldSlotScrubProps };
|
|
77
92
|
|
|
78
|
-
export { textFieldRootPropDefs, textFieldSlotPropDefs };
|
|
93
|
+
export { textFieldRootPropDefs, textFieldGroupPropDefs, textFieldSlotPropDefs };
|
|
@@ -5,7 +5,7 @@ import * as ReactDOM from 'react-dom';
|
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import { composeEventHandlers, composeRefs, useLayoutEffect } from 'radix-ui/internal';
|
|
7
7
|
|
|
8
|
-
import { textFieldRootPropDefs, textFieldSlotPropDefs, type TextFieldSlotScrubProps } from './text-field.props.js';
|
|
8
|
+
import { textFieldRootPropDefs, textFieldGroupPropDefs, textFieldSlotPropDefs, type TextFieldSlotScrubProps } from './text-field.props.js';
|
|
9
9
|
import { extractProps } from '../helpers/extract-props.js';
|
|
10
10
|
import { mergeStyles } from '../helpers/merge-styles.js';
|
|
11
11
|
import { useThemeSizeProps } from '../hooks/theme-size.js';
|
|
@@ -31,7 +31,23 @@ const TextFieldContext = React.createContext<TextFieldContextValue | null>(null)
|
|
|
31
31
|
// list, not a tag list. `[tabindex]` catches role-based widgets; `label` already redirects a click.
|
|
32
32
|
const FOCUSABLE_IN_SLOT = 'button, a, input, select, textarea, label, [tabindex], [contenteditable]';
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// A Group decides the look of its fields: their size, variant and radius come from it. A field
|
|
35
|
+
// can still take its own color, and is disabled when either it or the group is.
|
|
36
|
+
type TextFieldGroupContextValue = Pick<TextFieldGroupOwnProps, 'size' | 'variant' | 'radius' | 'color' | 'disabled'>;
|
|
37
|
+
const TextFieldGroupContext = React.createContext<TextFieldGroupContextValue | null>(null);
|
|
38
|
+
|
|
39
|
+
const TextFieldRoot = React.forwardRef<TextFieldRootElement, TextFieldRootProps>((fieldProps, forwardedRef) => {
|
|
40
|
+
const group = React.useContext(TextFieldGroupContext);
|
|
41
|
+
const ownProps = group
|
|
42
|
+
? {
|
|
43
|
+
...fieldProps,
|
|
44
|
+
size: group.size,
|
|
45
|
+
variant: group.variant,
|
|
46
|
+
radius: group.radius,
|
|
47
|
+
color: fieldProps.color ?? group.color,
|
|
48
|
+
disabled: Boolean(group.disabled || fieldProps.disabled),
|
|
49
|
+
}
|
|
50
|
+
: fieldProps;
|
|
35
51
|
// The caller's className and style are kept apart from the size and variant classes: with an
|
|
36
52
|
// error message they go on the wrapper, which is then the one box the parent lays out.
|
|
37
53
|
const { className: ownClassName, style: ownStyle, ...themedProps } = useThemeSizeProps(ownProps, textFieldRootPropDefs.size);
|
|
@@ -137,6 +153,34 @@ const TextFieldRoot = React.forwardRef<TextFieldRootElement, TextFieldRootProps>
|
|
|
137
153
|
});
|
|
138
154
|
TextFieldRoot.displayName = 'TextField.Root';
|
|
139
155
|
|
|
156
|
+
type TextFieldGroupOwnProps = GetPropDefTypes<typeof textFieldGroupPropDefs>;
|
|
157
|
+
interface TextFieldGroupProps extends ComponentPropsWithout<'div', RemovedProps>, TextFieldGroupOwnProps {}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Joins two or more fields into one, such as X, Y and Z: one edge, square inner corners and a
|
|
161
|
+
* hairline between the fields. The group draws the edge, so each field keeps only its fill.
|
|
162
|
+
*/
|
|
163
|
+
const TextFieldGroup = React.forwardRef<HTMLDivElement, TextFieldGroupProps>((ownProps, forwardedRef) => {
|
|
164
|
+
const props = useThemeSizeProps(ownProps, textFieldGroupPropDefs.size);
|
|
165
|
+
const { size, variant, radius, color, disabled } = props;
|
|
166
|
+
const { className, children, radius: _radius, color: _color, disabled: _disabled, ...domProps } = extractProps(props, textFieldGroupPropDefs);
|
|
167
|
+
const contextValue = React.useMemo(() => ({ size, variant, radius, color, disabled }), [size, variant, radius, color, disabled]);
|
|
168
|
+
return (
|
|
169
|
+
<div
|
|
170
|
+
role="group"
|
|
171
|
+
data-accent-color={color}
|
|
172
|
+
data-radius={radius}
|
|
173
|
+
data-disabled={disabled || undefined}
|
|
174
|
+
{...domProps}
|
|
175
|
+
ref={forwardedRef}
|
|
176
|
+
className={classNames('kui-TextFieldGroup', className)}
|
|
177
|
+
>
|
|
178
|
+
<TextFieldGroupContext.Provider value={contextValue}>{children}</TextFieldGroupContext.Provider>
|
|
179
|
+
</div>
|
|
180
|
+
);
|
|
181
|
+
});
|
|
182
|
+
TextFieldGroup.displayName = 'TextField.Group';
|
|
183
|
+
|
|
140
184
|
type TextFieldSlotElement = React.ElementRef<'div'>;
|
|
141
185
|
type TextFieldSlotOwnProps = GetPropDefTypes<typeof textFieldSlotPropDefs> & TextFieldSlotScrubProps;
|
|
142
186
|
interface TextFieldSlotProps extends ComponentPropsWithout<'div', RemovedProps>, TextFieldSlotOwnProps {}
|
|
@@ -478,5 +522,5 @@ const TextFieldSlot = React.forwardRef<TextFieldSlotElement, TextFieldSlotProps>
|
|
|
478
522
|
});
|
|
479
523
|
TextFieldSlot.displayName = 'TextField.Slot';
|
|
480
524
|
|
|
481
|
-
export { TextFieldRoot as Root, TextFieldSlot as Slot };
|
|
482
|
-
export type { TextFieldRootProps as RootProps, TextFieldSlotProps as SlotProps };
|
|
525
|
+
export { TextFieldRoot as Root, TextFieldGroup as Group, TextFieldSlot as Slot };
|
|
526
|
+
export type { TextFieldRootProps as RootProps, TextFieldGroupProps as GroupProps, TextFieldSlotProps as SlotProps };
|
|
@@ -7,14 +7,17 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Components read roles:
|
|
9
9
|
* --surface-chrome: a raised card or a pane.
|
|
10
|
-
* --control-chrome: a raised control
|
|
10
|
+
* --control-chrome: a raised control, such as a button.
|
|
11
|
+
* --field-chrome: a raised field, such as a text field, a select or a raised segmented control.
|
|
11
12
|
* --control-chrome-active: the same control while pressed. The drop tightens toward the surface.
|
|
12
13
|
* --grip-chrome: the thumb of a switch or slider.
|
|
13
14
|
* --control-light: an optional light across a raised control's top half (a background image); none by default.
|
|
14
15
|
* --floating-chrome: a popover, menu, combobox or select list.
|
|
15
16
|
* --dialog-chrome: a dialog. Like v2, a dialog is a surface that covers the page.
|
|
16
17
|
*
|
|
17
|
-
* Fields (text field, text area, select trigger) read --
|
|
18
|
+
* Fields (text field, text area, select trigger, raised segmented control) read --field-chrome: the
|
|
19
|
+
* control's edge and its 1px drop, without the wide blur. A field sits in the panel; a button lifts
|
|
20
|
+
* off it. In a panel of fields the blur under every row read as too heavy (2026-10-29).
|
|
18
21
|
*/
|
|
19
22
|
|
|
20
23
|
/* prettier-ignore */
|
|
@@ -29,6 +32,7 @@
|
|
|
29
32
|
--surface-chrome: var(--shadow-4);
|
|
30
33
|
--control-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 14px -4px rgb(0 0 0 / 0.08);
|
|
31
34
|
--control-chrome-active: inset 0 0 0 1px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.04);
|
|
35
|
+
--field-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
|
|
32
36
|
--control-light: none;
|
|
33
37
|
/* A grip: the thumb of a switch or slider. A small round object, so a tighter, darker cast. */
|
|
34
38
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.16), 0 2px 6px -1px rgb(0 0 0 / 0.18);
|
|
@@ -51,6 +55,7 @@
|
|
|
51
55
|
inner edge. v1 drew this edge with a ring in every shadow; now only the control role has it. */
|
|
52
56
|
--control-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.35), 0 4px 14px -4px rgb(0 0 0 / 0.45);
|
|
53
57
|
--control-chrome-active: inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 1px rgb(0 0 0 / 0.4);
|
|
58
|
+
--field-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.3);
|
|
54
59
|
--control-light: none;
|
|
55
60
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 6px -1px rgb(0 0 0 / 0.4);
|
|
56
61
|
--floating-chrome: inset 0 1px 0 rgb(255 255 255 / 0.05), var(--shadow-3);
|
package/styles.css
CHANGED
|
@@ -3434,6 +3434,7 @@
|
|
|
3434
3434
|
--surface-chrome: var(--shadow-4);
|
|
3435
3435
|
--control-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 14px -4px rgb(0 0 0 / 0.08);
|
|
3436
3436
|
--control-chrome-active: inset 0 0 0 1px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.04);
|
|
3437
|
+
--field-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
|
|
3437
3438
|
--control-light: none;
|
|
3438
3439
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.16), 0 2px 6px -1px rgb(0 0 0 / 0.18);
|
|
3439
3440
|
--floating-chrome: var(--shadow-3);
|
|
@@ -3498,6 +3499,7 @@
|
|
|
3498
3499
|
--surface-chrome: var(--shadow-4);
|
|
3499
3500
|
--control-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.35), 0 4px 14px -4px rgb(0 0 0 / 0.45);
|
|
3500
3501
|
--control-chrome-active: inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 1px rgb(0 0 0 / 0.4);
|
|
3502
|
+
--field-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.3);
|
|
3501
3503
|
--control-light: none;
|
|
3502
3504
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 6px -1px rgb(0 0 0 / 0.4);
|
|
3503
3505
|
--floating-chrome: inset 0 1px 0 rgb(255 255 255 / 0.05), var(--shadow-3);
|
|
@@ -11064,8 +11066,8 @@
|
|
|
11064
11066
|
--text-field-focus-color: var(--focus-8);
|
|
11065
11067
|
--text-field-border-width: 1px;
|
|
11066
11068
|
background-color: var(--field-fill);
|
|
11067
|
-
-webkit-box-shadow: var(--
|
|
11068
|
-
box-shadow: var(--
|
|
11069
|
+
-webkit-box-shadow: var(--field-chrome);
|
|
11070
|
+
box-shadow: var(--field-chrome);
|
|
11069
11071
|
}
|
|
11070
11072
|
@media (hover: hover) {
|
|
11071
11073
|
.kui-TextFieldRoot:where(.kui-variant-raised):where(:hover:not(:has(.kui-TextFieldInput:where(:focus,:disabled,:-moz-read-only)))) {
|
|
@@ -11420,6 +11422,173 @@
|
|
|
11420
11422
|
filter: none;
|
|
11421
11423
|
}
|
|
11422
11424
|
}
|
|
11425
|
+
.kui-TextFieldGroup {
|
|
11426
|
+
display: grid;
|
|
11427
|
+
grid-auto-flow: column;
|
|
11428
|
+
grid-auto-columns: minmax(0, 1fr);
|
|
11429
|
+
position: relative;
|
|
11430
|
+
isolation: isolate;
|
|
11431
|
+
border-radius: var(--text-field-border-radius);
|
|
11432
|
+
}
|
|
11433
|
+
.kui-TextFieldGroup::after {
|
|
11434
|
+
content: '';
|
|
11435
|
+
position: absolute;
|
|
11436
|
+
inset: 0;
|
|
11437
|
+
z-index: 2;
|
|
11438
|
+
border-radius: inherit;
|
|
11439
|
+
-webkit-box-shadow: var(--text-field-group-edge);
|
|
11440
|
+
box-shadow: var(--text-field-group-edge);
|
|
11441
|
+
pointer-events: none;
|
|
11442
|
+
}
|
|
11443
|
+
.kui-TextFieldGroup:where(.kui-r-size-1) {
|
|
11444
|
+
--text-field-border-radius: var(--radius-control-1);
|
|
11445
|
+
}
|
|
11446
|
+
.kui-TextFieldGroup:where(.kui-r-size-2) {
|
|
11447
|
+
--text-field-border-radius: var(--radius-control-2);
|
|
11448
|
+
}
|
|
11449
|
+
.kui-TextFieldGroup:where(.kui-r-size-3) {
|
|
11450
|
+
--text-field-border-radius: var(--radius-control-3);
|
|
11451
|
+
}
|
|
11452
|
+
.kui-TextFieldGroup:where(.kui-r-size-4) {
|
|
11453
|
+
--text-field-border-radius: var(--radius-control-4);
|
|
11454
|
+
}
|
|
11455
|
+
@media (min-width: 520px) {
|
|
11456
|
+
.kui-TextFieldGroup:where(.xs\:kui-r-size-1) {
|
|
11457
|
+
--text-field-border-radius: var(--radius-control-1);
|
|
11458
|
+
}
|
|
11459
|
+
.kui-TextFieldGroup:where(.xs\:kui-r-size-2) {
|
|
11460
|
+
--text-field-border-radius: var(--radius-control-2);
|
|
11461
|
+
}
|
|
11462
|
+
.kui-TextFieldGroup:where(.xs\:kui-r-size-3) {
|
|
11463
|
+
--text-field-border-radius: var(--radius-control-3);
|
|
11464
|
+
}
|
|
11465
|
+
.kui-TextFieldGroup:where(.xs\:kui-r-size-4) {
|
|
11466
|
+
--text-field-border-radius: var(--radius-control-4);
|
|
11467
|
+
}
|
|
11468
|
+
}
|
|
11469
|
+
@media (min-width: 768px) {
|
|
11470
|
+
.kui-TextFieldGroup:where(.sm\:kui-r-size-1) {
|
|
11471
|
+
--text-field-border-radius: var(--radius-control-1);
|
|
11472
|
+
}
|
|
11473
|
+
.kui-TextFieldGroup:where(.sm\:kui-r-size-2) {
|
|
11474
|
+
--text-field-border-radius: var(--radius-control-2);
|
|
11475
|
+
}
|
|
11476
|
+
.kui-TextFieldGroup:where(.sm\:kui-r-size-3) {
|
|
11477
|
+
--text-field-border-radius: var(--radius-control-3);
|
|
11478
|
+
}
|
|
11479
|
+
.kui-TextFieldGroup:where(.sm\:kui-r-size-4) {
|
|
11480
|
+
--text-field-border-radius: var(--radius-control-4);
|
|
11481
|
+
}
|
|
11482
|
+
}
|
|
11483
|
+
@media (min-width: 1024px) {
|
|
11484
|
+
.kui-TextFieldGroup:where(.md\:kui-r-size-1) {
|
|
11485
|
+
--text-field-border-radius: var(--radius-control-1);
|
|
11486
|
+
}
|
|
11487
|
+
.kui-TextFieldGroup:where(.md\:kui-r-size-2) {
|
|
11488
|
+
--text-field-border-radius: var(--radius-control-2);
|
|
11489
|
+
}
|
|
11490
|
+
.kui-TextFieldGroup:where(.md\:kui-r-size-3) {
|
|
11491
|
+
--text-field-border-radius: var(--radius-control-3);
|
|
11492
|
+
}
|
|
11493
|
+
.kui-TextFieldGroup:where(.md\:kui-r-size-4) {
|
|
11494
|
+
--text-field-border-radius: var(--radius-control-4);
|
|
11495
|
+
}
|
|
11496
|
+
}
|
|
11497
|
+
@media (min-width: 1280px) {
|
|
11498
|
+
.kui-TextFieldGroup:where(.lg\:kui-r-size-1) {
|
|
11499
|
+
--text-field-border-radius: var(--radius-control-1);
|
|
11500
|
+
}
|
|
11501
|
+
.kui-TextFieldGroup:where(.lg\:kui-r-size-2) {
|
|
11502
|
+
--text-field-border-radius: var(--radius-control-2);
|
|
11503
|
+
}
|
|
11504
|
+
.kui-TextFieldGroup:where(.lg\:kui-r-size-3) {
|
|
11505
|
+
--text-field-border-radius: var(--radius-control-3);
|
|
11506
|
+
}
|
|
11507
|
+
.kui-TextFieldGroup:where(.lg\:kui-r-size-4) {
|
|
11508
|
+
--text-field-border-radius: var(--radius-control-4);
|
|
11509
|
+
}
|
|
11510
|
+
}
|
|
11511
|
+
@media (min-width: 1640px) {
|
|
11512
|
+
.kui-TextFieldGroup:where(.xl\:kui-r-size-1) {
|
|
11513
|
+
--text-field-border-radius: var(--radius-control-1);
|
|
11514
|
+
}
|
|
11515
|
+
.kui-TextFieldGroup:where(.xl\:kui-r-size-2) {
|
|
11516
|
+
--text-field-border-radius: var(--radius-control-2);
|
|
11517
|
+
}
|
|
11518
|
+
.kui-TextFieldGroup:where(.xl\:kui-r-size-3) {
|
|
11519
|
+
--text-field-border-radius: var(--radius-control-3);
|
|
11520
|
+
}
|
|
11521
|
+
.kui-TextFieldGroup:where(.xl\:kui-r-size-4) {
|
|
11522
|
+
--text-field-border-radius: var(--radius-control-4);
|
|
11523
|
+
}
|
|
11524
|
+
}
|
|
11525
|
+
.kui-TextFieldGroup:where(.kui-variant-raised) {
|
|
11526
|
+
--text-field-group-edge: var(--field-chrome);
|
|
11527
|
+
--text-field-group-divider: var(--neutral-a4);
|
|
11528
|
+
}
|
|
11529
|
+
.kui-TextFieldGroup:where(.kui-variant-raised):where([data-disabled]) {
|
|
11530
|
+
--text-field-group-edge: inset 0 0 0 1px var(--field-edge-disabled);
|
|
11531
|
+
}
|
|
11532
|
+
.kui-TextFieldGroup:where(.kui-variant-outline, .kui-variant-surface) {
|
|
11533
|
+
--text-field-group-edge: inset 0 0 0 1px var(--accent-6);
|
|
11534
|
+
--text-field-group-divider: var(--accent-6);
|
|
11535
|
+
}
|
|
11536
|
+
.kui-TextFieldGroup:where(.kui-variant-outline,.kui-variant-surface):where([data-disabled]) {
|
|
11537
|
+
--text-field-group-edge: inset 0 0 0 1px var(--neutral-a6);
|
|
11538
|
+
--text-field-group-divider: var(--neutral-a6);
|
|
11539
|
+
}
|
|
11540
|
+
.kui-TextFieldGroup:where(.kui-variant-soft) {
|
|
11541
|
+
--text-field-group-edge: none;
|
|
11542
|
+
--text-field-group-divider: var(--accent-a5);
|
|
11543
|
+
}
|
|
11544
|
+
.kui-TextFieldGroup:where(.kui-variant-ghost) {
|
|
11545
|
+
--text-field-group-edge: none;
|
|
11546
|
+
--text-field-group-divider: var(--neutral-a5);
|
|
11547
|
+
}
|
|
11548
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot {
|
|
11549
|
+
position: relative;
|
|
11550
|
+
border-radius: 0;
|
|
11551
|
+
-webkit-box-shadow: none;
|
|
11552
|
+
box-shadow: none;
|
|
11553
|
+
}
|
|
11554
|
+
:is(.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot):focus-within {
|
|
11555
|
+
z-index: 3;
|
|
11556
|
+
}
|
|
11557
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper:first-child > .kui-TextFieldRoot {
|
|
11558
|
+
border-start-start-radius: var(--text-field-border-radius);
|
|
11559
|
+
border-end-start-radius: var(--text-field-border-radius);
|
|
11560
|
+
}
|
|
11561
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper:last-child > .kui-TextFieldRoot {
|
|
11562
|
+
border-start-end-radius: var(--text-field-border-radius);
|
|
11563
|
+
border-end-end-radius: var(--text-field-border-radius);
|
|
11564
|
+
}
|
|
11565
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper + .kui-TextFieldWrapper > .kui-TextFieldRoot::before {
|
|
11566
|
+
content: '';
|
|
11567
|
+
position: absolute;
|
|
11568
|
+
z-index: 1;
|
|
11569
|
+
inset-block: 0;
|
|
11570
|
+
inset-inline-start: 0;
|
|
11571
|
+
width: 1px;
|
|
11572
|
+
background-color: var(--text-field-group-divider);
|
|
11573
|
+
pointer-events: none;
|
|
11574
|
+
}
|
|
11575
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot:focus-within::before,
|
|
11576
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper:has(> .kui-TextFieldRoot:focus-within) + .kui-TextFieldWrapper > .kui-TextFieldRoot::before {
|
|
11577
|
+
opacity: 0;
|
|
11578
|
+
}
|
|
11579
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot:has(> .kui-TextFieldInput[aria-invalid='true']) {
|
|
11580
|
+
z-index: 3;
|
|
11581
|
+
-webkit-box-shadow: inset 0 0 0 1px var(--red-6);
|
|
11582
|
+
box-shadow: inset 0 0 0 1px var(--red-6);
|
|
11583
|
+
}
|
|
11584
|
+
@media (forced-colors: active) {
|
|
11585
|
+
.kui-TextFieldGroup {
|
|
11586
|
+
border: 1px solid CanvasText;
|
|
11587
|
+
}
|
|
11588
|
+
.kui-TextFieldGroup > .kui-TextFieldWrapper > .kui-TextFieldRoot {
|
|
11589
|
+
border: none;
|
|
11590
|
+
}
|
|
11591
|
+
}
|
|
11423
11592
|
.kui-ComboboxContent {
|
|
11424
11593
|
--combobox-list-max-height: calc(300px * var(--scale));
|
|
11425
11594
|
-ms-scroll-chaining: none;
|
|
@@ -13779,6 +13948,37 @@
|
|
|
13779
13948
|
height: var(--icon-size-4);
|
|
13780
13949
|
}
|
|
13781
13950
|
}
|
|
13951
|
+
.kui-SegmentedControlRoot:where(.kui-variant-raised, .kui-variant-outline) {
|
|
13952
|
+
--segmented-control-indicator-background-color: var(--neutral-a4);
|
|
13953
|
+
}
|
|
13954
|
+
.kui-SegmentedControlRoot:where(.kui-variant-raised,.kui-variant-outline) :where(.kui-SegmentedControlIndicator)::before {
|
|
13955
|
+
inset: var(--segmented-control-indicator-inset);
|
|
13956
|
+
border-radius: max(var(--border-width-standard), calc(var(--segmented-control-border-radius) - var(--segmented-control-indicator-inset)));
|
|
13957
|
+
-webkit-box-shadow: none;
|
|
13958
|
+
box-shadow: none;
|
|
13959
|
+
}
|
|
13960
|
+
.kui-SegmentedControlRoot:where(.kui-variant-raised) {
|
|
13961
|
+
--segmented-control-indicator-inset: 2px;
|
|
13962
|
+
background-color: var(--field-fill);
|
|
13963
|
+
-webkit-box-shadow: var(--field-chrome);
|
|
13964
|
+
box-shadow: var(--field-chrome);
|
|
13965
|
+
}
|
|
13966
|
+
.kui-SegmentedControlRoot:where(.kui-variant-raised):where([data-disabled]) {
|
|
13967
|
+
background-color: var(--field-fill-disabled);
|
|
13968
|
+
-webkit-box-shadow: inset 0 0 0 1px var(--field-edge-disabled);
|
|
13969
|
+
box-shadow: inset 0 0 0 1px var(--field-edge-disabled);
|
|
13970
|
+
}
|
|
13971
|
+
.kui-SegmentedControlRoot:where(.kui-variant-outline) {
|
|
13972
|
+
--segmented-control-indicator-inset: 2px;
|
|
13973
|
+
background-color: transparent;
|
|
13974
|
+
-webkit-box-shadow: inset 0 0 0 1px var(--neutral-6);
|
|
13975
|
+
box-shadow: inset 0 0 0 1px var(--neutral-6);
|
|
13976
|
+
}
|
|
13977
|
+
.kui-SegmentedControlRoot:where(.kui-variant-outline):where([data-disabled]) {
|
|
13978
|
+
background-color: transparent;
|
|
13979
|
+
-webkit-box-shadow: inset 0 0 0 1px var(--neutral-a6);
|
|
13980
|
+
box-shadow: inset 0 0 0 1px var(--neutral-a6);
|
|
13981
|
+
}
|
|
13782
13982
|
.kui-SegmentedControlItem:where([data-icon-only]) {
|
|
13783
13983
|
min-width: var(--segmented-control-height);
|
|
13784
13984
|
}
|
|
@@ -14973,8 +15173,8 @@
|
|
|
14973
15173
|
position: relative;
|
|
14974
15174
|
color: var(--accent-ink);
|
|
14975
15175
|
background-color: var(--field-fill);
|
|
14976
|
-
-webkit-box-shadow: var(--
|
|
14977
|
-
box-shadow: var(--
|
|
15176
|
+
-webkit-box-shadow: var(--field-chrome);
|
|
15177
|
+
box-shadow: var(--field-chrome);
|
|
14978
15178
|
}
|
|
14979
15179
|
.kui-SelectTrigger:where(.kui-variant-raised):where(:focus-visible) {
|
|
14980
15180
|
outline: 2px solid var(--focus-8);
|
|
@@ -19980,8 +20180,8 @@
|
|
|
19980
20180
|
--v-selection-color: var(--focus-a5);
|
|
19981
20181
|
--v-focus-color: var(--focus-8);
|
|
19982
20182
|
background-color: var(--field-fill);
|
|
19983
|
-
-webkit-box-shadow: var(--
|
|
19984
|
-
box-shadow: var(--
|
|
20183
|
+
-webkit-box-shadow: var(--field-chrome);
|
|
20184
|
+
box-shadow: var(--field-chrome);
|
|
19985
20185
|
}
|
|
19986
20186
|
:is(.kui-TextAreaRoot:where(.kui-variant-raised) :where(.kui-TextAreaInput))::-webkit-input-placeholder {
|
|
19987
20187
|
color: var(--neutral-a10);
|
package/tokens/base.css
CHANGED
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
--surface-chrome: var(--shadow-4);
|
|
119
119
|
--control-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 14px -4px rgb(0 0 0 / 0.08);
|
|
120
120
|
--control-chrome-active: inset 0 0 0 1px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.04);
|
|
121
|
+
--field-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
|
|
121
122
|
--control-light: none;
|
|
122
123
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.16), 0 2px 6px -1px rgb(0 0 0 / 0.18);
|
|
123
124
|
--floating-chrome: var(--shadow-3);
|
|
@@ -149,6 +150,7 @@
|
|
|
149
150
|
--surface-chrome: var(--shadow-4);
|
|
150
151
|
--control-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.35), 0 4px 14px -4px rgb(0 0 0 / 0.45);
|
|
151
152
|
--control-chrome-active: inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 1px rgb(0 0 0 / 0.4);
|
|
153
|
+
--field-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.3);
|
|
152
154
|
--control-light: none;
|
|
153
155
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 6px -1px rgb(0 0 0 / 0.4);
|
|
154
156
|
--floating-chrome: inset 0 1px 0 rgb(255 255 255 / 0.05), var(--shadow-3);
|
package/tokens.css
CHANGED
|
@@ -3434,6 +3434,7 @@
|
|
|
3434
3434
|
--surface-chrome: var(--shadow-4);
|
|
3435
3435
|
--control-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 14px -4px rgb(0 0 0 / 0.08);
|
|
3436
3436
|
--control-chrome-active: inset 0 0 0 1px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.04);
|
|
3437
|
+
--field-chrome: inset 0 0 0 1px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04);
|
|
3437
3438
|
--control-light: none;
|
|
3438
3439
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.16), 0 2px 6px -1px rgb(0 0 0 / 0.18);
|
|
3439
3440
|
--floating-chrome: var(--shadow-3);
|
|
@@ -3495,6 +3496,7 @@
|
|
|
3495
3496
|
--surface-chrome: var(--shadow-4);
|
|
3496
3497
|
--control-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.35), 0 4px 14px -4px rgb(0 0 0 / 0.45);
|
|
3497
3498
|
--control-chrome-active: inset 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 1px rgb(0 0 0 / 0.4);
|
|
3499
|
+
--field-chrome: inset 0 0 0 1px rgb(255 255 255 / 0.08), 0 1px 2px rgb(0 0 0 / 0.3);
|
|
3498
3500
|
--control-light: none;
|
|
3499
3501
|
--grip-chrome: 0 1px 2px rgb(0 0 0 / 0.5), 0 2px 6px -1px rgb(0 0 0 / 0.4);
|
|
3500
3502
|
--floating-chrome: inset 0 1px 0 rgb(255 255 255 / 0.05), var(--shadow-3);
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as e}from"./chunk-KRJTW535.js";var o=["1","2","3","4"],s=["horizontal","vertical"],r={disabled:{type:"boolean",default:!1},size:{type:"enum",className:"kui-r-size",values:o,default:"2",responsive:!0},orientation:{type:"enum",className:"kui-r-orientation",values:s,default:"horizontal",responsive:!0},...e};export{r as a};
|
|
2
|
-
//# sourceMappingURL=chunk-2ZLMWYJ6.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/segmented-control.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { radiusPropDef } from '../props/radius.prop.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst orientations = ['horizontal', 'vertical'] as const;\n\nconst segmentedControlRootPropDefs = {\n disabled: { type: 'boolean', default: false },\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n orientation: {\n type: 'enum',\n className: 'kui-r-orientation',\n values: orientations,\n default: 'horizontal',\n responsive: true,\n },\n ...radiusPropDef,\n} satisfies {\n disabled?: PropDef<boolean>;\n size: PropDef<(typeof sizes)[number]>;\n orientation: PropDef<(typeof orientations)[number]>;\n};\n\nexport { segmentedControlRootPropDefs };\n"],
|
|
5
|
-
"mappings": "wCAIA,IAAMA,EAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAC3BC,EAAe,CAAC,aAAc,UAAU,EAExCC,EAA+B,CACnC,SAAU,CAAE,KAAM,UAAW,QAAS,EAAM,EAC5C,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQF,EAAO,QAAS,IAAK,WAAY,EAAK,EAC7F,YAAa,CACX,KAAM,OACN,UAAW,oBACX,OAAQC,EACR,QAAS,aACT,WAAY,EACd,EACA,GAAGE,CACL",
|
|
6
|
-
"names": ["sizes", "orientations", "segmentedControlRootPropDefs", "radiusPropDef"]
|
|
7
|
-
}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as e}from"./chunk-P7VSZYG3.js";import{a as o}from"./chunk-UMYPLUG3.js";import{b as s}from"./chunk-KRJTW535.js";import{c as r}from"./chunk-CUNKWFKA.js";var t=["1","2","3","4"],p=["raised","surface","soft","ghost","outline"],d={size:{type:"enum",className:"kui-r-size",values:t,default:"2",responsive:!0},variant:{type:"enum",className:"kui-variant",values:p,default:"raised"},error:{type:"boolean",default:!1},errorMessage:{type:"string",default:void 0},required:{type:"boolean",default:!1},"aria-describedby":{type:"string",default:void 0},"aria-labelledby":{type:"string",default:void 0},...r,...s},i=["left","right"],l={side:{type:"enum",values:i},...r,gap:o.gap,px:e.px,pl:e.pl,pr:e.pr};export{d as a,l as b};
|
|
2
|
-
//# sourceMappingURL=chunk-BP64M73W.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/components/text-field.props.tsx"],
|
|
4
|
-
"sourcesContent": ["import { colorPropDef } from '../props/color.prop.js';\nimport { paddingPropDefs } from '../props/padding.props.js';\nimport { radiusPropDef } from '../props/radius.prop.js';\nimport { flexPropDefs } from './flex.props.js';\n\nimport type { PropDef } from '../props/prop-def.js';\n\nconst sizes = ['1', '2', '3', '4'] as const;\nconst variants = ['raised', 'surface', 'soft', 'ghost', 'outline'] as const;\n\nconst textFieldRootPropDefs = {\n size: { type: 'enum', className: 'kui-r-size', values: sizes, default: '2', responsive: true },\n variant: { type: 'enum', className: 'kui-variant', values: variants, default: 'raised' },\n // Error and validation props\n error: { type: 'boolean', default: false },\n errorMessage: { type: 'string', default: undefined },\n required: { type: 'boolean', default: false },\n // Accessibility props\n 'aria-describedby': { type: 'string', default: undefined },\n 'aria-labelledby': { type: 'string', default: undefined },\n ...colorPropDef,\n ...radiusPropDef,\n} satisfies {\n size: PropDef<(typeof sizes)[number]>;\n variant: PropDef<(typeof variants)[number]>;\n error: PropDef<boolean>;\n errorMessage: PropDef<string | undefined>;\n required: PropDef<boolean>;\n 'aria-describedby': PropDef<string | undefined>;\n 'aria-labelledby': PropDef<string | undefined>;\n};\n\nconst sides = ['left', 'right'] as const;\n\nconst textFieldSlotPropDefs = {\n side: { type: 'enum', values: sides },\n ...colorPropDef,\n gap: flexPropDefs.gap,\n px: paddingPropDefs.px,\n pl: paddingPropDefs.pl,\n pr: paddingPropDefs.pr,\n} satisfies {\n side: PropDef<(typeof sides)[number]>;\n gap: typeof flexPropDefs.gap;\n px: typeof paddingPropDefs.px;\n pl: typeof paddingPropDefs.pl;\n pr: typeof paddingPropDefs.pr;\n};\n\n/** Scrubbing props for TextField.Slot - handled separately from PropDef system */\ninterface TextFieldSlotScrubProps {\n /** Enable scrubbing behavior on this slot */\n scrub?: boolean;\n /** Current value (required for min/max clamping to work correctly) */\n scrubValue?: number;\n /** Base value change per movement unit (default: 1) */\n scrubStep?: number;\n /** Pixels of movement per step - higher = less sensitive (default: 1) */\n scrubSensitivity?: number;\n /** Minimum allowed value */\n scrubMin?: number;\n /** Maximum allowed value */\n scrubMax?: number;\n /** Step multiplier when Shift is held (default: 10) */\n scrubShiftMultiplier?: number;\n /** Step multiplier when Alt/Option is held (default: 0.1) */\n scrubAltMultiplier?: number;\n /**\n * Callback fired during scrubbing with the value delta\n * @param delta - The change in value\n * @param isChanging - true while dragging, false when released\n */\n onScrub?: (delta: number, isChanging: boolean) => void;\n}\n\nexport type { TextFieldSlotScrubProps };\n\nexport { textFieldRootPropDefs, textFieldSlotPropDefs };\n"],
|
|
5
|
-
"mappings": "gKAOA,IAAMA,EAAQ,CAAC,IAAK,IAAK,IAAK,GAAG,EAC3BC,EAAW,CAAC,SAAU,UAAW,OAAQ,QAAS,SAAS,EAE3DC,EAAwB,CAC5B,KAAM,CAAE,KAAM,OAAQ,UAAW,aAAc,OAAQF,EAAO,QAAS,IAAK,WAAY,EAAK,EAC7F,QAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,OAAQC,EAAU,QAAS,QAAS,EAEvF,MAAO,CAAE,KAAM,UAAW,QAAS,EAAM,EACzC,aAAc,CAAE,KAAM,SAAU,QAAS,MAAU,EACnD,SAAU,CAAE,KAAM,UAAW,QAAS,EAAM,EAE5C,mBAAoB,CAAE,KAAM,SAAU,QAAS,MAAU,EACzD,kBAAmB,CAAE,KAAM,SAAU,QAAS,MAAU,EACxD,GAAGE,EACH,GAAGC,CACL,EAUMC,EAAQ,CAAC,OAAQ,OAAO,EAExBC,EAAwB,CAC5B,KAAM,CAAE,KAAM,OAAQ,OAAQD,CAAM,EACpC,GAAGF,EACH,IAAKI,EAAa,IAClB,GAAIC,EAAgB,GACpB,GAAIA,EAAgB,GACpB,GAAIA,EAAgB,EACtB",
|
|
6
|
-
"names": ["sizes", "variants", "textFieldRootPropDefs", "colorPropDef", "radiusPropDef", "sides", "textFieldSlotPropDefs", "flexPropDefs", "paddingPropDefs"]
|
|
7
|
-
}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{c as y}from"./chunk-OKQAVYW4.js";import{c as v}from"./chunk-5ON3XLRD.js";import{b as R}from"./chunk-XU74PNM2.js";import{a as K}from"./chunk-VQPANPMI.js";var q={};K(q,{Item:()=>x,Root:()=>b});import*as e from"react";import S from"classnames";import{ToggleGroup as I}from"radix-ui";import{useComposedRefs as F,useControllableState as H,useLayoutEffect as j}from"radix-ui/internal";var M=["1","2","3","4"],O=["horizontal","vertical"],u={disabled:{type:"boolean",default:!1},size:{type:"enum",className:"kui-r-size",values:M,default:"2",responsive:!0},orientation:{type:"enum",className:"kui-r-orientation",values:O,default:"horizontal",responsive:!0},...R};var h=e.createContext(null),W=new Set(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"]),b=e.forwardRef((n,s)=>{let a=v(n,u.size),{className:l,children:t,radius:i,value:m,defaultValue:p,onValueChange:w,style:D,disabled:c,onKeyDown:N,onPointerDown:k,...T}=y(a,u),[f,d]=H({prop:m,onChange:w,defaultProp:p??""}),r=e.useRef(!1),A=e.useMemo(()=>({selectFromKeyboard(o){r.current&&(r.current=!1,d(o))}}),[d]),g=e.useRef(null),V=F(s,g),C=e.Children.toArray(t).filter(e.isValidElement),z=C.length,G=Math.max(0,C.findIndex(o=>o.props.value===f));return j(()=>{let o=g.current;if(!o)return;let P=Array.from(o.querySelectorAll(":scope > .kui-SegmentedControlItem")),L=P.findIndex(E=>E.getAttribute("data-state")==="on");o.style.setProperty("--segmented-control-count",String(P.length||1)),o.style.setProperty("--segmented-control-index",String(Math.max(0,L)))}),e.createElement(h.Provider,{value:A},e.createElement(I.Root,{"data-disabled":c||void 0,"data-radius":i,ref:V,style:{"--segmented-control-count":z||1,"--segmented-control-index":G,...D},className:S("kui-SegmentedControlRoot",l),onValueChange:o=>{o&&d(o)},onKeyDown:o=>{N?.(o),r.current=W.has(o.key)},onPointerDown:o=>{k?.(o),r.current=!1},...T,type:"single",value:f,asChild:!1,disabled:!!c},t,e.createElement("div",{className:"kui-SegmentedControlIndicator"})))});b.displayName="SegmentedControl.Root";var x=e.forwardRef(({children:n,className:s,iconOnly:a,onFocus:l,...t},i)=>{let m=e.useContext(h);return e.createElement(I.Item,{ref:i,className:S("kui-reset","kui-SegmentedControlItem",s),"data-icon-only":a||void 0,onFocus:p=>{l?.(p),m?.selectFromKeyboard(t.value)},...t,asChild:!1},e.createElement("span",{className:"kui-SegmentedControlItemSeparator"}),e.createElement("span",{className:"kui-SegmentedControlItemLabel"},e.createElement("span",{className:"kui-SegmentedControlItemLabelActive"},n),e.createElement("span",{className:"kui-SegmentedControlItemLabelInactive","aria-hidden":!0},n)))});x.displayName="SegmentedControl.Item";export{b as a,x as b,q as c};
|
|
3
|
-
//# sourceMappingURL=chunk-W4Z6ORYO.js.map
|