opui-css 4.0.1 → 5.0.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 +35 -0
- package/MIGRATING.md +23 -1
- package/README.md +2 -3
- package/components/AGENTS.md +20 -19
- package/components/Accordion/Accordion.astro +3 -3
- package/components/Anchor/Anchor.astro +2 -2
- package/components/Avatar/Avatar.astro +2 -8
- package/components/Badge/Badge.astro +12 -7
- package/components/Button/Button.astro +1 -1
- package/components/ButtonGroup/ButtonGroup.astro +1 -1
- package/components/Callout/Callout.astro +3 -3
- package/components/Card/Card.astro +5 -7
- package/components/Checkbox/Checkbox.astro +6 -6
- package/components/Chip/Chip.astro +5 -5
- package/components/ClassicSelect/ClassicSelect.astro +6 -6
- package/components/DescriptionList/Description.astro +1 -1
- package/components/DescriptionList/DescriptionList.astro +2 -2
- package/components/DescriptionList/Item.astro +1 -1
- package/components/DescriptionList/Term.astro +1 -1
- package/components/Dialog/Dialog.astro +5 -7
- package/components/Divider/Divider.astro +4 -1
- package/components/Drawer/Drawer.astro +5 -5
- package/components/Drawer/DrawerFooter.astro +1 -1
- package/components/Drawer/DrawerHeader.astro +1 -1
- package/components/FieldDescription/FieldDescription.astro +1 -1
- package/components/FieldGroup/FieldGroup.astro +1 -1
- package/components/FieldLegend/FieldLegend.astro +1 -1
- package/components/FieldSet/FieldSet.astro +1 -1
- package/components/Form/Form.astro +1 -1
- package/components/IconButton/IconButton.astro +1 -1
- package/components/List/List.astro +5 -5
- package/components/ListItem/ListItem.astro +12 -12
- package/components/Progress/Progress.astro +1 -1
- package/components/Radio/Radio.astro +5 -5
- package/components/Range/Range.astro +8 -8
- package/components/Select/Select.astro +13 -13
- package/components/Switch/Switch.astro +8 -8
- package/components/Table/Table.astro +4 -1
- package/components/Tabs/Tabs.astro +1 -1
- package/components/Tabs/TabsItem.astro +1 -1
- package/components/Tabs/TabsPanel.astro +1 -1
- package/components/Tabs/TabsTab.astro +1 -1
- package/components/TextField/TextField.astro +13 -13
- package/components/Textarea/Textarea.astro +13 -13
- package/components/Toast/Toast.astro +6 -6
- package/components/ToggleButton/ToggleButton.astro +3 -3
- package/components/ToggleGroup/ToggleGroup.astro +3 -3
- package/components/Tooltip/Tooltip.astro +1 -1
- package/core/utils.css +4 -4
- package/css/components/accordion.css +11 -11
- package/css/components/anchor.css +3 -3
- package/css/components/avatar.css +5 -5
- package/css/components/badge.css +14 -14
- package/css/components/button-group.css +16 -16
- package/css/components/button.css +12 -12
- package/css/components/callout.css +9 -9
- package/css/components/card.css +12 -12
- package/css/components/checkbox.css +13 -13
- package/css/components/chip.css +5 -5
- package/css/components/description-list.css +11 -8
- package/css/components/dialog.css +3 -3
- package/css/components/divider.css +4 -4
- package/css/components/drawer.css +21 -21
- package/css/components/form.css +18 -18
- package/css/components/icon-button.css +9 -9
- package/css/components/link.css +1 -1
- package/css/components/list.css +29 -29
- package/css/components/progress.css +4 -4
- package/css/components/radio.css +10 -10
- package/css/components/range.css +31 -31
- package/css/components/select.css +4 -4
- package/css/components/spinner.css +1 -1
- package/css/components/switch.css +23 -23
- package/css/components/table.css +3 -3
- package/css/components/tabs.css +14 -8
- package/css/components/text-field.css +47 -47
- package/css/components/text-input.css +7 -7
- package/css/components/textarea.css +3 -3
- package/css/components/toast.css +12 -12
- package/css/components/toggle-button.css +6 -6
- package/css/components/toggle-group.css +10 -10
- package/css/components/tooltip.css +6 -6
- package/css/components/typography.css +30 -30
- package/css/js/toast.js +7 -7
- package/css/theme.css +8 -8
- package/dist/opui.components.css +407 -398
- package/dist/opui.components.css.map +1 -1
- package/dist/opui.css +419 -410
- package/dist/opui.css.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,40 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 5.0.0 - 2026-05-21
|
|
4
|
+
|
|
5
|
+
### Breaking
|
|
6
|
+
|
|
7
|
+
This is technically very breaking, but with a little prompting from you it's probably not a big deal for you. Hopefully you'll understand the reasoning behind this.
|
|
8
|
+
|
|
9
|
+
Every OPUI-owned class now has a `ui-` prefix. This eliminates collisions with consumer styles and makes library classes self-identifying in the DOM.
|
|
10
|
+
|
|
11
|
+
- Component prop API is **unchanged**: `<Button size="small" variant="outlined" color="primary">` works exactly as before.
|
|
12
|
+
- Raw HTML / CSS users **must** rename every library class. `<button class="button outlined">` → `<button class="ui-button ui-outlined">`. `.button { ... }` overrides → `.ui-button { ... }`.
|
|
13
|
+
- CSS custom properties (`--primary`, `--surface-default`, `--size-3`, …) are unchanged.
|
|
14
|
+
- The framework component renders prefixed classes (`<button class="ui-button ui-small ui-outlined ui-primary">`); only the rendered HTML changes, not the public prop API.
|
|
15
|
+
- **Divider**, **Progress**, **Table**, **Tabs**, and **Description List** now render and style prefixed classes end-to-end (`.ui-divider`, `.ui-progress`, `.ui-table`, `.ui-tab-label`, `.ui-tab-panel`, `.ui-term`). Plain `<hr>`, `<progress>`, and `<table>` elements no longer pick up library styles unless the class is present.
|
|
16
|
+
- **Toggle Button**: pressed state no longer adds an unprefixed `selected` class.
|
|
17
|
+
- **Avatar**: removed unused `spacing` prop and related group gap classes.
|
|
18
|
+
|
|
19
|
+
#### Migration
|
|
20
|
+
|
|
21
|
+
Run a project-wide find/replace per token, prompt or whatever. Below are all the classes that got a `ui-` prefix.
|
|
22
|
+
|
|
23
|
+
<details>
|
|
24
|
+
<summary>Migrated classes</summary>
|
|
25
|
+
|
|
26
|
+
`abbr`, `accordion`, `actions`, `align-end`, `anchor`, `anchor-floating`, `auto-fit`, `avatar`, `backdrop-transparent`, `badge`, `badge-indicator`, `block-end`, `block-start`, `blockquote`, `border-filled`, `border-primary`, `border-tonal`, `border-top`, `bordered`, `button`, `button-group`, `callout`, `caption`, `card`, `checkbox`, `chip`, `cite`, `close-button`, `code-block`, `content`, `critical`, `dark`, `default`, `del`, `dense`, `description`, `description-list`, `dfn`, `dialog`, `disabled`, `divider`, `dot`, `dotted`, `drawer`, `elevated`, `end`, `end-end`, `end-start`, `end-text`, `exiting`, `field`, `field-description`, `field-group`, `fieldset`, `fieldset-item`, `filled`, `footer`, `form`, `gutterless`, `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `header`, `hgroup`, `icon`, `icon-button`, `icon-checked`, `icon-only`, `icon-unchecked`, `info`, `inline-end`, `inline-start`, `ins`, `inset`, `invisible`, `item`, `kbd`, `label`, `large`, `legend`, `light`, `link`, `list`, `mark`, `multiline`, `neutral`, `not-rich-text`, `outlined`, `overline`, `p`, `prefix`, `primary`, `progress`, `radio`, `range`, `rich-text`, `rounded`, `row`, `s`, `samp`, `scroll-lock`, `select`, `small`, `spacious`, `spread`, `squared`, `squircle`, `sr-only`, `stack`, `start`, `start-start`, `start-text`, `sub`, `success`, `suffix`, `sup`, `switch`, `tab-input`, `tab-label`, `tab-panel`, `table`, `tabs`, `term`, `text`, `text-field`, `textarea`, `title`, `toast`, `toggle-button`, `toggle-group`, `tonal`, `tooltip`, `transparent`, `u`, `value`, `var`, `vertical`, `warning`, `with-arrow`, `x-small`.
|
|
27
|
+
|
|
28
|
+
</details>
|
|
29
|
+
|
|
30
|
+
After the search/replace, do a visual smoke test — there is no automated codemod for consumer projects.
|
|
31
|
+
|
|
32
|
+
## 4.1.0 - 2026-05-18
|
|
33
|
+
|
|
34
|
+
### Breaking
|
|
35
|
+
|
|
36
|
+
- **Card** and **Dialog** (Astro): the `actions` prop with an `align` field is removed. Use the `actionsAlign` prop instead (`"start"` | `"end"`).
|
|
37
|
+
|
|
3
38
|
## 4.0.1 - 2026-05-13
|
|
4
39
|
|
|
5
40
|
### Fixed
|
package/MIGRATING.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
# Migrating from v4 to v5
|
|
2
|
+
|
|
3
|
+
v5 prefixes every OPUI-owned class with `ui-`. The component prop API is unchanged; only the rendered class names change.
|
|
4
|
+
|
|
5
|
+
If you use the framework component (e.g. `<Button size="small" variant="outlined">`), you don't need to do anything — the component emits the prefixed classes for you.
|
|
6
|
+
|
|
7
|
+
If you use raw HTML or write CSS that targets library classes, you must rename every reference:
|
|
8
|
+
|
|
9
|
+
```diff
|
|
10
|
+
- <button class="button outlined small">Save</button>
|
|
11
|
+
+ <button class="ui-button ui-outlined ui-small">Save</button>
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```diff
|
|
15
|
+
- .button.filled { /* override */ }
|
|
16
|
+
+ .ui-button.ui-filled { /* override */ }
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The full list of renamed tokens is in [CHANGELOG.md](./CHANGELOG.md#500). Run a project-wide find/replace per token, then visually smoke test.
|
|
20
|
+
|
|
21
|
+
CSS custom properties (`--primary`, `--surface-default`, `--size-3`, …) are unchanged.
|
|
22
|
+
|
|
1
23
|
# Migrating from v3 to v4
|
|
2
24
|
|
|
3
25
|
v4 is a full re-platform.
|
|
@@ -78,7 +100,7 @@ import { Button, Dialog, Tabs } from "opui-css/astro"
|
|
|
78
100
|
|
|
79
101
|
`astro` is an _optional_ peer — only required if you actually import from `opui-css/astro`. Pure-CSS consumers won't see a peer warning.
|
|
80
102
|
|
|
81
|
-
|
|
103
|
+
Astro components emit prefixed `ui-` classes (see the v4 → v5 section at the top of this file). Raw HTML and CSS overrides must use those prefixed names.
|
|
82
104
|
|
|
83
105
|
## 8. Cascade layers
|
|
84
106
|
|
package/README.md
CHANGED
|
@@ -22,11 +22,10 @@ Peer dependencies:
|
|
|
22
22
|
|
|
23
23
|
```astro
|
|
24
24
|
---
|
|
25
|
+
import "opui-css/css/imports.css"
|
|
25
26
|
import { Button, Card } from "opui-css/astro"
|
|
26
27
|
---
|
|
27
28
|
|
|
28
|
-
<link rel="stylesheet" href="opui-css/css/imports.css" />
|
|
29
|
-
|
|
30
29
|
<Card>
|
|
31
30
|
<Button variant="primary">Click me</Button>
|
|
32
31
|
</Card>
|
|
@@ -39,7 +38,7 @@ Drop a pre-bundled stylesheet into any page and use the documented class names:
|
|
|
39
38
|
```html
|
|
40
39
|
<link rel="stylesheet" href="https://unpkg.com/opui-css/dist/opui.css" />
|
|
41
40
|
|
|
42
|
-
<button class="button primary">Click me</button>
|
|
41
|
+
<button class="ui-button ui-primary">Click me</button>
|
|
43
42
|
```
|
|
44
43
|
|
|
45
44
|
`dist/opui.css` is a single self-contained file (Open Props + normalize + theme + every component + utils, in the correct cascade layers). `dist/opui.components.css` is the same minus tokens and reset for users who already have those.
|
package/components/AGENTS.md
CHANGED
|
@@ -68,32 +68,33 @@ const { as: Tag = Astro.props.href ? "a" : "button", ...rest } = Astro.props
|
|
|
68
68
|
- **Override**: Allow manual override via the `as` prop.
|
|
69
69
|
|
|
70
70
|
### Styling Inheritance
|
|
71
|
-
Components should often inherit styles from others (e.g., `Dialog` looking like a `Card`). Use conditional classes to apply the inherited base class.
|
|
71
|
+
Components should often inherit styles from others (e.g., `Dialog` looking like a `Card`). Use conditional classes to apply the inherited base class. All library classes are prefixed with `ui-`.
|
|
72
72
|
|
|
73
73
|
```astro
|
|
74
|
-
<dialog class:list={["dialog", { card: variant }, variant
|
|
74
|
+
<dialog class:list={["ui-dialog", { "ui-card": variant }, variant && `ui-${variant}`, className]} {...rest}>
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
---
|
|
78
78
|
|
|
79
79
|
## 3. Class Management
|
|
80
80
|
|
|
81
|
-
Use `class:list` exclusively.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
Use `class:list` exclusively. Every library-owned class is prefixed with `ui-`; the public prop API stays unprefixed (`<Button size="small" variant="outlined">`) and the component interpolates the prefix when rendering.
|
|
82
|
+
|
|
83
|
+
Follow this order for readability:
|
|
84
|
+
1. **Component Base Class**: The primary CSS class, prefixed (e.g., `"ui-button"`).
|
|
85
|
+
2. **State Objects**: Boolean flags as quoted prefixed keys (e.g., `{ "ui-disabled": disabled }`).
|
|
86
|
+
3. **Variant Props**: Interpolate the prefix from the prop value (e.g., `size && \`ui-${size}\``).
|
|
87
|
+
4. **External Class**: Always include `className` at the end to allow for overrides. Do not prefix `className`.
|
|
86
88
|
|
|
87
89
|
```astro
|
|
88
90
|
<div
|
|
89
91
|
class:list={[
|
|
90
|
-
"chip",
|
|
92
|
+
"ui-chip",
|
|
91
93
|
{
|
|
92
|
-
multiline: isMultiline,
|
|
93
|
-
selected,
|
|
94
|
+
"ui-multiline": isMultiline,
|
|
94
95
|
},
|
|
95
|
-
size
|
|
96
|
-
variant
|
|
96
|
+
size && `ui-${size}`,
|
|
97
|
+
variant && `ui-${variant}`,
|
|
97
98
|
className,
|
|
98
99
|
]}
|
|
99
100
|
>
|
|
@@ -107,9 +108,9 @@ Use `class:list` exclusively. Follow this order for readability:
|
|
|
107
108
|
For simple text-based components, provide both a `label` prop and a default slot.
|
|
108
109
|
|
|
109
110
|
```astro
|
|
110
|
-
<div class="component">
|
|
111
|
+
<div class="ui-component">
|
|
111
112
|
{ (label || Astro.slots.has("default")) && (
|
|
112
|
-
<span class="text">
|
|
113
|
+
<span class="ui-text">
|
|
113
114
|
{label}
|
|
114
115
|
<slot />
|
|
115
116
|
</span>
|
|
@@ -121,10 +122,10 @@ For simple text-based components, provide both a `label` prop and a default slot
|
|
|
121
122
|
Use named slots for specific functional areas. Check for existence before rendering wrapper tags.
|
|
122
123
|
|
|
123
124
|
```astro
|
|
124
|
-
<div class="card">
|
|
125
|
+
<div class="ui-card">
|
|
125
126
|
{Astro.slots.has("header") && <header><slot name="header" /></header>}
|
|
126
127
|
<slot />
|
|
127
|
-
{Astro.slots.has("actions") && <footer class="actions"><slot name="actions" /></footer>}
|
|
128
|
+
{Astro.slots.has("actions") && <footer class="ui-actions"><slot name="actions" /></footer>}
|
|
128
129
|
</div>
|
|
129
130
|
```
|
|
130
131
|
|
|
@@ -136,10 +137,10 @@ Use named slots for specific functional areas. Check for existence before render
|
|
|
136
137
|
Most inputs should be wrapped in a `<label>` to provide a larger hit area and built-in accessibility.
|
|
137
138
|
|
|
138
139
|
```astro
|
|
139
|
-
<label class:list={["field", { disabled, error }]}>
|
|
140
|
-
<span class="label">{label}</span>
|
|
140
|
+
<label class:list={["ui-field", { "ui-disabled": disabled, "ui-critical": error }]}>
|
|
141
|
+
<span class="ui-label">{label}</span>
|
|
141
142
|
<input type="text" {...rest} />
|
|
142
|
-
{endText && <span class="end-text">{endText}</span>}
|
|
143
|
+
{endText && <span class="ui-end-text">{endText}</span>}
|
|
143
144
|
</label>
|
|
144
145
|
```
|
|
145
146
|
|
|
@@ -18,7 +18,7 @@ const contentId = $id("content")
|
|
|
18
18
|
|
|
19
19
|
<details
|
|
20
20
|
name={name}
|
|
21
|
-
class:list={["accordion", "card", variant
|
|
21
|
+
class:list={["ui-accordion", "ui-card", variant && `ui-${variant}`, className]}
|
|
22
22
|
open={open}
|
|
23
23
|
{...rest}
|
|
24
24
|
>
|
|
@@ -27,14 +27,14 @@ const contentId = $id("content")
|
|
|
27
27
|
<summary id={summaryId} aria-controls={contentId}><slot name="summary" /><slot name="marker" /></summary>
|
|
28
28
|
|
|
29
29
|
<!-- Content -->
|
|
30
|
-
<div id={contentId} class="content" role="region" aria-labelledby={summaryId}>
|
|
30
|
+
<div id={contentId} class="ui-content" role="region" aria-labelledby={summaryId}>
|
|
31
31
|
<slot />
|
|
32
32
|
</div>
|
|
33
33
|
|
|
34
34
|
<!-- Actions -->
|
|
35
35
|
{
|
|
36
36
|
Astro.slots.has("actions") && (
|
|
37
|
-
<div class="actions">
|
|
37
|
+
<div class="ui-actions">
|
|
38
38
|
<slot name="actions" />
|
|
39
39
|
</div>
|
|
40
40
|
)
|
|
@@ -35,7 +35,7 @@ const positionArea = alignment
|
|
|
35
35
|
: {}
|
|
36
36
|
---
|
|
37
37
|
|
|
38
|
-
<span class:list={["anchor", className]} style={positionArea} {...rest}>
|
|
38
|
+
<span class:list={["ui-anchor", className]} style={positionArea} {...rest}>
|
|
39
39
|
{
|
|
40
40
|
isHover ? (
|
|
41
41
|
<span {...({ interestfor: id } as any)}>
|
|
@@ -45,7 +45,7 @@ const positionArea = alignment
|
|
|
45
45
|
<slot />
|
|
46
46
|
)
|
|
47
47
|
}
|
|
48
|
-
<span class="anchor-floating" id={id} popover={isHover ? "hint" : undefined}>
|
|
48
|
+
<span class="ui-anchor-floating" id={id} popover={isHover ? "hint" : undefined}>
|
|
49
49
|
<slot name="anchored" />
|
|
50
50
|
</span>
|
|
51
51
|
</span>
|
|
@@ -6,7 +6,6 @@ type Props = {
|
|
|
6
6
|
class?: string
|
|
7
7
|
href?: string
|
|
8
8
|
isGroup?: boolean
|
|
9
|
-
spacing?: "small" | "x-small"
|
|
10
9
|
src?: string
|
|
11
10
|
variant?: "squared" | "rounded" | "squircle"
|
|
12
11
|
}
|
|
@@ -19,7 +18,6 @@ const {
|
|
|
19
18
|
class: className,
|
|
20
19
|
href,
|
|
21
20
|
isGroup,
|
|
22
|
-
spacing,
|
|
23
21
|
src,
|
|
24
22
|
variant,
|
|
25
23
|
...rest
|
|
@@ -31,12 +29,8 @@ const Tag = as || (href ? "a" : "div")
|
|
|
31
29
|
<!-- prettier-ignore -->
|
|
32
30
|
<Tag
|
|
33
31
|
class:list={[
|
|
34
|
-
{ avatar: !isGroup },
|
|
35
|
-
!isGroup && variant
|
|
36
|
-
{
|
|
37
|
-
"gap-small": isGroup && spacing === "small",
|
|
38
|
-
"gap-x-small": isGroup && spacing === "x-small",
|
|
39
|
-
},
|
|
32
|
+
{ "ui-avatar": !isGroup },
|
|
33
|
+
!isGroup && variant && `ui-${variant}`,
|
|
40
34
|
className,
|
|
41
35
|
]}
|
|
42
36
|
href={href}
|
|
@@ -36,19 +36,24 @@ const positionArea =
|
|
|
36
36
|
<Anchor
|
|
37
37
|
alignment={positionArea}
|
|
38
38
|
class:list={[
|
|
39
|
-
"badge",
|
|
39
|
+
"ui-badge",
|
|
40
40
|
{
|
|
41
|
-
dot,
|
|
42
|
-
invisible,
|
|
41
|
+
"ui-dot": dot,
|
|
42
|
+
"ui-invisible": invisible,
|
|
43
43
|
},
|
|
44
|
-
alignment
|
|
44
|
+
alignment && `ui-${alignment}`,
|
|
45
45
|
className,
|
|
46
|
-
color
|
|
46
|
+
color && `ui-${color}`,
|
|
47
47
|
]}
|
|
48
48
|
{...rest}
|
|
49
49
|
>
|
|
50
50
|
<slot />
|
|
51
|
-
<span
|
|
52
|
-
|
|
51
|
+
<span
|
|
52
|
+
class="ui-badge-indicator"
|
|
53
|
+
slot="anchored"
|
|
54
|
+
aria-label={label?.toString()}
|
|
53
55
|
>
|
|
56
|
+
{dot ? "" : label}
|
|
57
|
+
{!dot && <slot name="indicator" />}
|
|
58
|
+
</span>
|
|
54
59
|
</Anchor>
|
|
@@ -39,7 +39,7 @@ const isButton = Tag === "button"
|
|
|
39
39
|
|
|
40
40
|
<!-- prettier-ignore -->
|
|
41
41
|
<Tag
|
|
42
|
-
class:list={["button", { disabled: isButton && disabled }, size
|
|
42
|
+
class:list={["ui-button", { "ui-disabled": isButton && disabled }, size && `ui-${size}`, variant && `ui-${variant}`, color && `ui-${color}`, className]}
|
|
43
43
|
disabled={isButton ? disabled : undefined}
|
|
44
44
|
href={href}
|
|
45
45
|
{...rest}><slot /></Tag>
|
|
@@ -21,7 +21,7 @@ const {
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
<div
|
|
24
|
-
class:list={["button-group", color
|
|
24
|
+
class:list={["ui-button-group", color && `ui-${color}`, size && `ui-${size}`, variant && `ui-${variant}`, orientation && `ui-${orientation}`, className]}
|
|
25
25
|
role="group"
|
|
26
26
|
{...rest}
|
|
27
27
|
>
|
|
@@ -13,7 +13,7 @@ const { class: className, severity, variant, ...rest } = Astro.props
|
|
|
13
13
|
|
|
14
14
|
<article
|
|
15
15
|
role="note"
|
|
16
|
-
class:list={["callout", variant
|
|
16
|
+
class:list={["ui-callout", variant && `ui-${variant}`, severity && `ui-${severity}`, className]}
|
|
17
17
|
{...rest}
|
|
18
18
|
>
|
|
19
19
|
<slot name="icon">
|
|
@@ -63,11 +63,11 @@ const { class: className, severity, variant, ...rest } = Astro.props
|
|
|
63
63
|
)
|
|
64
64
|
}
|
|
65
65
|
</slot>
|
|
66
|
-
<div class="content">
|
|
66
|
+
<div class="ui-content">
|
|
67
67
|
{
|
|
68
68
|
Astro.slots.has("title") && (
|
|
69
69
|
<!-- prettier-ignore -->
|
|
70
|
-
<h3 class="title"><slot name="title" /></h3>
|
|
70
|
+
<h3 class="ui-title"><slot name="title" /></h3>
|
|
71
71
|
)
|
|
72
72
|
}
|
|
73
73
|
<slot />
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
---
|
|
2
2
|
type Props = {
|
|
3
|
+
actionsAlign?: "start" | "end"
|
|
3
4
|
variant?: "text" | "outlined" | "elevated" | "tonal"
|
|
4
|
-
actions?: {
|
|
5
|
-
align?: "end"
|
|
6
|
-
}
|
|
7
5
|
[key: string]: any
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
export const title = "Card"
|
|
11
9
|
|
|
12
|
-
const { variant,
|
|
10
|
+
const { variant, actionsAlign, class: className, ...rest } = Astro.props
|
|
13
11
|
---
|
|
14
12
|
|
|
15
|
-
<div class:list={["card", variant
|
|
13
|
+
<div class:list={["ui-card", variant && `ui-${variant}`, className]} {...rest}>
|
|
16
14
|
{
|
|
17
15
|
Astro.slots.has("header") && (
|
|
18
16
|
<hgroup>
|
|
@@ -22,7 +20,7 @@ const { variant, actions, class: className, ...rest } = Astro.props
|
|
|
22
20
|
}
|
|
23
21
|
{
|
|
24
22
|
Astro.slots.has("content") && (
|
|
25
|
-
<div class="content">
|
|
23
|
+
<div class="ui-content">
|
|
26
24
|
<slot name="content" />
|
|
27
25
|
</div>
|
|
28
26
|
)
|
|
@@ -30,7 +28,7 @@ const { variant, actions, class: className, ...rest } = Astro.props
|
|
|
30
28
|
<slot />
|
|
31
29
|
{
|
|
32
30
|
Astro.slots.has("actions") && (
|
|
33
|
-
<div class:list={["actions",
|
|
31
|
+
<div class:list={["ui-actions", actionsAlign && `ui-align-${actionsAlign}`]}>
|
|
34
32
|
<slot name="actions" />
|
|
35
33
|
</div>
|
|
36
34
|
)
|
|
@@ -45,11 +45,11 @@ const finalName = name || currentFieldName
|
|
|
45
45
|
|
|
46
46
|
<label
|
|
47
47
|
class:list={[
|
|
48
|
-
"checkbox",
|
|
49
|
-
size
|
|
48
|
+
"ui-checkbox",
|
|
49
|
+
size && `ui-${size}`,
|
|
50
50
|
{
|
|
51
|
-
stack,
|
|
52
|
-
spread,
|
|
51
|
+
"ui-stack": stack,
|
|
52
|
+
"ui-spread": spread,
|
|
53
53
|
},
|
|
54
54
|
className,
|
|
55
55
|
]}
|
|
@@ -66,11 +66,11 @@ const finalName = name || currentFieldName
|
|
|
66
66
|
{value}
|
|
67
67
|
{...rest}
|
|
68
68
|
/>
|
|
69
|
-
<!-- prettier-ignore --><span class:list={[hideLabel ? "sr-only" : "label"]}><slot /></span>
|
|
69
|
+
<!-- prettier-ignore --><span class:list={[hideLabel ? "ui-sr-only" : "ui-label"]}><slot /></span>
|
|
70
70
|
{
|
|
71
71
|
Astro.slots.has("end-text") && (
|
|
72
72
|
<!-- prettier-ignore -->
|
|
73
|
-
<span id={endTextId} class="end-text"><slot name="end-text" /></span>
|
|
73
|
+
<span id={endTextId} class="ui-end-text"><slot name="end-text" /></span>
|
|
74
74
|
)
|
|
75
75
|
}
|
|
76
76
|
</label>
|
|
@@ -25,13 +25,13 @@ const {
|
|
|
25
25
|
<!-- prettier-ignore -->
|
|
26
26
|
<Tag
|
|
27
27
|
class:list={[
|
|
28
|
-
"chip",
|
|
28
|
+
"ui-chip",
|
|
29
29
|
{
|
|
30
|
-
multiline,
|
|
30
|
+
"ui-multiline": multiline,
|
|
31
31
|
},
|
|
32
|
-
size
|
|
33
|
-
variant
|
|
32
|
+
size && `ui-${size}`,
|
|
33
|
+
variant && `ui-${variant}`,
|
|
34
34
|
className,
|
|
35
35
|
]}
|
|
36
36
|
{...rest}
|
|
37
|
-
><slot name="start" /><slot />{label && <span class="text">{label}</span>}<slot name="end" /></Tag>
|
|
37
|
+
><slot name="start" /><slot />{label && <span class="ui-text">{label}</span>}<slot name="end" /></Tag>
|
|
@@ -45,10 +45,10 @@ const labelId = $id("select-label")
|
|
|
45
45
|
|
|
46
46
|
<label
|
|
47
47
|
class:list={[
|
|
48
|
-
"select",
|
|
49
|
-
size
|
|
48
|
+
"ui-select",
|
|
49
|
+
size && `ui-${size}`,
|
|
50
50
|
{
|
|
51
|
-
filled: variant === "filled",
|
|
51
|
+
"ui-filled": variant === "filled",
|
|
52
52
|
},
|
|
53
53
|
className,
|
|
54
54
|
]}
|
|
@@ -57,10 +57,10 @@ const labelId = $id("select-label")
|
|
|
57
57
|
{
|
|
58
58
|
label && (
|
|
59
59
|
<!-- prettier-ignore -->
|
|
60
|
-
<span class="label" id={labelId}>{label}</span>
|
|
60
|
+
<span class="ui-label" id={labelId}>{label}</span>
|
|
61
61
|
)
|
|
62
62
|
}
|
|
63
|
-
<span class="field">
|
|
63
|
+
<span class="ui-field">
|
|
64
64
|
<select
|
|
65
65
|
aria-labelledby={label ? labelId : undefined}
|
|
66
66
|
disabled={disabled}
|
|
@@ -77,7 +77,7 @@ const labelId = $id("select-label")
|
|
|
77
77
|
{
|
|
78
78
|
endText && (
|
|
79
79
|
<!-- prettier-ignore -->
|
|
80
|
-
<span class="end-text">{endText}</span>
|
|
80
|
+
<span class="ui-end-text">{endText}</span>
|
|
81
81
|
)
|
|
82
82
|
}
|
|
83
83
|
</label>
|
|
@@ -12,8 +12,8 @@ const { bordered, class: className, ...rest } = Astro.props
|
|
|
12
12
|
|
|
13
13
|
<dl
|
|
14
14
|
class:list={[
|
|
15
|
-
"description-list",
|
|
16
|
-
{ bordered: bordered, dotted: bordered === "dotted" },
|
|
15
|
+
"ui-description-list",
|
|
16
|
+
{ "ui-bordered": bordered, "ui-dotted": bordered === "dotted" },
|
|
17
17
|
className,
|
|
18
18
|
]}
|
|
19
19
|
{...rest}
|
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
---
|
|
2
2
|
type Props = {
|
|
3
3
|
[key: string]: any
|
|
4
|
-
|
|
5
|
-
align?: "end"
|
|
6
|
-
}
|
|
4
|
+
actionsAlign?: "start" | "end"
|
|
7
5
|
class?: string
|
|
8
6
|
closedby?: "any" | "closerequest" | "none"
|
|
9
7
|
}
|
|
10
8
|
|
|
11
9
|
export const title = "Dialog"
|
|
12
10
|
|
|
13
|
-
const {
|
|
11
|
+
const { actionsAlign, class: className, closedby, ...rest } = Astro.props
|
|
14
12
|
---
|
|
15
13
|
|
|
16
14
|
<dialog
|
|
17
|
-
class:list={["dialog card elevated", className]}
|
|
15
|
+
class:list={["ui-dialog ui-card ui-elevated", className]}
|
|
18
16
|
closedby={closedby}
|
|
19
17
|
{...rest}
|
|
20
18
|
>
|
|
@@ -27,7 +25,7 @@ const { actions, class: className, closedby, ...rest } = Astro.props
|
|
|
27
25
|
}
|
|
28
26
|
{
|
|
29
27
|
Astro.slots.has("content") && (
|
|
30
|
-
<div class="content">
|
|
28
|
+
<div class="ui-content">
|
|
31
29
|
<slot name="content" />
|
|
32
30
|
</div>
|
|
33
31
|
)
|
|
@@ -35,7 +33,7 @@ const { actions, class: className, closedby, ...rest } = Astro.props
|
|
|
35
33
|
<slot />
|
|
36
34
|
{
|
|
37
35
|
Astro.slots.has("actions") && (
|
|
38
|
-
<div class:list={["actions",
|
|
36
|
+
<div class:list={["ui-actions", actionsAlign && `ui-align-${actionsAlign}`]}>
|
|
39
37
|
<slot name="actions" />
|
|
40
38
|
</div>
|
|
41
39
|
)
|
|
@@ -11,4 +11,7 @@ const { class: className, variant, ...rest } = Astro.props
|
|
|
11
11
|
const variantClass = variant ? `border-${variant}` : ""
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
-
<hr
|
|
14
|
+
<hr
|
|
15
|
+
class:list={["ui-divider", className, variantClass && `ui-${variantClass}`]}
|
|
16
|
+
{...rest}
|
|
17
|
+
/>
|
|
@@ -28,11 +28,11 @@ const drawerId = id || $id("drawer")
|
|
|
28
28
|
<dialog
|
|
29
29
|
closedby={closedby}
|
|
30
30
|
class:list={[
|
|
31
|
-
"drawer",
|
|
32
|
-
side
|
|
31
|
+
"ui-drawer",
|
|
32
|
+
side && `ui-${side}`,
|
|
33
33
|
{
|
|
34
|
-
"backdrop-transparent": backdrop === "transparent",
|
|
35
|
-
"scroll-lock": scrollLock,
|
|
34
|
+
"ui-backdrop-transparent": backdrop === "transparent",
|
|
35
|
+
"ui-scroll-lock": scrollLock,
|
|
36
36
|
},
|
|
37
37
|
className,
|
|
38
38
|
]}
|
|
@@ -41,7 +41,7 @@ const drawerId = id || $id("drawer")
|
|
|
41
41
|
>
|
|
42
42
|
{Astro.slots.has("header") && <slot name="header" />}
|
|
43
43
|
|
|
44
|
-
<div class="content">
|
|
44
|
+
<div class="ui-content">
|
|
45
45
|
<slot name="content" />
|
|
46
46
|
</div>
|
|
47
47
|
|
|
@@ -12,7 +12,7 @@ export const title = "Drawer Header"
|
|
|
12
12
|
const { class: className, heading, ...rest } = Astro.props
|
|
13
13
|
---
|
|
14
14
|
|
|
15
|
-
<div class:list={["header", className]} {...rest}>
|
|
15
|
+
<div class:list={["ui-header", className]} {...rest}>
|
|
16
16
|
{heading && <span>{heading}</span>}
|
|
17
17
|
<slot />
|
|
18
18
|
<IconButton onclick="this.closest('dialog').close()" title="Close">
|