@threadlabs/looma 0.52.1 → 0.52.2

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/docs/catalog.json CHANGED
@@ -752,7 +752,7 @@
752
752
  ],
753
753
  "schemaVersion": 1,
754
754
  "package": "@threadlabs/looma",
755
- "version": "0.52.1",
755
+ "version": "0.52.2",
756
756
  "groups": [
757
757
  {
758
758
  "id": "layout",
@@ -6161,7 +6161,7 @@
6161
6161
  "tag": "ui-card",
6162
6162
  "package": "@threadlabs/looma",
6163
6163
  "root": "div",
6164
- "description": "A surface that groups content with shared spacing and corners. Choose outlined, subtle or elevated; standard or expressive treatment independently follows the theme's material. Tones change colour without changing geometry. All slots are optional; content uses the default slot. Omit the header to keep the title and description together in the body. Use ActionBar in the actions slot, with the main action in its primary slot. CardGroup aligns these regions with native subgrid; ordinary cards keep their stacked layout.",
6164
+ "description": "A surface that groups content with shared spacing and corners. Choose outlined, subtle, elevated or placeholder; placeholder marks an empty content area with muted text and a dashed border. Standard or expressive treatment independently follows the theme's material. Tones change colour without changing geometry. All slots are optional; content uses the default slot. Omit the header to keep the title and description together in the body. Use ActionBar in the actions slot, with the main action in its primary slot. CardGroup aligns these regions with native subgrid; ordinary cards keep their stacked layout.",
6165
6165
  "designTokens": {
6166
6166
  "sources": [
6167
6167
  "packages/looma/src/components/ui-card/ui-card.html"
@@ -6303,6 +6303,9 @@
6303
6303
  "0"
6304
6304
  ]
6305
6305
  },
6306
+ {
6307
+ "name": "--ui-text-muted"
6308
+ },
6306
6309
  {
6307
6310
  "name": "--ui-text-primary"
6308
6311
  },
@@ -6419,7 +6422,7 @@
6419
6422
  {
6420
6423
  "name": "variant",
6421
6424
  "property": "variant",
6422
- "description": "The surface. outlined is a bordered panel on the page; subtle is a quiet filled one with no border, for supporting details set apart from the flow; elevated adds a subtle lift above the page, for a view's one card, such as sign-in. Treatment independently controls decorative material.",
6425
+ "description": "The surface. outlined is a bordered panel on the page; subtle is a quiet filled one with no border, for supporting details set apart from the flow; elevated adds a subtle lift above the page, for a view's one card, such as sign-in. placeholder marks an empty content area with a quiet dashed border and muted text, keeping the outlined card's dimensions. Treatment independently controls decorative material.",
6423
6426
  "type": "keyword",
6424
6427
  "valueType": {
6425
6428
  "kind": "terminal",
@@ -6429,7 +6432,8 @@
6429
6432
  "options": [
6430
6433
  "outlined",
6431
6434
  "subtle",
6432
- "elevated"
6435
+ "elevated",
6436
+ "placeholder"
6433
6437
  ]
6434
6438
  }
6435
6439
  ],
@@ -6504,13 +6508,14 @@
6504
6508
  },
6505
6509
  {
6506
6510
  "name": "variant",
6507
- "description": "The surface. outlined is a bordered panel on the page; subtle is a quiet filled one with no border, for supporting details set apart from the flow; elevated adds a subtle lift above the page, for a view's one card, such as sign-in. Treatment independently controls decorative material.",
6508
- "type": "\"outlined\" | \"subtle\" | \"elevated\"",
6511
+ "description": "The surface. outlined is a bordered panel on the page; subtle is a quiet filled one with no border, for supporting details set apart from the flow; elevated adds a subtle lift above the page, for a view's one card, such as sign-in. placeholder marks an empty content area with a quiet dashed border and muted text, keeping the outlined card's dimensions. Treatment independently controls decorative material.",
6512
+ "type": "\"outlined\" | \"subtle\" | \"elevated\" | \"placeholder\"",
6509
6513
  "default": "outlined",
6510
6514
  "options": [
6511
6515
  "outlined",
6512
6516
  "subtle",
6513
- "elevated"
6517
+ "elevated",
6518
+ "placeholder"
6514
6519
  ]
6515
6520
  }
6516
6521
  ],
@@ -6557,8 +6562,8 @@
6557
6562
  "id": "@threadlabs/looma/ui-card/01-variants",
6558
6563
  "name": "01-variants",
6559
6564
  "title": "Variants",
6560
- "description": "outlined groups content on the page, subtle sets supporting details apart, and elevated floats a view's one card.",
6561
- "markup": "<ui-stack gap=\"m\">\n <ui-card><ui-text weight=\"semibold\">Outlined</ui-text><ui-text tone=\"secondary\">A bordered panel on the page.</ui-text></ui-card>\n <ui-card variant=\"subtle\" padding=\"sm\"><ui-text tone=\"secondary\" size=\"sm\">Subtle: supporting details, set apart.</ui-text></ui-card>\n <ui-card variant=\"elevated\" padding=\"lg\"><ui-text weight=\"semibold\">Elevated</ui-text><ui-text tone=\"secondary\"\n >The one card of a view, such as sign-in.</ui-text></ui-card>\n</ui-stack>",
6565
+ "description": "outlined groups content on the page, subtle sets supporting details apart, elevated floats a view's one card, and placeholder marks an empty content area.",
6566
+ "markup": "<ui-stack gap=\"m\">\n <ui-card><ui-text weight=\"semibold\">Outlined</ui-text><ui-text tone=\"secondary\">A bordered panel on the page.</ui-text></ui-card>\n <ui-card variant=\"subtle\" padding=\"sm\"><ui-text tone=\"secondary\" size=\"sm\">Subtle: supporting details, set apart.</ui-text></ui-card>\n <ui-card variant=\"elevated\" padding=\"lg\"><ui-text weight=\"semibold\">Elevated</ui-text><ui-text tone=\"secondary\"\n >The one card of a view, such as sign-in.</ui-text></ui-card>\n <ui-card variant=\"placeholder\"><ui-text weight=\"semibold\">No content yet</ui-text><ui-text>This area is empty.</ui-text></ui-card>\n</ui-stack>",
6562
6567
  "resizable": false,
6563
6568
  "bindings": "",
6564
6569
  "frameworks": {}
@@ -2973,6 +2973,15 @@
2973
2973
  box-shadow var(--ui-motion-fast) var(--ui-motion-ease);
2974
2974
  }
2975
2975
 
2976
+ /* A separately named mark has no text line to align with. Its row owns that alignment. */
2977
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component]))):has(.label:empty):has(.description:empty) .text {
2978
+ display: none !important;
2979
+ }
2980
+
2981
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component]))):has(.label:empty):has(.description:empty) input {
2982
+ margin: 0 !important;
2983
+ }
2984
+
2976
2985
  input:where(:not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]))::after {
2977
2986
  content: "";
2978
2987
  position: absolute !important;
@@ -3118,6 +3127,11 @@
3118
3127
  padding-block: max(0px, calc((var(--_row) - max(var(--_line), var(--_ui-checkbox-size, 1.125rem))) / 2)) !important;
3119
3128
  }
3120
3129
 
3130
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component])))[data-ui-checkbox-state~="size=sm"]:has(.label:empty):has(.description:empty),
3131
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component])))[data-ui-checkbox-state~="size=lg"]:has(.label:empty):has(.description:empty) {
3132
+ padding-block: max(0px, calc((var(--_row) - var(--_ui-checkbox-size, 1.125rem)) / 2)) !important;
3133
+ }
3134
+
3121
3135
  /* A component that sets its display still honours the hidden attribute on its root. */
3122
3136
  :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component])))[hidden] {
3123
3137
  display: none !important;
@@ -3126,6 +3140,8 @@
3126
3140
  @scope (:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component]))) to (:is([component]:not(template), [data-component]:not([component]))) {
3127
3141
  /* The label, and under it an optional line saying what the choice means. */
3128
3142
 
3143
+ /* A separately named mark has no text line to align with. Its row owns that alignment. */
3144
+
3129
3145
  /* The SVG's painted bounds are centred in its viewBox, including its round stroke.
3130
3146
  Centre that box directly; rotated border boxes do not centre the visible check. */
3131
3147
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@threadlabs/looma",
3
- "version": "0.52.1",
3
+ "version": "0.52.2",
4
4
  "type": "module",
5
5
  "description": "HTML Next UI components, native DOM support and design tokens.",
6
6
  "license": "MIT",
@@ -77,6 +77,12 @@
77
77
  --_ui-card-surface: var(--ui-surface-muted);
78
78
  }
79
79
 
80
+ :scope:where(:is([component~="ui-card"]:not(template), [data-component~="ui-card"]:not([component])))[data-ui-card-state~="variant=placeholder"] {
81
+ border-style: dashed;
82
+ border-color: var(--ui-border-subtle);
83
+ --_ui-surface-text: var(--ui-text-muted);
84
+ }
85
+
80
86
  :scope:where(:is([component~="ui-card"]:not(template), [data-component~="ui-card"]:not([component])))[data-ui-card-state~="variant=elevated"] {
81
87
  --_ui-card-elevation: var(--ui-shadow-lg);
82
88
  border-color: var(--ui-border-subtle);
@@ -87,6 +87,15 @@
87
87
  box-shadow var(--ui-motion-fast) var(--ui-motion-ease);
88
88
  }
89
89
 
90
+ /* A separately named mark has no text line to align with. Its row owns that alignment. */
91
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component]))):has(.label:empty):has(.description:empty) .text {
92
+ display: none !important;
93
+ }
94
+
95
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component]))):has(.label:empty):has(.description:empty) input {
96
+ margin: 0 !important;
97
+ }
98
+
90
99
  input:where(:not(:is([component]:not(template), [data-component]:not([component])), [data-slotted]))::after {
91
100
  content: "";
92
101
  position: absolute !important;
@@ -232,6 +241,11 @@
232
241
  padding-block: max(0px, calc((var(--_row) - max(var(--_line), var(--_ui-checkbox-size, 1.125rem))) / 2)) !important;
233
242
  }
234
243
 
244
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component])))[data-ui-checkbox-state~="size=sm"]:has(.label:empty):has(.description:empty),
245
+ :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component])))[data-ui-checkbox-state~="size=lg"]:has(.label:empty):has(.description:empty) {
246
+ padding-block: max(0px, calc((var(--_row) - var(--_ui-checkbox-size, 1.125rem)) / 2)) !important;
247
+ }
248
+
235
249
  /* A component that sets its display still honours the hidden attribute on its root. */
236
250
  :scope:where(:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component])))[hidden] {
237
251
  display: none !important;
@@ -240,6 +254,8 @@
240
254
  @scope (:is([component~="ui-checkbox"]:not(template), [data-component~="ui-checkbox"]:not([component]))) to (:is([component]:not(template), [data-component]:not([component]))) {
241
255
  /* The label, and under it an optional line saying what the choice means. */
242
256
 
257
+ /* A separately named mark has no text line to align with. Its row owns that alignment. */
258
+
243
259
  /* The SVG's painted bounds are centred in its viewBox, including its round stroke.
244
260
  Centre that box directly; rotated border boxes do not centre the visible check. */
245
261
 
@@ -16,7 +16,7 @@ export interface UiCardProps {
16
16
  size?: "content" | "sm" | "md" | "lg" | null;
17
17
  tone?: "neutral" | "accent" | "accent-secondary" | "accent-tertiary" | "info" | "success" | "warning" | "danger" | null;
18
18
  treatment?: "standard" | "expressive" | null;
19
- variant?: "outlined" | "subtle" | "elevated" | null;
19
+ variant?: "outlined" | "subtle" | "elevated" | "placeholder" | null;
20
20
  attributes?: Readonly<Record<string, string | number | boolean | null | undefined>>;
21
21
  children?: readonly (string | Node)[];
22
22
  slots?: Readonly<Record<string, readonly (string | Node)[]>>;
package/vanilla/UiCard.js CHANGED
@@ -22,7 +22,7 @@ let P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15;
22
22
  const S = { n: [], t: [], f: import.meta.url, g: "ui-card", b: generatedInputs };
23
23
  const A = [["section",{},[],"",[],["data-ui-card-state","data-ui-card-prop-as","data-ui-card-prop-fill","data-ui-card-prop-padding","data-ui-card-prop-size","data-ui-card-prop-tone","data-ui-card-prop-treatment","data-ui-card-prop-variant"]],["article",{},[],"",[],["data-ui-card-state","data-ui-card-prop-as","data-ui-card-prop-fill","data-ui-card-prop-padding","data-ui-card-prop-size","data-ui-card-prop-tone","data-ui-card-prop-treatment","data-ui-card-prop-variant"]],["aside",{},[],"",[],["data-ui-card-state","data-ui-card-prop-as","data-ui-card-prop-fill","data-ui-card-prop-padding","data-ui-card-prop-size","data-ui-card-prop-tone","data-ui-card-prop-treatment","data-ui-card-prop-variant"]],["div",{},[],"",[],["data-ui-card-state","data-ui-card-prop-as","data-ui-card-prop-fill","data-ui-card-prop-padding","data-ui-card-prop-size","data-ui-card-prop-tone","data-ui-card-prop-treatment","data-ui-card-prop-variant"]]];
24
24
  const Q = [[],[],[],[]];
25
- const D = { g: "ui-card", props: { "as": { "required":false,"values":["div","section","article","aside"],"default":"div", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "fill": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "padding": { "required":false,"values":["xs","sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "size": { "required":false,"values":["content","sm","md","lg"],"default":"content", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "tone": { "required":false,"values":["neutral","accent","accent-secondary","accent-tertiary","info","success","warning","danger"],"default":"neutral", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "treatment": { "required":false,"values":["standard","expressive"],"default":"standard", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["outlined","subtle","elevated"],"default":"outlined", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
25
+ const D = { g: "ui-card", props: { "as": { "required":false,"values":["div","section","article","aside"],"default":"div", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "fill": { "required":false,"default":false, c: checkBoolean, t: "boolean", j: 0, m: "b" }, "padding": { "required":false,"values":["xs","sm","md","lg"],"default":"md", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "size": { "required":false,"values":["content","sm","md","lg"],"default":"content", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "tone": { "required":false,"values":["neutral","accent","accent-secondary","accent-tertiary","info","success","warning","danger"],"default":"neutral", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "treatment": { "required":false,"values":["standard","expressive"],"default":"standard", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] }, "variant": { "required":false,"values":["outlined","subtle","elevated","placeholder"],"default":"outlined", c: checkFormat("keyword", keywordFormat), t: "keyword", j: 0, m: ["p",formatOf(keywordFormat)] } } };
26
26
 
27
27
  export function createUiCard(options = {}, html) {
28
28
  const { attributes = {}, children = [], slots = {}, ...componentProps } = options;