@threadlabs/looma 0.25.0 → 0.25.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.
@@ -282,6 +282,30 @@ useComponentHost(() => import('../components/ui-textarea/ui-textarea.js'), {
282
282
 
283
283
  <style scoped>
284
284
  /* This component's hooks style the element they are set on, and never a nested one. */
285
+ @property --ui-textarea-border-width {
286
+ syntax: "*";
287
+ inherits: false;
288
+ }
289
+ @property --ui-textarea-border {
290
+ syntax: "*";
291
+ inherits: false;
292
+ }
293
+ @property --ui-textarea-border-hover {
294
+ syntax: "*";
295
+ inherits: false;
296
+ }
297
+ @property --ui-textarea-focus-border {
298
+ syntax: "*";
299
+ inherits: false;
300
+ }
301
+ @property --ui-textarea-focus-outline {
302
+ syntax: "*";
303
+ inherits: false;
304
+ }
305
+ @property --ui-textarea-surface {
306
+ syntax: "*";
307
+ inherits: false;
308
+ }
285
309
  @property --ui-textarea-focus-shadow {
286
310
  syntax: "*";
287
311
  inherits: false;
@@ -302,6 +326,10 @@ useComponentHost(() => import('../components/ui-textarea/ui-textarea.js'), {
302
326
  syntax: "*";
303
327
  inherits: false;
304
328
  }
329
+ @property --ui-textarea-padding-inline-end {
330
+ syntax: "*";
331
+ inherits: false;
332
+ }
305
333
 
306
334
  [data-component~="ui-textarea"] {
307
335
  box-sizing: border-box;
@@ -312,15 +340,35 @@ useComponentHost(() => import('../components/ui-textarea/ui-textarea.js'), {
312
340
  margin: 0;
313
341
  --_padding-block: var(--ui-space-2);
314
342
  padding: var(--ui-space-2) var(--ui-space-3);
343
+ padding-inline-end: var(
344
+ --ui-textarea-padding-inline-end,
345
+ var(--_ui-default-textarea-padding-inline-end, var(--ui-space-3))
346
+ );
315
347
  appearance: none;
316
348
  resize: vertical;
317
- border: var(--ui-border-width) solid var(--ui-control-border, var(--ui-border-strong));
318
- border-radius: var(--ui-textarea-radius, var(--ui-field-radius, var(--ui-radius-md)));
319
- background: var(--ui-control-surface, var(--ui-surface-elevated));
349
+ border: var(
350
+ --ui-textarea-border-width,
351
+ var(--_ui-default-textarea-border-width, var(--ui-border-width))
352
+ ) solid
353
+ var(
354
+ --ui-textarea-border,
355
+ var(--_ui-default-textarea-border, var(--ui-control-border, var(--ui-border-strong)))
356
+ );
357
+ border-radius: var(
358
+ --ui-textarea-radius,
359
+ var(--_ui-default-textarea-radius, var(--ui-field-radius, var(--ui-radius-md)))
360
+ );
361
+ background: var(
362
+ --ui-textarea-surface,
363
+ var(--_ui-default-textarea-surface, var(--ui-control-surface, var(--ui-surface-elevated)))
364
+ );
320
365
  color: var(--ui-text-primary);
321
366
  font: inherit;
322
367
  line-height: var(--ui-line-height-md);
323
- box-shadow: var(--ui-textarea-shadow, var(--ui-control-inset));
368
+ box-shadow: var(
369
+ --ui-textarea-shadow,
370
+ var(--_ui-default-textarea-shadow, var(--ui-control-inset))
371
+ );
324
372
  transition:
325
373
  border-color var(--ui-motion-fast) var(--ui-motion-ease),
326
374
  box-shadow var(--ui-motion-fast) var(--ui-motion-ease),
@@ -339,33 +387,54 @@ useComponentHost(() => import('../components/ui-textarea/ui-textarea.js'), {
339
387
  }
340
388
 
341
389
  [data-component~="ui-textarea"]:hover:not(:focus):not(:disabled):not(:read-only):not([aria-invalid="true"]):not(:is(:user-invalid, [data-user-invalid])) {
342
- border-color: var(--ui-control-border-hover, var(--ui-text-secondary));
390
+ border-color: var(
391
+ --ui-textarea-border-hover,
392
+ var(
393
+ --_ui-default-textarea-border-hover,
394
+ var(--ui-control-border-hover, var(--ui-text-secondary))
395
+ )
396
+ );
343
397
  }
344
398
 
345
399
  [data-component~="ui-textarea"]:focus-visible {
346
- border-color: var(--ui-control-focus, var(--ui-accent-solid));
347
- outline: none;
400
+ border-color: var(
401
+ --ui-textarea-focus-border,
402
+ var(--_ui-default-textarea-focus-border, var(--ui-control-focus, var(--ui-accent-solid)))
403
+ );
404
+ outline: var(--ui-textarea-focus-outline, var(--_ui-default-textarea-focus-outline, none));
348
405
  box-shadow: var(
349
406
  --ui-textarea-focus-shadow,
350
- var(--ui-control-inset),
351
- var(--ui-control-focus-halo-shadow)
407
+ var(
408
+ --_ui-default-textarea-focus-shadow,
409
+ var(--ui-control-inset),
410
+ var(--ui-control-focus-halo-shadow)
411
+ )
352
412
  );
353
413
  }
354
414
 
355
415
  /* The app's invalid flag, or the browser's own verdict once the user has left an invalid field. */
356
416
  [data-component~="ui-textarea"][aria-invalid="true"],
357
417
  [data-component~="ui-textarea"]:is(:user-invalid, [data-user-invalid]) {
358
- border-color: var(--ui-textarea-invalid-border, var(--ui-field-danger, var(--ui-danger-solid)));
418
+ border-color: var(
419
+ --ui-textarea-invalid-border,
420
+ var(--_ui-default-textarea-invalid-border, var(--ui-field-danger, var(--ui-danger-solid)))
421
+ );
359
422
  }
360
423
 
361
424
  [data-component~="ui-textarea"]:is([aria-invalid="true"], :is(:user-invalid, [data-user-invalid])):focus-visible {
362
425
  box-shadow: var(
363
426
  --ui-textarea-invalid-focus-shadow,
364
- var(--ui-control-inset),
365
- 0 0 0 calc(var(--ui-focus-width) * 1.5) color-mix(
366
- in srgb,
367
- var(--ui-textarea-invalid-border, var(--ui-field-danger, var(--ui-danger-solid))) 22%,
368
- transparent
427
+ var(
428
+ --_ui-default-textarea-invalid-focus-shadow,
429
+ var(--ui-control-inset),
430
+ 0 0 0 calc(var(--ui-focus-width) * 1.5) color-mix(
431
+ in srgb,
432
+ var(
433
+ --ui-textarea-invalid-border,
434
+ var(--_ui-default-textarea-invalid-border, var(--ui-field-danger, var(--ui-danger-solid)))
435
+ ) 22%,
436
+ transparent
437
+ )
369
438
  )
370
439
  );
371
440
  }
@@ -380,12 +449,20 @@ useComponentHost(() => import('../components/ui-textarea/ui-textarea.js'), {
380
449
  [data-component~="ui-textarea"][data-ui-textarea-state~="size=sm"] {
381
450
  --_padding-block: var(--ui-space-1);
382
451
  padding: var(--ui-space-1) var(--ui-space-2);
452
+ padding-inline-end: var(
453
+ --ui-textarea-padding-inline-end,
454
+ var(--_ui-default-textarea-padding-inline-end, var(--ui-space-2))
455
+ );
383
456
  font-size: var(--ui-font-size-sm);
384
457
  }
385
458
 
386
459
  [data-component~="ui-textarea"][data-ui-textarea-state~="size=lg"] {
387
460
  --_padding-block: var(--ui-space-3);
388
461
  padding: var(--ui-space-3) var(--ui-space-4);
462
+ padding-inline-end: var(
463
+ --ui-textarea-padding-inline-end,
464
+ var(--_ui-default-textarea-padding-inline-end, var(--ui-space-4))
465
+ );
389
466
  font-size: var(--ui-font-size-md);
390
467
  }
391
468
 
@@ -4,7 +4,9 @@ import { a as vPropValidity, n as checkedProp, r as propValidityState } from "./
4
4
  import { computed, createElementBlock, createElementVNode, defineComponent, getCurrentInstance, mergeProps, openBlock, ref, renderSlot, unref, watchSyncEffect, withDirectives } from "vue";
5
5
  //#region .build/vue/UiInputGroup.vue?vue&type=script&setup=true&lang.ts
6
6
  var _hoisted_1 = [
7
+ "data-action-position",
7
8
  "data-disabled",
9
+ "data-multiline",
8
10
  "data-prefix-kind",
9
11
  "data-ui-input-group-state"
10
12
  ];
@@ -18,10 +20,18 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
18
20
  inheritAttrs: false,
19
21
  __name: "UiInputGroup",
20
22
  props: {
23
+ actionPosition: {
24
+ type: null,
25
+ default: "below"
26
+ },
21
27
  disabled: {
22
28
  type: null,
23
29
  default: false
24
30
  },
31
+ multiline: {
32
+ type: null,
33
+ default: false
34
+ },
25
35
  prefixKind: {
26
36
  type: null,
27
37
  default: "text"
@@ -29,6 +39,17 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
29
39
  },
30
40
  setup(__props) {
31
41
  const propValidityContract = { props: {
42
+ actionPosition: {
43
+ type: {
44
+ kind: "terminal",
45
+ name: "keyword"
46
+ },
47
+ required: false,
48
+ target: { attribute: "actionposition" },
49
+ description: "In a multiline group, below keeps the action under the text. top-end places it inside the textarea at its upper end and reserves text padding for its\n measured width.",
50
+ values: ["below", "top-end"],
51
+ default: "below"
52
+ },
32
53
  disabled: {
33
54
  type: {
34
55
  kind: "terminal",
@@ -39,6 +60,16 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
39
60
  description: "Fades the group's framing to match a disabled input inside it. Disable the input itself too.",
40
61
  default: false
41
62
  },
63
+ multiline: {
64
+ type: {
65
+ kind: "terminal",
66
+ name: "boolean"
67
+ },
68
+ required: false,
69
+ target: { attribute: "multiline" },
70
+ description: "Groups a Textarea with an action below its text inside the shared frame.",
71
+ default: false
72
+ },
42
73
  prefixKind: {
43
74
  type: {
44
75
  kind: "terminal",
@@ -53,14 +84,24 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
53
84
  } };
54
85
  const props = __props;
55
86
  const acceptedProps = {
87
+ actionPosition: "below",
56
88
  disabled: false,
89
+ multiline: false,
57
90
  prefixKind: "text"
58
91
  };
59
92
  const checkedProps = computed(() => ({
93
+ actionPosition: checkedProp(props["actionPosition"], {
94
+ kind: "terminal",
95
+ name: "keyword"
96
+ }, false, "actionPosition", acceptedProps),
60
97
  disabled: checkedProp(props["disabled"], {
61
98
  kind: "terminal",
62
99
  name: "boolean"
63
100
  }, false, "disabled", acceptedProps),
101
+ multiline: checkedProp(props["multiline"], {
102
+ kind: "terminal",
103
+ name: "boolean"
104
+ }, false, "multiline", acceptedProps),
64
105
  prefixKind: checkedProp(props["prefixKind"], {
65
106
  kind: "terminal",
66
107
  name: "keyword"
@@ -96,7 +137,10 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
96
137
  const hostState = computed(() => [
97
138
  checkedProps.value.disabled && "disabled",
98
139
  checkedProps.value.prefixKind && "prefixKind",
99
- checkedProps.value.prefixKind != null && `prefixKind=${encodeURIComponent(checkedProps.value.prefixKind)}`
140
+ checkedProps.value.prefixKind != null && `prefixKind=${encodeURIComponent(checkedProps.value.prefixKind)}`,
141
+ checkedProps.value.multiline && "multiline",
142
+ checkedProps.value.actionPosition && "actionPosition",
143
+ checkedProps.value.actionPosition != null && `actionPosition=${encodeURIComponent(checkedProps.value.actionPosition)}`
100
144
  ].filter(Boolean).join(" "));
101
145
  const dispatch = createDispatch(root);
102
146
  useComponentHost(() => import("@threadlabs/looma/components/ui-input-group/ui-input-group.js"), {
@@ -112,7 +156,12 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
112
156
  const kebab = name.replace(/[A-Z]/g, (letter) => "-" + letter.toLowerCase());
113
157
  return incoming !== null && incoming !== void 0 ? incoming[name] ?? incoming[kebab] ?? null : null;
114
158
  },
115
- propNames: ["disabled", "prefixKind"],
159
+ propNames: [
160
+ "actionPosition",
161
+ "disabled",
162
+ "multiline",
163
+ "prefixKind"
164
+ ],
116
165
  propValidity: (name) => propValidityState({
117
166
  contract: propValidityContract,
118
167
  values: { ...props }
@@ -120,7 +169,9 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
120
169
  });
121
170
  return (_ctx, _cache) => {
122
171
  return withDirectives((openBlock(), createElementBlock("div", mergeProps({ "data-component": "ui-input-group" }, nativeAttrs(_ctx.$attrs), {
172
+ "data-action-position": reflectedProp("actionPosition", "action-position", checkedProps.value.actionPosition, void 0, false),
123
173
  "data-disabled": reflectedProp("disabled", "disabled", checkedProps.value.disabled, void 0, false),
174
+ "data-multiline": reflectedProp("multiline", "multiline", checkedProps.value.multiline, void 0, false),
124
175
  "data-prefix-kind": reflectedProp("prefixKind", "prefix-kind", checkedProps.value.prefixKind, void 0, false),
125
176
  "data-ui-input-group-state": hostState.value || void 0,
126
177
  ref_key: "root",
@@ -136,6 +187,6 @@ var UiInputGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @_
136
187
  }]]);
137
188
  };
138
189
  }
139
- }), [["__scopeId", "data-v-45a11c70"]]);
190
+ }), [["__scopeId", "data-v-57e02424"]]);
140
191
  //#endregion
141
192
  export { UiInputGroup_default as t };
@@ -295,6 +295,6 @@ var UiTextarea_default = /*#__PURE__*/ _plugin_vue_export_helper_default(/* @__P
295
295
  }]]);
296
296
  };
297
297
  }
298
- }), [["__scopeId", "data-v-ce29cce2"]]);
298
+ }), [["__scopeId", "data-v-f5b6ae17"]]);
299
299
  //#endregion
300
300
  export { UiTextarea_default as t };