opui-css 5.2.0 → 5.4.0
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/CHANGELOG.md +14 -0
- package/components/Accordion/Accordion.vue +38 -0
- package/components/Anchor/Anchor.vue +41 -0
- package/components/Avatar/Avatar.vue +24 -0
- package/components/Avatar/types.d.vue.ts +2 -2
- package/components/Badge/Badge.vue +39 -0
- package/components/Button/Button.vue +27 -0
- package/components/Button/types.ts +0 -3
- package/components/ButtonGroup/ButtonGroup.vue +22 -0
- package/components/Callout/Callout.vue +63 -0
- package/components/Card/Card.vue +28 -0
- package/components/Card/types.ts +1 -0
- package/components/Checkbox/Checkbox.vue +43 -0
- package/components/Checkbox/CheckboxInput.vue +32 -0
- package/components/Checkbox/types.ts +0 -1
- package/components/Chip/Chip.vue +37 -0
- package/components/ClassicSelect/ClassicSelect.vue +54 -0
- package/components/ClassicSelect/types.ts +0 -4
- package/components/DescriptionList/Description.vue +12 -0
- package/components/DescriptionList/DescriptionList.vue +23 -0
- package/components/DescriptionList/Item.vue +12 -0
- package/components/DescriptionList/Term.vue +12 -0
- package/components/Dialog/Dialog.vue +35 -0
- package/components/Dialog/types.ts +1 -0
- package/components/Divider/Divider.vue +12 -0
- package/components/Drawer/Drawer.astro +9 -3
- package/components/Drawer/Drawer.vue +46 -0
- package/components/Drawer/DrawerFooter.vue +16 -0
- package/components/Drawer/DrawerHeader.vue +36 -0
- package/components/Drawer/types.d.vue.ts +3 -1
- package/components/Drawer/types.ts +1 -0
- package/components/FieldDescription/FieldDescription.vue +12 -0
- package/components/FieldGroup/FieldGroup.vue +25 -0
- package/components/FieldLegend/FieldLegend.vue +18 -0
- package/components/FieldSet/FieldSet.vue +18 -0
- package/components/Form/Form.vue +14 -0
- package/components/IconButton/IconButton.vue +24 -0
- package/components/List/List.vue +28 -0
- package/components/ListItem/ListItem.vue +98 -0
- package/components/Progress/Progress.vue +34 -0
- package/components/Radio/Radio.vue +41 -0
- package/components/Radio/RadioInput.vue +14 -0
- package/components/Radio/types.ts +0 -1
- package/components/Range/Range.vue +85 -0
- package/components/Range/types.ts +0 -5
- package/components/Select/Select.astro +0 -6
- package/components/Select/Select.vue +85 -0
- package/components/Switch/Switch.vue +63 -0
- package/components/Switch/SwitchInput.vue +14 -0
- package/components/Table/Body.vue +5 -0
- package/components/Table/Cell.vue +5 -0
- package/components/Table/Column.vue +19 -0
- package/components/Table/ColumnGroup.vue +5 -0
- package/components/Table/Head.vue +5 -0
- package/components/Table/HeaderCell.vue +5 -0
- package/components/Table/Row.vue +5 -0
- package/components/Table/Table.vue +19 -0
- package/components/Tabs/Tabs.vue +20 -0
- package/components/Tabs/TabsItem.vue +39 -0
- package/components/Tabs/TabsPanel.vue +31 -0
- package/components/Tabs/TabsTab.vue +24 -0
- package/components/TextField/TextField.vue +74 -0
- package/components/TextField/types.d.vue.ts +3 -1
- package/components/Textarea/Textarea.vue +64 -0
- package/components/Textarea/types.d.vue.ts +1 -0
- package/components/Toast/Toast.vue +48 -0
- package/components/ToggleButton/ToggleButton.vue +41 -0
- package/components/ToggleGroup/ToggleGroup.vue +36 -0
- package/components/Tooltip/Tooltip.vue +22 -0
- package/core/normalize.css +24 -10
- package/core/utils.css +1 -3
- package/css/components/accordion.css +4 -5
- package/css/components/button.css +5 -4
- package/css/components/dialog.css +8 -13
- package/css/components/drawer.css +2 -1
- package/css/components/icon-button.css +8 -10
- package/css/components/progress.css +23 -27
- package/css/components/range.css +3 -6
- package/css/components/select.css +6 -7
- package/css/components/switch.css +17 -18
- package/css/components/text-field.css +3 -3
- package/dist/opui.components.css +79 -94
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +104 -107
- package/dist/opui.css.map +1 -1
- package/package.json +14 -3
- package/vue/index.ts +54 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.4.0 - 2026-06-09
|
|
4
|
+
|
|
5
|
+
- Added global control for motion that lets you enable or disable all motion with a single class `.ui-motion-on`, `.ui-motion-off`, `.ui-motion-debug`. By default it will listen to `prefers-reduced-motion`. Locally each component individually has `--_motion` variable that can be changed as well.
|
|
6
|
+
|
|
7
|
+
## 5.3.0 - 2026-06-04
|
|
8
|
+
|
|
9
|
+
Vue support! 🎉
|
|
10
|
+
It's a lot of work but hopefully it's all good with them.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Vue components, importable from `opui-css/vue`.
|
|
15
|
+
- Adjusted types for Vue, Svelte and Solid.
|
|
16
|
+
|
|
3
17
|
## 5.2.0 - 2026-06-03
|
|
4
18
|
|
|
5
19
|
### Changed
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useId } from "vue"
|
|
3
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
4
|
+
|
|
5
|
+
const { class: className, name, open, variant } = defineProps<Props>()
|
|
6
|
+
defineSlots<Slots>()
|
|
7
|
+
|
|
8
|
+
const summaryId = useId()
|
|
9
|
+
const contentId = useId()
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<details
|
|
14
|
+
:name="name"
|
|
15
|
+
:class="['ui-accordion', 'ui-card', variant && `ui-${variant}`, className]"
|
|
16
|
+
:open="open"
|
|
17
|
+
>
|
|
18
|
+
<!-- Summary -->
|
|
19
|
+
<summary :id="summaryId" :aria-controls="contentId">
|
|
20
|
+
<slot name="summary"></slot><slot name="marker"></slot>
|
|
21
|
+
</summary>
|
|
22
|
+
|
|
23
|
+
<!-- Content -->
|
|
24
|
+
<div
|
|
25
|
+
:id="contentId"
|
|
26
|
+
class="ui-content"
|
|
27
|
+
role="region"
|
|
28
|
+
:aria-labelledby="summaryId"
|
|
29
|
+
>
|
|
30
|
+
<slot></slot>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<!-- Actions -->
|
|
34
|
+
<div v-if="$slots.actions" class="ui-actions">
|
|
35
|
+
<slot name="actions"></slot>
|
|
36
|
+
</div>
|
|
37
|
+
</details>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useId } from "vue"
|
|
3
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
4
|
+
|
|
5
|
+
const { alignment, id: idProp, trigger = "always" } = defineProps<Props>()
|
|
6
|
+
defineSlots<Slots>()
|
|
7
|
+
|
|
8
|
+
const isHover = trigger === "hover"
|
|
9
|
+
const uid = useId()
|
|
10
|
+
const id = isHover ? (idProp ?? uid) : undefined
|
|
11
|
+
|
|
12
|
+
const insetMap: Record<string, string> = {
|
|
13
|
+
"start start": "auto 100% 100% auto",
|
|
14
|
+
"start end": "auto auto 100% 100%",
|
|
15
|
+
"end start": "100% 100% auto auto",
|
|
16
|
+
"end end": "100% auto auto 100%",
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const positionArea = alignment
|
|
20
|
+
? {
|
|
21
|
+
"--anchor-position-area": alignment,
|
|
22
|
+
"--_anchor-inset": insetMap[alignment],
|
|
23
|
+
}
|
|
24
|
+
: {}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<span :class="['ui-anchor', $props.class]" :style="positionArea">
|
|
29
|
+
<span v-if="isHover" :interestfor="id">
|
|
30
|
+
<slot></slot>
|
|
31
|
+
</span>
|
|
32
|
+
<slot v-else></slot>
|
|
33
|
+
<span
|
|
34
|
+
class="ui-anchor-floating"
|
|
35
|
+
:id="id"
|
|
36
|
+
:popover="isHover ? 'hint' : undefined"
|
|
37
|
+
>
|
|
38
|
+
<slot name="anchored"></slot>
|
|
39
|
+
</span>
|
|
40
|
+
</span>
|
|
41
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
3
|
+
|
|
4
|
+
const { alt, as, href, isGroup, src, variant } = defineProps<Props>()
|
|
5
|
+
defineSlots<Slots>()
|
|
6
|
+
|
|
7
|
+
const Tag = as || (href ? "a" : "div")
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<component
|
|
12
|
+
:is="Tag"
|
|
13
|
+
:class="[
|
|
14
|
+
{ 'ui-avatar': !isGroup },
|
|
15
|
+
!isGroup && variant && `ui-${variant}`,
|
|
16
|
+
$props.class,
|
|
17
|
+
]"
|
|
18
|
+
:href="href"
|
|
19
|
+
:role="isGroup ? 'group' : undefined"
|
|
20
|
+
>
|
|
21
|
+
<img v-if="src" :src="src" :alt="alt" />
|
|
22
|
+
<slot v-else></slot>
|
|
23
|
+
</component>
|
|
24
|
+
</template>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { HTMLAttributes, ImgHTMLAttributes, Slot } from "vue"
|
|
2
|
-
import type {
|
|
2
|
+
import type { Props as BaseProps } from "./types"
|
|
3
3
|
|
|
4
4
|
export type Props = BaseProps &
|
|
5
|
-
Pick<ImgHTMLAttributes,
|
|
5
|
+
Pick<ImgHTMLAttributes, "alt" | "src"> & {
|
|
6
6
|
class?: HTMLAttributes["class"]
|
|
7
7
|
}
|
|
8
8
|
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import Anchor from "../Anchor/Anchor.vue"
|
|
3
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
4
|
+
|
|
5
|
+
const { alignment, color, dot, invisible, label } = defineProps<Props>()
|
|
6
|
+
defineSlots<Slots>()
|
|
7
|
+
|
|
8
|
+
const positionArea =
|
|
9
|
+
alignment === "start-start"
|
|
10
|
+
? "start start"
|
|
11
|
+
: alignment === "end-start"
|
|
12
|
+
? "end start"
|
|
13
|
+
: alignment === "end-end"
|
|
14
|
+
? "end end"
|
|
15
|
+
: undefined
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<Anchor
|
|
20
|
+
:alignment="positionArea"
|
|
21
|
+
:class="[
|
|
22
|
+
'ui-badge',
|
|
23
|
+
{
|
|
24
|
+
'ui-dot': dot,
|
|
25
|
+
'ui-invisible': invisible,
|
|
26
|
+
},
|
|
27
|
+
alignment && `ui-${alignment}`,
|
|
28
|
+
color && `ui-${color}`,
|
|
29
|
+
$props.class,
|
|
30
|
+
]"
|
|
31
|
+
>
|
|
32
|
+
<slot></slot>
|
|
33
|
+
<template #anchored>
|
|
34
|
+
<span class="ui-badge-indicator" :aria-label="label?.toString()">{{
|
|
35
|
+
dot ? "" : label
|
|
36
|
+
}}</span>
|
|
37
|
+
</template>
|
|
38
|
+
</Anchor>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
3
|
+
|
|
4
|
+
const { as, color, disabled, href, size, variant } = defineProps<Props>()
|
|
5
|
+
defineSlots<Slots>()
|
|
6
|
+
|
|
7
|
+
const Tag = as || (href ? "a" : "button")
|
|
8
|
+
const isButton = Tag === "button"
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<component
|
|
13
|
+
:is="Tag"
|
|
14
|
+
:class="[
|
|
15
|
+
'ui-button',
|
|
16
|
+
{ 'ui-disabled': isButton && disabled },
|
|
17
|
+
size && `ui-${size}`,
|
|
18
|
+
variant && `ui-${variant}`,
|
|
19
|
+
color && `ui-${color}`,
|
|
20
|
+
$props.class,
|
|
21
|
+
]"
|
|
22
|
+
:disabled="isButton ? disabled : undefined"
|
|
23
|
+
:href="href"
|
|
24
|
+
>
|
|
25
|
+
<slot></slot>
|
|
26
|
+
</component>
|
|
27
|
+
</template>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
3
|
+
|
|
4
|
+
const props = defineProps<Props>()
|
|
5
|
+
defineSlots<Slots>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div
|
|
10
|
+
:class="[
|
|
11
|
+
'ui-button-group',
|
|
12
|
+
props.color && `ui-${props.color}`,
|
|
13
|
+
props.size && `ui-${props.size}`,
|
|
14
|
+
props.variant && `ui-${props.variant}`,
|
|
15
|
+
props.orientation && `ui-${props.orientation}`,
|
|
16
|
+
props.class,
|
|
17
|
+
]"
|
|
18
|
+
role="group"
|
|
19
|
+
>
|
|
20
|
+
<slot></slot>
|
|
21
|
+
</div>
|
|
22
|
+
</template>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
3
|
+
|
|
4
|
+
const { severity, variant } = defineProps<Props>()
|
|
5
|
+
const slots = defineSlots<Slots>()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<article
|
|
10
|
+
role="note"
|
|
11
|
+
:class="[
|
|
12
|
+
'ui-callout',
|
|
13
|
+
variant && `ui-${variant}`,
|
|
14
|
+
severity && `ui-${severity}`,
|
|
15
|
+
$props.class,
|
|
16
|
+
]"
|
|
17
|
+
>
|
|
18
|
+
<slot name="icon">
|
|
19
|
+
<svg
|
|
20
|
+
v-if="severity === 'info'"
|
|
21
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
22
|
+
width="32"
|
|
23
|
+
height="32"
|
|
24
|
+
viewBox="0 0 32 32"
|
|
25
|
+
>
|
|
26
|
+
<path
|
|
27
|
+
fill="currentColor"
|
|
28
|
+
d="M16 13a1 1 0 0 1 1 1v9a1 1 0 1 1-2 0v-9a1 1 0 0 1 1-1m0-2a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3M2 16C2 8.268 8.268 2 16 2s14 6.268 14 14s-6.268 14-14 14S2 23.732 2 16M16 4C9.373 4 4 9.373 4 16s5.373 12 12 12s12-5.373 12-12S22.627 4 16 4"
|
|
29
|
+
/>
|
|
30
|
+
</svg>
|
|
31
|
+
<svg
|
|
32
|
+
v-if="severity === 'warning'"
|
|
33
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
34
|
+
width="32"
|
|
35
|
+
height="32"
|
|
36
|
+
viewBox="0 0 32 32"
|
|
37
|
+
>
|
|
38
|
+
<path
|
|
39
|
+
fill="currentColor"
|
|
40
|
+
d="M17.25 22a1.25 1.25 0 1 1-2.5 0a1.25 1.25 0 0 1 2.5 0M16 9a1 1 0 0 0-1 1v8a1 1 0 1 0 2 0v-8a1 1 0 0 0-1-1m-3.064-5.191c1.332-2.41 4.796-2.41 6.128 0l10.493 18.999C30.846 25.14 29.158 28 26.494 28H5.507c-2.665 0-4.352-2.86-3.064-5.192zm4.377.967a1.5 1.5 0 0 0-2.626 0L4.194 23.775A1.5 1.5 0 0 0 5.507 26h20.987a1.5 1.5 0 0 0 1.313-2.225z"
|
|
41
|
+
/>
|
|
42
|
+
</svg>
|
|
43
|
+
<svg
|
|
44
|
+
v-if="severity === 'critical'"
|
|
45
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
+
width="32"
|
|
47
|
+
height="32"
|
|
48
|
+
viewBox="0 0 48 48"
|
|
49
|
+
>
|
|
50
|
+
<path
|
|
51
|
+
fill="currentColor"
|
|
52
|
+
d="M24 13c.69 0 1.25.56 1.25 1.25v12.5a1.25 1.25 0 1 1-2.5 0v-12.5c0-.69.56-1.25 1.25-1.25m0 21a2 2 0 1 0 0-4a2 2 0 0 0 0 4M4 24C4 12.954 12.954 4 24 4s20 8.954 20 20s-8.954 20-20 20S4 35.046 4 24M24 6.5C14.335 6.5 6.5 14.335 6.5 24S14.335 41.5 24 41.5S41.5 33.665 41.5 24S33.665 6.5 24 6.5"
|
|
53
|
+
/>
|
|
54
|
+
</svg>
|
|
55
|
+
</slot>
|
|
56
|
+
<div class="ui-content">
|
|
57
|
+
<h3 v-if="slots.title" class="ui-title">
|
|
58
|
+
<slot name="title"></slot>
|
|
59
|
+
</h3>
|
|
60
|
+
<slot></slot>
|
|
61
|
+
</div>
|
|
62
|
+
</article>
|
|
63
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useSlots } from "vue"
|
|
3
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
4
|
+
|
|
5
|
+
const { actionsAlign, variant } = defineProps<Props>()
|
|
6
|
+
const slots = defineSlots<Slots>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div :class="['ui-card', variant && `ui-${variant}`, $props.class]">
|
|
11
|
+
<hgroup v-if="slots.header">
|
|
12
|
+
<slot name="header"></slot>
|
|
13
|
+
</hgroup>
|
|
14
|
+
|
|
15
|
+
<div v-if="slots.content" class="ui-content">
|
|
16
|
+
<slot name="content"></slot>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<slot></slot>
|
|
20
|
+
|
|
21
|
+
<div
|
|
22
|
+
v-if="slots.actions"
|
|
23
|
+
:class="['ui-actions', actionsAlign && `ui-align-${actionsAlign}`]"
|
|
24
|
+
>
|
|
25
|
+
<slot name="actions"></slot>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
</template>
|
package/components/Card/types.ts
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import CheckboxInput from "./CheckboxInput.vue"
|
|
3
|
+
import type { CheckboxProps, Slots } from "./types.d.vue"
|
|
4
|
+
import { useId } from "vue"
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const props = defineProps<CheckboxProps>()
|
|
11
|
+
defineSlots<Slots>()
|
|
12
|
+
const modelValue = defineModel<boolean | (string | number)[]>()
|
|
13
|
+
|
|
14
|
+
const endTextId = useId()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<label
|
|
19
|
+
:class="[
|
|
20
|
+
'ui-checkbox',
|
|
21
|
+
props.size && `ui-${props.size}`,
|
|
22
|
+
{
|
|
23
|
+
'ui-stack': props.stack,
|
|
24
|
+
'ui-spread': props.spread,
|
|
25
|
+
},
|
|
26
|
+
props.class,
|
|
27
|
+
]"
|
|
28
|
+
:data-invalid="props.error || undefined"
|
|
29
|
+
>
|
|
30
|
+
<CheckboxInput
|
|
31
|
+
v-bind="$attrs"
|
|
32
|
+
v-model="modelValue"
|
|
33
|
+
:aria-describedby="$slots['end-text'] ? endTextId : undefined"
|
|
34
|
+
:indeterminate="props.indeterminate"
|
|
35
|
+
/>
|
|
36
|
+
<span :class="[props.hideLabel ? 'ui-sr-only' : 'ui-label']"
|
|
37
|
+
><slot></slot
|
|
38
|
+
></span>
|
|
39
|
+
<span :id="endTextId" class="ui-end-text" v-if="$slots['end-text']">
|
|
40
|
+
<slot name="end-text"></slot>
|
|
41
|
+
</span>
|
|
42
|
+
</label>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { CheckboxInputProps } from "./types"
|
|
3
|
+
import { useAttrs, useTemplateRef, watchPostEffect } from "vue"
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const attrs = useAttrs()
|
|
10
|
+
const props = defineProps<CheckboxInputProps>()
|
|
11
|
+
const modelValue = defineModel<boolean | (string | number)[]>()
|
|
12
|
+
|
|
13
|
+
const input = useTemplateRef<HTMLInputElement>("input")
|
|
14
|
+
|
|
15
|
+
if (modelValue.value === undefined && attrs.checked !== undefined) {
|
|
16
|
+
modelValue.value = attrs.checked !== false
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
watchPostEffect(() => {
|
|
20
|
+
if (input.value) input.value.indeterminate = Boolean(props.indeterminate)
|
|
21
|
+
})
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<input
|
|
26
|
+
ref="input"
|
|
27
|
+
type="checkbox"
|
|
28
|
+
:data-indeterminate="props.indeterminate || undefined"
|
|
29
|
+
v-bind="$attrs"
|
|
30
|
+
v-model="modelValue"
|
|
31
|
+
/>
|
|
32
|
+
</template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue"
|
|
3
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
4
|
+
|
|
5
|
+
const {
|
|
6
|
+
as,
|
|
7
|
+
label,
|
|
8
|
+
multiline,
|
|
9
|
+
size,
|
|
10
|
+
variant = "tonal",
|
|
11
|
+
href,
|
|
12
|
+
} = defineProps<Props>()
|
|
13
|
+
defineSlots<Slots>()
|
|
14
|
+
|
|
15
|
+
const tag = computed(() => as || (href ? "a" : "div"))
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template>
|
|
19
|
+
<component
|
|
20
|
+
:is="tag"
|
|
21
|
+
:class="[
|
|
22
|
+
'ui-chip',
|
|
23
|
+
{
|
|
24
|
+
'ui-multiline': multiline,
|
|
25
|
+
},
|
|
26
|
+
size && `ui-${size}`,
|
|
27
|
+
variant && `ui-${variant}`,
|
|
28
|
+
$props.class,
|
|
29
|
+
]"
|
|
30
|
+
:href="tag === 'a' ? href : undefined"
|
|
31
|
+
>
|
|
32
|
+
<slot name="start"></slot>
|
|
33
|
+
<slot></slot>
|
|
34
|
+
<span v-if="label" class="ui-text">{{ label }}</span>
|
|
35
|
+
<slot name="end"></slot>
|
|
36
|
+
</component>
|
|
37
|
+
</template>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { ClassicSelectProps, Slots } from "./types.d.vue"
|
|
3
|
+
import { useId } from "vue"
|
|
4
|
+
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const props = withDefaults(defineProps<ClassicSelectProps>(), {
|
|
10
|
+
items: () => [],
|
|
11
|
+
variant: "outlined",
|
|
12
|
+
})
|
|
13
|
+
defineSlots<Slots>()
|
|
14
|
+
const modelValue = defineModel<string | number | (string | number)[]>()
|
|
15
|
+
|
|
16
|
+
const selectId = props.id || useId()
|
|
17
|
+
const labelId = useId()
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<label
|
|
22
|
+
:class="[
|
|
23
|
+
'ui-select',
|
|
24
|
+
props.size && `ui-${props.size}`,
|
|
25
|
+
{
|
|
26
|
+
'ui-filled': props.variant === 'filled',
|
|
27
|
+
},
|
|
28
|
+
props.class,
|
|
29
|
+
]"
|
|
30
|
+
:data-invalid="props.error || undefined"
|
|
31
|
+
>
|
|
32
|
+
<span v-if="props.label" class="ui-label" :id="labelId">{{
|
|
33
|
+
props.label
|
|
34
|
+
}}</span>
|
|
35
|
+
<span class="ui-field">
|
|
36
|
+
<select
|
|
37
|
+
:aria-labelledby="props.label ? labelId : undefined"
|
|
38
|
+
:id="selectId"
|
|
39
|
+
v-bind="$attrs"
|
|
40
|
+
v-model="modelValue"
|
|
41
|
+
>
|
|
42
|
+
<option
|
|
43
|
+
v-for="item in props.items"
|
|
44
|
+
:key="item.value"
|
|
45
|
+
:value="item.value"
|
|
46
|
+
>
|
|
47
|
+
{{ item.text }}
|
|
48
|
+
</option>
|
|
49
|
+
<slot></slot>
|
|
50
|
+
</select>
|
|
51
|
+
</span>
|
|
52
|
+
<span v-if="props.endText" class="ui-end-text">{{ props.endText }}</span>
|
|
53
|
+
</label>
|
|
54
|
+
</template>
|
|
@@ -5,15 +5,11 @@ export type Item = {
|
|
|
5
5
|
|
|
6
6
|
export type ClassicSelectProps = {
|
|
7
7
|
[key: string]: any
|
|
8
|
-
disabled?: boolean
|
|
9
8
|
error?: boolean
|
|
10
9
|
id?: string
|
|
11
10
|
items?: Item[]
|
|
12
11
|
label?: string
|
|
13
|
-
name?: string
|
|
14
|
-
required?: boolean
|
|
15
12
|
size?: "small"
|
|
16
13
|
endText?: string
|
|
17
|
-
value?: any
|
|
18
14
|
variant?: "outlined" | "filled"
|
|
19
15
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
3
|
+
|
|
4
|
+
const { bordered } = defineProps<Props>()
|
|
5
|
+
defineSlots<Slots>()
|
|
6
|
+
|
|
7
|
+
defineOptions({
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
})
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<dl
|
|
14
|
+
:class="[
|
|
15
|
+
'ui-description-list',
|
|
16
|
+
{ 'ui-bordered': bordered, 'ui-dotted': bordered === 'dotted' },
|
|
17
|
+
$props.class,
|
|
18
|
+
]"
|
|
19
|
+
v-bind="$attrs"
|
|
20
|
+
>
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</dl>
|
|
23
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props, Slots } from "./types.d.vue"
|
|
3
|
+
|
|
4
|
+
const { actionsAlign } = defineProps<Props>()
|
|
5
|
+
|
|
6
|
+
defineOptions({
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const slots = defineSlots<Slots>()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<dialog
|
|
15
|
+
:class="['ui-dialog', 'ui-card', 'ui-elevated', $props.class]"
|
|
16
|
+
v-bind="$attrs"
|
|
17
|
+
>
|
|
18
|
+
<hgroup v-if="slots.header">
|
|
19
|
+
<slot name="header"></slot>
|
|
20
|
+
</hgroup>
|
|
21
|
+
|
|
22
|
+
<div v-if="slots.content" class="ui-content">
|
|
23
|
+
<slot name="content"></slot>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<slot></slot>
|
|
27
|
+
|
|
28
|
+
<div
|
|
29
|
+
v-if="slots.actions"
|
|
30
|
+
:class="['ui-actions', actionsAlign && `ui-align-${actionsAlign}`]"
|
|
31
|
+
>
|
|
32
|
+
<slot name="actions"></slot>
|
|
33
|
+
</div>
|
|
34
|
+
</dialog>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Props } from "./types.d.vue"
|
|
3
|
+
|
|
4
|
+
const { variant } = defineProps<Props>()
|
|
5
|
+
const variantClass = variant ? `border-${variant}` : ""
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<hr
|
|
10
|
+
:class="['ui-divider', $props.class, variantClass && `ui-${variantClass}`]"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
@@ -33,9 +33,15 @@ const drawerId = id || $id("drawer")
|
|
|
33
33
|
>
|
|
34
34
|
{Astro.slots.has("header") && <slot name="header" />}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
{
|
|
37
|
+
Astro.slots.has("content") && (
|
|
38
|
+
<div class="ui-content">
|
|
39
|
+
<slot name="content" />
|
|
40
|
+
</div>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
<slot />
|
|
39
45
|
|
|
40
46
|
{Astro.slots.has("footer") && <slot name="footer" />}
|
|
41
47
|
</dialog>
|