@threadlabs/looma 0.23.22 → 0.23.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.23.22",
3
+ "version": "0.23.23",
4
4
  "type": "module",
5
5
  "description": "Looma components as HTML, Vue, and plain DOM, with design tokens.",
6
6
  "license": "MIT",
@@ -172,6 +172,42 @@
172
172
  font-size: var(--ui-font-size-md);
173
173
  }
174
174
 
175
+ /* Card actions inherit Button's palette and behavior; only their shared layout changes.
176
+ The icon may contain any decorative composition. Empty icons remove their column. */
177
+ :scope[data-ui-button-state~="variant=card"] {
178
+ display: grid;
179
+ grid-template-columns: auto minmax(0, 1fr) auto;
180
+ align-items: start;
181
+ gap: var(--ui-space-3);
182
+ inline-size: 100%;
183
+ min-block-size: max(var(--ui-control-min-block-size), var(--ui-control-size-md));
184
+ text-align: start;
185
+ white-space: normal;
186
+ box-shadow: none;
187
+ background-image: none;
188
+ }
189
+ :scope[data-ui-button-state~="variant=card"][data-ui-button-state~="size=lg"] {
190
+ min-block-size: max(var(--ui-control-min-block-size), var(--ui-control-size-lg));
191
+ }
192
+ :scope[data-ui-button-state~="variant=card"]:has(.card-icon:empty) {
193
+ grid-template-columns: minmax(0, 1fr) auto;
194
+ }
195
+ .card-icon {
196
+ display: flex;
197
+ align-items: flex-start;
198
+ }
199
+ .card-icon:empty {
200
+ display: none;
201
+ }
202
+ .card-content {
203
+ min-inline-size: 0;
204
+ }
205
+ .card-action {
206
+ display: flex;
207
+ align-items: center;
208
+ align-self: center;
209
+ }
210
+
175
211
  /* A link is never :enabled, so interactive states test "not unavailable" instead: for a button that
176
212
  is exactly :enabled, at the same specificity, and it also matches a link that can be followed. */
177
213
  :scope:hover:not(:disabled, [aria-disabled="true"]) {
@@ -388,6 +424,9 @@
388
424
  @supports (text-box-trim: trim-both) {
389
425
  }
390
426
 
427
+ /* Card actions inherit Button's palette and behavior; only their shared layout changes.
428
+ The icon may contain any decorative composition. Empty icons remove their column. */
429
+
391
430
  /* A link is never :enabled, so interactive states test "not unavailable" instead: for a button that
392
431
  is exactly :enabled, at the same specificity, and it also matches a link that can be followed. */
393
432
 
@@ -12,13 +12,17 @@
12
12
  align-self: stretch;
13
13
  margin: 0;
14
14
  border: 0;
15
- border-block-start: var(--ui-border-width) solid var(--ui-separator-color, var(--ui-border-divider));
15
+ border-block-start: var(--ui-border-width) solid var(--ui-separator-color, var(--_separator-color, var(--ui-border-divider)));
16
+ }
17
+
18
+ :scope[data-ui-separator-state~="emphasis=strong"] {
19
+ --_separator-color: var(--ui-border-strong);
16
20
  }
17
21
 
18
22
  :scope[aria-orientation="vertical"] {
19
23
  block-size: auto;
20
24
  border-block-start: 0;
21
- border-inline-start: var(--ui-border-width) solid var(--ui-separator-color, var(--ui-border-divider));
25
+ border-inline-start: var(--ui-border-width) solid var(--ui-separator-color, var(--_separator-color, var(--ui-border-divider)));
22
26
  }
23
27
 
24
28
  :scope[data-ui-separator-state~="selectable"] {
@@ -19,7 +19,7 @@ export interface UiButtonProps {
19
19
  target?: string | null;
20
20
  tone?: "accent" | "neutral" | "danger" | "success" | "warning" | "info" | null;
21
21
  type?: "button" | "submit" | "reset" | null;
22
- variant?: "outline" | "solid" | "danger" | "ghost" | "link" | null;
22
+ variant?: "outline" | "solid" | "danger" | "ghost" | "link" | "card" | null;
23
23
  attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
24
24
  children?: readonly (string | Node)[];
25
25
  slots?: Readonly<Record<string, readonly (string | Node)[]>>;
@@ -3,7 +3,7 @@ import { componentRootIndex, manageComponentLifecycle } from "@nextwebwg/html-ne
3
3
  import * as controller from "../components/ui-button/ui-button.js";
4
4
  import "../styles/ui-button.css";
5
5
 
6
- const definition = {...{"contract":{"tag":"ui-button","props":{"align":{"type":{"kind":"terminal","name":"keyword"},"values":["center","start"],"required":false,"target":{"attribute":"align"},"default":"center"},"as":{"type":{"kind":"terminal","name":"keyword"},"values":["button","a"],"required":false,"target":{"attribute":"as"},"default":"button"},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"href":{"type":"string","required":false,"target":{"attribute":"href"}},"loading":{"type":"boolean","required":false,"target":{"attribute":"loading"},"default":false},"pending":{"type":"boolean","required":false,"target":{"attribute":"pending"},"default":false},"rel":{"type":"string","required":false,"target":{"attribute":"rel"}},"shape":{"type":{"kind":"terminal","name":"keyword"},"values":["rounded","pill"],"required":false,"target":{"attribute":"shape"},"default":"rounded"},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["xs","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"md"},"stretch":{"type":"boolean","required":false,"target":{"attribute":"stretch"},"default":false},"target":{"type":"string","required":false,"target":{"attribute":"target"}},"tone":{"type":{"kind":"terminal","name":"keyword"},"values":["accent","neutral","danger","success","warning","info"],"required":false,"target":{"attribute":"tone"},"default":"accent"},"type":{"type":{"kind":"terminal","name":"keyword"},"values":["button","submit","reset"],"required":false,"target":{"attribute":"type"},"default":"button"},"variant":{"type":{"kind":"terminal","name":"keyword"},"values":["outline","solid","danger","ghost","link"],"required":false,"target":{"attribute":"variant"},"default":"outline"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"a","attributes":[{"kind":"attribute","name":"href","expression":"{ true: null, false: href }[concat(disabled or loading or pending)]","expressionPlan":{"source":"{ true: null, false: href }[concat(disabled or loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":null}},{"key":"false","value":{"kind":"id","name":"href"}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"loading"}},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["disabled","href","loading","pending"]}},{"kind":"attribute","name":"target","expression":"target","expressionPlan":{"source":"target","ast":{"kind":"id","name":"target"},"dependencies":["target"]}},{"kind":"attribute","name":"rel","expression":"rel","expressionPlan":{"source":"rel","ast":{"kind":"id","name":"rel"},"dependencies":["rel"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[concat(disabled or loading or pending)]","expressionPlan":{"source":"{ true: 'true', false: null }[concat(disabled or loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"loading"}},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["disabled","loading","pending"]}},{"kind":"attribute","name":"aria-busy","expression":"loading or pending","expressionPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}},{"kind":"attribute","name":"tabindex","expression":"{ true: '0', false: null }[concat((loading or pending) and not disabled)]","expressionPlan":{"source":"{ true: '0', false: null }[concat((loading or pending) and not disabled)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"0"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"and","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}}]}},"dependencies":["disabled","loading","pending"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"spinner-wrap"}],"children":[{"kind":"element","name":"ui-spinner","attributes":[{"kind":"literal","name":"size","value":"sm"}],"children":[]}],"flow":{"kind":"if","test":"loading or pending","testPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}},{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'a'","testPlan":{"source":"as = 'a'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"a"}},"dependencies":["as"]}}},{"kind":"element","name":"button","attributes":[{"kind":"attribute","name":"type","expression":"type","expressionPlan":{"source":"type","ast":{"kind":"id","name":"type"},"dependencies":["type"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[concat(loading or pending)]","expressionPlan":{"source":"{ true: 'true', false: null }[concat(loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["loading","pending"]}},{"kind":"attribute","name":"aria-busy","expression":"loading or pending","expressionPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"spinner-wrap"}],"children":[{"kind":"element","name":"ui-spinner","attributes":[{"kind":"literal","name":"size","value":"sm"}],"children":[]}],"flow":{"kind":"if","test":"loading or pending","testPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}},{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"button","choices":["a","button"]}},source:{file:import.meta.url},css:""};
6
+ const definition = {...{"contract":{"tag":"ui-button","props":{"align":{"type":{"kind":"terminal","name":"keyword"},"values":["center","start"],"required":false,"target":{"attribute":"align"},"default":"center"},"as":{"type":{"kind":"terminal","name":"keyword"},"values":["button","a"],"required":false,"target":{"attribute":"as"},"default":"button"},"disabled":{"type":"boolean","required":false,"target":{"attribute":"disabled"},"default":false},"href":{"type":"string","required":false,"target":{"attribute":"href"}},"loading":{"type":"boolean","required":false,"target":{"attribute":"loading"},"default":false},"pending":{"type":"boolean","required":false,"target":{"attribute":"pending"},"default":false},"rel":{"type":"string","required":false,"target":{"attribute":"rel"}},"shape":{"type":{"kind":"terminal","name":"keyword"},"values":["rounded","pill"],"required":false,"target":{"attribute":"shape"},"default":"rounded"},"size":{"type":{"kind":"terminal","name":"keyword"},"values":["xs","sm","md","lg"],"required":false,"target":{"attribute":"size"},"default":"md"},"stretch":{"type":"boolean","required":false,"target":{"attribute":"stretch"},"default":false},"target":{"type":"string","required":false,"target":{"attribute":"target"}},"tone":{"type":{"kind":"terminal","name":"keyword"},"values":["accent","neutral","danger","success","warning","info"],"required":false,"target":{"attribute":"tone"},"default":"accent"},"type":{"type":{"kind":"terminal","name":"keyword"},"values":["button","submit","reset"],"required":false,"target":{"attribute":"type"},"default":"button"},"variant":{"type":{"kind":"terminal","name":"keyword"},"values":["outline","solid","danger","ghost","link","card"],"required":false,"target":{"attribute":"variant"},"default":"outline"}}},"template":{"kind":"element","name":"template","attributes":[],"children":[{"kind":"element","name":"a","attributes":[{"kind":"attribute","name":"href","expression":"{ true: null, false: href }[concat(disabled or loading or pending)]","expressionPlan":{"source":"{ true: null, false: href }[concat(disabled or loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":null}},{"key":"false","value":{"kind":"id","name":"href"}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"loading"}},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["disabled","href","loading","pending"]}},{"kind":"attribute","name":"target","expression":"target","expressionPlan":{"source":"target","ast":{"kind":"id","name":"target"},"dependencies":["target"]}},{"kind":"attribute","name":"rel","expression":"rel","expressionPlan":{"source":"rel","ast":{"kind":"id","name":"rel"},"dependencies":["rel"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[concat(disabled or loading or pending)]","expressionPlan":{"source":"{ true: 'true', false: null }[concat(disabled or loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"loading"}},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["disabled","loading","pending"]}},{"kind":"attribute","name":"aria-busy","expression":"loading or pending","expressionPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}},{"kind":"attribute","name":"tabindex","expression":"{ true: '0', false: null }[concat((loading or pending) and not disabled)]","expressionPlan":{"source":"{ true: '0', false: null }[concat((loading or pending) and not disabled)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"0"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"and","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}}]}},"dependencies":["disabled","loading","pending"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"card-icon"}],"children":[{"kind":"element","name":"ui-spinner","attributes":[{"kind":"literal","name":"size","value":"sm"}],"children":[],"flow":{"kind":"if","test":"loading or pending","testPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}},{"kind":"element","name":"template","attributes":[],"children":[{"kind":"slot","fallback":[],"name":"icon"}],"flow":{"kind":"if","test":"not (loading or pending)","testPlan":{"source":"not (loading or pending)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}}},"dependencies":["loading","pending"]}}}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"card-content"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"card-action"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"chevron-right"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"name":"action"}]}],"flow":{"kind":"when","test":"variant = 'card' and as = 'a'","testPlan":{"source":"variant = 'card' and as = 'a'","ast":{"kind":"binary","op":"and","left":{"kind":"binary","op":"=","left":{"kind":"id","name":"variant"},"right":{"kind":"literal","value":"card"}},"right":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"a"}}},"dependencies":["as","variant"]}}},{"kind":"element","name":"button","attributes":[{"kind":"attribute","name":"type","expression":"type","expressionPlan":{"source":"type","ast":{"kind":"id","name":"type"},"dependencies":["type"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[concat(loading or pending)]","expressionPlan":{"source":"{ true: 'true', false: null }[concat(loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["loading","pending"]}},{"kind":"attribute","name":"aria-busy","expression":"loading or pending","expressionPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"card-icon"}],"children":[{"kind":"element","name":"ui-spinner","attributes":[{"kind":"literal","name":"size","value":"sm"}],"children":[],"flow":{"kind":"if","test":"loading or pending","testPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}},{"kind":"element","name":"template","attributes":[],"children":[{"kind":"slot","fallback":[],"name":"icon"}],"flow":{"kind":"if","test":"not (loading or pending)","testPlan":{"source":"not (loading or pending)","ast":{"kind":"unary","op":"not","operand":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}}},"dependencies":["loading","pending"]}}}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"card-content"}],"children":[{"kind":"slot"}]},{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"card-action"}],"children":[{"kind":"slot","fallback":[{"kind":"element","name":"ui-icon","attributes":[{"kind":"literal","name":"name","value":"chevron-right"},{"kind":"literal","name":"aria-hidden","value":"true"}],"children":[]}],"name":"action"}]}],"flow":{"kind":"when","test":"variant = 'card'","testPlan":{"source":"variant = 'card'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"variant"},"right":{"kind":"literal","value":"card"}},"dependencies":["variant"]}}},{"kind":"element","name":"a","attributes":[{"kind":"attribute","name":"href","expression":"{ true: null, false: href }[concat(disabled or loading or pending)]","expressionPlan":{"source":"{ true: null, false: href }[concat(disabled or loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":null}},{"key":"false","value":{"kind":"id","name":"href"}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"loading"}},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["disabled","href","loading","pending"]}},{"kind":"attribute","name":"target","expression":"target","expressionPlan":{"source":"target","ast":{"kind":"id","name":"target"},"dependencies":["target"]}},{"kind":"attribute","name":"rel","expression":"rel","expressionPlan":{"source":"rel","ast":{"kind":"id","name":"rel"},"dependencies":["rel"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[concat(disabled or loading or pending)]","expressionPlan":{"source":"{ true: 'true', false: null }[concat(disabled or loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"disabled"},"right":{"kind":"id","name":"loading"}},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["disabled","loading","pending"]}},{"kind":"attribute","name":"aria-busy","expression":"loading or pending","expressionPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}},{"kind":"attribute","name":"tabindex","expression":"{ true: '0', false: null }[concat((loading or pending) and not disabled)]","expressionPlan":{"source":"{ true: '0', false: null }[concat((loading or pending) and not disabled)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"0"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"and","left":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"right":{"kind":"unary","op":"not","operand":{"kind":"id","name":"disabled"}}}]}},"dependencies":["disabled","loading","pending"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"spinner-wrap"}],"children":[{"kind":"element","name":"ui-spinner","attributes":[{"kind":"literal","name":"size","value":"sm"}],"children":[]}],"flow":{"kind":"if","test":"loading or pending","testPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}},{"kind":"slot"}],"flow":{"kind":"when","test":"as = 'a'","testPlan":{"source":"as = 'a'","ast":{"kind":"binary","op":"=","left":{"kind":"id","name":"as"},"right":{"kind":"literal","value":"a"}},"dependencies":["as"]}}},{"kind":"element","name":"button","attributes":[{"kind":"attribute","name":"type","expression":"type","expressionPlan":{"source":"type","ast":{"kind":"id","name":"type"},"dependencies":["type"]}},{"kind":"attribute","name":"disabled","expression":"disabled","expressionPlan":{"source":"disabled","ast":{"kind":"id","name":"disabled"},"dependencies":["disabled"]}},{"kind":"attribute","name":"aria-disabled","expression":"{ true: 'true', false: null }[concat(loading or pending)]","expressionPlan":{"source":"{ true: 'true', false: null }[concat(loading or pending)]","ast":{"kind":"index","object":{"kind":"object","pairs":[{"key":"true","value":{"kind":"literal","value":"true"}},{"key":"false","value":{"kind":"literal","value":null}}]},"index":{"kind":"call","fn":"concat","args":[{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}}]}},"dependencies":["loading","pending"]}},{"kind":"attribute","name":"aria-busy","expression":"loading or pending","expressionPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}],"children":[{"kind":"element","name":"span","attributes":[{"kind":"literal","name":"class","value":"spinner-wrap"}],"children":[{"kind":"element","name":"ui-spinner","attributes":[{"kind":"literal","name":"size","value":"sm"}],"children":[]}],"flow":{"kind":"if","test":"loading or pending","testPlan":{"source":"loading or pending","ast":{"kind":"binary","op":"or","left":{"kind":"id","name":"loading"},"right":{"kind":"id","name":"pending"}},"dependencies":["loading","pending"]}}},{"kind":"slot"}],"flow":{"kind":"else"}}],"flow":{"kind":"match"}},"declarations":[],"root":{"kind":"native","element":"button","choices":["a","button"]}},source:{file:import.meta.url},css:""};
7
7
 
8
8
  export function createUiButton(options = {}) {
9
9
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
@@ -24,21 +24,51 @@ export function createUiButton(options = {}) {
24
24
  else element.setAttribute("rel", String(value1));
25
25
  element.setAttribute("data-component", "ui-button");
26
26
  const element0 = document.createElement("span");
27
- element0.setAttribute("class", "spinner-wrap");
27
+ element0.setAttribute("class", "card-icon");
28
28
  const element1 = document.createElement("ui-spinner");
29
29
  element1.setAttribute("size", "sm");
30
30
  element0.append(element1);
31
+ const element2 = document.createElement("template");
32
+ if (slots["icon"] ?? [].length > 0) {
33
+ for (const child of slots["icon"] ?? []) {
34
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
35
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
36
+ projected.push([node, "icon"]);
37
+ element2.append(node);
38
+ }
39
+ } else {
40
+ }
41
+ element0.append(element2);
31
42
  element.append(element0);
43
+ const element3 = document.createElement("span");
44
+ element3.setAttribute("class", "card-content");
32
45
  if (children.length > 0) {
33
46
  for (const child of children) {
34
47
  const node = typeof child === "string" ? document.createTextNode(child) : child;
35
48
  if (node.nodeType === 1) node.setAttribute("data-slotted", "");
36
49
  projected.push([node, ""]);
37
- element.append(node);
50
+ element3.append(node);
38
51
  }
39
52
  } else {
40
53
  }
41
- } else {
54
+ element.append(element3);
55
+ const element4 = document.createElement("span");
56
+ element4.setAttribute("class", "card-action");
57
+ if (slots["action"] ?? [].length > 0) {
58
+ for (const child of slots["action"] ?? []) {
59
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
60
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
61
+ projected.push([node, "action"]);
62
+ element4.append(node);
63
+ }
64
+ } else {
65
+ const element5 = document.createElement("ui-icon");
66
+ element5.setAttribute("name", "chevron-right");
67
+ element5.setAttribute("aria-hidden", "true");
68
+ element4.append(element5);
69
+ }
70
+ element.append(element4);
71
+ } else if (root === 1) {
42
72
  element = document.createElement("button");
43
73
  for (const [name, value] of Object.entries(attributes)) {
44
74
  if (value === null || value === undefined || value === false) continue;
@@ -51,12 +81,98 @@ export function createUiButton(options = {}) {
51
81
  if (value3 === true) element.setAttribute("disabled", "");
52
82
  else element.removeAttribute("disabled");
53
83
  element.setAttribute("data-component", "ui-button");
54
- const element2 = document.createElement("span");
55
- element2.setAttribute("class", "spinner-wrap");
56
- const element3 = document.createElement("ui-spinner");
57
- element3.setAttribute("size", "sm");
58
- element2.append(element3);
59
- element.append(element2);
84
+ const element6 = document.createElement("span");
85
+ element6.setAttribute("class", "card-icon");
86
+ const element7 = document.createElement("ui-spinner");
87
+ element7.setAttribute("size", "sm");
88
+ element6.append(element7);
89
+ const element8 = document.createElement("template");
90
+ if (slots["icon"] ?? [].length > 0) {
91
+ for (const child of slots["icon"] ?? []) {
92
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
93
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
94
+ projected.push([node, "icon"]);
95
+ element8.append(node);
96
+ }
97
+ } else {
98
+ }
99
+ element6.append(element8);
100
+ element.append(element6);
101
+ const element9 = document.createElement("span");
102
+ element9.setAttribute("class", "card-content");
103
+ if (children.length > 0) {
104
+ for (const child of children) {
105
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
106
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
107
+ projected.push([node, ""]);
108
+ element9.append(node);
109
+ }
110
+ } else {
111
+ }
112
+ element.append(element9);
113
+ const element10 = document.createElement("span");
114
+ element10.setAttribute("class", "card-action");
115
+ if (slots["action"] ?? [].length > 0) {
116
+ for (const child of slots["action"] ?? []) {
117
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
118
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
119
+ projected.push([node, "action"]);
120
+ element10.append(node);
121
+ }
122
+ } else {
123
+ const element11 = document.createElement("ui-icon");
124
+ element11.setAttribute("name", "chevron-right");
125
+ element11.setAttribute("aria-hidden", "true");
126
+ element10.append(element11);
127
+ }
128
+ element.append(element10);
129
+ } else if (root === 2) {
130
+ element = document.createElement("a");
131
+ for (const [name, value] of Object.entries(attributes)) {
132
+ if (value === null || value === undefined || value === false) continue;
133
+ element.setAttribute(name, value === true ? "" : String(value));
134
+ }
135
+ const value4 = componentProps["target"] === undefined ? null : componentProps["target"];
136
+ if (value4 === null || value4 === undefined) element.removeAttribute("target");
137
+ else element.setAttribute("target", String(value4));
138
+ const value5 = componentProps["rel"] === undefined ? null : componentProps["rel"];
139
+ if (value5 === null || value5 === undefined) element.removeAttribute("rel");
140
+ else element.setAttribute("rel", String(value5));
141
+ element.setAttribute("data-component", "ui-button");
142
+ const element12 = document.createElement("span");
143
+ element12.setAttribute("class", "spinner-wrap");
144
+ const element13 = document.createElement("ui-spinner");
145
+ element13.setAttribute("size", "sm");
146
+ element12.append(element13);
147
+ element.append(element12);
148
+ if (children.length > 0) {
149
+ for (const child of children) {
150
+ const node = typeof child === "string" ? document.createTextNode(child) : child;
151
+ if (node.nodeType === 1) node.setAttribute("data-slotted", "");
152
+ projected.push([node, ""]);
153
+ element.append(node);
154
+ }
155
+ } else {
156
+ }
157
+ } else {
158
+ element = document.createElement("button");
159
+ for (const [name, value] of Object.entries(attributes)) {
160
+ if (value === null || value === undefined || value === false) continue;
161
+ element.setAttribute(name, value === true ? "" : String(value));
162
+ }
163
+ const value6 = componentProps["type"] === undefined ? "button" : componentProps["type"];
164
+ if (value6 === null || value6 === undefined) element.removeAttribute("type");
165
+ else element.setAttribute("type", String(value6));
166
+ const value7 = componentProps["disabled"] === undefined ? false : componentProps["disabled"];
167
+ if (value7 === true) element.setAttribute("disabled", "");
168
+ else element.removeAttribute("disabled");
169
+ element.setAttribute("data-component", "ui-button");
170
+ const element14 = document.createElement("span");
171
+ element14.setAttribute("class", "spinner-wrap");
172
+ const element15 = document.createElement("ui-spinner");
173
+ element15.setAttribute("size", "sm");
174
+ element14.append(element15);
175
+ element.append(element14);
60
176
  if (children.length > 0) {
61
177
  for (const child of children) {
62
178
  const node = typeof child === "string" ? document.createTextNode(child) : child;
@@ -6,6 +6,7 @@ export interface UiSeparatorElement extends HTMLHRElement {
6
6
  removeEventListener<K extends keyof UiSeparatorEventMap>(type: K, listener: (this: UiSeparatorElement, event: UiSeparatorEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
7
7
  }
8
8
  export interface UiSeparatorProps {
9
+ emphasis?: "normal" | "strong" | null;
9
10
  orientation?: "horizontal" | "vertical" | null;
10
11
  selectable?: boolean | null;
11
12
  selected?: boolean | null;
@@ -5,19 +5,21 @@ import "../styles/ui-separator.css";
5
5
  export function createUiSeparator(options = {}) {
6
6
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;
7
7
  const projected = [];
8
- const prop0 = componentProps["orientation"] === undefined ? "horizontal" : componentProps["orientation"];
9
- const prop1 = componentProps["selectable"] === undefined ? false : componentProps["selectable"];
10
- const prop2 = componentProps["selected"] === undefined ? false : componentProps["selected"];
8
+ const prop0 = componentProps["emphasis"] === undefined ? "normal" : componentProps["emphasis"];
9
+ const prop1 = componentProps["orientation"] === undefined ? "horizontal" : componentProps["orientation"];
10
+ const prop2 = componentProps["selectable"] === undefined ? false : componentProps["selectable"];
11
+ const prop3 = componentProps["selected"] === undefined ? false : componentProps["selected"];
11
12
  const element = document.createElement("hr");
12
13
  for (const [name, value] of Object.entries(attributes)) {
13
14
  if (value === null || value === undefined || value === false) continue;
14
15
  element.setAttribute(name, value === true ? "" : String(value));
15
16
  }
16
- const value0 = prop0;
17
+ const value0 = prop1;
17
18
  if (value0 === null || value0 === undefined) element.removeAttribute("aria-orientation");
18
19
  else element.setAttribute("aria-orientation", String(value0));
19
20
  element.setAttribute("data-component", "ui-separator");
20
21
  manageGeneratedProps(element, [
22
+ { name: "emphasis", attribute: "data-emphasis", value: componentProps["emphasis"], default: "normal", type: ["normal","strong"], required: false },
21
23
  { name: "orientation", attribute: "data-orientation", value: componentProps["orientation"], default: "horizontal", type: ["horizontal","vertical"], required: false },
22
24
  { name: "selectable", attribute: "data-selectable", value: componentProps["selectable"], default: false, type: "boolean", required: false },
23
25
  { name: "selected", attribute: "data-selected", value: componentProps["selected"], default: false, type: "boolean", required: false },
package/vue/UiButton.d.ts CHANGED
@@ -1,9 +1,21 @@
1
1
  import type { PropType } from 'vue';
2
- declare var __VLS_6: {}, __VLS_13: {};
2
+ declare var __VLS_6: {}, __VLS_8: {}, __VLS_10: {}, __VLS_22: {}, __VLS_24: {}, __VLS_26: {}, __VLS_38: {}, __VLS_45: {};
3
3
  type __VLS_Slots = {} & {
4
- default?: (props: typeof __VLS_6) => any;
4
+ icon?: (props: typeof __VLS_6) => any;
5
5
  } & {
6
- default?: (props: typeof __VLS_13) => any;
6
+ default?: (props: typeof __VLS_8) => any;
7
+ } & {
8
+ action?: (props: typeof __VLS_10) => any;
9
+ } & {
10
+ icon?: (props: typeof __VLS_22) => any;
11
+ } & {
12
+ default?: (props: typeof __VLS_24) => any;
13
+ } & {
14
+ action?: (props: typeof __VLS_26) => any;
15
+ } & {
16
+ default?: (props: typeof __VLS_38) => any;
17
+ } & {
18
+ default?: (props: typeof __VLS_45) => any;
7
19
  };
8
20
  declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
9
21
  align: {
@@ -59,7 +71,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
59
71
  default: string;
60
72
  };
61
73
  variant: {
62
- type: PropType<"outline" | "solid" | "danger" | "ghost" | "link" | null>;
74
+ type: PropType<"outline" | "solid" | "danger" | "ghost" | "link" | "card" | null>;
63
75
  default: string;
64
76
  };
65
77
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -116,7 +128,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
116
128
  default: string;
117
129
  };
118
130
  variant: {
119
- type: PropType<"outline" | "solid" | "danger" | "ghost" | "link" | null>;
131
+ type: PropType<"outline" | "solid" | "danger" | "ghost" | "link" | "card" | null>;
120
132
  default: string;
121
133
  };
122
134
  }>> & Readonly<{}>, {
@@ -124,7 +136,7 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
124
136
  shape: "pill" | "rounded" | null;
125
137
  size: "xs" | "sm" | "md" | "lg" | null;
126
138
  tone: "info" | "neutral" | "accent" | "success" | "warning" | "danger" | null;
127
- variant: "link" | "danger" | "solid" | "outline" | "ghost" | null;
139
+ variant: "link" | "danger" | "solid" | "outline" | "ghost" | "card" | null;
128
140
  align: "center" | "start" | null;
129
141
  as: "a" | "button" | null;
130
142
  disabled: boolean | null;