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,27 +1,27 @@
1
- @layer components.root {
2
- :where(.ui-anchor) {
3
- anchor-name: --anchor;
4
- anchor-scope: --anchor;
5
- display: inline-block;
6
- inline-size: fit-content;
7
-
8
- /* Always-visible */
9
- &>.ui-anchor-floating:not([popover]) {
10
- block-size: max-content;
11
- inline-size: max-content;
12
- position: absolute;
13
- position-anchor: --anchor;
14
- position-area: var(--anchor-position-area, start end);
15
- translate: var(--_anchor-tx, 0) var(--_anchor-ty, 0);
16
- }
17
-
18
- /* Hover-triggered */
19
- &>.ui-anchor-floating[popover] {
20
- inset: unset;
21
- margin: 0;
22
- position: absolute;
23
- position-area: var(--anchor-position-area, start end);
24
- translate: var(--_anchor-tx, 0) var(--_anchor-ty, 0);
25
- }
26
- }
27
- }
1
+ @layer components.root {
2
+ :where(.ui-anchor) {
3
+ anchor-name: --anchor;
4
+ anchor-scope: --anchor;
5
+ display: inline-block;
6
+ inline-size: fit-content;
7
+
8
+ /* Always-visible */
9
+ & > .ui-anchor-floating:not([popover]) {
10
+ block-size: max-content;
11
+ inline-size: max-content;
12
+ position: absolute;
13
+ position-anchor: --anchor;
14
+ position-area: var(--anchor-position-area, start end);
15
+ translate: var(--_anchor-tx, 0) var(--_anchor-ty, 0);
16
+ }
17
+
18
+ /* Hover-triggered */
19
+ & > .ui-anchor-floating[popover] {
20
+ inset: unset;
21
+ margin: 0;
22
+ position: absolute;
23
+ position-area: var(--anchor-position-area, start end);
24
+ translate: var(--_anchor-tx, 0) var(--_anchor-ty, 0);
25
+ }
26
+ }
27
+ }
@@ -1,65 +1,65 @@
1
- @layer components.root {
2
- :where(.ui-avatar) {
3
- --_bg-color: var(--primary);
4
- --_color: var(--color-1);
5
- --_width: 40px;
6
-
7
- align-items: center;
8
- aspect-ratio: 1;
9
- background-color: var(--_bg-color);
10
- border-radius: var(--radius-round);
11
- color: var(--_color);
12
- display: inline-flex;
13
- inline-size: var(--_width);
14
- justify-content: center;
15
- overflow: clip;
16
- position: relative;
17
- text-align: center;
18
- text-decoration: none;
19
-
20
- &:has(img) {
21
- background-color: transparent;
22
- }
23
-
24
- svg {
25
- max-inline-size: var(--size-5);
26
- }
27
-
28
- img {
29
- block-size: 100%;
30
- inline-size: 100%;
31
- inset: 0;
32
- object-fit: cover;
33
- position: absolute;
34
- }
35
-
36
- &.ui-squared {
37
- border-radius: 0;
38
- }
39
-
40
- &.ui-rounded {
41
- border-radius: var(--radius-2);
42
- }
43
-
44
- &.ui-squircle {
45
- border-radius: var(--radius-3);
46
-
47
- @supports (corner-shape: squircle) {
48
- border-radius: var(--radius-round);
49
- corner-shape: squircle;
50
- }
51
- }
52
- }
53
-
54
- :where([role="group"]) {
55
- --_margin: var(--size-3);
56
- --_outline-color: var(--surface-default);
57
-
58
- display: flex;
59
-
60
- .ui-avatar {
61
- box-shadow: 0 0 0 2px var(--_outline-color);
62
- margin-inline-end: calc(-1 * var(--_margin));
63
- }
64
- }
65
- }
1
+ @layer components.root {
2
+ :where(.ui-avatar) {
3
+ --_bg-color: var(--primary);
4
+ --_color: var(--color-1);
5
+ --_width: 40px;
6
+
7
+ align-items: center;
8
+ aspect-ratio: 1;
9
+ background-color: var(--_bg-color);
10
+ border-radius: var(--radius-round);
11
+ color: var(--_color);
12
+ display: inline-flex;
13
+ inline-size: var(--_width);
14
+ justify-content: center;
15
+ overflow: clip;
16
+ position: relative;
17
+ text-align: center;
18
+ text-decoration: none;
19
+
20
+ &:has(img) {
21
+ background-color: transparent;
22
+ }
23
+
24
+ svg {
25
+ max-inline-size: var(--size-5);
26
+ }
27
+
28
+ img {
29
+ block-size: 100%;
30
+ inline-size: 100%;
31
+ inset: 0;
32
+ object-fit: cover;
33
+ position: absolute;
34
+ }
35
+
36
+ &.ui-squared {
37
+ border-radius: 0;
38
+ }
39
+
40
+ &.ui-rounded {
41
+ border-radius: var(--radius-2);
42
+ }
43
+
44
+ &.ui-squircle {
45
+ border-radius: var(--radius-3);
46
+
47
+ @supports (corner-shape: squircle) {
48
+ border-radius: var(--radius-round);
49
+ corner-shape: squircle;
50
+ }
51
+ }
52
+ }
53
+
54
+ :where([role="group"]) {
55
+ --_margin: var(--size-3);
56
+ --_outline-color: var(--surface-default);
57
+
58
+ display: flex;
59
+
60
+ .ui-avatar {
61
+ box-shadow: 0 0 0 2px var(--_outline-color);
62
+ margin-inline-end: calc(-1 * var(--_margin));
63
+ }
64
+ }
65
+ }
@@ -1,107 +1,107 @@
1
- @layer components.extended {
2
- :where(.ui-badge) {
3
- --_anchor-tx: -50%;
4
- --_anchor-ty: 50%;
5
- --_badge-inset: auto auto 100% 100%;
6
- --_bg-color: var(--primary);
7
- --_border-color: var(--primary);
8
- --_dot-size: var(--size-2);
9
- --_size: var(--size-4);
10
- --_text-color: var(--gray-1);
11
-
12
- display: inline-flex;
13
- position: relative;
14
- vertical-align: middle;
15
-
16
- /* Floating wrapper: traditional inset-based positioning so this works
17
- in browsers without position-area support (Firefox, older Safari). */
18
- &>.ui-anchor-floating:not([popover]) {
19
- inset: var(--_badge-inset);
20
- position-anchor: auto;
21
- position-area: none;
22
- }
23
-
24
- /* Indicator */
25
- &>.ui-anchor-floating>.ui-badge-indicator {
26
- background-color: var(--_bg-color);
27
- block-size: var(--_size);
28
- border: 2px solid var(--_border-color);
29
- border-radius: var(--radius-round);
30
- color: var(--_text-color);
31
- display: grid;
32
- font-size: 12px;
33
- font-weight: 500;
34
- inline-size: max-content;
35
- line-height: normal;
36
- min-inline-size: var(--_size);
37
- padding-inline: var(--size-1);
38
- place-items: center;
39
- text-align: center;
40
- transition: opacity 0.2s var(--ease-out-1);
41
- }
42
-
43
- /* Colors */
44
- &.ui-critical {
45
- --_bg-color: var(--critical);
46
- --_border-color: var(--critical);
47
- }
48
-
49
- &.ui-success {
50
- --_bg-color: var(--success);
51
- --_border-color: var(--success);
52
- }
53
-
54
- &.ui-info {
55
- --_bg-color: var(--info);
56
- --_border-color: var(--info);
57
- }
58
-
59
- &.ui-warning {
60
- --_bg-color: var(--warning);
61
- --_border-color: var(--warning);
62
- }
63
-
64
- &.ui-neutral {
65
- --_bg-color: var(--neutral);
66
- --_border-color: var(--neutral);
67
- }
68
-
69
- /* Alignment */
70
- &.ui-start-start {
71
- --_anchor-tx: 50%;
72
- --_anchor-ty: 50%;
73
- --_badge-inset: auto 100% 100% auto;
74
- }
75
-
76
- &.ui-end-start {
77
- --_anchor-tx: 50%;
78
- --_anchor-ty: -50%;
79
- --_badge-inset: 100% 100% auto auto;
80
- }
81
-
82
- &.ui-end-end {
83
- --_anchor-tx: -50%;
84
- --_anchor-ty: -50%;
85
- --_badge-inset: 100% auto auto 100%;
86
- }
87
-
88
- /* Dot */
89
- &.ui-dot {
90
- --_anchor-tx: calc((var(--_dot-size) - 2px) * -1);
91
- --_anchor-ty: var(--_dot-size);
92
- }
93
-
94
- &.ui-dot>.ui-anchor-floating>.ui-badge-indicator {
95
- block-size: var(--_dot-size);
96
- inline-size: var(--_dot-size);
97
- min-inline-size: var(--_dot-size);
98
- padding: 0;
99
- }
100
-
101
- /* Visibility */
102
- &.ui-invisible>.ui-anchor-floating>.ui-badge-indicator {
103
- opacity: 0;
104
- pointer-events: none;
105
- }
106
- }
107
- }
1
+ @layer components.extended {
2
+ :where(.ui-badge) {
3
+ --_anchor-tx: -50%;
4
+ --_anchor-ty: 50%;
5
+ --_badge-inset: auto auto 100% 100%;
6
+ --_bg-color: var(--primary);
7
+ --_border-color: var(--primary);
8
+ --_dot-size: var(--size-2);
9
+ --_size: var(--size-4);
10
+ --_text-color: var(--gray-1);
11
+
12
+ display: inline-flex;
13
+ position: relative;
14
+ vertical-align: middle;
15
+
16
+ /* Floating wrapper: traditional inset-based positioning so this works
17
+ in browsers without position-area support (Firefox, older Safari). */
18
+ & > .ui-anchor-floating:not([popover]) {
19
+ inset: var(--_badge-inset);
20
+ position-anchor: auto;
21
+ position-area: none;
22
+ }
23
+
24
+ /* Indicator */
25
+ & > .ui-anchor-floating > .ui-badge-indicator {
26
+ background-color: var(--_bg-color);
27
+ block-size: var(--_size);
28
+ border: 2px solid var(--_border-color);
29
+ border-radius: var(--radius-round);
30
+ color: var(--_text-color);
31
+ display: grid;
32
+ font-size: 12px;
33
+ font-weight: 500;
34
+ inline-size: max-content;
35
+ line-height: normal;
36
+ min-inline-size: var(--_size);
37
+ padding-inline: var(--size-1);
38
+ place-items: center;
39
+ text-align: center;
40
+ transition: opacity 0.2s var(--ease-out-1);
41
+ }
42
+
43
+ /* Colors */
44
+ &.ui-critical {
45
+ --_bg-color: var(--critical);
46
+ --_border-color: var(--critical);
47
+ }
48
+
49
+ &.ui-success {
50
+ --_bg-color: var(--success);
51
+ --_border-color: var(--success);
52
+ }
53
+
54
+ &.ui-info {
55
+ --_bg-color: var(--info);
56
+ --_border-color: var(--info);
57
+ }
58
+
59
+ &.ui-warning {
60
+ --_bg-color: var(--warning);
61
+ --_border-color: var(--warning);
62
+ }
63
+
64
+ &.ui-neutral {
65
+ --_bg-color: var(--neutral);
66
+ --_border-color: var(--neutral);
67
+ }
68
+
69
+ /* Alignment */
70
+ &.ui-start-start {
71
+ --_anchor-tx: 50%;
72
+ --_anchor-ty: 50%;
73
+ --_badge-inset: auto 100% 100% auto;
74
+ }
75
+
76
+ &.ui-end-start {
77
+ --_anchor-tx: 50%;
78
+ --_anchor-ty: -50%;
79
+ --_badge-inset: 100% 100% auto auto;
80
+ }
81
+
82
+ &.ui-end-end {
83
+ --_anchor-tx: -50%;
84
+ --_anchor-ty: -50%;
85
+ --_badge-inset: 100% auto auto 100%;
86
+ }
87
+
88
+ /* Dot */
89
+ &.ui-dot {
90
+ --_anchor-tx: calc((var(--_dot-size) - 2px) * -1);
91
+ --_anchor-ty: var(--_dot-size);
92
+ }
93
+
94
+ &.ui-dot > .ui-anchor-floating > .ui-badge-indicator {
95
+ block-size: var(--_dot-size);
96
+ inline-size: var(--_dot-size);
97
+ min-inline-size: var(--_dot-size);
98
+ padding: 0;
99
+ }
100
+
101
+ /* Visibility */
102
+ &.ui-invisible > .ui-anchor-floating > .ui-badge-indicator {
103
+ opacity: 0;
104
+ pointer-events: none;
105
+ }
106
+ }
107
+ }