use-wc 1.0.0-pre.91 → 1.0.0-pre.92
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/custom-elements.json +46 -46
- package/package.json +1 -1
- package/vscode.html-custom-data.json +6 -6
package/custom-elements.json
CHANGED
|
@@ -762,130 +762,130 @@
|
|
|
762
762
|
},
|
|
763
763
|
{
|
|
764
764
|
"kind": "javascript-module",
|
|
765
|
-
"path": "src/elements/use-
|
|
765
|
+
"path": "src/elements/use-calendarday/use-calendarday.ts",
|
|
766
766
|
"declarations": [
|
|
767
767
|
{
|
|
768
768
|
"kind": "class",
|
|
769
|
-
"description": "
|
|
770
|
-
"name": "
|
|
769
|
+
"description": "A helper component for customizing specific days within `use-calendar`.\nContent placed inside this element will replace the default day number display.",
|
|
770
|
+
"name": "UseCalendarday",
|
|
771
771
|
"slots": [
|
|
772
772
|
{
|
|
773
|
-
"description": "
|
|
773
|
+
"description": "slot for custom day content (replaces the day number)",
|
|
774
774
|
"name": "default"
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
"description": "Replaces the default caret glyph.",
|
|
778
|
-
"name": "icon"
|
|
779
775
|
}
|
|
780
776
|
],
|
|
781
777
|
"members": [
|
|
782
778
|
{
|
|
783
779
|
"kind": "field",
|
|
784
|
-
"name": "
|
|
780
|
+
"name": "date",
|
|
785
781
|
"type": {
|
|
786
|
-
"text": "
|
|
782
|
+
"text": "string"
|
|
787
783
|
},
|
|
788
|
-
"
|
|
789
|
-
"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 ▼."
|
|
784
|
+
"attribute": "date"
|
|
790
785
|
},
|
|
791
786
|
{
|
|
792
787
|
"kind": "field",
|
|
793
|
-
"name": "
|
|
788
|
+
"name": "day",
|
|
789
|
+
"readonly": true
|
|
790
|
+
}
|
|
791
|
+
],
|
|
792
|
+
"attributes": [
|
|
793
|
+
{
|
|
794
|
+
"name": "date",
|
|
794
795
|
"type": {
|
|
795
|
-
"text": "
|
|
796
|
+
"text": "string"
|
|
796
797
|
},
|
|
797
|
-
"
|
|
798
|
-
"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 ▶."
|
|
798
|
+
"fieldName": "date"
|
|
799
799
|
}
|
|
800
800
|
],
|
|
801
801
|
"superclass": {
|
|
802
802
|
"name": "LitElement",
|
|
803
803
|
"package": "lit"
|
|
804
804
|
},
|
|
805
|
-
"tagName": "use-
|
|
805
|
+
"tagName": "use-calendarday",
|
|
806
806
|
"customElement": true
|
|
807
807
|
}
|
|
808
808
|
],
|
|
809
809
|
"exports": [
|
|
810
810
|
{
|
|
811
811
|
"kind": "js",
|
|
812
|
-
"name": "
|
|
812
|
+
"name": "UseCalendarday",
|
|
813
813
|
"declaration": {
|
|
814
|
-
"name": "
|
|
815
|
-
"module": "src/elements/use-
|
|
814
|
+
"name": "UseCalendarday",
|
|
815
|
+
"module": "src/elements/use-calendarday/use-calendarday.ts"
|
|
816
816
|
}
|
|
817
817
|
},
|
|
818
818
|
{
|
|
819
819
|
"kind": "custom-element-definition",
|
|
820
|
-
"name": "use-
|
|
820
|
+
"name": "use-calendarday",
|
|
821
821
|
"declaration": {
|
|
822
|
-
"name": "
|
|
823
|
-
"module": "src/elements/use-
|
|
822
|
+
"name": "UseCalendarday",
|
|
823
|
+
"module": "src/elements/use-calendarday/use-calendarday.ts"
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
826
|
]
|
|
827
827
|
},
|
|
828
828
|
{
|
|
829
829
|
"kind": "javascript-module",
|
|
830
|
-
"path": "src/elements/use-
|
|
830
|
+
"path": "src/elements/use-caret/use-caret.ts",
|
|
831
831
|
"declarations": [
|
|
832
832
|
{
|
|
833
833
|
"kind": "class",
|
|
834
|
-
"description": "
|
|
835
|
-
"name": "
|
|
834
|
+
"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```",
|
|
835
|
+
"name": "UseCaret",
|
|
836
836
|
"slots": [
|
|
837
837
|
{
|
|
838
|
-
"description": "
|
|
838
|
+
"description": "Trigger label content.",
|
|
839
839
|
"name": "default"
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
"description": "Replaces the default caret glyph.",
|
|
843
|
+
"name": "icon"
|
|
840
844
|
}
|
|
841
845
|
],
|
|
842
846
|
"members": [
|
|
843
847
|
{
|
|
844
848
|
"kind": "field",
|
|
845
|
-
"name": "
|
|
849
|
+
"name": "icon",
|
|
846
850
|
"type": {
|
|
847
|
-
"text": "string"
|
|
851
|
+
"text": "((html: HtmlTag) => TemplateResult | string) | TemplateResult | string | undefined"
|
|
848
852
|
},
|
|
849
|
-
"
|
|
853
|
+
"static": true,
|
|
854
|
+
"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 ▼."
|
|
850
855
|
},
|
|
851
856
|
{
|
|
852
857
|
"kind": "field",
|
|
853
|
-
"name": "
|
|
854
|
-
"readonly": true
|
|
855
|
-
}
|
|
856
|
-
],
|
|
857
|
-
"attributes": [
|
|
858
|
-
{
|
|
859
|
-
"name": "date",
|
|
858
|
+
"name": "nestedIcon",
|
|
860
859
|
"type": {
|
|
861
|
-
"text": "string"
|
|
860
|
+
"text": "((html: HtmlTag) => TemplateResult | string) | TemplateResult | string | undefined"
|
|
862
861
|
},
|
|
863
|
-
"
|
|
862
|
+
"static": true,
|
|
863
|
+
"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 ▶."
|
|
864
864
|
}
|
|
865
865
|
],
|
|
866
866
|
"superclass": {
|
|
867
867
|
"name": "LitElement",
|
|
868
868
|
"package": "lit"
|
|
869
869
|
},
|
|
870
|
-
"tagName": "use-
|
|
870
|
+
"tagName": "use-caret",
|
|
871
871
|
"customElement": true
|
|
872
872
|
}
|
|
873
873
|
],
|
|
874
874
|
"exports": [
|
|
875
875
|
{
|
|
876
876
|
"kind": "js",
|
|
877
|
-
"name": "
|
|
877
|
+
"name": "UseCaret",
|
|
878
878
|
"declaration": {
|
|
879
|
-
"name": "
|
|
880
|
-
"module": "src/elements/use-
|
|
879
|
+
"name": "UseCaret",
|
|
880
|
+
"module": "src/elements/use-caret/use-caret.ts"
|
|
881
881
|
}
|
|
882
882
|
},
|
|
883
883
|
{
|
|
884
884
|
"kind": "custom-element-definition",
|
|
885
|
-
"name": "use-
|
|
885
|
+
"name": "use-caret",
|
|
886
886
|
"declaration": {
|
|
887
|
-
"name": "
|
|
888
|
-
"module": "src/elements/use-
|
|
887
|
+
"name": "UseCaret",
|
|
888
|
+
"module": "src/elements/use-caret/use-caret.ts"
|
|
889
889
|
}
|
|
890
890
|
}
|
|
891
891
|
]
|
package/package.json
CHANGED
|
@@ -63,18 +63,18 @@
|
|
|
63
63
|
],
|
|
64
64
|
"references": []
|
|
65
65
|
},
|
|
66
|
-
{
|
|
67
|
-
"name": "use-caret",
|
|
68
|
-
"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.",
|
|
69
|
-
"attributes": [],
|
|
70
|
-
"references": []
|
|
71
|
-
},
|
|
72
66
|
{
|
|
73
67
|
"name": "use-calendarday",
|
|
74
68
|
"description": "A helper component for customizing specific days within `use-calendar`.\nContent placed inside this element will replace the default day number display.\n---\n\n\n### **Slots:**\n - **default** - slot for custom day content (replaces the day number)",
|
|
75
69
|
"attributes": [{ "name": "date", "values": [] }],
|
|
76
70
|
"references": []
|
|
77
71
|
},
|
|
72
|
+
{
|
|
73
|
+
"name": "use-caret",
|
|
74
|
+
"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.",
|
|
75
|
+
"attributes": [],
|
|
76
|
+
"references": []
|
|
77
|
+
},
|
|
78
78
|
{
|
|
79
79
|
"name": "use-control-set",
|
|
80
80
|
"description": "Groups adjacent controls — buttons and text-style inputs alike — into one visual unit: shared\nborders between touching children, rounded corners only on the two outer ends, and a hovered\nor focused child's border lifted above its neighbors so the whole border reads clearly.\n\n`use-control-set` renders no shadow DOM and no template of its own — it exists only as a\ndedicated tag for `theme/control-set.css` to style, the same way `use-layout` is a bare\nprimitive rather than a specific look. A classic split button is a text button followed by an\nicon-only trigger for a `use-menu`:\n\n```html\n<use-control-set>\n <button type=\"button\">Save</button>\n <button type=\"button\" popovertarget=\"save-options\" aria-label=\"More save options\">\n <use-caret></use-caret>\n </button>\n</use-control-set>\n<use-menu id=\"save-options\" aria-label=\"More save options\">\n <button role=\"menuitem\">Save as…</button>\n</use-menu>\n```\n\nA search box with an attached submit button follows the same shape, mixing a text input with a\nbutton:\n\n```html\n<use-control-set>\n <input type=\"search\" placeholder=\"Search\" />\n <button type=\"submit\">Go</button>\n</use-control-set>\n```\n\nA child is a `<button>`, anything wearing `.appearance-button`, an `<input>` (other than a\ncheckbox/radio/range/file), a `<select>`, a `<textarea>`, or anything wearing\n`.appearance-input` — see `theme/control-set.css` for exactly which selectors read which\nradius/border tokens. A plain `span` renders as a static text cell between controls.\n\nPagination follows the same shape, with `a.appearance-button` links and `aria-current=\"page\"`\nholding the current page in its pressed look:\n\n```html\n<nav aria-label=\"Pagination\">\n <use-control-set>\n <a class=\"appearance-button\" href=\"?page=1\">1</a>\n <a class=\"appearance-button\" href=\"?page=2\" aria-current=\"page\">2</a>\n <span aria-hidden=\"true\">…</span>\n <a class=\"appearance-button\" href=\"?page=10\">10</a>\n </use-control-set>\n</nav>\n```\n\nA formatting toolbar works the same way with toggle buttons: `aria-pressed=\"true\"` (or `\"mixed\"`,\nfor a selection it only partly covers) holds a format that's on in its pressed look.\n\nHow the touching sides render is themeable rather than fixed: `--usewc-layout-control-set-gap`\n(default: a negative overlap equal to the child's own border, for a seamless merged line) and\n`--usewc-effect-control-set-border-radius-sequential` (default: `0`, for square touching\ncorners) can both be overridden — a positive gap and a small radius reads as a looser, softer\nset instead of a fused one.\n---\n\n\n### **Slots:**\n - _default_ - The grouped controls.",
|