@urbicon-ui/blocks 6.30.0 → 6.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Calendar/Calendar.svelte +17 -21
- package/dist/components/Calendar/CalendarAgendaView.svelte +9 -3
- package/dist/components/Calendar/CalendarDayView.svelte +9 -3
- package/dist/components/Calendar/CalendarGrid.svelte +9 -3
- package/dist/components/Calendar/CalendarWeekGrid.svelte +9 -3
- package/dist/components/Calendar/CalendarYearGrid.svelte +12 -3
- package/dist/components/CommandPalette/commandPalette.variants.js +9 -4
- package/dist/primitives/Accordion/accordion.variants.d.ts +7 -7
- package/dist/primitives/Accordion/accordion.variants.js +4 -4
- package/dist/primitives/Accordion/index.d.ts +2 -2
- package/dist/primitives/Button/Button.svelte +23 -7
- package/dist/primitives/Combobox/Combobox.svelte +11 -3
- package/dist/primitives/Combobox/combobox.variants.d.ts +9 -0
- package/dist/primitives/Combobox/combobox.variants.js +22 -4
- package/dist/primitives/Combobox/index.d.ts +2 -2
- package/dist/primitives/Menu/menu.variants.js +13 -5
- package/dist/primitives/SegmentGroup/SegmentGroup.svelte +4 -4
- package/dist/primitives/SegmentGroup/SegmentItem.svelte +1 -1
- package/dist/primitives/SegmentGroup/index.d.ts +1 -1
- package/dist/primitives/SegmentGroup/segmentgroup.variants.d.ts +4 -4
- package/dist/primitives/SegmentGroup/segmentgroup.variants.js +15 -15
- package/dist/primitives/Select/select.variants.js +21 -7
- package/dist/primitives/Slider/Slider.svelte +2 -2
- package/dist/primitives/Slider/slider.variants.d.ts +14 -14
- package/dist/primitives/Slider/slider.variants.js +13 -13
- package/dist/primitives/Toggle/Toggle.svelte +2 -2
- package/dist/primitives/Toggle/index.d.ts +1 -1
- package/dist/primitives/Toggle/toggle.variants.d.ts +7 -7
- package/dist/primitives/Toggle/toggle.variants.js +32 -32
- package/docs/MIGRATION-v5.md +7 -5
- package/package.json +3 -3
|
@@ -33,12 +33,12 @@ export const segmentGroupVariants = tv({
|
|
|
33
33
|
'group-data-[collapsed]:w-full group-data-[collapsed]:justify-start',
|
|
34
34
|
'font-medium whitespace-nowrap cursor-pointer select-none',
|
|
35
35
|
// `border-0` (not `border-none`) — keeps `border-style: solid` so the
|
|
36
|
-
// text-
|
|
36
|
+
// text-variant can add `border-b-[1.5px]` without a style conflict.
|
|
37
37
|
'border-0 bg-transparent',
|
|
38
38
|
// Note: weight is intentionally not transitioned and not bumped on
|
|
39
39
|
// active. Changing font weight on selection caused horizontal
|
|
40
40
|
// reflow of sibling items (knob-strips wrapping mid-row). The
|
|
41
|
-
// indicator (default
|
|
41
|
+
// indicator (default variant) / underline (text variant)
|
|
42
42
|
// already signal active state — the colour shift below adds the
|
|
43
43
|
// semantic emphasis without altering layout.
|
|
44
44
|
'transition-colors duration-[var(--blocks-duration-fast)] ease-out',
|
|
@@ -49,7 +49,7 @@ export const segmentGroupVariants = tv({
|
|
|
49
49
|
'data-[state=active]:text-text-primary'
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
|
-
//
|
|
52
|
+
// Variant contract (see docs/ARCHITECTURE.md §Component Styling
|
|
53
53
|
// for the surface-token hierarchy and docs/COMPONENT-FAMILIES.md §Navigation):
|
|
54
54
|
// default → classic pill-track look with an animated indicator
|
|
55
55
|
// text → no box frame; items are bare buttons, the active one
|
|
@@ -61,8 +61,8 @@ export const segmentGroupVariants = tv({
|
|
|
61
61
|
// canonical pill-track surface in the 3-tier vocabulary. `modify`
|
|
62
62
|
// produces a soft-rectangle track + indicator + item for compact
|
|
63
63
|
// inline-toolbar contexts (usually inherited from a wrapping
|
|
64
|
-
// `<Toolbar tier="modify">` via TierContext). When `
|
|
65
|
-
// the tier is moot — the
|
|
64
|
+
// `<Toolbar tier="modify">` via TierContext). When `variant="text"`
|
|
65
|
+
// the tier is moot — the variant override flattens the track to
|
|
66
66
|
// `rounded-none` and the items wear their underline instead.
|
|
67
67
|
tier: {
|
|
68
68
|
commit: {
|
|
@@ -76,7 +76,7 @@ export const segmentGroupVariants = tv({
|
|
|
76
76
|
item: 'rounded-modify'
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
|
|
79
|
+
variant: {
|
|
80
80
|
default: {},
|
|
81
81
|
text: {
|
|
82
82
|
// Radius flattening (`rounded-none`) and track-padding reset (`p-0`)
|
|
@@ -89,7 +89,7 @@ export const segmentGroupVariants = tv({
|
|
|
89
89
|
'border-b-[1.5px] border-b-transparent',
|
|
90
90
|
'data-[state=active]:border-b-primary',
|
|
91
91
|
'data-[state=active]:bg-transparent data-[state=active]:shadow-none',
|
|
92
|
-
// text-
|
|
92
|
+
// text-variant overrides the base `font-medium` so SegmentGroup
|
|
93
93
|
// text sits at the same weight as adjacent Select/Input values in
|
|
94
94
|
// editorial knob-strip contexts. Active state remains distinct via
|
|
95
95
|
// border-b-primary + text-text-primary — no need for weight to
|
|
@@ -125,22 +125,22 @@ export const segmentGroupVariants = tv({
|
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
127
|
compoundVariants: [
|
|
128
|
-
// Text-
|
|
128
|
+
// Text-variant flattens the corner radius (regardless of tier) and
|
|
129
129
|
// zeroes the track padding (regardless of size). Compounds resolve after
|
|
130
130
|
// every variant axis, so these deterministically replace the tier-stage
|
|
131
131
|
// `rounded-{commit|modify}` and the size-stage `p-*`.
|
|
132
|
-
{
|
|
133
|
-
// Text-
|
|
132
|
+
{ variant: 'text', class: { base: 'rounded-none p-0', item: 'rounded-none' } },
|
|
133
|
+
// Text-variant sizing: padding/sizing more compact than the pill-track,
|
|
134
134
|
// but still WCAG 2.5.5 AA (≥ 24px tap height). For touch-first contexts
|
|
135
|
-
// the `default`
|
|
135
|
+
// the `default` variant should be used — text is primarily intended
|
|
136
136
|
// for cursor-driven toolbar/knob-strip contexts.
|
|
137
|
-
{
|
|
138
|
-
{
|
|
139
|
-
{
|
|
137
|
+
{ variant: 'text', size: 'sm', class: { item: 'px-2 py-1.5 text-xs' } },
|
|
138
|
+
{ variant: 'text', size: 'md', class: { item: 'px-2.5 py-2 text-sm' } },
|
|
139
|
+
{ variant: 'text', size: 'lg', class: { item: 'px-3 py-2.5 text-base' } }
|
|
140
140
|
],
|
|
141
141
|
defaultVariants: {
|
|
142
142
|
tier: 'commit',
|
|
143
|
-
|
|
143
|
+
variant: 'default',
|
|
144
144
|
size: 'md',
|
|
145
145
|
fullWidth: false,
|
|
146
146
|
disabled: false
|
|
@@ -55,7 +55,10 @@ export const selectVariants = tv({
|
|
|
55
55
|
'bg-surface-base transition-colors duration-[var(--blocks-duration-fast)]',
|
|
56
56
|
'[&_svg]:opacity-0 [&_svg]:transition-opacity [&_svg]:duration-[var(--blocks-duration-fast)]'
|
|
57
57
|
],
|
|
58
|
-
|
|
58
|
+
// `space-y-0.5` keeps grouped options on the same item-to-item rhythm as
|
|
59
|
+
// the flat listbox (whose spacing lives on the `listbox` slot) — without
|
|
60
|
+
// it, adjacent selected-highlights inside a group touch (XC-9).
|
|
61
|
+
group: ['space-y-0.5'],
|
|
59
62
|
groupLabel: ['px-3 py-1.5 text-xs font-medium text-text-tertiary uppercase tracking-wider'],
|
|
60
63
|
label: ['block font-medium text-text-secondary text-sm'],
|
|
61
64
|
message: ['text-xs']
|
|
@@ -84,21 +87,26 @@ export const selectVariants = tv({
|
|
|
84
87
|
size: {
|
|
85
88
|
// Full xs–xl scale, mirroring Input's h-7…h-14 ladder (form-family
|
|
86
89
|
// symmetry: a dense form should not pair an xs Input with an sm Select).
|
|
90
|
+
// Option inset (`px`) and the group label track the shared listbox item
|
|
91
|
+
// rhythm (XC-9): px-2 below md, px-3 at md/lg (slot base), px-4 at xl —
|
|
92
|
+
// the group header always shares the item's horizontal inset.
|
|
87
93
|
xs: {
|
|
88
94
|
trigger: 'h-7 pl-2 pr-7 text-xs gap-1.5',
|
|
89
95
|
chevron: 'w-3 h-3',
|
|
90
96
|
clear: 'right-1.5 p-0.5 [&_svg]:w-3 [&_svg]:h-3',
|
|
91
|
-
option: 'py-1 text-xs min-h-[1.75rem]',
|
|
97
|
+
option: 'px-2 py-1 text-xs min-h-[1.75rem]',
|
|
92
98
|
optionCheck: 'w-3 h-3',
|
|
93
|
-
optionCheckbox: 'w-3 h-3 [&_svg]:w-2 [&_svg]:h-2'
|
|
99
|
+
optionCheckbox: 'w-3 h-3 [&_svg]:w-2 [&_svg]:h-2',
|
|
100
|
+
groupLabel: 'px-2'
|
|
94
101
|
},
|
|
95
102
|
sm: {
|
|
96
103
|
trigger: 'h-8 pl-3 pr-8 text-sm gap-2',
|
|
97
104
|
chevron: 'w-3.5 h-3.5',
|
|
98
105
|
clear: 'right-2 p-0.5 [&_svg]:w-3.5 [&_svg]:h-3.5',
|
|
99
|
-
option: 'py-1.5 text-sm min-h-[2rem]',
|
|
106
|
+
option: 'px-2 py-1.5 text-sm min-h-[2rem]',
|
|
100
107
|
optionCheck: 'w-3.5 h-3.5',
|
|
101
|
-
optionCheckbox: 'w-3.5 h-3.5 [&_svg]:w-2.5 [&_svg]:h-2.5'
|
|
108
|
+
optionCheckbox: 'w-3.5 h-3.5 [&_svg]:w-2.5 [&_svg]:h-2.5',
|
|
109
|
+
groupLabel: 'px-2'
|
|
102
110
|
},
|
|
103
111
|
md: {
|
|
104
112
|
trigger: 'h-10 pl-4 pr-10 text-base gap-2',
|
|
@@ -120,9 +128,10 @@ export const selectVariants = tv({
|
|
|
120
128
|
trigger: 'h-14 pl-6 pr-14 text-xl gap-3',
|
|
121
129
|
chevron: 'w-6 h-6',
|
|
122
130
|
clear: 'right-5 p-1 [&_svg]:w-6 [&_svg]:h-6',
|
|
123
|
-
option: 'py-3 text-lg min-h-[3.5rem]',
|
|
131
|
+
option: 'px-4 py-3 text-lg min-h-[3.5rem]',
|
|
124
132
|
optionCheck: 'w-6 h-6',
|
|
125
|
-
optionCheckbox: 'w-5 h-5 [&_svg]:w-4 [&_svg]:h-4'
|
|
133
|
+
optionCheckbox: 'w-5 h-5 [&_svg]:w-4 [&_svg]:h-4',
|
|
134
|
+
groupLabel: 'px-4'
|
|
126
135
|
}
|
|
127
136
|
},
|
|
128
137
|
open: {
|
|
@@ -153,6 +162,11 @@ export const selectVariants = tv({
|
|
|
153
162
|
},
|
|
154
163
|
selected: {
|
|
155
164
|
true: {
|
|
165
|
+
// Form-family selected signature (parity with Combobox `optionSelected`):
|
|
166
|
+
// persistent value marking = `bg-surface-selected font-medium` + primary
|
|
167
|
+
// check. The keyboard/hover cursor (`bg-surface-hover`, call-site class)
|
|
168
|
+
// still wins the bg bucket, so the cursor stays visible on selected rows.
|
|
169
|
+
option: 'bg-surface-selected font-medium',
|
|
156
170
|
optionCheck: 'opacity-100',
|
|
157
171
|
optionCheckbox: 'border-primary bg-primary text-text-on-primary [&_svg]:opacity-100'
|
|
158
172
|
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
helper,
|
|
22
22
|
intent = 'primary',
|
|
23
23
|
size = 'md',
|
|
24
|
-
|
|
24
|
+
variant = 'default',
|
|
25
25
|
disabled = false,
|
|
26
26
|
name,
|
|
27
27
|
validRange,
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
const variantProps: SliderVariants = $derived({
|
|
232
232
|
intent,
|
|
233
233
|
size,
|
|
234
|
-
|
|
234
|
+
variant,
|
|
235
235
|
disabled: disabled || undefined,
|
|
236
236
|
error: !!error || undefined,
|
|
237
237
|
messageType: error ? 'error' : 'helper',
|
|
@@ -2,7 +2,7 @@ import { type SlotNames, type VariantProps } from '../../utils/variants.js';
|
|
|
2
2
|
export declare const sliderVariants: ((props?: {
|
|
3
3
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
4
4
|
size?: "sm" | "md" | "lg" | undefined;
|
|
5
|
-
|
|
5
|
+
variant?: "default" | "rail" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
messageType?: "error" | "helper" | undefined;
|
|
8
8
|
error?: boolean | undefined;
|
|
@@ -11,7 +11,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
11
11
|
wrapper: (props?: ({
|
|
12
12
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
13
13
|
size?: "sm" | "md" | "lg" | undefined;
|
|
14
|
-
|
|
14
|
+
variant?: "default" | "rail" | undefined;
|
|
15
15
|
disabled?: boolean | undefined;
|
|
16
16
|
messageType?: "error" | "helper" | undefined;
|
|
17
17
|
error?: boolean | undefined;
|
|
@@ -22,7 +22,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
22
22
|
header: (props?: ({
|
|
23
23
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
24
24
|
size?: "sm" | "md" | "lg" | undefined;
|
|
25
|
-
|
|
25
|
+
variant?: "default" | "rail" | undefined;
|
|
26
26
|
disabled?: boolean | undefined;
|
|
27
27
|
messageType?: "error" | "helper" | undefined;
|
|
28
28
|
error?: boolean | undefined;
|
|
@@ -33,7 +33,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
33
33
|
label: (props?: ({
|
|
34
34
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
35
35
|
size?: "sm" | "md" | "lg" | undefined;
|
|
36
|
-
|
|
36
|
+
variant?: "default" | "rail" | undefined;
|
|
37
37
|
disabled?: boolean | undefined;
|
|
38
38
|
messageType?: "error" | "helper" | undefined;
|
|
39
39
|
error?: boolean | undefined;
|
|
@@ -44,7 +44,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
44
44
|
valueText: (props?: ({
|
|
45
45
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
46
46
|
size?: "sm" | "md" | "lg" | undefined;
|
|
47
|
-
|
|
47
|
+
variant?: "default" | "rail" | undefined;
|
|
48
48
|
disabled?: boolean | undefined;
|
|
49
49
|
messageType?: "error" | "helper" | undefined;
|
|
50
50
|
error?: boolean | undefined;
|
|
@@ -55,7 +55,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
55
55
|
base: (props?: ({
|
|
56
56
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
57
57
|
size?: "sm" | "md" | "lg" | undefined;
|
|
58
|
-
|
|
58
|
+
variant?: "default" | "rail" | undefined;
|
|
59
59
|
disabled?: boolean | undefined;
|
|
60
60
|
messageType?: "error" | "helper" | undefined;
|
|
61
61
|
error?: boolean | undefined;
|
|
@@ -66,7 +66,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
66
66
|
track: (props?: ({
|
|
67
67
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
68
68
|
size?: "sm" | "md" | "lg" | undefined;
|
|
69
|
-
|
|
69
|
+
variant?: "default" | "rail" | undefined;
|
|
70
70
|
disabled?: boolean | undefined;
|
|
71
71
|
messageType?: "error" | "helper" | undefined;
|
|
72
72
|
error?: boolean | undefined;
|
|
@@ -77,7 +77,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
77
77
|
range: (props?: ({
|
|
78
78
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
79
79
|
size?: "sm" | "md" | "lg" | undefined;
|
|
80
|
-
|
|
80
|
+
variant?: "default" | "rail" | undefined;
|
|
81
81
|
disabled?: boolean | undefined;
|
|
82
82
|
messageType?: "error" | "helper" | undefined;
|
|
83
83
|
error?: boolean | undefined;
|
|
@@ -88,7 +88,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
88
88
|
thumb: (props?: ({
|
|
89
89
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
90
90
|
size?: "sm" | "md" | "lg" | undefined;
|
|
91
|
-
|
|
91
|
+
variant?: "default" | "rail" | undefined;
|
|
92
92
|
disabled?: boolean | undefined;
|
|
93
93
|
messageType?: "error" | "helper" | undefined;
|
|
94
94
|
error?: boolean | undefined;
|
|
@@ -99,7 +99,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
99
99
|
mark: (props?: ({
|
|
100
100
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
101
101
|
size?: "sm" | "md" | "lg" | undefined;
|
|
102
|
-
|
|
102
|
+
variant?: "default" | "rail" | undefined;
|
|
103
103
|
disabled?: boolean | undefined;
|
|
104
104
|
messageType?: "error" | "helper" | undefined;
|
|
105
105
|
error?: boolean | undefined;
|
|
@@ -110,7 +110,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
110
110
|
boundaryTick: (props?: ({
|
|
111
111
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
112
112
|
size?: "sm" | "md" | "lg" | undefined;
|
|
113
|
-
|
|
113
|
+
variant?: "default" | "rail" | undefined;
|
|
114
114
|
disabled?: boolean | undefined;
|
|
115
115
|
messageType?: "error" | "helper" | undefined;
|
|
116
116
|
error?: boolean | undefined;
|
|
@@ -121,7 +121,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
121
121
|
rangeStatus: (props?: ({
|
|
122
122
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
123
123
|
size?: "sm" | "md" | "lg" | undefined;
|
|
124
|
-
|
|
124
|
+
variant?: "default" | "rail" | undefined;
|
|
125
125
|
disabled?: boolean | undefined;
|
|
126
126
|
messageType?: "error" | "helper" | undefined;
|
|
127
127
|
error?: boolean | undefined;
|
|
@@ -132,7 +132,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
132
132
|
rangeStatusIcon: (props?: ({
|
|
133
133
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
134
134
|
size?: "sm" | "md" | "lg" | undefined;
|
|
135
|
-
|
|
135
|
+
variant?: "default" | "rail" | undefined;
|
|
136
136
|
disabled?: boolean | undefined;
|
|
137
137
|
messageType?: "error" | "helper" | undefined;
|
|
138
138
|
error?: boolean | undefined;
|
|
@@ -143,7 +143,7 @@ export declare const sliderVariants: ((props?: {
|
|
|
143
143
|
message: (props?: ({
|
|
144
144
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
145
145
|
size?: "sm" | "md" | "lg" | undefined;
|
|
146
|
-
|
|
146
|
+
variant?: "default" | "rail" | undefined;
|
|
147
147
|
disabled?: boolean | undefined;
|
|
148
148
|
messageType?: "error" | "helper" | undefined;
|
|
149
149
|
error?: boolean | undefined;
|
|
@@ -80,7 +80,7 @@ export const sliderVariants = tv({
|
|
|
80
80
|
thumb: 'w-7 h-7'
|
|
81
81
|
}
|
|
82
82
|
},
|
|
83
|
-
//
|
|
83
|
+
// Variant contract (mirrors Toggle's `dot` and SegmentGroup's `text`).
|
|
84
84
|
// default → classic pill slider: filled range + 20px thumb with a
|
|
85
85
|
// white center, border in the intent color, shadow + scale on
|
|
86
86
|
// hover. Ideal for mobile and content-light contexts where the
|
|
@@ -95,7 +95,7 @@ export const sliderVariants = tv({
|
|
|
95
95
|
// so the tv() pipeline override can cleanly strip the size stage
|
|
96
96
|
// (h-1/2/3, w-3.5 …) — variants and compounds sit in different stages,
|
|
97
97
|
// and only compounds reliably win against variants.
|
|
98
|
-
|
|
98
|
+
variant: {
|
|
99
99
|
default: {},
|
|
100
100
|
rail: {}
|
|
101
101
|
},
|
|
@@ -147,18 +147,18 @@ export const sliderVariants = tv({
|
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
compoundVariants: [
|
|
150
|
-
// ─── rail
|
|
151
|
-
// Strips the default-
|
|
150
|
+
// ─── rail variant: structural overrides ──────────────────────────
|
|
151
|
+
// Strips the default-variant pill chrome from track, range and
|
|
152
152
|
// thumb. tv() applies compoundVariants after base variants, so the
|
|
153
153
|
// h-px / rounded-none / border-0 overrides win against the size and
|
|
154
154
|
// intent stages without us having to repeat them per-size.
|
|
155
155
|
{
|
|
156
|
-
|
|
156
|
+
variant: 'rail',
|
|
157
157
|
class: {
|
|
158
158
|
track: 'h-px rounded-none bg-border-default',
|
|
159
159
|
range: 'h-px rounded-none',
|
|
160
160
|
thumb: [
|
|
161
|
-
// Reset default-
|
|
161
|
+
// Reset default-variant chrome
|
|
162
162
|
'rounded-full border-0 bg-current shadow-none',
|
|
163
163
|
// Fixed 8×8 visual — rail is size-invariant by design (analogue
|
|
164
164
|
// to Toggle dot, which keeps the same dot size across sm/md/lg).
|
|
@@ -177,17 +177,17 @@ export const sliderVariants = tv({
|
|
|
177
177
|
// bg-current picks up the text-color set here, so we map intent →
|
|
178
178
|
// text-color once instead of overriding bg-primary/secondary/…
|
|
179
179
|
// for every intent.
|
|
180
|
-
{
|
|
181
|
-
{
|
|
182
|
-
{
|
|
183
|
-
{
|
|
184
|
-
{
|
|
185
|
-
{
|
|
180
|
+
{ variant: 'rail', intent: 'primary', class: { thumb: 'text-primary' } },
|
|
181
|
+
{ variant: 'rail', intent: 'secondary', class: { thumb: 'text-secondary' } },
|
|
182
|
+
{ variant: 'rail', intent: 'success', class: { thumb: 'text-success' } },
|
|
183
|
+
{ variant: 'rail', intent: 'warning', class: { thumb: 'text-warning' } },
|
|
184
|
+
{ variant: 'rail', intent: 'danger', class: { thumb: 'text-danger' } },
|
|
185
|
+
{ variant: 'rail', intent: 'neutral', class: { thumb: 'text-neutral' } }
|
|
186
186
|
],
|
|
187
187
|
defaultVariants: {
|
|
188
188
|
intent: 'primary',
|
|
189
189
|
size: 'md',
|
|
190
|
-
|
|
190
|
+
variant: 'default',
|
|
191
191
|
disabled: false,
|
|
192
192
|
error: false,
|
|
193
193
|
messageType: 'helper',
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
tier,
|
|
16
16
|
size = 'md',
|
|
17
17
|
intent = 'primary',
|
|
18
|
-
|
|
18
|
+
variant = 'default',
|
|
19
19
|
disabled = false,
|
|
20
20
|
required = false,
|
|
21
21
|
name,
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
tier: effectiveTier,
|
|
71
71
|
size,
|
|
72
72
|
intent,
|
|
73
|
-
|
|
73
|
+
variant,
|
|
74
74
|
checked,
|
|
75
75
|
disabled,
|
|
76
76
|
error: !!error,
|
|
@@ -90,7 +90,7 @@ export interface ToggleProps extends Omit<ToggleVariants, 'checked' | 'error'>,
|
|
|
90
90
|
*
|
|
91
91
|
* @default 'default'
|
|
92
92
|
*/
|
|
93
|
-
|
|
93
|
+
variant?: ToggleVariants['variant'];
|
|
94
94
|
}
|
|
95
95
|
export { default as Toggle } from './Toggle.svelte';
|
|
96
96
|
export { type ToggleVariants, toggleVariants } from './toggle.variants.js';
|
|
@@ -3,7 +3,7 @@ export declare const toggleVariants: ((props?: {
|
|
|
3
3
|
tier?: "commit" | "modify" | undefined;
|
|
4
4
|
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
5
5
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
6
|
-
|
|
6
|
+
variant?: "default" | "dot" | undefined;
|
|
7
7
|
checked?: boolean | undefined;
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
error?: boolean | undefined;
|
|
@@ -13,7 +13,7 @@ export declare const toggleVariants: ((props?: {
|
|
|
13
13
|
tier?: "commit" | "modify" | undefined;
|
|
14
14
|
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
15
15
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
16
|
-
|
|
16
|
+
variant?: "default" | "dot" | undefined;
|
|
17
17
|
checked?: boolean | undefined;
|
|
18
18
|
disabled?: boolean | undefined;
|
|
19
19
|
error?: boolean | undefined;
|
|
@@ -25,7 +25,7 @@ export declare const toggleVariants: ((props?: {
|
|
|
25
25
|
tier?: "commit" | "modify" | undefined;
|
|
26
26
|
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
27
27
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
28
|
-
|
|
28
|
+
variant?: "default" | "dot" | undefined;
|
|
29
29
|
checked?: boolean | undefined;
|
|
30
30
|
disabled?: boolean | undefined;
|
|
31
31
|
error?: boolean | undefined;
|
|
@@ -37,7 +37,7 @@ export declare const toggleVariants: ((props?: {
|
|
|
37
37
|
tier?: "commit" | "modify" | undefined;
|
|
38
38
|
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
39
39
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
40
|
-
|
|
40
|
+
variant?: "default" | "dot" | undefined;
|
|
41
41
|
checked?: boolean | undefined;
|
|
42
42
|
disabled?: boolean | undefined;
|
|
43
43
|
error?: boolean | undefined;
|
|
@@ -49,7 +49,7 @@ export declare const toggleVariants: ((props?: {
|
|
|
49
49
|
tier?: "commit" | "modify" | undefined;
|
|
50
50
|
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
51
51
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
52
|
-
|
|
52
|
+
variant?: "default" | "dot" | undefined;
|
|
53
53
|
checked?: boolean | undefined;
|
|
54
54
|
disabled?: boolean | undefined;
|
|
55
55
|
error?: boolean | undefined;
|
|
@@ -61,7 +61,7 @@ export declare const toggleVariants: ((props?: {
|
|
|
61
61
|
tier?: "commit" | "modify" | undefined;
|
|
62
62
|
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
63
63
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
64
|
-
|
|
64
|
+
variant?: "default" | "dot" | undefined;
|
|
65
65
|
checked?: boolean | undefined;
|
|
66
66
|
disabled?: boolean | undefined;
|
|
67
67
|
error?: boolean | undefined;
|
|
@@ -73,7 +73,7 @@ export declare const toggleVariants: ((props?: {
|
|
|
73
73
|
tier?: "commit" | "modify" | undefined;
|
|
74
74
|
size?: "sm" | "md" | "lg" | "xs" | undefined;
|
|
75
75
|
intent?: "primary" | "secondary" | "success" | "warning" | "danger" | "neutral" | undefined;
|
|
76
|
-
|
|
76
|
+
variant?: "default" | "dot" | undefined;
|
|
77
77
|
checked?: boolean | undefined;
|
|
78
78
|
disabled?: boolean | undefined;
|
|
79
79
|
error?: boolean | undefined;
|