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.
Files changed (90) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/MIGRATING.md +23 -1
  3. package/README.md +2 -3
  4. package/components/AGENTS.md +20 -19
  5. package/components/Accordion/Accordion.astro +3 -3
  6. package/components/Anchor/Anchor.astro +2 -2
  7. package/components/Avatar/Avatar.astro +2 -8
  8. package/components/Badge/Badge.astro +12 -7
  9. package/components/Button/Button.astro +1 -1
  10. package/components/ButtonGroup/ButtonGroup.astro +1 -1
  11. package/components/Callout/Callout.astro +3 -3
  12. package/components/Card/Card.astro +5 -7
  13. package/components/Checkbox/Checkbox.astro +6 -6
  14. package/components/Chip/Chip.astro +5 -5
  15. package/components/ClassicSelect/ClassicSelect.astro +6 -6
  16. package/components/DescriptionList/Description.astro +1 -1
  17. package/components/DescriptionList/DescriptionList.astro +2 -2
  18. package/components/DescriptionList/Item.astro +1 -1
  19. package/components/DescriptionList/Term.astro +1 -1
  20. package/components/Dialog/Dialog.astro +5 -7
  21. package/components/Divider/Divider.astro +4 -1
  22. package/components/Drawer/Drawer.astro +5 -5
  23. package/components/Drawer/DrawerFooter.astro +1 -1
  24. package/components/Drawer/DrawerHeader.astro +1 -1
  25. package/components/FieldDescription/FieldDescription.astro +1 -1
  26. package/components/FieldGroup/FieldGroup.astro +1 -1
  27. package/components/FieldLegend/FieldLegend.astro +1 -1
  28. package/components/FieldSet/FieldSet.astro +1 -1
  29. package/components/Form/Form.astro +1 -1
  30. package/components/IconButton/IconButton.astro +1 -1
  31. package/components/List/List.astro +5 -5
  32. package/components/ListItem/ListItem.astro +12 -12
  33. package/components/Progress/Progress.astro +1 -1
  34. package/components/Radio/Radio.astro +5 -5
  35. package/components/Range/Range.astro +8 -8
  36. package/components/Select/Select.astro +13 -13
  37. package/components/Switch/Switch.astro +8 -8
  38. package/components/Table/Table.astro +4 -1
  39. package/components/Tabs/Tabs.astro +1 -1
  40. package/components/Tabs/TabsItem.astro +1 -1
  41. package/components/Tabs/TabsPanel.astro +1 -1
  42. package/components/Tabs/TabsTab.astro +1 -1
  43. package/components/TextField/TextField.astro +13 -13
  44. package/components/Textarea/Textarea.astro +13 -13
  45. package/components/Toast/Toast.astro +6 -6
  46. package/components/ToggleButton/ToggleButton.astro +3 -3
  47. package/components/ToggleGroup/ToggleGroup.astro +3 -3
  48. package/components/Tooltip/Tooltip.astro +1 -1
  49. package/core/utils.css +4 -4
  50. package/css/components/accordion.css +11 -11
  51. package/css/components/anchor.css +3 -3
  52. package/css/components/avatar.css +5 -5
  53. package/css/components/badge.css +14 -14
  54. package/css/components/button-group.css +16 -16
  55. package/css/components/button.css +12 -12
  56. package/css/components/callout.css +9 -9
  57. package/css/components/card.css +12 -12
  58. package/css/components/checkbox.css +13 -13
  59. package/css/components/chip.css +5 -5
  60. package/css/components/description-list.css +11 -8
  61. package/css/components/dialog.css +3 -3
  62. package/css/components/divider.css +4 -4
  63. package/css/components/drawer.css +21 -21
  64. package/css/components/form.css +18 -18
  65. package/css/components/icon-button.css +9 -9
  66. package/css/components/link.css +1 -1
  67. package/css/components/list.css +29 -29
  68. package/css/components/progress.css +4 -4
  69. package/css/components/radio.css +10 -10
  70. package/css/components/range.css +31 -31
  71. package/css/components/select.css +4 -4
  72. package/css/components/spinner.css +1 -1
  73. package/css/components/switch.css +23 -23
  74. package/css/components/table.css +3 -3
  75. package/css/components/tabs.css +14 -8
  76. package/css/components/text-field.css +47 -47
  77. package/css/components/text-input.css +7 -7
  78. package/css/components/textarea.css +3 -3
  79. package/css/components/toast.css +12 -12
  80. package/css/components/toggle-button.css +6 -6
  81. package/css/components/toggle-group.css +10 -10
  82. package/css/components/tooltip.css +6 -6
  83. package/css/components/typography.css +30 -30
  84. package/css/js/toast.js +7 -7
  85. package/css/theme.css +8 -8
  86. package/dist/opui.components.css +407 -398
  87. package/dist/opui.components.css.map +1 -1
  88. package/dist/opui.css +419 -410
  89. package/dist/opui.css.map +1 -1
  90. package/package.json +1 -1
@@ -23,4 +23,4 @@ const {
23
23
  ---
24
24
 
25
25
  <!-- prettier-ignore -->
26
- <Tag class:list={["icon-button", size, variant, color, className]} href={href} {...rest}><slot /></Tag>
26
+ <Tag class:list={["ui-icon-button", size && `ui-${size}`, variant && `ui-${variant}`, color && `ui-${color}`, className]} href={href} {...rest}><slot /></Tag>
@@ -21,13 +21,13 @@ const {
21
21
 
22
22
  <ul
23
23
  class:list={[
24
- "list",
24
+ "ui-list",
25
25
  {
26
- bordered,
27
- dense,
28
- gutterless,
26
+ "ui-bordered": bordered,
27
+ "ui-dense": dense,
28
+ "ui-gutterless": gutterless,
29
29
  },
30
- variant,
30
+ variant && `ui-${variant}`,
31
31
  className,
32
32
  ]}
33
33
  {...rest}
@@ -35,8 +35,8 @@ const innerProps = Tag ? rest : {}
35
35
  <li
36
36
  class:list={[
37
37
  {
38
- "border-top": borderTop,
39
- inset,
38
+ "ui-border-top": borderTop,
39
+ "ui-inset": inset,
40
40
  },
41
41
  className,
42
42
  ]}
@@ -45,21 +45,21 @@ const innerProps = Tag ? rest : {}
45
45
  {
46
46
  // Label + checkbox/radio/switch
47
47
  hasLabel ? (
48
- <label class={labelClass} for={htmlFor}>
48
+ <label class={labelClass && `ui-${labelClass}`} for={htmlFor}>
49
49
  {Astro.slots.start && (
50
- <div class="start">
50
+ <div class="ui-start">
51
51
  <slot name="start" />
52
52
  </div>
53
53
  )}
54
54
  {Astro.slots.text || headline || description ? (
55
- <div class="text">
55
+ <div class="ui-text">
56
56
  {headline && <p>{headline}</p>}
57
57
  {description && <p>{description}</p>}
58
58
  <slot name="text" />
59
59
  </div>
60
60
  ) : null}
61
61
  {Astro.slots.end && (
62
- <div class="end">
62
+ <div class="ui-end">
63
63
  <slot name="end" />
64
64
  </div>
65
65
  )}
@@ -69,12 +69,12 @@ const innerProps = Tag ? rest : {}
69
69
  Tag ? (
70
70
  <Tag {...innerProps}>
71
71
  {Astro.slots.start && (
72
- <div class="start">
72
+ <div class="ui-start">
73
73
  <slot name="start" />
74
74
  </div>
75
75
  )}
76
76
  {headline || description || Astro.slots.text ? (
77
- <div class="text">
77
+ <div class="ui-text">
78
78
  {headline && <p>{headline}</p>}
79
79
  {description && <p>{description}</p>}
80
80
  <slot name="text" />
@@ -84,7 +84,7 @@ const innerProps = Tag ? rest : {}
84
84
  <slot />
85
85
  )}
86
86
  {Astro.slots.end && (
87
- <div class="end">
87
+ <div class="ui-end">
88
88
  <slot name="end" />
89
89
  </div>
90
90
  )}
@@ -93,12 +93,12 @@ const innerProps = Tag ? rest : {}
93
93
  // Without custom tag
94
94
  <>
95
95
  {Astro.slots.start && (
96
- <div class="start">
96
+ <div class="ui-start">
97
97
  <slot name="start" />
98
98
  </div>
99
99
  )}
100
100
  {headline || description || Astro.slots.text ? (
101
- <div class="text">
101
+ <div class="ui-text">
102
102
  {headline && <p>{headline}</p>}
103
103
  {description && <p>{description}</p>}
104
104
  <slot name="text" />
@@ -108,7 +108,7 @@ const innerProps = Tag ? rest : {}
108
108
  <slot />
109
109
  )}
110
110
  {Astro.slots.end && (
111
- <div class="end">
111
+ <div class="ui-end">
112
112
  <slot name="end" />
113
113
  </div>
114
114
  )}
@@ -30,7 +30,7 @@ const {
30
30
  aria-busy={ariaBusy}
31
31
  aria-describedby={ariaDescribedby}
32
32
  aria-label={ariaLabel}
33
- class:list={["progress", className, variant]}
33
+ class:list={["ui-progress", className, variant && `ui-${variant}`]}
34
34
  id={id}
35
35
  max={max}
36
36
  value={value}
@@ -41,10 +41,10 @@ const finalName = name || currentFieldName
41
41
 
42
42
  <label
43
43
  class:list={[
44
- "radio",
45
- size,
44
+ "ui-radio",
45
+ size && `ui-${size}`,
46
46
  {
47
- stack,
47
+ "ui-stack": stack,
48
48
  },
49
49
  className,
50
50
  ]}
@@ -60,11 +60,11 @@ const finalName = name || currentFieldName
60
60
  {value}
61
61
  {...rest}
62
62
  />
63
- <!-- prettier-ignore --><span class:list={[hideLabel ? "sr-only" : "label"]}><slot /></span>
63
+ <!-- prettier-ignore --><span class:list={[hideLabel ? "ui-sr-only" : "ui-label"]}><slot /></span>
64
64
  {
65
65
  Astro.slots.has("end-text") && (
66
66
  <!-- prettier-ignore -->
67
- <span id={endTextId} class="end-text"><slot name="end-text" /></span>
67
+ <span id={endTextId} class="ui-end-text"><slot name="end-text" /></span>
68
68
  )
69
69
  }
70
70
  </label>
@@ -60,23 +60,23 @@ const endTextId = hasEndText ? $id("range-end") : undefined
60
60
  const describedBy = [startTextId, endTextId].filter(Boolean).join(" ") || undefined
61
61
  ---
62
62
 
63
- <label class:list={["range", variant, { spread }, className]}>
63
+ <label class:list={["ui-range", variant && `ui-${variant}`, { "ui-spread": spread }, className]}>
64
64
  {
65
65
  hasLabel && (
66
66
  <!-- prettier-ignore -->
67
- <span class="label" id={labelId}>{label}<slot /></span>
67
+ <span class="ui-label" id={labelId}>{label}<slot /></span>
68
68
  )
69
69
  }
70
70
  {
71
71
  hasValue && (
72
- <output class="value" for={inputId} data-suffix={valueSuffix}>
72
+ <output class="ui-value" for={inputId} data-suffix={valueSuffix}>
73
73
  <slot name="value">{value}</slot>
74
74
  </output>
75
75
  )
76
76
  }
77
77
  {
78
78
  hasStartText && (
79
- <span class="start-text" id={startTextId}>
79
+ <span class="ui-start-text" id={startTextId}>
80
80
  {startText}<slot name="start-text" />
81
81
  </span>
82
82
  )
@@ -111,7 +111,7 @@ const describedBy = [startTextId, endTextId].filter(Boolean).join(" ") || undefi
111
111
  }
112
112
  {
113
113
  hasEndText && (
114
- <span class="end-text" id={endTextId}>
114
+ <span class="ui-end-text" id={endTextId}>
115
115
  {endText}<slot name="end-text" />
116
116
  </span>
117
117
  )
@@ -120,11 +120,11 @@ const describedBy = [startTextId, endTextId].filter(Boolean).join(" ") || undefi
120
120
 
121
121
  <script>
122
122
  // Mirror the slider's current value into its associated <output> on every
123
- // input event. Idempotent: each .range is wired once, and ignores ranges
123
+ // input event. Idempotent: each .ui-range is wired once, and ignores ranges
124
124
  // without a value display.
125
- for (const range of document.querySelectorAll<HTMLElement>(".range")) {
125
+ for (const range of document.querySelectorAll<HTMLElement>(".ui-range")) {
126
126
  const input = range.querySelector<HTMLInputElement>('input[type="range"]')
127
- const output = range.querySelector<HTMLOutputElement>(":scope > output.value")
127
+ const output = range.querySelector<HTMLOutputElement>(":scope > output.ui-value")
128
128
  if (!input || !output) continue
129
129
  const suffix = output.dataset.suffix ?? ""
130
130
  const update = () => {
@@ -52,11 +52,11 @@ const labelId = $id("select-label")
52
52
 
53
53
  <label
54
54
  class:list={[
55
- "select",
56
- size,
55
+ "ui-select",
56
+ size && `ui-${size}`,
57
57
  {
58
- filled: variant === "filled",
59
- spread,
58
+ "ui-filled": variant === "filled",
59
+ "ui-spread": spread,
60
60
  },
61
61
  className,
62
62
  ]}
@@ -65,16 +65,16 @@ const labelId = $id("select-label")
65
65
  {
66
66
  (label || Astro.slots.has("label")) && (
67
67
  <!-- prettier-ignore -->
68
- <span class="label" id={labelId}>{label}<slot name="label" /></span>
68
+ <span class="ui-label" id={labelId}>{label}<slot name="label" /></span>
69
69
  )
70
70
  }
71
71
  {
72
72
  (description || Astro.slots.has("description")) && (
73
73
  <!-- prettier-ignore -->
74
- <span class="start-text">{description}<slot name="description" /></span>
74
+ <span class="ui-start-text">{description}<slot name="description" /></span>
75
75
  )
76
76
  }
77
- <span class="field">
77
+ <span class="ui-field">
78
78
  <select
79
79
  aria-labelledby={label ? labelId : undefined}
80
80
  disabled={disabled}
@@ -87,20 +87,20 @@ const labelId = $id("select-label")
87
87
  <button>
88
88
  <selectedcontent></selectedcontent>
89
89
  </button>
90
- <div class:list={["list", { dense }]}>
90
+ <div class:list={["ui-list", { "ui-dense": dense }]}>
91
91
  {items.map((item) => <option value={item.value}>{item.text}</option>)}
92
92
  <slot />
93
93
  </div>
94
94
  </select>
95
- {Astro.slots.has("prefix") && <span class="prefix"><slot name="prefix" /></span>}
96
- {Astro.slots.has("suffix") && <span class="suffix"><slot name="suffix" /></span>}
97
- {Astro.slots.has("header") && <span class="header"><slot name="header" /></span>}
98
- {Astro.slots.has("footer") && <span class="footer"><slot name="footer" /></span>}
95
+ {Astro.slots.has("prefix") && <span class="ui-prefix"><slot name="prefix" /></span>}
96
+ {Astro.slots.has("suffix") && <span class="ui-suffix"><slot name="suffix" /></span>}
97
+ {Astro.slots.has("header") && <span class="ui-header"><slot name="header" /></span>}
98
+ {Astro.slots.has("footer") && <span class="ui-footer"><slot name="footer" /></span>}
99
99
  </span>
100
100
  {
101
101
  (endText || Astro.slots.has("end-text")) && (
102
102
  <!-- prettier-ignore -->
103
- <span id={$id("end-text")} class="end-text">{endText}<slot name="end-text" /></span>
103
+ <span id={$id("end-text")} class="ui-end-text">{endText}<slot name="end-text" /></span>
104
104
  )
105
105
  }
106
106
  </label>
@@ -54,11 +54,11 @@ if (
54
54
 
55
55
  <label
56
56
  class:list={[
57
- "switch",
57
+ "ui-switch",
58
58
  {
59
- small,
60
- stack,
61
- spread,
59
+ "ui-small": small,
60
+ "ui-stack": stack,
61
+ "ui-spread": spread,
62
62
  },
63
63
  className,
64
64
  ]}
@@ -66,14 +66,14 @@ if (
66
66
  >
67
67
  {
68
68
  Astro.slots.has("icon-unchecked") && (
69
- <span class="icon-unchecked" aria-hidden="true">
69
+ <span class="ui-icon-unchecked" aria-hidden="true">
70
70
  <slot name="icon-unchecked" />
71
71
  </span>
72
72
  )
73
73
  }
74
74
  {
75
75
  Astro.slots.has("icon-checked") && (
76
- <span class="icon-checked" aria-hidden="true">
76
+ <span class="ui-icon-checked" aria-hidden="true">
77
77
  <slot name="icon-checked" />
78
78
  </span>
79
79
  )
@@ -90,12 +90,12 @@ if (
90
90
  />
91
91
  {
92
92
  Astro.slots.has("default") && (
93
- <!-- prettier-ignore --><span class:list={[hideLabel ? "sr-only" : "label"]}><slot /></span>)
93
+ <!-- prettier-ignore --><span class:list={[hideLabel ? "ui-sr-only" : "ui-label"]}><slot /></span>)
94
94
  }
95
95
  {
96
96
  Astro.slots.has("end-text") && (
97
97
  <!-- prettier-ignore -->
98
- <span id={endTextId} class="end-text"><slot name="end-text" /></span>
98
+ <span id={endTextId} class="ui-end-text"><slot name="end-text" /></span>
99
99
  )
100
100
  }
101
101
  </label>
@@ -10,6 +10,9 @@ export const title = "Table"
10
10
  const { class: className, variant, ...rest } = Astro.props
11
11
  ---
12
12
 
13
- <table class:list={[className, variant]} {...rest}>
13
+ <table
14
+ class:list={["ui-table", className, variant && `ui-${variant}`]}
15
+ {...rest}
16
+ >
14
17
  <slot />
15
18
  </table>
@@ -21,7 +21,7 @@ Astro.locals.tabsGroupName = originalGroupName
21
21
  ---
22
22
 
23
23
  <div
24
- class:list={["tabs", className]}
24
+ class:list={["ui-tabs", className]}
25
25
  role="tablist"
26
26
  {...rest}
27
27
  set:html={html}
@@ -38,7 +38,7 @@ Astro.locals.tabsGroupName = originalGroupName
38
38
  <input
39
39
  aria-controls={panelId}
40
40
  checked={open}
41
- class:list={["tab-input", className]}
41
+ class:list={["ui-tab-input", className]}
42
42
  id={tabId}
43
43
  name={tabsGroupName}
44
44
  type="radio"
@@ -12,7 +12,7 @@ const { currentPanelId, currentTabId } = Astro.locals
12
12
 
13
13
  <div
14
14
  id={panelId || currentPanelId}
15
- class:list={["tab-panel", className]}
15
+ class:list={["ui-tab-panel", className]}
16
16
  role="tabpanel"
17
17
  aria-labelledby={tabId || currentTabId}
18
18
  {...rest}
@@ -11,7 +11,7 @@ const { currentTabId } = Astro.locals
11
11
 
12
12
  <label
13
13
  for={tabId || currentTabId}
14
- class:list={["tab-label", className]}
14
+ class:list={["ui-tab-label", className]}
15
15
  role="tab"
16
16
  {...rest}
17
17
  >
@@ -73,12 +73,12 @@ const fieldName = name || currentFieldName
73
73
 
74
74
  <label
75
75
  class:list={[
76
- "text-field",
76
+ "ui-text-field",
77
77
  {
78
- "auto-fit": autoFit,
79
- filled,
80
- spread,
81
- small,
78
+ "ui-auto-fit": autoFit,
79
+ "ui-filled": filled,
80
+ "ui-spread": spread,
81
+ "ui-small": small,
82
82
  },
83
83
  className,
84
84
  ]}
@@ -88,16 +88,16 @@ const fieldName = name || currentFieldName
88
88
  {
89
89
  (label || Astro.slots.has("label")) && (
90
90
  <!-- prettier-ignore -->
91
- <span class="label">{label}<slot name="label" /></span>
91
+ <span class="ui-label">{label}<slot name="label" /></span>
92
92
  )
93
93
  }
94
94
  {
95
95
  (startTextValue || Astro.slots.has("description")) && (
96
96
  <!-- prettier-ignore -->
97
- <span class="start-text">{startTextValue}<slot name="description" /></span>
97
+ <span class="ui-start-text">{startTextValue}<slot name="description" /></span>
98
98
  )
99
99
  }
100
- <span class="field">
100
+ <span class="ui-field">
101
101
  <input
102
102
  disabled={disabled}
103
103
  id={fieldId}
@@ -113,15 +113,15 @@ const fieldName = name || currentFieldName
113
113
  type={type === "numeric" ? "text" : type}
114
114
  value={value}
115
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>}
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
120
  </span>
121
121
  {
122
122
  (endText || Astro.slots.has("end-text") || Astro.slots.has("supporting-text")) && (
123
123
  <!-- prettier-ignore -->
124
- <span class="end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
124
+ <span class="ui-end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
125
125
  )
126
126
  }
127
127
  <slot />
@@ -54,12 +54,12 @@ const fieldName = name || currentFieldName
54
54
 
55
55
  <label
56
56
  class:list={[
57
- "textarea",
57
+ "ui-textarea",
58
58
  {
59
- "auto-fit": autoFit,
60
- filled,
61
- spread,
62
- small,
59
+ "ui-auto-fit": autoFit,
60
+ "ui-filled": filled,
61
+ "ui-spread": spread,
62
+ "ui-small": small,
63
63
  },
64
64
  className,
65
65
  ]}
@@ -69,17 +69,17 @@ const fieldName = name || currentFieldName
69
69
  {
70
70
  (label || Astro.slots.has("label")) && (
71
71
  <!-- prettier-ignore -->
72
- <span class="label">{label}<slot name="label" /></span>
72
+ <span class="ui-label">{label}<slot name="label" /></span>
73
73
  )
74
74
  }
75
75
 
76
76
  {
77
77
  (description || Astro.slots.has("description")) && (
78
78
  <!-- prettier-ignore -->
79
- <span class="start-text">{description}<slot name="description" /></span>
79
+ <span class="ui-start-text">{description}<slot name="description" /></span>
80
80
  )
81
81
  }
82
- <span class="field">
82
+ <span class="ui-field">
83
83
  <textarea
84
84
  cols={cols}
85
85
  disabled={disabled}
@@ -91,15 +91,15 @@ const fieldName = name || currentFieldName
91
91
  required={required}
92
92
  rows={rows}
93
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>}
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
98
  </span>
99
99
  {
100
100
  (endText || Astro.slots.has("end-text") || Astro.slots.has("supporting-text")) && (
101
101
  <!-- prettier-ignore -->
102
- <span class="end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
102
+ <span class="ui-end-text">{endText}<slot name="end-text" /><slot name="supporting-text" /></span>
103
103
  )
104
104
  }
105
105
  <slot />
@@ -6,15 +6,15 @@ export const title = "Toast"
6
6
  ></output>
7
7
 
8
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>
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
14
  </div>
15
15
  <button
16
16
  aria-label="Close"
17
- class="close-button"
17
+ class="ui-close-button"
18
18
  data-toast-close
19
19
  type="button"
20
20
  >
@@ -33,9 +33,9 @@ const id = rest.id || $id("toggle")
33
33
 
34
34
  <label
35
35
  class:list={[
36
- "toggle-button",
37
- { selected: pressed, disabled },
38
- size,
36
+ "ui-toggle-button",
37
+ { "ui-disabled": disabled },
38
+ size && `ui-${size}`,
39
39
  className,
40
40
  ]}
41
41
  >
@@ -37,9 +37,9 @@ Astro.locals.currentToggleGroupType = originalType
37
37
 
38
38
  <div
39
39
  class:list={[
40
- "toggle-group",
41
- size !== "default" && size,
42
- orientation,
40
+ "ui-toggle-group",
41
+ size !== "default" && size && `ui-${size}`,
42
+ orientation && `ui-${orientation}`,
43
43
  className,
44
44
  ]}
45
45
  role={selection === "single" ? "radiogroup" : "group"}
@@ -17,7 +17,7 @@ const { alignment, arrow, class: className, id, label, ...rest } = Astro.props
17
17
 
18
18
  <Anchor
19
19
  alignment={alignment}
20
- class:list={["tooltip", { "with-arrow": arrow }, className]}
20
+ class:list={["ui-tooltip", { "ui-with-arrow": arrow }, className]}
21
21
  id={id}
22
22
  trigger="hover"
23
23
  {...rest}
package/core/utils.css CHANGED
@@ -4,7 +4,7 @@
4
4
  Screen-reader only
5
5
  When you visibly want to hide an element but make it accessible for screen readers.
6
6
  */
7
- .sr-only {
7
+ .ui-sr-only {
8
8
  block-size: 1px;
9
9
  clip-path: inset(50%);
10
10
  inline-size: 1px;
@@ -15,17 +15,17 @@ When you visibly want to hide an element but make it accessible for screen reade
15
15
 
16
16
  /*
17
17
  Scroll-lock
18
- Add `.scroll-lock` to any element that uses the [open] attribute (native <dialog>,
18
+ Add `.ui-scroll-lock` to any element that uses the [open] attribute (native <dialog>,
19
19
  <details>, or any custom element). When that element is open, the page is locked.
20
20
  */
21
- html:has(.scroll-lock[open]) {
21
+ html:has(.ui-scroll-lock[open]) {
22
22
  overflow: clip;
23
23
  overscroll-behavior: contain;
24
24
  scrollbar-gutter: stable;
25
25
  }
26
26
 
27
27
  /* Hover and active effect for checkbox, radio and icon buttons */
28
- :where(.checkbox input, .radio input, .icon-button) {
28
+ :where(.ui-checkbox input, .ui-radio input, .ui-icon-button) {
29
29
  --isLTR: 1;
30
30
  --isRTL: -1;
31
31
 
@@ -1,5 +1,5 @@
1
1
  @layer components.extended {
2
- :where(details.accordion) {
2
+ :where(details.ui-accordion) {
3
3
  --_actions-gap: var(--size-1);
4
4
  --_actions-margin-block-start: var(--size-3);
5
5
  --_actions-padding-block-end: var(--size-1);
@@ -26,14 +26,14 @@
26
26
  margin-inline: var(--_margin-inline);
27
27
  transition: all var(--_transition) ease-out;
28
28
 
29
- &.elevated {
29
+ &.ui-elevated {
30
30
  --_bg-color: var(--surface-elevated);
31
31
  --_margin-inline: 0;
32
32
  --_padding-inline: var(--size-3);
33
33
  --_shadow: var(--shadow-3);
34
34
  }
35
35
 
36
- &.outlined {
36
+ &.ui-outlined {
37
37
  --_bg-color: var(--surface-default);
38
38
  --_border-color: var(--border-color);
39
39
  --_border-width: 1px;
@@ -41,7 +41,7 @@
41
41
  --_padding-inline: var(--size-3);
42
42
  }
43
43
 
44
- &.tonal {
44
+ &.ui-tonal {
45
45
  --_bg-color: var(--surface-tonal);
46
46
  --_margin-inline: 0;
47
47
  --_padding-inline: var(--size-3);
@@ -98,13 +98,13 @@
98
98
  rotate: 180deg;
99
99
  }
100
100
 
101
- &>.content {
101
+ &>.ui-content {
102
102
  margin-block-start: 0;
103
103
  padding-block: var(--_content-padding-block);
104
104
  padding-inline: var(--_content-padding-inline);
105
105
  }
106
106
 
107
- &>.actions {
107
+ &>.ui-actions {
108
108
  display: flex;
109
109
  gap: var(--_actions-gap);
110
110
  justify-content: end;
@@ -115,7 +115,7 @@
115
115
  }
116
116
 
117
117
  /* Accordion group */
118
- :where(.card[role="group"]:has(details.accordion)) {
118
+ :where(.ui-card[role="group"]:has(details.ui-accordion)) {
119
119
  --_group-radius: var(--border-radius);
120
120
  --_gutter-color: var(--border-color);
121
121
  --_item-padding-inline: var(--size-3);
@@ -123,18 +123,18 @@
123
123
 
124
124
  display: block;
125
125
 
126
- &.card {
127
- &:not(.tonal, .outlined, .elevated) {
126
+ &.ui-card {
127
+ &:not(.ui-tonal, .ui-outlined, .ui-elevated) {
128
128
  --_item-summary-padding-inline: 0;
129
129
  }
130
130
  }
131
131
 
132
- &>.content {
132
+ &>.ui-content {
133
133
  margin-block: 0;
134
134
  padding: 0;
135
135
  }
136
136
 
137
- &>details.accordion {
137
+ &>details.ui-accordion {
138
138
  --_border-color: transparent;
139
139
  --_border-width: 0;
140
140
  --_margin-inline: 0;