@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.
- package/LICENSE +21 -0
- package/README.md +49 -6
- package/dist/alert-By364Om4.js +77 -0
- package/dist/alert-bsnEmrzb.js +89 -0
- package/dist/alert.js +2 -0
- package/dist/badge-fffoaFuZ.js +57 -0
- package/dist/badge-yaFEZnEW.js +54 -0
- package/dist/badge.js +2 -0
- package/dist/button-BUziAVbu.js +94 -0
- package/dist/{button-LlRiSiGS.js → button-nN1Pcwm6.js} +36 -21
- package/dist/button.js +1 -1
- package/dist/checkbox-PAgQqiIw.js +145 -0
- package/dist/checkbox-g6cqR6wz.js +170 -0
- package/dist/checkbox.js +1 -1
- package/dist/control-item-slots-BNXNsI1e.js +12 -0
- package/dist/control-item-slots-XV8Gjvf1.js +9 -0
- package/dist/elements-alert.js +2 -0
- package/dist/elements-badge.js +2 -0
- package/dist/elements-button.js +1 -1
- package/dist/elements-checkbox.js +1 -1
- package/dist/elements-modal.js +2 -0
- package/dist/elements-radio.js +2 -0
- package/dist/elements-select.js +1 -1
- package/dist/elements-switch.js +2 -0
- package/dist/elements-tag.js +1 -1
- package/dist/elements-text-area.js +2 -0
- package/dist/elements-text-input.js +1 -1
- package/dist/elements.js +13 -7
- package/dist/index.js +12 -6
- package/dist/modal-CHjaB_yR.js +181 -0
- package/dist/modal-IEXNB8St.js +193 -0
- package/dist/modal.js +2 -0
- package/dist/radio-Cmrtred_.js +147 -0
- package/dist/radio-CqVqsZ7n.js +175 -0
- package/dist/radio.js +5 -0
- package/dist/{runtime-dom.esm-bundler-BzNNnH8h.js → runtime-dom.esm-bundler-BeOO_l6v.js} +987 -839
- package/dist/select-Bpou1HIY.js +167 -0
- package/dist/select-CWjTpHGb.js +126 -0
- package/dist/select.js +1 -1
- package/dist/switch-CFv0JUeq.js +132 -0
- package/dist/switch-DEYsTCw5.js +157 -0
- package/dist/switch.js +5 -0
- package/dist/tag-BdB0YDBJ.js +84 -0
- package/dist/tag-Un7w0uDf.js +81 -0
- package/dist/tag.js +1 -1
- package/dist/text-area-DkjEGpHg.js +99 -0
- package/dist/text-area-DqBoz2_d.js +139 -0
- package/dist/text-area.js +5 -0
- package/dist/text-input-DnWjB1vE.js +207 -0
- package/dist/text-input-DxzwRS2R.js +157 -0
- package/dist/text-input.js +1 -1
- package/dist/types/alert.d.ts +1 -0
- package/dist/types/badge.d.ts +1 -0
- package/dist/types/components/alert/Alert.vue.d.ts +37 -0
- package/dist/types/components/alert/alert.context.d.ts +2 -0
- package/dist/types/components/alert/alert.options.d.ts +2 -0
- package/dist/types/components/alert/alert.types.d.ts +14 -0
- package/dist/types/components/badge/Badge.vue.d.ts +26 -0
- package/dist/types/components/badge/badge.options.d.ts +4 -0
- package/dist/types/components/badge/badge.types.d.ts +13 -0
- package/dist/types/components/button/Button.vue.d.ts +7 -4
- package/dist/types/components/button/button.options.d.ts +1 -1
- package/dist/types/components/button/button.types.d.ts +2 -0
- package/dist/types/components/checkbox/Checkbox.vue.d.ts +13 -6
- package/dist/types/components/checkbox/VueCheckbox.vue.d.ts +9 -5
- package/dist/types/components/checkbox/checkbox.context.d.ts +2 -0
- package/dist/types/components/checkbox/checkbox.types.d.ts +4 -0
- package/dist/types/components/modal/Modal.vue.d.ts +86 -0
- package/dist/types/components/modal/modal.context.d.ts +2 -0
- package/dist/types/components/modal/modal.options.d.ts +7 -0
- package/dist/types/components/modal/modal.types.d.ts +28 -0
- package/dist/types/components/radio/Radio.vue.d.ts +37 -0
- package/dist/types/components/radio/VueRadio.vue.d.ts +34 -0
- package/dist/types/components/radio/radio.context.d.ts +2 -0
- package/dist/types/components/radio/radio.types.d.ts +20 -0
- package/dist/types/components/select/Select.vue.d.ts +21 -4
- package/dist/types/components/select/VueSelect.vue.d.ts +15 -5
- package/dist/types/components/select/select.types.d.ts +10 -0
- package/dist/types/components/shared/control-item-slots.d.ts +2 -0
- package/dist/types/components/switch/Switch.vue.d.ts +32 -0
- package/dist/types/components/switch/VueSwitch.vue.d.ts +28 -0
- package/dist/types/components/switch/switch.context.d.ts +2 -0
- package/dist/types/components/switch/switch.types.d.ts +17 -0
- package/dist/types/components/tag/Tag.vue.d.ts +8 -3
- package/dist/types/components/tag/tag.options.d.ts +1 -1
- package/dist/types/components/tag/tag.types.d.ts +4 -0
- package/dist/types/components/text-area/TextArea.vue.d.ts +36 -0
- package/dist/types/components/text-area/VueTextArea.vue.d.ts +32 -0
- package/dist/types/components/text-area/text-area.types.d.ts +19 -0
- package/dist/types/components/text-input/TextInput.vue.d.ts +17 -15
- package/dist/types/components/text-input/VueTextInput.vue.d.ts +17 -13
- package/dist/types/components/text-input/text-input.types.d.ts +1 -0
- package/dist/types/elements/alert.d.ts +5 -0
- package/dist/types/elements/badge.d.ts +5 -0
- package/dist/types/elements/index.d.ts +13 -0
- package/dist/types/elements/modal.d.ts +5 -0
- package/dist/types/elements/radio.d.ts +4 -0
- package/dist/types/elements/switch.d.ts +4 -0
- package/dist/types/elements/text-area.d.ts +4 -0
- package/dist/types/modal.d.ts +1 -0
- package/dist/types/radio.d.ts +2 -0
- package/dist/types/switch.d.ts +2 -0
- package/dist/types/text-area.d.ts +2 -0
- package/dist/types/vue/alert.d.ts +3 -0
- package/dist/types/vue/badge.d.ts +3 -0
- package/dist/types/vue/index.d.ts +11 -0
- package/dist/types/vue/modal.d.ts +3 -0
- package/dist/types/vue/radio.d.ts +2 -0
- package/dist/types/vue/switch.d.ts +2 -0
- package/dist/types/vue/text-area.d.ts +2 -0
- package/dist/vue-alert.js +2 -0
- package/dist/vue-badge.js +2 -0
- package/dist/vue-button.js +1 -1
- package/dist/vue-checkbox.js +1 -1
- package/dist/vue-modal.js +2 -0
- package/dist/vue-radio.js +2 -0
- package/dist/vue-select.js +1 -1
- package/dist/vue-switch.js +2 -0
- package/dist/vue-tag.js +1 -1
- package/dist/vue-text-area.js +2 -0
- package/dist/vue-text-input.js +1 -1
- package/dist/vue.js +12 -6
- package/package.json +82 -10
- package/dist/button-BPOKh6G4.js +0 -79
- package/dist/checkbox-BYrgMhwO.js +0 -105
- package/dist/checkbox-D-A_bSBK.js +0 -79
- package/dist/select-CA6TVlpX.js +0 -58
- package/dist/select-CKHEHpJL.js +0 -80
- package/dist/tag-B2qhuHjk.js +0 -41
- package/dist/tag-BY32Hj5n.js +0 -44
- package/dist/text-input-CtTr5yfe.js +0 -151
- 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,6 +1,6 @@
|
|
|
1
1
|
# @nilloq/ouds-web
|
|
2
2
|
|
|
3
|
-
OUDS Web 1.
|
|
3
|
+
OUDS Web 1.6.0 components available as Vue components and framework-independent Web Components (custom elements). Both APIs provide **Alert**, **Badge**, **Button**, **Modal**, **Tag**, **Checkbox**, **Radio**, **Switch**, **Select**, **Text Input**, and **Text Area**. The playground demonstrates the components.
|
|
4
4
|
|
|
5
5
|
## Vue components
|
|
6
6
|
|
|
@@ -32,9 +32,9 @@ Include the OUDS Web Orange stylesheet in the consuming page. The components do
|
|
|
32
32
|
|
|
33
33
|
```html
|
|
34
34
|
<link
|
|
35
|
-
href="https://cdn.jsdelivr.net/npm/@ouds/web-orange@1.
|
|
35
|
+
href="https://cdn.jsdelivr.net/npm/@ouds/web-orange@1.6.0/dist/css/ouds-web.min.css"
|
|
36
36
|
rel="stylesheet"
|
|
37
|
-
integrity="sha384
|
|
37
|
+
integrity="sha384-/CYsyb9K6r8k5oSHG3szNxLYPR1OclHp84CIR093c9+junu5Wt5IWbhIweVxLGUZ"
|
|
38
38
|
crossorigin="anonymous"
|
|
39
39
|
/>
|
|
40
40
|
```
|
|
@@ -49,12 +49,12 @@ import "@nilloq/ouds-web";
|
|
|
49
49
|
<ouds-button>Continue</ouds-button>
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
The same pattern applies to the other elements: `<ouds-tag>`, `<ouds-checkbox>`, `<ouds-select>`, and `<ouds-text-
|
|
52
|
+
The same pattern applies to the other elements: `<ouds-modal>`, `<ouds-alert>`, `<ouds-badge>`, `<ouds-tag>`, `<ouds-checkbox>`, `<ouds-radio>`, `<ouds-switch>`, `<ouds-select>`, `<ouds-text-input>`, and `<ouds-text-area>`. Without a bundler, load the published ES module directly:
|
|
53
53
|
|
|
54
54
|
```html
|
|
55
55
|
<script
|
|
56
56
|
type="module"
|
|
57
|
-
src="https://cdn.jsdelivr.net/npm/@nilloq/ouds-web@
|
|
57
|
+
src="https://cdn.jsdelivr.net/npm/@nilloq/ouds-web@{{libraryVersion}}/dist/index.js"
|
|
58
58
|
></script>
|
|
59
59
|
```
|
|
60
60
|
|
|
@@ -66,7 +66,50 @@ import { defineOudsButton } from "@nilloq/ouds-web/button";
|
|
|
66
66
|
defineOudsButton();
|
|
67
67
|
```
|
|
68
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-
|
|
69
|
+
The subpath exports the component constructor and types without registering it automatically. The same subpath pattern is available for `modal`, `alert`, `badge`, `tag`, `checkbox`, `radio`, `switch`, `select`, `text-input`, and `text-area`; the corresponding `components/…` subpaths are equivalent.
|
|
70
|
+
|
|
71
|
+
## Modal dialogs
|
|
72
|
+
|
|
73
|
+
`OudsModal` uses a native `<dialog>` for focus handling and background inertness. It needs OUDS CSS and no OUDS JavaScript or invoker/closedby polyfills.
|
|
74
|
+
|
|
75
|
+
```vue
|
|
76
|
+
<script setup lang="ts">
|
|
77
|
+
import { ref } from "vue";
|
|
78
|
+
import { OudsModal, OudsButton } from "@nilloq/ouds-web/vue";
|
|
79
|
+
const open = ref(false);
|
|
80
|
+
</script>
|
|
81
|
+
|
|
82
|
+
<template>
|
|
83
|
+
<OudsButton @click="open = true">Edit preferences</OudsButton>
|
|
84
|
+
<OudsModal v-model:open="open" label="Preferences" description="Review your settings.">
|
|
85
|
+
<template #actions="{ close }">
|
|
86
|
+
<OudsButton variant="strong" @click="close('saved')">Save</OudsButton>
|
|
87
|
+
<OudsButton @click="close()">Cancel</OudsButton>
|
|
88
|
+
</template>
|
|
89
|
+
</OudsModal>
|
|
90
|
+
</template>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
For custom elements, register with `defineOudsModal` from `@nilloq/ouds-web/modal`. After the element mounts, call `element.showModal()` / `element.close(returnValue?)`, or set its boolean `open` property. The `open` attribute also opens it. A `form method="dialog"` inside a slot closes it with the submit button's value. Set Boolean properties to `false` to disable defaults; an attribute such as `dismissible="false"` is still present and does not disable the option.
|
|
94
|
+
|
|
95
|
+
| Property | Default | Purpose |
|
|
96
|
+
| ------------------------------------ | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
97
|
+
| `label`, `description`, `subtitle` | `Dialog`, empty, empty | Dialog text; the title, description, and subtitle slots override these. |
|
|
98
|
+
| `headingLevel` | `h2` | Heading tag, `h1` through `h6`. |
|
|
99
|
+
| `type` | `dialog` | `dialog` or `fullscreen`. |
|
|
100
|
+
| `size` | `default` | `default` or `small`; standard dialogs only. |
|
|
101
|
+
| `fixedHeight`, `nonBlurred` | `false` | Standard dialog height and backdrop variants. |
|
|
102
|
+
| `variant` | `neutral` | `neutral`, `negative`, `positive`, `info`, or `warning`. |
|
|
103
|
+
| `iconLabel` | Status name | Localized accessible status label for functional icons. |
|
|
104
|
+
| `stickyActions`, `horizontalActions` | `false` | Footer placement and mobile action layout. Sticky actions require description or body content; otherwise the footer stays in the body. |
|
|
105
|
+
| `dismissible` | `true` | Show the close button. |
|
|
106
|
+
| `closeLabel` | `Close dialog` | Localized close button label. |
|
|
107
|
+
| `closeOnEscape` | `true` | Allow Escape dismissal. |
|
|
108
|
+
| `closeOnBackdrop` | `false` | Allow clicks outside the dialog to dismiss it. |
|
|
109
|
+
|
|
110
|
+
Slots: `title`, `subtitle`, `description`, `icon` (neutral variant), `previous`, `actions`, and the default rich body slot. Vue's `actions` slot receives `close(returnValue?)`. Supply actions in primary, secondary, tertiary order. Use `autofocus` on content that should receive initial focus. Rounded corners use the global OUDS parent class `use-rounded-corner-modal`.
|
|
111
|
+
|
|
112
|
+
Events: `show` after opening; `close` with the return value; `cancel` for Escape. Vue receives the return value directly and the native cancel event. Custom elements expose the return value as `event.detail[0]` and a cancellable `cancel` event. Calling `preventDefault()` in a cancel listener keeps the dialog open. Vue also emits `update:open` for model synchronization. Use the component methods for opening so state stays synchronized. Separate Vue applications sharing a document should configure unique `app.config.idPrefix` values for generated IDs.
|
|
70
113
|
|
|
71
114
|
## Development
|
|
72
115
|
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { t as e } from "./control-item-slots-XV8Gjvf1.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 };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { A as e, E as t, M 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-BeOO_l6v.js";
|
|
2
|
+
import { n as _, t as v } from "./control-item-slots-BNXNsI1e.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 };
|
package/dist/alert.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { M 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-BeOO_l6v.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,94 @@
|
|
|
1
|
+
import { M 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-BeOO_l6v.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 };
|
|
@@ -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
|
|
3
|
+
var u = [
|
|
4
|
+
"type",
|
|
5
|
+
"disabled",
|
|
6
|
+
"aria-expanded"
|
|
7
|
+
], d = {
|
|
4
8
|
key: 0,
|
|
5
9
|
class: "visually-hidden"
|
|
6
|
-
},
|
|
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
|
-
},
|
|
16
|
+
}, p = {
|
|
13
17
|
key: 2,
|
|
14
18
|
role: "status",
|
|
15
19
|
class: "visually-hidden"
|
|
16
|
-
},
|
|
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
|
|
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
|
-
]),
|
|
48
|
-
return (e,
|
|
49
|
-
class: a(
|
|
50
|
-
type:
|
|
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
|
-
|
|
55
|
-
i.loading ? (o(), n("svg",
|
|
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",
|
|
62
|
-
], 10,
|
|
75
|
+
i.loading ? (o(), n("span", p, "Loading")) : t("", !0)
|
|
76
|
+
], 10, u));
|
|
63
77
|
}
|
|
64
|
-
}),
|
|
78
|
+
}), h = [
|
|
65
79
|
"default",
|
|
66
80
|
"strong",
|
|
67
81
|
"brand",
|
|
68
82
|
"minimal",
|
|
69
|
-
"negative"
|
|
70
|
-
|
|
83
|
+
"negative",
|
|
84
|
+
"assistant"
|
|
85
|
+
], g = ["medium", "small"], _ = [
|
|
71
86
|
"button",
|
|
72
87
|
"submit",
|
|
73
88
|
"reset"
|
|
74
|
-
],
|
|
89
|
+
], v = ["previous", "next"];
|
|
75
90
|
//#endregion
|
|
76
|
-
export {
|
|
91
|
+
export { m as a, h as i, g as n, _ as r, v 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-
|
|
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 };
|