@nilloq/ouds-web 0.1.5 → 0.1.6

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