opui-css 5.0.0 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +282 -276
  2. package/LICENSE +21 -21
  3. package/MIGRATING.md +127 -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 +42 -42
  8. package/components/Anchor/Anchor.astro +51 -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 +29 -29
  13. package/components/Callout/Callout.astro +75 -75
  14. package/components/Card/Card.astro +36 -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 +41 -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 +194 -194
  65. package/core/palette.css +59 -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 +179 -179
  72. package/css/components/button.css +215 -215
  73. package/css/components/callout.css +109 -109
  74. package/css/components/card.css +117 -117
  75. package/css/components/checkbox.css +205 -205
  76. package/css/components/chip.css +87 -87
  77. package/css/components/description-list.css +80 -80
  78. package/css/components/dialog.css +68 -68
  79. package/css/components/divider.css +20 -20
  80. package/css/components/drawer.css +171 -171
  81. package/css/components/form.css +146 -146
  82. package/css/components/icon-button.css +139 -139
  83. package/css/components/link.css +21 -21
  84. package/css/components/list.css +345 -345
  85. package/css/components/progress.css +102 -97
  86. package/css/components/radio.css +172 -172
  87. package/css/components/range.css +337 -337
  88. package/css/components/select.css +169 -169
  89. package/css/components/spinner.css +37 -37
  90. package/css/components/switch.css +268 -268
  91. package/css/components/table.css +179 -179
  92. package/css/components/tabs.css +83 -83
  93. package/css/components/text-field.css +450 -450
  94. package/css/components/text-input.css +64 -64
  95. package/css/components/textarea.css +24 -24
  96. package/css/components/toast.css +161 -161
  97. package/css/components/toggle-button.css +87 -87
  98. package/css/components/toggle-group.css +56 -56
  99. package/css/components/tooltip.css +67 -67
  100. package/css/components/typography.css +585 -585
  101. package/css/components.css +41 -41
  102. package/css/imports.css +16 -16
  103. package/css/js/checkbox.js +21 -21
  104. package/css/js/toast.js +94 -94
  105. package/css/theme.css +132 -132
  106. package/dist/op.css +65 -65
  107. package/dist/op.css.map +1 -1
  108. package/dist/opui.components.css +5159 -5154
  109. package/dist/opui.components.css.map +1 -1
  110. package/dist/opui.css +5668 -5663
  111. package/dist/opui.css.map +1 -1
  112. package/env.d.ts +14 -14
  113. package/open-props.css +9 -9
  114. package/package.json +81 -81
@@ -1,97 +1,102 @@
1
- @layer components.root {
2
- :where(.ui-progress) {
3
- --_accent-color: var(--primary);
4
- --_bg-color: var(--surface-tonal);
5
-
6
- appearance: none;
7
- background-color: var(--_bg-color);
8
- block-size: var(--size-1);
9
- border: 0;
10
- border-radius: var(--border-radius, 0.25rem);
11
- display: inline-block;
12
- inline-size: 100%;
13
- overflow: hidden;
14
- position: relative;
15
- vertical-align: baseline;
16
-
17
- /* Color */
18
- &.ui-filled {
19
- --_bg-color: var(--surface-filled);
20
- }
21
-
22
- &.ui-default {
23
- --_bg-color: var(--surface-default);
24
- }
25
-
26
- &.ui-tonal {
27
- --_bg-color: var(--surface-tonal);
28
- }
29
-
30
- &::-webkit-progress-bar {
31
- background: none;
32
- border-radius: var(--border-radius, 0.25rem);
33
- }
34
-
35
- &[value]::-webkit-progress-value {
36
- background-color: var(--_accent-color);
37
-
38
- @media (prefers-reduced-motion: no-preference) {
39
- transition: inline-size 0.2s var(--ease-out-4, cubic-bezier(0, 0, 0.1, 1));
40
- }
41
- }
42
-
43
- &::-moz-progress-bar {
44
- background-color: var(--_accent-color);
45
- }
46
- }
47
-
48
- @media (prefers-reduced-motion: no-preference) {
49
- progress:indeterminate {
50
- background-color: var(--_bg-color);
51
-
52
- &::after {
53
- animation: indeterminate 2s linear infinite;
54
- background-color: var(--_accent-color);
55
- content: "";
56
- inset: 0 auto 0 0;
57
- position: absolute;
58
- will-change: inset-inline-start, inset-inline-end;
59
- }
60
-
61
- &[value]::-webkit-progress-value {
62
- background-color: transparent;
63
- }
64
-
65
- &::-moz-progress-bar {
66
- background-color: transparent;
67
- }
68
- }
69
-
70
- [dir="rtl"] {
71
- :where(progress):indeterminate {
72
- animation-direction: reverse;
73
-
74
- &::after {
75
- animation-direction: reverse;
76
- }
77
- }
78
- }
79
- }
80
-
81
- @keyframes indeterminate {
82
- 0% {
83
- inset-inline-start: -200%;
84
- inset-inline-end: 100%;
85
- }
86
-
87
- 60% {
88
- inset-inline-start: 107%;
89
- inset-inline-end: -8%;
90
- }
91
-
92
- 100% {
93
- inset-inline-start: 107%;
94
- inset-inline-end: -8%;
95
- }
96
- }
97
- }
1
+ @layer components.root {
2
+ :where(.ui-progress) {
3
+ --_accent-color: var(--primary);
4
+ --_bg-color: var(--surface-tonal);
5
+
6
+ background-color: var(--_bg-color);
7
+ block-size: var(--size-1);
8
+ border-radius: var(--border-radius, 0.25rem);
9
+ display: inline-block;
10
+ inline-size: 100%;
11
+ overflow: hidden;
12
+ position: relative;
13
+ vertical-align: baseline;
14
+
15
+ /* Color */
16
+ &.ui-filled {
17
+ --_bg-color: var(--surface-filled);
18
+ }
19
+
20
+ &.ui-default {
21
+ --_bg-color: var(--surface-default);
22
+ }
23
+
24
+ &.ui-tonal {
25
+ --_bg-color: var(--surface-tonal);
26
+ }
27
+
28
+ &>progress {
29
+ appearance: none;
30
+ background: none;
31
+ block-size: 100%;
32
+ border: 0;
33
+ display: block;
34
+ inline-size: 100%;
35
+
36
+ &::-webkit-progress-bar {
37
+ background: none;
38
+ border-radius: var(--border-radius, 0.25rem);
39
+ }
40
+
41
+ &[value]::-webkit-progress-value {
42
+ background-color: var(--_accent-color);
43
+
44
+ @media (prefers-reduced-motion: no-preference) {
45
+ transition: inline-size 0.2s var(--ease-out-4, cubic-bezier(0, 0, 0.1, 1));
46
+ }
47
+ }
48
+
49
+ &::-moz-progress-bar {
50
+ background-color: var(--_accent-color);
51
+ }
52
+ }
53
+ }
54
+
55
+ @media (prefers-reduced-motion: no-preference) {
56
+ :where(.ui-progress):has(> progress:indeterminate) {
57
+ &::after {
58
+ animation: indeterminate 2s linear infinite;
59
+ background-color: var(--_accent-color);
60
+ content: "";
61
+ inset: 0 auto 0 0;
62
+ position: absolute;
63
+ will-change: inset-inline-start, inset-inline-end;
64
+ }
65
+
66
+ &>progress {
67
+ &::-webkit-progress-value {
68
+ background-color: transparent;
69
+ }
70
+
71
+ &::-moz-progress-bar {
72
+ background-color: transparent;
73
+ }
74
+ }
75
+ }
76
+
77
+ [dir="rtl"] {
78
+ :where(.ui-progress):has(> progress:indeterminate) {
79
+ &::after {
80
+ animation-direction: reverse;
81
+ }
82
+ }
83
+ }
84
+ }
85
+
86
+ @keyframes indeterminate {
87
+ 0% {
88
+ inset-inline-start: -200%;
89
+ inset-inline-end: 100%;
90
+ }
91
+
92
+ 60% {
93
+ inset-inline-start: 107%;
94
+ inset-inline-end: -8%;
95
+ }
96
+
97
+ 100% {
98
+ inset-inline-start: 107%;
99
+ inset-inline-end: -8%;
100
+ }
101
+ }
102
+ }
@@ -1,172 +1,172 @@
1
- @layer components.root {
2
- label.ui-radio {
3
- --_input-size: 1.125rem;
4
- --_indicator-size: 50%;
5
-
6
- align-items: center;
7
- color: var(--text-primary);
8
- cursor: pointer;
9
- display: inline-grid;
10
- gap: 0 var(--size-2);
11
- grid-auto-columns: auto;
12
- grid-auto-flow: column;
13
- inline-size: fit-content;
14
- line-height: 1.5;
15
- transform: translateZ(0);
16
- user-select: none;
17
-
18
- /* Disabled */
19
- &:has([disabled]) {
20
- cursor: not-allowed;
21
- opacity: 0.64;
22
- user-select: none;
23
-
24
- input {
25
- cursor: not-allowed;
26
- }
27
- }
28
-
29
- /* Required dot */
30
- &:has(:invalid) {
31
- .ui-label:after {
32
- color: var(--red);
33
- content: "*";
34
- inset: 0 -0.25ex auto auto;
35
- position: absolute;
36
- }
37
- }
38
-
39
- /* Label */
40
- .ui-label {
41
- color: var(--text-primary);
42
- font-size: var(--font-size-05);
43
- grid-column: 2;
44
- grid-row: 1;
45
- padding-inline: 0 1ex;
46
- position: relative;
47
- }
48
-
49
- /* End text */
50
- :where(.ui-end-text) {
51
- color: var(--text-muted);
52
- font-size: var(--font-size-0);
53
- grid-column: 2;
54
- grid-row: 2;
55
- line-height: 1.5;
56
- z-index: 1;
57
- }
58
-
59
- /* Stacked layout */
60
- &.ui-stack {
61
- grid-auto-columns: unset;
62
- justify-items: center;
63
-
64
- .ui-label {
65
- grid-column: 1/-1;
66
- grid-row: 2;
67
- margin-block-start: var(--size-1);
68
- padding-inline: 1ex;
69
-
70
- /* Required dot */
71
- &::after {
72
- inset: 0 -0.25ex auto auto;
73
- }
74
- }
75
-
76
- .ui-end-text {
77
- grid-column: 1/-1;
78
- grid-row: 3;
79
- }
80
- }
81
-
82
- /* Input */
83
- input[type="radio"] {
84
- appearance: none;
85
- aspect-ratio: 1;
86
- background-color: var(--surface-default);
87
- block-size: var(--_input-size);
88
- border: 1px solid var(--field-border-color);
89
- border-radius: var(--radius-round);
90
- box-sizing: border-box;
91
- cursor: pointer;
92
- display: grid;
93
- inline-size: var(--_input-size);
94
- margin: 0;
95
- padding: 0;
96
- place-items: center;
97
- position: relative;
98
-
99
- &:checked {
100
- background-color: var(--primary);
101
- border-color: var(--primary);
102
- }
103
-
104
- /* Dot */
105
- &::after {
106
- background-color: var(--primary-contrast);
107
- block-size: var(--_indicator-size);
108
- border-radius: var(--radius-round);
109
- content: "";
110
- inline-size: var(--_indicator-size);
111
- margin: auto;
112
- opacity: 0;
113
- }
114
-
115
- &:checked::after {
116
- opacity: 1;
117
- }
118
-
119
- &::before {
120
- --highlight-size: 175%;
121
- }
122
- }
123
-
124
- /* Sizes */
125
- &.ui-small {
126
- input[type="radio"] {
127
- --_input-size: var(--size-3);
128
-
129
- }
130
- }
131
-
132
- &.ui-large {
133
- input[type="radio"] {
134
- --_input-size: var(--size-4);
135
-
136
- }
137
- }
138
-
139
- /* Validation */
140
- &[data-invalid],
141
- &:has(:user-invalid) {
142
- --palette-source: oklch(0.58 0.21 var(--hue-red));
143
-
144
- :where(.ui-end-text) {
145
- color: var(--primary);
146
- }
147
- }
148
-
149
- /* Touch devices */
150
- @media (pointer: coarse) {
151
- input[type="radio"] {
152
- block-size: var(--size-4);
153
- inline-size: var(--size-4);
154
- }
155
- }
156
-
157
- @media (forced-colors: active) {
158
- input[type="radio"] {
159
- border: 1px solid CanvasText;
160
-
161
- &:checked {
162
- background-color: SelectedItem;
163
- border-color: SelectedItem;
164
-
165
- &::after {
166
- background-color: SelectedItemText;
167
- }
168
- }
169
- }
170
- }
171
- }
172
- }
1
+ @layer components.root {
2
+ label.ui-radio {
3
+ --_input-size: 1.125rem;
4
+ --_indicator-size: 50%;
5
+
6
+ align-items: center;
7
+ color: var(--text-primary);
8
+ cursor: pointer;
9
+ display: inline-grid;
10
+ gap: 0 var(--size-2);
11
+ grid-auto-columns: auto;
12
+ grid-auto-flow: column;
13
+ inline-size: fit-content;
14
+ line-height: 1.5;
15
+ transform: translateZ(0);
16
+ user-select: none;
17
+
18
+ /* Disabled */
19
+ &:has([disabled]) {
20
+ cursor: not-allowed;
21
+ opacity: 0.64;
22
+ user-select: none;
23
+
24
+ input {
25
+ cursor: not-allowed;
26
+ }
27
+ }
28
+
29
+ /* Required dot */
30
+ &:has(:invalid) {
31
+ .ui-label:after {
32
+ color: var(--red);
33
+ content: "*";
34
+ inset: 0 -0.25ex auto auto;
35
+ position: absolute;
36
+ }
37
+ }
38
+
39
+ /* Label */
40
+ .ui-label {
41
+ color: var(--text-primary);
42
+ font-size: var(--font-size-05);
43
+ grid-column: 2;
44
+ grid-row: 1;
45
+ padding-inline: 0 1ex;
46
+ position: relative;
47
+ }
48
+
49
+ /* End text */
50
+ :where(.ui-end-text) {
51
+ color: var(--text-muted);
52
+ font-size: var(--font-size-0);
53
+ grid-column: 2;
54
+ grid-row: 2;
55
+ line-height: 1.5;
56
+ z-index: 1;
57
+ }
58
+
59
+ /* Stacked layout */
60
+ &.ui-stack {
61
+ grid-auto-columns: unset;
62
+ justify-items: center;
63
+
64
+ .ui-label {
65
+ grid-column: 1/-1;
66
+ grid-row: 2;
67
+ margin-block-start: var(--size-1);
68
+ padding-inline: 1ex;
69
+
70
+ /* Required dot */
71
+ &::after {
72
+ inset: 0 -0.25ex auto auto;
73
+ }
74
+ }
75
+
76
+ .ui-end-text {
77
+ grid-column: 1/-1;
78
+ grid-row: 3;
79
+ }
80
+ }
81
+
82
+ /* Input */
83
+ input[type="radio"] {
84
+ appearance: none;
85
+ aspect-ratio: 1;
86
+ background-color: var(--surface-default);
87
+ block-size: var(--_input-size);
88
+ border: 1px solid var(--field-border-color);
89
+ border-radius: var(--radius-round);
90
+ box-sizing: border-box;
91
+ cursor: pointer;
92
+ display: grid;
93
+ inline-size: var(--_input-size);
94
+ margin: 0;
95
+ padding: 0;
96
+ place-items: center;
97
+ position: relative;
98
+
99
+ &:checked {
100
+ background-color: var(--primary);
101
+ border-color: var(--primary);
102
+ }
103
+
104
+ /* Dot */
105
+ &::after {
106
+ background-color: var(--primary-contrast);
107
+ block-size: var(--_indicator-size);
108
+ border-radius: var(--radius-round);
109
+ content: "";
110
+ inline-size: var(--_indicator-size);
111
+ margin: auto;
112
+ opacity: 0;
113
+ }
114
+
115
+ &:checked::after {
116
+ opacity: 1;
117
+ }
118
+
119
+ &::before {
120
+ --highlight-size: 175%;
121
+ }
122
+ }
123
+
124
+ /* Sizes */
125
+ &.ui-small {
126
+ input[type="radio"] {
127
+ --_input-size: var(--size-3);
128
+
129
+ }
130
+ }
131
+
132
+ &.ui-large {
133
+ input[type="radio"] {
134
+ --_input-size: var(--size-4);
135
+
136
+ }
137
+ }
138
+
139
+ /* Validation */
140
+ &[data-invalid],
141
+ &:has(:user-invalid) {
142
+ --palette-source: oklch(0.58 0.21 var(--hue-red));
143
+
144
+ :where(.ui-end-text) {
145
+ color: var(--primary);
146
+ }
147
+ }
148
+
149
+ /* Touch devices */
150
+ @media (pointer: coarse) {
151
+ input[type="radio"] {
152
+ block-size: var(--size-4);
153
+ inline-size: var(--size-4);
154
+ }
155
+ }
156
+
157
+ @media (forced-colors: active) {
158
+ input[type="radio"] {
159
+ border: 1px solid CanvasText;
160
+
161
+ &:checked {
162
+ background-color: SelectedItem;
163
+ border-color: SelectedItem;
164
+
165
+ &::after {
166
+ background-color: SelectedItemText;
167
+ }
168
+ }
169
+ }
170
+ }
171
+ }
172
+ }