@nilloq/ouds-web 0.1.5 → 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 (147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -72
  3. package/dist/alert-B4w3fDHo.js +89 -0
  4. package/dist/alert-Chns046l.js +77 -0
  5. package/dist/alert.js +2 -0
  6. package/dist/badge-CDpWg-AO.js +57 -0
  7. package/dist/badge-yaFEZnEW.js +54 -0
  8. package/dist/badge.js +2 -0
  9. package/dist/{button-LlRiSiGS.js → button-nN1Pcwm6.js} +36 -21
  10. package/dist/button-rgIJZsYq.js +94 -0
  11. package/dist/button.js +1 -1
  12. package/dist/checkbox-D7TFFuw3.js +196 -0
  13. package/dist/checkbox-DfYlHYR2.js +155 -0
  14. package/dist/checkbox.js +1 -1
  15. package/dist/chip-B3v4pWZD.js +92 -0
  16. package/dist/chip-DGfqitrQ.js +115 -0
  17. package/dist/chip.js +2 -0
  18. package/dist/control-item-slots-BDoeNuk4.js +15 -0
  19. package/dist/control-item-slots-Ddp7c8w8.js +12 -0
  20. package/dist/elements-alert.js +2 -0
  21. package/dist/elements-badge.js +2 -0
  22. package/dist/elements-button.js +1 -1
  23. package/dist/elements-checkbox.js +1 -1
  24. package/dist/elements-chip.js +2 -0
  25. package/dist/elements-modal.js +2 -0
  26. package/dist/elements-radio.js +2 -0
  27. package/dist/elements-select.js +1 -1
  28. package/dist/elements-switch.js +2 -0
  29. package/dist/elements-tag.js +1 -1
  30. package/dist/elements-text-area.js +2 -0
  31. package/dist/elements-text-input.js +1 -1
  32. package/dist/elements.js +14 -7
  33. package/dist/index.js +13 -6
  34. package/dist/modal-BAvMVUIE.js +193 -0
  35. package/dist/modal-BnT5Kxjg.js +181 -0
  36. package/dist/modal.js +2 -0
  37. package/dist/radio-CDq4r1_L.js +155 -0
  38. package/dist/radio-TaYThYkI.js +199 -0
  39. package/dist/radio.js +5 -0
  40. package/dist/{runtime-dom.esm-bundler-BzNNnH8h.js → runtime-dom.esm-bundler-DLryEdgJ.js} +987 -839
  41. package/dist/select--O3jL-En.js +134 -0
  42. package/dist/select-NiIx8bVD.js +191 -0
  43. package/dist/select.js +1 -1
  44. package/dist/switch-BmxLKPbL.js +179 -0
  45. package/dist/switch-D5N-j5F7.js +140 -0
  46. package/dist/switch.js +5 -0
  47. package/dist/tag-BvOt0v-c.js +84 -0
  48. package/dist/tag-Un7w0uDf.js +81 -0
  49. package/dist/tag.js +1 -1
  50. package/dist/text-area-BdmAyh3N.js +163 -0
  51. package/dist/text-area-BgYNtAMx.js +107 -0
  52. package/dist/text-area.js +5 -0
  53. package/dist/text-input-DgFIuIOA.js +235 -0
  54. package/dist/text-input-i559HVOP.js +163 -0
  55. package/dist/text-input.js +1 -1
  56. package/dist/types/alert.d.ts +1 -0
  57. package/dist/types/badge.d.ts +1 -0
  58. package/dist/types/chip.d.ts +1 -0
  59. package/dist/types/components/alert/Alert.vue.d.ts +37 -0
  60. package/dist/types/components/alert/alert.context.d.ts +2 -0
  61. package/dist/types/components/alert/alert.options.d.ts +2 -0
  62. package/dist/types/components/alert/alert.types.d.ts +14 -0
  63. package/dist/types/components/badge/Badge.vue.d.ts +26 -0
  64. package/dist/types/components/badge/badge.options.d.ts +4 -0
  65. package/dist/types/components/badge/badge.types.d.ts +13 -0
  66. package/dist/types/components/button/Button.vue.d.ts +8 -5
  67. package/dist/types/components/button/button.options.d.ts +1 -1
  68. package/dist/types/components/button/button.types.d.ts +2 -0
  69. package/dist/types/components/checkbox/Checkbox.vue.d.ts +13 -17
  70. package/dist/types/components/checkbox/VueCheckbox.vue.d.ts +18 -8
  71. package/dist/types/components/checkbox/checkbox.context.d.ts +2 -0
  72. package/dist/types/components/checkbox/checkbox.types.d.ts +20 -0
  73. package/dist/types/components/chip/Chip.vue.d.ts +38 -0
  74. package/dist/types/components/chip/VueChip.vue.d.ts +32 -0
  75. package/dist/types/components/chip/chip.context.d.ts +2 -0
  76. package/dist/types/components/chip/chip.types.d.ts +27 -0
  77. package/dist/types/components/modal/Modal.vue.d.ts +86 -0
  78. package/dist/types/components/modal/modal.context.d.ts +2 -0
  79. package/dist/types/components/modal/modal.options.d.ts +7 -0
  80. package/dist/types/components/modal/modal.types.d.ts +28 -0
  81. package/dist/types/components/radio/Radio.vue.d.ts +22 -0
  82. package/dist/types/components/radio/VueRadio.vue.d.ts +36 -0
  83. package/dist/types/components/radio/radio.context.d.ts +2 -0
  84. package/dist/types/components/radio/radio.types.d.ts +36 -0
  85. package/dist/types/components/select/Select.vue.d.ts +17 -17
  86. package/dist/types/components/select/VueSelect.vue.d.ts +24 -8
  87. package/dist/types/components/select/select.types.d.ts +28 -0
  88. package/dist/types/components/shared/control-item-slots.d.ts +3 -0
  89. package/dist/types/components/switch/Switch.vue.d.ts +20 -0
  90. package/dist/types/components/switch/VueSwitch.vue.d.ts +34 -0
  91. package/dist/types/components/switch/switch.context.d.ts +2 -0
  92. package/dist/types/components/switch/switch.types.d.ts +30 -0
  93. package/dist/types/components/tag/Tag.vue.d.ts +9 -4
  94. package/dist/types/components/tag/tag.options.d.ts +1 -1
  95. package/dist/types/components/tag/tag.types.d.ts +4 -0
  96. package/dist/types/components/text-area/TextArea.vue.d.ts +22 -0
  97. package/dist/types/components/text-area/VueTextArea.vue.d.ts +38 -0
  98. package/dist/types/components/text-area/text-area.types.d.ts +34 -0
  99. package/dist/types/components/text-input/TextInput.vue.d.ts +19 -34
  100. package/dist/types/components/text-input/VueTextInput.vue.d.ts +26 -16
  101. package/dist/types/components/text-input/text-input.types.d.ts +26 -0
  102. package/dist/types/elements/alert.d.ts +5 -0
  103. package/dist/types/elements/badge.d.ts +5 -0
  104. package/dist/types/elements/chip.d.ts +4 -0
  105. package/dist/types/elements/index.d.ts +15 -0
  106. package/dist/types/elements/modal.d.ts +5 -0
  107. package/dist/types/elements/radio.d.ts +4 -0
  108. package/dist/types/elements/switch.d.ts +4 -0
  109. package/dist/types/elements/text-area.d.ts +4 -0
  110. package/dist/types/modal.d.ts +1 -0
  111. package/dist/types/radio.d.ts +2 -0
  112. package/dist/types/switch.d.ts +2 -0
  113. package/dist/types/text-area.d.ts +2 -0
  114. package/dist/types/vue/alert.d.ts +3 -0
  115. package/dist/types/vue/badge.d.ts +3 -0
  116. package/dist/types/vue/checkbox.d.ts +1 -1
  117. package/dist/types/vue/chip.d.ts +2 -0
  118. package/dist/types/vue/index.d.ts +16 -3
  119. package/dist/types/vue/modal.d.ts +3 -0
  120. package/dist/types/vue/radio.d.ts +2 -0
  121. package/dist/types/vue/select.d.ts +1 -1
  122. package/dist/types/vue/switch.d.ts +2 -0
  123. package/dist/types/vue/text-area.d.ts +2 -0
  124. package/dist/types/vue/text-input.d.ts +1 -1
  125. package/dist/vue-alert.js +2 -0
  126. package/dist/vue-badge.js +2 -0
  127. package/dist/vue-button.js +1 -1
  128. package/dist/vue-checkbox.js +1 -1
  129. package/dist/vue-chip.js +2 -0
  130. package/dist/vue-modal.js +2 -0
  131. package/dist/vue-radio.js +2 -0
  132. package/dist/vue-select.js +1 -1
  133. package/dist/vue-switch.js +2 -0
  134. package/dist/vue-tag.js +1 -1
  135. package/dist/vue-text-area.js +2 -0
  136. package/dist/vue-text-input.js +1 -1
  137. package/dist/vue.js +13 -6
  138. package/package.json +96 -11
  139. package/dist/button-BPOKh6G4.js +0 -79
  140. package/dist/checkbox-BYrgMhwO.js +0 -105
  141. package/dist/checkbox-D-A_bSBK.js +0 -79
  142. package/dist/select-CA6TVlpX.js +0 -58
  143. package/dist/select-CKHEHpJL.js +0 -80
  144. package/dist/tag-B2qhuHjk.js +0 -41
  145. package/dist/tag-BY32Hj5n.js +0 -44
  146. package/dist/text-input-CtTr5yfe.js +0 -151
  147. package/dist/text-input-l1F2arKl.js +0 -201
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015-2026
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
package/README.md CHANGED
@@ -1,81 +1,26 @@
1
1
  # @nilloq/ouds-web
2
2
 
3
- OUDS Web 1.5 components available as Vue components and framework-independent Web Components (custom elements). Both APIs provide **Button**, **Tag**, **Checkbox**, **Select**, and **Text Input**. The playground demonstrates the components.
3
+ Vue components and framework-independent custom elements styled with OUDS Web 1.6.0.
4
4
 
5
- ## Vue components
5
+ ## Components
6
6
 
7
- Import components from `@nilloq/ouds-web/vue` and use them in your Vue templates. These are regular Vue components and support server-side rendering. For example:
7
+ - Alert
8
+ - Badge
9
+ - Button
10
+ - Checkbox
11
+ - Chip
12
+ - Modal
13
+ - Radio
14
+ - Select
15
+ - Switch
16
+ - Tag
17
+ - Text Area
18
+ - Text Input
8
19
 
9
- ```vue
10
- <script setup lang="ts">
11
- import { OudsButton } from "@nilloq/ouds-web/vue";
12
- </script>
20
+ ## Documentation and examples
13
21
 
14
- <template>
15
- <OudsButton>Continue</OudsButton>
16
- </template>
17
- ```
18
-
19
- Use the same pattern for the other components by importing their `Ouds…` component from the Vue entry point. For individual imports, use the matching subpath, such as `@nilloq/ouds-web/vue/button` or `@nilloq/ouds-web/vue/select`. Vue is an optional peer dependency, required only when using this API. Load OUDS Web CSS in the consuming app.
20
-
21
- ## Web components (custom elements)
22
-
23
- Custom elements can be used without a framework. They render in the light DOM so the page's OUDS stylesheet can style their native HTML. Vue is bundled into the custom element build, so consumers do not need to install or use Vue.
24
-
25
- Install the package:
26
-
27
- ```sh
28
- npm install @nilloq/ouds-web
29
- ```
30
-
31
- Include the OUDS Web Orange stylesheet in the consuming page. The components do not load global design-system styles automatically.
32
-
33
- ```html
34
- <link
35
- href="https://cdn.jsdelivr.net/npm/@ouds/web-orange@1.5.0/dist/css/ouds-web.min.css"
36
- rel="stylesheet"
37
- integrity="sha384-pASwsNEkGwpJibll6DpHIhi7kAiLDGTLmBJ5GVL1ZZe1iAGMLtrNQwksOznxX+gV"
38
- crossorigin="anonymous"
39
- />
40
- ```
41
-
42
- When using a bundler, import the package once to register all custom elements. Then use the matching HTML tag. For example:
43
-
44
- ```js
45
- import "@nilloq/ouds-web";
46
- ```
47
-
48
- ```html
49
- <ouds-button>Continue</ouds-button>
50
- ```
51
-
52
- The same pattern applies to the other elements: `<ouds-tag>`, `<ouds-checkbox>`, `<ouds-select>`, and `<ouds-text-input>`. Without a bundler, load the published ES module directly:
53
-
54
- ```html
55
- <script
56
- type="module"
57
- src="https://cdn.jsdelivr.net/npm/@nilloq/ouds-web@0.1.0/dist/index.js"
58
- ></script>
59
- ```
60
-
61
- To register only one custom element, import its subpath and call its `defineOuds…()` helper. For example:
62
-
63
- ```ts
64
- import { defineOudsButton } from "@nilloq/ouds-web/button";
65
-
66
- defineOudsButton();
67
- ```
68
-
69
- The subpath exports the component constructor and types without registering it automatically. The same subpath pattern is available for `tag`, `checkbox`, `select`, and `text-input`; the corresponding `components/…` subpaths are equivalent.
22
+ The [playground](https://nilloq.github.io/ouds-web/) has live examples and documents each component's attributes, slots, and events. Its getting-started guide covers installation and integration for Vue and custom elements.
70
23
 
71
24
  ## Development
72
25
 
73
- ```sh
74
- vp install
75
- vp run check
76
- vp test
77
- vp run build
78
- vp run playground
79
- ```
80
-
81
- `vp run playground` builds the custom element and starts the Vue demo app in `playground/`.
26
+ Run `vp install` to install dependencies. Use `vp run check` and `vp test` to validate changes, `vp run build` to build the library, and `vp run playground` to start the local playground.
@@ -0,0 +1,89 @@
1
+ import { A as e, E as t, N as n, O as r, a as i, c as a, d as o, f as s, g as c, i as l, j as u, l as d, o as f, r as p, t as m, u as h, v as g } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
2
+ import { r as _, t as v } from "./control-item-slots-BDoeNuk4.js";
3
+ //#region src/components/alert/alert.context.ts
4
+ var y = Symbol("ouds-alert-element"), b = {
5
+ key: 0,
6
+ class: "alert-icon"
7
+ }, x = {
8
+ key: 0,
9
+ class: "visually-hidden"
10
+ }, S = {
11
+ key: 1,
12
+ class: "alert-label"
13
+ }, C = {
14
+ key: 0,
15
+ class: "visually-hidden"
16
+ }, w = {
17
+ key: 2,
18
+ class: "alert-container"
19
+ }, T = { class: "alert-text-container" }, E = { class: "alert-label" }, D = {
20
+ key: 0,
21
+ class: "visually-hidden"
22
+ }, O = { key: 0 }, k = {
23
+ key: 3,
24
+ class: "alert-action-container"
25
+ }, A = { class: "alert-close-container" }, j = ["aria-label"], M = /* @__PURE__ */ o({
26
+ __name: "Alert",
27
+ props: {
28
+ variant: { default: "info" },
29
+ label: { default: "Alert" },
30
+ description: { default: "" },
31
+ inline: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ dismissible: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ closeLabel: { default: "Close alert" },
40
+ iconLabel: { default: "" }
41
+ },
42
+ emits: ["dismiss"],
43
+ setup(o, { emit: m }) {
44
+ let v = m, M = _(s(y, !1)), N = r(!1), P = i(() => [
45
+ "positive",
46
+ "info",
47
+ "warning",
48
+ "negative"
49
+ ].includes(o.variant));
50
+ function F() {
51
+ N.value = !0, v("dismiss");
52
+ }
53
+ return (r, i) => t((c(), d("div", { class: u([
54
+ "alert",
55
+ { "alert-message": !o.inline },
56
+ o.variant !== "neutral" && `alert-${o.variant}`
57
+ ]) }, [
58
+ P.value || e(M)("icon") ? (c(), d("div", b, [o.iconLabel ? (c(), d("span", x, n(o.iconLabel), 1)) : a("", !0), P.value ? a("", !0) : g(r.$slots, "icon", {}, void 0, void 0, 1)])) : a("", !0),
59
+ o.inline ? (c(), d("p", S, [!P.value && !e(M)("icon") && o.iconLabel ? (c(), d("span", C, n(o.iconLabel + " "), 1)) : a("", !0), e(M)("default") ? g(r.$slots, "default", {}, () => [h(n(o.label), 1)], void 0, 1) : (c(), d(l, { key: 2 }, [h(n(o.label), 1)], 64))])) : (c(), d("div", w, [f("div", T, [f("p", E, [!P.value && !e(M)("icon") && o.iconLabel ? (c(), d("span", D, n(o.iconLabel + " "), 1)) : a("", !0), e(M)("default") ? g(r.$slots, "default", {}, () => [h(n(o.label), 1)], void 0, 1) : (c(), d(l, { key: 2 }, [h(n(o.label), 1)], 64))]), o.description || e(M)("description") ? (c(), d("p", O, [g(r.$slots, "description", {}, () => [h(n(o.description), 1)])])) : a("", !0)]), g(r.$slots, "action")])),
60
+ !o.inline && o.dismissible ? (c(), d("div", k, [f("div", A, [f("button", {
61
+ type: "button",
62
+ class: "btn-close",
63
+ "aria-label": o.closeLabel,
64
+ onClick: F
65
+ }, null, 8, j)])])) : a("", !0)
66
+ ], 2)), [[p, !N.value]]);
67
+ }
68
+ }), N = [
69
+ "neutral",
70
+ "accent",
71
+ "positive",
72
+ "info",
73
+ "warning",
74
+ "negative"
75
+ ], P = m(M, {
76
+ shadowRoot: !1,
77
+ configureApp(e) {
78
+ e.provide(y, !0);
79
+ }
80
+ }), F = class extends P {
81
+ connectedCallback() {
82
+ v(this), super.connectedCallback();
83
+ }
84
+ };
85
+ function I() {
86
+ typeof customElements < "u" && (customElements.get("ouds-alert") || customElements.define("ouds-alert", F));
87
+ }
88
+ //#endregion
89
+ export { I as n, N as r, F as t };
@@ -0,0 +1,77 @@
1
+ import { n as e } from "./control-item-slots-Ddp7c8w8.js";
2
+ import { Fragment as t, computed as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, defineComponent as s, inject as c, normalizeClass as l, openBlock as u, ref as d, renderSlot as f, toDisplayString as p, unref as m, vShow as h, withDirectives as g } from "vue";
3
+ //#region src/components/alert/alert.context.ts
4
+ var _ = Symbol("ouds-alert-element"), v = {
5
+ key: 0,
6
+ class: "alert-icon"
7
+ }, y = {
8
+ key: 0,
9
+ class: "visually-hidden"
10
+ }, b = {
11
+ key: 1,
12
+ class: "alert-label"
13
+ }, x = {
14
+ key: 0,
15
+ class: "visually-hidden"
16
+ }, S = {
17
+ key: 2,
18
+ class: "alert-container"
19
+ }, C = { class: "alert-text-container" }, w = { class: "alert-label" }, T = {
20
+ key: 0,
21
+ class: "visually-hidden"
22
+ }, E = { key: 0 }, D = {
23
+ key: 3,
24
+ class: "alert-action-container"
25
+ }, O = { class: "alert-close-container" }, k = ["aria-label"], A = /* @__PURE__ */ s({
26
+ __name: "Alert",
27
+ props: {
28
+ variant: { default: "info" },
29
+ label: { default: "Alert" },
30
+ description: { default: "" },
31
+ inline: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ dismissible: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ closeLabel: { default: "Close alert" },
40
+ iconLabel: { default: "" }
41
+ },
42
+ emits: ["dismiss"],
43
+ setup(s, { emit: A }) {
44
+ let j = A, M = e(c(_, !1)), N = d(!1), P = n(() => [
45
+ "positive",
46
+ "info",
47
+ "warning",
48
+ "negative"
49
+ ].includes(s.variant));
50
+ function F() {
51
+ N.value = !0, j("dismiss");
52
+ }
53
+ return (e, n) => g((u(), i("div", { class: l([
54
+ "alert",
55
+ { "alert-message": !s.inline },
56
+ s.variant !== "neutral" && `alert-${s.variant}`
57
+ ]) }, [
58
+ P.value || m(M)("icon") ? (u(), i("div", v, [s.iconLabel ? (u(), i("span", y, p(s.iconLabel), 1)) : r("", !0), P.value ? r("", !0) : f(e.$slots, "icon", {}, void 0, void 0, 1)])) : r("", !0),
59
+ s.inline ? (u(), i("p", b, [!P.value && !m(M)("icon") && s.iconLabel ? (u(), i("span", x, p(s.iconLabel + " "), 1)) : r("", !0), m(M)("default") ? f(e.$slots, "default", {}, () => [o(p(s.label), 1)], void 0, 1) : (u(), i(t, { key: 2 }, [o(p(s.label), 1)], 64))])) : (u(), i("div", S, [a("div", C, [a("p", w, [!P.value && !m(M)("icon") && s.iconLabel ? (u(), i("span", T, p(s.iconLabel + " "), 1)) : r("", !0), m(M)("default") ? f(e.$slots, "default", {}, () => [o(p(s.label), 1)], void 0, 1) : (u(), i(t, { key: 2 }, [o(p(s.label), 1)], 64))]), s.description || m(M)("description") ? (u(), i("p", E, [f(e.$slots, "description", {}, () => [o(p(s.description), 1)])])) : r("", !0)]), f(e.$slots, "action")])),
60
+ !s.inline && s.dismissible ? (u(), i("div", D, [a("div", O, [a("button", {
61
+ type: "button",
62
+ class: "btn-close",
63
+ "aria-label": s.closeLabel,
64
+ onClick: F
65
+ }, null, 8, k)])])) : r("", !0)
66
+ ], 2)), [[h, !N.value]]);
67
+ }
68
+ }), j = [
69
+ "neutral",
70
+ "accent",
71
+ "positive",
72
+ "info",
73
+ "warning",
74
+ "negative"
75
+ ];
76
+ //#endregion
77
+ export { A as n, j as t };
package/dist/alert.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as e, r as t, t as n } from "./alert-B4w3fDHo.js";
2
+ export { n as OudsAlert, t as alertVariants, e as defineOudsAlert };
@@ -0,0 +1,57 @@
1
+ import { N as e, a as t, c as n, d as r, g as i, i as a, j as o, l as s, o as c, t as l, u, v as d } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
2
+ //#region src/components/badge/Badge.vue?vue&type=script&setup=true&lang.ts
3
+ var f = {
4
+ key: 0,
5
+ class: "badge-status-icon",
6
+ "aria-hidden": "true"
7
+ }, p = { class: "visually-hidden" }, m = /* @__PURE__ */ r({
8
+ __name: "Badge",
9
+ props: {
10
+ variant: { default: "negative" },
11
+ size: { default: "medium" },
12
+ count: {},
13
+ label: { default: "Notification" },
14
+ statusIcon: {
15
+ type: Boolean,
16
+ default: !1
17
+ },
18
+ disabled: {
19
+ type: Boolean,
20
+ default: !1
21
+ }
22
+ },
23
+ setup(r) {
24
+ let l = t(() => r.count !== void 0 && r.count !== null), m = t(() => [
25
+ "positive",
26
+ "info",
27
+ "warning",
28
+ "negative"
29
+ ].includes(r.variant)), h = t(() => [
30
+ "badge",
31
+ r.variant !== "negative" && `badge-${r.variant}`,
32
+ r.size !== "medium" && `badge-${r.size}`,
33
+ {
34
+ "badge-count": l.value,
35
+ disabled: r.disabled
36
+ }
37
+ ]);
38
+ return (t, g) => (i(), s("span", { class: o(h.value) }, [l.value ? (i(), s(a, { key: 0 }, [u(e(r.count), 1)], 64)) : d(t.$slots, "icon", {}, () => [r.statusIcon && m.value ? (i(), s("span", f)) : n("", !0)], void 0, 1), c("span", p, [u(e(l.value ? " " : ""), 1), d(t.$slots, "default", {}, () => [u(e(r.label), 1)])])], 2));
39
+ }
40
+ }), h = [
41
+ "negative",
42
+ "neutral",
43
+ "accent",
44
+ "positive",
45
+ "info",
46
+ "warning"
47
+ ], g = [
48
+ "xsmall",
49
+ "small",
50
+ "medium",
51
+ "large"
52
+ ], _ = l(m, { shadowRoot: !1 });
53
+ function v() {
54
+ typeof customElements < "u" && (customElements.get("ouds-badge") || customElements.define("ouds-badge", _));
55
+ }
56
+ //#endregion
57
+ export { h as i, v as n, g as r, _ as t };
@@ -0,0 +1,54 @@
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, toDisplayString as u } from "vue";
2
+ //#region src/components/badge/Badge.vue?vue&type=script&setup=true&lang.ts
3
+ var d = {
4
+ key: 0,
5
+ class: "badge-status-icon",
6
+ "aria-hidden": "true"
7
+ }, f = { class: "visually-hidden" }, p = /* @__PURE__ */ o({
8
+ __name: "Badge",
9
+ props: {
10
+ variant: { default: "negative" },
11
+ size: { default: "medium" },
12
+ count: {},
13
+ label: { default: "Notification" },
14
+ statusIcon: {
15
+ type: Boolean,
16
+ default: !1
17
+ },
18
+ disabled: {
19
+ type: Boolean,
20
+ default: !1
21
+ }
22
+ },
23
+ setup(o) {
24
+ let p = t(() => o.count !== void 0 && o.count !== null), m = t(() => [
25
+ "positive",
26
+ "info",
27
+ "warning",
28
+ "negative"
29
+ ].includes(o.variant)), h = t(() => [
30
+ "badge",
31
+ o.variant !== "negative" && `badge-${o.variant}`,
32
+ o.size !== "medium" && `badge-${o.size}`,
33
+ {
34
+ "badge-count": p.value,
35
+ disabled: o.disabled
36
+ }
37
+ ]);
38
+ return (t, g) => (c(), r("span", { class: s(h.value) }, [p.value ? (c(), r(e, { key: 0 }, [a(u(o.count), 1)], 64)) : l(t.$slots, "icon", {}, () => [o.statusIcon && m.value ? (c(), r("span", d)) : n("", !0)], void 0, 1), i("span", f, [a(u(p.value ? " " : ""), 1), l(t.$slots, "default", {}, () => [a(u(o.label), 1)])])], 2));
39
+ }
40
+ }), m = [
41
+ "negative",
42
+ "neutral",
43
+ "accent",
44
+ "positive",
45
+ "info",
46
+ "warning"
47
+ ], h = [
48
+ "xsmall",
49
+ "small",
50
+ "medium",
51
+ "large"
52
+ ];
53
+ //#endregion
54
+ export { m as n, p as r, h as t };
package/dist/badge.js ADDED
@@ -0,0 +1,2 @@
1
+ import { i as e, n as t, r as n, t as r } from "./badge-CDpWg-AO.js";
2
+ export { r as OudsBadge, n as badgeSizes, e as badgeVariants, t as defineOudsBadge };
@@ -1,19 +1,23 @@
1
- import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, toDisplayString as c } from "vue";
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, normalizeClass as a, openBlock as o, renderSlot as s, toDisplayString as c, useAttrs as l } from "vue";
2
2
  //#region src/components/button/Button.vue?vue&type=script&setup=true&lang.ts
3
- var l = ["type", "disabled"], u = {
3
+ var u = [
4
+ "type",
5
+ "disabled",
6
+ "aria-expanded"
7
+ ], d = {
4
8
  key: 0,
5
9
  class: "visually-hidden"
6
- }, d = {
10
+ }, f = {
7
11
  key: 1,
8
12
  viewBox: "0 0 40 40",
9
13
  xmlns: "http://www.w3.org/2000/svg",
10
14
  class: "loader",
11
15
  "aria-hidden": "true"
12
- }, f = {
16
+ }, p = {
13
17
  key: 2,
14
18
  role: "status",
15
19
  class: "visually-hidden"
16
- }, p = /* @__PURE__ */ i({
20
+ }, m = /* @__PURE__ */ i({
17
21
  __name: "Button",
18
22
  props: {
19
23
  type: { default: "button" },
@@ -23,8 +27,15 @@ var l = ["type", "disabled"], u = {
23
27
  type: Boolean,
24
28
  default: !1
25
29
  },
26
- ariaLabel: {},
27
30
  navigation: {},
31
+ expand: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ onColoredBg: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
28
39
  disabled: {
29
40
  type: Boolean,
30
41
  default: !1
@@ -35,42 +46,46 @@ var l = ["type", "disabled"], u = {
35
46
  }
36
47
  },
37
48
  setup(i) {
38
- let p = e(() => [
49
+ let m = l(), h = () => m["aria-label"] || m.ariaLabel, g = e(() => [
39
50
  "btn",
40
51
  `btn-${i.variant}`,
41
52
  {
42
53
  "btn-icon": i.iconOnly,
43
54
  "btn-small": i.size === "small",
55
+ "btn-expand": i.expand,
56
+ "btn-on-colored-bg": i.onColoredBg,
44
57
  "loading-indeterminate": i.loading
45
58
  },
46
59
  ...i.navigation ? [`btn-${i.navigation}`] : []
47
- ]), m = e(() => i.type === "submit" || i.type === "reset" ? i.type : "button");
48
- return (e, h) => (o(), n("button", {
49
- class: a(p.value),
50
- type: m.value,
51
- disabled: i.disabled || i.loading
60
+ ]), _ = e(() => i.type === "submit" || i.type === "reset" ? i.type : "button");
61
+ return (e, l) => (o(), n("button", {
62
+ class: a(g.value),
63
+ type: _.value,
64
+ disabled: i.disabled || i.loading,
65
+ "aria-expanded": !i.expand && void 0
52
66
  }, [
53
67
  s(e.$slots, "default"),
54
- i.ariaLabel ? (o(), n("span", u, c(i.ariaLabel), 1)) : t("", !0),
55
- i.loading ? (o(), n("svg", d, [...h[0] ||= [r("circle", {
68
+ h() ? (o(), n("span", d, c(h()), 1)) : t("", !0),
69
+ i.loading ? (o(), n("svg", f, [...l[0] ||= [r("circle", {
56
70
  class: "loader-inner",
57
71
  cx: "20",
58
72
  cy: "20",
59
73
  r: "17"
60
74
  }, null, -1)]])) : t("", !0),
61
- i.loading ? (o(), n("span", f, "Loading")) : t("", !0)
62
- ], 10, l));
75
+ i.loading ? (o(), n("span", p, "Loading")) : t("", !0)
76
+ ], 10, u));
63
77
  }
64
- }), m = [
78
+ }), h = [
65
79
  "default",
66
80
  "strong",
67
81
  "brand",
68
82
  "minimal",
69
- "negative"
70
- ], h = ["medium", "small"], g = [
83
+ "negative",
84
+ "assistant"
85
+ ], g = ["medium", "small"], _ = [
71
86
  "button",
72
87
  "submit",
73
88
  "reset"
74
- ], _ = ["previous", "next"];
89
+ ], v = ["previous", "next"];
75
90
  //#endregion
76
- export { p as a, m as i, h as n, g as r, _ as t };
91
+ export { m as a, h as i, g as n, _ as r, v as t };
@@ -0,0 +1,94 @@
1
+ import { N as e, a as t, b as n, c as r, d as i, g as a, j as o, l as s, o as c, t as l, v as u } from "./runtime-dom.esm-bundler-DLryEdgJ.js";
2
+ //#region src/components/button/Button.vue?vue&type=script&setup=true&lang.ts
3
+ var d = [
4
+ "type",
5
+ "disabled",
6
+ "aria-expanded"
7
+ ], f = {
8
+ key: 0,
9
+ class: "visually-hidden"
10
+ }, p = {
11
+ key: 1,
12
+ viewBox: "0 0 40 40",
13
+ xmlns: "http://www.w3.org/2000/svg",
14
+ class: "loader",
15
+ "aria-hidden": "true"
16
+ }, m = {
17
+ key: 2,
18
+ role: "status",
19
+ class: "visually-hidden"
20
+ }, h = /* @__PURE__ */ i({
21
+ __name: "Button",
22
+ props: {
23
+ type: { default: "button" },
24
+ variant: { default: "default" },
25
+ size: { default: "medium" },
26
+ iconOnly: {
27
+ type: Boolean,
28
+ default: !1
29
+ },
30
+ navigation: {},
31
+ expand: {
32
+ type: Boolean,
33
+ default: !1
34
+ },
35
+ onColoredBg: {
36
+ type: Boolean,
37
+ default: !1
38
+ },
39
+ disabled: {
40
+ type: Boolean,
41
+ default: !1
42
+ },
43
+ loading: {
44
+ type: Boolean,
45
+ default: !1
46
+ }
47
+ },
48
+ setup(i) {
49
+ let l = n(), h = () => l["aria-label"] || l.ariaLabel, g = t(() => [
50
+ "btn",
51
+ `btn-${i.variant}`,
52
+ {
53
+ "btn-icon": i.iconOnly,
54
+ "btn-small": i.size === "small",
55
+ "btn-expand": i.expand,
56
+ "btn-on-colored-bg": i.onColoredBg,
57
+ "loading-indeterminate": i.loading
58
+ },
59
+ ...i.navigation ? [`btn-${i.navigation}`] : []
60
+ ]), _ = t(() => i.type === "submit" || i.type === "reset" ? i.type : "button");
61
+ return (t, n) => (a(), s("button", {
62
+ class: o(g.value),
63
+ type: _.value,
64
+ disabled: i.disabled || i.loading,
65
+ "aria-expanded": !i.expand && void 0
66
+ }, [
67
+ u(t.$slots, "default"),
68
+ h() ? (a(), s("span", f, e(h()), 1)) : r("", !0),
69
+ i.loading ? (a(), s("svg", p, [...n[0] ||= [c("circle", {
70
+ class: "loader-inner",
71
+ cx: "20",
72
+ cy: "20",
73
+ r: "17"
74
+ }, null, -1)]])) : r("", !0),
75
+ i.loading ? (a(), s("span", m, "Loading")) : r("", !0)
76
+ ], 10, d));
77
+ }
78
+ }), g = [
79
+ "default",
80
+ "strong",
81
+ "brand",
82
+ "minimal",
83
+ "negative",
84
+ "assistant"
85
+ ], _ = ["medium", "small"], v = [
86
+ "button",
87
+ "submit",
88
+ "reset"
89
+ ], y = ["previous", "next"], b = l(h, { shadowRoot: !1 });
90
+ function x() {
91
+ typeof customElements < "u" && (customElements.get("ouds-button") || customElements.define("ouds-button", b));
92
+ }
93
+ //#endregion
94
+ export { v as a, _ as i, x as n, g as o, y as r, b as t };
package/dist/button.js CHANGED
@@ -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-rgIJZsYq.js";
2
2
  export { a as OudsButton, i as buttonNavigations, t as buttonSizes, e as buttonTypes, r as buttonVariants, n as defineOudsButton };