@infonomic/uikit 6.5.1 → 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/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/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/lib/ripple.js +3 -3
- 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/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 +1 -1
- 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
package/README.md
CHANGED
|
@@ -36,6 +36,23 @@ We also highly value the option to 'tell' components to ignore or override a top
|
|
|
36
36
|
|
|
37
37
|
In addition to CSS modules, we're experimenting with an assembled global stylesheet (in a post-build script) that can be used in vanilla HTML/CSS projects.
|
|
38
38
|
|
|
39
|
+
## Design System Architecture
|
|
40
|
+
|
|
41
|
+
Our CSS is organised into three layers. The directory names matter and are worth calling out because "theme" is a misleading name for what it now does:
|
|
42
|
+
|
|
43
|
+
- `src/styles/base/` — primitive tokens (color palette scales, spacing, breakpoints, shadows, typography scales). No semantic meaning, no mode switching.
|
|
44
|
+
- `src/styles/functional/` — **the semantic source of truth**. This is where intent-based tokens live (`--fill-primary-strong`, `--text-on-danger-weak`, `--stroke-warning-disabled`, etc.), along with generic role tokens (`--focus-ring`, `--field-border-invalid`, `--surface-subtle`, `--text-subtle`). Every component should read from this layer, not from base primitives. Light / dark / `.not-dark` switching happens here.
|
|
45
|
+
- `src/styles/theme/` — document-level defaults and browser behaviour (autofill colours, scrollbars, element resets). Despite the name, this is not where semantic tokens live.
|
|
46
|
+
|
|
47
|
+
The intent token taxonomy follows `element-intent-emphasis-state`:
|
|
48
|
+
|
|
49
|
+
- **element**: `fill` (backgrounds), `text-on` (foreground on a fill), `text` (foreground with no fill context), `stroke` (borders), `ring` (focus rings), `gradient`
|
|
50
|
+
- **intent**: `primary`, `secondary`, `noeffect`, `success`, `info`, `warning`, `danger`
|
|
51
|
+
- **emphasis** (optional): `strong`, `weak`, `outlined`, `text`
|
|
52
|
+
- **state** (optional): `hover`, `disabled`
|
|
53
|
+
|
|
54
|
+
Example: `--text-on-primary-strong-disabled`. Components that need a role without an intent (e.g. a focus ring on a form field) should use the generic tokens: `--focus-ring`, `--field-border`, `--field-border-invalid`, `--surface-subtle`, `--text-subtle`.
|
|
55
|
+
|
|
39
56
|
|
|
40
57
|
|
|
41
58
|
## Getting Started
|
|
@@ -127,10 +144,15 @@ Here's an example Tailwind CSS integration. Note that we have our own reset, and
|
|
|
127
144
|
'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
|
|
128
145
|
'Liberation Mono', 'Courier New', monospace;
|
|
129
146
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
147
|
+
/* Brand palette access. If you plan to opt into the ShadCN compatibility
|
|
148
|
+
layer (see below), keep these under the brand-* namespace so the short
|
|
149
|
+
semantic names (primary, secondary, accent, muted, destructive) stay
|
|
150
|
+
free for ShadCN-style utilities. If you are not using the compat layer,
|
|
151
|
+
you can drop the brand- prefix and expose --color-primary etc. directly. */
|
|
152
|
+
--color-brand-primary: var(--primary);
|
|
153
|
+
--color-brand-secondary: var(--secondary);
|
|
154
|
+
--color-brand-accent: var(--accent);
|
|
155
|
+
--color-brand-noeffect: var(--noeffect);
|
|
134
156
|
--color-success: var(--success);
|
|
135
157
|
--color-info: var(--info);
|
|
136
158
|
--color-warning: var(--warning);
|
|
@@ -220,6 +242,56 @@ Here's an example Tailwind CSS integration. Note that we have our own reset, and
|
|
|
220
242
|
}
|
|
221
243
|
```
|
|
222
244
|
|
|
245
|
+
## Optional ShadCN Compatibility Layer
|
|
246
|
+
|
|
247
|
+
The uikit ships an **opt-in** compatibility layer that exposes ShadCN-style semantic token names as aliases over our existing semantic tokens. This is useful if you're dropping AI-generated UI snippets (which typically reach for `bg-card`, `text-muted-foreground`, `border-border`, `ring-ring`, `bg-destructive`, etc.) into a Tailwind-consumer app.
|
|
248
|
+
|
|
249
|
+
The compatibility layer is additive. It does **not** change any existing uikit component or semantic token — it only adds a parallel `--shadcn-*` namespace that maps onto our tokens. In particular:
|
|
250
|
+
|
|
251
|
+
- `--shadcn-accent` maps to a subtle interactive surface (our `--surface-subtle-hover`), not our brand `--accent` palette. This matches ShadCN's convention.
|
|
252
|
+
- `--shadcn-muted` is a subdued surface (our `--surface-subtle-hover`), not our `--muted` text token.
|
|
253
|
+
- `--shadcn-primary` / `--shadcn-destructive` are high-emphasis action surfaces mapped to `--fill-primary-strong` / `--fill-danger-strong`.
|
|
254
|
+
|
|
255
|
+
The `--shadcn-*` aliases are defined inside `@infonomic/uikit/styles.css` and are always present — they're cheap. To make them resolvable through Tailwind utilities (`bg-card`, `text-primary-foreground`, etc.), add a second Tailwind `@theme` block in your consumer app after the main brand palette block:
|
|
256
|
+
|
|
257
|
+
```css
|
|
258
|
+
@theme {
|
|
259
|
+
--color-background: var(--shadcn-background);
|
|
260
|
+
--color-foreground: var(--shadcn-foreground);
|
|
261
|
+
|
|
262
|
+
--color-card: var(--shadcn-card);
|
|
263
|
+
--color-card-foreground: var(--shadcn-card-foreground);
|
|
264
|
+
|
|
265
|
+
--color-popover: var(--shadcn-popover);
|
|
266
|
+
--color-popover-foreground: var(--shadcn-popover-foreground);
|
|
267
|
+
|
|
268
|
+
--color-primary: var(--shadcn-primary);
|
|
269
|
+
--color-primary-foreground: var(--shadcn-primary-foreground);
|
|
270
|
+
|
|
271
|
+
--color-secondary: var(--shadcn-secondary);
|
|
272
|
+
--color-secondary-foreground: var(--shadcn-secondary-foreground);
|
|
273
|
+
|
|
274
|
+
--color-muted: var(--shadcn-muted);
|
|
275
|
+
--color-muted-foreground: var(--shadcn-muted-foreground);
|
|
276
|
+
|
|
277
|
+
--color-accent: var(--shadcn-accent);
|
|
278
|
+
--color-accent-foreground: var(--shadcn-accent-foreground);
|
|
279
|
+
|
|
280
|
+
--color-destructive: var(--shadcn-destructive);
|
|
281
|
+
--color-destructive-foreground: var(--shadcn-destructive-foreground);
|
|
282
|
+
|
|
283
|
+
--color-border: var(--shadcn-border);
|
|
284
|
+
--color-input: var(--shadcn-input);
|
|
285
|
+
--color-ring: var(--shadcn-ring);
|
|
286
|
+
|
|
287
|
+
--radius: var(--shadcn-radius);
|
|
288
|
+
}
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
Because this block registers `--color-primary`, `--color-secondary`, `--color-accent`, and `--color-muted` as Tailwind semantic utilities, make sure your brand palette uses the `--color-brand-*` names shown in the Tailwind example above so the two vocabularies don't collide.
|
|
292
|
+
|
|
293
|
+
Our TanStack example app in `apps/tanstack` demonstrates this pattern: the brand palette and core Tailwind theme registrations live in `tailwind.css`, and the opt-in ShadCN registrations live in a separate `tailwind-shadcn.css` that is imported after it.
|
|
294
|
+
|
|
223
295
|
## Questions or Comments?
|
|
224
296
|
|
|
225
297
|
Feel free to get in touch by reaching out to us at https://infonomic.io, or by posting questions, issues, or PRs to our github repo at https://github.com/infonomic/uikit
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
object-fit: cover;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
/* flex h-full w-full items-center justify-center rounded-full bg-white dark:bg-gray-800 */
|
|
28
27
|
.avatar-fallback,
|
|
29
28
|
:global(.infonomic-avatar-fallback) {
|
|
30
29
|
display: flex;
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
align-items: center;
|
|
34
33
|
justify-content: center;
|
|
35
34
|
border-radius: 50%;
|
|
36
|
-
background-color: var(--
|
|
35
|
+
background-color: var(--surface-panel-elevated);
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
.avatar-text,
|
|
@@ -41,22 +40,6 @@
|
|
|
41
40
|
font-size: var(--font-size-sm);
|
|
42
41
|
font-weight: var(--font-weight-medium);
|
|
43
42
|
text-transform: uppercase;
|
|
44
|
-
color: var(--
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/* 🌙 Dark via `.dark` class. We rely on the
|
|
48
|
-
* consuming application to detect a user's preferred
|
|
49
|
-
* color scheme - either by header or cookie, and set
|
|
50
|
-
* a root html class accordingly
|
|
51
|
-
*/
|
|
52
|
-
:global(.dark),
|
|
53
|
-
:global([data-theme="dark"]) {
|
|
54
|
-
.avatar-fallback {
|
|
55
|
-
background-color: var(--gray-800);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.avatar-text {
|
|
59
|
-
color: var(--gray-400);
|
|
60
|
-
}
|
|
43
|
+
color: var(--text-subtle);
|
|
61
44
|
}
|
|
62
45
|
}
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
:is(.avatar-fallback-LnFLNm, .infonomic-avatar-fallback) {
|
|
20
|
-
background-color: var(--
|
|
20
|
+
background-color: var(--surface-panel-elevated);
|
|
21
21
|
border-radius: 50%;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
align-items: center;
|
|
@@ -30,15 +30,7 @@
|
|
|
30
30
|
font-size: var(--font-size-sm);
|
|
31
31
|
font-weight: var(--font-weight-medium);
|
|
32
32
|
text-transform: uppercase;
|
|
33
|
-
color: var(--
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
:is(.dark, [data-theme="dark"]) .avatar-fallback-LnFLNm {
|
|
37
|
-
background-color: var(--gray-800);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:is(.dark, [data-theme="dark"]) .avatar-text-Xf0G6q {
|
|
41
|
-
color: var(--gray-400);
|
|
33
|
+
color: var(--text-subtle);
|
|
42
34
|
}
|
|
43
35
|
}
|
|
44
36
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/button/button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE1E,UAAU,sBAAsB;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1B;AAWD,KAAK,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,CAAA;AAGhE,KAAK,sBAAsB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"button-group.d.ts","sourceRoot":"","sources":["../../../src/components/button/button-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,KAAK,GAAG,EAAE,MAAM,OAAO,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAKzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AAE1E,UAAU,sBAAsB;IAC9B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,MAAM,CAAC,EAAE,YAAY,CAAA;IACrB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;CAC1B;AAWD,KAAK,gBAAgB,GAAG,KAAK,CAAC,cAAc,CAAC,OAAO,WAAW,CAAC,CAAA;AAGhE,KAAK,sBAAsB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,OAAO,GAAG,eAAe,CAAC,GAAG;IAC7F,IAAI,EAAE,QAAQ,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;CACxC,CAAA;AAED,KAAK,wBAAwB,GAAG,IAAI,CAAC,gBAAgB,EAAE,UAAU,GAAG,OAAO,GAAG,eAAe,CAAC,GAAG;IAC/F,IAAI,EAAE,UAAU,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,sBAAsB,GAAG,wBAAwB,CAAC,GAAG;IACnF,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,IAAI,CAAA;IAClD,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAA;CAC1B,GAAG,sBAAsB,CAAA;AAG1B,QAAA,MAAM,WAAW,GAAI,wIAelB,gBAAgB,sBAoClB,CAAA;AAID,KAAK,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,WAAW,CAAC,GAAG;IACnF,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,GAAG,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAA;CAC7B,GAAG,sBAAsB,CAAA;AAE1B,QAAA,MAAM,eAAe;oDAAmD,oBAAoB;;CAyB3F,CAAA;AAID,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -16,7 +16,7 @@ const ButtonGroupContext = /*#__PURE__*/ react.createContext({
|
|
|
16
16
|
});
|
|
17
17
|
const ButtonGroup = ({ className, variant = 'filled', size = 'md', ripple = true, expandToFit = false, active = 'primary', inactive = 'noeffect', type, onValueChange, value, defaultValue, children, ref, ...props })=>{
|
|
18
18
|
const isMultiple = 'multiple' === type;
|
|
19
|
-
const handleValueChange = (newValue,
|
|
19
|
+
const handleValueChange = (newValue, _event)=>{
|
|
20
20
|
if (!onValueChange) return;
|
|
21
21
|
isMultiple ? onValueChange(newValue) : onValueChange(newValue[0] ?? '');
|
|
22
22
|
};
|
|
@@ -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
|
+
}
|
|
@@ -139,8 +139,8 @@
|
|
|
139
139
|
:is(.gradient-ySC3O3, .infonomic-button-gradient) {
|
|
140
140
|
color: var(--button-variant-gradient-foreground);
|
|
141
141
|
background: linear-gradient(45deg,
|
|
142
|
-
|
|
143
|
-
|
|
142
|
+
var(--button-variant-gradient-start),
|
|
143
|
+
var(--button-variant-gradient-end));
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
:is(.gradient-ySC3O3:disabled, .gradient-ySC3O3[disabled], .infonomic-button-gradient:disabled, .infonomic-button-gradient[disabled]) {
|
|
@@ -152,8 +152,8 @@
|
|
|
152
152
|
:is(.gradient-ySC3O3:hover, .infonomic-button-gradient:hover) {
|
|
153
153
|
color: var(--button-variant-gradient-foreground);
|
|
154
154
|
background: linear-gradient(45deg,
|
|
155
|
-
|
|
156
|
-
|
|
155
|
+
var(--button-variant-gradient-start),
|
|
156
|
+
var(--button-variant-gradient-end));
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
:is(.gradient-ySC3O3:focus, .gradient-ySC3O3:active, .infonomic-button-gradient:focus, .infonomic-button-gradient:active) {
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
--button-variant-gradient-end: var(--gradient-primary-end);
|
|
203
203
|
--button-variant-gradient-foreground: var(--gradient-primary-foreground);
|
|
204
204
|
--button-variant-gradient-disabled: var(--gradient-primary-disabled);
|
|
205
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-primary-disabled);
|
|
205
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-primary-strong-disabled);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
:is(.secondary-UqT2AY, .infonomic-button-secondary) {
|
|
@@ -230,7 +230,7 @@
|
|
|
230
230
|
--button-variant-gradient-end: var(--gradient-secondary-end);
|
|
231
231
|
--button-variant-gradient-foreground: var(--gradient-secondary-foreground);
|
|
232
232
|
--button-variant-gradient-disabled: var(--gradient-secondary-disabled);
|
|
233
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-secondary-disabled);
|
|
233
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-secondary-strong-disabled);
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
:is(.noeffect-fpxSgg, .infonomic-button-noeffect) {
|
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
--button-variant-outlined-border: var(--stroke-noeffect);
|
|
252
252
|
--button-variant-outlined-border-disabled: var(--stroke-noeffect-disabled);
|
|
253
253
|
--button-variant-outlined-foreground: var(--text-on-noeffect-outlined);
|
|
254
|
-
--button-variant-outlined-foreground-disabled: var(--text-on-noeffect-disabled);
|
|
254
|
+
--button-variant-outlined-foreground-disabled: var(--text-on-noeffect-outlined-disabled);
|
|
255
255
|
--button-variant-text: var(--fill-noeffect-text);
|
|
256
256
|
--button-variant-text-hover: var(--fill-noeffect-text-hover);
|
|
257
257
|
--button-variant-text-foreground: var(--text-noeffect);
|
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
--button-variant-gradient-end: var(--gradient-noeffect-end);
|
|
260
260
|
--button-variant-gradient-foreground: var(--gradient-noeffect-foreground);
|
|
261
261
|
--button-variant-gradient-disabled: var(--gradient-noeffect-disabled);
|
|
262
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-noeffect-disabled);
|
|
262
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-noeffect-strong-disabled);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
265
|
:is(.success-fTNDEn, .infonomic-button-success) {
|
|
@@ -287,7 +287,7 @@
|
|
|
287
287
|
--button-variant-gradient-end: var(--gradient-success-end);
|
|
288
288
|
--button-variant-gradient-foreground: var(--gradient-success-foreground);
|
|
289
289
|
--button-variant-gradient-disabled: var(--gradient-success-disabled);
|
|
290
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-success-disabled);
|
|
290
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-success-strong-disabled);
|
|
291
291
|
}
|
|
292
292
|
|
|
293
293
|
:is(.info-qrdXQD, .infonomic-button-info) {
|
|
@@ -315,7 +315,7 @@
|
|
|
315
315
|
--button-variant-gradient-end: var(--gradient-info-end);
|
|
316
316
|
--button-variant-gradient-foreground: var(--gradient-info-foreground);
|
|
317
317
|
--button-variant-gradient-disabled: var(--gradient-info-disabled);
|
|
318
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-info-disabled);
|
|
318
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-info-strong-disabled);
|
|
319
319
|
}
|
|
320
320
|
|
|
321
321
|
:is(.warning-a00T3A, .infonomic-button-warning) {
|
|
@@ -343,7 +343,7 @@
|
|
|
343
343
|
--button-variant-gradient-end: var(--gradient-warning-end);
|
|
344
344
|
--button-variant-gradient-foreground: var(--gradient-warning-foreground);
|
|
345
345
|
--button-variant-gradient-disabled: var(--gradient-warning-disabled);
|
|
346
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-warning-disabled);
|
|
346
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-warning-strong-disabled);
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
:is(.danger-rwIV_i, .infonomic-button-danger) {
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
--button-variant-gradient-end: var(--gradient-danger-end);
|
|
372
372
|
--button-variant-gradient-foreground: var(--gradient-danger-foreground);
|
|
373
373
|
--button-variant-gradient-disabled: var(--gradient-danger-disabled);
|
|
374
|
-
--button-variant-gradient-foreground-disabled: var(--text-on-danger-disabled);
|
|
374
|
+
--button-variant-gradient-foreground-disabled: var(--text-on-danger-strong-disabled);
|
|
375
375
|
}
|
|
376
376
|
|
|
377
377
|
:is(.fullWidth-wXvP0v, .infonomic-button-full-width) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/combo-button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAGnD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAC3C,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC3C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,6LAgBzB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"combo-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/combo-button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,UAAU,CAAA;AAGnD,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAC3C,OAAO,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC3C,aAAa,CAAC,EAAE,MAAM,IAAI,CAAA;IAC1B,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAA;IAClC,QAAQ,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAA;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,WAAW,GAAI,6LAgBzB,gBAAgB,gCAiDlB,CAAA"}
|
|
@@ -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
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/copy-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,UAAU,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,SAAkB,EAClB,UAAsB,EACtB,OAAO,EACP,IAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,
|
|
1
|
+
{"version":3,"file":"copy-button.d.ts","sourceRoot":"","sources":["../../../src/components/button/copy-button.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAE9C,UAAU,eAAgB,SAAQ,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,SAAkB,EAClB,UAAsB,EACtB,OAAO,EACP,IAAW,EACX,MAAM,EACN,SAAS,EACT,MAAM,EACN,SAAS,EACT,kBAAkB,EAClB,YAAY,EACZ,GAAG,IAAI,EACR,EAAE,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAyFrC"}
|
|
@@ -6,7 +6,8 @@ import { Tooltip } from "../tooltip/tooltip.js";
|
|
|
6
6
|
import { Button } from "./button.js";
|
|
7
7
|
import copy_button_module from "./copy-button.module.js";
|
|
8
8
|
function CopyButton({ text, hoverText = 'Copy', copiedText = 'Copied!', variant, size = 'sm', intent, fullWidth, ripple, className, containerClassName, svgClassName, ...rest }) {
|
|
9
|
-
const [copied, setCopied] = useState(
|
|
9
|
+
const [copied, setCopied] = useState(false);
|
|
10
|
+
const [hoverOpen, setHoverOpen] = useState(false);
|
|
10
11
|
const handleCopied = ()=>{
|
|
11
12
|
if (null != navigator.clipboard && null != navigator.permissions) navigator.clipboard.writeText(text).then(()=>{
|
|
12
13
|
setCopied(true);
|
|
@@ -22,18 +23,24 @@ function CopyButton({ text, hoverText = 'Copy', copiedText = 'Copied!', variant,
|
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
useEffect(()=>{
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
26
|
+
if (!copied) return;
|
|
27
|
+
const timer = setTimeout(()=>setCopied(false), 900);
|
|
28
|
+
return ()=>clearTimeout(timer);
|
|
29
|
+
}, [
|
|
30
|
+
copied
|
|
31
|
+
]);
|
|
32
|
+
const tooltipText = copied ? copiedText : hoverText;
|
|
30
33
|
return /*#__PURE__*/ jsx("div", {
|
|
31
34
|
className: classnames('infonomic-copy-button-container', copy_button_module["copy-button-container"], containerClassName),
|
|
32
35
|
children: /*#__PURE__*/ jsx(Tooltip, {
|
|
33
36
|
side: "top",
|
|
34
37
|
sideOffset: 2,
|
|
35
38
|
text: tooltipText,
|
|
36
|
-
open: copied,
|
|
39
|
+
open: copied || hoverOpen,
|
|
40
|
+
onOpenChange: (next)=>{
|
|
41
|
+
if (copied && !next) return;
|
|
42
|
+
setHoverOpen(next);
|
|
43
|
+
},
|
|
37
44
|
children: /*#__PURE__*/ jsx(Button, {
|
|
38
45
|
variant: variant,
|
|
39
46
|
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;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
width: 100%;
|
|
6
6
|
max-width: 100%;
|
|
7
7
|
color: var(--foreground);
|
|
8
|
-
background: var(--
|
|
8
|
+
background: var(--surface-panel);
|
|
9
9
|
border-width: var(--border-width-thin);
|
|
10
10
|
border-color: var(--border-color);
|
|
11
11
|
border-style: var(--border-style-solid);
|
|
@@ -16,10 +16,6 @@
|
|
|
16
16
|
display: flex;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
:is(:is(.dark, [data-theme="dark"]) .card-mqJaiW, :is(.dark, [data-theme="dark"]) .infonomic-card) {
|
|
20
|
-
background: var(--canvas-800);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
19
|
:is(.card-hover-hvT4d6, .infonomic-card-hover) {
|
|
24
20
|
transition: background .2s ease-in-out;
|
|
25
21
|
}
|