opui-css 4.1.0 → 5.0.1
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 +282 -247
- package/LICENSE +21 -21
- package/MIGRATING.md +127 -105
- package/README.md +87 -87
- package/astro/index.ts +46 -46
- package/components/AGENTS.md +248 -247
- package/components/Accordion/Accordion.astro +42 -42
- package/components/Anchor/Anchor.astro +51 -51
- package/components/Avatar/Avatar.astro +38 -44
- package/components/Badge/Badge.astro +59 -54
- package/components/Button/Button.astro +45 -45
- package/components/ButtonGroup/ButtonGroup.astro +29 -29
- package/components/Callout/Callout.astro +75 -75
- package/components/Card/Card.astro +36 -36
- package/components/Checkbox/Checkbox.astro +76 -76
- package/components/Checkbox/CheckboxInput.astro +32 -32
- package/components/Chip/Chip.astro +37 -37
- package/components/ClassicSelect/ClassicSelect.astro +83 -83
- package/components/DescriptionList/Description.astro +12 -12
- package/components/DescriptionList/DescriptionList.astro +22 -22
- package/components/DescriptionList/Item.astro +12 -12
- package/components/DescriptionList/Term.astro +12 -12
- package/components/DescriptionList/index.ts +12 -12
- package/components/Dialog/Dialog.astro +41 -41
- package/components/Divider/Divider.astro +17 -14
- package/components/Drawer/Drawer.astro +49 -49
- package/components/Drawer/DrawerFooter.astro +14 -14
- package/components/Drawer/DrawerHeader.astro +31 -31
- package/components/FieldDescription/FieldDescription.astro +13 -13
- package/components/FieldGroup/FieldGroup.astro +31 -31
- package/components/FieldLegend/FieldLegend.astro +15 -15
- package/components/FieldSet/FieldSet.astro +15 -15
- package/components/Form/Form.astro +15 -15
- package/components/IconButton/IconButton.astro +26 -26
- package/components/List/List.astro +36 -36
- package/components/ListItem/ListItem.astro +118 -118
- package/components/Progress/Progress.astro +41 -40
- package/components/Radio/Radio.astro +70 -70
- package/components/Radio/RadioInput.astro +24 -24
- package/components/Range/Range.astro +136 -136
- package/components/Select/Select.astro +106 -106
- package/components/Switch/Switch.astro +101 -101
- package/components/Switch/SwitchInput.astro +25 -25
- package/components/Table/Body.astro +13 -13
- package/components/Table/Cell.astro +13 -13
- package/components/Table/Column.astro +15 -15
- package/components/Table/ColumnGroup.astro +13 -13
- package/components/Table/Head.astro +13 -13
- package/components/Table/HeaderCell.astro +13 -13
- package/components/Table/Row.astro +13 -13
- package/components/Table/Table.astro +18 -15
- package/components/Table/index.ts +20 -20
- package/components/Tabs/Tabs.astro +28 -28
- package/components/Tabs/TabsItem.astro +47 -47
- package/components/Tabs/TabsPanel.astro +21 -21
- package/components/Tabs/TabsTab.astro +19 -19
- package/components/Tabs/index.ts +14 -14
- package/components/TextField/TextField.astro +128 -128
- package/components/Textarea/Textarea.astro +106 -106
- package/components/Toast/Toast.astro +42 -42
- package/components/ToggleButton/ToggleButton.astro +53 -53
- package/components/ToggleGroup/ToggleGroup.astro +49 -49
- package/components/Tooltip/Tooltip.astro +30 -30
- package/core/normalize.css +194 -194
- package/core/palette.css +59 -59
- package/core/utils.css +71 -71
- package/css/components/accordion.css +174 -174
- package/css/components/anchor.css +27 -27
- package/css/components/avatar.css +65 -65
- package/css/components/badge.css +107 -107
- package/css/components/button-group.css +179 -179
- package/css/components/button.css +215 -215
- package/css/components/callout.css +109 -109
- package/css/components/card.css +117 -117
- package/css/components/checkbox.css +205 -205
- package/css/components/chip.css +87 -87
- package/css/components/description-list.css +80 -77
- package/css/components/dialog.css +68 -68
- package/css/components/divider.css +20 -20
- package/css/components/drawer.css +171 -171
- package/css/components/form.css +146 -146
- package/css/components/icon-button.css +139 -139
- package/css/components/link.css +21 -21
- package/css/components/list.css +345 -345
- package/css/components/progress.css +102 -97
- package/css/components/radio.css +172 -172
- package/css/components/range.css +337 -337
- package/css/components/select.css +169 -169
- package/css/components/spinner.css +37 -37
- package/css/components/switch.css +268 -268
- package/css/components/table.css +179 -179
- package/css/components/tabs.css +83 -77
- package/css/components/text-field.css +450 -450
- package/css/components/text-input.css +64 -64
- package/css/components/textarea.css +24 -24
- package/css/components/toast.css +161 -161
- package/css/components/toggle-button.css +87 -87
- package/css/components/toggle-group.css +56 -56
- package/css/components/tooltip.css +67 -67
- package/css/components/typography.css +585 -585
- package/css/components.css +41 -41
- package/css/imports.css +16 -16
- package/css/js/checkbox.js +21 -21
- package/css/js/toast.js +94 -94
- package/css/theme.css +132 -132
- package/dist/op.css +65 -65
- package/dist/op.css.map +1 -1
- package/dist/opui.components.css +5159 -5145
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +5668 -5654
- package/dist/opui.css.map +1 -1
- package/env.d.ts +14 -14
- package/open-props.css +9 -9
- package/package.json +81 -81
|
@@ -1,128 +1,128 @@
|
|
|
1
|
-
---
|
|
2
|
-
type Props = {
|
|
3
|
-
[key: string]: any
|
|
4
|
-
autoFit?: boolean
|
|
5
|
-
class?: string
|
|
6
|
-
critical?: boolean
|
|
7
|
-
description?: string
|
|
8
|
-
disabled?: boolean
|
|
9
|
-
endText?: string
|
|
10
|
-
filled?: boolean
|
|
11
|
-
id?: string
|
|
12
|
-
label?: string
|
|
13
|
-
list?: string
|
|
14
|
-
max?: number | string
|
|
15
|
-
min?: number | string
|
|
16
|
-
name?: string
|
|
17
|
-
placeholder?: string
|
|
18
|
-
required?: boolean
|
|
19
|
-
small?: boolean
|
|
20
|
-
spread?: boolean
|
|
21
|
-
startText?: string
|
|
22
|
-
step?: number | string
|
|
23
|
-
type?:
|
|
24
|
-
| "color"
|
|
25
|
-
| "date"
|
|
26
|
-
| "datetime-local"
|
|
27
|
-
| "email"
|
|
28
|
-
| "file"
|
|
29
|
-
| "month"
|
|
30
|
-
| "numeric"
|
|
31
|
-
| "password"
|
|
32
|
-
| "search"
|
|
33
|
-
| "tel"
|
|
34
|
-
| "text"
|
|
35
|
-
| "time"
|
|
36
|
-
| "url"
|
|
37
|
-
| "week"
|
|
38
|
-
value?: string | number
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const title = "Text Field"
|
|
42
|
-
|
|
43
|
-
const {
|
|
44
|
-
autoFit,
|
|
45
|
-
class: className,
|
|
46
|
-
critical,
|
|
47
|
-
description,
|
|
48
|
-
disabled,
|
|
49
|
-
endText,
|
|
50
|
-
filled,
|
|
51
|
-
id,
|
|
52
|
-
label,
|
|
53
|
-
list,
|
|
54
|
-
max,
|
|
55
|
-
min,
|
|
56
|
-
name,
|
|
57
|
-
placeholder,
|
|
58
|
-
required,
|
|
59
|
-
small,
|
|
60
|
-
spread,
|
|
61
|
-
startText,
|
|
62
|
-
step,
|
|
63
|
-
type = "text",
|
|
64
|
-
value,
|
|
65
|
-
...rest
|
|
66
|
-
} = Astro.props
|
|
67
|
-
|
|
68
|
-
const startTextValue = description || startText
|
|
69
|
-
const { $id, currentFieldName } = Astro.locals
|
|
70
|
-
const fieldId = id || $id("text-field")
|
|
71
|
-
const fieldName = name || currentFieldName
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
<label
|
|
75
|
-
class:list={[
|
|
76
|
-
"text-field",
|
|
77
|
-
{
|
|
78
|
-
"auto-fit": autoFit,
|
|
79
|
-
filled,
|
|
80
|
-
spread,
|
|
81
|
-
small,
|
|
82
|
-
},
|
|
83
|
-
className,
|
|
84
|
-
]}
|
|
85
|
-
data-invalid={critical || undefined}
|
|
86
|
-
{...rest}
|
|
87
|
-
>
|
|
88
|
-
{
|
|
89
|
-
(label || Astro.slots.has("label")) && (
|
|
90
|
-
<!-- prettier-ignore -->
|
|
91
|
-
<span class="label">{label}<slot name="label" /></span>
|
|
92
|
-
)
|
|
93
|
-
}
|
|
94
|
-
{
|
|
95
|
-
(startTextValue || Astro.slots.has("description")) && (
|
|
96
|
-
<!-- prettier-ignore -->
|
|
97
|
-
<span class="start-text">{startTextValue}<slot name="description" /></span>
|
|
98
|
-
)
|
|
99
|
-
}
|
|
100
|
-
<span class="field">
|
|
101
|
-
<input
|
|
102
|
-
disabled={disabled}
|
|
103
|
-
id={fieldId}
|
|
104
|
-
inputmode={type === "numeric" ? "numeric" : undefined}
|
|
105
|
-
list={list}
|
|
106
|
-
max={max}
|
|
107
|
-
min={min}
|
|
108
|
-
name={fieldName}
|
|
109
|
-
pattern={type === "numeric" ? "[0-9]*" : undefined}
|
|
110
|
-
placeholder={placeholder}
|
|
111
|
-
required={required}
|
|
112
|
-
step={step}
|
|
113
|
-
type={type === "numeric" ? "text" : type}
|
|
114
|
-
value={value}
|
|
115
|
-
/>
|
|
116
|
-
{Astro.slots.has("prefix") && <span class="prefix"><slot name="prefix" /></span>}
|
|
117
|
-
{Astro.slots.has("suffix") && <span class="suffix"><slot name="suffix" /></span>}
|
|
118
|
-
{Astro.slots.has("header") && <span class="header"><slot name="header" /></span>}
|
|
119
|
-
{Astro.slots.has("footer") && <span class="footer"><slot name="footer" /></span>}
|
|
120
|
-
</span>
|
|
121
|
-
{
|
|
122
|
-
(endText || Astro.slots.has("end-text") || Astro.slots.has("supporting-text")) && (
|
|
123
|
-
<!-- prettier-ignore -->
|
|
124
|
-
<span class="end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
|
|
125
|
-
)
|
|
126
|
-
}
|
|
127
|
-
<slot />
|
|
128
|
-
</label>
|
|
1
|
+
---
|
|
2
|
+
type Props = {
|
|
3
|
+
[key: string]: any
|
|
4
|
+
autoFit?: boolean
|
|
5
|
+
class?: string
|
|
6
|
+
critical?: boolean
|
|
7
|
+
description?: string
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
endText?: string
|
|
10
|
+
filled?: boolean
|
|
11
|
+
id?: string
|
|
12
|
+
label?: string
|
|
13
|
+
list?: string
|
|
14
|
+
max?: number | string
|
|
15
|
+
min?: number | string
|
|
16
|
+
name?: string
|
|
17
|
+
placeholder?: string
|
|
18
|
+
required?: boolean
|
|
19
|
+
small?: boolean
|
|
20
|
+
spread?: boolean
|
|
21
|
+
startText?: string
|
|
22
|
+
step?: number | string
|
|
23
|
+
type?:
|
|
24
|
+
| "color"
|
|
25
|
+
| "date"
|
|
26
|
+
| "datetime-local"
|
|
27
|
+
| "email"
|
|
28
|
+
| "file"
|
|
29
|
+
| "month"
|
|
30
|
+
| "numeric"
|
|
31
|
+
| "password"
|
|
32
|
+
| "search"
|
|
33
|
+
| "tel"
|
|
34
|
+
| "text"
|
|
35
|
+
| "time"
|
|
36
|
+
| "url"
|
|
37
|
+
| "week"
|
|
38
|
+
value?: string | number
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const title = "Text Field"
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
autoFit,
|
|
45
|
+
class: className,
|
|
46
|
+
critical,
|
|
47
|
+
description,
|
|
48
|
+
disabled,
|
|
49
|
+
endText,
|
|
50
|
+
filled,
|
|
51
|
+
id,
|
|
52
|
+
label,
|
|
53
|
+
list,
|
|
54
|
+
max,
|
|
55
|
+
min,
|
|
56
|
+
name,
|
|
57
|
+
placeholder,
|
|
58
|
+
required,
|
|
59
|
+
small,
|
|
60
|
+
spread,
|
|
61
|
+
startText,
|
|
62
|
+
step,
|
|
63
|
+
type = "text",
|
|
64
|
+
value,
|
|
65
|
+
...rest
|
|
66
|
+
} = Astro.props
|
|
67
|
+
|
|
68
|
+
const startTextValue = description || startText
|
|
69
|
+
const { $id, currentFieldName } = Astro.locals
|
|
70
|
+
const fieldId = id || $id("text-field")
|
|
71
|
+
const fieldName = name || currentFieldName
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
<label
|
|
75
|
+
class:list={[
|
|
76
|
+
"ui-text-field",
|
|
77
|
+
{
|
|
78
|
+
"ui-auto-fit": autoFit,
|
|
79
|
+
"ui-filled": filled,
|
|
80
|
+
"ui-spread": spread,
|
|
81
|
+
"ui-small": small,
|
|
82
|
+
},
|
|
83
|
+
className,
|
|
84
|
+
]}
|
|
85
|
+
data-invalid={critical || undefined}
|
|
86
|
+
{...rest}
|
|
87
|
+
>
|
|
88
|
+
{
|
|
89
|
+
(label || Astro.slots.has("label")) && (
|
|
90
|
+
<!-- prettier-ignore -->
|
|
91
|
+
<span class="ui-label">{label}<slot name="label" /></span>
|
|
92
|
+
)
|
|
93
|
+
}
|
|
94
|
+
{
|
|
95
|
+
(startTextValue || Astro.slots.has("description")) && (
|
|
96
|
+
<!-- prettier-ignore -->
|
|
97
|
+
<span class="ui-start-text">{startTextValue}<slot name="description" /></span>
|
|
98
|
+
)
|
|
99
|
+
}
|
|
100
|
+
<span class="ui-field">
|
|
101
|
+
<input
|
|
102
|
+
disabled={disabled}
|
|
103
|
+
id={fieldId}
|
|
104
|
+
inputmode={type === "numeric" ? "numeric" : undefined}
|
|
105
|
+
list={list}
|
|
106
|
+
max={max}
|
|
107
|
+
min={min}
|
|
108
|
+
name={fieldName}
|
|
109
|
+
pattern={type === "numeric" ? "[0-9]*" : undefined}
|
|
110
|
+
placeholder={placeholder}
|
|
111
|
+
required={required}
|
|
112
|
+
step={step}
|
|
113
|
+
type={type === "numeric" ? "text" : type}
|
|
114
|
+
value={value}
|
|
115
|
+
/>
|
|
116
|
+
{Astro.slots.has("prefix") && <span class="ui-prefix"><slot name="prefix" /></span>}
|
|
117
|
+
{Astro.slots.has("suffix") && <span class="ui-suffix"><slot name="suffix" /></span>}
|
|
118
|
+
{Astro.slots.has("header") && <span class="ui-header"><slot name="header" /></span>}
|
|
119
|
+
{Astro.slots.has("footer") && <span class="ui-footer"><slot name="footer" /></span>}
|
|
120
|
+
</span>
|
|
121
|
+
{
|
|
122
|
+
(endText || Astro.slots.has("end-text") || Astro.slots.has("supporting-text")) && (
|
|
123
|
+
<!-- prettier-ignore -->
|
|
124
|
+
<span class="ui-end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
|
|
125
|
+
)
|
|
126
|
+
}
|
|
127
|
+
<slot />
|
|
128
|
+
</label>
|
|
@@ -1,106 +1,106 @@
|
|
|
1
|
-
---
|
|
2
|
-
type Props = {
|
|
3
|
-
[key: string]: any
|
|
4
|
-
autoFit?: boolean
|
|
5
|
-
class?: string
|
|
6
|
-
cols?: number
|
|
7
|
-
description?: string
|
|
8
|
-
disabled?: boolean
|
|
9
|
-
critical?: boolean
|
|
10
|
-
filled?: boolean
|
|
11
|
-
id?: string
|
|
12
|
-
label?: string
|
|
13
|
-
maxlength?: number
|
|
14
|
-
minlength?: number
|
|
15
|
-
name?: string
|
|
16
|
-
spread?: boolean
|
|
17
|
-
placeholder?: string
|
|
18
|
-
required?: boolean
|
|
19
|
-
rows?: number
|
|
20
|
-
small?: boolean
|
|
21
|
-
endText?: string
|
|
22
|
-
value?: string
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const title = "Textarea"
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
autoFit,
|
|
29
|
-
class: className,
|
|
30
|
-
cols,
|
|
31
|
-
description,
|
|
32
|
-
disabled,
|
|
33
|
-
critical,
|
|
34
|
-
filled,
|
|
35
|
-
id,
|
|
36
|
-
label,
|
|
37
|
-
maxlength,
|
|
38
|
-
minlength,
|
|
39
|
-
name,
|
|
40
|
-
spread,
|
|
41
|
-
placeholder,
|
|
42
|
-
required,
|
|
43
|
-
rows,
|
|
44
|
-
small,
|
|
45
|
-
endText,
|
|
46
|
-
value,
|
|
47
|
-
...rest
|
|
48
|
-
} = Astro.props
|
|
49
|
-
|
|
50
|
-
const { $id, currentFieldName } = Astro.locals
|
|
51
|
-
const fieldId = id || $id("textarea")
|
|
52
|
-
const fieldName = name || currentFieldName
|
|
53
|
-
---
|
|
54
|
-
|
|
55
|
-
<label
|
|
56
|
-
class:list={[
|
|
57
|
-
"textarea",
|
|
58
|
-
{
|
|
59
|
-
"auto-fit": autoFit,
|
|
60
|
-
filled,
|
|
61
|
-
spread,
|
|
62
|
-
small,
|
|
63
|
-
},
|
|
64
|
-
className,
|
|
65
|
-
]}
|
|
66
|
-
data-invalid={critical || undefined}
|
|
67
|
-
{...rest}
|
|
68
|
-
>
|
|
69
|
-
{
|
|
70
|
-
(label || Astro.slots.has("label")) && (
|
|
71
|
-
<!-- prettier-ignore -->
|
|
72
|
-
<span class="label">{label}<slot name="label" /></span>
|
|
73
|
-
)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
{
|
|
77
|
-
(description || Astro.slots.has("description")) && (
|
|
78
|
-
<!-- prettier-ignore -->
|
|
79
|
-
<span class="start-text">{description}<slot name="description" /></span>
|
|
80
|
-
)
|
|
81
|
-
}
|
|
82
|
-
<span class="field">
|
|
83
|
-
<textarea
|
|
84
|
-
cols={cols}
|
|
85
|
-
disabled={disabled}
|
|
86
|
-
id={fieldId}
|
|
87
|
-
maxlength={maxlength}
|
|
88
|
-
minlength={minlength}
|
|
89
|
-
name={fieldName}
|
|
90
|
-
placeholder={placeholder}
|
|
91
|
-
required={required}
|
|
92
|
-
rows={rows}
|
|
93
|
-
value={value}></textarea>
|
|
94
|
-
{Astro.slots.has("prefix") && <span class="prefix"><slot name="prefix" /></span>}
|
|
95
|
-
{Astro.slots.has("suffix") && <span class="suffix"><slot name="suffix" /></span>}
|
|
96
|
-
{Astro.slots.has("header") && <span class="header"><slot name="header" /></span>}
|
|
97
|
-
{Astro.slots.has("footer") && <span class="footer"><slot name="footer" /></span>}
|
|
98
|
-
</span>
|
|
99
|
-
{
|
|
100
|
-
(endText || Astro.slots.has("end-text") || Astro.slots.has("supporting-text")) && (
|
|
101
|
-
<!-- prettier-ignore -->
|
|
102
|
-
<span class="end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
<slot />
|
|
106
|
-
</label>
|
|
1
|
+
---
|
|
2
|
+
type Props = {
|
|
3
|
+
[key: string]: any
|
|
4
|
+
autoFit?: boolean
|
|
5
|
+
class?: string
|
|
6
|
+
cols?: number
|
|
7
|
+
description?: string
|
|
8
|
+
disabled?: boolean
|
|
9
|
+
critical?: boolean
|
|
10
|
+
filled?: boolean
|
|
11
|
+
id?: string
|
|
12
|
+
label?: string
|
|
13
|
+
maxlength?: number
|
|
14
|
+
minlength?: number
|
|
15
|
+
name?: string
|
|
16
|
+
spread?: boolean
|
|
17
|
+
placeholder?: string
|
|
18
|
+
required?: boolean
|
|
19
|
+
rows?: number
|
|
20
|
+
small?: boolean
|
|
21
|
+
endText?: string
|
|
22
|
+
value?: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const title = "Textarea"
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
autoFit,
|
|
29
|
+
class: className,
|
|
30
|
+
cols,
|
|
31
|
+
description,
|
|
32
|
+
disabled,
|
|
33
|
+
critical,
|
|
34
|
+
filled,
|
|
35
|
+
id,
|
|
36
|
+
label,
|
|
37
|
+
maxlength,
|
|
38
|
+
minlength,
|
|
39
|
+
name,
|
|
40
|
+
spread,
|
|
41
|
+
placeholder,
|
|
42
|
+
required,
|
|
43
|
+
rows,
|
|
44
|
+
small,
|
|
45
|
+
endText,
|
|
46
|
+
value,
|
|
47
|
+
...rest
|
|
48
|
+
} = Astro.props
|
|
49
|
+
|
|
50
|
+
const { $id, currentFieldName } = Astro.locals
|
|
51
|
+
const fieldId = id || $id("textarea")
|
|
52
|
+
const fieldName = name || currentFieldName
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
<label
|
|
56
|
+
class:list={[
|
|
57
|
+
"ui-textarea",
|
|
58
|
+
{
|
|
59
|
+
"ui-auto-fit": autoFit,
|
|
60
|
+
"ui-filled": filled,
|
|
61
|
+
"ui-spread": spread,
|
|
62
|
+
"ui-small": small,
|
|
63
|
+
},
|
|
64
|
+
className,
|
|
65
|
+
]}
|
|
66
|
+
data-invalid={critical || undefined}
|
|
67
|
+
{...rest}
|
|
68
|
+
>
|
|
69
|
+
{
|
|
70
|
+
(label || Astro.slots.has("label")) && (
|
|
71
|
+
<!-- prettier-ignore -->
|
|
72
|
+
<span class="ui-label">{label}<slot name="label" /></span>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
{
|
|
77
|
+
(description || Astro.slots.has("description")) && (
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
|
+
<span class="ui-start-text">{description}<slot name="description" /></span>
|
|
80
|
+
)
|
|
81
|
+
}
|
|
82
|
+
<span class="ui-field">
|
|
83
|
+
<textarea
|
|
84
|
+
cols={cols}
|
|
85
|
+
disabled={disabled}
|
|
86
|
+
id={fieldId}
|
|
87
|
+
maxlength={maxlength}
|
|
88
|
+
minlength={minlength}
|
|
89
|
+
name={fieldName}
|
|
90
|
+
placeholder={placeholder}
|
|
91
|
+
required={required}
|
|
92
|
+
rows={rows}
|
|
93
|
+
value={value}></textarea>
|
|
94
|
+
{Astro.slots.has("prefix") && <span class="ui-prefix"><slot name="prefix" /></span>}
|
|
95
|
+
{Astro.slots.has("suffix") && <span class="ui-suffix"><slot name="suffix" /></span>}
|
|
96
|
+
{Astro.slots.has("header") && <span class="ui-header"><slot name="header" /></span>}
|
|
97
|
+
{Astro.slots.has("footer") && <span class="ui-footer"><slot name="footer" /></span>}
|
|
98
|
+
</span>
|
|
99
|
+
{
|
|
100
|
+
(endText || Astro.slots.has("end-text") || Astro.slots.has("supporting-text")) && (
|
|
101
|
+
<!-- prettier-ignore -->
|
|
102
|
+
<span class="ui-end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
105
|
+
<slot />
|
|
106
|
+
</label>
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
---
|
|
2
|
-
export const title = "Toast"
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
<output aria-live="polite" id="toast-manager" popover="manual" role="status"
|
|
6
|
-
></output>
|
|
7
|
-
|
|
8
|
-
<template id="toast-template">
|
|
9
|
-
<div class="toast" role="alert">
|
|
10
|
-
<span class="icon" data-toast-icon></span>
|
|
11
|
-
<div class="content">
|
|
12
|
-
<div class="title" data-toast-title></div>
|
|
13
|
-
<div class="description" data-toast-description></div>
|
|
14
|
-
</div>
|
|
15
|
-
<button
|
|
16
|
-
aria-label="Close"
|
|
17
|
-
class="close-button"
|
|
18
|
-
data-toast-close
|
|
19
|
-
type="button"
|
|
20
|
-
>
|
|
21
|
-
<svg
|
|
22
|
-
fill="none"
|
|
23
|
-
height="20"
|
|
24
|
-
stroke="currentColor"
|
|
25
|
-
stroke-linecap="round"
|
|
26
|
-
stroke-linejoin="round"
|
|
27
|
-
stroke-width="2"
|
|
28
|
-
viewBox="0 0 24 24"
|
|
29
|
-
width="20"
|
|
30
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
-
>
|
|
32
|
-
<path d="M18 6 6 18"></path>
|
|
33
|
-
<path d="m6 6 12 12"></path>
|
|
34
|
-
</svg>
|
|
35
|
-
</button>
|
|
36
|
-
</div>
|
|
37
|
-
</template>
|
|
38
|
-
|
|
39
|
-
<script>
|
|
40
|
-
import { initToastManager } from "../../css/js/toast.js"
|
|
41
|
-
initToastManager()
|
|
42
|
-
</script>
|
|
1
|
+
---
|
|
2
|
+
export const title = "Toast"
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
<output aria-live="polite" id="toast-manager" popover="manual" role="status"
|
|
6
|
+
></output>
|
|
7
|
+
|
|
8
|
+
<template id="toast-template">
|
|
9
|
+
<div class="ui-toast" role="alert">
|
|
10
|
+
<span class="ui-icon" data-toast-icon></span>
|
|
11
|
+
<div class="ui-content">
|
|
12
|
+
<div class="ui-title" data-toast-title></div>
|
|
13
|
+
<div class="ui-description" data-toast-description></div>
|
|
14
|
+
</div>
|
|
15
|
+
<button
|
|
16
|
+
aria-label="Close"
|
|
17
|
+
class="ui-close-button"
|
|
18
|
+
data-toast-close
|
|
19
|
+
type="button"
|
|
20
|
+
>
|
|
21
|
+
<svg
|
|
22
|
+
fill="none"
|
|
23
|
+
height="20"
|
|
24
|
+
stroke="currentColor"
|
|
25
|
+
stroke-linecap="round"
|
|
26
|
+
stroke-linejoin="round"
|
|
27
|
+
stroke-width="2"
|
|
28
|
+
viewBox="0 0 24 24"
|
|
29
|
+
width="20"
|
|
30
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
31
|
+
>
|
|
32
|
+
<path d="M18 6 6 18"></path>
|
|
33
|
+
<path d="m6 6 12 12"></path>
|
|
34
|
+
</svg>
|
|
35
|
+
</button>
|
|
36
|
+
</div>
|
|
37
|
+
</template>
|
|
38
|
+
|
|
39
|
+
<script>
|
|
40
|
+
import { initToastManager } from "../../css/js/toast.js"
|
|
41
|
+
initToastManager()
|
|
42
|
+
</script>
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
---
|
|
2
|
-
type Props = {
|
|
3
|
-
[key: string]: any
|
|
4
|
-
class?: string
|
|
5
|
-
disabled?: boolean
|
|
6
|
-
label?: string
|
|
7
|
-
name?: string
|
|
8
|
-
pressed?: boolean
|
|
9
|
-
size?: "small" | "x-small"
|
|
10
|
-
type?: "checkbox" | "radio"
|
|
11
|
-
value?: string
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const title = "Toggle Button"
|
|
15
|
-
|
|
16
|
-
const {
|
|
17
|
-
class: className,
|
|
18
|
-
disabled,
|
|
19
|
-
label,
|
|
20
|
-
name,
|
|
21
|
-
pressed,
|
|
22
|
-
size,
|
|
23
|
-
type,
|
|
24
|
-
value,
|
|
25
|
-
...rest
|
|
26
|
-
} = Astro.props
|
|
27
|
-
|
|
28
|
-
const { $id, currentToggleGroupName, currentToggleGroupType } = Astro.locals
|
|
29
|
-
const finalName = name || currentToggleGroupName
|
|
30
|
-
const finalType = type || currentToggleGroupType || "checkbox"
|
|
31
|
-
const id = rest.id || $id("toggle")
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
<label
|
|
35
|
-
class:list={[
|
|
36
|
-
"toggle-button",
|
|
37
|
-
{
|
|
38
|
-
size
|
|
39
|
-
className,
|
|
40
|
-
]}
|
|
41
|
-
>
|
|
42
|
-
<input
|
|
43
|
-
aria-pressed={finalType === "checkbox" ? pressed : undefined}
|
|
44
|
-
checked={pressed}
|
|
45
|
-
disabled={disabled}
|
|
46
|
-
id={id}
|
|
47
|
-
name={finalName}
|
|
48
|
-
type={finalType}
|
|
49
|
-
value={value || label}
|
|
50
|
-
{...rest}
|
|
51
|
-
/>
|
|
52
|
-
<slot />
|
|
53
|
-
</label>
|
|
1
|
+
---
|
|
2
|
+
type Props = {
|
|
3
|
+
[key: string]: any
|
|
4
|
+
class?: string
|
|
5
|
+
disabled?: boolean
|
|
6
|
+
label?: string
|
|
7
|
+
name?: string
|
|
8
|
+
pressed?: boolean
|
|
9
|
+
size?: "small" | "x-small"
|
|
10
|
+
type?: "checkbox" | "radio"
|
|
11
|
+
value?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const title = "Toggle Button"
|
|
15
|
+
|
|
16
|
+
const {
|
|
17
|
+
class: className,
|
|
18
|
+
disabled,
|
|
19
|
+
label,
|
|
20
|
+
name,
|
|
21
|
+
pressed,
|
|
22
|
+
size,
|
|
23
|
+
type,
|
|
24
|
+
value,
|
|
25
|
+
...rest
|
|
26
|
+
} = Astro.props
|
|
27
|
+
|
|
28
|
+
const { $id, currentToggleGroupName, currentToggleGroupType } = Astro.locals
|
|
29
|
+
const finalName = name || currentToggleGroupName
|
|
30
|
+
const finalType = type || currentToggleGroupType || "checkbox"
|
|
31
|
+
const id = rest.id || $id("toggle")
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
<label
|
|
35
|
+
class:list={[
|
|
36
|
+
"ui-toggle-button",
|
|
37
|
+
{ "ui-disabled": disabled },
|
|
38
|
+
size && `ui-${size}`,
|
|
39
|
+
className,
|
|
40
|
+
]}
|
|
41
|
+
>
|
|
42
|
+
<input
|
|
43
|
+
aria-pressed={finalType === "checkbox" ? pressed : undefined}
|
|
44
|
+
checked={pressed}
|
|
45
|
+
disabled={disabled}
|
|
46
|
+
id={id}
|
|
47
|
+
name={finalName}
|
|
48
|
+
type={finalType}
|
|
49
|
+
value={value || label}
|
|
50
|
+
{...rest}
|
|
51
|
+
/>
|
|
52
|
+
<slot />
|
|
53
|
+
</label>
|