opui-css 5.0.0 → 5.1.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 (114) hide show
  1. package/CHANGELOG.md +317 -276
  2. package/LICENSE +21 -21
  3. package/MIGRATING.md +138 -127
  4. package/README.md +87 -87
  5. package/astro/index.ts +46 -46
  6. package/components/AGENTS.md +248 -248
  7. package/components/Accordion/Accordion.astro +52 -42
  8. package/components/Anchor/Anchor.astro +55 -51
  9. package/components/Avatar/Avatar.astro +38 -38
  10. package/components/Badge/Badge.astro +59 -59
  11. package/components/Button/Button.astro +45 -45
  12. package/components/ButtonGroup/ButtonGroup.astro +36 -29
  13. package/components/Callout/Callout.astro +75 -75
  14. package/components/Card/Card.astro +38 -36
  15. package/components/Checkbox/Checkbox.astro +76 -76
  16. package/components/Checkbox/CheckboxInput.astro +32 -32
  17. package/components/Chip/Chip.astro +37 -37
  18. package/components/ClassicSelect/ClassicSelect.astro +83 -83
  19. package/components/DescriptionList/Description.astro +12 -12
  20. package/components/DescriptionList/DescriptionList.astro +22 -22
  21. package/components/DescriptionList/Item.astro +12 -12
  22. package/components/DescriptionList/Term.astro +12 -12
  23. package/components/DescriptionList/index.ts +12 -12
  24. package/components/Dialog/Dialog.astro +43 -41
  25. package/components/Divider/Divider.astro +17 -17
  26. package/components/Drawer/Drawer.astro +49 -49
  27. package/components/Drawer/DrawerFooter.astro +14 -14
  28. package/components/Drawer/DrawerHeader.astro +31 -31
  29. package/components/FieldDescription/FieldDescription.astro +13 -13
  30. package/components/FieldGroup/FieldGroup.astro +31 -31
  31. package/components/FieldLegend/FieldLegend.astro +15 -15
  32. package/components/FieldSet/FieldSet.astro +15 -15
  33. package/components/Form/Form.astro +15 -15
  34. package/components/IconButton/IconButton.astro +26 -26
  35. package/components/List/List.astro +36 -36
  36. package/components/ListItem/ListItem.astro +118 -118
  37. package/components/Progress/Progress.astro +41 -40
  38. package/components/Radio/Radio.astro +70 -70
  39. package/components/Radio/RadioInput.astro +24 -24
  40. package/components/Range/Range.astro +136 -136
  41. package/components/Select/Select.astro +106 -106
  42. package/components/Switch/Switch.astro +101 -101
  43. package/components/Switch/SwitchInput.astro +25 -25
  44. package/components/Table/Body.astro +13 -13
  45. package/components/Table/Cell.astro +13 -13
  46. package/components/Table/Column.astro +15 -15
  47. package/components/Table/ColumnGroup.astro +13 -13
  48. package/components/Table/Head.astro +13 -13
  49. package/components/Table/HeaderCell.astro +13 -13
  50. package/components/Table/Row.astro +13 -13
  51. package/components/Table/Table.astro +18 -18
  52. package/components/Table/index.ts +20 -20
  53. package/components/Tabs/Tabs.astro +28 -28
  54. package/components/Tabs/TabsItem.astro +47 -47
  55. package/components/Tabs/TabsPanel.astro +21 -21
  56. package/components/Tabs/TabsTab.astro +19 -19
  57. package/components/Tabs/index.ts +14 -14
  58. package/components/TextField/TextField.astro +128 -128
  59. package/components/Textarea/Textarea.astro +106 -106
  60. package/components/Toast/Toast.astro +42 -42
  61. package/components/ToggleButton/ToggleButton.astro +53 -53
  62. package/components/ToggleGroup/ToggleGroup.astro +49 -49
  63. package/components/Tooltip/Tooltip.astro +30 -30
  64. package/core/normalize.css +200 -194
  65. package/core/palette.css +110 -59
  66. package/core/utils.css +71 -71
  67. package/css/components/accordion.css +174 -174
  68. package/css/components/anchor.css +27 -27
  69. package/css/components/avatar.css +65 -65
  70. package/css/components/badge.css +107 -107
  71. package/css/components/button-group.css +193 -179
  72. package/css/components/button.css +227 -215
  73. package/css/components/callout.css +112 -109
  74. package/css/components/card.css +115 -117
  75. package/css/components/checkbox.css +211 -205
  76. package/css/components/chip.css +92 -87
  77. package/css/components/description-list.css +81 -80
  78. package/css/components/dialog.css +69 -68
  79. package/css/components/divider.css +20 -20
  80. package/css/components/drawer.css +171 -171
  81. package/css/components/form.css +147 -146
  82. package/css/components/icon-button.css +158 -139
  83. package/css/components/link.css +21 -21
  84. package/css/components/list.css +343 -345
  85. package/css/components/progress.css +103 -97
  86. package/css/components/radio.css +170 -172
  87. package/css/components/range.css +342 -337
  88. package/css/components/select.css +172 -169
  89. package/css/components/spinner.css +38 -37
  90. package/css/components/switch.css +271 -268
  91. package/css/components/table.css +173 -179
  92. package/css/components/tabs.css +84 -83
  93. package/css/components/text-field.css +449 -450
  94. package/css/components/text-input.css +68 -64
  95. package/css/components/textarea.css +26 -24
  96. package/css/components/toast.css +160 -161
  97. package/css/components/toggle-button.css +91 -87
  98. package/css/components/toggle-group.css +56 -56
  99. package/css/components/tooltip.css +70 -67
  100. package/css/components/typography.css +585 -585
  101. package/css/components.css +41 -41
  102. package/css/imports.css +17 -16
  103. package/css/js/checkbox.js +21 -21
  104. package/css/js/toast.js +94 -94
  105. package/css/theme.css +133 -132
  106. package/dist/op.css +4 -66
  107. package/dist/op.css.map +1 -1
  108. package/dist/opui.components.css +5234 -5154
  109. package/dist/opui.components.css.map +1 -1
  110. package/dist/opui.css +5798 -5663
  111. package/dist/opui.css.map +1 -1
  112. package/env.d.ts +14 -14
  113. package/open-props.css +8 -9
  114. package/package.json +81 -81
@@ -1,49 +1,49 @@
1
- ---
2
- type Props = {
3
- [key: string]: any
4
- class?: string
5
- name?: string
6
- orientation?: "vertical"
7
- selection?: "single" | "multiple"
8
- size?: "default" | "small" | "x-small"
9
- }
10
-
11
- export const title = "Toggle Group"
12
-
13
- const {
14
- class: className,
15
- name,
16
- orientation,
17
- selection = "multiple",
18
- size = "default",
19
- ...rest
20
- } = Astro.props
21
-
22
- const { $id } = Astro.locals
23
- const groupName = name || $id("toggle-group")
24
- const inputType = selection === "single" ? "radio" : "checkbox"
25
-
26
- const originalName = Astro.locals.currentToggleGroupName
27
- const originalType = Astro.locals.currentToggleGroupType
28
-
29
- Astro.locals.currentToggleGroupName = groupName
30
- Astro.locals.currentToggleGroupType = inputType
31
-
32
- const html = await Astro.slots.render("default")
33
-
34
- Astro.locals.currentToggleGroupName = originalName
35
- Astro.locals.currentToggleGroupType = originalType
36
- ---
37
-
38
- <div
39
- class:list={[
40
- "ui-toggle-group",
41
- size !== "default" && size && `ui-${size}`,
42
- orientation && `ui-${orientation}`,
43
- className,
44
- ]}
45
- role={selection === "single" ? "radiogroup" : "group"}
46
- {...rest}
47
- >
48
- <Fragment set:html={html} />
49
- </div>
1
+ ---
2
+ type Props = {
3
+ [key: string]: any
4
+ class?: string
5
+ name?: string
6
+ orientation?: "vertical"
7
+ selection?: "single" | "multiple"
8
+ size?: "default" | "small" | "x-small"
9
+ }
10
+
11
+ export const title = "Toggle Group"
12
+
13
+ const {
14
+ class: className,
15
+ name,
16
+ orientation,
17
+ selection = "multiple",
18
+ size = "default",
19
+ ...rest
20
+ } = Astro.props
21
+
22
+ const { $id } = Astro.locals
23
+ const groupName = name || $id("toggle-group")
24
+ const inputType = selection === "single" ? "radio" : "checkbox"
25
+
26
+ const originalName = Astro.locals.currentToggleGroupName
27
+ const originalType = Astro.locals.currentToggleGroupType
28
+
29
+ Astro.locals.currentToggleGroupName = groupName
30
+ Astro.locals.currentToggleGroupType = inputType
31
+
32
+ const html = await Astro.slots.render("default")
33
+
34
+ Astro.locals.currentToggleGroupName = originalName
35
+ Astro.locals.currentToggleGroupType = originalType
36
+ ---
37
+
38
+ <div
39
+ class:list={[
40
+ "ui-toggle-group",
41
+ size !== "default" && size && `ui-${size}`,
42
+ orientation && `ui-${orientation}`,
43
+ className,
44
+ ]}
45
+ role={selection === "single" ? "radiogroup" : "group"}
46
+ {...rest}
47
+ >
48
+ <Fragment set:html={html} />
49
+ </div>
@@ -1,30 +1,30 @@
1
- ---
2
- import Anchor from "../Anchor/Anchor.astro"
3
-
4
- type Props = {
5
- [key: string]: any
6
- alignment?: string
7
- arrow?: boolean
8
- class?: string
9
- id?: string
10
- label?: string
11
- }
12
-
13
- export const title = "Tooltip"
14
-
15
- const { alignment, arrow, class: className, id, label, ...rest } = Astro.props
16
- ---
17
-
18
- <Anchor
19
- alignment={alignment}
20
- class:list={["ui-tooltip", { "ui-with-arrow": arrow }, className]}
21
- id={id}
22
- trigger="hover"
23
- {...rest}
24
- >
25
- <slot />
26
- <Fragment slot="anchored">
27
- {label}
28
- <slot name="content" />
29
- </Fragment>
30
- </Anchor>
1
+ ---
2
+ import Anchor from "../Anchor/Anchor.astro"
3
+
4
+ type Props = {
5
+ [key: string]: any
6
+ alignment?: string
7
+ arrow?: boolean
8
+ class?: string
9
+ id?: string
10
+ label?: string
11
+ }
12
+
13
+ export const title = "Tooltip"
14
+
15
+ const { alignment, arrow, class: className, id, label, ...rest } = Astro.props
16
+ ---
17
+
18
+ <Anchor
19
+ alignment={alignment}
20
+ class:list={["ui-tooltip", { "ui-with-arrow": arrow }, className]}
21
+ id={id}
22
+ trigger="hover"
23
+ {...rest}
24
+ >
25
+ <slot />
26
+ <Fragment slot="anchored">
27
+ {label}
28
+ <slot name="content" />
29
+ </Fragment>
30
+ </Anchor>
@@ -1,194 +1,200 @@
1
- @layer normalize {
2
-
3
- *,
4
- ::before,
5
- ::after {
6
- /* Set box sizing instead of inheriting */
7
- /* https://www.oddbird.net/2025/09/04/box-model/ */
8
- box-sizing: border-box;
9
- }
10
-
11
- * {
12
- scrollbar-width: thin;
13
- }
14
-
15
- :where(html) {
16
- --_page-bg-color: var(--surface-default);
17
-
18
- accent-color: var(--primary);
19
- background-color: var(--_page-bg-color);
20
- block-size: 100%;
21
- caret-color: var(--primary);
22
- color: var(--text-muted, var(--text-color-2));
23
- /* text-color-2 is for backwards compatibility */
24
- font-family: var(--font-sans);
25
- interpolate-size: allow-keywords;
26
- line-height: var(--font-lineheight-4);
27
-
28
- /* https://kilianvalkhof.com/2022/css-html/your-css-reset-needs-text-size-adjust-probably/ */
29
- -moz-text-size-adjust: none;
30
- -webkit-text-size-adjust: none;
31
- text-size-adjust: none;
32
-
33
- @media (prefers-reduced-motion: no-preference) {
34
- scroll-behavior: smooth;
35
- }
36
- }
37
-
38
- :where(body) {
39
- -moz-osx-font-smoothing: grayscale;
40
- -webkit-font-smoothing: antialiased;
41
- container-type: inline-size;
42
- font-size: 16px;
43
- font-synthesis: style;
44
- font-weight: 400;
45
- inline-size: 100%;
46
- margin: 0;
47
- min-block-size: 100%;
48
- min-inline-size: 320px;
49
- position: relative;
50
- text-rendering: optimizeLegibility;
51
- }
52
-
53
- :where(:not(dialog, popover)) {
54
- margin: 0;
55
- }
56
-
57
- :where(dialog:not([open])) {
58
- outline: none !important;
59
- }
60
-
61
-
62
- :where(:not(fieldset, progress, meter)) {
63
- background-origin: border-box;
64
- background-repeat: no-repeat;
65
- border-style: solid;
66
- border-width: 0;
67
- }
68
-
69
- :where(fieldset) {
70
- border: var(--field-border-width) solid var(--field-border-color);
71
- border-radius: var(--field-border-radius);
72
- padding: var(--size-3);
73
- display: grid;
74
- gap: var(--size-3);
75
- }
76
-
77
- :where(input, button, textarea),
78
- :where(input[type="file"])::-webkit-file-upload-button {
79
- color: inherit;
80
- font: inherit;
81
- letter-spacing: inherit;
82
- }
83
-
84
- :where(input):-webkit-autofill,
85
- :where(input):-webkit-autofill:hover,
86
- :where(input):-webkit-autofill:focus,
87
- :where(textarea):-webkit-autofill,
88
- :where(textarea):-webkit-autofill:hover,
89
- :where(textarea):-webkit-autofill:focus,
90
- :where(select):-webkit-autofill,
91
- :where(select):-webkit-autofill:hover,
92
- :where(select):-webkit-autofill:focus,
93
- :where(input):autofill,
94
- :where(input):autofill:hover,
95
- :where(input):autofill:focus,
96
- :where(textarea):autofill,
97
- :where(textarea):autofill:hover,
98
- :where(textarea):autofill:focus,
99
- :where(select):autofill,
100
- :where(select):autofill:hover,
101
- :where(select):autofill:focus {
102
- -webkit-text-fill-color: var(--text-muted, var(--text-color-2));
103
- -webkit-box-shadow: 0 0 0px 1e5px var(--well-1) inset;
104
- transition: background-color 5000s ease-in-out 0s;
105
- }
106
-
107
- ::placeholder {
108
- color: var(--text-muted, var(--text-color-2));
109
- }
110
-
111
- ::-moz-placeholder {
112
- opacity: 1;
113
- }
114
-
115
- :focus-visible {
116
- /* Inverts the --_page-bg-color */
117
- --_focus-visible-color: rgb(from var(--_page-bg-color) calc(255 - r) calc(255 - g) calc(255 - b));
118
-
119
- border-radius: var(--border-radius, 0px);
120
- outline: 2px solid var(--_focus-visible-color);
121
- outline-offset: 2px;
122
- }
123
-
124
- @media (prefers-reduced-motion: no-preference) {
125
- :where(:focus-visible) {
126
- transition: outline-offset .15 var(--ease-2);
127
- }
128
-
129
- :where(:not(:active):focus-visible) {
130
- transition-duration: 0.15s;
131
- }
132
- }
133
-
134
- :where(:not(:active):focus-visible) {
135
- outline-offset: var(--outline-offset, 0px);
136
- }
137
-
138
- :where(a[href],
139
- area,
140
- button,
141
- input:not([type="text"],
142
- [type="email"],
143
- [type="number"],
144
- [type="password"],
145
- [type=""],
146
- [type="tel"],
147
- [type="url"]),
148
- label[for],
149
- select,
150
- summary) {
151
- cursor: pointer;
152
- }
153
-
154
- :where(a[href],
155
- area,
156
- button,
157
- [role="button"],
158
- input,
159
- label[for],
160
- select,
161
- summary,
162
- textarea,
163
- [tabindex]:not([tabindex*="-"])) {
164
- -webkit-tap-highlight-color: transparent;
165
- touch-action: manipulation;
166
- }
167
-
168
- :where(img, svg, video, canvas, audio, iframe, embed, object) {
169
- display: block;
170
- }
171
-
172
- :where(img, svg, video) {
173
- block-size: auto;
174
- max-inline-size: 100%;
175
- }
176
-
177
- :where(svg:not([width])) {
178
- inline-size: var(--size-7);
179
- }
180
-
181
- :where(dt:not(:first-of-type)) {
182
- margin-block-start: var(--size-5);
183
- }
184
-
185
- :where(figure) {
186
- display: grid;
187
- gap: var(--size-2);
188
- place-items: center;
189
- }
190
-
191
- :target {
192
- scroll-margin-block-start: 2rem;
193
- }
194
- }
1
+ @layer normalize {
2
+ *,
3
+ ::before,
4
+ ::after {
5
+ /* Set box sizing instead of inheriting */
6
+ /* https://www.oddbird.net/2025/09/04/box-model/ */
7
+ box-sizing: border-box;
8
+ }
9
+
10
+ * {
11
+ scrollbar-width: thin;
12
+ }
13
+
14
+ :where(html) {
15
+ --_page-bg-color: var(--surface-default);
16
+
17
+ accent-color: var(--primary);
18
+ background-color: var(--_page-bg-color);
19
+ block-size: 100%;
20
+ caret-color: var(--primary);
21
+ color: var(--text-muted, var(--text-color-2));
22
+ /* text-color-2 is for backwards compatibility */
23
+ font-family: var(--font-sans);
24
+ interpolate-size: allow-keywords;
25
+ line-height: var(--font-lineheight-4);
26
+
27
+ /* https://kilianvalkhof.com/2022/css-html/your-css-reset-needs-text-size-adjust-probably/ */
28
+ -moz-text-size-adjust: none;
29
+ -webkit-text-size-adjust: none;
30
+ text-size-adjust: none;
31
+
32
+ @media (prefers-reduced-motion: no-preference) {
33
+ scroll-behavior: smooth;
34
+ }
35
+ }
36
+
37
+ :where(body) {
38
+ -moz-osx-font-smoothing: grayscale;
39
+ -webkit-font-smoothing: antialiased;
40
+ container-type: inline-size;
41
+ font-size: 16px;
42
+ font-synthesis: style;
43
+ font-weight: 400;
44
+ inline-size: 100%;
45
+ margin: 0;
46
+ min-block-size: 100%;
47
+ min-inline-size: 320px;
48
+ position: relative;
49
+ text-rendering: optimizeLegibility;
50
+ }
51
+
52
+ :where(:not(dialog, popover)) {
53
+ margin: 0;
54
+ }
55
+
56
+ :where(dialog:not([open])) {
57
+ outline: none !important;
58
+ }
59
+
60
+ :where(:not(fieldset, progress, meter)) {
61
+ background-origin: border-box;
62
+ background-repeat: no-repeat;
63
+ border-style: solid;
64
+ border-width: 0;
65
+ }
66
+
67
+ :where(fieldset) {
68
+ border: var(--field-border-width) solid var(--field-border-color);
69
+ border-radius: var(--field-border-radius);
70
+ padding: var(--size-3);
71
+ display: grid;
72
+ gap: var(--size-3);
73
+ }
74
+
75
+ :where(input, button, textarea),
76
+ :where(input[type="file"])::-webkit-file-upload-button {
77
+ color: inherit;
78
+ font: inherit;
79
+ letter-spacing: inherit;
80
+ }
81
+
82
+ :where(input):-webkit-autofill,
83
+ :where(input):-webkit-autofill:hover,
84
+ :where(input):-webkit-autofill:focus,
85
+ :where(textarea):-webkit-autofill,
86
+ :where(textarea):-webkit-autofill:hover,
87
+ :where(textarea):-webkit-autofill:focus,
88
+ :where(select):-webkit-autofill,
89
+ :where(select):-webkit-autofill:hover,
90
+ :where(select):-webkit-autofill:focus,
91
+ :where(input):autofill,
92
+ :where(input):autofill:hover,
93
+ :where(input):autofill:focus,
94
+ :where(textarea):autofill,
95
+ :where(textarea):autofill:hover,
96
+ :where(textarea):autofill:focus,
97
+ :where(select):autofill,
98
+ :where(select):autofill:hover,
99
+ :where(select):autofill:focus {
100
+ -webkit-text-fill-color: var(--text-muted, var(--text-color-2));
101
+ -webkit-box-shadow: 0 0 0px 1e5px var(--well-1) inset;
102
+ transition: background-color 5000s ease-in-out 0s;
103
+ }
104
+
105
+ ::placeholder {
106
+ color: var(--text-muted, var(--text-color-2));
107
+ }
108
+
109
+ ::-moz-placeholder {
110
+ opacity: 1;
111
+ }
112
+
113
+ :focus-visible {
114
+ /* Inverts the --_page-bg-color */
115
+ --_focus-visible-color: rgb(
116
+ from var(--_page-bg-color) calc(255 - r) calc(255 - g) calc(255 - b)
117
+ );
118
+
119
+ border-radius: var(--border-radius, 0px);
120
+ outline: 2px solid var(--_focus-visible-color);
121
+ outline-offset: 2px;
122
+ }
123
+
124
+ @media (prefers-reduced-motion: no-preference) {
125
+ :where(:focus-visible) {
126
+ transition: outline-offset 0.15 var(--ease-2);
127
+ }
128
+
129
+ :where(:not(:active):focus-visible) {
130
+ transition-duration: 0.15s;
131
+ }
132
+ }
133
+
134
+ :where(:not(:active):focus-visible) {
135
+ outline-offset: var(--outline-offset, 0px);
136
+ }
137
+
138
+ :where(
139
+ a[href],
140
+ area,
141
+ button,
142
+ input:not(
143
+ [type="text"],
144
+ [type="email"],
145
+ [type="number"],
146
+ [type="password"],
147
+ [type=""],
148
+ [type="tel"],
149
+ [type="url"]
150
+ ),
151
+ label[for],
152
+ select,
153
+ summary
154
+ ) {
155
+ cursor: pointer;
156
+ }
157
+
158
+ :where(
159
+ a[href],
160
+ area,
161
+ button,
162
+ [role="button"],
163
+ input,
164
+ label[for],
165
+ select,
166
+ summary,
167
+ textarea,
168
+ [tabindex]:not([tabindex*="-"])
169
+ ) {
170
+ -webkit-tap-highlight-color: transparent;
171
+ touch-action: manipulation;
172
+ }
173
+
174
+ :where(img, svg, video, canvas, audio, iframe, embed, object) {
175
+ display: block;
176
+ }
177
+
178
+ :where(img, svg, video) {
179
+ block-size: auto;
180
+ max-inline-size: 100%;
181
+ }
182
+
183
+ :where(svg:not([width])) {
184
+ inline-size: var(--size-7);
185
+ }
186
+
187
+ :where(dt:not(:first-of-type)) {
188
+ margin-block-start: var(--size-5);
189
+ }
190
+
191
+ :where(figure) {
192
+ display: grid;
193
+ gap: var(--size-2);
194
+ place-items: center;
195
+ }
196
+
197
+ :target {
198
+ scroll-margin-block-start: 2rem;
199
+ }
200
+ }