use-wc 1.0.0-pre.56 → 1.0.0-pre.58

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.
@@ -702,71 +702,6 @@
702
702
  }
703
703
  ]
704
704
  },
705
- {
706
- "kind": "javascript-module",
707
- "path": "src/elements/use-caret/use-caret.ts",
708
- "declarations": [
709
- {
710
- "kind": "class",
711
- "description": "`use-caret` supplies the caret icon and label layout for a consumer who wants to own the\ninvoking button itself. It renders inside a plain `<button>`\nthat carries the native `popovertarget` attribute, pointing at a `use-menu`:\n\n```html\n<button id=\"thing\" popovertarget=\"thing-menu\">\n <use-caret>Menu</use-caret>\n</button>\n<use-menu id=\"thing-menu\" aria-label=\"Menu\">\n <button role=\"menuitem\">First thing</button>\n</use-menu>\n```\n\n`use-menu` finds this button on its own via `popovertarget` and anchors to it — no\n`anchortarget` needed here; that's only for a menu with more than one invoker. See `use-menu`'s\nown docs for that case.\n\nThe button is entirely the consumer's own element — their classes, their content, their event\nhandlers. `use-caret` contributes no interactivity of its own: no internal button, no focus\ntarget, no state. It only renders the label and caret glyph, so consumers get a consistent\nvisual trigger without giving up control of the button.\n\nThe caret direction is derived rather than configured: a trigger nested inside a `use-menu`\nis understood to open a submenu and renders pointing sideways; a top-level trigger renders\npointing down.\n\nSwapping in a different caret **per instance** is a slot: put your own element in the `icon`\nslot and it replaces `part(icon-default)` entirely for that trigger.\n\nSwapping the default caret **for every trigger in the app** doesn't need touching this\ncomponent's `render()` at all — style `::part(icon-default)` from an outside stylesheet, the\nsame way any shadow DOM part is themed:\n\n```css\nuse-caret::part(icon-default) {\n mask-image: url(\"/icons/my-caret.svg\");\n}\n```\n\n(When the design system's `theme.css` is loaded, this is already wired to a token —\n`--usewc-effect-dropdown-trigger-icon-mask-image` — so redefining that custom property has\nthe same effect without writing a `::part()` rule at all.)\n\n`::part()` only reaches CSS-expressible changes (a mask, a background, a transform). For\nanything else — different markup, an icon font, logic beyond a mask — set the static `icon`\nand `nestedIcon` hooks. Every `<use-caret>` in the page picks them up; consumers keep writing\nthe same tag, no new element to register or remember to use instead. `icon` supplies a\ntop-level trigger's glyph, `nestedIcon` a submenu trigger's — set whichever apply; an unset one\nkeeps the built-in ▼/▶ for that case. Set them once, as early as possible (an app's entry\npoint, before any triggers connect) — Lit calls `render()` fresh on every update, so an\nalready-connected instance only reflects the change once something causes it to re-render:\n\n```ts\n// A bare string or TemplateResult is used as-is, on every trigger of that kind:\nUseCaret.icon = \"▾\";\nUseCaret.nestedIcon = \"▸\";\n\n// A function is called on every render instead:\nUseCaret.nestedIcon = (html) => html`<my-icon name=\"chevron-right\"></my-icon>`;\n```\n\nThe function form is called with the component's own `html` tag as its (optional) first\nargument rather than requiring the caller to import one — a page can end up with more than one\ncopy of `lit-html` in its module graph, and a `TemplateResult` built from a *different* copy\nthan the one this component renders with can silently fail to render. Taking `html` in as a\nparameter sidesteps that: whatever's returned is guaranteed to come from the same `lit-html`\nthis component already uses. A bare string skips the concern entirely.\n\nOnly need to change the icon on **some** triggers, not every one in the app? Extend the\nclass, override `render()` normally, and register the subclass under a different tag name so\nit coexists with the built-in element instead of replacing it everywhere:\n\n```ts\nclass MyCaret extends UseCaret {\n override render() {\n return html`<slot></slot><slot name=\"icon\"><my-icon name=\"chevron\"></my-icon></slot>`;\n }\n}\ncustomElements.define(\"my-caret\", MyCaret);\n```",
712
- "name": "UseCaret",
713
- "slots": [
714
- {
715
- "description": "Trigger label content.",
716
- "name": "default"
717
- },
718
- {
719
- "description": "Replaces the default caret glyph.",
720
- "name": "icon"
721
- }
722
- ],
723
- "members": [
724
- {
725
- "kind": "field",
726
- "name": "icon",
727
- "type": {
728
- "text": "((html: HtmlTag) => TemplateResult | string) | TemplateResult | string | undefined"
729
- },
730
- "static": true,
731
- "description": "Global override for a top-level trigger's caret. When set, every non-nested `<use-caret>` in\nthe page renders this inside `part(icon-default)` instead of the built-in ▼ character. A\nplain string or `TemplateResult` is used as-is; the function form is called with the\ncomponent's own `html` tag, so a returned template is guaranteed to come from the same\n`lit-html` instance this component renders with. Unset (the default) keeps the built-in ▼."
732
- },
733
- {
734
- "kind": "field",
735
- "name": "nestedIcon",
736
- "type": {
737
- "text": "((html: HtmlTag) => TemplateResult | string) | TemplateResult | string | undefined"
738
- },
739
- "static": true,
740
- "description": "Global override for a submenu trigger's caret — the counterpart to icon for a\n`<use-caret>` nested inside a `use-menu`. Unset (the default) keeps the built-in ▶."
741
- }
742
- ],
743
- "superclass": {
744
- "name": "LitElement",
745
- "package": "lit"
746
- },
747
- "tagName": "use-caret",
748
- "customElement": true
749
- }
750
- ],
751
- "exports": [
752
- {
753
- "kind": "js",
754
- "name": "UseCaret",
755
- "declaration": {
756
- "name": "UseCaret",
757
- "module": "src/elements/use-caret/use-caret.ts"
758
- }
759
- },
760
- {
761
- "kind": "custom-element-definition",
762
- "name": "use-caret",
763
- "declaration": {
764
- "name": "UseCaret",
765
- "module": "src/elements/use-caret/use-caret.ts"
766
- }
767
- }
768
- ]
769
- },
770
705
  {
771
706
  "kind": "javascript-module",
772
707
  "path": "src/elements/use-date-input/use-date-input.ts",
@@ -893,6 +828,71 @@
893
828
  }
894
829
  ]
895
830
  },
831
+ {
832
+ "kind": "javascript-module",
833
+ "path": "src/elements/use-caret/use-caret.ts",
834
+ "declarations": [
835
+ {
836
+ "kind": "class",
837
+ "description": "`use-caret` supplies the caret icon and label layout for a consumer who wants to own the\ninvoking button itself. It renders inside a plain `<button>`\nthat carries the native `popovertarget` attribute, pointing at a `use-menu`:\n\n```html\n<button id=\"thing\" popovertarget=\"thing-menu\">\n <use-caret>Menu</use-caret>\n</button>\n<use-menu id=\"thing-menu\" aria-label=\"Menu\">\n <button role=\"menuitem\">First thing</button>\n</use-menu>\n```\n\n`use-menu` finds this button on its own via `popovertarget` and anchors to it — no\n`anchortarget` needed here; that's only for a menu with more than one invoker. See `use-menu`'s\nown docs for that case.\n\nThe button is entirely the consumer's own element — their classes, their content, their event\nhandlers. `use-caret` contributes no interactivity of its own: no internal button, no focus\ntarget, no state. It only renders the label and caret glyph, so consumers get a consistent\nvisual trigger without giving up control of the button.\n\nThe caret direction is derived rather than configured: a trigger nested inside a `use-menu`\nis understood to open a submenu and renders pointing sideways; a top-level trigger renders\npointing down.\n\nSwapping in a different caret **per instance** is a slot: put your own element in the `icon`\nslot and it replaces `part(icon-default)` entirely for that trigger.\n\nSwapping the default caret **for every trigger in the app** doesn't need touching this\ncomponent's `render()` at all — style `::part(icon-default)` from an outside stylesheet, the\nsame way any shadow DOM part is themed:\n\n```css\nuse-caret::part(icon-default) {\n mask-image: url(\"/icons/my-caret.svg\");\n}\n```\n\n(When the design system's `theme.css` is loaded, this is already wired to a token —\n`--usewc-effect-dropdown-trigger-icon-mask-image` — so redefining that custom property has\nthe same effect without writing a `::part()` rule at all.)\n\n`::part()` only reaches CSS-expressible changes (a mask, a background, a transform). For\nanything else — different markup, an icon font, logic beyond a mask — set the static `icon`\nand `nestedIcon` hooks. Every `<use-caret>` in the page picks them up; consumers keep writing\nthe same tag, no new element to register or remember to use instead. `icon` supplies a\ntop-level trigger's glyph, `nestedIcon` a submenu trigger's — set whichever apply; an unset one\nkeeps the built-in ▼/▶ for that case. Set them once, as early as possible (an app's entry\npoint, before any triggers connect) — Lit calls `render()` fresh on every update, so an\nalready-connected instance only reflects the change once something causes it to re-render:\n\n```ts\n// A bare string or TemplateResult is used as-is, on every trigger of that kind:\nUseCaret.icon = \"▾\";\nUseCaret.nestedIcon = \"▸\";\n\n// A function is called on every render instead:\nUseCaret.nestedIcon = (html) => html`<my-icon name=\"chevron-right\"></my-icon>`;\n```\n\nThe function form is called with the component's own `html` tag as its (optional) first\nargument rather than requiring the caller to import one — a page can end up with more than one\ncopy of `lit-html` in its module graph, and a `TemplateResult` built from a *different* copy\nthan the one this component renders with can silently fail to render. Taking `html` in as a\nparameter sidesteps that: whatever's returned is guaranteed to come from the same `lit-html`\nthis component already uses. A bare string skips the concern entirely.\n\nOnly need to change the icon on **some** triggers, not every one in the app? Extend the\nclass, override `render()` normally, and register the subclass under a different tag name so\nit coexists with the built-in element instead of replacing it everywhere:\n\n```ts\nclass MyCaret extends UseCaret {\n override render() {\n return html`<slot></slot><slot name=\"icon\"><my-icon name=\"chevron\"></my-icon></slot>`;\n }\n}\ncustomElements.define(\"my-caret\", MyCaret);\n```",
838
+ "name": "UseCaret",
839
+ "slots": [
840
+ {
841
+ "description": "Trigger label content.",
842
+ "name": "default"
843
+ },
844
+ {
845
+ "description": "Replaces the default caret glyph.",
846
+ "name": "icon"
847
+ }
848
+ ],
849
+ "members": [
850
+ {
851
+ "kind": "field",
852
+ "name": "icon",
853
+ "type": {
854
+ "text": "((html: HtmlTag) => TemplateResult | string) | TemplateResult | string | undefined"
855
+ },
856
+ "static": true,
857
+ "description": "Global override for a top-level trigger's caret. When set, every non-nested `<use-caret>` in\nthe page renders this inside `part(icon-default)` instead of the built-in ▼ character. A\nplain string or `TemplateResult` is used as-is; the function form is called with the\ncomponent's own `html` tag, so a returned template is guaranteed to come from the same\n`lit-html` instance this component renders with. Unset (the default) keeps the built-in ▼."
858
+ },
859
+ {
860
+ "kind": "field",
861
+ "name": "nestedIcon",
862
+ "type": {
863
+ "text": "((html: HtmlTag) => TemplateResult | string) | TemplateResult | string | undefined"
864
+ },
865
+ "static": true,
866
+ "description": "Global override for a submenu trigger's caret — the counterpart to icon for a\n`<use-caret>` nested inside a `use-menu`. Unset (the default) keeps the built-in ▶."
867
+ }
868
+ ],
869
+ "superclass": {
870
+ "name": "LitElement",
871
+ "package": "lit"
872
+ },
873
+ "tagName": "use-caret",
874
+ "customElement": true
875
+ }
876
+ ],
877
+ "exports": [
878
+ {
879
+ "kind": "js",
880
+ "name": "UseCaret",
881
+ "declaration": {
882
+ "name": "UseCaret",
883
+ "module": "src/elements/use-caret/use-caret.ts"
884
+ }
885
+ },
886
+ {
887
+ "kind": "custom-element-definition",
888
+ "name": "use-caret",
889
+ "declaration": {
890
+ "name": "UseCaret",
891
+ "module": "src/elements/use-caret/use-caret.ts"
892
+ }
893
+ }
894
+ ]
895
+ },
896
896
  {
897
897
  "kind": "javascript-module",
898
898
  "path": "src/elements/use-date-picker/use-date-picker.ts",
@@ -2748,6 +2748,185 @@
2748
2748
  }
2749
2749
  ]
2750
2750
  },
2751
+ {
2752
+ "kind": "javascript-module",
2753
+ "path": "src/elements/use-intl-number/use-intl-number.ts",
2754
+ "declarations": [
2755
+ {
2756
+ "kind": "class",
2757
+ "description": "Displays a localized, human-readable representation of a number using\n[`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).\nRenders a semantic `<data>` element in its shadow root with a machine-readable\n`value` attribute and formatted inner text.\n\nSet `numberstyle` to control what kind of number is formatted (see\n[`style`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#style)):\n- `decimal` (default) → plain number, e.g. `1,234.5`\n- `percent` → percentage, e.g. `42%` (value is the fraction, so `0.42` renders `42%`)\n- `currency` → currency amount, requires `currency`\n- `unit` → measurement, requires `unit`\n\nLocale is resolved from the nearest ancestor `[lang]` attribute, or\n`navigator.language` if none is found. Set `lang` directly on the element to override.",
2758
+ "name": "UseIntlNumber",
2759
+ "members": [
2760
+ {
2761
+ "kind": "field",
2762
+ "name": "value",
2763
+ "type": {
2764
+ "text": "string | undefined"
2765
+ },
2766
+ "attribute": "value"
2767
+ },
2768
+ {
2769
+ "kind": "field",
2770
+ "name": "numberstyle",
2771
+ "type": {
2772
+ "text": "string | undefined"
2773
+ },
2774
+ "attribute": "numberstyle"
2775
+ },
2776
+ {
2777
+ "kind": "field",
2778
+ "name": "currency",
2779
+ "type": {
2780
+ "text": "string | undefined"
2781
+ },
2782
+ "attribute": "currency"
2783
+ },
2784
+ {
2785
+ "kind": "field",
2786
+ "name": "currencydisplay",
2787
+ "type": {
2788
+ "text": "string | undefined"
2789
+ },
2790
+ "attribute": "currencydisplay"
2791
+ },
2792
+ {
2793
+ "kind": "field",
2794
+ "name": "currencysign",
2795
+ "type": {
2796
+ "text": "string | undefined"
2797
+ },
2798
+ "attribute": "currencysign"
2799
+ },
2800
+ {
2801
+ "kind": "field",
2802
+ "name": "unit",
2803
+ "type": {
2804
+ "text": "string | undefined"
2805
+ },
2806
+ "attribute": "unit"
2807
+ },
2808
+ {
2809
+ "kind": "field",
2810
+ "name": "unitdisplay",
2811
+ "type": {
2812
+ "text": "string | undefined"
2813
+ },
2814
+ "attribute": "unitdisplay"
2815
+ },
2816
+ {
2817
+ "kind": "field",
2818
+ "name": "signdisplay",
2819
+ "type": {
2820
+ "text": "string | undefined"
2821
+ },
2822
+ "attribute": "signdisplay"
2823
+ }
2824
+ ],
2825
+ "attributes": [
2826
+ {
2827
+ "type": {
2828
+ "text": "string | undefined"
2829
+ },
2830
+ "description": "Numeric amount to format",
2831
+ "name": "value",
2832
+ "fieldName": "value"
2833
+ },
2834
+ {
2835
+ "type": {
2836
+ "text": "string | undefined"
2837
+ },
2838
+ "description": "Format style: `decimal` | `percent` | `currency` | `unit`",
2839
+ "name": "numberstyle",
2840
+ "fieldName": "numberstyle"
2841
+ },
2842
+ {
2843
+ "type": {
2844
+ "text": "string | undefined"
2845
+ },
2846
+ "description": "[ISO 4217 currency code](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currency), e.g. `USD`, `EUR`, `JPY`. Required when numberstyle is `currency`",
2847
+ "name": "currency",
2848
+ "fieldName": "currency"
2849
+ },
2850
+ {
2851
+ "type": {
2852
+ "text": "string | undefined"
2853
+ },
2854
+ "description": "[How the currency is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay): `symbol` | `narrowSymbol` | `code` | `name`",
2855
+ "name": "currencydisplay",
2856
+ "fieldName": "currencydisplay"
2857
+ },
2858
+ {
2859
+ "type": {
2860
+ "text": "string | undefined"
2861
+ },
2862
+ "description": "[Sign convention](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign): `standard` (minus sign) | `accounting` (parenthesized negatives)",
2863
+ "name": "currencysign",
2864
+ "fieldName": "currencysign"
2865
+ },
2866
+ {
2867
+ "type": {
2868
+ "text": "string | undefined"
2869
+ },
2870
+ "description": "[Unit identifier](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unit), e.g. `kilometer-per-hour`, `liter`. Required when numberstyle is `unit`",
2871
+ "name": "unit",
2872
+ "fieldName": "unit"
2873
+ },
2874
+ {
2875
+ "type": {
2876
+ "text": "string | undefined"
2877
+ },
2878
+ "description": "[How the unit is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unitdisplay): `short` | `narrow` | `long`",
2879
+ "name": "unitdisplay",
2880
+ "fieldName": "unitdisplay"
2881
+ },
2882
+ {
2883
+ "type": {
2884
+ "text": "string | undefined"
2885
+ },
2886
+ "description": "[When to show the sign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay): `auto` | `always` | `exceptZero` | `never`",
2887
+ "name": "signdisplay",
2888
+ "fieldName": "signdisplay"
2889
+ },
2890
+ {
2891
+ "name": "lang",
2892
+ "type": {
2893
+ "text": "string"
2894
+ },
2895
+ "fieldName": "lang",
2896
+ "description": "BCP 47 locale tag. Inherits from nearest ancestor `[lang]` if not set.",
2897
+ "inheritedFrom": {
2898
+ "name": "UseLocaleElement",
2899
+ "module": "src/elements/use-locale-element/use-locale-element.ts"
2900
+ }
2901
+ }
2902
+ ],
2903
+ "superclass": {
2904
+ "name": "UseLocaleElement",
2905
+ "module": "/src/elements/use-locale-element/use-locale-element"
2906
+ },
2907
+ "tagName": "use-intl-number",
2908
+ "customElement": true
2909
+ }
2910
+ ],
2911
+ "exports": [
2912
+ {
2913
+ "kind": "js",
2914
+ "name": "UseIntlNumber",
2915
+ "declaration": {
2916
+ "name": "UseIntlNumber",
2917
+ "module": "src/elements/use-intl-number/use-intl-number.ts"
2918
+ }
2919
+ },
2920
+ {
2921
+ "kind": "custom-element-definition",
2922
+ "name": "use-intl-number",
2923
+ "declaration": {
2924
+ "name": "UseIntlNumber",
2925
+ "module": "src/elements/use-intl-number/use-intl-number.ts"
2926
+ }
2927
+ }
2928
+ ]
2929
+ },
2751
2930
  {
2752
2931
  "kind": "javascript-module",
2753
2932
  "path": "src/elements/use-listbox-input/use-listbox-input.ts",
@@ -1241,3 +1241,19 @@
1241
1241
  }
1242
1242
  }
1243
1243
 
1244
+ /* Grid — a cell holding a use-intl-number reads as tabular data, so it defaults to end-aligned
1245
+ text with tabular-nums, which locks every digit to the same width so values stack and compare
1246
+ cleanly down a column. text-align and font-variant-numeric are both inherited, so setting them
1247
+ on use-gridcell reaches the formatted text inside use-intl-number's shadow root without needing
1248
+ a rule scoped to use-intl-number itself. */
1249
+ @layer use-theme.grid {
1250
+ use-gridcell:has(use-intl-number) {
1251
+ text-align: end;
1252
+ font-variant-numeric: tabular-nums;
1253
+
1254
+ use-theme-escape & {
1255
+ all: revert-layer;
1256
+ }
1257
+ }
1258
+ }
1259
+
@@ -0,0 +1,30 @@
1
+ # `use-intl-number`
2
+
3
+ Displays a localized, human-readable representation of a number using
4
+ [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).
5
+ Renders a semantic `<data>` element in its shadow root with a machine-readable
6
+ `value` attribute and formatted inner text.
7
+
8
+ Set `numberstyle` to control what kind of number is formatted (see
9
+ [`style`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#style)):
10
+ - `decimal` (default) → plain number, e.g. `1,234.5`
11
+ - `percent` → percentage, e.g. `42%` (value is the fraction, so `0.42` renders `42%`)
12
+ - `currency` → currency amount, requires `currency`
13
+ - `unit` → measurement, requires `unit`
14
+
15
+ Locale is resolved from the nearest ancestor `[lang]` attribute, or
16
+ `navigator.language` if none is found. Set `lang` directly on the element to override.
17
+
18
+ ## Attributes
19
+
20
+ | Name | Type | Default | Description |
21
+ | --- | --- | --- | --- |
22
+ | value | `string \| undefined` | - | Numeric amount to format |
23
+ | numberstyle | `string \| undefined` | - | Format style: `decimal` \| `percent` \| `currency` \| `unit` |
24
+ | currency | `string \| undefined` | - | [ISO 4217 currency code](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currency), e.g. `USD`, `EUR`, `JPY`. Required when numberstyle is `currency` |
25
+ | currencydisplay | `string \| undefined` | - | [How the currency is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay): `symbol` \| `narrowSymbol` \| `code` \| `name` |
26
+ | currencysign | `string \| undefined` | - | [Sign convention](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign): `standard` (minus sign) \| `accounting` (parenthesized negatives) |
27
+ | unit | `string \| undefined` | - | [Unit identifier](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unit), e.g. `kilometer-per-hour`, `liter`. Required when numberstyle is `unit` |
28
+ | unitdisplay | `string \| undefined` | - | [How the unit is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unitdisplay): `short` \| `narrow` \| `long` |
29
+ | signdisplay | `string \| undefined` | - | [When to show the sign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay): `auto` \| `always` \| `exceptZero` \| `never` |
30
+ | lang | `string` | - | BCP 47 locale tag. Inherits from nearest ancestor `[lang]` if not set. |
package/dist/tokens.css CHANGED
@@ -548,15 +548,15 @@
548
548
  --usewc-layout-popover-menu-item-padding-block: var(--usewc-space-2);
549
549
  --usewc-layout-popover-menu-item-line-height: var(--usewc-line-height-24);
550
550
  --usewc-color-popover-menu-item-background-static: var(--usewc-color-transparent);
551
- --usewc-color-popover-menu-item-background-hover: var(--usewc-color-gray-800);
552
- --usewc-color-popover-menu-item-background-active: var(--usewc-color-gray-800);
551
+ --usewc-color-popover-menu-item-background-hover: var(--usewc-color-selector-background-hover);
552
+ --usewc-color-popover-menu-item-background-active: var(--usewc-color-selector-background-hover);
553
553
  --usewc-effect-popover-menu-item-border-radius: var(--usewc-effect-border-radius-4);
554
554
  --usewc-layout-popover-menu-anchor-offset: var(--usewc-space-4);
555
555
  --usewc-layout-popover-menu-padding: var(--usewc-space-4);
556
556
  --usewc-layout-popover-menu-border: var(--usewc-space-1-relative);
557
557
  --usewc-effect-popover-menu-border-style: var(--usewc-effect-border-solid);
558
558
  --usewc-color-popover-menu-background: var(--usewc-color-canvas-background);
559
- --usewc-color-popover-menu-border: var(--usewc-color-gray-600);
559
+ --usewc-color-popover-menu-border: var(--usewc-color-button-base-border-static);
560
560
  --usewc-effect-popover-menu-border-radius: var(--usewc-effect-border-radius-8);
561
561
  --usewc-font-popover-menu-header-size: var(--usewc-font-size-14);
562
562
  --usewc-font-popover-menu-header-weight: var(--usewc-font-weight-medium);
package/dist/use-wc.d.mts CHANGED
@@ -1406,6 +1406,52 @@ declare global {
1406
1406
  }
1407
1407
  }
1408
1408
  //#endregion
1409
+ //#region src/elements/use-intl-number/use-intl-number.d.ts
1410
+ /**
1411
+ * Displays a localized, human-readable representation of a number using
1412
+ * [`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).
1413
+ * Renders a semantic `<data>` element in its shadow root with a machine-readable
1414
+ * `value` attribute and formatted inner text.
1415
+ *
1416
+ * Set `numberstyle` to control what kind of number is formatted (see
1417
+ * [`style`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#style)):
1418
+ * - `decimal` (default) → plain number, e.g. `1,234.5`
1419
+ * - `percent` → percentage, e.g. `42%` (value is the fraction, so `0.42` renders `42%`)
1420
+ * - `currency` → currency amount, requires `currency`
1421
+ * - `unit` → measurement, requires `unit`
1422
+ *
1423
+ * Locale is resolved from the nearest ancestor `[lang]` attribute, or
1424
+ * `navigator.language` if none is found. Set `lang` directly on the element to override.
1425
+ *
1426
+ * @attr {string} value - Numeric amount to format
1427
+ * @attr {string} numberstyle - Format style: `decimal` | `percent` | `currency` | `unit`
1428
+ * @attr {string} currency - [ISO 4217 currency code](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currency), e.g. `USD`, `EUR`, `JPY`. Required when numberstyle is `currency`
1429
+ * @attr {string} currencydisplay - [How the currency is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay): `symbol` | `narrowSymbol` | `code` | `name`
1430
+ * @attr {string} currencysign - [Sign convention](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign): `standard` (minus sign) | `accounting` (parenthesized negatives)
1431
+ * @attr {string} unit - [Unit identifier](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unit), e.g. `kilometer-per-hour`, `liter`. Required when numberstyle is `unit`
1432
+ * @attr {string} unitdisplay - [How the unit is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unitdisplay): `short` | `narrow` | `long`
1433
+ * @attr {string} signdisplay - [When to show the sign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay): `auto` | `always` | `exceptZero` | `never`
1434
+ * @attr {string} lang - BCP 47 locale tag. Inherits from nearest ancestor `[lang]` if not set.
1435
+ */
1436
+ declare class UseIntlNumber extends UseLocaleElement {
1437
+ #private;
1438
+ static styles: import("lit").CSSResult;
1439
+ value?: string;
1440
+ numberstyle?: string;
1441
+ currency?: string;
1442
+ currencydisplay?: string;
1443
+ currencysign?: string;
1444
+ unit?: string;
1445
+ unitdisplay?: string;
1446
+ signdisplay?: string;
1447
+ render(): TemplateResult$1<1>;
1448
+ }
1449
+ declare global {
1450
+ interface HTMLElementTagNameMap {
1451
+ "use-intl-number": UseIntlNumber;
1452
+ }
1453
+ }
1454
+ //#endregion
1409
1455
  //#region src/elements/use-badge/use-badge.d.ts
1410
1456
  /**
1411
1457
  * `use-badge` renders a small indicator anchored to another element's corner, using
@@ -1508,4 +1554,4 @@ declare global {
1508
1554
  }
1509
1555
  }
1510
1556
  //#endregion
1511
- export { UseAnchored, UseBadge, UseCalendarBase, UseCalendarRenderDay, UseCaret, UseDateInput, UseDatePicker, UseDatetimeInput, UseDurationInput, UseFocusgroup, UseIntlDatetime, UseListboxInput, UseMenu, UseMonthPicker, UseMonthPickerRenderMonth, UseOption, UseScrollarea, UseTimeInput, UseTree, UseTreeitem, UseWeekPicker, UseWidget };
1557
+ export { UseAnchored, UseBadge, UseCalendarBase, UseCalendarRenderDay, UseCaret, UseDateInput, UseDatePicker, UseDatetimeInput, UseDurationInput, UseFocusgroup, UseIntlDatetime, UseIntlNumber, UseListboxInput, UseMenu, UseMonthPicker, UseMonthPickerRenderMonth, UseOption, UseScrollarea, UseTimeInput, UseTree, UseTreeitem, UseWeekPicker, UseWidget };
package/dist/use-wc.mjs CHANGED
@@ -4290,6 +4290,112 @@ __decorate([property({ type: String })], UseIntlDatetime.prototype, "datestyle",
4290
4290
  __decorate([property({ type: String })], UseIntlDatetime.prototype, "timestyle", void 0);
4291
4291
  UseIntlDatetime = __decorate([customElement("use-intl-datetime")], UseIntlDatetime);
4292
4292
  //#endregion
4293
+ //#region src/elements/use-intl-number/use-intl-number.ts
4294
+ const NUMBER_STYLES = [
4295
+ "decimal",
4296
+ "percent",
4297
+ "currency",
4298
+ "unit"
4299
+ ];
4300
+ const CURRENCY_DISPLAYS = [
4301
+ "symbol",
4302
+ "narrowSymbol",
4303
+ "code",
4304
+ "name"
4305
+ ];
4306
+ const CURRENCY_SIGNS = ["standard", "accounting"];
4307
+ const SIGN_DISPLAYS = [
4308
+ "auto",
4309
+ "always",
4310
+ "exceptZero",
4311
+ "never"
4312
+ ];
4313
+ const UNIT_DISPLAYS = [
4314
+ "short",
4315
+ "narrow",
4316
+ "long"
4317
+ ];
4318
+ let UseIntlNumber = class UseIntlNumber extends UseLocaleElement {
4319
+ static {
4320
+ this.styles = css`
4321
+ :host {
4322
+ display: contents;
4323
+ }
4324
+ `;
4325
+ }
4326
+ #resolveNumberStyle() {
4327
+ return NUMBER_STYLES.includes(this.numberstyle) ? this.numberstyle : "decimal";
4328
+ }
4329
+ #resolveCurrencyDisplay() {
4330
+ return CURRENCY_DISPLAYS.includes(this.currencydisplay) ? this.currencydisplay : "symbol";
4331
+ }
4332
+ #resolveCurrencySign() {
4333
+ return CURRENCY_SIGNS.includes(this.currencysign) ? this.currencysign : "standard";
4334
+ }
4335
+ #resolveUnitDisplay() {
4336
+ return UNIT_DISPLAYS.includes(this.unitdisplay) ? this.unitdisplay : "short";
4337
+ }
4338
+ #resolveSignDisplay() {
4339
+ return SIGN_DISPLAYS.includes(this.signdisplay) ? this.signdisplay : "auto";
4340
+ }
4341
+ #resolveOptions(style) {
4342
+ if (style === "currency") {
4343
+ if (!this.currency) return null;
4344
+ return {
4345
+ style,
4346
+ currency: this.currency,
4347
+ currencyDisplay: this.#resolveCurrencyDisplay(),
4348
+ currencySign: this.#resolveCurrencySign(),
4349
+ signDisplay: this.#resolveSignDisplay()
4350
+ };
4351
+ }
4352
+ if (style === "unit") {
4353
+ if (!this.unit) return null;
4354
+ return {
4355
+ style,
4356
+ unit: this.unit,
4357
+ unitDisplay: this.#resolveUnitDisplay(),
4358
+ signDisplay: this.#resolveSignDisplay()
4359
+ };
4360
+ }
4361
+ return {
4362
+ style,
4363
+ signDisplay: this.#resolveSignDisplay()
4364
+ };
4365
+ }
4366
+ #computeFormatted() {
4367
+ const value = this.value ?? "";
4368
+ const locale = this.lang;
4369
+ if (!value || value.trim() === "") return null;
4370
+ const amount = Number(value);
4371
+ if (isNaN(amount)) return null;
4372
+ const options = this.#resolveOptions(this.#resolveNumberStyle());
4373
+ if (!options) return null;
4374
+ try {
4375
+ return {
4376
+ valueAttr: String(amount),
4377
+ text: new Intl.NumberFormat(locale, options).format(amount)
4378
+ };
4379
+ } catch {
4380
+ return null;
4381
+ }
4382
+ }
4383
+ render() {
4384
+ const result = this.#computeFormatted();
4385
+ if (!result) return html`<data></data>`;
4386
+ return html`<data value=${result.valueAttr}>${result.text}</data>`;
4387
+ }
4388
+ };
4389
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "value", void 0);
4390
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "numberstyle", void 0);
4391
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "currency", void 0);
4392
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "currencydisplay", void 0);
4393
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "currencysign", void 0);
4394
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "unit", void 0);
4395
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "unitdisplay", void 0);
4396
+ __decorate([property({ type: String })], UseIntlNumber.prototype, "signdisplay", void 0);
4397
+ UseIntlNumber = __decorate([customElement("use-intl-number")], UseIntlNumber);
4398
+ //#endregion
4293
4399
  //#region src/elements/use-badge/use-badge.ts
4294
4400
  let UseBadge = class UseBadge extends LitElement {
4295
4401
  #internals;
@@ -4446,4 +4552,4 @@ __decorate([property({
4446
4552
  })], UseBadge.prototype, "options", void 0);
4447
4553
  UseBadge = __decorate([customElement("use-badge")], UseBadge);
4448
4554
  //#endregion
4449
- export { UseAnchored, UseBadge, UseCalendarBase, UseCaret, UseDateInput, UseDatePicker, UseDatetimeInput, UseDurationInput, UseFocusgroup, UseIntlDatetime, UseListboxInput, UseMenu, UseMonthPicker, UseOption, UseScrollarea, UseTimeInput, UseTree, UseTreeitem, UseWeekPicker, UseWidget };
4555
+ export { UseAnchored, UseBadge, UseCalendarBase, UseCaret, UseDateInput, UseDatePicker, UseDatetimeInput, UseDurationInput, UseFocusgroup, UseIntlDatetime, UseIntlNumber, UseListboxInput, UseMenu, UseMonthPicker, UseOption, UseScrollarea, UseTimeInput, UseTree, UseTreeitem, UseWeekPicker, UseWidget };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-wc",
3
- "version": "1.0.0-pre.56",
3
+ "version": "1.0.0-pre.58",
4
4
  "private": false,
5
5
  "homepage": "https://usewc.com",
6
6
  "bugs": "https://github.com/dang-rabbits/use-wc/issues",
@@ -57,12 +57,6 @@
57
57
  "attributes": [{ "name": "date", "values": [] }],
58
58
  "references": []
59
59
  },
60
- {
61
- "name": "use-caret",
62
- "description": "`use-caret` supplies the caret icon and label layout for a consumer who wants to own the\ninvoking button itself. It renders inside a plain `<button>`\nthat carries the native `popovertarget` attribute, pointing at a `use-menu`:\n\n```html\n<button id=\"thing\" popovertarget=\"thing-menu\">\n <use-caret>Menu</use-caret>\n</button>\n<use-menu id=\"thing-menu\" aria-label=\"Menu\">\n <button role=\"menuitem\">First thing</button>\n</use-menu>\n```\n\n`use-menu` finds this button on its own via `popovertarget` and anchors to it — no\n`anchortarget` needed here; that's only for a menu with more than one invoker. See `use-menu`'s\nown docs for that case.\n\nThe button is entirely the consumer's own element — their classes, their content, their event\nhandlers. `use-caret` contributes no interactivity of its own: no internal button, no focus\ntarget, no state. It only renders the label and caret glyph, so consumers get a consistent\nvisual trigger without giving up control of the button.\n\nThe caret direction is derived rather than configured: a trigger nested inside a `use-menu`\nis understood to open a submenu and renders pointing sideways; a top-level trigger renders\npointing down.\n\nSwapping in a different caret **per instance** is a slot: put your own element in the `icon`\nslot and it replaces `part(icon-default)` entirely for that trigger.\n\nSwapping the default caret **for every trigger in the app** doesn't need touching this\ncomponent's `render()` at all — style `::part(icon-default)` from an outside stylesheet, the\nsame way any shadow DOM part is themed:\n\n```css\nuse-caret::part(icon-default) {\n mask-image: url(\"/icons/my-caret.svg\");\n}\n```\n\n(When the design system's `theme.css` is loaded, this is already wired to a token —\n`--usewc-effect-dropdown-trigger-icon-mask-image` — so redefining that custom property has\nthe same effect without writing a `::part()` rule at all.)\n\n`::part()` only reaches CSS-expressible changes (a mask, a background, a transform). For\nanything else — different markup, an icon font, logic beyond a mask — set the static `icon`\nand `nestedIcon` hooks. Every `<use-caret>` in the page picks them up; consumers keep writing\nthe same tag, no new element to register or remember to use instead. `icon` supplies a\ntop-level trigger's glyph, `nestedIcon` a submenu trigger's — set whichever apply; an unset one\nkeeps the built-in ▼/▶ for that case. Set them once, as early as possible (an app's entry\npoint, before any triggers connect) — Lit calls `render()` fresh on every update, so an\nalready-connected instance only reflects the change once something causes it to re-render:\n\n```ts\n// A bare string or TemplateResult is used as-is, on every trigger of that kind:\nUseCaret.icon = \"▾\";\nUseCaret.nestedIcon = \"▸\";\n\n// A function is called on every render instead:\nUseCaret.nestedIcon = (html) => html`<my-icon name=\"chevron-right\"></my-icon>`;\n```\n\nThe function form is called with the component's own `html` tag as its (optional) first\nargument rather than requiring the caller to import one — a page can end up with more than one\ncopy of `lit-html` in its module graph, and a `TemplateResult` built from a *different* copy\nthan the one this component renders with can silently fail to render. Taking `html` in as a\nparameter sidesteps that: whatever's returned is guaranteed to come from the same `lit-html`\nthis component already uses. A bare string skips the concern entirely.\n\nOnly need to change the icon on **some** triggers, not every one in the app? Extend the\nclass, override `render()` normally, and register the subclass under a different tag name so\nit coexists with the built-in element instead of replacing it everywhere:\n\n```ts\nclass MyCaret extends UseCaret {\n override render() {\n return html`<slot></slot><slot name=\"icon\"><my-icon name=\"chevron\"></my-icon></slot>`;\n }\n}\ncustomElements.define(\"my-caret\", MyCaret);\n```\n---\n\n\n### **Slots:**\n - **default** - Trigger label content.\n- **icon** - Replaces the default caret glyph.",
63
- "attributes": [],
64
- "references": []
65
- },
66
60
  {
67
61
  "name": "use-date-input",
68
62
  "description": "Displays a date picker using segmented inputs for year, month, and day.\n\nUses browser locale for formatting and ARIA labels.\n---\n",
@@ -74,6 +68,12 @@
74
68
  ],
75
69
  "references": []
76
70
  },
71
+ {
72
+ "name": "use-caret",
73
+ "description": "`use-caret` supplies the caret icon and label layout for a consumer who wants to own the\ninvoking button itself. It renders inside a plain `<button>`\nthat carries the native `popovertarget` attribute, pointing at a `use-menu`:\n\n```html\n<button id=\"thing\" popovertarget=\"thing-menu\">\n <use-caret>Menu</use-caret>\n</button>\n<use-menu id=\"thing-menu\" aria-label=\"Menu\">\n <button role=\"menuitem\">First thing</button>\n</use-menu>\n```\n\n`use-menu` finds this button on its own via `popovertarget` and anchors to it — no\n`anchortarget` needed here; that's only for a menu with more than one invoker. See `use-menu`'s\nown docs for that case.\n\nThe button is entirely the consumer's own element — their classes, their content, their event\nhandlers. `use-caret` contributes no interactivity of its own: no internal button, no focus\ntarget, no state. It only renders the label and caret glyph, so consumers get a consistent\nvisual trigger without giving up control of the button.\n\nThe caret direction is derived rather than configured: a trigger nested inside a `use-menu`\nis understood to open a submenu and renders pointing sideways; a top-level trigger renders\npointing down.\n\nSwapping in a different caret **per instance** is a slot: put your own element in the `icon`\nslot and it replaces `part(icon-default)` entirely for that trigger.\n\nSwapping the default caret **for every trigger in the app** doesn't need touching this\ncomponent's `render()` at all — style `::part(icon-default)` from an outside stylesheet, the\nsame way any shadow DOM part is themed:\n\n```css\nuse-caret::part(icon-default) {\n mask-image: url(\"/icons/my-caret.svg\");\n}\n```\n\n(When the design system's `theme.css` is loaded, this is already wired to a token —\n`--usewc-effect-dropdown-trigger-icon-mask-image` — so redefining that custom property has\nthe same effect without writing a `::part()` rule at all.)\n\n`::part()` only reaches CSS-expressible changes (a mask, a background, a transform). For\nanything else — different markup, an icon font, logic beyond a mask — set the static `icon`\nand `nestedIcon` hooks. Every `<use-caret>` in the page picks them up; consumers keep writing\nthe same tag, no new element to register or remember to use instead. `icon` supplies a\ntop-level trigger's glyph, `nestedIcon` a submenu trigger's — set whichever apply; an unset one\nkeeps the built-in ▼/▶ for that case. Set them once, as early as possible (an app's entry\npoint, before any triggers connect) — Lit calls `render()` fresh on every update, so an\nalready-connected instance only reflects the change once something causes it to re-render:\n\n```ts\n// A bare string or TemplateResult is used as-is, on every trigger of that kind:\nUseCaret.icon = \"▾\";\nUseCaret.nestedIcon = \"▸\";\n\n// A function is called on every render instead:\nUseCaret.nestedIcon = (html) => html`<my-icon name=\"chevron-right\"></my-icon>`;\n```\n\nThe function form is called with the component's own `html` tag as its (optional) first\nargument rather than requiring the caller to import one — a page can end up with more than one\ncopy of `lit-html` in its module graph, and a `TemplateResult` built from a *different* copy\nthan the one this component renders with can silently fail to render. Taking `html` in as a\nparameter sidesteps that: whatever's returned is guaranteed to come from the same `lit-html`\nthis component already uses. A bare string skips the concern entirely.\n\nOnly need to change the icon on **some** triggers, not every one in the app? Extend the\nclass, override `render()` normally, and register the subclass under a different tag name so\nit coexists with the built-in element instead of replacing it everywhere:\n\n```ts\nclass MyCaret extends UseCaret {\n override render() {\n return html`<slot></slot><slot name=\"icon\"><my-icon name=\"chevron\"></my-icon></slot>`;\n }\n}\ncustomElements.define(\"my-caret\", MyCaret);\n```\n---\n\n\n### **Slots:**\n - **default** - Trigger label content.\n- **icon** - Replaces the default caret glyph.",
74
+ "attributes": [],
75
+ "references": []
76
+ },
77
77
  {
78
78
  "name": "use-date-picker",
79
79
  "description": "A day-granularity date picker. Value format: YYYY-MM-DD.\n\nCustomize day rendering on an instance:\n```ts\ndatePicker.renderDay = ({ day, date }, html) =>\n date === \"2026-03-17\" ? html`<strong>${day}</strong>` : String(day);\n```\n\nOr override on a subclass to apply it to every instance, falling back to\n`super.renderDay(...)` for dates you don't want to customize:\n```ts\nclass MyDatePicker extends UseDatePicker {\n renderDay(data: { day: number; date: string }, html: LitHtml) {\n if (data.date === \"2026-03-17\") {\n return html`<strong>${data.day}</strong>`;\n }\n return super.renderDay(data, html);\n }\n}\n```\n---\n\n\n### **Events:**\n - **use-change** - Fired on selection with detail `{ value: string }`\n\n### **Methods:**\n - **renderDay(data: _{ day: number; date: string }_, _html: _LitHtml_): _TemplateResult | string_** - See UseCalendarRenderDay. Assigning a new function on an\ninstance (e.g. via `.renderDay=${fn}` in a Lit template) after first\nrender does not schedule a re-render on its own — call `requestUpdate()`\nif needed.\n\nDeclared as a regular method rather than a class field so subclass\noverrides can call `super.renderDay(data, html)` to fall back to the\ndefault (or a parent override's) rendering.\n\n### **Slots:**\n - **header-start** - Content before the title in the header\n- **title** - Title showing the month and year\n- **controls** - Navigation controls (previous, today, next buttons)\n- **header-end** - Content after the controls in the header\n- **date-{YYYY-MM-DD}** - Per-date content that replaces the default day number\n\n### **CSS Parts:**\n - **header** - The header container\n- **title** - The title text\n- **title-month** - The month part of the title\n- **title-literal** - Literal text in the title\n- **title-year** - The year part of the title\n- **controls** - The controls slot container\n- **control** - Individual control button\n- **control-previous** - Previous month button\n- **control-today** - Today button\n- **control-next** - Next month button\n- **grid** - The main calendar grid\n- **grid-header** - The header row with day names\n- **grid-header-cell** - Individual day name header cell\n- **grid-body** - The container for calendar weeks\n- **row** - A row of days\n- **day** - A day cell\n- **day-empty** - An empty day cell (from previous/next month)\n- **day-selected** - A selected day cell\n- **day-today** - The current date cell\n- **day-disabled** - A disabled date cell\n- **title-button** - The clickable button wrapping the month/year title\n- **picker** - The scrollable month/year picker panel (replaces grid when open)\n- **picker-year-section** - Container for one year's label and month grid\n- **picker-year-label** - The year heading inside a year section\n- **picker-months** - The 4-column month grid inside a year section\n- **picker-month** - An individual month button\n- **picker-month-current** - Applied to the currently selected month button",
@@ -252,6 +252,58 @@
252
252
  ],
253
253
  "references": []
254
254
  },
255
+ {
256
+ "name": "use-intl-number",
257
+ "description": "Displays a localized, human-readable representation of a number using\n[`Intl.NumberFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat).\nRenders a semantic `<data>` element in its shadow root with a machine-readable\n`value` attribute and formatted inner text.\n\nSet `numberstyle` to control what kind of number is formatted (see\n[`style`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#style)):\n- `decimal` (default) → plain number, e.g. `1,234.5`\n- `percent` → percentage, e.g. `42%` (value is the fraction, so `0.42` renders `42%`)\n- `currency` → currency amount, requires `currency`\n- `unit` → measurement, requires `unit`\n\nLocale is resolved from the nearest ancestor `[lang]` attribute, or\n`navigator.language` if none is found. Set `lang` directly on the element to override.\n---\n",
258
+ "attributes": [
259
+ {
260
+ "name": "value",
261
+ "description": "Numeric amount to format",
262
+ "values": []
263
+ },
264
+ {
265
+ "name": "numberstyle",
266
+ "description": "Format style: `decimal` | `percent` | `currency` | `unit`",
267
+ "values": []
268
+ },
269
+ {
270
+ "name": "currency",
271
+ "description": "[ISO 4217 currency code](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currency), e.g. `USD`, `EUR`, `JPY`. Required when numberstyle is `currency`",
272
+ "values": []
273
+ },
274
+ {
275
+ "name": "currencydisplay",
276
+ "description": "[How the currency is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencydisplay): `symbol` | `narrowSymbol` | `code` | `name`",
277
+ "values": []
278
+ },
279
+ {
280
+ "name": "currencysign",
281
+ "description": "[Sign convention](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#currencysign): `standard` (minus sign) | `accounting` (parenthesized negatives)",
282
+ "values": []
283
+ },
284
+ {
285
+ "name": "unit",
286
+ "description": "[Unit identifier](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unit), e.g. `kilometer-per-hour`, `liter`. Required when numberstyle is `unit`",
287
+ "values": []
288
+ },
289
+ {
290
+ "name": "unitdisplay",
291
+ "description": "[How the unit is denoted](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#unitdisplay): `short` | `narrow` | `long`",
292
+ "values": []
293
+ },
294
+ {
295
+ "name": "signdisplay",
296
+ "description": "[When to show the sign](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat#signdisplay): `auto` | `always` | `exceptZero` | `never`",
297
+ "values": []
298
+ },
299
+ {
300
+ "name": "lang",
301
+ "description": "BCP 47 locale tag. Inherits from nearest ancestor `[lang]` if not set.",
302
+ "values": []
303
+ }
304
+ ],
305
+ "references": []
306
+ },
255
307
  {
256
308
  "name": "use-listbox-input",
257
309
  "description": "\n---\n\n\n### **Events:**\n - **use-change**\n\n### **Slots:**\n - **default** - NodeList of `use-option` elements",