loseta 0.1.0 → 0.4.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 (256) hide show
  1. package/README.md +19 -6
  2. package/dist/cli.js +2 -0
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/add.d.ts +2 -2
  5. package/dist/commands/add.js +47 -62
  6. package/dist/commands/add.js.map +1 -1
  7. package/dist/commands/init.d.ts +2 -3
  8. package/dist/commands/init.js +57 -40
  9. package/dist/commands/init.js.map +1 -1
  10. package/dist/commands/style.d.ts +1 -0
  11. package/dist/commands/style.js +65 -0
  12. package/dist/commands/style.js.map +1 -0
  13. package/dist/config.d.ts +4 -1
  14. package/dist/config.js +9 -2
  15. package/dist/config.js.map +1 -1
  16. package/dist/imports.d.ts +2 -2
  17. package/dist/imports.js +8 -7
  18. package/dist/imports.js.map +1 -1
  19. package/dist/install.d.ts +24 -0
  20. package/dist/install.js +61 -0
  21. package/dist/install.js.map +1 -0
  22. package/dist/registry.d.ts +10 -0
  23. package/dist/registry.js +22 -0
  24. package/dist/registry.js.map +1 -1
  25. package/dist/style-selection.d.ts +32 -0
  26. package/dist/style-selection.js +52 -0
  27. package/dist/style-selection.js.map +1 -0
  28. package/dist/style-switch.d.ts +37 -0
  29. package/dist/style-switch.js +70 -0
  30. package/dist/style-switch.js.map +1 -0
  31. package/dist/types.d.ts +10 -4
  32. package/package.json +3 -2
  33. package/registry/base.css +1 -1
  34. package/registry/components/code-block.css +173 -0
  35. package/registry/examples/code-block.html +73 -0
  36. package/registry/examples/skeleton.html +1 -1
  37. package/registry/registry.json +1313 -105
  38. package/registry/reset.css +332 -80
  39. package/registry/schema.json +19 -4
  40. package/registry/styles/luma/alert-dialog.css +74 -0
  41. package/registry/styles/luma/alert.css +114 -0
  42. package/registry/styles/luma/badge.css +84 -0
  43. package/registry/styles/luma/button-group.css +75 -0
  44. package/registry/styles/luma/button.css +222 -0
  45. package/registry/styles/luma/card.css +100 -0
  46. package/registry/styles/luma/checkbox.css +52 -0
  47. package/registry/styles/luma/code-block.css +186 -0
  48. package/registry/styles/luma/dialog.css +64 -0
  49. package/registry/styles/luma/dropdown-menu.css +104 -0
  50. package/registry/styles/luma/empty.css +54 -0
  51. package/registry/styles/luma/field.css +120 -0
  52. package/registry/styles/luma/input.css +56 -0
  53. package/registry/styles/luma/item.css +133 -0
  54. package/registry/styles/luma/kbd.css +22 -0
  55. package/registry/styles/luma/label.css +70 -0
  56. package/registry/styles/luma/native-select.css +73 -0
  57. package/registry/styles/luma/popover.css +25 -0
  58. package/registry/styles/luma/primitives/dialog-shell.css +19 -0
  59. package/registry/styles/luma/primitives/popover.css +16 -0
  60. package/registry/{themes/nova → styles/luma}/radio.css +13 -20
  61. package/registry/{themes/nova → styles/luma}/skeleton.css +1 -1
  62. package/registry/styles/luma/switch.css +81 -0
  63. package/registry/styles/luma/table.css +87 -0
  64. package/registry/styles/luma/tabs.css +133 -0
  65. package/registry/styles/luma/textarea.css +48 -0
  66. package/registry/styles/luma/tooltip.css +22 -0
  67. package/registry/styles/lyra/alert-dialog.css +74 -0
  68. package/registry/styles/lyra/alert.css +114 -0
  69. package/registry/styles/lyra/badge.css +84 -0
  70. package/registry/styles/lyra/button-group.css +74 -0
  71. package/registry/styles/lyra/button.css +221 -0
  72. package/registry/styles/lyra/card.css +99 -0
  73. package/registry/styles/lyra/checkbox.css +52 -0
  74. package/registry/styles/lyra/code-block.css +186 -0
  75. package/registry/styles/lyra/dialog.css +64 -0
  76. package/registry/styles/lyra/dropdown-menu.css +104 -0
  77. package/registry/styles/lyra/empty.css +54 -0
  78. package/registry/styles/lyra/field.css +120 -0
  79. package/registry/styles/lyra/input.css +57 -0
  80. package/registry/styles/lyra/item.css +133 -0
  81. package/registry/styles/lyra/kbd.css +22 -0
  82. package/registry/styles/lyra/label.css +70 -0
  83. package/registry/styles/lyra/native-select.css +74 -0
  84. package/registry/styles/lyra/popover.css +25 -0
  85. package/registry/styles/lyra/primitives/dialog-shell.css +19 -0
  86. package/registry/styles/lyra/primitives/popover.css +16 -0
  87. package/registry/styles/lyra/radio.css +46 -0
  88. package/registry/styles/lyra/skeleton.css +7 -0
  89. package/registry/{themes/nova → styles/lyra}/switch.css +16 -22
  90. package/registry/styles/lyra/table.css +87 -0
  91. package/registry/styles/lyra/tabs.css +133 -0
  92. package/registry/styles/lyra/textarea.css +49 -0
  93. package/registry/styles/lyra/tooltip.css +22 -0
  94. package/registry/styles/maia/alert-dialog.css +74 -0
  95. package/registry/styles/maia/alert.css +114 -0
  96. package/registry/{themes/nova → styles/maia}/badge.css +9 -11
  97. package/registry/styles/maia/button-group.css +75 -0
  98. package/registry/styles/maia/button.css +222 -0
  99. package/registry/styles/maia/card.css +99 -0
  100. package/registry/styles/maia/checkbox.css +52 -0
  101. package/registry/styles/maia/code-block.css +186 -0
  102. package/registry/styles/maia/dialog.css +64 -0
  103. package/registry/styles/maia/dropdown-menu.css +104 -0
  104. package/registry/styles/maia/empty.css +54 -0
  105. package/registry/styles/maia/field.css +120 -0
  106. package/registry/styles/maia/input.css +56 -0
  107. package/registry/styles/maia/item.css +133 -0
  108. package/registry/{themes/nova → styles/maia}/kbd.css +1 -1
  109. package/registry/styles/maia/label.css +70 -0
  110. package/registry/styles/maia/native-select.css +73 -0
  111. package/registry/styles/maia/popover.css +25 -0
  112. package/registry/styles/maia/primitives/dialog-shell.css +19 -0
  113. package/registry/styles/maia/primitives/popover.css +16 -0
  114. package/registry/styles/maia/radio.css +46 -0
  115. package/registry/styles/maia/skeleton.css +7 -0
  116. package/registry/styles/maia/switch.css +81 -0
  117. package/registry/styles/maia/table.css +87 -0
  118. package/registry/styles/maia/tabs.css +133 -0
  119. package/registry/styles/maia/textarea.css +48 -0
  120. package/registry/styles/maia/tooltip.css +22 -0
  121. package/registry/styles/mira/alert-dialog.css +74 -0
  122. package/registry/styles/mira/alert.css +114 -0
  123. package/registry/styles/mira/badge.css +84 -0
  124. package/registry/styles/mira/button-group.css +75 -0
  125. package/registry/styles/mira/button.css +222 -0
  126. package/registry/styles/mira/card.css +99 -0
  127. package/registry/{themes/nova → styles/mira}/checkbox.css +13 -20
  128. package/registry/styles/mira/code-block.css +186 -0
  129. package/registry/styles/mira/dialog.css +64 -0
  130. package/registry/styles/mira/dropdown-menu.css +105 -0
  131. package/registry/styles/mira/empty.css +54 -0
  132. package/registry/styles/mira/field.css +120 -0
  133. package/registry/styles/mira/input.css +57 -0
  134. package/registry/styles/mira/item.css +133 -0
  135. package/registry/styles/mira/kbd.css +22 -0
  136. package/registry/styles/mira/label.css +70 -0
  137. package/registry/styles/mira/native-select.css +75 -0
  138. package/registry/styles/mira/popover.css +25 -0
  139. package/registry/styles/mira/primitives/dialog-shell.css +19 -0
  140. package/registry/styles/mira/primitives/popover.css +16 -0
  141. package/registry/styles/mira/radio.css +46 -0
  142. package/registry/styles/mira/skeleton.css +7 -0
  143. package/registry/styles/mira/switch.css +81 -0
  144. package/registry/styles/mira/table.css +87 -0
  145. package/registry/styles/mira/tabs.css +133 -0
  146. package/registry/styles/mira/textarea.css +49 -0
  147. package/registry/{themes/nova → styles/mira}/tooltip.css +1 -1
  148. package/registry/{themes → styles}/nova/alert-dialog.css +1 -1
  149. package/registry/{themes → styles}/nova/alert.css +1 -1
  150. package/registry/styles/nova/badge.css +84 -0
  151. package/registry/{themes → styles}/nova/button-group.css +1 -1
  152. package/registry/{themes → styles}/nova/button.css +38 -44
  153. package/registry/{themes → styles}/nova/card.css +1 -1
  154. package/registry/styles/nova/checkbox.css +52 -0
  155. package/registry/styles/nova/code-block.css +186 -0
  156. package/registry/{themes → styles}/nova/dialog.css +1 -1
  157. package/registry/{themes → styles}/nova/dropdown-menu.css +5 -6
  158. package/registry/{themes → styles}/nova/empty.css +1 -1
  159. package/registry/{themes → styles}/nova/field.css +1 -1
  160. package/registry/{themes → styles}/nova/input.css +17 -18
  161. package/registry/{themes → styles}/nova/item.css +1 -1
  162. package/registry/styles/nova/kbd.css +22 -0
  163. package/registry/{themes → styles}/nova/label.css +9 -10
  164. package/registry/{themes → styles}/nova/native-select.css +20 -16
  165. package/registry/{themes → styles}/nova/popover.css +1 -1
  166. package/registry/{themes → styles}/nova/primitives/dialog-shell.css +1 -1
  167. package/registry/{themes → styles}/nova/primitives/popover.css +1 -1
  168. package/registry/styles/nova/radio.css +46 -0
  169. package/registry/styles/nova/skeleton.css +7 -0
  170. package/registry/styles/nova/switch.css +81 -0
  171. package/registry/{themes → styles}/nova/table.css +1 -1
  172. package/registry/{themes → styles}/nova/tabs.css +10 -23
  173. package/registry/{themes → styles}/nova/textarea.css +17 -18
  174. package/registry/styles/nova/tooltip.css +22 -0
  175. package/registry/styles/rhea/alert-dialog.css +74 -0
  176. package/registry/styles/rhea/alert.css +114 -0
  177. package/registry/styles/rhea/badge.css +84 -0
  178. package/registry/styles/rhea/button-group.css +75 -0
  179. package/registry/styles/rhea/button.css +222 -0
  180. package/registry/styles/rhea/card.css +100 -0
  181. package/registry/styles/rhea/checkbox.css +52 -0
  182. package/registry/styles/rhea/code-block.css +186 -0
  183. package/registry/styles/rhea/dialog.css +64 -0
  184. package/registry/styles/rhea/dropdown-menu.css +105 -0
  185. package/registry/styles/rhea/empty.css +54 -0
  186. package/registry/styles/rhea/field.css +120 -0
  187. package/registry/styles/rhea/input.css +56 -0
  188. package/registry/styles/rhea/item.css +133 -0
  189. package/registry/styles/rhea/kbd.css +22 -0
  190. package/registry/styles/rhea/label.css +70 -0
  191. package/registry/styles/rhea/native-select.css +73 -0
  192. package/registry/styles/rhea/popover.css +25 -0
  193. package/registry/styles/rhea/primitives/dialog-shell.css +19 -0
  194. package/registry/styles/rhea/primitives/popover.css +16 -0
  195. package/registry/styles/rhea/radio.css +46 -0
  196. package/registry/styles/rhea/skeleton.css +7 -0
  197. package/registry/styles/rhea/switch.css +81 -0
  198. package/registry/styles/rhea/table.css +87 -0
  199. package/registry/styles/rhea/tabs.css +133 -0
  200. package/registry/styles/rhea/textarea.css +48 -0
  201. package/registry/styles/rhea/tooltip.css +22 -0
  202. package/registry/styles/sera/alert-dialog.css +76 -0
  203. package/registry/styles/sera/alert.css +114 -0
  204. package/registry/styles/sera/badge.css +115 -0
  205. package/registry/styles/sera/button-group.css +75 -0
  206. package/registry/styles/sera/button.css +222 -0
  207. package/registry/styles/sera/card.css +102 -0
  208. package/registry/styles/sera/checkbox.css +52 -0
  209. package/registry/styles/sera/code-block.css +186 -0
  210. package/registry/styles/sera/dialog.css +67 -0
  211. package/registry/styles/sera/dropdown-menu.css +104 -0
  212. package/registry/styles/sera/empty.css +54 -0
  213. package/registry/styles/sera/field.css +120 -0
  214. package/registry/styles/sera/input.css +57 -0
  215. package/registry/styles/sera/item.css +133 -0
  216. package/registry/styles/sera/kbd.css +22 -0
  217. package/registry/styles/sera/label.css +70 -0
  218. package/registry/styles/sera/native-select.css +74 -0
  219. package/registry/styles/sera/popover.css +25 -0
  220. package/registry/styles/sera/primitives/dialog-shell.css +19 -0
  221. package/registry/styles/sera/primitives/popover.css +16 -0
  222. package/registry/styles/sera/radio.css +46 -0
  223. package/registry/styles/sera/skeleton.css +7 -0
  224. package/registry/styles/sera/switch.css +82 -0
  225. package/registry/styles/sera/table.css +88 -0
  226. package/registry/styles/sera/tabs.css +133 -0
  227. package/registry/styles/sera/textarea.css +49 -0
  228. package/registry/styles/sera/tooltip.css +22 -0
  229. package/registry/styles/vega/alert-dialog.css +74 -0
  230. package/registry/styles/vega/alert.css +114 -0
  231. package/registry/styles/vega/badge.css +84 -0
  232. package/registry/styles/vega/button-group.css +75 -0
  233. package/registry/styles/vega/button.css +222 -0
  234. package/registry/styles/vega/card.css +100 -0
  235. package/registry/styles/vega/checkbox.css +53 -0
  236. package/registry/styles/vega/code-block.css +186 -0
  237. package/registry/styles/vega/dialog.css +64 -0
  238. package/registry/styles/vega/dropdown-menu.css +104 -0
  239. package/registry/styles/vega/empty.css +54 -0
  240. package/registry/styles/vega/field.css +120 -0
  241. package/registry/styles/vega/input.css +57 -0
  242. package/registry/styles/vega/item.css +133 -0
  243. package/registry/styles/vega/kbd.css +22 -0
  244. package/registry/styles/vega/label.css +70 -0
  245. package/registry/styles/vega/native-select.css +74 -0
  246. package/registry/styles/vega/popover.css +25 -0
  247. package/registry/styles/vega/primitives/dialog-shell.css +19 -0
  248. package/registry/styles/vega/primitives/popover.css +16 -0
  249. package/registry/styles/vega/radio.css +46 -0
  250. package/registry/styles/vega/skeleton.css +7 -0
  251. package/registry/styles/vega/switch.css +82 -0
  252. package/registry/styles/vega/table.css +87 -0
  253. package/registry/styles/vega/tabs.css +133 -0
  254. package/registry/styles/vega/textarea.css +49 -0
  255. package/registry/styles/vega/tooltip.css +22 -0
  256. package/registry/tokens.css +116 -130
@@ -0,0 +1,22 @@
1
+ /* Kbd */
2
+ @layer loseta.style {
3
+ .kbd {
4
+ height: 1.375rem;
5
+ width: fit-content;
6
+ min-width: 1.25rem;
7
+ gap: 0.25rem;
8
+ border-radius: var(--radius-lg);
9
+ background-color: var(--muted);
10
+ padding-inline: 0.375rem;
11
+ font-family: inherit;
12
+ font-size: var(--text-xs);
13
+ line-height: var(--text-xs--line-height);
14
+ font-weight: 500;
15
+ color: var(--muted-foreground);
16
+
17
+ & svg {
18
+ width: var(--icon-size, 0.75rem);
19
+ height: var(--icon-size, 0.75rem);
20
+ }
21
+ }
22
+ }
@@ -0,0 +1,70 @@
1
+ /* Label */
2
+ @layer loseta.style {
3
+ :is(.field > label, .field > section > label, label:has(> .field), .label) {
4
+ gap: 0.5rem;
5
+ font-size: var(--text-sm);
6
+ font-weight: 500;
7
+
8
+ &:has(> :disabled),
9
+ &:has(+ :disabled),
10
+ &:has(~ :disabled),
11
+ :where([aria-disabled='true']) & {
12
+ opacity: 50%;
13
+ }
14
+ }
15
+
16
+ :is(.field > label, .field > section > label, label:has(> .field)) {
17
+ line-height: 1.375;
18
+ }
19
+
20
+ .label {
21
+ line-height: 1;
22
+ }
23
+
24
+ :is(.field > label, label:has(> .field)):has(> .field) {
25
+ border-radius: var(--radius-2xl);
26
+ border-style: solid;
27
+ border-width: 1px;
28
+ border-color: var(--border);
29
+
30
+ &:has(*:is(:checked)) {
31
+ border-color: light-dark(
32
+ color-mix(in oklab, var(--primary) 30%, transparent),
33
+ color-mix(in oklab, var(--primary) 20%, transparent)
34
+ );
35
+ background-color: light-dark(
36
+ color-mix(in oklab, var(--primary) 5%, transparent),
37
+ color-mix(in oklab, var(--primary) 10%, transparent)
38
+ );
39
+ }
40
+
41
+ &:has(:focus-visible) {
42
+ border-color: var(--ring);
43
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
44
+ }
45
+
46
+ &:not(:has(:disabled, [aria-disabled='true'])):hover {
47
+ background-color: color-mix(in oklab, var(--muted) 50%, transparent);
48
+ }
49
+ }
50
+
51
+ :is(.field > label, label:has(> .field)) > .field {
52
+ padding: 1rem;
53
+ }
54
+
55
+ :is(.field > label, label:has(> .field)):has(> .field) :is(.checkbox, .radio, .switch):focus-visible {
56
+ box-shadow: none;
57
+ }
58
+
59
+ :is(.field > label, label:has(> .field)):has(> .field) :is(.checkbox, .radio):focus-visible:not(:checked) {
60
+ border-color: var(--input);
61
+ }
62
+
63
+ :is(.field > label, label:has(> .field)):has(> .field) :is(.checkbox, .radio):focus-visible:checked {
64
+ border-color: var(--primary);
65
+ }
66
+
67
+ :is(.field > label, label:has(> .field)):has(> .field) .switch:focus-visible {
68
+ border-color: transparent;
69
+ }
70
+ }
@@ -0,0 +1,73 @@
1
+ /* Native Select */
2
+ @layer loseta.style {
3
+ .native-select {
4
+ height: 2.25rem;
5
+ width: fit-content;
6
+ border-radius: var(--radius-3xl);
7
+ border-style: solid;
8
+ border-width: 1px;
9
+ border-color: var(--input);
10
+ background-color: light-dark(
11
+ transparent,
12
+ color-mix(in oklab, var(--input) 30%, transparent)
13
+ );
14
+ padding-block: 0.25rem;
15
+ padding-inline-start: 0.75rem;
16
+ padding-inline-end: 2rem;
17
+ font-size: var(--text-sm);
18
+ line-height: var(--text-sm--line-height);
19
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke;
20
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
21
+ transition-duration: 150ms;
22
+
23
+ & *::selection {
24
+ background-color: var(--primary);
25
+ color: var(--primary-foreground);
26
+ }
27
+
28
+ &::selection {
29
+ background-color: var(--primary);
30
+ color: var(--primary-foreground);
31
+ }
32
+
33
+ &::placeholder {
34
+ color: var(--muted-foreground);
35
+ }
36
+
37
+ &:focus-visible {
38
+ border-color: var(--ring);
39
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
40
+ }
41
+
42
+ &[aria-invalid='true'] {
43
+ border-color: light-dark(
44
+ var(--destructive),
45
+ color-mix(in oklab, var(--destructive) 50%, transparent)
46
+ );
47
+ box-shadow: 0 0 0 3px light-dark(
48
+ color-mix(in oklab, var(--destructive) 20%, transparent),
49
+ color-mix(in oklab, var(--destructive) 40%, transparent)
50
+ );
51
+ }
52
+
53
+ &:hover {
54
+ background-color: light-dark(
55
+ transparent,
56
+ color-mix(in oklab, var(--input) 50%, transparent)
57
+ );
58
+ }
59
+
60
+ &[data-size='sm'] {
61
+ height: 2rem;
62
+ }
63
+
64
+ background-image: var(--chevron-down-icon);
65
+ background-size: 1rem;
66
+ background-position: center right 0.625rem;
67
+ background-repeat: no-repeat;
68
+ }
69
+
70
+ .native-select:dir(rtl) {
71
+ background-position: center left 0.625rem;
72
+ }
73
+ }
@@ -0,0 +1,25 @@
1
+ /* Popover */
2
+ @layer loseta.style {
3
+ .popover > [data-popover] {
4
+ width: 18rem;
5
+ }
6
+
7
+ .popover > [data-popover] > header,
8
+ .popover > [data-popover] > [data-slot='header'] {
9
+ display: flex;
10
+ flex-direction: column;
11
+ gap: 0.25rem;
12
+ font-size: var(--text-sm);
13
+ line-height: var(--text-sm--line-height);
14
+ }
15
+
16
+ .popover > [data-popover] > header > :is(h1, h2, h3, h4, h5, h6),
17
+ .popover > [data-popover] > :is(h1, h2, h3, h4, h5, h6, [data-slot='title']) {
18
+ font-weight: 500;
19
+ }
20
+
21
+ .popover > [data-popover] > header > p,
22
+ .popover > [data-popover] > [data-slot='description'] {
23
+ color: var(--muted-foreground);
24
+ }
25
+ }
@@ -0,0 +1,19 @@
1
+ /* Dialog shell */
2
+ @layer loseta.style {
3
+ .dialog::backdrop,
4
+ .alert-dialog::backdrop {
5
+ background-color: color-mix(in oklab, #000 10%, transparent);
6
+ -webkit-backdrop-filter: blur(4px);
7
+ backdrop-filter: blur(4px);
8
+ transition-duration: 100ms;
9
+ }
10
+
11
+ :is(.dialog, .alert-dialog) > * > footer {
12
+ margin-inline: 0;
13
+ margin-bottom: 0;
14
+ gap: 0.5rem;
15
+ border-top-width: 0;
16
+ background-color: transparent;
17
+ padding: 0;
18
+ }
19
+ }
@@ -0,0 +1,16 @@
1
+ /* Popover primitive */
2
+ @layer loseta.style {
3
+ [data-popover] {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 1rem;
7
+ border-radius: var(--radius-3xl);
8
+ background-color: var(--popover);
9
+ padding: 1rem;
10
+ font-size: var(--text-sm);
11
+ line-height: var(--text-sm--line-height);
12
+ color: var(--popover-foreground);
13
+ box-shadow: 0 0 0 1px color-mix(in oklab, var(--foreground) 10%, transparent), var(--shadow-lg);
14
+ transition-duration: 100ms;
15
+ }
16
+ }
@@ -1,11 +1,15 @@
1
1
  /* Radio */
2
- @layer loseta.theme {
2
+ @layer loseta.style {
3
3
  .radio {
4
4
  display: flex;
5
5
  width: 1rem;
6
6
  height: 1rem;
7
7
  border-radius: var(--radius-full);
8
8
  border-color: var(--input);
9
+ background-color: light-dark(
10
+ transparent,
11
+ color-mix(in oklab, var(--input) 30%, transparent)
12
+ );
9
13
 
10
14
  &:checked {
11
15
  border-color: var(--primary);
@@ -19,30 +23,19 @@
19
23
  }
20
24
 
21
25
  &[aria-invalid='true'] {
22
- border-color: var(--destructive);
23
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
26
+ border-color: light-dark(
27
+ var(--destructive),
28
+ color-mix(in oklab, var(--destructive) 50%, transparent)
29
+ );
30
+ box-shadow: 0 0 0 3px light-dark(
31
+ color-mix(in oklab, var(--destructive) 20%, transparent),
32
+ color-mix(in oklab, var(--destructive) 40%, transparent)
33
+ );
24
34
 
25
35
  &:checked {
26
36
  border-color: var(--primary);
27
37
  }
28
38
  }
29
-
30
- &:is(html.dark *) {
31
- background-color: color-mix(in oklab, var(--input) 30%, transparent);
32
-
33
- &:checked {
34
- background-color: var(--primary);
35
- }
36
-
37
- &[aria-invalid='true'] {
38
- border-color: color-mix(in oklab, var(--destructive) 50%, transparent);
39
- box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 40%, transparent);
40
-
41
- &:checked {
42
- border-color: var(--primary);
43
- }
44
- }
45
- }
46
39
  }
47
40
 
48
41
  .radio:checked::before {
@@ -1,5 +1,5 @@
1
1
  /* Skeleton */
2
- @layer loseta.theme {
2
+ @layer loseta.style {
3
3
  .skeleton {
4
4
  border-radius: var(--radius-md);
5
5
  background-color: var(--muted);
@@ -0,0 +1,81 @@
1
+ /* Switch */
2
+ @layer loseta.style {
3
+ .switch {
4
+ border-radius: var(--radius-full);
5
+ border-style: solid;
6
+ border-width: 1px;
7
+ border-color: transparent;
8
+
9
+ &:not(:checked) {
10
+ background-color: light-dark(
11
+ var(--input),
12
+ color-mix(in oklab, var(--input) 80%, transparent)
13
+ );
14
+ }
15
+
16
+ &:checked {
17
+ background-color: var(--primary);
18
+ }
19
+
20
+ &:focus-visible {
21
+ border-color: var(--ring);
22
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
23
+ }
24
+
25
+ &[aria-invalid='true'] {
26
+ border-color: light-dark(
27
+ var(--destructive),
28
+ color-mix(in oklab, var(--destructive) 50%, transparent)
29
+ );
30
+ box-shadow: 0 0 0 3px light-dark(
31
+ color-mix(in oklab, var(--destructive) 20%, transparent),
32
+ color-mix(in oklab, var(--destructive) 40%, transparent)
33
+ );
34
+ }
35
+
36
+ &:not([data-size='sm']) {
37
+ height: 20px;
38
+ width: 44px;
39
+ }
40
+
41
+ &[data-size='sm'] {
42
+ height: 16px;
43
+ width: 28px;
44
+ }
45
+
46
+ &:before {
47
+ border-radius: var(--radius-full);
48
+ background-color: light-dark(var(--background), var(--foreground));
49
+ }
50
+
51
+ &:checked:before {
52
+ background-color: light-dark(var(--background), var(--primary-foreground));
53
+ }
54
+
55
+ &:not([data-size='sm']):before {
56
+ width: 1.5rem;
57
+ height: 1rem;
58
+ }
59
+
60
+ &[data-size='sm']:before {
61
+ width: 1rem;
62
+ height: 0.75rem;
63
+ }
64
+
65
+ &:checked:not([data-size='sm']):before {
66
+ translate: calc(100% - 8px);
67
+ }
68
+
69
+ &:checked[data-size='sm']:before {
70
+ translate: calc(100% - 8px);
71
+ }
72
+
73
+ &:dir(rtl):checked:not([data-size='sm']):before {
74
+ translate: calc(calc(100% - 2px) * -1);
75
+ }
76
+
77
+ &:dir(rtl):checked[data-size='sm']:before {
78
+ translate: calc(calc(100% - 2px) * -1);
79
+ }
80
+ }
81
+ }
@@ -0,0 +1,87 @@
1
+ /* Table */
2
+ @layer loseta.style {
3
+ .table {
4
+ width: 100%;
5
+ caption-side: bottom;
6
+ color: var(--foreground);
7
+ font-size: var(--text-sm);
8
+ line-height: var(--text-sm--line-height);
9
+
10
+ thead {
11
+ & tr {
12
+ border-bottom-style: solid;
13
+ border-bottom-width: 1px;
14
+ }
15
+ }
16
+
17
+ tbody {
18
+ & tr:last-child {
19
+ border-style: solid;
20
+ border-width: 0px;
21
+ }
22
+ }
23
+
24
+ tfoot {
25
+ border-top-style: solid;
26
+ border-top-width: 1px;
27
+ border-top-color: var(--border);
28
+ background-color: color-mix(in oklab, var(--muted) 50%, transparent);
29
+ font-weight: 500;
30
+
31
+ > tr {
32
+ &:last-child {
33
+ border-bottom-style: solid;
34
+ border-bottom-width: 0px;
35
+ }
36
+ }
37
+ }
38
+
39
+ tr {
40
+ border-bottom-style: solid;
41
+ border-bottom-width: 1px;
42
+ border-bottom-color: var(--border);
43
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke;
44
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
45
+ transition-duration: 150ms;
46
+
47
+ &:hover {
48
+ background-color: color-mix(in oklab, var(--muted) 50%, transparent);
49
+ }
50
+
51
+ &[aria-selected='true'] {
52
+ background-color: var(--muted);
53
+ }
54
+ }
55
+
56
+ th {
57
+ height: 3rem;
58
+ padding: 0 0.75rem;
59
+ text-align: start;
60
+ vertical-align: middle;
61
+ font-weight: 500;
62
+ white-space: nowrap;
63
+ color: var(--foreground);
64
+
65
+ &:has([role='checkbox']) {
66
+ padding-inline-end: 0;
67
+ }
68
+ }
69
+
70
+ td {
71
+ padding: 0.75rem;
72
+ vertical-align: middle;
73
+ white-space: nowrap;
74
+
75
+ &:has([role='checkbox']) {
76
+ padding-inline-end: 0;
77
+ }
78
+ }
79
+
80
+ caption {
81
+ margin-top: 1rem;
82
+ font-size: var(--text-sm);
83
+ line-height: var(--text-sm--line-height);
84
+ color: var(--muted-foreground);
85
+ }
86
+ }
87
+ }
@@ -0,0 +1,133 @@
1
+ /* Tabs */
2
+ @layer loseta.style {
3
+ .tabs {
4
+ gap: 0.5rem;
5
+
6
+ > [role='tablist'] {
7
+ height: 2.25rem;
8
+ border-radius: var(--radius-full);
9
+ padding: 0.25rem;
10
+
11
+ &:not([data-variant='line']) {
12
+ background-color: var(--muted);
13
+ }
14
+
15
+ &[data-variant='line'] {
16
+ gap: 0.25rem;
17
+ border-radius: 0;
18
+ background-color: transparent;
19
+ }
20
+
21
+ &[aria-orientation='vertical'] {
22
+ height: fit-content;
23
+ }
24
+
25
+ > [role='tab'] {
26
+ height: calc(100% - 1px);
27
+ gap: 0.5rem;
28
+ border-radius: var(--radius-full);
29
+ border-style: solid;
30
+ border-width: 1px;
31
+ border-color: transparent;
32
+ padding-inline: 0.75rem;
33
+ padding-block: 0.25rem;
34
+ font-size: var(--text-sm);
35
+ line-height: var(--text-sm--line-height);
36
+ font-weight: 500;
37
+ color: light-dark(
38
+ color-mix(in oklab, var(--foreground) 60%, transparent),
39
+ var(--muted-foreground)
40
+ );
41
+
42
+ &:hover {
43
+ color: var(--foreground);
44
+ }
45
+
46
+ &:focus-visible {
47
+ border-color: var(--ring);
48
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
49
+ outline-style: solid;
50
+ outline-width: 1px;
51
+ outline-color: var(--ring);
52
+ }
53
+
54
+ & svg {
55
+ width: var(--icon-size, 1rem);
56
+ height: var(--icon-size, 1rem);
57
+ }
58
+ &::after {
59
+ position: absolute;
60
+ background-color: var(--foreground);
61
+ opacity: 0%;
62
+ content: '';
63
+ transition-property: opacity;
64
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
65
+ transition-duration: 150ms;
66
+ }
67
+ }
68
+
69
+ &[aria-orientation='vertical'] > [role='tab'] {
70
+ width: 100%;
71
+ justify-content: flex-start;
72
+ }
73
+
74
+ &[data-variant='line'][aria-orientation='horizontal'] > [role='tab'] {
75
+ background-color: transparent;
76
+ box-shadow: none;
77
+
78
+ &::after {
79
+ inset-inline: 0;
80
+ bottom: -5px;
81
+ content: '';
82
+ height: 0.125rem;
83
+ }
84
+ }
85
+
86
+ &[data-variant='line'][aria-orientation='vertical'] > [role='tab'] {
87
+ background-color: transparent;
88
+ box-shadow: none;
89
+
90
+ &::after {
91
+ inset-block: 0;
92
+ inset-inline-end: -4px;
93
+ content: '';
94
+ width: 0.125rem;
95
+ }
96
+ }
97
+
98
+ &:not([data-variant='line']) > [role='tab'][aria-selected='true'] {
99
+ border-color: light-dark(transparent, var(--input));
100
+ background-color: light-dark(
101
+ var(--background),
102
+ color-mix(in oklab, var(--input) 30%, transparent)
103
+ );
104
+ color: var(--foreground);
105
+ box-shadow: var(--shadow-sm);
106
+ }
107
+
108
+ &[data-variant='line'] > [role='tab'][aria-selected='true'] {
109
+ background-color: transparent;
110
+ color: var(--foreground);
111
+ box-shadow: none;
112
+
113
+ &::after {
114
+ content: '';
115
+ opacity: 100%;
116
+ }
117
+ }
118
+
119
+ > [role='tab']:has(> svg:first-child) {
120
+ padding-inline-start: 0.25rem;
121
+ }
122
+
123
+ > [role='tab']:has(> svg:last-child) {
124
+ padding-inline-end: 0.25rem;
125
+ }
126
+ }
127
+
128
+ > [role='tabpanel'] {
129
+ font-size: var(--text-sm);
130
+ line-height: var(--text-sm--line-height);
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,48 @@
1
+ /* Textarea */
2
+ @layer loseta.style {
3
+ .textarea {
4
+ border-radius: var(--radius-2xl);
5
+ border-style: solid;
6
+ border-width: 1px;
7
+ border-color: var(--input);
8
+ background-color: light-dark(
9
+ transparent,
10
+ color-mix(in oklab, var(--input) 30%, transparent)
11
+ );
12
+ padding-inline: 0.75rem;
13
+ padding-block: 0.75rem;
14
+ font-size: var(--text-base);
15
+ line-height: 1.5;
16
+ transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke;
17
+ transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
18
+ transition-duration: 150ms;
19
+
20
+ &:focus-visible {
21
+ border-color: var(--ring);
22
+ box-shadow: 0 0 0 3px color-mix(in oklab, var(--ring) 50%, transparent);
23
+ }
24
+
25
+ &:disabled {
26
+ background-color: light-dark(
27
+ color-mix(in oklab, var(--input) 50%, transparent),
28
+ color-mix(in oklab, var(--input) 80%, transparent)
29
+ );
30
+ }
31
+
32
+ &[aria-invalid='true'] {
33
+ border-color: light-dark(
34
+ var(--destructive),
35
+ color-mix(in oklab, var(--destructive) 50%, transparent)
36
+ );
37
+ box-shadow: 0 0 0 3px light-dark(
38
+ color-mix(in oklab, var(--destructive) 20%, transparent),
39
+ color-mix(in oklab, var(--destructive) 40%, transparent)
40
+ );
41
+ }
42
+
43
+ @media (width >= 48rem) {
44
+ font-size: var(--text-sm);
45
+ line-height: var(--text-sm--line-height);
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,22 @@
1
+ /* Tooltip */
2
+ @layer loseta.style {
3
+ .tooltip[data-tooltip] {
4
+ &::before {
5
+ display: inline-flex;
6
+ align-items: center;
7
+ gap: 0.375rem;
8
+ border-radius: var(--radius-xl);
9
+ background-color: var(--foreground);
10
+ padding-inline: 0.75rem;
11
+ padding-block: 0.375rem;
12
+ font-size: var(--text-xs);
13
+ line-height: var(--text-xs--line-height);
14
+ color: var(--background);
15
+ }
16
+
17
+ &[data-arrow]::after {
18
+ border-radius: 2px;
19
+ background-color: var(--foreground);
20
+ }
21
+ }
22
+ }