@nilloq/ouds-web 0.0.0-stage → 0.1.3

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 (62) hide show
  1. package/README.md +80 -2
  2. package/dist/button-DdoJkL_N.js +59 -0
  3. package/dist/button-z6rNROko.js +62 -0
  4. package/dist/button.js +2 -0
  5. package/dist/checkbox-BYrgMhwO.js +105 -0
  6. package/dist/checkbox-CS0xyJ93.js +79 -0
  7. package/dist/checkbox.js +5 -0
  8. package/dist/elements-button.js +2 -0
  9. package/dist/elements-checkbox.js +2 -0
  10. package/dist/elements-select.js +2 -0
  11. package/dist/elements-tag.js +2 -0
  12. package/dist/elements-text-input.js +2 -0
  13. package/dist/elements.js +8 -0
  14. package/dist/index.js +7 -0
  15. package/dist/runtime-dom.esm-bundler-Bh0p0Jto.js +2782 -0
  16. package/dist/select-6rG9CVMu.js +58 -0
  17. package/dist/select-CKHEHpJL.js +80 -0
  18. package/dist/select.js +5 -0
  19. package/dist/tag-Gq6ZayFl.js +37 -0
  20. package/dist/tag-XX1_lffX.js +34 -0
  21. package/dist/tag.js +2 -0
  22. package/dist/text-input-9GVktDML.js +113 -0
  23. package/dist/text-input-DLbvTlpY.js +73 -0
  24. package/dist/text-input.js +5 -0
  25. package/dist/types/button.d.ts +1 -0
  26. package/dist/types/checkbox.d.ts +2 -0
  27. package/dist/types/components/button/Button.vue.d.ts +22 -0
  28. package/dist/types/components/button/button.types.d.ts +14 -0
  29. package/dist/types/components/checkbox/Checkbox.vue.d.ts +26 -0
  30. package/dist/types/components/checkbox/VueCheckbox.vue.d.ts +24 -0
  31. package/dist/types/components/checkbox/checkbox.types.d.ts +14 -0
  32. package/dist/types/components/select/Select.vue.d.ts +26 -0
  33. package/dist/types/components/select/VueSelect.vue.d.ts +24 -0
  34. package/dist/types/components/select/select.types.d.ts +12 -0
  35. package/dist/types/components/tag/Tag.vue.d.ts +20 -0
  36. package/dist/types/components/tag/tag.types.d.ts +9 -0
  37. package/dist/types/components/text-input/TextInput.vue.d.ts +31 -0
  38. package/dist/types/components/text-input/VueTextInput.vue.d.ts +30 -0
  39. package/dist/types/components/text-input/text-input.types.d.ts +14 -0
  40. package/dist/types/elements/button.d.ts +4 -0
  41. package/dist/types/elements/checkbox.d.ts +4 -0
  42. package/dist/types/elements/index.d.ts +10 -0
  43. package/dist/types/elements/select.d.ts +4 -0
  44. package/dist/types/elements/tag.d.ts +4 -0
  45. package/dist/types/elements/text-input.d.ts +4 -0
  46. package/dist/types/index.d.ts +1 -0
  47. package/dist/types/select.d.ts +2 -0
  48. package/dist/types/tag.d.ts +1 -0
  49. package/dist/types/text-input.d.ts +2 -0
  50. package/dist/types/vue/button.d.ts +2 -0
  51. package/dist/types/vue/checkbox.d.ts +2 -0
  52. package/dist/types/vue/index.d.ts +10 -0
  53. package/dist/types/vue/select.d.ts +2 -0
  54. package/dist/types/vue/tag.d.ts +2 -0
  55. package/dist/types/vue/text-input.d.ts +2 -0
  56. package/dist/vue-button.js +2 -0
  57. package/dist/vue-checkbox.js +2 -0
  58. package/dist/vue-select.js +2 -0
  59. package/dist/vue-tag.js +2 -0
  60. package/dist/vue-text-input.js +2 -0
  61. package/dist/vue.js +6 -0
  62. package/package.json +126 -4
package/README.md CHANGED
@@ -1,3 +1,81 @@
1
- # Temporary Holding Version
1
+ # @nilloq/ouds-web
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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.
4
+
5
+ ## Vue components
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:
8
+
9
+ ```vue
10
+ <script setup lang="ts">
11
+ import { OudsButton } from "@nilloq/ouds-web/vue";
12
+ </script>
13
+
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.
70
+
71
+ ## Development
72
+
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/`.
@@ -0,0 +1,59 @@
1
+ import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, createTextVNode as i, defineComponent as a, normalizeClass as o, openBlock as s, renderSlot as c } from "vue";
2
+ //#region src/components/button/Button.vue?vue&type=script&setup=true&lang.ts
3
+ var l = ["type", "disabled"], u = {
4
+ key: 0,
5
+ viewBox: "0 0 40 40",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ class: "loader",
8
+ "aria-hidden": "true"
9
+ }, d = {
10
+ key: 1,
11
+ role: "status",
12
+ class: "visually-hidden"
13
+ }, f = /* @__PURE__ */ a({
14
+ __name: "Button",
15
+ props: {
16
+ type: { default: "button" },
17
+ variant: { default: "default" },
18
+ size: { default: "medium" },
19
+ iconOnly: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ disabled: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ loading: {
28
+ type: Boolean,
29
+ default: !1
30
+ }
31
+ },
32
+ setup(a) {
33
+ let f = e(() => [
34
+ "btn",
35
+ `btn-${a.variant}`,
36
+ {
37
+ "btn-icon": a.iconOnly,
38
+ "btn-small": a.size === "small",
39
+ "loading-indeterminate": a.loading
40
+ }
41
+ ]), p = e(() => a.type === "submit" || a.type === "reset" ? a.type : "button");
42
+ return (e, m) => (s(), n("button", {
43
+ class: o(f.value),
44
+ type: p.value,
45
+ disabled: a.disabled || a.loading
46
+ }, [
47
+ c(e.$slots, "default", {}, () => [m[0] ||= i("Button", -1)]),
48
+ a.loading ? (s(), n("svg", u, [...m[1] ||= [r("circle", {
49
+ class: "loader-inner",
50
+ cx: "20",
51
+ cy: "20",
52
+ r: "17"
53
+ }, null, -1)]])) : t("", !0),
54
+ a.loading ? (s(), n("span", d, "Loading")) : t("", !0)
55
+ ], 10, l));
56
+ }
57
+ });
58
+ //#endregion
59
+ export { f as t };
@@ -0,0 +1,62 @@
1
+ import { a as e, c as t, f as n, i as r, o as i, r as a, s as o, t as s, u as c, v as l } from "./runtime-dom.esm-bundler-Bh0p0Jto.js";
2
+ //#region src/components/button/Button.vue?vue&type=script&setup=true&lang.ts
3
+ var u = ["type", "disabled"], d = {
4
+ key: 0,
5
+ viewBox: "0 0 40 40",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ class: "loader",
8
+ "aria-hidden": "true"
9
+ }, f = {
10
+ key: 1,
11
+ role: "status",
12
+ class: "visually-hidden"
13
+ }, p = s(/* @__PURE__ */ t({
14
+ __name: "Button",
15
+ props: {
16
+ type: { default: "button" },
17
+ variant: { default: "default" },
18
+ size: { default: "medium" },
19
+ iconOnly: {
20
+ type: Boolean,
21
+ default: !1
22
+ },
23
+ disabled: {
24
+ type: Boolean,
25
+ default: !1
26
+ },
27
+ loading: {
28
+ type: Boolean,
29
+ default: !1
30
+ }
31
+ },
32
+ setup(t) {
33
+ let s = a(() => [
34
+ "btn",
35
+ `btn-${t.variant}`,
36
+ {
37
+ "btn-icon": t.iconOnly,
38
+ "btn-small": t.size === "small",
39
+ "loading-indeterminate": t.loading
40
+ }
41
+ ]), p = a(() => t.type === "submit" || t.type === "reset" ? t.type : "button");
42
+ return (a, m) => (c(), i("button", {
43
+ class: l(s.value),
44
+ type: p.value,
45
+ disabled: t.disabled || t.loading
46
+ }, [
47
+ n(a.$slots, "default", {}, () => [m[0] ||= o("Button", -1)]),
48
+ t.loading ? (c(), i("svg", d, [...m[1] ||= [r("circle", {
49
+ class: "loader-inner",
50
+ cx: "20",
51
+ cy: "20",
52
+ r: "17"
53
+ }, null, -1)]])) : e("", !0),
54
+ t.loading ? (c(), i("span", f, "Loading")) : e("", !0)
55
+ ], 10, u));
56
+ }
57
+ }), { shadowRoot: !1 });
58
+ function m() {
59
+ typeof customElements < "u" && (customElements.get("ouds-button") || customElements.define("ouds-button", p));
60
+ }
61
+ //#endregion
62
+ export { m as n, p as t };
package/dist/button.js ADDED
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./button-z6rNROko.js";
2
+ export { t as OudsButton, e as defineOudsButton };
@@ -0,0 +1,105 @@
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, ref as f, renderSlot as p, toDisplayString as m, unref as h, useAttrs as g, useId as _, useModel as v, watchEffect as y, withCtx as b } from "vue";
2
+ //#region src/components/checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
3
+ var x = { class: "control-item-assets-container" }, S = [
4
+ "id",
5
+ "value",
6
+ "checked",
7
+ "disabled",
8
+ "required",
9
+ "aria-describedby"
10
+ ], C = { class: "control-item-text-container" }, w = ["for"], T = ["id"], E = {
11
+ key: 0,
12
+ class: "control-item-assets-container"
13
+ }, D = /* @__PURE__ */ s({
14
+ inheritAttrs: !1,
15
+ __name: "Checkbox",
16
+ props: {
17
+ id: {},
18
+ label: { default: "Checkbox" },
19
+ description: { default: "" },
20
+ value: { default: "" },
21
+ checked: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ disabled: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ required: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ divider: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ indeterminate: {
38
+ type: Boolean,
39
+ default: !1
40
+ }
41
+ },
42
+ setup(t) {
43
+ let a = g(), s = f(), c = _(), v = e(() => t.id || `ouds-checkbox-${c}`), b = e(() => `${v.value}-description`), D = e(() => {
44
+ let e = [a["aria-describedby"]];
45
+ return t.description && e.push(b.value), e.filter(Boolean).join(" ") || void 0;
46
+ }), O = e(() => ["checkbox-item", { "control-item-divider": t.divider }]);
47
+ return y(() => {
48
+ s.value && (s.value.indeterminate = t.indeterminate);
49
+ }), (e, c) => (d(), r("div", { class: u(O.value) }, [
50
+ i("div", x, [i("input", l({
51
+ ref_key: "input",
52
+ ref: s
53
+ }, h(a), {
54
+ id: v.value,
55
+ class: "control-item-indicator",
56
+ type: "checkbox",
57
+ value: t.value,
58
+ checked: t.checked,
59
+ disabled: t.disabled,
60
+ required: t.required,
61
+ "aria-describedby": D.value
62
+ }), null, 16, S)]),
63
+ i("div", C, [i("label", {
64
+ class: "control-item-label",
65
+ for: v.value
66
+ }, [p(e.$slots, "label", {}, () => [o(m(t.label), 1)])], 8, w), t.description ? (d(), r("p", {
67
+ key: 0,
68
+ id: b.value,
69
+ class: "control-item-description"
70
+ }, m(t.description), 9, T)) : n("", !0)]),
71
+ e.$slots.asset ? (d(), r("div", E, [p(e.$slots, "asset")])) : n("", !0)
72
+ ], 2));
73
+ }
74
+ }), O = /* @__PURE__ */ s({
75
+ inheritAttrs: !1,
76
+ __name: "VueCheckbox",
77
+ props: {
78
+ modelValue: {
79
+ type: Boolean,
80
+ default: !1
81
+ },
82
+ modelModifiers: {}
83
+ },
84
+ emits: /*@__PURE__*/ c(["change"], ["update:modelValue"]),
85
+ setup(e, { emit: n }) {
86
+ let r = v(e, "modelValue"), i = n;
87
+ function o(e) {
88
+ r.value = e.target.checked, i("change", e);
89
+ }
90
+ return (e, n) => (d(), t(D, l(e.$attrs, {
91
+ checked: r.value,
92
+ onChange: o
93
+ }), a({ _: 2 }, [e.$slots.label ? {
94
+ name: "label",
95
+ fn: b(() => [p(e.$slots, "label")]),
96
+ key: "0"
97
+ } : void 0, e.$slots.asset ? {
98
+ name: "asset",
99
+ fn: b(() => [p(e.$slots, "asset")]),
100
+ key: "1"
101
+ } : void 0]), 1040, ["checked"]));
102
+ }
103
+ });
104
+ //#endregion
105
+ export { O as t };
@@ -0,0 +1,79 @@
1
+ import { _ as e, a as t, c as n, f as r, g as i, h as a, i as o, l as s, m as c, o as l, p as u, r as d, s as f, t as p, u as m, v as h, y as g } from "./runtime-dom.esm-bundler-Bh0p0Jto.js";
2
+ //#region src/components/checkbox/Checkbox.vue?vue&type=script&setup=true&lang.ts
3
+ var _ = { class: "control-item-assets-container" }, v = [
4
+ "id",
5
+ "value",
6
+ "checked",
7
+ "disabled",
8
+ "required",
9
+ "aria-describedby"
10
+ ], y = { class: "control-item-text-container" }, b = ["for"], x = ["id"], S = {
11
+ key: 0,
12
+ class: "control-item-assets-container"
13
+ }, C = p(/* @__PURE__ */ n({
14
+ inheritAttrs: !1,
15
+ __name: "Checkbox",
16
+ props: {
17
+ id: {},
18
+ label: { default: "Checkbox" },
19
+ description: { default: "" },
20
+ value: { default: "" },
21
+ checked: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ disabled: {
26
+ type: Boolean,
27
+ default: !1
28
+ },
29
+ required: {
30
+ type: Boolean,
31
+ default: !1
32
+ },
33
+ divider: {
34
+ type: Boolean,
35
+ default: !1
36
+ },
37
+ indeterminate: {
38
+ type: Boolean,
39
+ default: !1
40
+ }
41
+ },
42
+ setup(n) {
43
+ let p = u(), C = i(), w = c(), T = d(() => n.id || `ouds-checkbox-${w}`), E = d(() => `${T.value}-description`), D = d(() => {
44
+ let e = [p["aria-describedby"]];
45
+ return n.description && e.push(E.value), e.filter(Boolean).join(" ") || void 0;
46
+ }), O = d(() => ["checkbox-item", { "control-item-divider": n.divider }]);
47
+ return a(() => {
48
+ C.value && (C.value.indeterminate = n.indeterminate);
49
+ }), (i, a) => (m(), l("div", { class: h(O.value) }, [
50
+ o("div", _, [o("input", s({
51
+ ref_key: "input",
52
+ ref: C
53
+ }, e(p), {
54
+ id: T.value,
55
+ class: "control-item-indicator",
56
+ type: "checkbox",
57
+ value: n.value,
58
+ checked: n.checked,
59
+ disabled: n.disabled,
60
+ required: n.required,
61
+ "aria-describedby": D.value
62
+ }), null, 16, v)]),
63
+ o("div", y, [o("label", {
64
+ class: "control-item-label",
65
+ for: T.value
66
+ }, [r(i.$slots, "label", {}, () => [f(g(n.label), 1)])], 8, b), n.description ? (m(), l("p", {
67
+ key: 0,
68
+ id: E.value,
69
+ class: "control-item-description"
70
+ }, g(n.description), 9, x)) : t("", !0)]),
71
+ i.$slots.asset ? (m(), l("div", S, [r(i.$slots, "asset")])) : t("", !0)
72
+ ], 2));
73
+ }
74
+ }), { shadowRoot: !1 });
75
+ function w() {
76
+ typeof customElements < "u" && (customElements.get("ouds-checkbox") || customElements.define("ouds-checkbox", C));
77
+ }
78
+ //#endregion
79
+ export { w as n, C as t };
@@ -0,0 +1,5 @@
1
+ import { n as e, t } from "./checkbox-CS0xyJ93.js";
2
+ //#region src/checkbox.ts
3
+ e();
4
+ //#endregion
5
+ export { t as OudsCheckbox, e as defineOudsCheckbox };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./button-z6rNROko.js";
2
+ export { t as OudsButton, e as defineOudsButton };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./checkbox-CS0xyJ93.js";
2
+ export { t as OudsCheckbox, e as defineOudsCheckbox };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./select-6rG9CVMu.js";
2
+ export { t as OudsSelect, e as defineOudsSelect };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./tag-Gq6ZayFl.js";
2
+ export { t as OudsTag, e as defineOudsTag };
@@ -0,0 +1,2 @@
1
+ import { n as e, t } from "./text-input-DLbvTlpY.js";
2
+ export { t as OudsTextInput, e as defineOudsTextInput };
@@ -0,0 +1,8 @@
1
+ import { n as e, t } from "./button-z6rNROko.js";
2
+ import { n, t as r } from "./tag-Gq6ZayFl.js";
3
+ import { n as i, t as a } from "./select-6rG9CVMu.js";
4
+ import { n as o, t as s } from "./checkbox-CS0xyJ93.js";
5
+ import { n as c, t as l } from "./text-input-DLbvTlpY.js";
6
+ e(), n(), i(), o(), c();
7
+ //#endregion
8
+ export { t as OudsButton, s as OudsCheckbox, a as OudsSelect, r as OudsTag, l as OudsTextInput, e as defineOudsButton, o as defineOudsCheckbox, i as defineOudsSelect, n as defineOudsTag, c as defineOudsTextInput };
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import { n as e, t } from "./button-z6rNROko.js";
2
+ import { n, t as r } from "./tag-Gq6ZayFl.js";
3
+ import { n as i, t as a } from "./select-6rG9CVMu.js";
4
+ import { n as o, t as s } from "./checkbox-CS0xyJ93.js";
5
+ import { n as c, t as l } from "./text-input-DLbvTlpY.js";
6
+ import "./elements.js";
7
+ export { t as OudsButton, s as OudsCheckbox, a as OudsSelect, r as OudsTag, l as OudsTextInput, e as defineOudsButton, o as defineOudsCheckbox, i as defineOudsSelect, n as defineOudsTag, c as defineOudsTextInput };