@nxgt/material 3.10.2 → 3.11.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/CHANGELOG.md +70 -0
- package/README.md +4 -4
- package/dist/{async-slice-DDjaJY_F.js → async-slice-4qbER86I.js} +1 -1
- package/dist/button-BNjw-pnE.js +327 -0
- package/dist/button-group-context-CaP0X5p_.js +5 -0
- package/dist/{button-tones-BgZJ1tkD.js → button-tones-BwuVvAmd.js} +9 -1
- package/dist/{callout-view-DdJPdFrP.js → callout-view-C6voDS00.js} +1 -1
- package/dist/charts.js +5 -5
- package/dist/{chip-DpySRqCy.js → chip-DLgQTJBZ.js} +4 -4
- package/dist/{code-editor-BiA14xua.js → code-editor-BZbaYLvo.js} +8 -8
- package/dist/code-editor.js +7 -7
- package/dist/{code-language-items-C_dJ6GVs.js → code-language-items-BT5BO5w6.js} +2 -2
- package/dist/components/base.css +21 -6
- package/dist/components/components.css +5 -2
- package/dist/components/type-scale.css +194 -0
- package/dist/components/ui/actions/button/button.css +156 -0
- package/dist/components/ui/actions/button-group/button-group-standard.css +131 -0
- package/dist/components/ui/actions/button-group/button-group.css +4 -1
- package/dist/components/ui/actions/icon-button/icon-button.css +115 -0
- package/dist/components/ui/actions/morph-fill.css +62 -0
- package/dist/{components-BkF9N-Yx.js → components-1GK7YIhY.js} +14685 -14688
- package/dist/components.js +23 -23
- package/dist/{dialog-CkIYpJXk.js → dialog-BQp5IdFl.js} +147 -147
- package/dist/dnd.js +1 -1
- package/dist/{dropdown-menu-BC5Tbhb9.js → dropdown-menu-BsH9W_3C.js} +3 -3
- package/dist/editor-viewer.js +1 -1
- package/dist/editor.js +13 -13
- package/dist/{empty-state-SeAg2TOX.js → empty-state-WaU4-T2c.js} +5 -5
- package/dist/escape-owner-C4W_sOAU.js +116 -0
- package/dist/{field-blur-DPLsMufs.js → field-blur-CJHzVSh9.js} +1 -1
- package/dist/{field-blur-context-1ZwJgsHE.js → field-blur-context-Cft9s7Hg.js} +2 -2
- package/dist/{hover-card-Cox-tPDz.js → hover-card-C0fw2kLK.js} +72 -71
- package/dist/i18n.js +12 -12
- package/dist/{icon-badge-q3Ve8gra.js → icon-badge-DUAq9f7H.js} +4 -4
- package/dist/icon-button-ifTpXt0A.js +355 -0
- package/dist/{illustration-BfHRpVzM.js → illustration-BmQmvW_4.js} +1 -1
- package/dist/illustrations.js +2 -2
- package/dist/lib/components/ui/actions/button/button-tones.d.ts +16 -0
- package/dist/lib/components/ui/actions/button/button.d.ts +13 -0
- package/dist/lib/components/ui/actions/button/button.variants.d.ts +4 -3
- package/dist/lib/components/ui/actions/button-group/button-group-context.d.ts +16 -0
- package/dist/lib/components/ui/actions/button-group/button-group-reset.d.ts +13 -0
- package/dist/lib/components/ui/actions/button-group/button-group.d.ts +19 -2
- package/dist/lib/components/ui/actions/icon-button/icon-button-shape.d.ts +3 -2
- package/dist/lib/components/ui/actions/icon-button/icon-button.d.ts +18 -4
- package/dist/lib/components/ui/actions/icon-button/icon-button.variants.d.ts +34 -4
- package/dist/lib/components/ui/feedback/typing-indicator/typing-indicator.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/split-slider-props.d.ts +1 -1
- package/dist/lib/components/ui/fields/slider/use-slider-control.d.ts +1 -1
- package/dist/lib/components/ui/overlays/dialog/dialog-variants.d.ts +1 -1
- package/dist/lib/components/ui/primitives/toggle/toggle.d.ts +1 -1
- package/dist/lib/components/ui/primitives/typography/typography.d.ts +17 -7
- package/dist/lib/components/ui/primitives/typography/typography.variants.d.ts +55 -0
- package/dist/lib/components/ui/selection/choice-group/use-choice-group-field.d.ts +2 -2
- package/dist/lib/i18n/translator.d.ts +1 -1
- package/dist/lib.js +2 -2
- package/dist/{line-path-BQeLQZ-P.js → line-path-C5pZGC49.js} +1 -1
- package/dist/main.js +29 -29
- package/dist/map.js +9 -9
- package/dist/material.css +1 -1
- package/dist/pdf-reader.js +1 -1
- package/dist/print.js +1 -1
- package/dist/{public-CtpsxV4I.js → public-B0Nq_yYV.js} +524 -524
- package/dist/{render-json-DyFYFIkZ.js → render-json-BOhvPnSv.js} +1 -1
- package/dist/{rich-code-block-C2Fp_FDU.js → rich-code-block-v7WmeZp9.js} +5 -5
- package/dist/{rich-text-viewer-LO1IZCWs.js → rich-text-viewer-W15XIwah.js} +2 -2
- package/dist/{skeleton-Bmp4gWAH.js → skeleton-DSdtr2qc.js} +1 -1
- package/dist/{sortable-provider-pVaEZzty.js → sortable-provider-CgDTolQR.js} +3 -3
- package/dist/{spinner-CsHcmcpF.js → spinner-BtSIYVrC.js} +3 -3
- package/dist/{state-scenes-SGNyZjTz.js → state-scenes-BX03WmSu.js} +1 -1
- package/dist/styles.css +2 -0
- package/dist/theme-picker.js +3 -3
- package/dist/{theme-toggle-oU-fh6WE.js → theme-toggle-B2Pehdhn.js} +2 -2
- package/dist/{toggle-group-j8zaxEg1.js → toggle-group-BMJNcFAC.js} +1 -1
- package/dist/{toolbar-items-CqHvlTU8.js → toolbar-items-rUHdVqAq.js} +399 -398
- package/dist/{tooltip-rhbqNmr3.js → tooltip-CkttDIab.js} +1 -1
- package/dist/{translate-material-CGZljjp1.js → translate-material-Bd_KgfB8.js} +1 -1
- package/dist/{translator-DCYO4Ij3.js → translator-Dje8HrNz.js} +5 -5
- package/dist/{use-chat-composer-nWWfVyrK.js → use-chat-composer-Bt2ULsv6.js} +4172 -4172
- package/dist/{use-material-translation-DkxcLbLM.js → use-material-translation-B3V_bz-5.js} +1 -1
- package/dist/{utils-Bcd2Z3ea.js → utils-BLfntITJ.js} +14 -1
- package/docs/components/buttons-and-actions.md +64 -15
- package/docs/components/navigation-and-layout.md +1 -1
- package/docs/components/primitives.md +52 -10
- package/docs/guides/theming.md +51 -0
- package/docs/previews/buttons-actions-button.webp +0 -0
- package/docs/previews/buttons-actions-iconbutton.webp +0 -0
- package/docs/previews/primitives-typography.webp +0 -0
- package/docs/roadmap.md +35 -4
- package/docs/troubleshooting.md +58 -2
- package/lib/components/base.css +21 -6
- package/lib/components/components.css +5 -2
- package/lib/components/type-scale.css +194 -0
- package/lib/components/ui/actions/button/button.css +156 -0
- package/lib/components/ui/actions/button-group/button-group-standard.css +131 -0
- package/lib/components/ui/actions/button-group/button-group.css +4 -1
- package/lib/components/ui/actions/icon-button/icon-button.css +115 -0
- package/lib/components/ui/actions/morph-fill.css +62 -0
- package/lib/styles.css +2 -0
- package/package.json +1 -1
- package/dist/button-DbfdITBB.js +0 -322
- package/dist/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
- package/dist/components/ui/actions/icon-button/icon-button-morph.css +0 -152
- package/dist/escape-owner-CripBce_.js +0 -57
- package/dist/icon-button-DJcWpIhu.js +0 -319
- package/lib/components/ui/actions/icon-button/icon-button-morph-media.css +0 -65
- package/lib/components/ui/actions/icon-button/icon-button-morph.css +0 -152
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,75 @@
|
|
|
1
1
|
# @nxgt/material
|
|
2
2
|
|
|
3
|
+
## 3.11.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1436](https://github.com/softistx/nxgt-material/pull/1436) [`cdd7025`](https://github.com/softistx/nxgt-material/commit/cdd7025df8e581b3b04168c10c8f4afd3a5ec9a7) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Button goes Material 3 Expressive. New options, no breaking type change: `size` adds `xl` (56 px) and `2xl` (96 px) to `xs`, `sm`, `default` and `lg`; `shape` is `round` (default) or `square`, and the corners spring when the button is pressed (a round one squares, a square one rounds, and the button scales to .97, .985 at `2xl`; reduced motion keeps the colour change only); `selected` makes it a toggle (`aria-pressed` and `data-selected`), takes the other shape and a solid fill of its colour (ignored with `asChild`, with a warning in development). A round button's radius is half its height, never 999px, and every corner stays at 4 px or more at the spring's overshoot. On a coarse pointer every size has a 44 px hit area. `buttonVariants` carries the same look, so Pagination, AlertDialog and the calendar's date picker follow.
|
|
8
|
+
|
|
9
|
+
**Visual changes** (every `Button`, and what uses `buttonVariants`):
|
|
10
|
+
|
|
11
|
+
- Padding grows: `default` 16 → 18 px, `xs` 8 → 12 px, `sm` 12 → 16 px, with an icon too. A button without a `size` keeps its content height and its 16 px padding.
|
|
12
|
+
- Labels use the type scale and are heavier: weights 560 (`xs`) to 700 (`2xl`), `lg` 14 → 16 px (`title-md`), `xl` 24 px, `2xl` 32 px. The icon follows the size (`xs` 14 px, `default` 18 px, `2xl` 44 px).
|
|
13
|
+
- The `filled` and `tonal` variants lose their `shadow-xs`.
|
|
14
|
+
- The focus is a 2 px outline in the colour, 2 px off the button, instead of a 3 px ring; `aria-invalid` focuses in the error colour.
|
|
15
|
+
- A disabled button has neutral text (40 % of the text colour), whatever the variant and colour, and a neutral fill (12 %) except `ghost` and `link`, which stay transparent, instead of 50 % opacity.
|
|
16
|
+
- The `outlined` line is 1.5 px, drawn inside the box at 55 % of the colour, instead of a 1 px border at 50 %.
|
|
17
|
+
- A `ghost` button is neutral without a `color` (and with `color="default"`); one given a `color`, `primary` included, is tinted by it (its text and hover), where `primary` was neutral.
|
|
18
|
+
- A pressed button squeezes (radius and scale).
|
|
19
|
+
- The label is what is cut with an ellipsis, not the button: the host no longer truncates (an `asChild` host still does), the children of a button are no longer all `truncate`, and a `buttonVariants` element (Pagination's links, AlertDialog's actions) no longer cuts bare text with an ellipsis.
|
|
20
|
+
- Toolbar items keep the Toolbar's own look. `IconButton` and `ButtonGroup` take the same look in this release (their own changesets).
|
|
21
|
+
- A `Banner`'s text actions (`ghost` and `link`) are pulled back by the button's own padding (`--btn-px`, less `--btn-pxi` with a leading icon) instead of a list of fixed margins per size, so they stay aligned at every size.
|
|
22
|
+
- A `Button` with a height class of your own (`h-11`) keeps the pill radius of its `size` (half of `--btn-h`, 36 px without one): set `--btn-h` with your height (`[--btn-h:44px] h-(--btn-h)`), or use `size`. The date and time pickers' OK and Cancel do this on a coarse pointer, so their pill follows their 44 px.
|
|
23
|
+
- An `asChild` button (a link) cuts its text with `overflow: clip` and a 22 px clip margin instead of `truncate`, so its 44 px hit area on a coarse pointer is not clipped.
|
|
24
|
+
- A `ghost` button given `selected` without a `color` is a neutral tint, as `IconButton`'s ghost toggle is (12 % of the text colour, label and icon in the full text colour); it is tinted by its `color` when one is set (an explicit `color="default"` selects as a solid fill of the text colour).
|
|
25
|
+
- A selected button is the system's selected item in forced colours (`SelectedItem` and `SelectedItemText`, the icon's line too).
|
|
26
|
+
|
|
27
|
+
- [#1447](https://github.com/softistx/nxgt-material/pull/1447) [`452216b`](https://github.com/softistx/nxgt-material/commit/452216bec6789708831d4b490c27a3962e06e6a9) Thanks [@SteveGT96](https://github.com/SteveGT96)! - `ButtonGroup` gets the Material 3 Expressive "standard" look and a shared size. `look="standard"` is an opt-in in this release (it becomes the default in the next major, with `look="legacy"` to keep the original): the buttons keep their own look, 8px apart, and a pressed one widens by 14px on each side while its neighbours give the same width back (half each, or all of it when it sits at an end), so the group never changes width; the buttons spring on `spatial-fast`, and reduced motion turns the exchange off. At `xs`, `sm` and `default` the exchange is 7, 10 and 11px per side, the most a button of that size can give back at the end of the group without its padding going below 0 in the spring's overshoot (10px without a `size`). An icon-only button keeps its icon and 2px each side, so next to a pressed button at the end of the group it may give back less than asked and the group widens by the difference. `size` (`xs`, `sm`, `default`, `lg` or `xl`) is shared by every `Button` and `IconButton` in the group through a context; a child with a `size` of its own keeps it. `data-slot="button-group"`, `data-look` and `data-size` are on the host. On a coarse pointer the gap grows to `max(8px, 44px - the size's height)` (20px at `xs`, 12px at `sm`, 8px from `default`), so every button, across and between wrapped rows, keeps a 44px hit area that touches no neighbour's.
|
|
28
|
+
|
|
29
|
+
A `ButtonGroup` without `look` is unchanged: the original rules (tinted, rounded children, `w-full`, 8px of padding) now apply to `.nxgt-button-group:not(:where([data-look]))`, at the same specificity as before; `size` works on it too.
|
|
30
|
+
|
|
31
|
+
`Button`'s `outlined` variant keeps its line in forced colours (a `ButtonText` outline, where the inset shadow is removed), as `IconButton`'s does.
|
|
32
|
+
|
|
33
|
+
- [#1444](https://github.com/softistx/nxgt-material/pull/1444) [`9215bc1`](https://github.com/softistx/nxgt-material/commit/9215bc181f93f24cc4151b5ab168ecb40b4e790d) Thanks [@SteveGT96](https://github.com/SteveGT96)! - IconButton goes Material 3 Expressive, on the look `Button` already has. New options and one narrow type break (see the Type note): `size` is `xs`, `sm`, `default`, `lg` or `xl` (24, 32, 36, 40 and 56 px, with icons of 14, 16, 18, 20 and 28 px), and `width` is `narrow`, `default` or `wide` (0.78, 1 and 1.45 times the height); `width` is ignored when `shape` draws the button as an expressive shape (a warning in development). A button without a `size` is exactly what it was: 36 px, a circle, a 16 px icon (an explicit `size="default"` has an 18 px icon; the ladder's icon size applies to a glyph without its own `size-*` class, and the `Icon` component is 16 px unless sized). `iconButtonVariants` takes `size` and `width` too (`ScrollToTop`'s props follow). The `morph` options (`pill`, `round`, `none`) keep their meaning; a toggle now sets `data-selected` and its fill is the one `Button` shares (`morph-fill.css`), the pill being the button's own width rather than a `::before`.
|
|
34
|
+
|
|
35
|
+
**Visual changes** (every `IconButton`, and what uses `iconButtonVariants`: the close buttons of Dialog, Drawer and Sheet):
|
|
36
|
+
|
|
37
|
+
- The `filled` and `tonal` variants lose their `shadow-xs`, and the `outlined` line is Button's: 1.5 px inside the box at 55 % of the colour, instead of a 1 px border at 50 %; it gives way to the fill when selected and disappears when disabled.
|
|
38
|
+
- A `ghost` toggle without a `color` is neutral when selected too (a 12 % tint of the text colour, the icon in full text colour); it is primary only when a `color` is set. Its focus outline is the text's colour.
|
|
39
|
+
- The focus is a 2 px outline in the colour, 2 px off the button, instead of a 3 px ring; `aria-invalid` focuses in the error colour.
|
|
40
|
+
- A disabled button has neutral text and icon (40 % of the text colour) and a neutral fill (12 %), except `ghost` and `link`, which stay transparent, instead of 50 % opacity; a disabled `outlined` button loses its line.
|
|
41
|
+
- An `aria-invalid` button no longer draws an error border and ring: only its focus outline (and an `outlined` line) turns to the error colour.
|
|
42
|
+
- A pill toggle's selected width follows its `size`; use `size` rather than a `size-*` class on a pill toggle.
|
|
43
|
+
- A pressed button squeezes (the corners go toward a square, and it scales to .97); reduced motion keeps the colour change only.
|
|
44
|
+
- On a coarse pointer every size has a 44 px hit area, a shaped button too.
|
|
45
|
+
- Toolbar items and shaped buttons keep their own looks.
|
|
46
|
+
- An `IconButton` without a `variant` is the `filled` one in `data-variant` too, so a disabled one no longer has an invisible icon; in an editor toolbar, a variant-less IconButton now matches `[data-variant=filled]` selectors (every shipped ToolbarIconButton passes a variant).
|
|
47
|
+
- `Sheet`'s close button merges the variant's classes with its own position and touch box through `cn`, so the size classes of the ladder do not fight the touch box's; Dialog, Sheet, Drawer, Popover and AlertDialog give their content no `ButtonGroup` size, where an overlay opened from a sized group used to pass it on.
|
|
48
|
+
|
|
49
|
+
**Type note**: `IconButton` and `IconLinkButton` now have a typed `size`, so spreading a `Button`'s props into them no longer compiles when `size` is `icon`, `icon-xs`, `icon-sm`, `icon-lg` or `2xl`: drop `size` before spreading (`const { size, ...rest } = props`). `Button`'s `shape` (`round` or `square`) is likewise not `IconButton`'s `shape` (an expressive shape name).
|
|
50
|
+
|
|
51
|
+
- [#1433](https://github.com/softistx/nxgt-material/pull/1433) [`f66606d`](https://github.com/softistx/nxgt-material/commit/f66606d86c847aefbfcef94f2c8d525ff052b510) Thanks [@SteveGT96](https://github.com/SteveGT96)! - Typography takes the Material 3 type scale. `variant` accepts `display`, `headline`, `title`, `body` and `label`, each in `lg`, `md` and `sm` (`title-md`, `body-sm`…), `body-md` by default, and the new `emphasized` prop gives the same step a heavier weight. The scale is a set of Tailwind 4 tokens in `styles.css`, `--text-<role>-<size>` with its `--line-height`, `--letter-spacing` and `--font-weight` (and `--font-weight-em` for the emphasized weight), so `text-title-md` and `text-title-md-em` are native utilities that set size, line height, tracking and weight together. An app or a zone retunes any of them with a CSS variable on `:root` or the zone; a variable font such as Inter reads the numeric weights on its `wght` axis. There is no `defineTheme` key.
|
|
52
|
+
|
|
53
|
+
The fifteen former variants stay, deprecated, as aliases of the scale by name, the old semibold ones on the emphasized step, so no type breaks but **their sizes change**:
|
|
54
|
+
|
|
55
|
+
| Former variant | Now | Size before → after |
|
|
56
|
+
| --- | --- | --- |
|
|
57
|
+
| `normal`, `body-medium` | `body-md` | 14 → 14 px (weight 400, which `Typography` now sets itself instead of inheriting its parent's) |
|
|
58
|
+
| `body-small` | `body-sm` | 12 → 12 px |
|
|
59
|
+
| `caption` | `label-sm`, muted | 10 → 11 px |
|
|
60
|
+
| `title-small` | `title-sm` emphasized | 16 → 14 px |
|
|
61
|
+
| `title-medium` | `title-md` emphasized | 18 → 16 px |
|
|
62
|
+
| `title-large` | `title-lg` emphasized | 20 → 22 px |
|
|
63
|
+
| `headline-small` | `headline-sm` emphasized | 24 → 24 px |
|
|
64
|
+
| `headline-medium` | `headline-md` emphasized | 30 → 28 px |
|
|
65
|
+
| `headline-large` | `headline-lg` emphasized | 36 → 32 px |
|
|
66
|
+
| `headline-larger` | `display-sm` emphasized | 48 → 36 px |
|
|
67
|
+
| `huge-small` | `display-sm` emphasized | 60 → 36 px |
|
|
68
|
+
| `huge-medium` | `display-md` emphasized | 72 → 45 px |
|
|
69
|
+
| `huge-large`, `huge-larger` | `display-lg` emphasized | 96 → 57 px |
|
|
70
|
+
|
|
71
|
+
The weights follow the scale too (emphasized 540 to 700 instead of 600), as do the line heights and the tracking. The bare `h1` to `h6` elements (`base.css`) read the scale too, with weight 500: `h1` is `headline-md` (24 → 28 px), `h2` `headline-sm` (20 → 24 px), `h3` `title-lg` (18 → 22 px), `h4` `title-md` (16 px), `h5` `title-sm` (14 px) and `h6` `label-md` (12 px), each with the step's line height and tracking, so retuning a step retunes the headings.
|
|
72
|
+
|
|
3
73
|
## 3.10.2
|
|
4
74
|
|
|
5
75
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -476,7 +476,7 @@ Not components: what the stylesheet gives any element.
|
|
|
476
476
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-accordion.webp" width="120" alt="Accordion"> | [`Accordion`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#accordion), `AccordionItem`, `AccordionTrigger`, `AccordionContent` | Collapsible sections whose content springs open, in three looks (`flush`, `separated` cards, `contained` list) and three sizes. | `Accordion` (same parts) |
|
|
477
477
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-collapsible.webp" width="120" alt="Collapsible"> | [`Collapsible`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#collapsible), `CollapsibleTrigger`, `CollapsibleContent` | A single show / hide region that springs open, and its trigger (optionally styled: `tonal` or `text`). | `Collapsible` (same parts) |
|
|
478
478
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-card.webp" width="120" alt="Card"> | [`Card`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#card), `CardHeader`, `CardTitle`, `CardDescription`, `CardAction`, `CardContent`, `CardFooter` | Card surface with header, action slot, content and footer. | `Card` (same parts) |
|
|
479
|
-
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-typography.webp" width="120" alt="Typography"> | [`Typography`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#typography) | Text in the Material type scale
|
|
479
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-typography.webp" width="120" alt="Typography"> | [`Typography`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#typography) | Text in the Material 3 type scale: display, headline, title, body and label in three sizes, `emphasized` for the heavier weight; the former names are deprecated aliases. | `Typography` |
|
|
480
480
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-anchorheading.webp" width="120" alt="AnchorHeading"> | [`AnchorHeading`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#anchorheading) | Heading with a hover copy-link (always visible on the phone). | `AnchorHeading` |
|
|
481
481
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-label.webp" width="120" alt="Label"> | [`Label`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#label) | Form label with an optional required asterisk. | `Label` |
|
|
482
482
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/primitives-helpertext.webp" width="120" alt="HelperText"> | [`HelperText`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/primitives.md#helpertext) | Hint or error message under a field. | `HelperText` |
|
|
@@ -499,9 +499,9 @@ Not components: what the stylesheet gives any element.
|
|
|
499
499
|
|
|
500
500
|
| Preview | Component | What it does | @nxgt/material-vue |
|
|
501
501
|
| --- | --- | --- | --- |
|
|
502
|
-
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-button.webp" width="120" alt="Button"> | [`Button`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#button) | Filled, tonal, outlined, ghost or link button in seven colours,
|
|
503
|
-
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-iconbutton.webp" width="120" alt="IconButton"> | [`IconButton`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#iconbutton) | Icon-only button with an optional tooltip; `shape` draws it as an expressive shape and morphs when it changes. | `IconButton` |
|
|
504
|
-
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-buttongroup.webp" width="120" alt="ButtonGroup"> | [`ButtonGroup`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#buttongroup) | Joins adjacent buttons into one control. | `ButtonGroup` |
|
|
502
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-button.webp" width="120" alt="Button"> | [`Button`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#button) | Filled, tonal, outlined, ghost or link button in seven colours, six sizes (24 to 96 px), round or square (`shape`), a `selected` toggle and a loading state. | `Button` |
|
|
503
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-iconbutton.webp" width="120" alt="IconButton"> | [`IconButton`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#iconbutton) | Icon-only button in five sizes and three widths, with an optional tooltip; a toggle fills and widens; `shape` draws it as an expressive shape and morphs when it changes. | `IconButton` |
|
|
504
|
+
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-buttongroup.webp" width="120" alt="ButtonGroup"> | [`ButtonGroup`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#buttongroup) | Joins adjacent buttons into one control; `look="standard"` widens the pressed one and `size` is shared. | `ButtonGroup` |
|
|
505
505
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-splitbutton.webp" width="120" alt="SplitButton"> | [`SplitButton`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#splitbutton) | Main action plus a menu of related ones: two halves, five sizes, an open state that morphs. | `SplitButton` |
|
|
506
506
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-fab.webp" width="120" alt="Fab"> | [`Fab`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#fab), `FabDock` | The screen's main floating action: four sizes, tonal or filled in three tones or an app tone, extended, folds on scroll (`useScrollAway`). | — |
|
|
507
507
|
| <img src="https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/previews/buttons-actions-fabmenu.webp" width="120" alt="FabMenu"> | [`FabMenu`](https://cdn.jsdelivr.net/npm/@nxgt/material@3/docs/components/buttons-and-actions.md#fabmenu) | A FAB that opens a few related actions as pills, with a scrim. | — |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as e, r as t, t as n } from "./stored-language-BeIKw3-K.js";
|
|
2
|
-
import { r } from "./translator-
|
|
2
|
+
import { r } from "./translator-Dje8HrNz.js";
|
|
3
3
|
import { t as i } from "./_baseIsEqual-C6ksIHya.js";
|
|
4
4
|
import { useMemo as a } from "react";
|
|
5
5
|
import { asyncThunkCreator as o, buildCreateSlice as s } from "@reduxjs/toolkit";
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
+
import { n as t, t as n } from "./dist-DVRQkaTK.js";
|
|
3
|
+
import { o as r, t as i } from "./tooltip-CkttDIab.js";
|
|
4
|
+
import { t as a } from "./is-production-GLw59WU8.js";
|
|
5
|
+
import { t as o } from "./spinner-BtSIYVrC.js";
|
|
6
|
+
import { a as s, i as c, r as l, t as u } from "./button-tones-BwuVvAmd.js";
|
|
7
|
+
import { t as d } from "./button-group-context-CaP0X5p_.js";
|
|
8
|
+
import { t as f } from "./has-text-content-Ds2dkHX_.js";
|
|
9
|
+
import { Children as p, Fragment as m, cloneElement as h, isValidElement as g, useCallback as _, useContext as v, useEffect as y, useRef as b, useState as x } from "react";
|
|
10
|
+
import { jsx as S, jsxs as C } from "react/jsx-runtime";
|
|
11
|
+
//#region lib/components/ui/actions/button/busy-click-capture.ts
|
|
12
|
+
function w(e, t, n) {
|
|
13
|
+
return (r) => {
|
|
14
|
+
if (e || t.isLocked()) {
|
|
15
|
+
r.preventDefault(), r.stopPropagation();
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
t.lock(), n?.(r);
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region lib/components/ui/actions/button/button.compound-variants.ts
|
|
23
|
+
var T = [
|
|
24
|
+
{
|
|
25
|
+
variant: "filled",
|
|
26
|
+
color: "primary",
|
|
27
|
+
class: "bg-primary text-primary-foreground hover:bg-[color-mix(in_oklab,var(--color-primary)_90%,black)] [&_svg]:data-[slot=icon]:text-primary-foreground active:bg-[color-mix(in_oklab,var(--color-primary)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-primary)_85%,black)]"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
variant: "filled",
|
|
31
|
+
color: "secondary",
|
|
32
|
+
class: "bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklab,var(--color-secondary)_90%,black)] [&_svg]:data-[slot=icon]:text-secondary-foreground active:bg-[color-mix(in_oklab,var(--color-secondary)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-secondary)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-secondary)_60%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-secondary)_50%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-secondary)_60%,var(--color-background))]"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
variant: "filled",
|
|
36
|
+
color: "success",
|
|
37
|
+
class: "bg-success text-success-foreground hover:bg-[color-mix(in_oklab,var(--color-success)_90%,black)] [&_svg]:data-[slot=icon]:text-success-foreground active:bg-[color-mix(in_oklab,var(--color-success)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-success)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-success)_60%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-success)_50%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-success)_40%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-success)_50%,var(--color-background))]"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
variant: "filled",
|
|
41
|
+
color: "info",
|
|
42
|
+
class: "bg-info text-info-foreground hover:bg-[color-mix(in_oklab,var(--color-info)_90%,black)] [&_svg]:data-[slot=icon]:text-info-foreground active:bg-[color-mix(in_oklab,var(--color-info)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-info)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-info)_60%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-info)_50%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-info)_40%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-info)_50%,var(--color-background))]"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
variant: "filled",
|
|
46
|
+
color: "warning",
|
|
47
|
+
class: "bg-warning text-warning-foreground hover:bg-[color-mix(in_oklab,var(--color-warning)_90%,black)] [&_svg]:data-[slot=icon]:text-warning-foreground active:bg-[color-mix(in_oklab,var(--color-warning)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-warning)_85%,black)] dark:bg-[color-mix(in_oklab,var(--color-warning)_60%,var(--color-background))] dark:hover:bg-[color-mix(in_oklab,var(--color-warning)_50%,var(--color-background))] dark:active:bg-[color-mix(in_oklab,var(--color-warning)_40%,var(--color-background))] dark:focus:bg-[color-mix(in_oklab,var(--color-warning)_50%,var(--color-background))]"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
variant: "filled",
|
|
51
|
+
color: "error",
|
|
52
|
+
class: "bg-error text-error-foreground hover:bg-[color-mix(in_oklab,var(--color-error)_90%,black)] [&_svg]:data-[slot=icon]:text-error-foreground active:bg-[color-mix(in_oklab,var(--color-error)_80%,black)] focus:bg-[color-mix(in_oklab,var(--color-error)_85%,black)]"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
variant: "filled",
|
|
56
|
+
color: "default",
|
|
57
|
+
class: "bg-foreground text-background hover:bg-[color-mix(in_oklab,var(--color-foreground)_90%,var(--color-background))] [&_svg]:data-[slot=icon]:text-foreground active:bg-[color-mix(in_oklab,var(--color-foreground)_70%,var(--color-background))] focus:bg-[color-mix(in_oklab,var(--color-foreground)_80%,var(--color-background))]"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
variant: "tonal",
|
|
61
|
+
color: "primary",
|
|
62
|
+
class: `${l.primary} ${u.primary} bg-primary/15 hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
variant: "tonal",
|
|
66
|
+
color: "secondary",
|
|
67
|
+
class: `${l.secondary} ${u.secondary} bg-secondary/15 hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
variant: "tonal",
|
|
71
|
+
color: "info",
|
|
72
|
+
class: `${l.info} ${u.info} bg-info/15 hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
variant: "tonal",
|
|
76
|
+
color: "success",
|
|
77
|
+
class: `${l.success} ${u.success} bg-success/15 hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
variant: "tonal",
|
|
81
|
+
color: "warning",
|
|
82
|
+
class: `${l.warning} ${u.warning} bg-warning/15 hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
variant: "tonal",
|
|
86
|
+
color: "error",
|
|
87
|
+
class: `${l.error} ${u.error} bg-error/15 hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
variant: "tonal",
|
|
91
|
+
color: "default",
|
|
92
|
+
class: `${l.default} ${u.default} bg-foreground/15 hover:bg-foreground/10 active:bg-muted focus:bg-muted`
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
variant: "ghost",
|
|
96
|
+
color: "primary",
|
|
97
|
+
class: `${l.primary} ${u.primary} hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
variant: "ghost",
|
|
101
|
+
color: "default",
|
|
102
|
+
class: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
variant: "ghost",
|
|
106
|
+
color: "secondary",
|
|
107
|
+
class: `${l.secondary} ${u.secondary} hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
variant: "ghost",
|
|
111
|
+
color: "success",
|
|
112
|
+
class: `${l.success} ${u.success} hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
variant: "ghost",
|
|
116
|
+
color: "info",
|
|
117
|
+
class: `${l.info} ${u.info} hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
variant: "ghost",
|
|
121
|
+
color: "warning",
|
|
122
|
+
class: `${l.warning} ${u.warning} hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
variant: "ghost",
|
|
126
|
+
color: "error",
|
|
127
|
+
class: `${l.error} ${u.error} hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
variant: "outlined",
|
|
131
|
+
color: "primary",
|
|
132
|
+
class: `${l.primary} ${u.primary} focus:bg-primary/10 hover:bg-primary/10`
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
variant: "outlined",
|
|
136
|
+
color: "secondary",
|
|
137
|
+
class: `${l.secondary} ${u.secondary} focus:bg-secondary/10 hover:bg-secondary/10`
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
variant: "outlined",
|
|
141
|
+
color: "info",
|
|
142
|
+
class: `${l.info} ${u.info} focus:bg-info/10 hover:bg-info/10`
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
variant: "outlined",
|
|
146
|
+
color: "success",
|
|
147
|
+
class: `${l.success} ${u.success} focus:bg-success/10 hover:bg-success/10`
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
variant: "outlined",
|
|
151
|
+
color: "warning",
|
|
152
|
+
class: `${l.warning} ${u.warning} focus:bg-warning/10 hover:bg-warning/10`
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
variant: "outlined",
|
|
156
|
+
color: "error",
|
|
157
|
+
class: `${l.error} ${u.error} focus:bg-error/10 hover:bg-error/10`
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
variant: "outlined",
|
|
161
|
+
color: "default",
|
|
162
|
+
class: `${l.default} ${u.default} focus:bg-foreground/10 hover:bg-foreground/10`
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
variant: "link",
|
|
166
|
+
color: "primary",
|
|
167
|
+
class: `${l.primary} ${u.primary} hover:bg-primary/10 active:bg-primary/5 focus:bg-primary/10`
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
variant: "link",
|
|
171
|
+
color: "secondary",
|
|
172
|
+
class: `${l.secondary} ${u.secondary} hover:bg-secondary/10 active:bg-secondary/5 focus:bg-secondary/10`
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
variant: "link",
|
|
176
|
+
color: "success",
|
|
177
|
+
class: `${l.success} ${u.success} hover:bg-success/10 active:bg-success/5 focus:bg-success/10`
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
variant: "link",
|
|
181
|
+
color: "info",
|
|
182
|
+
class: `${l.info} ${u.info} hover:bg-info/10 active:bg-info/5 focus:bg-info/10`
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
variant: "link",
|
|
186
|
+
color: "warning",
|
|
187
|
+
class: `${l.warning} ${u.warning} hover:bg-warning/10 active:bg-warning/5 focus:bg-warning/10`
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
variant: "link",
|
|
191
|
+
color: "error",
|
|
192
|
+
class: `${l.error} ${u.error} hover:bg-error/10 active:bg-error/5 focus:bg-error/10`
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
variant: "link",
|
|
196
|
+
color: "default",
|
|
197
|
+
class: `${l.default} ${u.default} hover:bg-foreground/10 active:bg-muted focus:bg-foreground/10`
|
|
198
|
+
}
|
|
199
|
+
], E = r("nxgt-btn nxgt-morph-fill inline-flex center gap-[var(--btn-gap,0.5rem)] h-min cursor-pointer whitespace-nowrap disabled:pointer-events-none aria-busy:cursor-progress [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-[var(--btn-ic,1rem)] shrink-0 [&_svg]:shrink-0 aria-invalid:[--btn-focus:var(--color-error)] aria-invalid:[--btn-line:var(--color-error)] px-[calc(var(--btn-px,1rem)+var(--btn-dx,0px))] py-2 has-[>svg]:px-[calc(var(--btn-px,1rem)-var(--btn-pxi,0.25rem)+var(--btn-dx,0px))]", {
|
|
200
|
+
variants: {
|
|
201
|
+
variant: {
|
|
202
|
+
filled: "",
|
|
203
|
+
tonal: "",
|
|
204
|
+
ghost: "nxgt-btn-bare",
|
|
205
|
+
outlined: "shadow-[inset_0_0_0_1.5px_color-mix(in_oklab,var(--btn-line,currentColor)_55%,transparent)]",
|
|
206
|
+
link: "nxgt-btn-bare focus:underline underline-offset-4 hover:underline"
|
|
207
|
+
},
|
|
208
|
+
color: c,
|
|
209
|
+
size: {
|
|
210
|
+
xs: "h-(--btn-h) [--btn-h:24px] [--btn-px:12px] [--btn-pxi:4px] [--btn-gap:4px] [--btn-ic:14px] [--btn-sq:6px] [--btn-fs:var(--text-label-md)] [--btn-lh:var(--text-label-md--line-height)] [--btn-ls:var(--text-label-md--letter-spacing)] [--btn-fw:560]",
|
|
211
|
+
sm: "h-(--btn-h) [--btn-h:32px] [--btn-px:16px] [--btn-pxi:4px] [--btn-gap:6px] [--btn-ic:16px] [--btn-sq:8px] [--btn-fs:var(--text-label-lg)] [--btn-lh:var(--text-label-lg--line-height)] [--btn-ls:var(--text-label-lg--letter-spacing)] [--btn-fw:580]",
|
|
212
|
+
default: "h-(--btn-h) [--btn-h:36px] [--btn-px:18px] [--btn-pxi:5px] [--btn-gap:8px] [--btn-ic:18px] [--btn-sq:10px] [--btn-fs:var(--text-label-lg)] [--btn-lh:var(--text-label-lg--line-height)] [--btn-ls:var(--text-label-lg--letter-spacing)] [--btn-fw:600]",
|
|
213
|
+
lg: "h-(--btn-h) [--btn-h:40px] [--btn-px:24px] [--btn-pxi:8px] [--btn-gap:8px] [--btn-ic:20px] [--btn-sq:12px] [--btn-fs:var(--text-title-md)] [--btn-lh:var(--text-title-md--line-height)] [--btn-ls:var(--text-title-md--letter-spacing)] [--btn-fw:620]",
|
|
214
|
+
xl: "h-(--btn-h) [--btn-h:56px] [--btn-px:40px] [--btn-pxi:14px] [--btn-gap:12px] [--btn-ic:28px] [--btn-sq:16px] [--btn-fs:var(--text-headline-sm)] [--btn-lh:var(--text-headline-sm--line-height)] [--btn-ls:var(--text-headline-sm--letter-spacing)] [--btn-fw:650]",
|
|
215
|
+
"2xl": "h-(--btn-h) [--btn-h:96px] [--btn-px:64px] [--btn-pxi:20px] [--btn-gap:16px] [--btn-ic:44px] [--btn-sq:28px] [--btn-scale:0.985] [--btn-fs:var(--text-headline-lg)] [--btn-lh:var(--text-headline-lg--line-height)] [--btn-ls:var(--text-headline-lg--letter-spacing)] [--btn-fw:700]",
|
|
216
|
+
icon: "size-9 px-0 py-0 has-[>svg]:px-0 [--btn-h:36px] [--btn-sq:10px]",
|
|
217
|
+
"icon-xs": "size-6 px-0 py-0 has-[>svg]:px-0 [--btn-h:24px] [--btn-sq:6px] [--btn-ic:12px]",
|
|
218
|
+
"icon-sm": "size-8 px-0 py-0 has-[>svg]:px-0 [--btn-h:32px] [--btn-sq:8px]",
|
|
219
|
+
"icon-lg": "size-10 px-0 py-0 has-[>svg]:px-0 [--btn-h:40px] [--btn-sq:12px]"
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
defaultVariants: {
|
|
223
|
+
variant: "filled",
|
|
224
|
+
color: "primary"
|
|
225
|
+
},
|
|
226
|
+
compoundVariants: T
|
|
227
|
+
}), D = ((e) => E(e?.variant === "ghost" && e.color == null ? {
|
|
228
|
+
...e,
|
|
229
|
+
color: "default"
|
|
230
|
+
} : e)), O = {
|
|
231
|
+
xs: "min-h-6",
|
|
232
|
+
sm: "min-h-8",
|
|
233
|
+
default: "min-h-9",
|
|
234
|
+
lg: "min-h-10",
|
|
235
|
+
xl: "min-h-14",
|
|
236
|
+
"2xl": "min-h-24"
|
|
237
|
+
};
|
|
238
|
+
function k(e, t) {
|
|
239
|
+
return !e || t?.startsWith("icon") ? !1 : `h-auto ${t ? O[t] : ""} whitespace-normal **:whitespace-normal text-center`;
|
|
240
|
+
}
|
|
241
|
+
//#endregion
|
|
242
|
+
//#region lib/components/ui/actions/button/label-text.tsx
|
|
243
|
+
function A(e) {
|
|
244
|
+
let t = [], n = 0, r = [], i = () => {
|
|
245
|
+
if (r.length === 0) return;
|
|
246
|
+
let e = r.join("");
|
|
247
|
+
r = [], e.trim() === "" ? t.push(e) : t.push(/* @__PURE__ */ S("span", {
|
|
248
|
+
"data-slot": "button-label",
|
|
249
|
+
children: e
|
|
250
|
+
}, `label-${n++}`));
|
|
251
|
+
};
|
|
252
|
+
for (let n of p.toArray(e)) {
|
|
253
|
+
if (typeof n == "string" || typeof n == "number" || typeof n == "bigint") {
|
|
254
|
+
r.push(n);
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
i(), t.push(j(n));
|
|
258
|
+
}
|
|
259
|
+
return i(), t;
|
|
260
|
+
}
|
|
261
|
+
function j(e) {
|
|
262
|
+
return g(e) && e.type === m ? h(e, void 0, A(e.props.children)) : e;
|
|
263
|
+
}
|
|
264
|
+
//#endregion
|
|
265
|
+
//#region lib/components/ui/actions/button/use-click-lock.ts
|
|
266
|
+
var M = 1e3;
|
|
267
|
+
function N(e, t) {
|
|
268
|
+
let n = b(!1), r = b(!1), i = b(void 0), [a, o] = x(!1), s = _(() => {
|
|
269
|
+
n.current = !1, r.current = !1, clearTimeout(i.current), o(!1);
|
|
270
|
+
}, []), c = _(() => {
|
|
271
|
+
e && (n.current = !0, o(!0), clearTimeout(i.current), i.current = setTimeout(() => {
|
|
272
|
+
r.current || s();
|
|
273
|
+
}, M));
|
|
274
|
+
}, [e, s]);
|
|
275
|
+
return y(() => {
|
|
276
|
+
n.current && (t ? r.current = !0 : r.current && s());
|
|
277
|
+
}, [t, s]), y(() => () => clearTimeout(i.current), []), {
|
|
278
|
+
locked: a,
|
|
279
|
+
lock: c,
|
|
280
|
+
isLocked: _(() => n.current, [])
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
//#endregion
|
|
284
|
+
//#region lib/components/ui/actions/button/button.tsx
|
|
285
|
+
function P({ className: r, variant: i = "filled", asChild: c = !1, children: l, color: u, size: p, loading: m = !1, lockOnClick: h, spinnerVariant: g = "2", wrap: _, shape: b, selected: x, disabled: T, onClickCapture: E, type: O = "button", ...j }) {
|
|
286
|
+
let M = c ? n : "button", P = v(d), F = p ?? P, I = c && x !== void 0;
|
|
287
|
+
y(() => {
|
|
288
|
+
I && !a() && console.warn("Button: `selected` is ignored with `asChild`; set aria-pressed on the child element.");
|
|
289
|
+
}, [I]);
|
|
290
|
+
let L = !c && x !== void 0, R = v(s) || !!(j["aria-label"] || j["aria-labelledby"]) || f(l), z = N(h, m), B = m || z.locked, V = w(B, z, E);
|
|
291
|
+
return /* @__PURE__ */ S(s, {
|
|
292
|
+
value: R,
|
|
293
|
+
children: /* @__PURE__ */ C(M, {
|
|
294
|
+
"data-slot": "button",
|
|
295
|
+
"data-variant": i,
|
|
296
|
+
"data-color": u,
|
|
297
|
+
"data-size": F,
|
|
298
|
+
"data-shape": b,
|
|
299
|
+
"data-selected": L && x ? "true" : void 0,
|
|
300
|
+
className: e("w-fit max-w-full min-w-0 justify-center", c && "nxgt-btn-as-child overflow-clip text-ellipsis whitespace-nowrap [overflow-clip-margin:22px]", D({
|
|
301
|
+
variant: i,
|
|
302
|
+
color: u,
|
|
303
|
+
size: F
|
|
304
|
+
}), k(_, F), r),
|
|
305
|
+
type: c ? void 0 : O,
|
|
306
|
+
disabled: T,
|
|
307
|
+
...j,
|
|
308
|
+
"aria-disabled": B || j["aria-disabled"],
|
|
309
|
+
"aria-busy": B || j["aria-busy"],
|
|
310
|
+
"aria-pressed": L ? x : j["aria-pressed"],
|
|
311
|
+
onClickCapture: V,
|
|
312
|
+
children: [B && /* @__PURE__ */ S(o, {
|
|
313
|
+
variant: g,
|
|
314
|
+
color: i === "filled" ? "light" : u,
|
|
315
|
+
className: e("starting:scale-0 duration-500", g === "4" ? "size-7.5" : "size-4.5")
|
|
316
|
+
}), /* @__PURE__ */ S(t, { children: c ? l : A(l) })]
|
|
317
|
+
})
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
function F({ tooltip: e, ...t }) {
|
|
321
|
+
return e ? /* @__PURE__ */ S(i, {
|
|
322
|
+
content: e,
|
|
323
|
+
children: /* @__PURE__ */ S(P, { ...t })
|
|
324
|
+
}) : /* @__PURE__ */ S(P, { ...t });
|
|
325
|
+
}
|
|
326
|
+
//#endregion
|
|
327
|
+
export { w as a, D as i, N as n, A as r, F as t };
|
|
@@ -24,6 +24,14 @@ var t = e(!1), n = {
|
|
|
24
24
|
warning: "[&_svg]:stroke-[color-mix(in_oklab,var(--color-warning)_85%,black)] dark:[&_svg]:stroke-[color-mix(in_oklab,var(--color-warning)_85%,white)]",
|
|
25
25
|
error: "[&_svg]:stroke-[color-mix(in_oklab,var(--color-error)_85%,black)] dark:[&_svg]:stroke-[color-mix(in_oklab,var(--color-error)_70%,white)]",
|
|
26
26
|
default: "[&_svg]:stroke-foreground"
|
|
27
|
+
}, a = {
|
|
28
|
+
primary: "[--morph-on:var(--color-primary)] [--morph-on-fg:var(--color-primary-foreground)] [--btn-focus:var(--color-primary-text)] [--btn-line:var(--color-primary)]",
|
|
29
|
+
secondary: "[--morph-on:var(--color-secondary)] dark:[--morph-on:color-mix(in_oklab,var(--color-secondary)_70%,var(--color-background))] [--morph-on-fg:var(--color-secondary-foreground)] [--btn-focus:var(--color-secondary)] [--btn-line:var(--color-secondary)]",
|
|
30
|
+
success: "[--morph-on:var(--color-success)] dark:[--morph-on:color-mix(in_oklab,var(--color-success)_60%,var(--color-background))] [--morph-on-fg:var(--color-success-foreground)] [--btn-focus:var(--color-success)] dark:[--btn-focus:color-mix(in_oklab,var(--color-success)_85%,white)] [--btn-line:var(--color-success)]",
|
|
31
|
+
info: "[--morph-on:var(--color-info)] dark:[--morph-on:color-mix(in_oklab,var(--color-info)_60%,var(--color-background))] [--morph-on-fg:var(--color-info-foreground)] [--btn-focus:var(--color-info)] [--btn-line:var(--color-info)]",
|
|
32
|
+
warning: "[--morph-on:var(--color-warning)] dark:[--morph-on:color-mix(in_oklab,var(--color-warning)_60%,var(--color-background))] [--morph-on-fg:var(--color-warning-foreground)] [--btn-focus:color-mix(in_oklab,var(--color-warning)_85%,black)] dark:[--btn-focus:color-mix(in_oklab,var(--color-warning)_85%,white)] [--btn-line:var(--color-warning)]",
|
|
33
|
+
error: "[--morph-on:var(--color-error)] [--morph-on-fg:var(--color-error-foreground)] [--btn-focus:color-mix(in_oklab,var(--color-error)_85%,black)] dark:[--btn-focus:color-mix(in_oklab,var(--color-error)_70%,white)] [--btn-line:var(--color-error)]",
|
|
34
|
+
default: "[--morph-on:var(--color-foreground)] [--morph-on-fg:var(--color-background)] [--btn-focus:var(--color-foreground)] [--btn-line:var(--color-foreground)]"
|
|
27
35
|
};
|
|
28
36
|
//#endregion
|
|
29
|
-
export { t as i, i as n, n as r, r as t };
|
|
37
|
+
export { t as a, a as i, i as n, n as r, r as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
|
-
import { t } from "./utils-
|
|
2
|
+
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { V as n } from "./youtube-node-OWSNlYCc.js";
|
|
4
4
|
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
5
5
|
//#region lib/components/ui/widgets/editor/viewer/callout-view.tsx
|
package/dist/charts.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as e } from "./ui.utils-CAnKTCw5.js";
|
|
2
|
-
import { t } from "./utils-
|
|
3
|
-
import { t as n } from "./use-material-translation-
|
|
4
|
-
import { t as r } from "./button-
|
|
2
|
+
import { t } from "./utils-BLfntITJ.js";
|
|
3
|
+
import { t as n } from "./use-material-translation-B3V_bz-5.js";
|
|
4
|
+
import { t as r } from "./button-BNjw-pnE.js";
|
|
5
5
|
import { t as i } from "./use-ssr-media-query-C6M5m8sf.js";
|
|
6
6
|
import { i as a, n as o, r as s, t as c } from "./util-4heV2LPI.js";
|
|
7
7
|
import { t as l } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
8
8
|
import { t as u } from "./warn-once-C_e47JM8.js";
|
|
9
|
-
import { t as d } from "./chip-
|
|
10
|
-
import { c as f, d as p, f as m, i as h, o as g, p as _, s as v, t as y } from "./line-path-
|
|
9
|
+
import { t as d } from "./chip-DLgQTJBZ.js";
|
|
10
|
+
import { c as f, d as p, f as m, i as h, o as g, p as _, s as v, t as y } from "./line-path-C5pZGC49.js";
|
|
11
11
|
import { t as b } from "./live-status-BGPaN8r8.js";
|
|
12
12
|
import { t as x } from "./linear-G97mfnKF.js";
|
|
13
13
|
import { t as S } from "./band-ZcHOFBlS.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./utils-
|
|
2
|
-
import { t } from "./tooltip-
|
|
3
|
-
import { t as n } from "./use-material-translation-
|
|
4
|
-
import {
|
|
1
|
+
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
|
+
import { t } from "./tooltip-CkttDIab.js";
|
|
3
|
+
import { t as n } from "./use-material-translation-B3V_bz-5.js";
|
|
4
|
+
import { a as r } from "./button-tones-BwuVvAmd.js";
|
|
5
5
|
import { t as i } from "./react-node-text-Crkpfpco.js";
|
|
6
6
|
import { Check as a, X as o } from "lucide-react";
|
|
7
7
|
import { cloneElement as s, isValidElement as c } from "react";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as e } from "./rolldown-runtime-BFFgcFxR.js";
|
|
2
|
-
import { t } from "./utils-
|
|
2
|
+
import { t } from "./utils-BLfntITJ.js";
|
|
3
3
|
import { a as n } from "./dist-lmHmz_bu.js";
|
|
4
|
-
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-
|
|
5
|
-
import { a as c, i as l, n as u } from "./field-blur-context-
|
|
6
|
-
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-
|
|
4
|
+
import { c as r, d as i, f as a, n as o, t as s } from "./dropdown-menu-BsH9W_3C.js";
|
|
5
|
+
import { a as c, i as l, n as u } from "./field-blur-context-Cft9s7Hg.js";
|
|
6
|
+
import { a as d, d as f, r as p, t as m, u as h } from "./toolbar-items-rUHdVqAq.js";
|
|
7
7
|
import { t as g } from "./is-production-GLw59WU8.js";
|
|
8
|
-
import { t as _ } from "./use-material-translation-
|
|
9
|
-
import { i as v, n as y, o as b, t as x } from "./code-language-items-
|
|
8
|
+
import { t as _ } from "./use-material-translation-B3V_bz-5.js";
|
|
9
|
+
import { i as v, n as y, o as b, t as x } from "./code-language-items-BT5BO5w6.js";
|
|
10
10
|
import { t as S } from "./useIsomorphicLayoutEffect-DfgAhWcH.js";
|
|
11
|
-
import { n as C, t as w } from "./escape-owner-
|
|
12
|
-
import { t as T } from "./skeleton-
|
|
11
|
+
import { n as C, t as w } from "./escape-owner-C4W_sOAU.js";
|
|
12
|
+
import { t as T } from "./skeleton-DSdtr2qc.js";
|
|
13
13
|
import { t as E } from "./react-node-text-Crkpfpco.js";
|
|
14
14
|
import { Check as D, ChevronDown as O, CircleAlert as ee, Copy as k, FileCode2 as te, Lock as ne, Maximize2 as re, Minimize2 as A, Search as ie, TriangleAlert as ae, WandSparkles as oe, WrapText as se } from "lucide-react";
|
|
15
15
|
import j, { memo as ce, useCallback as le, useEffect as M, useId as ue, useImperativeHandle as de, useMemo as fe, useRef as N, useState as P } from "react";
|
package/dist/code-editor.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { t as e } from "./utils-
|
|
1
|
+
import { t as e } from "./utils-BLfntITJ.js";
|
|
2
2
|
import { a as t } from "./dist-lmHmz_bu.js";
|
|
3
|
-
import { d as n, r, t as i, u as a } from "./toolbar-items-
|
|
4
|
-
import { t as o } from "./use-material-translation-
|
|
5
|
-
import { i as s, n as c, o as l } from "./code-language-items-
|
|
6
|
-
import { r as u, t as d } from "./field-blur-
|
|
7
|
-
import { t as f } from "./skeleton-
|
|
3
|
+
import { d as n, r, t as i, u as a } from "./toolbar-items-rUHdVqAq.js";
|
|
4
|
+
import { t as o } from "./use-material-translation-B3V_bz-5.js";
|
|
5
|
+
import { i as s, n as c, o as l } from "./code-language-items-BT5BO5w6.js";
|
|
6
|
+
import { r as u, t as d } from "./field-blur-CJHzVSh9.js";
|
|
7
|
+
import { t as f } from "./skeleton-DSdtr2qc.js";
|
|
8
8
|
import { t as p } from "./live-status-BGPaN8r8.js";
|
|
9
9
|
import { t as m } from "./use-mobile-BDro060N.js";
|
|
10
10
|
import { t as h } from "./react-node-text-Crkpfpco.js";
|
|
11
|
-
import { a as g, c as _, d as v, f as y, i as b, l as x, m as S, o as C, p as w, r as T, s as E, t as D, u as O } from "./code-editor-
|
|
11
|
+
import { a as g, c as _, d as v, f as y, i as b, l as x, m as S, o as C, p as w, r as T, s as E, t as D, u as O } from "./code-editor-BZbaYLvo.js";
|
|
12
12
|
import { ChevronDown as k, ChevronUp as A, Columns2 as j } from "lucide-react";
|
|
13
13
|
import { useEffect as M, useRef as N, useState as P } from "react";
|
|
14
14
|
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { d as e, f as t } from "./dropdown-menu-
|
|
2
|
-
import { t as n } from "./use-material-translation-
|
|
1
|
+
import { d as e, f as t } from "./dropdown-menu-BsH9W_3C.js";
|
|
2
|
+
import { t as n } from "./use-material-translation-B3V_bz-5.js";
|
|
3
3
|
import { t as r } from "./live-status-BGPaN8r8.js";
|
|
4
4
|
import { useEffect as i, useRef as a, useState as o } from "react";
|
|
5
5
|
import { jsx as s } from "react/jsx-runtime";
|
package/dist/components/base.css
CHANGED
|
@@ -31,28 +31,43 @@
|
|
|
31
31
|
@apply dark:fill-foreground;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/* h1 to h6 read the type scale (type-scale.css); the fallbacks keep the
|
|
35
|
+
old sizes where the scale is not loaded (this file is shared with
|
|
36
|
+
@nxgt/material-vue, which has no scale yet). */
|
|
34
37
|
h1 {
|
|
35
|
-
font-size: var(--text-2xl);
|
|
38
|
+
font-size: var(--text-headline-md, var(--text-2xl));
|
|
39
|
+
line-height: var(--text-headline-md--line-height, inherit);
|
|
40
|
+
letter-spacing: var(--text-headline-md--letter-spacing, inherit);
|
|
36
41
|
font-weight: var(--font-weight-medium);
|
|
37
42
|
}
|
|
38
43
|
h2 {
|
|
39
|
-
font-size: var(--text-xl);
|
|
44
|
+
font-size: var(--text-headline-sm, var(--text-xl));
|
|
45
|
+
line-height: var(--text-headline-sm--line-height, inherit);
|
|
46
|
+
letter-spacing: var(--text-headline-sm--letter-spacing, inherit);
|
|
40
47
|
font-weight: var(--font-weight-medium);
|
|
41
48
|
}
|
|
42
49
|
h3 {
|
|
43
|
-
font-size: var(--text-lg);
|
|
50
|
+
font-size: var(--text-title-lg, var(--text-lg));
|
|
51
|
+
line-height: var(--text-title-lg--line-height, inherit);
|
|
52
|
+
letter-spacing: var(--text-title-lg--letter-spacing, inherit);
|
|
44
53
|
font-weight: var(--font-weight-medium);
|
|
45
54
|
}
|
|
46
55
|
h4 {
|
|
47
|
-
font-size: var(--text-base);
|
|
56
|
+
font-size: var(--text-title-md, var(--text-base));
|
|
57
|
+
line-height: var(--text-title-md--line-height, inherit);
|
|
58
|
+
letter-spacing: var(--text-title-md--letter-spacing, inherit);
|
|
48
59
|
font-weight: var(--font-weight-medium);
|
|
49
60
|
}
|
|
50
61
|
h5 {
|
|
51
|
-
font-size: var(--text-sm);
|
|
62
|
+
font-size: var(--text-title-sm, var(--text-sm));
|
|
63
|
+
line-height: var(--text-title-sm--line-height, inherit);
|
|
64
|
+
letter-spacing: var(--text-title-sm--letter-spacing, inherit);
|
|
52
65
|
font-weight: var(--font-weight-medium);
|
|
53
66
|
}
|
|
54
67
|
h6 {
|
|
55
|
-
font-size: var(--text-xs);
|
|
68
|
+
font-size: var(--text-label-md, var(--text-xs));
|
|
69
|
+
line-height: var(--text-label-md--line-height, inherit);
|
|
70
|
+
letter-spacing: var(--text-label-md--letter-spacing, inherit);
|
|
56
71
|
font-weight: var(--font-weight-medium);
|
|
57
72
|
}
|
|
58
73
|
/* A sidebar entry is a link styled as a menu entry: the prose link style
|