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,87 +1,87 @@
1
- @layer components.root {
2
- :where(.ui-chip) {
3
- --_bg-color: var(--surface-tonal);
4
- --_border-color: var(--border-color);
5
- --_color: var(--text-primary);
6
-
7
- align-items: center;
8
- background: var(--_bg-color) var(--ripple, none);
9
- block-size: var(--size-7, 2rem);
10
- border-radius: var(--radius-2, 0.5rem);
11
- border: 1px solid var(--_border-color);
12
- color: var(--_color);
13
- display: inline-flex;
14
- font-size: var(--font-size-0, 0.75rem);
15
- gap: var(--size-1);
16
- padding-inline: var(--size-2);
17
- text-decoration: none;
18
-
19
- /* Variants */
20
- &.ui-tonal {
21
- --_bg-color: var(--surface-tonal);
22
- --_color: var(--text-primary);
23
- }
24
-
25
- &.ui-outlined {
26
- --_bg-color: var(--surface-default);
27
- --_color: var(--text-primary);
28
- }
29
-
30
- &:where(button, a):where(:not([disabled])) {
31
- &:where(:not(:active)):hover {
32
- --_bg-color: light-dark(oklch(from var(--surface-tonal) calc(l * 0.98) c h),
33
- oklch(from var(--surface-tonal) calc(l * 1.1) c h));
34
- }
35
- }
36
-
37
- /* Icon */
38
- &:has(svg:first-child) {
39
- padding-inline: var(--size-1) var(--size-2);
40
- }
41
-
42
- &:has(svg:last-child) {
43
- padding-inline: var(--size-2) var(--size-1);
44
- }
45
-
46
- &:has(svg) {
47
- svg {
48
- flex-shrink: 0;
49
- inline-size: var(--size-3);
50
- }
51
- }
52
-
53
- /* Sizes */
54
- &.ui-small {
55
- block-size: var(--size-5);
56
- }
57
-
58
- &.ui-multiline {
59
- block-size: auto;
60
- }
61
-
62
- /* Ripple effect */
63
- background-position: center;
64
-
65
- &:where(:not([disabled])) {
66
- &:where(:not(:active):hover) {
67
- --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%) center/15000%;
68
-
69
- transition: background var(--button-ripple-duration);
70
- }
71
-
72
- &:where(:hover:active) {
73
- background-size: var(--button-ripple-size);
74
- transition: background 0s;
75
- }
76
- }
77
-
78
- /* Disabled */
79
- &:where([disabled]) {
80
- opacity: 0.64;
81
- --_color: color-mix(in oklch,
82
- var(--text-muted) 50%,
83
- var(--surface-default));
84
- cursor: not-allowed;
85
- }
86
- }
87
- }
1
+ @layer components.root {
2
+ :where(.ui-chip) {
3
+ --_bg-color: var(--surface-tonal);
4
+ --_border-color: var(--border-color);
5
+ --_color: var(--text-primary);
6
+
7
+ align-items: center;
8
+ background: var(--_bg-color) var(--ripple, none);
9
+ block-size: var(--size-7, 2rem);
10
+ border-radius: var(--radius-2, 0.5rem);
11
+ border: 1px solid var(--_border-color);
12
+ color: var(--_color);
13
+ display: inline-flex;
14
+ font-size: var(--font-size-0, 0.75rem);
15
+ gap: var(--size-1);
16
+ padding-inline: var(--size-2);
17
+ text-decoration: none;
18
+
19
+ /* Variants */
20
+ &.ui-tonal {
21
+ --_bg-color: var(--surface-tonal);
22
+ --_color: var(--text-primary);
23
+ }
24
+
25
+ &.ui-outlined {
26
+ --_bg-color: var(--surface-default);
27
+ --_color: var(--text-primary);
28
+ }
29
+
30
+ &:where(button, a):where(:not([disabled])) {
31
+ &:where(:not(:active)):hover {
32
+ --_bg-color: light-dark(oklch(from var(--surface-tonal) calc(l * 0.98) c h),
33
+ oklch(from var(--surface-tonal) calc(l * 1.1) c h));
34
+ }
35
+ }
36
+
37
+ /* Icon */
38
+ &:has(svg:first-child) {
39
+ padding-inline: var(--size-1) var(--size-2);
40
+ }
41
+
42
+ &:has(svg:last-child) {
43
+ padding-inline: var(--size-2) var(--size-1);
44
+ }
45
+
46
+ &:has(svg) {
47
+ svg {
48
+ flex-shrink: 0;
49
+ inline-size: var(--size-3);
50
+ }
51
+ }
52
+
53
+ /* Sizes */
54
+ &.ui-small {
55
+ block-size: var(--size-5);
56
+ }
57
+
58
+ &.ui-multiline {
59
+ block-size: auto;
60
+ }
61
+
62
+ /* Ripple effect */
63
+ background-position: center;
64
+
65
+ &:where(:not([disabled])) {
66
+ &:where(:not(:active):hover) {
67
+ --ripple: radial-gradient(circle, transparent 1%, var(--_bg-color) 1%) center/15000%;
68
+
69
+ transition: background var(--button-ripple-duration);
70
+ }
71
+
72
+ &:where(:hover:active) {
73
+ background-size: var(--button-ripple-size);
74
+ transition: background 0s;
75
+ }
76
+ }
77
+
78
+ /* Disabled */
79
+ &:where([disabled]) {
80
+ opacity: 0.64;
81
+ --_color: color-mix(in oklch,
82
+ var(--text-muted) 50%,
83
+ var(--surface-default));
84
+ cursor: not-allowed;
85
+ }
86
+ }
87
+ }
@@ -1,80 +1,80 @@
1
- @layer components.root {
2
- :where(.ui-description-list) {
3
- --_border-style: solid;
4
- --_border-width: 1px;
5
-
6
- display: grid;
7
- gap: var(--size-3);
8
- margin: 0;
9
- padding: 0;
10
-
11
- &.ui-dotted {
12
- --_border-style: dotted;
13
- --_border-width: 2px;
14
- }
15
-
16
- .ui-item {
17
- display: grid;
18
- margin: 0;
19
- padding: 0;
20
-
21
- dt,
22
- .ui-term {
23
- display: block;
24
- font-weight: 700;
25
- overflow: hidden;
26
- position: relative;
27
- }
28
-
29
- dd {
30
- margin: 0;
31
- }
32
- }
33
-
34
- @container (width > 45ch) {
35
- gap: var(--size-1);
36
-
37
- .ui-item {
38
- align-items: baseline;
39
- display: grid;
40
- gap: var(--size-1);
41
- grid-template-columns: 1fr auto;
42
-
43
- dt,
44
- .ui-term {
45
- inline-size: max-content;
46
-
47
- &::after {
48
- display: inline-block;
49
- }
50
- }
51
-
52
- dd {
53
- color: var(--text-muted);
54
- text-align: end;
55
- }
56
- }
57
-
58
- &.ui-bordered .ui-item {
59
- grid-template-columns: auto 1fr auto;
60
-
61
- dt,
62
- .ui-term {
63
- order: 0;
64
- }
65
-
66
- dd {
67
- order: 2;
68
- }
69
-
70
- &::after {
71
- background-color: transparent;
72
- block-size: 2px;
73
- border-block-end: var(--_border-width) var(--_border-style) var(--border-color);
74
- content: "";
75
- order: 1;
76
- }
77
- }
78
- }
79
- }
80
- }
1
+ @layer components.root {
2
+ :where(.ui-description-list) {
3
+ --_border-style: solid;
4
+ --_border-width: 1px;
5
+
6
+ display: grid;
7
+ gap: var(--size-3);
8
+ margin: 0;
9
+ padding: 0;
10
+
11
+ &.ui-dotted {
12
+ --_border-style: dotted;
13
+ --_border-width: 2px;
14
+ }
15
+
16
+ .ui-item {
17
+ display: grid;
18
+ margin: 0;
19
+ padding: 0;
20
+
21
+ dt,
22
+ .ui-term {
23
+ display: block;
24
+ font-weight: 700;
25
+ overflow: hidden;
26
+ position: relative;
27
+ }
28
+
29
+ dd {
30
+ margin: 0;
31
+ }
32
+ }
33
+
34
+ @container (width > 45ch) {
35
+ gap: var(--size-1);
36
+
37
+ .ui-item {
38
+ align-items: baseline;
39
+ display: grid;
40
+ gap: var(--size-1);
41
+ grid-template-columns: 1fr auto;
42
+
43
+ dt,
44
+ .ui-term {
45
+ inline-size: max-content;
46
+
47
+ &::after {
48
+ display: inline-block;
49
+ }
50
+ }
51
+
52
+ dd {
53
+ color: var(--text-muted);
54
+ text-align: end;
55
+ }
56
+ }
57
+
58
+ &.ui-bordered .ui-item {
59
+ grid-template-columns: auto 1fr auto;
60
+
61
+ dt,
62
+ .ui-term {
63
+ order: 0;
64
+ }
65
+
66
+ dd {
67
+ order: 2;
68
+ }
69
+
70
+ &::after {
71
+ background-color: transparent;
72
+ block-size: 2px;
73
+ border-block-end: var(--_border-width) var(--_border-style) var(--border-color);
74
+ content: "";
75
+ order: 1;
76
+ }
77
+ }
78
+ }
79
+ }
80
+ }
@@ -1,68 +1,68 @@
1
- @layer components.extended {
2
- :where(.ui-dialog) {
3
- inline-size: 100%;
4
- inset: 0;
5
- margin: auto;
6
- margin-block-start: 15%;
7
- max-inline-size: calc(100% - var(--size-4));
8
- padding-block: 0;
9
- pointer-events: none;
10
- position: fixed;
11
-
12
- @media (width > 600px) {
13
- max-inline-size: 60ch;
14
- }
15
-
16
- /* Animation */
17
- /* There's no close animation, intentionally */
18
- opacity: 0;
19
-
20
- &::backdrop {
21
- backdrop-filter: blur(1px);
22
- background-color: rgba(0, 0, 0, 0.5);
23
-
24
- @media (prefers-reduced-motion: reduce) {
25
- backdrop-filter: none;
26
- }
27
- }
28
-
29
- &:not([open]) {
30
- display: none;
31
- }
32
-
33
- &[open] {
34
- pointer-events: all;
35
- }
36
-
37
- .ui-actions {
38
- justify-content: end;
39
- padding-inline: var(--size-3) var(--size-1);
40
- }
41
-
42
- &[open] {
43
- opacity: 1;
44
- transition: display 0.2s allow-discrete,
45
- overlay 0.2s allow-discrete,
46
- opacity 0.2s var(--ease-out-1);
47
-
48
- @starting-style {
49
- opacity: 0;
50
- }
51
- }
52
-
53
- @media (prefers-reduced-motion: no-preference) {
54
- &[open] {
55
- margin-block-start: 15%;
56
-
57
- @starting-style {
58
- opacity: 0;
59
- }
60
- }
61
- }
62
- }
63
-
64
- :where(html:has(.ui-dialog[open])) {
65
- block-size: 100%;
66
- overflow: hidden;
67
- }
68
- }
1
+ @layer components.extended {
2
+ :where(.ui-dialog) {
3
+ inline-size: 100%;
4
+ inset: 0;
5
+ margin: auto;
6
+ margin-block-start: 15%;
7
+ max-inline-size: calc(100% - var(--size-4));
8
+ padding-block: 0;
9
+ pointer-events: none;
10
+ position: fixed;
11
+
12
+ @media (width > 600px) {
13
+ max-inline-size: 60ch;
14
+ }
15
+
16
+ /* Animation */
17
+ /* There's no close animation, intentionally */
18
+ opacity: 0;
19
+
20
+ &::backdrop {
21
+ backdrop-filter: blur(1px);
22
+ background-color: rgba(0, 0, 0, 0.5);
23
+
24
+ @media (prefers-reduced-motion: reduce) {
25
+ backdrop-filter: none;
26
+ }
27
+ }
28
+
29
+ &:not([open]) {
30
+ display: none;
31
+ }
32
+
33
+ &[open] {
34
+ pointer-events: all;
35
+ }
36
+
37
+ .ui-actions {
38
+ justify-content: end;
39
+ padding-inline: var(--size-3) var(--size-1);
40
+ }
41
+
42
+ &[open] {
43
+ opacity: 1;
44
+ transition: display 0.2s allow-discrete,
45
+ overlay 0.2s allow-discrete,
46
+ opacity 0.2s var(--ease-out-1);
47
+
48
+ @starting-style {
49
+ opacity: 0;
50
+ }
51
+ }
52
+
53
+ @media (prefers-reduced-motion: no-preference) {
54
+ &[open] {
55
+ margin-block-start: 15%;
56
+
57
+ @starting-style {
58
+ opacity: 0;
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ :where(html:has(.ui-dialog[open])) {
65
+ block-size: 100%;
66
+ overflow: hidden;
67
+ }
68
+ }
@@ -1,20 +1,20 @@
1
- @layer components.root {
2
- :where(.ui-divider) {
3
- background-color: var(--border-color);
4
- block-size: var(--border-size-1);
5
- margin-block: var(--size-fluid-3);
6
-
7
- /* Border color */
8
- &.ui-border-filled {
9
- background-color: var(--surface-filled);
10
- }
11
-
12
- &.ui-border-primary {
13
- background-color: var(--primary);
14
- }
15
-
16
- &.ui-border-tonal {
17
- background-color: var(--surface-tonal);
18
- }
19
- }
20
- }
1
+ @layer components.root {
2
+ :where(.ui-divider) {
3
+ background-color: var(--border-color);
4
+ block-size: var(--border-size-1);
5
+ margin-block: var(--size-fluid-3);
6
+
7
+ /* Border color */
8
+ &.ui-border-filled {
9
+ background-color: var(--surface-filled);
10
+ }
11
+
12
+ &.ui-border-primary {
13
+ background-color: var(--primary);
14
+ }
15
+
16
+ &.ui-border-tonal {
17
+ background-color: var(--surface-tonal);
18
+ }
19
+ }
20
+ }