opui-css 2.4.0 → 3.0.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 (80) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +23 -7
  3. package/dist/op.css +1 -14
  4. package/dist/{op+ui.css → theme-one.css} +4378 -4155
  5. package/dist/{ui.css → theme-two.css} +4097 -4100
  6. package/package.json +10 -8
  7. package/src/core/normalize.css +196 -196
  8. package/src/core/utils.css +60 -60
  9. package/src/open-props.css +1 -1
  10. package/src/{components → themes/theme-one/components}/accordion.css +172 -172
  11. package/src/{components → themes/theme-one/components}/alert.css +85 -85
  12. package/src/{components → themes/theme-one/components}/avatar.css +68 -68
  13. package/src/{components → themes/theme-one/components}/badge.css +101 -101
  14. package/src/{components → themes/theme-one/components}/button-group.css +69 -69
  15. package/src/{components → themes/theme-one/components}/button.css +267 -267
  16. package/src/{components → themes/theme-one/components}/card.css +82 -82
  17. package/src/{components → themes/theme-one/components}/checkbox-radio.css +123 -123
  18. package/src/{components → themes/theme-one/components}/chip.css +135 -135
  19. package/src/{components → themes/theme-one/components}/definition-list.css +65 -65
  20. package/src/{components → themes/theme-one/components}/dialog.css +59 -59
  21. package/src/{components → themes/theme-one/components}/divider.css +7 -7
  22. package/src/{components → themes/theme-one/components}/field-group.css +83 -83
  23. package/src/{components → themes/theme-one/components}/field.css +494 -494
  24. package/src/{components → themes/theme-one/components}/icon-button.css +40 -40
  25. package/src/{components → themes/theme-one/components}/link.css +21 -21
  26. package/src/{components → themes/theme-one/components}/list.css +317 -317
  27. package/src/{components → themes/theme-one/components}/progress.css +83 -83
  28. package/src/{components → themes/theme-one/components}/range.css +121 -121
  29. package/src/{components → themes/theme-one/components}/rich-text.css +210 -210
  30. package/src/{components → themes/theme-one/components}/select.css +163 -163
  31. package/src/{components → themes/theme-one/components}/snackbar.css +148 -148
  32. package/src/{components → themes/theme-one/components}/spinner.css +38 -38
  33. package/src/{components → themes/theme-one/components}/switch.css +189 -189
  34. package/src/{components → themes/theme-one/components}/tab-buttons.css +120 -120
  35. package/src/themes/theme-one/components/table.css +100 -0
  36. package/src/{components → themes/theme-one/components}/text-field.css +57 -57
  37. package/src/{components → themes/theme-one/components}/textarea.css +25 -25
  38. package/src/{components → themes/theme-one/components}/toggle-button-group.css +135 -139
  39. package/src/{components → themes/theme-one/components}/tooltip.css +94 -94
  40. package/src/{components → themes/theme-one/components}/typography.css +209 -209
  41. package/src/themes/theme-one/components.css +37 -0
  42. package/src/themes/theme-one/imports.css +16 -0
  43. package/src/{theme.css → themes/theme-one/theme.css} +163 -163
  44. package/src/themes/theme-two/components/accordion.css +172 -0
  45. package/src/themes/theme-two/components/alert.css +85 -0
  46. package/src/themes/theme-two/components/avatar.css +68 -0
  47. package/src/themes/theme-two/components/badge.css +101 -0
  48. package/src/themes/theme-two/components/button-group.css +50 -0
  49. package/src/themes/theme-two/components/button.css +217 -0
  50. package/src/themes/theme-two/components/card.css +82 -0
  51. package/src/themes/theme-two/components/checkbox-radio.css +123 -0
  52. package/src/themes/theme-two/components/chip.css +135 -0
  53. package/src/themes/theme-two/components/definition-list.css +65 -0
  54. package/src/themes/theme-two/components/dialog.css +59 -0
  55. package/src/themes/theme-two/components/divider.css +7 -0
  56. package/src/themes/theme-two/components/field-group.css +83 -0
  57. package/src/themes/theme-two/components/field.css +281 -0
  58. package/src/themes/theme-two/components/icon-button.css +40 -0
  59. package/src/themes/theme-two/components/link.css +21 -0
  60. package/src/themes/theme-two/components/list.css +317 -0
  61. package/src/themes/theme-two/components/progress.css +83 -0
  62. package/src/themes/theme-two/components/range.css +121 -0
  63. package/src/themes/theme-two/components/rich-text.css +210 -0
  64. package/src/themes/theme-two/components/select.css +162 -0
  65. package/src/themes/theme-two/components/snackbar.css +148 -0
  66. package/src/themes/theme-two/components/spinner.css +38 -0
  67. package/src/themes/theme-two/components/switch.css +189 -0
  68. package/src/themes/theme-two/components/tab-buttons.css +120 -0
  69. package/src/{components → themes/theme-two/components}/table.css +107 -107
  70. package/src/themes/theme-two/components/text-field.css +57 -0
  71. package/src/themes/theme-two/components/textarea.css +25 -0
  72. package/src/themes/theme-two/components/toggle-button-group.css +135 -0
  73. package/src/themes/theme-two/components/tooltip.css +94 -0
  74. package/src/themes/theme-two/components/typography.css +209 -0
  75. package/src/themes/theme-two/components.css +37 -0
  76. package/src/themes/theme-two/imports.css +16 -0
  77. package/src/themes/theme-two/theme.css +158 -0
  78. package/src/core/components.css +0 -37
  79. package/src/main.css +0 -13
  80. package/src/opui.css +0 -10
@@ -1,120 +1,120 @@
1
- @layer components.root {
2
- :where(nav.tabs) {
3
- --_bg-color: transparent;
4
-
5
- & > [role="tablist"] {
6
- button {
7
- outline-color: transparent;
8
- outline-offset: -4px;
9
-
10
- &[aria-selected="true"] {
11
- &:focus-visible {
12
- outline: 2px solid var(--text-color-1);
13
- }
14
- }
15
- }
16
- }
17
-
18
- /* Underlined */
19
- &.underlined {
20
- /* Tab list */
21
- & > [role="tablist"] {
22
- border-bottom: 1px solid var(--border-color);
23
-
24
- button {
25
- --_ripple-color: light-dark(
26
- color-mix(in oklch, var(--gray-2) 80%, var(--color-8)),
27
- color-mix(in oklch, var(--gray-13) 80%, var(--color-8))
28
- );
29
-
30
- background: var(--_bg-color) var(--ripple, none);
31
- font-weight: 500;
32
- line-height: var(--font-lineheight-4);
33
- padding: var(--size-2) var(--size-3);
34
-
35
- &:focus-visible {
36
- border-radius: 0;
37
- }
38
-
39
- &[aria-selected="true"] {
40
- border-block-end: 2px solid var(--primary);
41
- color: var(--primary);
42
- }
43
-
44
- @media (prefers-reduced-motion: no-preference) {
45
- transition: background-color 0.2s var(--ease-out-3),
46
- border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
47
- outline-offset 0.05s var(--ease-1);
48
-
49
- /*** Ripple effect */
50
- background-position: center;
51
- transition: background var(--button-ripple-duration);
52
- &:where(:not(:active):hover) {
53
- --ripple: radial-gradient(
54
- circle,
55
- transparent 1%,
56
- var(--_ripple-color) 1%
57
- )
58
- center/15000%;
59
- }
60
-
61
- &:where(:hover:active) {
62
- background-size: var(--button-ripple-size);
63
- transition: background 0s;
64
- }
65
-
66
- &:hover {
67
- background-color: light-dark(
68
- oklch(from var(--primary) calc(l * 0.75) none h / 5%),
69
- oklch(from var(--primary) calc(l * 1.25) none h / 5%)
70
- );
71
- }
72
- }
73
- }
74
- }
75
- }
76
-
77
- /* Filled */
78
- &.filled {
79
- --_bg-color: var(--surface-default);
80
- --_radius: var(--border-radius);
81
- --_selected-bg: var(--surface-filled);
82
-
83
- & > [role="tablist"] {
84
- background-color: var(--_bg-color);
85
- border: var(--border-width) solid var(--border-color);
86
- border-radius: var(--_radius);
87
- overflow: hidden;
88
- padding: 0.792ex;
89
- width: fit-content;
90
-
91
- button {
92
- background-color: var(--_bg-color);
93
- border-radius: var(--_radius);
94
- line-height: var(--font-lineheight-4);
95
- padding-inline: var(--size-3);
96
-
97
- &:hover {
98
- background-color: oklch(from var(--_bg-color) calc(l * 1.25) c h);
99
- }
100
-
101
- &[aria-selected="true"] {
102
- background-color: var(--_selected-bg);
103
-
104
- &:hover {
105
- background-color: oklch(
106
- from var(--_selected-bg) calc(l * 1.25) c h
107
- );
108
- }
109
- }
110
-
111
- @media (prefers-reduced-motion: no-preference) {
112
- transition: background-color 0.2s var(--ease-out-3),
113
- border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
114
- outline-offset 0.05s var(--ease-1);
115
- }
116
- }
117
- }
118
- }
119
- }
120
- }
1
+ @layer components.root {
2
+ :where(nav.tabs) {
3
+ --_bg-color: transparent;
4
+
5
+ & > [role="tablist"] {
6
+ button {
7
+ outline-color: transparent;
8
+ outline-offset: -4px;
9
+
10
+ &[aria-selected="true"] {
11
+ &:focus-visible {
12
+ outline: 2px solid var(--text-color-1);
13
+ }
14
+ }
15
+ }
16
+ }
17
+
18
+ /* Underlined */
19
+ &.underlined {
20
+ /* Tab list */
21
+ & > [role="tablist"] {
22
+ border-bottom: 1px solid var(--border-color);
23
+
24
+ button {
25
+ --_ripple-color: light-dark(
26
+ color-mix(in oklch, var(--gray-2) 80%, var(--color-8)),
27
+ color-mix(in oklch, var(--gray-13) 80%, var(--color-8))
28
+ );
29
+
30
+ background: var(--_bg-color) var(--ripple, none);
31
+ font-weight: 500;
32
+ line-height: var(--font-lineheight-4);
33
+ padding: var(--size-2) var(--size-3);
34
+
35
+ &:focus-visible {
36
+ border-radius: 0;
37
+ }
38
+
39
+ &[aria-selected="true"] {
40
+ border-block-end: 2px solid var(--primary);
41
+ color: var(--primary);
42
+ }
43
+
44
+ @media (prefers-reduced-motion: no-preference) {
45
+ transition: background-color 0.2s var(--ease-out-3),
46
+ border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
47
+ outline-offset 0.05s var(--ease-1);
48
+
49
+ /*** Ripple effect */
50
+ background-position: center;
51
+ transition: background var(--button-ripple-duration);
52
+ &:where(:not(:active):hover) {
53
+ --ripple: radial-gradient(
54
+ circle,
55
+ transparent 1%,
56
+ var(--_ripple-color) 1%
57
+ )
58
+ center/15000%;
59
+ }
60
+
61
+ &:where(:hover:active) {
62
+ background-size: var(--button-ripple-size);
63
+ transition: background 0s;
64
+ }
65
+
66
+ &:hover {
67
+ background-color: light-dark(
68
+ oklch(from var(--primary) calc(l * 0.75) none h / 5%),
69
+ oklch(from var(--primary) calc(l * 1.25) none h / 5%)
70
+ );
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+
77
+ /* Filled */
78
+ &.filled {
79
+ --_bg-color: var(--surface-default);
80
+ --_radius: var(--border-radius);
81
+ --_selected-bg: var(--surface-filled);
82
+
83
+ & > [role="tablist"] {
84
+ background-color: var(--_bg-color);
85
+ border: var(--border-width) solid var(--border-color);
86
+ border-radius: var(--_radius);
87
+ overflow: hidden;
88
+ padding: 0.792ex;
89
+ width: fit-content;
90
+
91
+ button {
92
+ background-color: var(--_bg-color);
93
+ border-radius: var(--_radius);
94
+ line-height: var(--font-lineheight-4);
95
+ padding-inline: var(--size-3);
96
+
97
+ &:hover {
98
+ background-color: oklch(from var(--_bg-color) calc(l * 1.25) c h);
99
+ }
100
+
101
+ &[aria-selected="true"] {
102
+ background-color: var(--_selected-bg);
103
+
104
+ &:hover {
105
+ background-color: oklch(
106
+ from var(--_selected-bg) calc(l * 1.25) c h
107
+ );
108
+ }
109
+ }
110
+
111
+ @media (prefers-reduced-motion: no-preference) {
112
+ transition: background-color 0.2s var(--ease-out-3),
113
+ border-color 0.2s var(--ease-out-3), color 0.2s var(--ease-out-3),
114
+ outline-offset 0.05s var(--ease-1);
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,100 @@
1
+ @layer components.root {
2
+ :where(table) {
3
+ border-collapse: collapse;
4
+ display: block;
5
+ margin: var(--size-3) 0;
6
+ max-inline-size: 100%;
7
+ position: relative;
8
+
9
+ /* Rows */
10
+ tr {
11
+ background-color: var(--surface-default);
12
+ border-top: 1px solid var(--border-color);
13
+
14
+ &:hover {
15
+ background-color: oklch(from var(--surface-filled) l c h / 75%);
16
+ }
17
+ }
18
+
19
+ /* Cells */
20
+ th,
21
+ td {
22
+ border: 1px solid var(--border-color);
23
+ padding: var(--size-1) var(--size-2);
24
+ }
25
+
26
+ th {
27
+ background-color: var(--surface-filled);
28
+ color: var(--text-color-1);
29
+ font-size: var(--font-size-sm, 0.75rem);
30
+ font-weight: 600;
31
+ text-align: start;
32
+ }
33
+
34
+ td {
35
+ font-size: var(--font-size-sm, 0.75rem);
36
+ }
37
+
38
+ /* Caption */
39
+ caption {
40
+ caption-side: bottom;
41
+ color: var(--text-color-2);
42
+ font-size: var(--font-size-sm, 0.75rem);
43
+ padding: var(--size-2) 0;
44
+ text-align: start;
45
+ }
46
+
47
+ /* Footer */
48
+ tfoot {
49
+ border-top: 2px solid var(--border-color);
50
+
51
+ tr {
52
+ background-color: var(--surface-filled);
53
+ }
54
+
55
+ td {
56
+ color: var(--text-color-1);
57
+ font-weight: 600;
58
+ }
59
+ }
60
+
61
+ /* Column group */
62
+ colgroup col {
63
+ border: none;
64
+ }
65
+
66
+ @container (width < 60ch) {
67
+ th,
68
+ td {
69
+ padding: var(--size-1) 0.875rem;
70
+ }
71
+ }
72
+
73
+ /* Sticky header */
74
+ &.sticky-header thead {
75
+ background-color: var(--surface-filled);
76
+ position: sticky;
77
+ inset-block-start: 0;
78
+ z-index: 1;
79
+ }
80
+
81
+ /* Dense */
82
+ &.dense {
83
+ th,
84
+ td {
85
+ padding: var(--size-1) var(--size-2);
86
+ }
87
+
88
+ caption {
89
+ padding: var(--size-1) 0;
90
+ }
91
+
92
+ @container (width < 60ch) {
93
+ th,
94
+ td {
95
+ padding: var(--size-1) var(--size-2);
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
@@ -1,57 +1,57 @@
1
- @layer components.extended {
2
- :where(
3
- .field:has(
4
- :where(
5
- input[type="date"],
6
- input[type="datetime-local"],
7
- input[type="email"],
8
- input[type="month"],
9
- input[type="number"],
10
- input[type="password"],
11
- input[type="search"],
12
- input[type="tel"],
13
- input[type="text"],
14
- input[type="time"],
15
- input[type="url"],
16
- input[type="week"]
17
- )
18
- )
19
- ) {
20
- /* Sizes */
21
- &.small {
22
- input {
23
- padding-inline: var(--size-2);
24
- }
25
- }
26
- }
27
-
28
- /* Autosuggest */
29
- :where(.field:has(input[list])) {
30
- /* Hide native arrow */
31
- input::-webkit-calendar-picker-indicator {
32
- opacity: 0;
33
- position: absolute;
34
- cursor: pointer;
35
- pointer-events: none;
36
- }
37
- }
38
- :where(
39
- .field:has(input[list]:placeholder-shown),
40
- .field:has(input[list]):where(:focus-within, :hover)
41
- ) {
42
- /* Arrow */
43
- &::after {
44
- block-size: 0;
45
- border-block-start: 5px solid;
46
- border-inline: 5px solid transparent;
47
- content: "";
48
- display: inline-block;
49
- flex-shrink: 0;
50
- inline-size: 0;
51
- inset: 50% var(--size-3) auto auto;
52
- pointer-events: none;
53
- position: absolute;
54
- translate: 0 -50%;
55
- }
56
- }
57
- }
1
+ @layer components.extended {
2
+ :where(
3
+ .field:has(
4
+ :where(
5
+ input[type="date"],
6
+ input[type="datetime-local"],
7
+ input[type="email"],
8
+ input[type="month"],
9
+ input[type="number"],
10
+ input[type="password"],
11
+ input[type="search"],
12
+ input[type="tel"],
13
+ input[type="text"],
14
+ input[type="time"],
15
+ input[type="url"],
16
+ input[type="week"]
17
+ )
18
+ )
19
+ ) {
20
+ /* Sizes */
21
+ &.small {
22
+ input {
23
+ padding-inline: var(--size-2);
24
+ }
25
+ }
26
+ }
27
+
28
+ /* Autosuggest */
29
+ :where(.field:has(input[list])) {
30
+ /* Hide native arrow */
31
+ input::-webkit-calendar-picker-indicator {
32
+ opacity: 0;
33
+ position: absolute;
34
+ cursor: pointer;
35
+ pointer-events: none;
36
+ }
37
+ }
38
+ :where(
39
+ .field:has(input[list]:placeholder-shown),
40
+ .field:has(input[list]):where(:focus-within, :hover)
41
+ ) {
42
+ /* Arrow */
43
+ &::after {
44
+ block-size: 0;
45
+ border-block-start: 5px solid;
46
+ border-inline: 5px solid transparent;
47
+ content: "";
48
+ display: inline-block;
49
+ flex-shrink: 0;
50
+ inline-size: 0;
51
+ inset: 50% var(--size-3) auto auto;
52
+ pointer-events: none;
53
+ position: absolute;
54
+ translate: 0 -50%;
55
+ }
56
+ }
57
+ }
@@ -1,25 +1,25 @@
1
- @layer components.extended {
2
- :where(.field:has(textarea)) {
3
- textarea {
4
- block-size: auto;
5
- field-sizing: content;
6
- min-block-size: 5rem;
7
- resize: vertical;
8
- }
9
-
10
- /* Size */
11
- &.small {
12
- textarea {
13
- min-block-size: var(--_height);
14
- }
15
- }
16
-
17
- /* Auto-fit */
18
- &.auto-fit {
19
- textarea {
20
- min-block-size: var(--_height);
21
- resize: both;
22
- }
23
- }
24
- }
25
- }
1
+ @layer components.extended {
2
+ :where(.field:has(textarea)) {
3
+ textarea {
4
+ block-size: auto;
5
+ field-sizing: content;
6
+ min-block-size: 5rem;
7
+ resize: vertical;
8
+ }
9
+
10
+ /* Size */
11
+ &.small {
12
+ textarea {
13
+ min-block-size: var(--_height);
14
+ }
15
+ }
16
+
17
+ /* Auto-fit */
18
+ &.auto-fit {
19
+ textarea {
20
+ min-block-size: var(--_height);
21
+ resize: both;
22
+ }
23
+ }
24
+ }
25
+ }