use-wc 1.0.0-pre.96 → 1.0.0-pre.97

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.
@@ -4413,6 +4413,48 @@
4413
4413
  }
4414
4414
  ]
4415
4415
  },
4416
+ {
4417
+ "kind": "javascript-module",
4418
+ "path": "src/elements/use-pattern/use-pattern.ts",
4419
+ "declarations": [
4420
+ {
4421
+ "kind": "class",
4422
+ "description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```",
4423
+ "name": "UsePattern",
4424
+ "slots": [
4425
+ {
4426
+ "description": "The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
4427
+ "name": ""
4428
+ }
4429
+ ],
4430
+ "members": [],
4431
+ "superclass": {
4432
+ "name": "LitElement",
4433
+ "package": "lit"
4434
+ },
4435
+ "tagName": "use-pattern",
4436
+ "customElement": true
4437
+ }
4438
+ ],
4439
+ "exports": [
4440
+ {
4441
+ "kind": "js",
4442
+ "name": "UsePattern",
4443
+ "declaration": {
4444
+ "name": "UsePattern",
4445
+ "module": "src/elements/use-pattern/use-pattern.ts"
4446
+ }
4447
+ },
4448
+ {
4449
+ "kind": "custom-element-definition",
4450
+ "name": "use-pattern",
4451
+ "declaration": {
4452
+ "name": "UsePattern",
4453
+ "module": "src/elements/use-pattern/use-pattern.ts"
4454
+ }
4455
+ }
4456
+ ]
4457
+ },
4416
4458
  {
4417
4459
  "kind": "javascript-module",
4418
4460
  "path": "src/elements/use-option/use-option.ts",
@@ -4527,48 +4569,6 @@
4527
4569
  }
4528
4570
  ]
4529
4571
  },
4530
- {
4531
- "kind": "javascript-module",
4532
- "path": "src/elements/use-pattern/use-pattern.ts",
4533
- "declarations": [
4534
- {
4535
- "kind": "class",
4536
- "description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```",
4537
- "name": "UsePattern",
4538
- "slots": [
4539
- {
4540
- "description": "The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
4541
- "name": ""
4542
- }
4543
- ],
4544
- "members": [],
4545
- "superclass": {
4546
- "name": "LitElement",
4547
- "package": "lit"
4548
- },
4549
- "tagName": "use-pattern",
4550
- "customElement": true
4551
- }
4552
- ],
4553
- "exports": [
4554
- {
4555
- "kind": "js",
4556
- "name": "UsePattern",
4557
- "declaration": {
4558
- "name": "UsePattern",
4559
- "module": "src/elements/use-pattern/use-pattern.ts"
4560
- }
4561
- },
4562
- {
4563
- "kind": "custom-element-definition",
4564
- "name": "use-pattern",
4565
- "declaration": {
4566
- "name": "UsePattern",
4567
- "module": "src/elements/use-pattern/use-pattern.ts"
4568
- }
4569
- }
4570
- ]
4571
- },
4572
4572
  {
4573
4573
  "kind": "javascript-module",
4574
4574
  "path": "src/elements/use-scrollarea/index.ts",
@@ -1321,7 +1321,7 @@
1321
1321
  --usewc-color-popover-menu-item-text: var(--usewc-color-popover-menu-item-text-static);
1322
1322
  --usewc-effect-outline-width: 0;
1323
1323
 
1324
- gap: var(--usewc-layout-popover-menu-item-padding-inline);
1324
+ gap: var(--usewc-layout-popover-menu-item-gap);
1325
1325
  line-height: var(--usewc-layout-popover-menu-item-line-height);
1326
1326
  padding-inline: var(--usewc-layout-popover-menu-item-padding-inline);
1327
1327
  padding-block: var(--usewc-layout-popover-menu-item-padding-block);
@@ -1551,7 +1551,7 @@
1551
1551
  flex-direction: row;
1552
1552
  justify-content: start;
1553
1553
  width: 100%;
1554
- gap: var(--usewc-layout-popover-menu-item-padding-inline);
1554
+ gap: var(--usewc-layout-popover-menu-item-gap);
1555
1555
  line-height: var(--usewc-layout-popover-menu-item-line-height);
1556
1556
  padding-inline: var(--usewc-layout-popover-menu-item-padding-inline);
1557
1557
  padding-block: var(--usewc-layout-popover-menu-item-padding-block);
package/dist/tokens.css CHANGED
@@ -738,8 +738,9 @@
738
738
  --usewc-layout-grid-list-row-selected-marker: var(--usewc-space-2);
739
739
 
740
740
  /* Menu */
741
- --usewc-layout-popover-menu-item-padding-inline: var(--usewc-space-4);
742
- --usewc-layout-popover-menu-item-padding-block: var(--usewc-space-2);
741
+ --usewc-layout-popover-menu-item-padding-inline: var(--usewc-space-12);
742
+ --usewc-layout-popover-menu-item-gap: var(--usewc-space-4);
743
+ --usewc-layout-popover-menu-item-padding-block: var(--usewc-space-4);
743
744
  --usewc-layout-popover-menu-item-line-height: var(--usewc-line-height-24);
744
745
  --usewc-color-popover-menu-item-background-static: var(--usewc-color-transparent);
745
746
  --usewc-color-popover-menu-item-background-hover: var(--usewc-color-selector-background-hover);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-wc",
3
- "version": "1.0.0-pre.96",
3
+ "version": "1.0.0-pre.97",
4
4
  "private": false,
5
5
  "homepage": "https://usewc.com",
6
6
  "bugs": "https://github.com/dang-rabbits/use-wc/issues",
@@ -467,6 +467,12 @@
467
467
  ],
468
468
  "references": []
469
469
  },
470
+ {
471
+ "name": "use-pattern",
472
+ "description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```\n---\n\n\n### **Slots:**\n - _default_ - The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
473
+ "attributes": [],
474
+ "references": []
475
+ },
470
476
  {
471
477
  "name": "use-option",
472
478
  "description": "`use-option` is a custom element that represents an option in a `use-listbox-input` custom\nelement.\n\nThe children of this element are the content of the option and must not contain any\ninteractive elements.\n\nSelection is shown by one of two indicators, swapped based on the option's `selected` state:\na checkmark when selected, nothing (a reserved-space placeholder) when not.\n\nSwapping an indicator **per instance** is a slot: put your own element in the `selected-indicator`\nor `deselected-indicator` slot and it replaces `part(selected-indicator-default)` /\n`part(deselected-indicator-default)` entirely for that option.\n\nSwapping an indicator **for every option in the app** doesn't need touching this component's\n`render()` at all — style `::part(selected-indicator-default)` /\n`::part(deselected-indicator-default)` from an outside stylesheet, the same way any shadow DOM\npart is themed:\n\n```css\nuse-option::part(selected-indicator-default) {\n mask-image: url(\"/icons/my-checkmark.svg\");\n}\n```\n\n(When the design system's `theme.css` is loaded, this is already wired to a pair of tokens —\n`--usewc-effect-selected-indicator-mask-image` for the shape and\n`--usewc-effect-selected-indicator-color` for what paints it (`--usewc-effect-deselected-…`\nfor the other state) — so redefining those custom properties has the same effect without\nwriting 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\n`selectedIcon` and `deselectedIcon` hooks. Every `<use-option>` in the page picks them up;\nconsumers keep writing the same tag, no new element to register or remember to use instead.\nSet them once, as early as possible (an app's entry point, before any options connect) — Lit\ncalls `render()` fresh on every update, so an already-connected instance only reflects the\nchange once something causes it to re-render:\n\n```ts\n// A bare string or TemplateResult is used as-is, on every option:\nUseOption.selectedIcon = \"✓\";\nUseOption.deselectedIcon = \"\";\n\n// A function is called on every render instead:\nUseOption.selectedIcon = (html) => html`<my-icon name=\"check\"></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\nA set icon still renders under `part(selected-indicator-default)` /\n`part(deselected-indicator-default)` — the same part the design system's theme masks into the\nbuilt-in glyph. Combining a static hook with `theme.css` means the theme's masking still\napplies to the custom content; reset the relevant `mask-image` token or `::part()` rule if that\nfights with what was set.\n\nOnly need to change the icon on **some** options, not every one in the app? Extend the class,\noverride `render()` normally, and register the subclass under a different tag name so it\ncoexists with the built-in element instead of replacing it everywhere:\n\n```ts\nclass MyOption extends UseOption {\n override render() {\n return html`<slot></slot><slot name=\"selected-indicator\"><my-icon name=\"check\"></my-icon></slot>`;\n }\n}\ncustomElements.define(\"my-option\", MyOption);\n```\n---\n\n\n### **Slots:**\n - **selected-indicator** - Replaces the default checkmark shown when the option is selected.\n- **deselected-indicator** - Replaces the default (empty) indicator shown when the option is not selected.\n- **default** - Option content.",
@@ -477,12 +483,6 @@
477
483
  ],
478
484
  "references": []
479
485
  },
480
- {
481
- "name": "use-pattern",
482
- "description": "`use-pattern` arranges a region-based unit of content — a card, a row in a list, a chat\nmessage, a media object — styled entirely by the design system's theme layer\n(`theme/pattern.css`) rather than by any shadow DOM here. It renders its light-DOM children\nexactly as given.\n\nIts variant classes (`card`, `entry`, `message`, `media`) and their modifiers (`.divided`,\n`.compact`, `.elevated`, `.flush`) are plain classes rather than properties, the same as any\nother themed class in this system, like `use-avatar`'s `.circle`/`.square`. For generic flex\narrangement, or a page frame, use `use-layout`, which nests freely inside a pattern's regions.\n\n```html\n<use-pattern class=\"card\">\n <header>\n <hgroup><h3>Title</h3><p>Subtitle</p></hgroup>\n </header>\n <main><p>Body</p></main>\n <footer><button type=\"button\">Done</button></footer>\n</use-pattern>\n```\n---\n\n\n### **Slots:**\n - _default_ - The pattern's regions — `figure`, `header`, `main`, `footer`, or any other element.",
483
- "attributes": [],
484
- "references": []
485
- },
486
486
  {
487
487
  "name": "use-scrollarea",
488
488
  "description": "A scroll container that exposes custom states for scroll edge detection.\n\n## Custom States\nThe following CSS custom states are available for styling:\n\n- `:state(at-block-start)` — scrolled to the block-start edge (top in horizontal writing modes)\n- `:state(at-block-end)` — scrolled to the block-end edge (bottom in horizontal writing modes)\n- `:state(at-inline-start)` — scrolled to the inline-start edge (left in LTR)\n- `:state(at-inline-end)` — scrolled to the inline-end edge (right in LTR)\n---\n\n\n### **Slots:**\n - _default_ - Scrollable content",