@nilloq/ouds-web 0.1.4 → 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 +19 -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 +3 -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-DOUGu0A2.js +0 -180
  132. package/dist/text-input-t-iE4dFj.js +0 -130
@@ -0,0 +1,145 @@
1
+ import { A as e, M as t, O as n, T as r, a as i, b as a, c as o, d as s, f as c, g as l, j as u, k as d, l as f, o as p, p as m, s as h, t as g, u as _, v, w as y, x as b, y as x } from "./runtime-dom.esm-bundler-BeOO_l6v.js";
2
+ import { n as S, t as C } from "./control-item-slots-BNXNsI1e.js";
3
+ //#region src/components/checkbox/checkbox.context.ts
4
+ var w = Symbol("ouds-checkbox-element-id"), T = { class: "control-item-assets-container" }, E = [
5
+ "id",
6
+ "value",
7
+ "checked",
8
+ "disabled",
9
+ "required",
10
+ "aria-describedby",
11
+ "aria-invalid"
12
+ ], D = [
13
+ "id",
14
+ "aria-checked",
15
+ "aria-labelledby",
16
+ "aria-describedby",
17
+ "aria-invalid"
18
+ ], O = { class: "control-item-text-container" }, k = ["id"], A = {
19
+ key: 0,
20
+ class: "control-item-assets-container"
21
+ }, j = /* @__PURE__ */ s({
22
+ inheritAttrs: !1,
23
+ __name: "Checkbox",
24
+ props: {
25
+ label: { default: "Checkbox" },
26
+ description: { default: "" },
27
+ value: { default: "" },
28
+ checked: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ disabled: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ required: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ divider: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ indeterminate: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ readonly: {
49
+ type: Boolean,
50
+ default: !1
51
+ },
52
+ invalid: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ reverse: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ maxWidth: {
61
+ type: Boolean,
62
+ default: !1
63
+ }
64
+ },
65
+ setup(s) {
66
+ let g = a(), C = d(() => g.id), j = n(), M = b(), N = c(w, void 0), P = S(N !== void 0), F = d(() => N ? `${C.value || N}-input` : C.value || `ouds-checkbox-${M}`), I = d(() => `${F.value}-label`), L = d(() => `${F.value}-description`);
67
+ function R() {
68
+ let e = [g["aria-describedby"]];
69
+ return (s.description || P("description")) && e.push(L.value), e.filter(Boolean).join(" ") || void 0;
70
+ }
71
+ function z() {
72
+ return [g["aria-labelledby"], I.value].filter(Boolean).join(" ");
73
+ }
74
+ let B = i(() => ["checkbox-item", {
75
+ "control-item-divider": s.divider,
76
+ "control-item-reverse": s.reverse,
77
+ "component-max-width": s.maxWidth
78
+ }]);
79
+ return y(() => {
80
+ j.value && "indeterminate" in j.value && (j.value.indeterminate = s.indeterminate);
81
+ }), (n, i) => (l(), f("div", { class: u(B.value) }, [
82
+ p("div", T, [s.readonly ? (l(), f("span", m({
83
+ key: 1,
84
+ ref_key: "input",
85
+ ref: j
86
+ }, e(g), {
87
+ id: F.value,
88
+ class: "control-item-indicator",
89
+ role: "checkbox",
90
+ "aria-readonly": "true",
91
+ "aria-disabled": "true",
92
+ tabindex: "0",
93
+ "aria-checked": s.indeterminate ? "mixed" : s.checked,
94
+ "aria-labelledby": z(),
95
+ "aria-describedby": R(),
96
+ "aria-invalid": s.invalid || e(g)["aria-invalid"]
97
+ }), null, 16, D)) : (l(), f("input", m({
98
+ key: 0,
99
+ ref_key: "input",
100
+ ref: j
101
+ }, e(g), {
102
+ id: F.value,
103
+ class: "control-item-indicator",
104
+ type: "checkbox",
105
+ value: s.value,
106
+ checked: s.checked,
107
+ disabled: s.disabled,
108
+ required: s.required,
109
+ "aria-describedby": R(),
110
+ "aria-invalid": s.invalid || e(g)["aria-invalid"]
111
+ }), null, 16, E))]),
112
+ p("div", O, [(l(), h(x(s.readonly ? "span" : "label"), {
113
+ id: I.value,
114
+ class: u(["control-item-label", { "is-required": s.required }]),
115
+ for: s.readonly ? void 0 : F.value
116
+ }, {
117
+ default: r(() => [v(n.$slots, "label", {}, () => [_(t(s.label), 1)])]),
118
+ _: 3
119
+ }, 8, [
120
+ "id",
121
+ "class",
122
+ "for"
123
+ ])), s.description || e(P)("description") ? (l(), f("p", {
124
+ key: 0,
125
+ id: L.value,
126
+ class: "control-item-description"
127
+ }, [v(n.$slots, "description", {}, () => [_(t(s.description), 1)])], 8, k)) : o("", !0)]),
128
+ e(P)("asset") ? (l(), f("div", A, [v(n.$slots, "asset")])) : o("", !0)
129
+ ], 2));
130
+ }
131
+ }), M = 0, N = g(j, {
132
+ shadowRoot: !1,
133
+ configureApp(e) {
134
+ e.provide(w, `ouds-checkbox-element-${M++}`);
135
+ }
136
+ }), P = class extends N {
137
+ connectedCallback() {
138
+ C(this), super.connectedCallback();
139
+ }
140
+ };
141
+ function F() {
142
+ typeof customElements < "u" && (customElements.get("ouds-checkbox") || customElements.define("ouds-checkbox", P));
143
+ }
144
+ //#endregion
145
+ export { F as n, P as t };
@@ -0,0 +1,170 @@
1
+ import { t as e } from "./control-item-slots-XV8Gjvf1.js";
2
+ import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, defineComponent as c, inject as l, mergeModels as u, mergeProps as d, normalizeClass as f, openBlock as p, ref as m, renderSlot as h, resolveDynamicComponent as g, toDisplayString as _, toRef as v, unref as y, useAttrs as b, useId as x, useModel as S, watchEffect as C, withCtx as w } from "vue";
3
+ //#region src/components/checkbox/checkbox.context.ts
4
+ var T = Symbol("ouds-checkbox-element-id"), E = { class: "control-item-assets-container" }, D = [
5
+ "id",
6
+ "value",
7
+ "checked",
8
+ "disabled",
9
+ "required",
10
+ "aria-describedby",
11
+ "aria-invalid"
12
+ ], O = [
13
+ "id",
14
+ "aria-checked",
15
+ "aria-labelledby",
16
+ "aria-describedby",
17
+ "aria-invalid"
18
+ ], k = { class: "control-item-text-container" }, A = ["id"], j = {
19
+ key: 0,
20
+ class: "control-item-assets-container"
21
+ }, M = /* @__PURE__ */ c({
22
+ inheritAttrs: !1,
23
+ __name: "Checkbox",
24
+ props: {
25
+ label: { default: "Checkbox" },
26
+ description: { default: "" },
27
+ value: { default: "" },
28
+ checked: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ disabled: {
33
+ type: Boolean,
34
+ default: !1
35
+ },
36
+ required: {
37
+ type: Boolean,
38
+ default: !1
39
+ },
40
+ divider: {
41
+ type: Boolean,
42
+ default: !1
43
+ },
44
+ indeterminate: {
45
+ type: Boolean,
46
+ default: !1
47
+ },
48
+ readonly: {
49
+ type: Boolean,
50
+ default: !1
51
+ },
52
+ invalid: {
53
+ type: Boolean,
54
+ default: !1
55
+ },
56
+ reverse: {
57
+ type: Boolean,
58
+ default: !1
59
+ },
60
+ maxWidth: {
61
+ type: Boolean,
62
+ default: !1
63
+ }
64
+ },
65
+ setup(o) {
66
+ let c = b(), u = v(() => c.id), S = m(), M = x(), N = l(T, void 0), P = e(N !== void 0), F = v(() => N ? `${u.value || N}-input` : u.value || `ouds-checkbox-${M}`), I = v(() => `${F.value}-label`), L = v(() => `${F.value}-description`);
67
+ function R() {
68
+ let e = [c["aria-describedby"]];
69
+ return (o.description || P("description")) && e.push(L.value), e.filter(Boolean).join(" ") || void 0;
70
+ }
71
+ function z() {
72
+ return [c["aria-labelledby"], I.value].filter(Boolean).join(" ");
73
+ }
74
+ let B = t(() => ["checkbox-item", {
75
+ "control-item-divider": o.divider,
76
+ "control-item-reverse": o.reverse,
77
+ "component-max-width": o.maxWidth
78
+ }]);
79
+ return C(() => {
80
+ S.value && "indeterminate" in S.value && (S.value.indeterminate = o.indeterminate);
81
+ }), (e, t) => (p(), i("div", { class: f(B.value) }, [
82
+ a("div", E, [o.readonly ? (p(), i("span", d({
83
+ key: 1,
84
+ ref_key: "input",
85
+ ref: S
86
+ }, y(c), {
87
+ id: F.value,
88
+ class: "control-item-indicator",
89
+ role: "checkbox",
90
+ "aria-readonly": "true",
91
+ "aria-disabled": "true",
92
+ tabindex: "0",
93
+ "aria-checked": o.indeterminate ? "mixed" : o.checked,
94
+ "aria-labelledby": z(),
95
+ "aria-describedby": R(),
96
+ "aria-invalid": o.invalid || y(c)["aria-invalid"]
97
+ }), null, 16, O)) : (p(), i("input", d({
98
+ key: 0,
99
+ ref_key: "input",
100
+ ref: S
101
+ }, y(c), {
102
+ id: F.value,
103
+ class: "control-item-indicator",
104
+ type: "checkbox",
105
+ value: o.value,
106
+ checked: o.checked,
107
+ disabled: o.disabled,
108
+ required: o.required,
109
+ "aria-describedby": R(),
110
+ "aria-invalid": o.invalid || y(c)["aria-invalid"]
111
+ }), null, 16, D))]),
112
+ a("div", k, [(p(), n(g(o.readonly ? "span" : "label"), {
113
+ id: I.value,
114
+ class: f(["control-item-label", { "is-required": o.required }]),
115
+ for: o.readonly ? void 0 : F.value
116
+ }, {
117
+ default: w(() => [h(e.$slots, "label", {}, () => [s(_(o.label), 1)])]),
118
+ _: 3
119
+ }, 8, [
120
+ "id",
121
+ "class",
122
+ "for"
123
+ ])), o.description || y(P)("description") ? (p(), i("p", {
124
+ key: 0,
125
+ id: L.value,
126
+ class: "control-item-description"
127
+ }, [h(e.$slots, "description", {}, () => [s(_(o.description), 1)])], 8, A)) : r("", !0)]),
128
+ y(P)("asset") ? (p(), i("div", j, [h(e.$slots, "asset")])) : r("", !0)
129
+ ], 2));
130
+ }
131
+ }), N = /* @__PURE__ */ c({
132
+ inheritAttrs: !1,
133
+ __name: "VueCheckbox",
134
+ props: {
135
+ modelValue: {
136
+ type: Boolean,
137
+ default: !1
138
+ },
139
+ modelModifiers: {}
140
+ },
141
+ emits: /*@__PURE__*/ u(["change"], ["update:modelValue"]),
142
+ setup(e, { emit: t }) {
143
+ let r = S(e, "modelValue"), i = t;
144
+ function a(e) {
145
+ r.value = e.target.checked, i("change", e);
146
+ }
147
+ return (e, t) => (p(), n(M, d(e.$attrs, {
148
+ checked: r.value,
149
+ onChange: a
150
+ }), o({ _: 2 }, [
151
+ e.$slots.label ? {
152
+ name: "label",
153
+ fn: w(() => [h(e.$slots, "label")]),
154
+ key: "0"
155
+ } : void 0,
156
+ e.$slots.asset ? {
157
+ name: "asset",
158
+ fn: w(() => [h(e.$slots, "asset")]),
159
+ key: "1"
160
+ } : void 0,
161
+ e.$slots.description ? {
162
+ name: "description",
163
+ fn: w(() => [h(e.$slots, "description")]),
164
+ key: "2"
165
+ } : void 0
166
+ ]), 1040, ["checked"]));
167
+ }
168
+ });
169
+ //#endregion
170
+ export { N as t };
package/dist/checkbox.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as e, t } from "./checkbox-D-A_bSBK.js";
1
+ import { n as e, t } from "./checkbox-PAgQqiIw.js";
2
2
  //#region src/checkbox.ts
3
3
  e();
4
4
  //#endregion
@@ -0,0 +1,12 @@
1
+ import { S as e, n as t } from "./runtime-dom.esm-bundler-BeOO_l6v.js";
2
+ //#region src/components/shared/control-item-slots.ts
3
+ var n = /* @__PURE__ */ new WeakMap();
4
+ function r(e) {
5
+ n.has(e) || n.set(e, new Set(Array.from(e.childNodes).flatMap((e) => e.nodeType === 1 ? [e.getAttribute("slot") || "default"] : e.nodeType === 3 && e.textContent?.trim() ? ["default"] : [])));
6
+ }
7
+ function i(r) {
8
+ let i = e(), a = r ? t() : void 0;
9
+ return (e) => !!(i[e] || a && n.get(a)?.has(e));
10
+ }
11
+ //#endregion
12
+ export { i as n, r as t };
@@ -0,0 +1,9 @@
1
+ import { useHost as e, useSlots as t } from "vue";
2
+ //#region src/components/shared/control-item-slots.ts
3
+ var n = /* @__PURE__ */ new WeakMap();
4
+ function r(r) {
5
+ let i = t(), a = r ? e() : void 0;
6
+ return (e) => !!(i[e] || a && n.get(a)?.has(e));
7
+ }
8
+ //#endregion
9
+ export { r as t };
@@ -0,0 +1,2 @@
1
+ import { n as e, r as t, t as n } from "./alert-bsnEmrzb.js";
2
+ export { n as OudsAlert, t as alertVariants, e as defineOudsAlert };
@@ -0,0 +1,2 @@
1
+ import { i as e, n as t, r as n, t as r } from "./badge-fffoaFuZ.js";
2
+ export { r as OudsBadge, n as badgeSizes, e as badgeVariants, t as defineOudsBadge };
@@ -1,2 +1,2 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./button-BPOKh6G4.js";
1
+ import { a as e, i as t, n, o as r, r as i, t as a } from "./button-BUziAVbu.js";
2
2
  export { a as OudsButton, i as buttonNavigations, t as buttonSizes, e as buttonTypes, r as buttonVariants, n as defineOudsButton };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./checkbox-D-A_bSBK.js";
1
+ import { n as e, t } from "./checkbox-PAgQqiIw.js";
2
2
  export { t as OudsCheckbox, e as defineOudsCheckbox };
@@ -0,0 +1,2 @@
1
+ import { a as e, i as t, n, r, t as i } from "./modal-IEXNB8St.js";
2
+ export { i as OudsModal, n as defineOudsModal, r as modalSizes, t as modalTypes, e as modalVariants };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./radio-Cmrtred_.js";
2
+ export { t as OudsRadio, e as defineOudsRadio };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./select-CA6TVlpX.js";
1
+ import { n as e, t } from "./select-CWjTpHGb.js";
2
2
  export { t as OudsSelect, e as defineOudsSelect };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./switch-CFv0JUeq.js";
2
+ export { t as OudsSwitch, e as defineOudsSwitch };
@@ -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,2 @@
1
+ import { n as e, t } from "./text-area-DkjEGpHg.js";
2
+ export { t as OudsTextArea, e as defineOudsTextArea };
@@ -1,2 +1,2 @@
1
- import { n as e, t } from "./text-input-t-iE4dFj.js";
1
+ import { n as e, t } from "./text-input-DxzwRS2R.js";
2
2
  export { t as OudsTextInput, e as defineOudsTextInput };
package/dist/elements.js CHANGED
@@ -1,8 +1,14 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./button-BPOKh6G4.js";
2
- import { i as o, n as s, r as c, t as l } from "./tag-BY32Hj5n.js";
3
- import { n as u, t as d } from "./select-CA6TVlpX.js";
4
- import { n as f, t as p } from "./checkbox-D-A_bSBK.js";
5
- import { n as m, t as h } from "./text-input-t-iE4dFj.js";
6
- n(), s(), u(), f(), m();
1
+ import { n as e, r as t, t as n } from "./alert-bsnEmrzb.js";
2
+ import { i as r, n as i, r as a, t as o } from "./badge-fffoaFuZ.js";
3
+ import { a as s, i as c, n as l, o as u, r as d, t as f } from "./button-BUziAVbu.js";
4
+ import { i as p, n as m, r as h, t as g } from "./tag-BdB0YDBJ.js";
5
+ import { n as _, t as v } from "./select-CWjTpHGb.js";
6
+ import { n as y, t as b } from "./checkbox-PAgQqiIw.js";
7
+ import { n as x, t as S } from "./radio-Cmrtred_.js";
8
+ import { n as C, t as w } from "./switch-CFv0JUeq.js";
9
+ import { n as T, t as E } from "./text-input-DxzwRS2R.js";
10
+ import { n as D, t as O } from "./text-area-DkjEGpHg.js";
11
+ import { a as k, i as A, n as j, r as M, t as N } from "./modal-IEXNB8St.js";
12
+ e(), i(), l(), m(), _(), y(), x(), C(), T(), D(), j();
7
13
  //#endregion
8
- export { a as OudsButton, p as OudsCheckbox, d as OudsSelect, l as OudsTag, h as OudsTextInput, i as buttonNavigations, t as buttonSizes, e as buttonTypes, r as buttonVariants, n as defineOudsButton, f as defineOudsCheckbox, u as defineOudsSelect, s as defineOudsTag, m as defineOudsTextInput, c as tagSizes, o as tagVariants };
14
+ export { n as OudsAlert, o as OudsBadge, f as OudsButton, b as OudsCheckbox, N as OudsModal, S as OudsRadio, v as OudsSelect, w as OudsSwitch, g as OudsTag, O as OudsTextArea, E as OudsTextInput, t as alertVariants, a as badgeSizes, r as badgeVariants, d as buttonNavigations, c as buttonSizes, s as buttonTypes, u as buttonVariants, e as defineOudsAlert, i as defineOudsBadge, l as defineOudsButton, y as defineOudsCheckbox, j as defineOudsModal, x as defineOudsRadio, _ as defineOudsSelect, C as defineOudsSwitch, m as defineOudsTag, D as defineOudsTextArea, T as defineOudsTextInput, M as modalSizes, A as modalTypes, k as modalVariants, h as tagSizes, p as tagVariants };
package/dist/index.js CHANGED
@@ -1,7 +1,13 @@
1
- import { a as e, i as t, n, o as r, r as i, t as a } from "./button-BPOKh6G4.js";
2
- import { i as o, n as s, r as c, t as l } from "./tag-BY32Hj5n.js";
3
- import { n as u, t as d } from "./select-CA6TVlpX.js";
4
- import { n as f, t as p } from "./checkbox-D-A_bSBK.js";
5
- import { n as m, t as h } from "./text-input-t-iE4dFj.js";
1
+ import { n as e, r as t, t as n } from "./alert-bsnEmrzb.js";
2
+ import { i as r, n as i, r as a, t as o } from "./badge-fffoaFuZ.js";
3
+ import { a as s, i as c, n as l, o as u, r as d, t as f } from "./button-BUziAVbu.js";
4
+ import { i as p, n as m, r as h, t as g } from "./tag-BdB0YDBJ.js";
5
+ import { n as _, t as v } from "./select-CWjTpHGb.js";
6
+ import { n as y, t as b } from "./checkbox-PAgQqiIw.js";
7
+ import { n as x, t as S } from "./radio-Cmrtred_.js";
8
+ import { n as C, t as w } from "./switch-CFv0JUeq.js";
9
+ import { n as T, t as E } from "./text-input-DxzwRS2R.js";
10
+ import { n as D, t as O } from "./text-area-DkjEGpHg.js";
11
+ import { a as k, i as A, n as j, r as M, t as N } from "./modal-IEXNB8St.js";
6
12
  import "./elements.js";
7
- export { a as OudsButton, p as OudsCheckbox, d as OudsSelect, l as OudsTag, h as OudsTextInput, i as buttonNavigations, t as buttonSizes, e as buttonTypes, r as buttonVariants, n as defineOudsButton, f as defineOudsCheckbox, u as defineOudsSelect, s as defineOudsTag, m as defineOudsTextInput, c as tagSizes, o as tagVariants };
13
+ export { n as OudsAlert, o as OudsBadge, f as OudsButton, b as OudsCheckbox, N as OudsModal, S as OudsRadio, v as OudsSelect, w as OudsSwitch, g as OudsTag, O as OudsTextArea, E as OudsTextInput, t as alertVariants, a as badgeSizes, r as badgeVariants, d as buttonNavigations, c as buttonSizes, s as buttonTypes, u as buttonVariants, e as defineOudsAlert, i as defineOudsBadge, l as defineOudsButton, y as defineOudsCheckbox, j as defineOudsModal, x as defineOudsRadio, _ as defineOudsSelect, C as defineOudsSwitch, m as defineOudsTag, D as defineOudsTextArea, T as defineOudsTextInput, M as modalSizes, A as modalTypes, k as modalVariants, h as tagSizes, p as tagVariants };
@@ -0,0 +1,181 @@
1
+ import { t as e } from "./control-item-slots-XV8Gjvf1.js";
2
+ import { computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, inject as c, isRef as l, mergeProps as u, normalizeClass as d, onBeforeUnmount as f, onMounted as p, openBlock as m, ref as h, renderSlot as g, resolveDynamicComponent as _, toDisplayString as v, unref as y, useAttrs as b, useHost as x, useId as S, watch as C, withCtx as w } from "vue";
3
+ //#region src/components/modal/modal.context.ts
4
+ var T = Symbol("ouds-modal-element-id"), E = [
5
+ "id",
6
+ "aria-labelledby",
7
+ "aria-describedby"
8
+ ], ee = { class: "modal-header" }, D = {
9
+ key: 0,
10
+ class: "modal-subtitle"
11
+ }, O = ["aria-hidden"], k = {
12
+ key: 0,
13
+ class: "visually-hidden"
14
+ }, A = ["aria-label"], j = ["id"], M = /* @__PURE__ */ s({
15
+ inheritAttrs: !1,
16
+ __name: "Modal",
17
+ props: {
18
+ open: {
19
+ type: Boolean,
20
+ default: !1
21
+ },
22
+ label: { default: "Dialog" },
23
+ description: { default: "" },
24
+ subtitle: { default: "" },
25
+ headingLevel: { default: "h2" },
26
+ type: { default: "dialog" },
27
+ size: { default: "default" },
28
+ variant: { default: "neutral" },
29
+ iconLabel: { default: "" },
30
+ fixedHeight: {
31
+ type: Boolean,
32
+ default: !1
33
+ },
34
+ nonBlurred: {
35
+ type: Boolean,
36
+ default: !1
37
+ },
38
+ stickyActions: {
39
+ type: Boolean,
40
+ default: !1
41
+ },
42
+ horizontalActions: {
43
+ type: Boolean,
44
+ default: !1
45
+ },
46
+ dismissible: {
47
+ type: Boolean,
48
+ default: !0
49
+ },
50
+ closeLabel: { default: "Close dialog" },
51
+ closeOnEscape: {
52
+ type: Boolean,
53
+ default: !0
54
+ },
55
+ closeOnBackdrop: {
56
+ type: Boolean,
57
+ default: !1
58
+ }
59
+ },
60
+ emits: [
61
+ "update:open",
62
+ "show",
63
+ "close",
64
+ "cancel"
65
+ ],
66
+ setup(s, { expose: M, emit: N }) {
67
+ let P = s, F = N, I = b(), L = c(T, void 0), R = L ? x() : void 0, z = e(!!L), B = S(), V = h(), H = t(() => `${L || `ouds-modal-${B}`}-title`), U = t(() => `${L || `ouds-modal-${B}`}-description`), W = t(() => P.iconLabel || {
68
+ neutral: "",
69
+ negative: "Error",
70
+ positive: "Success",
71
+ info: "Information",
72
+ warning: "Warning"
73
+ }[P.variant]);
74
+ function G() {
75
+ return P.stickyActions && !!(P.description || z("description") || z("default"));
76
+ }
77
+ let K = !1, q = !1;
78
+ function J(e) {
79
+ R && Reflect.set(R, "open", e), F("update:open", e);
80
+ }
81
+ function Y() {
82
+ V.value && !V.value.open && (K && X(), V.value.returnValue = "", V.value.showModal(), K = !0, J(!0), F("show"));
83
+ }
84
+ function X() {
85
+ K && V.value && !V.value.open && (K = !1, J(!1), F("close", V.value.returnValue));
86
+ }
87
+ function Z(e) {
88
+ V.value?.open && (V.value.close(e), X());
89
+ }
90
+ function Q(e) {
91
+ if (P.closeOnEscape || e.preventDefault(), R) {
92
+ let t = new CustomEvent("cancel", {
93
+ detail: [e],
94
+ cancelable: !0
95
+ });
96
+ R.dispatchEvent(t) || e.preventDefault();
97
+ } else F("cancel", e);
98
+ }
99
+ function $(e) {
100
+ let t = V.value;
101
+ if (!t || e.target !== t) return !1;
102
+ let n = t.getBoundingClientRect();
103
+ return e.clientX < n.left || e.clientX > n.right || e.clientY < n.top || e.clientY > n.bottom;
104
+ }
105
+ function te(e) {
106
+ P.closeOnBackdrop && q && $(e) && Z(), q = !1;
107
+ }
108
+ return C(() => P.open, (e) => {
109
+ e ? Y() : Z();
110
+ }, { flush: "post" }), p(() => {
111
+ P.open && Y();
112
+ }), f(() => {
113
+ K = !1, V.value?.open && V.value.close();
114
+ }), M({
115
+ showModal: Y,
116
+ close: Z
117
+ }), (e, t) => (m(), i("dialog", u({
118
+ ref_key: "dialog",
119
+ ref: V
120
+ }, y(I), {
121
+ id: y(L) ? `${y(I).id || y(L)}-dialog` : y(I).id || `ouds-modal-${y(B)}`,
122
+ class: ["modal-base", [s.type === "fullscreen" ? "modal-fullscreen-dialog" : "modal-dialog", {
123
+ "modal-small": s.type === "dialog" && s.size === "small",
124
+ "modal-fixed-height": s.type === "dialog" && s.fixedHeight,
125
+ "modal-non-blurred": s.type === "dialog" && s.nonBlurred
126
+ }]],
127
+ "aria-labelledby": y(I)["aria-labelledby"] || H.value,
128
+ "aria-describedby": y(I)["aria-describedby"] || (s.description || y(z)("description") ? U.value : void 0),
129
+ onCancel: Q,
130
+ onClose: X,
131
+ onPointerdown: t[1] ||= (e) => l(q) ? q.value = $(e) : q = $(e),
132
+ onClick: te
133
+ }), [
134
+ a("div", ee, [
135
+ g(e.$slots, "previous"),
136
+ s.subtitle || y(z)("subtitle") ? (m(), i("p", D, [g(e.$slots, "subtitle", {}, () => [o(v(s.subtitle), 1)])])) : r("", !0),
137
+ (m(), n(_(s.headingLevel), {
138
+ id: H.value,
139
+ class: "modal-title"
140
+ }, {
141
+ default: w(() => [s.variant !== "neutral" || y(z)("icon") ? (m(), i("span", {
142
+ key: 0,
143
+ class: d(["modal-icon", s.variant !== "neutral" && `modal-icon-${s.variant}`]),
144
+ "aria-hidden": !W.value || void 0
145
+ }, [W.value ? (m(), i("span", k, v(W.value), 1)) : r("", !0), s.variant === "neutral" ? g(e.$slots, "icon", {}, void 0, void 0, 1) : r("", !0)], 10, O)) : r("", !0), g(e.$slots, "title", {}, () => [o(v(s.label), 1)])]),
146
+ _: 3
147
+ }, 8, ["id"])),
148
+ s.dismissible ? (m(), i("button", {
149
+ key: 1,
150
+ type: "button",
151
+ class: "btn btn-close",
152
+ "aria-label": s.closeLabel,
153
+ onClick: t[0] ||= (e) => Z()
154
+ }, null, 8, A)) : r("", !0)
155
+ ]),
156
+ a("div", { class: d(["modal-body", { "pt-large": !s.description && !y(z)("description") && y(z)("default") }]) }, [
157
+ s.description || y(z)("description") ? (m(), i("p", {
158
+ key: 0,
159
+ id: U.value
160
+ }, [g(e.$slots, "description", {}, () => [o(v(s.description), 1)])], 8, j)) : r("", !0),
161
+ g(e.$slots, "default"),
162
+ y(z)("actions") && !G() ? (m(), i("div", {
163
+ key: 1,
164
+ class: d(["modal-footer", { "modal-footer-horizontal": s.horizontalActions }])
165
+ }, [g(e.$slots, "actions", { close: Z })], 2)) : r("", !0)
166
+ ], 2),
167
+ y(z)("actions") && G() ? (m(), i("div", {
168
+ key: 0,
169
+ class: d(["modal-footer", { "modal-footer-horizontal": s.horizontalActions }])
170
+ }, [g(e.$slots, "actions", { close: Z })], 2)) : r("", !0)
171
+ ], 16, E));
172
+ }
173
+ }), N = ["dialog", "fullscreen"], P = ["default", "small"], F = [
174
+ "neutral",
175
+ "negative",
176
+ "positive",
177
+ "info",
178
+ "warning"
179
+ ];
180
+ //#endregion
181
+ export { M as i, N as n, F as r, P as t };