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,179 +1,173 @@
1
- @layer components.root {
2
- :where(.ui-table) {
3
- --_table-border-radius: var(--border-radius);
4
-
5
- border-collapse: separate;
6
- border-spacing: 0;
7
- border: 1px solid var(--border-color);
8
- border-radius: var(--_table-border-radius);
9
- overflow: hidden;
10
- inline-size: 100%;
11
- margin: var(--size-3) 0;
12
- position: relative;
13
-
14
- /* Rows */
15
- tr {
16
- &:hover {
17
- background-color: oklch(from var(--surface-filled) l c h / 75%);
18
- }
19
- }
20
-
21
- /* Cells */
22
- th,
23
- td {
24
- background-color: var(--surface-default);
25
- border-inline-end: var(--border-width) solid var(--border-color);
26
- border-block-end: var(--border-width) solid var(--border-color);
27
- padding: var(--size-1) var(--size-2);
28
-
29
- &:last-child {
30
- border-inline-end: none;
31
- }
32
- }
33
-
34
- /* Remove bottom border only on the last row of the table */
35
- &>*:last-child tr:last-child {
36
-
37
- th,
38
- td {
39
- border-block-end: none;
40
- }
41
- }
42
-
43
- th {
44
- background-color: var(--surface-filled);
45
- color: var(--text-primary);
46
- font-size: var(--font-size-05);
47
- font-weight: 600;
48
- text-align: start;
49
- }
50
-
51
- td {
52
- font-size: var(--font-size-05);
53
- }
54
-
55
- /* Round corner cells */
56
- &>thead:first-of-type tr:first-child {
57
- th:first-child {
58
- border-start-start-radius: var(--_table-border-radius);
59
- }
60
-
61
- th:last-child {
62
- border-start-end-radius: var(--_table-border-radius);
63
- }
64
- }
65
-
66
- /* Logic for tables without thead */
67
- &>tbody:first-of-type:not(thead ~ tbody) tr:first-child {
68
- td:first-child {
69
- border-start-start-radius: var(--_table-border-radius);
70
- }
71
-
72
- td:last-child {
73
- border-start-end-radius: var(--_table-border-radius);
74
- }
75
- }
76
-
77
- /* Logic for bottom corners (whether in tbody or tfoot) */
78
- &>*:last-child tr:last-child {
79
- :where(th, td):first-child {
80
- border-end-start-radius: var(--_table-border-radius);
81
- }
82
-
83
- :where(th, td):last-child {
84
- border-end-end-radius: var(--_table-border-radius);
85
- }
86
- }
87
-
88
- /* Footer */
89
- tfoot {
90
- tr td {
91
- background-color: var(--surface-filled);
92
- padding-block: var(--size-2);
93
- }
94
-
95
- td {
96
- color: var(--text-primary);
97
- font-weight: 600;
98
- border-top: var(--border-width) solid var(--border-color);
99
- }
100
- }
101
-
102
- /* Caption */
103
- caption {
104
- caption-side: bottom;
105
- color: var(--text-muted);
106
- font-size: var(--font-size-05);
107
- margin-inline-start: var(--size-2);
108
- padding: var(--size-2) 0;
109
- text-align: start;
110
- }
111
-
112
- /* Header */
113
- thead {
114
- z-index: 1;
115
- }
116
-
117
- /* Remove bottom border of the row above the footer to stay single-line */
118
- tbody:has(+ tfoot) tr:last-child td {
119
- border-block-end: none;
120
- }
121
-
122
- /* Column group */
123
- colgroup col {
124
- border: none;
125
- }
126
-
127
- @container (width < 60ch) {
128
-
129
- th,
130
- td {
131
- padding: var(--size-1) 0.875rem;
132
- }
133
- }
134
-
135
- /* Spacious */
136
- &.ui-spacious {
137
-
138
- th,
139
- td {
140
- padding: var(--size-3);
141
- }
142
-
143
- caption {
144
- margin-inline-start: var(--size-3);
145
- padding: var(--size-2) 0;
146
- }
147
-
148
- @container (width < 60ch) {
149
-
150
- th,
151
- td {
152
- padding: var(--size-3);
153
- }
154
- }
155
- }
156
-
157
- /* Dense */
158
- &.ui-dense {
159
-
160
- th,
161
- td {
162
- padding: var(--size-1);
163
- }
164
-
165
- caption {
166
- margin-inline-start: var(--size-1);
167
- padding: var(--size-1) 0;
168
- }
169
-
170
- @container (width < 60ch) {
171
-
172
- th,
173
- td {
174
- padding: var(--size-1);
175
- }
176
- }
177
- }
178
- }
179
- }
1
+ @layer components.root {
2
+ :where(.ui-table) {
3
+ --_table-border-radius: var(--border-radius);
4
+
5
+ border-collapse: separate;
6
+ border-spacing: 0;
7
+ border: 1px solid var(--border-color);
8
+ border-radius: var(--_table-border-radius);
9
+ overflow: hidden;
10
+ inline-size: 100%;
11
+ margin: var(--size-3) 0;
12
+ position: relative;
13
+
14
+ /* Rows */
15
+ tr {
16
+ &:hover {
17
+ background-color: oklch(from var(--surface-filled) l c h / 75%);
18
+ }
19
+ }
20
+
21
+ /* Cells */
22
+ th,
23
+ td {
24
+ background-color: var(--surface-default);
25
+ border-inline-end: var(--border-width) solid var(--border-color);
26
+ border-block-end: var(--border-width) solid var(--border-color);
27
+ padding: var(--size-1) var(--size-2);
28
+
29
+ &:last-child {
30
+ border-inline-end: none;
31
+ }
32
+ }
33
+
34
+ /* Remove bottom border only on the last row of the table */
35
+ & > *:last-child tr:last-child {
36
+ th,
37
+ td {
38
+ border-block-end: none;
39
+ }
40
+ }
41
+
42
+ th {
43
+ background-color: var(--surface-filled);
44
+ color: var(--text-primary);
45
+ font-size: var(--font-size-05);
46
+ font-weight: 600;
47
+ text-align: start;
48
+ }
49
+
50
+ td {
51
+ font-size: var(--font-size-05);
52
+ }
53
+
54
+ /* Round corner cells */
55
+ & > thead:first-of-type tr:first-child {
56
+ th:first-child {
57
+ border-start-start-radius: var(--_table-border-radius);
58
+ }
59
+
60
+ th:last-child {
61
+ border-start-end-radius: var(--_table-border-radius);
62
+ }
63
+ }
64
+
65
+ /* Logic for tables without thead */
66
+ & > tbody:first-of-type:not(thead ~ tbody) tr:first-child {
67
+ td:first-child {
68
+ border-start-start-radius: var(--_table-border-radius);
69
+ }
70
+
71
+ td:last-child {
72
+ border-start-end-radius: var(--_table-border-radius);
73
+ }
74
+ }
75
+
76
+ /* Logic for bottom corners (whether in tbody or tfoot) */
77
+ & > *:last-child tr:last-child {
78
+ :where(th, td):first-child {
79
+ border-end-start-radius: var(--_table-border-radius);
80
+ }
81
+
82
+ :where(th, td):last-child {
83
+ border-end-end-radius: var(--_table-border-radius);
84
+ }
85
+ }
86
+
87
+ /* Footer */
88
+ tfoot {
89
+ tr td {
90
+ background-color: var(--surface-filled);
91
+ padding-block: var(--size-2);
92
+ }
93
+
94
+ td {
95
+ color: var(--text-primary);
96
+ font-weight: 600;
97
+ border-top: var(--border-width) solid var(--border-color);
98
+ }
99
+ }
100
+
101
+ /* Caption */
102
+ caption {
103
+ caption-side: bottom;
104
+ color: var(--text-muted);
105
+ font-size: var(--font-size-05);
106
+ margin-inline-start: var(--size-2);
107
+ padding: var(--size-2) 0;
108
+ text-align: start;
109
+ }
110
+
111
+ /* Header */
112
+ thead {
113
+ z-index: 1;
114
+ }
115
+
116
+ /* Remove bottom border of the row above the footer to stay single-line */
117
+ tbody:has(+ tfoot) tr:last-child td {
118
+ border-block-end: none;
119
+ }
120
+
121
+ /* Column group */
122
+ colgroup col {
123
+ border: none;
124
+ }
125
+
126
+ @container (width < 60ch) {
127
+ th,
128
+ td {
129
+ padding: var(--size-1) 0.875rem;
130
+ }
131
+ }
132
+
133
+ /* Spacious */
134
+ &.ui-spacious {
135
+ th,
136
+ td {
137
+ padding: var(--size-3);
138
+ }
139
+
140
+ caption {
141
+ margin-inline-start: var(--size-3);
142
+ padding: var(--size-2) 0;
143
+ }
144
+
145
+ @container (width < 60ch) {
146
+ th,
147
+ td {
148
+ padding: var(--size-3);
149
+ }
150
+ }
151
+ }
152
+
153
+ /* Dense */
154
+ &.ui-dense {
155
+ th,
156
+ td {
157
+ padding: var(--size-1);
158
+ }
159
+
160
+ caption {
161
+ margin-inline-start: var(--size-1);
162
+ padding: var(--size-1) 0;
163
+ }
164
+
165
+ @container (width < 60ch) {
166
+ th,
167
+ td {
168
+ padding: var(--size-1);
169
+ }
170
+ }
171
+ }
172
+ }
173
+ }
@@ -1,83 +1,84 @@
1
- @layer components.root {
2
- :where(.ui-tabs) {
3
- --_accent-color: var(--primary);
4
- --_bg-color: transparent;
5
-
6
- align-items: flex-start;
7
- display: flex;
8
- flex-wrap: wrap;
9
- gap: 0 var(--size-1);
10
- position: relative;
11
-
12
- &>.ui-tab-input[type="radio"] {
13
- /* utils > .ui-sr-only */
14
- /* TODO: use mixin for this when available */
15
- block-size: 1px;
16
- clip-path: inset(50%);
17
- inline-size: 1px;
18
- overflow: hidden;
19
- position: absolute;
20
- white-space: nowrap;
21
-
22
- &:checked {
23
-
24
- /* Checked Tab */
25
- &+[role="tab"],
26
- &+.ui-tab-label {
27
- border-block-end-color: var(--_accent-color);
28
- color: var(--_accent-color);
29
-
30
- /* Checked Panel */
31
- &+[role="tabpanel"],
32
- &+.ui-tab-panel {
33
- display: block;
34
- }
35
- }
36
- }
37
-
38
- &:focus-visible {
39
-
40
- &+[role="tab"],
41
- &+.ui-tab-label {
42
- --focus-ring-color: var(--text-muted);
43
- --focus-ring-offset: calc(-1 * var(--size-2));
44
- outline: var(--focus-ring-width) var(--focus-ring-style) var(--focus-ring-color);
45
- outline-offset: var(--focus-ring-offset);
46
- }
47
- }
48
- }
49
-
50
- /* Tab */
51
- &>[role="tab"],
52
- &>.ui-tab-label {
53
- align-items: center;
54
- background-color: transparent;
55
- border-bottom: 2px solid transparent;
56
- border-radius: 0;
57
- color: var(--text-muted);
58
- cursor: pointer;
59
- display: inline-flex;
60
- font-weight: 600;
61
- justify-content: center;
62
- line-height: var(--font-lineheight-4);
63
- order: 1;
64
- padding: var(--size-2) var(--size-3);
65
- position: relative;
66
- transition: color 0.1s;
67
- user-select: none;
68
-
69
- &:hover {
70
- background-color: light-dark(oklch(from var(--_accent-color) calc(l * 0.75) none h / 5%),
71
- oklch(from var(--_accent-color) calc(l * 1.25) none h / 5%));
72
- }
73
- }
74
-
75
- /* Tab Panel */
76
- &>[role="tabpanel"],
77
- &>.ui-tab-panel {
78
- display: none;
79
- inline-size: 100%;
80
- order: 2;
81
- }
82
- }
83
- }
1
+ @layer components.root {
2
+ :where(.ui-tabs) {
3
+ --_accent-color: var(--primary);
4
+ --_bg-color: transparent;
5
+
6
+ align-items: flex-start;
7
+ display: flex;
8
+ flex-wrap: wrap;
9
+ gap: 0 var(--size-1);
10
+ position: relative;
11
+
12
+ & > .ui-tab-input[type="radio"] {
13
+ /* utils > .ui-sr-only */
14
+ /* TODO: use mixin for this when available */
15
+ block-size: 1px;
16
+ clip-path: inset(50%);
17
+ inline-size: 1px;
18
+ overflow: hidden;
19
+ position: absolute;
20
+ white-space: nowrap;
21
+
22
+ &:checked {
23
+ /* Checked Tab */
24
+ & + [role="tab"],
25
+ & + .ui-tab-label {
26
+ border-block-end-color: var(--_accent-color);
27
+ color: var(--_accent-color);
28
+
29
+ /* Checked Panel */
30
+ & + [role="tabpanel"],
31
+ & + .ui-tab-panel {
32
+ display: block;
33
+ }
34
+ }
35
+ }
36
+
37
+ &:focus-visible {
38
+ & + [role="tab"],
39
+ & + .ui-tab-label {
40
+ --focus-ring-color: var(--text-muted);
41
+ --focus-ring-offset: calc(-1 * var(--size-2));
42
+ outline: var(--focus-ring-width) var(--focus-ring-style)
43
+ var(--focus-ring-color);
44
+ outline-offset: var(--focus-ring-offset);
45
+ }
46
+ }
47
+ }
48
+
49
+ /* Tab */
50
+ & > [role="tab"],
51
+ & > .ui-tab-label {
52
+ align-items: center;
53
+ background-color: transparent;
54
+ border-bottom: 2px solid transparent;
55
+ border-radius: 0;
56
+ color: var(--text-muted);
57
+ cursor: pointer;
58
+ display: inline-flex;
59
+ font-weight: 600;
60
+ justify-content: center;
61
+ line-height: var(--font-lineheight-4);
62
+ order: 1;
63
+ padding: var(--size-2) var(--size-3);
64
+ position: relative;
65
+ transition: color 0.1s;
66
+ user-select: none;
67
+
68
+ &:hover {
69
+ background-color: light-dark(
70
+ oklch(from var(--_accent-color) calc(l * 0.75) none h / 5%),
71
+ oklch(from var(--_accent-color) calc(l * 1.25) none h / 5%)
72
+ );
73
+ }
74
+ }
75
+
76
+ /* Tab Panel */
77
+ & > [role="tabpanel"],
78
+ & > .ui-tab-panel {
79
+ display: none;
80
+ inline-size: 100%;
81
+ order: 2;
82
+ }
83
+ }
84
+ }