@nilloq/ouds-web 0.1.6 → 0.1.7

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.
Files changed (113) hide show
  1. package/README.md +17 -115
  2. package/dist/{alert-bsnEmrzb.js → alert-B4w3fDHo.js} +2 -2
  3. package/dist/{alert-By364Om4.js → alert-Chns046l.js} +1 -1
  4. package/dist/alert.js +1 -1
  5. package/dist/{badge-fffoaFuZ.js → badge-CDpWg-AO.js} +1 -1
  6. package/dist/badge.js +1 -1
  7. package/dist/{button-BUziAVbu.js → button-rgIJZsYq.js} +1 -1
  8. package/dist/button.js +1 -1
  9. package/dist/checkbox-D7TFFuw3.js +196 -0
  10. package/dist/checkbox-DfYlHYR2.js +155 -0
  11. package/dist/checkbox.js +1 -1
  12. package/dist/chip-B3v4pWZD.js +92 -0
  13. package/dist/chip-DGfqitrQ.js +115 -0
  14. package/dist/chip.js +2 -0
  15. package/dist/{control-item-slots-BNXNsI1e.js → control-item-slots-BDoeNuk4.js} +5 -2
  16. package/dist/{control-item-slots-XV8Gjvf1.js → control-item-slots-Ddp7c8w8.js} +4 -1
  17. package/dist/elements-alert.js +1 -1
  18. package/dist/elements-badge.js +1 -1
  19. package/dist/elements-button.js +1 -1
  20. package/dist/elements-checkbox.js +1 -1
  21. package/dist/elements-chip.js +2 -0
  22. package/dist/elements-modal.js +1 -1
  23. package/dist/elements-radio.js +1 -1
  24. package/dist/elements-select.js +1 -1
  25. package/dist/elements-switch.js +1 -1
  26. package/dist/elements-tag.js +1 -1
  27. package/dist/elements-text-area.js +1 -1
  28. package/dist/elements-text-input.js +1 -1
  29. package/dist/elements.js +14 -13
  30. package/dist/index.js +13 -12
  31. package/dist/{modal-IEXNB8St.js → modal-BAvMVUIE.js} +2 -2
  32. package/dist/{modal-CHjaB_yR.js → modal-BnT5Kxjg.js} +1 -1
  33. package/dist/modal.js +1 -1
  34. package/dist/radio-CDq4r1_L.js +155 -0
  35. package/dist/radio-TaYThYkI.js +199 -0
  36. package/dist/radio.js +1 -1
  37. package/dist/{runtime-dom.esm-bundler-BeOO_l6v.js → runtime-dom.esm-bundler-DLryEdgJ.js} +1 -1
  38. package/dist/select--O3jL-En.js +134 -0
  39. package/dist/select-NiIx8bVD.js +191 -0
  40. package/dist/select.js +1 -1
  41. package/dist/switch-BmxLKPbL.js +179 -0
  42. package/dist/switch-D5N-j5F7.js +140 -0
  43. package/dist/switch.js +1 -1
  44. package/dist/{tag-BdB0YDBJ.js → tag-BvOt0v-c.js} +1 -1
  45. package/dist/tag.js +1 -1
  46. package/dist/text-area-BdmAyh3N.js +163 -0
  47. package/dist/text-area-BgYNtAMx.js +107 -0
  48. package/dist/text-area.js +1 -1
  49. package/dist/text-input-DgFIuIOA.js +235 -0
  50. package/dist/text-input-i559HVOP.js +163 -0
  51. package/dist/text-input.js +1 -1
  52. package/dist/types/chip.d.ts +1 -0
  53. package/dist/types/components/alert/Alert.vue.d.ts +3 -3
  54. package/dist/types/components/badge/Badge.vue.d.ts +1 -1
  55. package/dist/types/components/button/Button.vue.d.ts +1 -1
  56. package/dist/types/components/checkbox/Checkbox.vue.d.ts +4 -15
  57. package/dist/types/components/checkbox/VueCheckbox.vue.d.ts +9 -3
  58. package/dist/types/components/checkbox/checkbox.types.d.ts +16 -0
  59. package/dist/types/components/chip/Chip.vue.d.ts +38 -0
  60. package/dist/types/components/chip/VueChip.vue.d.ts +32 -0
  61. package/dist/types/components/chip/chip.context.d.ts +2 -0
  62. package/dist/types/components/chip/chip.types.d.ts +27 -0
  63. package/dist/types/components/modal/Modal.vue.d.ts +8 -8
  64. package/dist/types/components/radio/Radio.vue.d.ts +2 -17
  65. package/dist/types/components/radio/VueRadio.vue.d.ts +8 -6
  66. package/dist/types/components/radio/radio.types.d.ts +16 -0
  67. package/dist/types/components/select/Select.vue.d.ts +2 -19
  68. package/dist/types/components/select/VueSelect.vue.d.ts +9 -3
  69. package/dist/types/components/select/select.types.d.ts +18 -0
  70. package/dist/types/components/shared/control-item-slots.d.ts +1 -0
  71. package/dist/types/components/switch/Switch.vue.d.ts +2 -14
  72. package/dist/types/components/switch/VueSwitch.vue.d.ts +9 -3
  73. package/dist/types/components/switch/switch.types.d.ts +13 -0
  74. package/dist/types/components/tag/Tag.vue.d.ts +1 -1
  75. package/dist/types/components/text-area/TextArea.vue.d.ts +2 -16
  76. package/dist/types/components/text-area/VueTextArea.vue.d.ts +9 -3
  77. package/dist/types/components/text-area/text-area.types.d.ts +15 -0
  78. package/dist/types/components/text-input/TextInput.vue.d.ts +2 -19
  79. package/dist/types/components/text-input/VueTextInput.vue.d.ts +9 -3
  80. package/dist/types/components/text-input/text-input.types.d.ts +25 -0
  81. package/dist/types/elements/chip.d.ts +4 -0
  82. package/dist/types/elements/index.d.ts +2 -0
  83. package/dist/types/vue/checkbox.d.ts +1 -1
  84. package/dist/types/vue/chip.d.ts +2 -0
  85. package/dist/types/vue/index.d.ts +8 -6
  86. package/dist/types/vue/radio.d.ts +1 -1
  87. package/dist/types/vue/select.d.ts +1 -1
  88. package/dist/types/vue/switch.d.ts +1 -1
  89. package/dist/types/vue/text-area.d.ts +1 -1
  90. package/dist/types/vue/text-input.d.ts +1 -1
  91. package/dist/vue-alert.js +1 -1
  92. package/dist/vue-checkbox.js +1 -1
  93. package/dist/vue-chip.js +2 -0
  94. package/dist/vue-modal.js +1 -1
  95. package/dist/vue-radio.js +1 -1
  96. package/dist/vue-select.js +1 -1
  97. package/dist/vue-switch.js +1 -1
  98. package/dist/vue-text-area.js +1 -1
  99. package/dist/vue-text-input.js +1 -1
  100. package/dist/vue.js +10 -9
  101. package/package.json +15 -2
  102. package/dist/checkbox-PAgQqiIw.js +0 -145
  103. package/dist/checkbox-g6cqR6wz.js +0 -170
  104. package/dist/radio-Cmrtred_.js +0 -147
  105. package/dist/radio-CqVqsZ7n.js +0 -175
  106. package/dist/select-Bpou1HIY.js +0 -167
  107. package/dist/select-CWjTpHGb.js +0 -126
  108. package/dist/switch-CFv0JUeq.js +0 -132
  109. package/dist/switch-DEYsTCw5.js +0 -157
  110. package/dist/text-area-DkjEGpHg.js +0 -99
  111. package/dist/text-area-DqBoz2_d.js +0 -139
  112. package/dist/text-input-DnWjB1vE.js +0 -207
  113. package/dist/text-input-DxzwRS2R.js +0 -157
@@ -0,0 +1,163 @@
1
+ import { computed as e, createBlock as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createSlots as a, createTextVNode as o, defineComponent as s, mergeModels as c, mergeProps as l, normalizeClass as u, normalizeStyle as d, openBlock as f, renderSlot as p, toDisplayString as m, toRef as h, unref as g, useAttrs as _, useId as v, useModel as y, useSlots as b, withCtx as x } from "vue";
2
+ //#region src/components/text-area/TextArea.vue?vue&type=script&setup=true&lang.ts
3
+ var S = ["id", "for"], C = [
4
+ "id",
5
+ "placeholder",
6
+ "value",
7
+ "disabled",
8
+ "readonly",
9
+ "required",
10
+ "aria-describedby",
11
+ "aria-invalid"
12
+ ], w = ["id"], T = ["id"], E = [
13
+ "id",
14
+ "href",
15
+ "aria-labelledby"
16
+ ], D = /* @__PURE__ */ s({
17
+ inheritAttrs: !1,
18
+ __name: "TextArea",
19
+ props: {
20
+ label: { default: "Text area" },
21
+ placeholder: { default: " " },
22
+ helperText: { default: "" },
23
+ errorText: { default: "" },
24
+ helperLink: { default: "" },
25
+ helperLinkHref: { default: "" },
26
+ value: { default: "" },
27
+ outlined: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
31
+ disabled: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ readonly: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ required: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ invalid: {
44
+ type: Boolean,
45
+ default: !1
46
+ },
47
+ maxWidth: {
48
+ type: Boolean,
49
+ default: !1
50
+ }
51
+ },
52
+ setup(t) {
53
+ let a = _();
54
+ function s() {
55
+ let { class: e, style: t, ...n } = a;
56
+ return n;
57
+ }
58
+ let c = h(() => a.id), y = b(), x = v(), D = h(() => c.value || `ouds-text-area-${x}`), O = h(() => `${D.value}-helper`), k = h(() => `${D.value}-error`), A = h(() => `${D.value}-label`), j = h(() => `${D.value}-helper-link`);
59
+ function M() {
60
+ let e = [a["aria-describedby"]];
61
+ return (t.helperText || y["helper-text"]) && !t.invalid && e.push(O.value), t.invalid && (t.errorText || y["error-text"]) && e.push(k.value), t.helperLinkHref && (t.helperLink || y["helper-link"]) && e.push(j.value), e.filter(Boolean).join(" ") || void 0;
62
+ }
63
+ let N = e(() => ["text-area", { "component-max-width": t.maxWidth }]), P = e(() => ["text-area-container", { "text-area-container-outlined": t.outlined }]);
64
+ return (e, c) => (f(), r("div", {
65
+ class: u([N.value, g(a).class]),
66
+ style: d(g(a).style)
67
+ }, [
68
+ i("div", { class: u(P.value) }, [i("label", {
69
+ id: A.value,
70
+ for: D.value,
71
+ class: u({ "is-required": t.required })
72
+ }, [p(e.$slots, "label", {}, () => [o(m(t.label), 1)])], 10, S), i("textarea", l(s(), {
73
+ id: D.value,
74
+ class: "text-area-field",
75
+ placeholder: t.placeholder || " ",
76
+ value: t.value,
77
+ disabled: t.disabled,
78
+ readonly: t.readonly,
79
+ required: t.required,
80
+ "aria-describedby": M(),
81
+ "aria-invalid": t.invalid
82
+ }), null, 16, C)], 2),
83
+ (t.helperText || e.$slots["helper-text"]) && !t.invalid ? (f(), r("p", {
84
+ key: 0,
85
+ id: O.value,
86
+ class: "helper-text"
87
+ }, [p(e.$slots, "helper-text", {}, () => [o(m(t.helperText), 1)])], 8, w)) : n("", !0),
88
+ t.invalid && (t.errorText || e.$slots["error-text"]) ? (f(), r("p", {
89
+ key: 1,
90
+ id: k.value,
91
+ class: "error-text"
92
+ }, [p(e.$slots, "error-text", {}, () => [o(m(t.errorText), 1)])], 8, T)) : n("", !0),
93
+ t.helperLinkHref && (t.helperLink || e.$slots["helper-link"]) ? (f(), r("a", {
94
+ key: 2,
95
+ id: j.value,
96
+ href: t.helperLinkHref,
97
+ "aria-labelledby": `${j.value} ${A.value}`,
98
+ class: "link link-small"
99
+ }, [p(e.$slots, "helper-link", {}, () => [o(m(t.helperLink), 1)]), c[0] ||= i("span", { class: "visually-hidden" }, "on", -1)], 8, E)) : n("", !0)
100
+ ], 6));
101
+ }
102
+ }), O = /* @__PURE__ */ s({
103
+ inheritAttrs: !1,
104
+ __name: "VueTextArea",
105
+ props: /*@__PURE__*/ c({
106
+ label: {},
107
+ placeholder: {},
108
+ helperText: {},
109
+ errorText: {},
110
+ helperLink: {},
111
+ helperLinkHref: {},
112
+ outlined: { type: Boolean },
113
+ disabled: { type: Boolean },
114
+ readonly: { type: Boolean },
115
+ required: { type: Boolean },
116
+ invalid: { type: Boolean },
117
+ maxWidth: { type: Boolean }
118
+ }, {
119
+ modelValue: { default: "" },
120
+ modelModifiers: {}
121
+ }),
122
+ emits: /*@__PURE__*/ c(["input", "change"], ["update:modelValue"]),
123
+ setup(e, { emit: n }) {
124
+ let r = e, i = y(e, "modelValue"), o = n;
125
+ function s(e) {
126
+ i.value = e.target.value, o("input", e);
127
+ }
128
+ function c(e) {
129
+ i.value = e.target.value, o("change", e);
130
+ }
131
+ return (e, n) => (f(), t(D, l({
132
+ ...e.$attrs,
133
+ ...r
134
+ }, {
135
+ value: i.value,
136
+ onInput: s,
137
+ onChange: c
138
+ }), a({ _: 2 }, [
139
+ e.$slots.label ? {
140
+ name: "label",
141
+ fn: x(() => [p(e.$slots, "label")]),
142
+ key: "0"
143
+ } : void 0,
144
+ e.$slots["helper-text"] ? {
145
+ name: "helper-text",
146
+ fn: x(() => [p(e.$slots, "helper-text")]),
147
+ key: "1"
148
+ } : void 0,
149
+ e.$slots["error-text"] ? {
150
+ name: "error-text",
151
+ fn: x(() => [p(e.$slots, "error-text")]),
152
+ key: "2"
153
+ } : void 0,
154
+ e.$slots["helper-link"] ? {
155
+ name: "helper-link",
156
+ fn: x(() => [p(e.$slots, "helper-link")]),
157
+ key: "3"
158
+ } : void 0
159
+ ]), 1040, ["value"]));
160
+ }
161
+ });
162
+ //#endregion
163
+ export { O as t };
@@ -0,0 +1,107 @@
1
+ import { A as e, M as t, N as n, S as r, a as i, b as a, c as o, d as s, g as c, j as l, k as u, l as d, o as f, p, t as m, u as h, v as g, x as _ } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
2
+ //#region src/components/text-area/TextArea.vue?vue&type=script&setup=true&lang.ts
3
+ var v = ["id", "for"], y = [
4
+ "id",
5
+ "placeholder",
6
+ "value",
7
+ "disabled",
8
+ "readonly",
9
+ "required",
10
+ "aria-describedby",
11
+ "aria-invalid"
12
+ ], b = ["id"], x = ["id"], S = [
13
+ "id",
14
+ "href",
15
+ "aria-labelledby"
16
+ ], C = m(/* @__PURE__ */ s({
17
+ inheritAttrs: !1,
18
+ __name: "TextArea",
19
+ props: {
20
+ label: { default: "Text area" },
21
+ placeholder: { default: " " },
22
+ helperText: { default: "" },
23
+ errorText: { default: "" },
24
+ helperLink: { default: "" },
25
+ helperLinkHref: { default: "" },
26
+ value: { default: "" },
27
+ outlined: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
31
+ disabled: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ readonly: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ required: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ invalid: {
44
+ type: Boolean,
45
+ default: !1
46
+ },
47
+ maxWidth: {
48
+ type: Boolean,
49
+ default: !1
50
+ }
51
+ },
52
+ setup(s) {
53
+ let m = a();
54
+ function C() {
55
+ let { class: e, style: t, ...n } = m;
56
+ return n;
57
+ }
58
+ let w = u(() => m.id), T = r(), E = _(), D = u(() => w.value || `ouds-text-area-${E}`), O = u(() => `${D.value}-helper`), k = u(() => `${D.value}-error`), A = u(() => `${D.value}-label`), j = u(() => `${D.value}-helper-link`);
59
+ function M() {
60
+ let e = [m["aria-describedby"]];
61
+ return (s.helperText || T["helper-text"]) && !s.invalid && e.push(O.value), s.invalid && (s.errorText || T["error-text"]) && e.push(k.value), s.helperLinkHref && (s.helperLink || T["helper-link"]) && e.push(j.value), e.filter(Boolean).join(" ") || void 0;
62
+ }
63
+ let N = i(() => ["text-area", { "component-max-width": s.maxWidth }]), P = i(() => ["text-area-container", { "text-area-container-outlined": s.outlined }]);
64
+ return (r, i) => (c(), d("div", {
65
+ class: l([N.value, e(m).class]),
66
+ style: t(e(m).style)
67
+ }, [
68
+ f("div", { class: l(P.value) }, [f("label", {
69
+ id: A.value,
70
+ for: D.value,
71
+ class: l({ "is-required": s.required })
72
+ }, [g(r.$slots, "label", {}, () => [h(n(s.label), 1)])], 10, v), f("textarea", p(C(), {
73
+ id: D.value,
74
+ class: "text-area-field",
75
+ placeholder: s.placeholder || " ",
76
+ value: s.value,
77
+ disabled: s.disabled,
78
+ readonly: s.readonly,
79
+ required: s.required,
80
+ "aria-describedby": M(),
81
+ "aria-invalid": s.invalid
82
+ }), null, 16, y)], 2),
83
+ (s.helperText || r.$slots["helper-text"]) && !s.invalid ? (c(), d("p", {
84
+ key: 0,
85
+ id: O.value,
86
+ class: "helper-text"
87
+ }, [g(r.$slots, "helper-text", {}, () => [h(n(s.helperText), 1)])], 8, b)) : o("", !0),
88
+ s.invalid && (s.errorText || r.$slots["error-text"]) ? (c(), d("p", {
89
+ key: 1,
90
+ id: k.value,
91
+ class: "error-text"
92
+ }, [g(r.$slots, "error-text", {}, () => [h(n(s.errorText), 1)])], 8, x)) : o("", !0),
93
+ s.helperLinkHref && (s.helperLink || r.$slots["helper-link"]) ? (c(), d("a", {
94
+ key: 2,
95
+ id: j.value,
96
+ href: s.helperLinkHref,
97
+ "aria-labelledby": `${j.value} ${A.value}`,
98
+ class: "link link-small"
99
+ }, [g(r.$slots, "helper-link", {}, () => [h(n(s.helperLink), 1)]), i[0] ||= f("span", { class: "visually-hidden" }, "on", -1)], 8, S)) : o("", !0)
100
+ ], 6));
101
+ }
102
+ }), { shadowRoot: !1 });
103
+ function w() {
104
+ typeof customElements < "u" && (customElements.get("ouds-text-area") || customElements.define("ouds-text-area", C));
105
+ }
106
+ //#endregion
107
+ export { w as n, C as t };
package/dist/text-area.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./text-area-DkjEGpHg.js";
1
+ import { n as e, t } from "./text-area-BgYNtAMx.js";
2
2
  //#region src/text-area.ts
3
3
  e();
4
4
  //#endregion
@@ -0,0 +1,235 @@
1
+ import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, defineComponent as c, guardReactiveProps as l, mergeModels as u, mergeProps as d, normalizeClass as f, normalizeProps as p, normalizeStyle as m, openBlock as h, renderSlot as g, toDisplayString as _, toRef as v, unref as y, useAttrs as b, useId as x, useModel as S, useSlots as C, withCtx as w } from "vue";
2
+ //#region src/components/text-input/TextInput.vue?vue&type=script&setup=true&lang.ts
3
+ var T = ["id", "for"], E = ["data-bs-prefix", "data-bs-suffix"], D = [
4
+ "id",
5
+ "type",
6
+ "placeholder",
7
+ "value",
8
+ "disabled",
9
+ "readonly",
10
+ "required",
11
+ "aria-describedby",
12
+ "aria-invalid"
13
+ ], O = [
14
+ "id",
15
+ "type",
16
+ "placeholder",
17
+ "value",
18
+ "disabled",
19
+ "readonly",
20
+ "required",
21
+ "aria-describedby",
22
+ "aria-invalid"
23
+ ], k = ["id"], A = ["id"], j = ["id"], M = [
24
+ "id",
25
+ "href",
26
+ "aria-labelledby"
27
+ ], N = { class: "visually-hidden" }, P = /* @__PURE__ */ c({
28
+ inheritAttrs: !1,
29
+ __name: "TextInput",
30
+ props: {
31
+ prefix: { default: "" },
32
+ label: { default: "Text input" },
33
+ placeholder: { default: " " },
34
+ helperText: { default: "" },
35
+ errorText: { default: "" },
36
+ helperLink: { default: "" },
37
+ helperLinkHref: { default: "" },
38
+ helperLinkAria: { default: "on" },
39
+ suffix: { default: "" },
40
+ value: { default: "" },
41
+ type: { default: "text" },
42
+ outlined: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ disabled: {
47
+ type: Boolean,
48
+ default: !1
49
+ },
50
+ readonly: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ required: {
55
+ type: Boolean,
56
+ default: !1
57
+ },
58
+ invalid: {
59
+ type: Boolean,
60
+ default: !1
61
+ },
62
+ maxWidth: {
63
+ type: Boolean,
64
+ default: !1
65
+ },
66
+ loading: {
67
+ type: Boolean,
68
+ default: !1
69
+ },
70
+ loadingText: { default: "Loading" }
71
+ },
72
+ setup(n) {
73
+ let o = b();
74
+ function c() {
75
+ let { class: e, style: t, ...n } = o;
76
+ return n;
77
+ }
78
+ let l = v(() => o.id), u = C(), p = x(), S = v(() => l.value || `ouds-text-input-${p}`), w = v(() => `${S.value}-helper`), P = v(() => `${S.value}-error`), F = v(() => `${S.value}-label`), I = v(() => `${S.value}-helper-link`), L = v(() => `${S.value}-loading`);
79
+ function R() {
80
+ let e = [o["aria-describedby"]];
81
+ return (n.helperText || u["helper-text"]) && !n.invalid && e.push(w.value), n.invalid && (n.errorText || u["error-text"]) && e.push(P.value), n.helperLinkHref && (n.helperLink || u["helper-link"]) && e.push(I.value), n.loading && e.push(L.value), e.filter(Boolean).join(" ") || void 0;
82
+ }
83
+ let z = t(() => ["text-input", { "component-max-width": n.maxWidth }]), B = t(() => ["text-input-container", { "text-input-container-outlined": n.outlined }]), V = t(() => ["text-input-field", { "loading-indeterminate": n.loading }]);
84
+ return (t, l) => (h(), i("div", {
85
+ class: f([z.value, y(o).class]),
86
+ style: m(y(o).style)
87
+ }, [
88
+ a("div", { class: f(B.value) }, [
89
+ g(t.$slots, "leading-icon"),
90
+ a("label", {
91
+ id: F.value,
92
+ for: S.value,
93
+ class: f({ "is-required": n.required })
94
+ }, [g(t.$slots, "label", {}, () => [s(_(n.label), 1)])], 10, T),
95
+ n.prefix || n.suffix ? (h(), i("div", {
96
+ key: 0,
97
+ class: "input-container",
98
+ "data-bs-prefix": n.prefix || void 0,
99
+ "data-bs-suffix": n.suffix || void 0
100
+ }, [a("input", d(c(), {
101
+ id: S.value,
102
+ type: n.type,
103
+ class: V.value,
104
+ placeholder: n.placeholder || " ",
105
+ value: n.value,
106
+ disabled: n.disabled,
107
+ readonly: n.readonly,
108
+ required: n.required,
109
+ "aria-describedby": R(),
110
+ "aria-invalid": n.invalid
111
+ }), null, 16, D)], 8, E)) : (h(), i("input", d({ key: 1 }, c(), {
112
+ id: S.value,
113
+ type: n.type,
114
+ class: V.value,
115
+ placeholder: n.placeholder || " ",
116
+ value: n.value,
117
+ disabled: n.disabled,
118
+ readonly: n.readonly,
119
+ required: n.required,
120
+ "aria-describedby": R(),
121
+ "aria-invalid": n.invalid
122
+ }), null, 16, O)),
123
+ n.loading ? (h(), i(e, { key: 2 }, [l[0] ||= a("svg", {
124
+ viewBox: "0 0 40 40",
125
+ xmlns: "http://www.w3.org/2000/svg",
126
+ class: "loader",
127
+ "aria-hidden": "true"
128
+ }, [a("circle", {
129
+ class: "loader-inner",
130
+ cx: "20",
131
+ cy: "20",
132
+ r: "17"
133
+ })], -1), a("span", {
134
+ id: L.value,
135
+ role: "status",
136
+ class: "visually-hidden"
137
+ }, _(n.loadingText), 9, k)], 64)) : g(t.$slots, "trailing-action", { disabled: n.disabled || n.readonly }, void 0, void 0, 3)
138
+ ], 2),
139
+ (n.helperText || t.$slots["helper-text"]) && !n.invalid ? (h(), i("p", {
140
+ key: 0,
141
+ id: w.value,
142
+ class: "helper-text"
143
+ }, [g(t.$slots, "helper-text", {}, () => [s(_(n.helperText), 1)])], 8, A)) : r("", !0),
144
+ n.invalid && (n.errorText || t.$slots["error-text"]) ? (h(), i("p", {
145
+ key: 1,
146
+ id: P.value,
147
+ class: "error-text"
148
+ }, [g(t.$slots, "error-text", {}, () => [s(_(n.errorText), 1)])], 8, j)) : r("", !0),
149
+ n.helperLinkHref && (n.helperLink || t.$slots["helper-link"]) ? (h(), i("a", {
150
+ key: 2,
151
+ id: I.value,
152
+ href: n.helperLinkHref,
153
+ "aria-labelledby": `${I.value} ${F.value}`,
154
+ class: "link link-small"
155
+ }, [g(t.$slots, "helper-link", {}, () => [s(_(n.helperLink), 1)]), a("span", N, _(n.helperLinkAria), 1)], 8, M)) : r("", !0)
156
+ ], 6));
157
+ }
158
+ }), F = /* @__PURE__ */ c({
159
+ inheritAttrs: !1,
160
+ __name: "VueTextInput",
161
+ props: /*@__PURE__*/ u({
162
+ prefix: {},
163
+ label: {},
164
+ placeholder: {},
165
+ helperText: {},
166
+ errorText: {},
167
+ helperLink: {},
168
+ helperLinkHref: {},
169
+ helperLinkAria: {},
170
+ suffix: {},
171
+ type: {},
172
+ outlined: { type: Boolean },
173
+ disabled: { type: Boolean },
174
+ readonly: { type: Boolean },
175
+ required: { type: Boolean },
176
+ invalid: { type: Boolean },
177
+ maxWidth: { type: Boolean },
178
+ loading: { type: Boolean },
179
+ loadingText: {}
180
+ }, {
181
+ modelValue: { default: "" },
182
+ modelModifiers: {}
183
+ }),
184
+ emits: /*@__PURE__*/ u(["input", "change"], ["update:modelValue"]),
185
+ setup(e, { emit: t }) {
186
+ let r = e, i = S(e, "modelValue"), a = t;
187
+ function s(e) {
188
+ i.value = e.target.value, a("input", e);
189
+ }
190
+ function c(e) {
191
+ i.value = e.target.value, a("change", e);
192
+ }
193
+ return (e, t) => (h(), n(P, d({
194
+ ...e.$attrs,
195
+ ...r
196
+ }, {
197
+ value: i.value,
198
+ onInput: s,
199
+ onChange: c
200
+ }), o({ _: 2 }, [
201
+ e.$slots.label ? {
202
+ name: "label",
203
+ fn: w(() => [g(e.$slots, "label")]),
204
+ key: "0"
205
+ } : void 0,
206
+ e.$slots["leading-icon"] ? {
207
+ name: "leading-icon",
208
+ fn: w(() => [g(e.$slots, "leading-icon")]),
209
+ key: "1"
210
+ } : void 0,
211
+ e.$slots["trailing-action"] ? {
212
+ name: "trailing-action",
213
+ fn: w((t) => [g(e.$slots, "trailing-action", p(l(t)))]),
214
+ key: "2"
215
+ } : void 0,
216
+ e.$slots["helper-text"] ? {
217
+ name: "helper-text",
218
+ fn: w(() => [g(e.$slots, "helper-text")]),
219
+ key: "3"
220
+ } : void 0,
221
+ e.$slots["error-text"] ? {
222
+ name: "error-text",
223
+ fn: w(() => [g(e.$slots, "error-text")]),
224
+ key: "4"
225
+ } : void 0,
226
+ e.$slots["helper-link"] ? {
227
+ name: "helper-link",
228
+ fn: w(() => [g(e.$slots, "helper-link")]),
229
+ key: "5"
230
+ } : void 0
231
+ ]), 1040, ["value"]));
232
+ }
233
+ });
234
+ //#endregion
235
+ export { F as t };
@@ -0,0 +1,163 @@
1
+ import { A as e, M as t, N as n, S as r, a as i, b as a, c as o, d as s, g as c, i as l, j as u, k as d, l as f, o as p, p as m, t as h, u as g, v as _, x as v } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
2
+ //#region src/components/text-input/TextInput.vue?vue&type=script&setup=true&lang.ts
3
+ var y = ["id", "for"], b = ["data-bs-prefix", "data-bs-suffix"], x = [
4
+ "id",
5
+ "type",
6
+ "placeholder",
7
+ "value",
8
+ "disabled",
9
+ "readonly",
10
+ "required",
11
+ "aria-describedby",
12
+ "aria-invalid"
13
+ ], S = [
14
+ "id",
15
+ "type",
16
+ "placeholder",
17
+ "value",
18
+ "disabled",
19
+ "readonly",
20
+ "required",
21
+ "aria-describedby",
22
+ "aria-invalid"
23
+ ], C = ["id"], w = ["id"], T = ["id"], E = [
24
+ "id",
25
+ "href",
26
+ "aria-labelledby"
27
+ ], D = { class: "visually-hidden" }, O = h(/* @__PURE__ */ s({
28
+ inheritAttrs: !1,
29
+ __name: "TextInput",
30
+ props: {
31
+ prefix: { default: "" },
32
+ label: { default: "Text input" },
33
+ placeholder: { default: " " },
34
+ helperText: { default: "" },
35
+ errorText: { default: "" },
36
+ helperLink: { default: "" },
37
+ helperLinkHref: { default: "" },
38
+ helperLinkAria: { default: "on" },
39
+ suffix: { default: "" },
40
+ value: { default: "" },
41
+ type: { default: "text" },
42
+ outlined: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ disabled: {
47
+ type: Boolean,
48
+ default: !1
49
+ },
50
+ readonly: {
51
+ type: Boolean,
52
+ default: !1
53
+ },
54
+ required: {
55
+ type: Boolean,
56
+ default: !1
57
+ },
58
+ invalid: {
59
+ type: Boolean,
60
+ default: !1
61
+ },
62
+ maxWidth: {
63
+ type: Boolean,
64
+ default: !1
65
+ },
66
+ loading: {
67
+ type: Boolean,
68
+ default: !1
69
+ },
70
+ loadingText: { default: "Loading" }
71
+ },
72
+ setup(s) {
73
+ let h = a();
74
+ function O() {
75
+ let { class: e, style: t, ...n } = h;
76
+ return n;
77
+ }
78
+ let k = d(() => h.id), A = r(), j = v(), M = d(() => k.value || `ouds-text-input-${j}`), N = d(() => `${M.value}-helper`), P = d(() => `${M.value}-error`), F = d(() => `${M.value}-label`), I = d(() => `${M.value}-helper-link`), L = d(() => `${M.value}-loading`);
79
+ function R() {
80
+ let e = [h["aria-describedby"]];
81
+ return (s.helperText || A["helper-text"]) && !s.invalid && e.push(N.value), s.invalid && (s.errorText || A["error-text"]) && e.push(P.value), s.helperLinkHref && (s.helperLink || A["helper-link"]) && e.push(I.value), s.loading && e.push(L.value), e.filter(Boolean).join(" ") || void 0;
82
+ }
83
+ let z = i(() => ["text-input", { "component-max-width": s.maxWidth }]), B = i(() => ["text-input-container", { "text-input-container-outlined": s.outlined }]), V = i(() => ["text-input-field", { "loading-indeterminate": s.loading }]);
84
+ return (r, i) => (c(), f("div", {
85
+ class: u([z.value, e(h).class]),
86
+ style: t(e(h).style)
87
+ }, [
88
+ p("div", { class: u(B.value) }, [
89
+ _(r.$slots, "leading-icon"),
90
+ p("label", {
91
+ id: F.value,
92
+ for: M.value,
93
+ class: u({ "is-required": s.required })
94
+ }, [_(r.$slots, "label", {}, () => [g(n(s.label), 1)])], 10, y),
95
+ s.prefix || s.suffix ? (c(), f("div", {
96
+ key: 0,
97
+ class: "input-container",
98
+ "data-bs-prefix": s.prefix || void 0,
99
+ "data-bs-suffix": s.suffix || void 0
100
+ }, [p("input", m(O(), {
101
+ id: M.value,
102
+ type: s.type,
103
+ class: V.value,
104
+ placeholder: s.placeholder || " ",
105
+ value: s.value,
106
+ disabled: s.disabled,
107
+ readonly: s.readonly,
108
+ required: s.required,
109
+ "aria-describedby": R(),
110
+ "aria-invalid": s.invalid
111
+ }), null, 16, x)], 8, b)) : (c(), f("input", m({ key: 1 }, O(), {
112
+ id: M.value,
113
+ type: s.type,
114
+ class: V.value,
115
+ placeholder: s.placeholder || " ",
116
+ value: s.value,
117
+ disabled: s.disabled,
118
+ readonly: s.readonly,
119
+ required: s.required,
120
+ "aria-describedby": R(),
121
+ "aria-invalid": s.invalid
122
+ }), null, 16, S)),
123
+ s.loading ? (c(), f(l, { key: 2 }, [i[0] ||= p("svg", {
124
+ viewBox: "0 0 40 40",
125
+ xmlns: "http://www.w3.org/2000/svg",
126
+ class: "loader",
127
+ "aria-hidden": "true"
128
+ }, [p("circle", {
129
+ class: "loader-inner",
130
+ cx: "20",
131
+ cy: "20",
132
+ r: "17"
133
+ })], -1), p("span", {
134
+ id: L.value,
135
+ role: "status",
136
+ class: "visually-hidden"
137
+ }, n(s.loadingText), 9, C)], 64)) : _(r.$slots, "trailing-action", { disabled: s.disabled || s.readonly }, void 0, void 0, 3)
138
+ ], 2),
139
+ (s.helperText || r.$slots["helper-text"]) && !s.invalid ? (c(), f("p", {
140
+ key: 0,
141
+ id: N.value,
142
+ class: "helper-text"
143
+ }, [_(r.$slots, "helper-text", {}, () => [g(n(s.helperText), 1)])], 8, w)) : o("", !0),
144
+ s.invalid && (s.errorText || r.$slots["error-text"]) ? (c(), f("p", {
145
+ key: 1,
146
+ id: P.value,
147
+ class: "error-text"
148
+ }, [_(r.$slots, "error-text", {}, () => [g(n(s.errorText), 1)])], 8, T)) : o("", !0),
149
+ s.helperLinkHref && (s.helperLink || r.$slots["helper-link"]) ? (c(), f("a", {
150
+ key: 2,
151
+ id: I.value,
152
+ href: s.helperLinkHref,
153
+ "aria-labelledby": `${I.value} ${F.value}`,
154
+ class: "link link-small"
155
+ }, [_(r.$slots, "helper-link", {}, () => [g(n(s.helperLink), 1)]), p("span", D, n(s.helperLinkAria), 1)], 8, E)) : o("", !0)
156
+ ], 6));
157
+ }
158
+ }), { shadowRoot: !1 });
159
+ function k() {
160
+ typeof customElements < "u" && (customElements.get("ouds-text-input") || customElements.define("ouds-text-input", O));
161
+ }
162
+ //#endregion
163
+ export { k as n, O as t };
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./text-input-DxzwRS2R.js";
1
+ import { n as e, t } from "./text-input-i559HVOP.js";
2
2
  //#region src/text-input.ts
3
3
  e();
4
4
  //#endregion
@@ -0,0 +1 @@
1
+ export * from "./elements/chip.js";