@infonomic/uikit 6.5.0 → 6.6.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/README.md +76 -4
- package/dist/components/accordion/accordion.module.css +1 -2
- package/dist/components/avatar/avatar.module.css +2 -19
- package/dist/components/avatar/avatar_module.css +2 -10
- package/dist/components/button/button-group.d.ts.map +1 -1
- package/dist/components/button/button-group.js +1 -1
- package/dist/components/button/button.module.css +56 -37
- package/dist/components/button/button_module.css +12 -12
- package/dist/components/button/combo-button.d.ts.map +1 -1
- package/dist/components/button/combo-button.module.css +3 -3
- package/dist/components/button/copy-button.d.ts.map +1 -1
- package/dist/components/button/copy-button.js +14 -7
- package/dist/components/card/card.module.css +1 -9
- package/dist/components/card/card_module.css +1 -5
- package/dist/components/chips/chip.module.css +32 -21
- package/dist/components/chips/chip_module.css +2 -2
- package/dist/components/dropdown/dropdown.d.ts.map +1 -1
- package/dist/components/hamburger/hamburger.module.css +6 -7
- package/dist/components/inputs/autocomplete.d.ts.map +1 -1
- package/dist/components/inputs/autocomplete.module.css +9 -10
- package/dist/components/inputs/autocomplete_module.css +2 -2
- package/dist/components/inputs/checkbox-group.module.css +6 -7
- package/dist/components/inputs/checkbox.module.css +16 -18
- package/dist/components/inputs/checkbox_module.css +2 -2
- package/dist/components/inputs/error-text.module.css +1 -1
- package/dist/components/inputs/error-text_module.css +1 -1
- package/dist/components/inputs/input.module.css +10 -11
- package/dist/components/inputs/input_module.css +2 -2
- package/dist/components/inputs/label.module.css +1 -1
- package/dist/components/inputs/label_module.css +1 -1
- package/dist/components/inputs/radio-group.module.css +6 -7
- package/dist/components/inputs/select.d.ts.map +1 -1
- package/dist/components/inputs/select.module.css +6 -7
- package/dist/components/inputs/text-area.module.css +10 -9
- package/dist/components/notifications/@types/alert.js +1 -0
- package/dist/components/notifications/@types/toast.js +1 -0
- package/dist/components/notifications/toast.module.css +9 -19
- package/dist/components/notifications/toast_module.css +3 -6
- package/dist/components/pager/first-button.d.ts.map +1 -1
- package/dist/components/pager/hooks/types/usePagination.js +1 -0
- package/dist/components/pager/last-button.d.ts.map +1 -1
- package/dist/components/pager/next-button.d.ts.map +1 -1
- package/dist/components/pager/number-button.d.ts.map +1 -1
- package/dist/components/pager/pagination.module.css +1 -6
- package/dist/components/pager/pagination_module.css +1 -1
- package/dist/components/pager/previous-button.d.ts.map +1 -1
- package/dist/components/scroll-area/scroll-area.d.ts.map +1 -1
- package/dist/components/scroll-to-top/scroll-to-top.module.css +3 -3
- package/dist/components/scroll-to-top/scroll-to-top_module.css +6 -6
- package/dist/components/tabs/tabs.module.css +6 -7
- package/dist/components/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/tooltip/tooltip.module.css +10 -11
- package/dist/icons/types/icon.js +1 -0
- package/dist/lib/ripple.js +3 -3
- package/dist/loaders/@types/index.js +1 -0
- package/dist/loaders/ellipses.d.ts.map +1 -1
- package/dist/loaders/ring.d.ts.map +1 -1
- package/dist/loaders/spinner.d.ts.map +1 -1
- package/dist/styles/components-vanilla.css +1 -1
- package/dist/styles/styles.css +1 -1
- package/dist/utils/polymorphic.js +1 -0
- package/dist/widgets/datepicker/datepicker.d.ts.map +1 -1
- package/dist/widgets/datepicker/datepicker.module.css +1 -2
- package/dist/widgets/drawer/drawer.module.css +1 -2
- package/dist/widgets/modal/modal.d.ts.map +1 -1
- package/dist/widgets/modal/modal.module.css +1 -4
- package/package.json +22 -18
- package/src/components/accordion/accordion.module.css +1 -2
- package/src/components/avatar/avatar.module.css +2 -19
- package/src/components/button/button-group.tsx +3 -9
- package/src/components/button/button.module.css +56 -37
- package/src/components/button/combo-button.module.css +3 -3
- package/src/components/button/combo-button.tsx +1 -7
- package/src/components/button/copy-button.tsx +23 -9
- package/src/components/card/card.module.css +1 -9
- package/src/components/chips/chip.module.css +32 -21
- package/src/components/chips/chip.stories.tsx +2 -2
- package/src/components/chips/chip.tsx +2 -2
- package/src/components/dropdown/dropdown.tsx +4 -19
- package/src/components/hamburger/hamburger.module.css +6 -7
- package/src/components/hamburger/hamburger.stories.tsx +0 -1
- package/src/components/inputs/autocomplete.module.css +9 -10
- package/src/components/inputs/autocomplete.tsx +10 -4
- package/src/components/inputs/calendar.stories.tsx +18 -18
- package/src/components/inputs/checkbox-group.module.css +6 -7
- package/src/components/inputs/checkbox-group.stories.tsx +4 -7
- package/src/components/inputs/checkbox.module.css +16 -18
- package/src/components/inputs/error-text.module.css +1 -1
- package/src/components/inputs/input.module.css +10 -11
- package/src/components/inputs/label.module.css +1 -1
- package/src/components/inputs/radio-group.module.css +6 -7
- package/src/components/inputs/select.module.css +6 -7
- package/src/components/inputs/select.stories.tsx +21 -4
- package/src/components/inputs/select.tsx +9 -7
- package/src/components/inputs/text-area.module.css +10 -9
- package/src/components/notifications/toast.module.css +9 -19
- package/src/components/notifications/toast.tsx +2 -11
- package/src/components/pager/first-button.tsx +5 -1
- package/src/components/pager/last-button.tsx +5 -1
- package/src/components/pager/next-button.tsx +5 -1
- package/src/components/pager/number-button.tsx +6 -3
- package/src/components/pager/pagination.module.css +1 -6
- package/src/components/pager/previous-button.tsx +5 -1
- package/src/components/scroll-area/scroll-area.tsx +1 -1
- package/src/components/scroll-to-top/scroll-to-top.module.css +3 -3
- package/src/components/tabs/tabs.module.css +6 -7
- package/src/components/tooltip/tooltip.module.css +10 -11
- package/src/components/tooltip/tooltip.tsx +12 -12
- package/src/lib/ripple.ts +3 -3
- package/src/loaders/ellipses.tsx +1 -1
- package/src/loaders/loaders.stories.tsx +44 -10
- package/src/loaders/ring.tsx +1 -1
- package/src/loaders/spinner.tsx +2 -2
- package/src/styles/components/hamburger.css +6 -6
- package/src/styles/components/loaders.css +1 -1
- package/src/styles/functional/README.md +67 -0
- package/src/styles/functional/borders.css +19 -0
- package/src/styles/functional/colors.css +237 -69
- package/src/styles/functional/functional.css +1 -0
- package/src/styles/functional/shadcn-compat.css +120 -0
- package/src/styles/functional/surfaces.css +17 -0
- package/src/styles/functional/typography.css +14 -6
- package/src/styles/local-fonts.css +1 -1
- package/src/styles/theme/theme.css +1 -1
- package/src/styles/utils/utility-classes.css +12 -22
- package/src/widgets/datepicker/datepicker.module.css +1 -2
- package/src/widgets/datepicker/datepicker.tsx +10 -8
- package/src/widgets/drawer/drawer.module.css +1 -2
- package/src/widgets/modal/modal.module.css +1 -4
- package/src/widgets/modal/modal.tsx +2 -6
|
@@ -32,19 +32,13 @@ const ButtonGroupContext = React.createContext<ButtonGroupContextType>({
|
|
|
32
32
|
type ToggleGroupProps = React.ComponentProps<typeof ToggleGroup>
|
|
33
33
|
|
|
34
34
|
// Create separate props for single and multiple modes
|
|
35
|
-
type SingleToggleGroupProps = Omit<
|
|
36
|
-
ToggleGroupProps,
|
|
37
|
-
'multiple' | 'value' | 'onValueChange'
|
|
38
|
-
> & {
|
|
35
|
+
type SingleToggleGroupProps = Omit<ToggleGroupProps, 'multiple' | 'value' | 'onValueChange'> & {
|
|
39
36
|
type: 'single'
|
|
40
37
|
value?: string
|
|
41
38
|
onValueChange?: (value: string) => void
|
|
42
39
|
}
|
|
43
40
|
|
|
44
|
-
type MultipleToggleGroupProps = Omit<
|
|
45
|
-
ToggleGroupProps,
|
|
46
|
-
'multiple' | 'value' | 'onValueChange'
|
|
47
|
-
> & {
|
|
41
|
+
type MultipleToggleGroupProps = Omit<ToggleGroupProps, 'multiple' | 'value' | 'onValueChange'> & {
|
|
48
42
|
type: 'multiple'
|
|
49
43
|
value?: string[]
|
|
50
44
|
onValueChange?: (value: string[]) => void
|
|
@@ -76,7 +70,7 @@ const ButtonGroup = ({
|
|
|
76
70
|
|
|
77
71
|
const handleValueChange: React.ComponentProps<typeof ToggleGroup>['onValueChange'] = (
|
|
78
72
|
newValue,
|
|
79
|
-
|
|
73
|
+
_event
|
|
80
74
|
) => {
|
|
81
75
|
if (!onValueChange) return
|
|
82
76
|
if (isMultiple) {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
.button,
|
|
11
10
|
:global(.infonomic-button) {
|
|
12
11
|
border: none;
|
|
@@ -114,10 +113,14 @@ infonomic-components;
|
|
|
114
113
|
.filled[disabled],
|
|
115
114
|
:global(.infonomic-button-filled):disabled,
|
|
116
115
|
:global(.infonomic-button-filled)[disabled] {
|
|
117
|
-
background-color: var(
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
116
|
+
background-color: var(
|
|
117
|
+
--button-variant-filled-disabled,
|
|
118
|
+
oklch(from var(--button-variant-filled) calc(l * 1.1) calc(c * 0.85) h)
|
|
119
|
+
);
|
|
120
|
+
color: var(
|
|
121
|
+
--button-variant-filled-foreground-disabled,
|
|
122
|
+
oklch(from var(--button-variant-filled-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
123
|
+
);
|
|
121
124
|
}
|
|
122
125
|
|
|
123
126
|
/* -------------------------------------------------------- */
|
|
@@ -145,10 +148,14 @@ infonomic-components;
|
|
|
145
148
|
.filled-weak[disabled],
|
|
146
149
|
:global(.infonomic-button-filled-weak):disabled,
|
|
147
150
|
:global(.infonomic-button-filled-weak)[disabled] {
|
|
148
|
-
background-color: var(
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
151
|
+
background-color: var(
|
|
152
|
+
--button-variant-filled-weak-disabled,
|
|
153
|
+
oklch(from var(--button-variant-filled-weak) calc(l * 1.1) calc(c * 0.85) h)
|
|
154
|
+
);
|
|
155
|
+
color: var(
|
|
156
|
+
--button-variant-filled-weak-foreground-disabled,
|
|
157
|
+
oklch(from var(--button-variant-filled-weak-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
158
|
+
);
|
|
152
159
|
}
|
|
153
160
|
|
|
154
161
|
.outlined,
|
|
@@ -162,10 +169,14 @@ infonomic-components;
|
|
|
162
169
|
.outlined[disabled],
|
|
163
170
|
:global(.infonomic-button-outlined):disabled,
|
|
164
171
|
:global(.infonomic-button-outlined)[disabled] {
|
|
165
|
-
border-color: var(
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
172
|
+
border-color: var(
|
|
173
|
+
--button-variant-outlined-border-disabled,
|
|
174
|
+
oklch(from var(--button-variant-outlined-border) calc(l * 1.5) calc(c * 0.8) h)
|
|
175
|
+
);
|
|
176
|
+
color: var(
|
|
177
|
+
--button-variant-outlined-foreground-disabled,
|
|
178
|
+
oklch(from var(--button-variant-outlined-foreground) calc(l * 1.1) calc(c * 0.7) h)
|
|
179
|
+
);
|
|
169
180
|
}
|
|
170
181
|
|
|
171
182
|
.outlined:hover,
|
|
@@ -183,9 +194,11 @@ infonomic-components;
|
|
|
183
194
|
.gradient,
|
|
184
195
|
:global(.infonomic-button-gradient) {
|
|
185
196
|
color: var(--button-variant-gradient-foreground);
|
|
186
|
-
background: linear-gradient(
|
|
187
|
-
|
|
188
|
-
|
|
197
|
+
background: linear-gradient(
|
|
198
|
+
45deg,
|
|
199
|
+
var(--button-variant-gradient-start),
|
|
200
|
+
var(--button-variant-gradient-end)
|
|
201
|
+
);
|
|
189
202
|
}
|
|
190
203
|
|
|
191
204
|
.gradient:disabled,
|
|
@@ -193,18 +206,24 @@ infonomic-components;
|
|
|
193
206
|
:global(.infonomic-button-gradient):disabled,
|
|
194
207
|
:global(.infonomic-button-gradient)[disabled] {
|
|
195
208
|
background: unset;
|
|
196
|
-
background-color: var(
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
209
|
+
background-color: var(
|
|
210
|
+
--button-variant-gradient-disabled,
|
|
211
|
+
oklch(from var(--button-variant-gradient-end) calc(l * 1.2) calc(c * 0.85) h)
|
|
212
|
+
);
|
|
213
|
+
color: var(
|
|
214
|
+
--button-variant-gradient-foreground-disabled,
|
|
215
|
+
oklch(from var(--button-variant-gradient-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
216
|
+
);
|
|
200
217
|
}
|
|
201
218
|
|
|
202
219
|
.gradient:hover,
|
|
203
220
|
:global(.infonomic-button-gradient):hover {
|
|
204
221
|
color: var(--button-variant-gradient-foreground);
|
|
205
|
-
background: linear-gradient(
|
|
206
|
-
|
|
207
|
-
|
|
222
|
+
background: linear-gradient(
|
|
223
|
+
45deg,
|
|
224
|
+
var(--button-variant-gradient-start),
|
|
225
|
+
var(--button-variant-gradient-end)
|
|
226
|
+
);
|
|
208
227
|
}
|
|
209
228
|
|
|
210
229
|
.gradient:focus,
|
|
@@ -276,7 +295,7 @@ infonomic-components;
|
|
|
276
295
|
--button-variant-gradient-end: var(--gradient-primary-end);
|
|
277
296
|
--button-variant-gradient-foreground: var(--gradient-primary-foreground);
|
|
278
297
|
--button-variant-gradient-disabled: var(--gradient-primary-disabled);
|
|
279
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-primary-disabled);
|
|
298
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-primary-strong-disabled);
|
|
280
299
|
}
|
|
281
300
|
|
|
282
301
|
.secondary,
|
|
@@ -315,7 +334,7 @@ infonomic-components;
|
|
|
315
334
|
--button-variant-gradient-end: var(--gradient-secondary-end);
|
|
316
335
|
--button-variant-gradient-foreground: var(--gradient-secondary-foreground);
|
|
317
336
|
--button-variant-gradient-disabled: var(--gradient-secondary-disabled);
|
|
318
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-secondary-disabled);
|
|
337
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-secondary-strong-disabled);
|
|
319
338
|
}
|
|
320
339
|
|
|
321
340
|
.noeffect,
|
|
@@ -343,7 +362,7 @@ infonomic-components;
|
|
|
343
362
|
--button-variant-outlined-border: var(--stroke-noeffect);
|
|
344
363
|
--button-variant-outlined-border-disabled: var(--stroke-noeffect-disabled);
|
|
345
364
|
--button-variant-outlined-foreground: var(--text-on-noeffect-outlined);
|
|
346
|
-
--button-variant-outlined-foreground-disabled: var(--text-on-noeffect-disabled);
|
|
365
|
+
--button-variant-outlined-foreground-disabled: var(--text-on-noeffect-outlined-disabled);
|
|
347
366
|
|
|
348
367
|
/* Text */
|
|
349
368
|
--button-variant-text: var(--fill-noeffect-text);
|
|
@@ -355,7 +374,7 @@ infonomic-components;
|
|
|
355
374
|
--button-variant-gradient-end: var(--gradient-noeffect-end);
|
|
356
375
|
--button-variant-gradient-foreground: var(--gradient-noeffect-foreground);
|
|
357
376
|
--button-variant-gradient-disabled: var(--gradient-noeffect-disabled);
|
|
358
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-noeffect-disabled);
|
|
377
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-noeffect-strong-disabled);
|
|
359
378
|
}
|
|
360
379
|
|
|
361
380
|
.success,
|
|
@@ -394,7 +413,7 @@ infonomic-components;
|
|
|
394
413
|
--button-variant-gradient-end: var(--gradient-success-end);
|
|
395
414
|
--button-variant-gradient-foreground: var(--gradient-success-foreground);
|
|
396
415
|
--button-variant-gradient-disabled: var(--gradient-success-disabled);
|
|
397
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-success-disabled);
|
|
416
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-success-strong-disabled);
|
|
398
417
|
}
|
|
399
418
|
|
|
400
419
|
.info,
|
|
@@ -433,7 +452,7 @@ infonomic-components;
|
|
|
433
452
|
--button-variant-gradient-end: var(--gradient-info-end);
|
|
434
453
|
--button-variant-gradient-foreground: var(--gradient-info-foreground);
|
|
435
454
|
--button-variant-gradient-disabled: var(--gradient-info-disabled);
|
|
436
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-info-disabled);
|
|
455
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-info-strong-disabled);
|
|
437
456
|
}
|
|
438
457
|
|
|
439
458
|
.warning,
|
|
@@ -472,7 +491,7 @@ infonomic-components;
|
|
|
472
491
|
--button-variant-gradient-end: var(--gradient-warning-end);
|
|
473
492
|
--button-variant-gradient-foreground: var(--gradient-warning-foreground);
|
|
474
493
|
--button-variant-gradient-disabled: var(--gradient-warning-disabled);
|
|
475
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-warning-disabled);
|
|
494
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-warning-strong-disabled);
|
|
476
495
|
}
|
|
477
496
|
|
|
478
497
|
.danger,
|
|
@@ -511,7 +530,7 @@ infonomic-components;
|
|
|
511
530
|
--button-variant-gradient-end: var(--gradient-danger-end);
|
|
512
531
|
--button-variant-gradient-foreground: var(--gradient-danger-foreground);
|
|
513
532
|
--button-variant-gradient-disabled: var(--gradient-danger-disabled);
|
|
514
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-danger-disabled);
|
|
533
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-danger-strong-disabled);
|
|
515
534
|
}
|
|
516
535
|
|
|
517
536
|
/* Full width */
|
|
@@ -520,4 +539,4 @@ infonomic-components;
|
|
|
520
539
|
width: 100%;
|
|
521
540
|
display: flex;
|
|
522
541
|
}
|
|
523
|
-
}
|
|
542
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
@layer infonomic-base, infonomic-utilities, infonomic-theme, infonomic-components;
|
|
2
2
|
|
|
3
3
|
@layer infonomic-components {
|
|
4
|
-
|
|
5
4
|
.combo-button-wrapper,
|
|
6
5
|
:global(.infonomic-combo-button-wrapper) {
|
|
7
6
|
display: flex;
|
|
@@ -48,5 +47,6 @@
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
.combo-button-options-item,
|
|
51
|
-
:global(.infonomic-combo-button-options-item) {
|
|
52
|
-
}
|
|
50
|
+
:global(.infonomic-combo-button-options-item) {
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -55,13 +55,7 @@ export const ComboButton = ({
|
|
|
55
55
|
<DropdownComponent.Root>
|
|
56
56
|
<DropdownComponent.Trigger
|
|
57
57
|
className={cx('combo-button-trigger', styles['combo-button-trigger'], triggerClassName)}
|
|
58
|
-
render={
|
|
59
|
-
<Button
|
|
60
|
-
disabled={disabled || optionsDisabled}
|
|
61
|
-
intent={intent}
|
|
62
|
-
{...rest}
|
|
63
|
-
/>
|
|
64
|
-
}
|
|
58
|
+
render={<Button disabled={disabled || optionsDisabled} intent={intent} {...rest} />}
|
|
65
59
|
>
|
|
66
60
|
<ChevronDownIcon width="16px" height="16px" />
|
|
67
61
|
</DropdownComponent.Trigger>
|
|
@@ -32,7 +32,12 @@ export function CopyButton({
|
|
|
32
32
|
svgClassName,
|
|
33
33
|
...rest
|
|
34
34
|
}: CopyButtonProps): React.JSX.Element {
|
|
35
|
-
|
|
35
|
+
// Track copied-feedback and hover-open as separate booleans so the
|
|
36
|
+
// tooltip's `open` prop is always a boolean. Passing `undefined` -> `true`
|
|
37
|
+
// makes Base UI's Tooltip switch from uncontrolled to controlled and emits
|
|
38
|
+
// a React warning in consumer apps.
|
|
39
|
+
const [copied, setCopied] = useState(false)
|
|
40
|
+
const [hoverOpen, setHoverOpen] = useState(false)
|
|
36
41
|
|
|
37
42
|
const handleCopied = (): void => {
|
|
38
43
|
// TODO: Permissions check?
|
|
@@ -52,14 +57,12 @@ export function CopyButton({
|
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
useEffect(() => {
|
|
55
|
-
if (copied
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
})
|
|
60
|
+
if (!copied) return
|
|
61
|
+
const timer = setTimeout(() => setCopied(false), 900)
|
|
62
|
+
return () => clearTimeout(timer)
|
|
63
|
+
}, [copied])
|
|
61
64
|
|
|
62
|
-
const tooltipText = copied
|
|
65
|
+
const tooltipText = copied ? copiedText : hoverText
|
|
63
66
|
|
|
64
67
|
return (
|
|
65
68
|
<div
|
|
@@ -69,7 +72,18 @@ export function CopyButton({
|
|
|
69
72
|
containerClassName
|
|
70
73
|
)}
|
|
71
74
|
>
|
|
72
|
-
<Tooltip
|
|
75
|
+
<Tooltip
|
|
76
|
+
side="top"
|
|
77
|
+
sideOffset={2}
|
|
78
|
+
text={tooltipText}
|
|
79
|
+
open={copied || hoverOpen}
|
|
80
|
+
onOpenChange={(next) => {
|
|
81
|
+
// While the "Copied!" feedback is showing, ignore hover-close so
|
|
82
|
+
// the tooltip stays visible for the full confirmation window.
|
|
83
|
+
if (copied && !next) return
|
|
84
|
+
setHoverOpen(next)
|
|
85
|
+
}}
|
|
86
|
+
>
|
|
73
87
|
<Button
|
|
74
88
|
variant={variant}
|
|
75
89
|
size={size}
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
width: 100%;
|
|
15
15
|
max-width: 100%;
|
|
16
16
|
color: var(--foreground);
|
|
17
|
-
background: var(--
|
|
17
|
+
background: var(--surface-panel);
|
|
18
18
|
border-width: var(--border-width-thin);
|
|
19
19
|
border-color: var(--border-color);
|
|
20
20
|
border-style: var(--border-style-solid);
|
|
@@ -22,14 +22,6 @@
|
|
|
22
22
|
box-shadow: var(--shadow-sm);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
:global(.dark),
|
|
26
|
-
:global([data-theme="dark"]) {
|
|
27
|
-
.card,
|
|
28
|
-
:global(.infonomic-card) {
|
|
29
|
-
background: var(--canvas-800);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
25
|
.card-hover,
|
|
34
26
|
:global(.infonomic-card-hover) {
|
|
35
27
|
transition: background 0.2s ease-in-out;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
.chip,
|
|
11
10
|
:global(.infonomic-chip) {
|
|
12
11
|
--chip-font-size: 0.9rem;
|
|
@@ -148,10 +147,14 @@ infonomic-components;
|
|
|
148
147
|
.filled[disabled],
|
|
149
148
|
:global(.infonomic-chip-filled):disabled,
|
|
150
149
|
:global(.infonomic-chip-filled)[disabled] {
|
|
151
|
-
background-color: var(
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
150
|
+
background-color: var(
|
|
151
|
+
--chip-variant-filled-disabled,
|
|
152
|
+
oklch(from var(--chip-variant-filled) calc(l * 1.1) calc(c * 0.85) h)
|
|
153
|
+
);
|
|
154
|
+
color: var(
|
|
155
|
+
--chip-variant-filled-foreground-disabled,
|
|
156
|
+
oklch(from var(--chip-variant-filled-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
157
|
+
);
|
|
155
158
|
}
|
|
156
159
|
|
|
157
160
|
/* -------------------------------------------------------- */
|
|
@@ -179,10 +182,14 @@ infonomic-components;
|
|
|
179
182
|
.filled-weak[disabled],
|
|
180
183
|
:global(.infonomic-chip-filled-weak):disabled,
|
|
181
184
|
:global(.infonomic-chip-filled-weak)[disabled] {
|
|
182
|
-
background-color: var(
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
185
|
+
background-color: var(
|
|
186
|
+
--chip-variant-filled-weak-disabled,
|
|
187
|
+
oklch(from var(--chip-variant-filled-weak) calc(l * 1.1) calc(c * 0.85) h)
|
|
188
|
+
);
|
|
189
|
+
color: var(
|
|
190
|
+
--chip-variant-filled-weak-foreground-disabled,
|
|
191
|
+
oklch(from var(--chip-variant-filled-weak-foreground) calc(l * 0.9) calc(c * 0.85) h)
|
|
192
|
+
);
|
|
186
193
|
}
|
|
187
194
|
|
|
188
195
|
/* -------------------------------------------------------- */
|
|
@@ -199,10 +206,14 @@ infonomic-components;
|
|
|
199
206
|
.outlined[disabled],
|
|
200
207
|
:global(.infonomic-chip-outlined):disabled,
|
|
201
208
|
:global(.infonomic-chip-outlined)[disabled] {
|
|
202
|
-
border-color: var(
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
209
|
+
border-color: var(
|
|
210
|
+
--chip-variant-outlined-border-disabled,
|
|
211
|
+
oklch(from var(--chip-variant-outlined-border) calc(l * 1.5) calc(c * 0.8) h)
|
|
212
|
+
);
|
|
213
|
+
color: var(
|
|
214
|
+
--chip-variant-outlined-foreground-disabled,
|
|
215
|
+
oklch(from var(--chip-variant-outlined-foreground) calc(l * 1.1) calc(c * 0.7) h)
|
|
216
|
+
);
|
|
206
217
|
}
|
|
207
218
|
|
|
208
219
|
.outlined:hover,
|
|
@@ -283,10 +294,10 @@ infonomic-components;
|
|
|
283
294
|
|
|
284
295
|
/* Filled Weak */
|
|
285
296
|
--chip-variant-filled-weak: var(--fill-secondary-weak);
|
|
286
|
-
--chip-variant-filled-weak-foreground: var(--text-on-secondary);
|
|
297
|
+
--chip-variant-filled-weak-foreground: var(--text-on-secondary-weak);
|
|
287
298
|
--chip-variant-filled-weak-hover: var(--fill-secondary-weak-hover);
|
|
288
299
|
--chip-variant-filled-weak-disabled: var(--fill-secondary-weak-disabled);
|
|
289
|
-
--chip-variant-filled-weak-foreground-disabled: var(--text-on-secondary-disabled);
|
|
300
|
+
--chip-variant-filled-weak-foreground-disabled: var(--text-on-secondary-weak-disabled);
|
|
290
301
|
|
|
291
302
|
/* Outlined */
|
|
292
303
|
--chip-variant-outlined: var(--fill-secondary-outlined);
|
|
@@ -431,4 +442,4 @@ infonomic-components;
|
|
|
431
442
|
--chip-variant-outlined-foreground: var(--text-on-danger-outlined);
|
|
432
443
|
--chip-variant-outlined-foreground-disabled: var(--text-on-danger-outlined-disabled);
|
|
433
444
|
}
|
|
434
|
-
}
|
|
445
|
+
}
|
|
@@ -63,7 +63,7 @@ export const Variants: Story = {
|
|
|
63
63
|
selected={true}
|
|
64
64
|
>{`${capitalize(variant)} with icon`}</Chip>
|
|
65
65
|
{(variant === 'removable' || variant === 'selectable-removable') && (
|
|
66
|
-
<Chip variant={variant} onRemove={() => {
|
|
66
|
+
<Chip variant={variant} onRemove={() => {}}>
|
|
67
67
|
{`${capitalize(variant)} with remove`}
|
|
68
68
|
</Chip>
|
|
69
69
|
)}
|
|
@@ -102,7 +102,7 @@ export const Removable: Story = {
|
|
|
102
102
|
<Chip
|
|
103
103
|
variant="removable"
|
|
104
104
|
intent="primary"
|
|
105
|
-
onRemove={() => {
|
|
105
|
+
onRemove={() => {}}
|
|
106
106
|
startIcon={<CalendarIcon height="16px" width="16px" />}
|
|
107
107
|
>
|
|
108
108
|
Removable chip
|
|
@@ -61,7 +61,7 @@ export const Chip = ({
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
if (onClick) {
|
|
64
|
-
;
|
|
64
|
+
;(onClick as React.MouseEventHandler<HTMLElement>)(event)
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
if (isSelectable && onToggle) {
|
|
@@ -77,7 +77,7 @@ export const Chip = ({
|
|
|
77
77
|
if ((event.key === 'Enter' || event.key === ' ') && isCustomElement) {
|
|
78
78
|
event.preventDefault()
|
|
79
79
|
if (onClick) {
|
|
80
|
-
;
|
|
80
|
+
;(onClick as React.MouseEventHandler<HTMLElement>)(
|
|
81
81
|
event as unknown as React.MouseEvent<HTMLElement>
|
|
82
82
|
)
|
|
83
83
|
}
|
|
@@ -7,10 +7,7 @@ import cx from 'classnames'
|
|
|
7
7
|
|
|
8
8
|
import styles from './dropdown.module.css'
|
|
9
9
|
|
|
10
|
-
function Root({
|
|
11
|
-
children,
|
|
12
|
-
...rest
|
|
13
|
-
}: React.ComponentProps<typeof Menu.Root>): React.JSX.Element {
|
|
10
|
+
function Root({ children, ...rest }: React.ComponentProps<typeof Menu.Root>): React.JSX.Element {
|
|
14
11
|
return <Menu.Root {...rest}>{children}</Menu.Root>
|
|
15
12
|
}
|
|
16
13
|
|
|
@@ -23,11 +20,7 @@ const Trigger = ({
|
|
|
23
20
|
ref?: React.RefObject<React.ComponentRef<'button'>>
|
|
24
21
|
}): React.JSX.Element => {
|
|
25
22
|
return (
|
|
26
|
-
<Menu.Trigger
|
|
27
|
-
className={cx('infonomic-dropdown-trigger', className)}
|
|
28
|
-
ref={ref}
|
|
29
|
-
{...rest}
|
|
30
|
-
>
|
|
23
|
+
<Menu.Trigger className={cx('infonomic-dropdown-trigger', className)} ref={ref} {...rest}>
|
|
31
24
|
{children}
|
|
32
25
|
</Menu.Trigger>
|
|
33
26
|
)
|
|
@@ -90,11 +83,7 @@ const Group = ({
|
|
|
90
83
|
ref?: React.RefObject<React.ComponentRef<'div'>>
|
|
91
84
|
}): React.JSX.Element => {
|
|
92
85
|
return (
|
|
93
|
-
<Menu.Group
|
|
94
|
-
ref={ref}
|
|
95
|
-
className={cx('infonomic-dropdown-group', className)}
|
|
96
|
-
{...rest}
|
|
97
|
-
>
|
|
86
|
+
<Menu.Group ref={ref} className={cx('infonomic-dropdown-group', className)} {...rest}>
|
|
98
87
|
{children}
|
|
99
88
|
</Menu.Group>
|
|
100
89
|
)
|
|
@@ -130,11 +119,7 @@ const Label = ({
|
|
|
130
119
|
ref?: React.RefObject<React.ComponentRef<'div'>>
|
|
131
120
|
}): React.JSX.Element => {
|
|
132
121
|
return (
|
|
133
|
-
<Menu.GroupLabel
|
|
134
|
-
ref={ref}
|
|
135
|
-
className={cx('infonomic-dropdown-label', className)}
|
|
136
|
-
{...rest}
|
|
137
|
-
>
|
|
122
|
+
<Menu.GroupLabel ref={ref} className={cx('infonomic-dropdown-label', className)} {...rest}>
|
|
138
123
|
{children}
|
|
139
124
|
</Menu.GroupLabel>
|
|
140
125
|
)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
.hamburger,
|
|
11
10
|
:global(.infonomic-hamburger) {
|
|
12
11
|
--hamburger-color: currentColor;
|
|
@@ -139,4 +138,4 @@ infonomic-components;
|
|
|
139
138
|
--hamburger-color: var(--foreground, #1a1a1a);
|
|
140
139
|
--hamburger-focus-ring-color: var(--foreground, #1a1a1a);
|
|
141
140
|
}
|
|
142
|
-
}
|
|
141
|
+
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
@layer infonomic-base,
|
|
2
|
-
infonomic-functional,
|
|
3
|
-
infonomic-utilities,
|
|
4
|
-
infonomic-theme,
|
|
5
|
-
infonomic-typography,
|
|
6
|
-
infonomic-components;
|
|
2
|
+
infonomic-functional,
|
|
3
|
+
infonomic-utilities,
|
|
4
|
+
infonomic-theme,
|
|
5
|
+
infonomic-typography,
|
|
6
|
+
infonomic-components;
|
|
7
7
|
|
|
8
8
|
@layer infonomic-components {
|
|
9
|
-
|
|
10
9
|
/* ── Wrapper ── */
|
|
11
10
|
|
|
12
11
|
.autocomplete-wrapper,
|
|
@@ -139,19 +138,19 @@ infonomic-components;
|
|
|
139
138
|
|
|
140
139
|
.error,
|
|
141
140
|
:global(.infonomic-autocomplete-input-error) {
|
|
142
|
-
border: 1px solid var(--
|
|
141
|
+
border: 1px solid var(--field-border-invalid);
|
|
143
142
|
}
|
|
144
143
|
|
|
145
144
|
.error:hover,
|
|
146
145
|
:global(.infonomic-autocomplete-input-error):hover {
|
|
147
|
-
border: 1px solid var(--
|
|
146
|
+
border: 1px solid var(--field-border-invalid);
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
.error:focus,
|
|
151
150
|
.error:active,
|
|
152
151
|
:global(.infonomic-autocomplete-input-error):focus,
|
|
153
152
|
:global(.infonomic-autocomplete-input-error):active {
|
|
154
|
-
--ring-color: var(--
|
|
153
|
+
--ring-color: var(--field-ring-invalid);
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
/* ── Intents ── */
|
|
@@ -368,4 +367,4 @@ infonomic-components;
|
|
|
368
367
|
}
|
|
369
368
|
|
|
370
369
|
/* Dark mode handled by semantic tokens in theme layer */
|
|
371
|
-
}
|
|
370
|
+
}
|
|
@@ -57,7 +57,13 @@ export function Autocomplete<Item = string>({
|
|
|
57
57
|
...rest
|
|
58
58
|
}: AutocompleteProps<Item>) {
|
|
59
59
|
return (
|
|
60
|
-
<div
|
|
60
|
+
<div
|
|
61
|
+
className={cx(
|
|
62
|
+
'infonomic-autocomplete-wrapper',
|
|
63
|
+
styles['autocomplete-wrapper'],
|
|
64
|
+
wrapperClassName
|
|
65
|
+
)}
|
|
66
|
+
>
|
|
61
67
|
<AutocompletePrimitive.Root items={items} {...rest}>
|
|
62
68
|
{label != null && <Label id={id} htmlFor={id} required={required} label={label} />}
|
|
63
69
|
<AutocompletePrimitive.Input
|
|
@@ -80,7 +86,7 @@ export function Autocomplete<Item = string>({
|
|
|
80
86
|
styles[intent],
|
|
81
87
|
{ [styles.error]: error },
|
|
82
88
|
className,
|
|
83
|
-
inputClassName
|
|
89
|
+
inputClassName
|
|
84
90
|
)}
|
|
85
91
|
/>
|
|
86
92
|
|
|
@@ -93,7 +99,7 @@ export function Autocomplete<Item = string>({
|
|
|
93
99
|
className={cx(
|
|
94
100
|
'infonomic-autocomplete-popup',
|
|
95
101
|
styles.popup,
|
|
96
|
-
inputSize != null && styles[`popup-${inputSize}`]
|
|
102
|
+
inputSize != null && styles[`popup-${inputSize}`]
|
|
97
103
|
)}
|
|
98
104
|
>
|
|
99
105
|
<AutocompletePrimitive.Empty
|
|
@@ -170,4 +176,4 @@ export const AutocompleteSeparator = ({
|
|
|
170
176
|
)
|
|
171
177
|
}
|
|
172
178
|
|
|
173
|
-
AutocompleteSeparator.displayName = 'AutocompleteSeparator'
|
|
179
|
+
AutocompleteSeparator.displayName = 'AutocompleteSeparator'
|