luxen-ui 0.2.1 → 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 (70) hide show
  1. package/cdn/chunks/decorate.js +1 -1
  2. package/cdn/chunks/decorate.js.map +1 -1
  3. package/cdn/custom-elements.json +185 -112
  4. package/cdn/elements/avatar/avatar.js +1 -1
  5. package/cdn/elements/avatar/avatar.js.map +1 -1
  6. package/cdn/elements/badge/badge.js +1 -1
  7. package/cdn/elements/carousel/carousel.d.ts +9 -1
  8. package/cdn/elements/carousel/carousel.d.ts.map +1 -1
  9. package/cdn/elements/carousel/carousel.js +21 -20
  10. package/cdn/elements/carousel/carousel.js.map +1 -1
  11. package/cdn/elements/dialog/dialog.js +1 -1
  12. package/cdn/elements/dialog/dialog.styles.js +1 -1
  13. package/cdn/elements/dialog/dialog.styles.js.map +1 -1
  14. package/cdn/elements/divider/divider.js +1 -1
  15. package/cdn/elements/drawer/drawer.js +1 -1
  16. package/cdn/elements/dropdown/dropdown.d.ts +5 -2
  17. package/cdn/elements/dropdown/dropdown.d.ts.map +1 -1
  18. package/cdn/elements/dropdown/dropdown.js +6 -3
  19. package/cdn/elements/dropdown/dropdown.js.map +1 -1
  20. package/cdn/elements/dropdown-item/dropdown-item.js +1 -1
  21. package/cdn/elements/dropdown-item/dropdown-item.js.map +1 -1
  22. package/cdn/elements/icon/icon.js +1 -1
  23. package/cdn/elements/input-otp/input-otp.d.ts +8 -2
  24. package/cdn/elements/input-otp/input-otp.d.ts.map +1 -1
  25. package/cdn/elements/input-otp/input-otp.js +1 -1
  26. package/cdn/elements/input-otp/input-otp.js.map +1 -1
  27. package/cdn/elements/input-stepper/input-stepper.js +1 -1
  28. package/cdn/elements/popover/popover.js +1 -1
  29. package/cdn/elements/popover/popover.js.map +1 -1
  30. package/cdn/elements/rating/rating.js +1 -1
  31. package/cdn/elements/tabs/tabs.js +1 -1
  32. package/cdn/elements/toast/toast.js +1 -1
  33. package/cdn/elements/toast/toast.js.map +1 -1
  34. package/cdn/elements/tooltip/tooltip.d.ts +3 -3
  35. package/cdn/elements/tooltip/tooltip.js +1 -1
  36. package/cdn/elements/tooltip/tooltip.js.map +1 -1
  37. package/cdn/elements/tree/tree.js +1 -1
  38. package/cdn/elements/tree/tree.js.map +1 -1
  39. package/cdn/elements/tree-item/tree-item.js +1 -1
  40. package/cdn/elements/tree-item/tree-item.js.map +1 -1
  41. package/cdn/shared/luxen-form-associated-element.js +1 -1
  42. package/cdn/styles/elements/divider.css +7 -0
  43. package/cdn/styles/elements/input-otp.css +63 -29
  44. package/cdn/styles/elements/select.css +3 -3
  45. package/cdn/styles/index.css +10 -0
  46. package/dist/css/elements/divider.css +7 -0
  47. package/dist/css/elements/input-otp.css +63 -29
  48. package/dist/css/elements/select.css +3 -3
  49. package/dist/css/index.css +10 -0
  50. package/dist/custom-elements.json +185 -112
  51. package/dist/elements/avatar/avatar.css +13 -7
  52. package/dist/elements/carousel/carousel.css +7 -0
  53. package/dist/elements/carousel/carousel.d.ts +9 -1
  54. package/dist/elements/carousel/carousel.d.ts.map +1 -1
  55. package/dist/elements/carousel/carousel.js +71 -37
  56. package/dist/elements/dialog/dialog.css +10 -0
  57. package/dist/elements/dropdown/dropdown.css +14 -3
  58. package/dist/elements/dropdown/dropdown.d.ts +5 -2
  59. package/dist/elements/dropdown/dropdown.d.ts.map +1 -1
  60. package/dist/elements/dropdown/dropdown.js +19 -7
  61. package/dist/elements/input-otp/input-otp.d.ts +8 -2
  62. package/dist/elements/input-otp/input-otp.d.ts.map +1 -1
  63. package/dist/elements/input-otp/input-otp.js +14 -5
  64. package/dist/elements/tooltip/tooltip.css +15 -7
  65. package/dist/elements/tooltip/tooltip.d.ts +3 -3
  66. package/dist/elements/tooltip/tooltip.js +3 -3
  67. package/dist/skills/luxen-ui/references/dialog.md +76 -0
  68. package/dist/skills/luxen-ui/references/drawer.md +8 -0
  69. package/dist/skills/luxen-ui/references/select.md +1 -1
  70. package/package.json +1 -1
@@ -15,13 +15,14 @@
15
15
 
16
16
  l-input-otp {
17
17
  --digits: 6;
18
- --size: 2.75rem;
19
- --_font-size: calc(var(--size) * 0.45);
20
- --_bg: color-mix(in oklab, var(--l-color-text-primary) 4%, var(--l-color-surface));
21
- --_border-color: var(--l-color-border);
22
- --_highlight-color: var(--l-focus-ring);
18
+ --cell-size: 2.75rem;
19
+ --cell-bg-color: color-mix(in oklab, var(--l-color-text-primary) 4%, var(--l-color-surface));
20
+ --cell-border-color: var(--l-color-border);
21
+ --cell-border-radius: var(--radius-md);
22
+ --cell-focus-color: var(--l-focus-ring);
23
+ --cell-focus-ring: 0 0 0 1px var(--cell-focus-color);
23
24
 
24
- display: inline-flex;
25
+ display: inline-block;
25
26
  position: relative;
26
27
  }
27
28
 
@@ -34,7 +35,7 @@
34
35
  .l-input-otp-cells {
35
36
  display: inline-flex;
36
37
  align-items: center;
37
- gap: var(--gap, 0.5rem);
38
+ gap: var(--cell-gap, 0.5rem);
38
39
  position: relative;
39
40
  }
40
41
 
@@ -48,15 +49,15 @@
48
49
  display: flex;
49
50
  align-items: center;
50
51
  justify-content: center;
51
- inline-size: var(--size);
52
- block-size: var(--size);
53
- border: 1px solid var(--_border-color);
54
- border-radius: var(--radius-md);
55
- background: var(--_bg);
52
+ inline-size: var(--cell-size);
53
+ block-size: var(--cell-size);
54
+ border: 1px solid var(--cell-border-color);
55
+ border-radius: var(--cell-border-radius);
56
+ background: var(--cell-bg-color);
56
57
  font-family:
57
58
  ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono',
58
59
  monospace;
59
- font-size: var(--_font-size);
60
+ font-size: calc(var(--cell-size) * 0.45);
60
61
  font-variant-numeric: tabular-nums;
61
62
  line-height: 1;
62
63
  color: var(--l-color-text-primary);
@@ -73,8 +74,37 @@
73
74
  */
74
75
 
75
76
  l-input-otp:focus-within .l-input-otp-cell[data-active] {
76
- border-color: var(--_highlight-color);
77
- box-shadow: 0 0 0 1px var(--_highlight-color);
77
+ border-color: var(--cell-focus-color);
78
+ box-shadow: var(--cell-focus-ring);
79
+ }
80
+
81
+ /*
82
+ ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
83
+ 🅲🅰🆁🅴🆃 (fake blinking caret in active empty cell)
84
+ ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
85
+ The native caret is hidden via `caret-color: transparent`; this stand-in
86
+ gives the missing point-of-insertion cue inside the active cell. Only
87
+ visible while empty — once a digit is typed, it replaces the caret.
88
+ */
89
+
90
+ l-input-otp:focus-within .l-input-otp-cell[data-active]:not([data-filled])::after {
91
+ content: '';
92
+ inline-size: 1px;
93
+ block-size: 1em;
94
+ background: currentColor;
95
+ animation: l-input-otp-caret 1s steps(2, jump-none) infinite;
96
+ }
97
+
98
+ @keyframes l-input-otp-caret {
99
+ 50% {
100
+ opacity: 0;
101
+ }
102
+ }
103
+
104
+ @media (prefers-reduced-motion: reduce) {
105
+ l-input-otp:focus-within .l-input-otp-cell[data-active]:not([data-filled])::after {
106
+ animation: none;
107
+ }
78
108
  }
79
109
 
80
110
  /*
@@ -122,11 +152,11 @@
122
152
  */
123
153
 
124
154
  l-input-otp[size='sm'] {
125
- --size: 2rem;
155
+ --cell-size: 2rem;
126
156
  }
127
157
 
128
158
  l-input-otp[size='lg'] {
129
- --size: 3.5rem;
159
+ --cell-size: 3.5rem;
130
160
  }
131
161
 
132
162
  /*
@@ -145,20 +175,24 @@
145
175
  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
146
176
  🅿🆁🅾🅶🆁🅴🆂🆂🅸🆅🅴 🅴🅽🅷🅰🅽🅲🅴🅼🅴🅽🆃 🅵🅰🅻🅻🅱🅰🅲🅺
147
177
  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
148
- Before JS loads, the raw input is visible and usable.
178
+ Pre-upgrade reserves the exact box the cells will occupy width scales
179
+ with --digits / --cell-size / --cell-gap so layout doesn't shift on hydration.
180
+ Single soft-tinted rectangle (not per-cell): matches any custom appearance
181
+ cleanly since it doesn't pretend to redraw the cell layout.
149
182
  */
150
183
 
151
- l-input-otp:not(:defined) > input {
152
- all: unset;
184
+ l-input-otp:not(:defined) {
153
185
  display: inline-block;
154
- border: 1px solid var(--l-color-border);
155
- border-radius: var(--radius-md);
156
- padding: 0.5rem 0.75rem;
157
- font-family:
158
- ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono',
159
- monospace;
160
- font-size: 1.25rem;
161
- letter-spacing: 0.5ch;
162
- color: var(--l-color-text-primary);
186
+ flex-shrink: 0;
187
+ inline-size: calc(
188
+ var(--cell-size) * var(--digits) + var(--cell-gap, 0.5rem) * (var(--digits) - 1)
189
+ );
190
+ block-size: var(--cell-size);
191
+ background: var(--cell-bg-color);
192
+ border-radius: var(--cell-border-radius);
193
+ }
194
+
195
+ l-input-otp:not(:defined) > input {
196
+ display: none;
163
197
  }
164
198
  }
@@ -1,6 +1,6 @@
1
1
  @layer components {
2
2
  .l-select {
3
- --radius: 4px;
3
+ --border-radius: 4px;
4
4
  --border-color: light-dark(var(--color-gray-200), var(--color-gray-800));
5
5
 
6
6
  &,
@@ -14,7 +14,7 @@
14
14
 
15
15
  &::picker(select) {
16
16
  border: 1px solid var(--border-color);
17
- border-radius: var(--radius);
17
+ border-radius: var(--border-radius);
18
18
  min-width: 180px;
19
19
  margin-block-start: 0.25rem;
20
20
  padding: 4px;
@@ -50,7 +50,7 @@
50
50
  padding-block: 6px;
51
51
  isolation: isolate;
52
52
  cursor: pointer;
53
- border-radius: var(--radius);
53
+ border-radius: var(--border-radius);
54
54
 
55
55
  &::checkmark {
56
56
  background-color: currentColor;
@@ -707,6 +707,16 @@ In dark mode, mixes the base color with black (default 15% black).
707
707
  white-space: nowrap;
708
708
  border: 0;
709
709
  }
710
+
711
+ /* Hide Shadow-DOM overlay elements until their custom element upgrades.
712
+ Without this, slotted/inner content flashes inline before the upgrade. */
713
+ l-dialog:not(:defined),
714
+ l-drawer:not(:defined),
715
+ l-dropdown:not(:defined),
716
+ l-popover:not(:defined),
717
+ l-tooltip:not(:defined) {
718
+ display: none;
719
+ }
710
720
  }
711
721
 
712
722
  /* https://github.com/tailwindlabs/tailwindcss/blob/main/packages/tailwindcss/theme.css */
@@ -52,6 +52,13 @@
52
52
  padding-inline: var(--spacing-2, 0.5rem);
53
53
  }
54
54
 
55
+ /* Compact form when slotted into <l-dropdown>: bleed to panel edges, tighten spacing. */
56
+ l-dropdown l-divider:not([orientation='vertical']) {
57
+ margin-block: var(--padding, 0.25rem);
58
+ margin-inline: calc(var(--padding, 0.25rem) * -1);
59
+ width: auto;
60
+ }
61
+
55
62
  /*
56
63
  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
57
64
  vertical
@@ -15,13 +15,14 @@
15
15
 
16
16
  l-input-otp {
17
17
  --digits: 6;
18
- --size: 2.75rem;
19
- --_font-size: calc(var(--size) * 0.45);
20
- --_bg: color-mix(in oklab, var(--l-color-text-primary) 4%, var(--l-color-surface));
21
- --_border-color: var(--l-color-border);
22
- --_highlight-color: var(--l-focus-ring);
18
+ --cell-size: 2.75rem;
19
+ --cell-bg-color: color-mix(in oklab, var(--l-color-text-primary) 4%, var(--l-color-surface));
20
+ --cell-border-color: var(--l-color-border);
21
+ --cell-border-radius: var(--radius-md);
22
+ --cell-focus-color: var(--l-focus-ring);
23
+ --cell-focus-ring: 0 0 0 1px var(--cell-focus-color);
23
24
 
24
- display: inline-flex;
25
+ display: inline-block;
25
26
  position: relative;
26
27
  }
27
28
 
@@ -34,7 +35,7 @@
34
35
  .l-input-otp-cells {
35
36
  display: inline-flex;
36
37
  align-items: center;
37
- gap: var(--gap, 0.5rem);
38
+ gap: var(--cell-gap, 0.5rem);
38
39
  position: relative;
39
40
  }
40
41
 
@@ -48,15 +49,15 @@
48
49
  display: flex;
49
50
  align-items: center;
50
51
  justify-content: center;
51
- inline-size: var(--size);
52
- block-size: var(--size);
53
- border: 1px solid var(--_border-color);
54
- border-radius: var(--radius-md);
55
- background: var(--_bg);
52
+ inline-size: var(--cell-size);
53
+ block-size: var(--cell-size);
54
+ border: 1px solid var(--cell-border-color);
55
+ border-radius: var(--cell-border-radius);
56
+ background: var(--cell-bg-color);
56
57
  font-family:
57
58
  ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono',
58
59
  monospace;
59
- font-size: var(--_font-size);
60
+ font-size: calc(var(--cell-size) * 0.45);
60
61
  font-variant-numeric: tabular-nums;
61
62
  line-height: 1;
62
63
  color: var(--l-color-text-primary);
@@ -73,8 +74,37 @@
73
74
  */
74
75
 
75
76
  l-input-otp:focus-within .l-input-otp-cell[data-active] {
76
- border-color: var(--_highlight-color);
77
- box-shadow: 0 0 0 1px var(--_highlight-color);
77
+ border-color: var(--cell-focus-color);
78
+ box-shadow: var(--cell-focus-ring);
79
+ }
80
+
81
+ /*
82
+ ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
83
+ 🅲🅰🆁🅴🆃 (fake blinking caret in active empty cell)
84
+ ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
85
+ The native caret is hidden via `caret-color: transparent`; this stand-in
86
+ gives the missing point-of-insertion cue inside the active cell. Only
87
+ visible while empty — once a digit is typed, it replaces the caret.
88
+ */
89
+
90
+ l-input-otp:focus-within .l-input-otp-cell[data-active]:not([data-filled])::after {
91
+ content: '';
92
+ inline-size: 1px;
93
+ block-size: 1em;
94
+ background: currentColor;
95
+ animation: l-input-otp-caret 1s steps(2, jump-none) infinite;
96
+ }
97
+
98
+ @keyframes l-input-otp-caret {
99
+ 50% {
100
+ opacity: 0;
101
+ }
102
+ }
103
+
104
+ @media (prefers-reduced-motion: reduce) {
105
+ l-input-otp:focus-within .l-input-otp-cell[data-active]:not([data-filled])::after {
106
+ animation: none;
107
+ }
78
108
  }
79
109
 
80
110
  /*
@@ -122,11 +152,11 @@
122
152
  */
123
153
 
124
154
  l-input-otp[size='sm'] {
125
- --size: 2rem;
155
+ --cell-size: 2rem;
126
156
  }
127
157
 
128
158
  l-input-otp[size='lg'] {
129
- --size: 3.5rem;
159
+ --cell-size: 3.5rem;
130
160
  }
131
161
 
132
162
  /*
@@ -145,20 +175,24 @@
145
175
  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
146
176
  🅿🆁🅾🅶🆁🅴🆂🆂🅸🆅🅴 🅴🅽🅷🅰🅽🅲🅴🅼🅴🅽🆃 🅵🅰🅻🅻🅱🅰🅲🅺
147
177
  ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
148
- Before JS loads, the raw input is visible and usable.
178
+ Pre-upgrade reserves the exact box the cells will occupy width scales
179
+ with --digits / --cell-size / --cell-gap so layout doesn't shift on hydration.
180
+ Single soft-tinted rectangle (not per-cell): matches any custom appearance
181
+ cleanly since it doesn't pretend to redraw the cell layout.
149
182
  */
150
183
 
151
- l-input-otp:not(:defined) > input {
152
- all: unset;
184
+ l-input-otp:not(:defined) {
153
185
  display: inline-block;
154
- border: 1px solid var(--l-color-border);
155
- border-radius: var(--radius-md);
156
- padding: 0.5rem 0.75rem;
157
- font-family:
158
- ui-monospace, 'Cascadia Code', 'Source Code Pro', Menlo, Consolas, 'DejaVu Sans Mono',
159
- monospace;
160
- font-size: 1.25rem;
161
- letter-spacing: 0.5ch;
162
- color: var(--l-color-text-primary);
186
+ flex-shrink: 0;
187
+ inline-size: calc(
188
+ var(--cell-size) * var(--digits) + var(--cell-gap, 0.5rem) * (var(--digits) - 1)
189
+ );
190
+ block-size: var(--cell-size);
191
+ background: var(--cell-bg-color);
192
+ border-radius: var(--cell-border-radius);
193
+ }
194
+
195
+ l-input-otp:not(:defined) > input {
196
+ display: none;
163
197
  }
164
198
  }
@@ -1,6 +1,6 @@
1
1
  @layer components {
2
2
  .l-select {
3
- --radius: 4px;
3
+ --border-radius: 4px;
4
4
  --border-color: light-dark(var(--color-gray-200), var(--color-gray-800));
5
5
 
6
6
  &,
@@ -14,7 +14,7 @@
14
14
 
15
15
  &::picker(select) {
16
16
  border: 1px solid var(--border-color);
17
- border-radius: var(--radius);
17
+ border-radius: var(--border-radius);
18
18
  min-width: 180px;
19
19
  margin-block-start: 0.25rem;
20
20
  padding: 4px;
@@ -50,7 +50,7 @@
50
50
  padding-block: 6px;
51
51
  isolation: isolate;
52
52
  cursor: pointer;
53
- border-radius: var(--radius);
53
+ border-radius: var(--border-radius);
54
54
 
55
55
  &::checkmark {
56
56
  background-color: currentColor;
@@ -707,6 +707,16 @@ In dark mode, mixes the base color with black (default 15% black).
707
707
  white-space: nowrap;
708
708
  border: 0;
709
709
  }
710
+
711
+ /* Hide Shadow-DOM overlay elements until their custom element upgrades.
712
+ Without this, slotted/inner content flashes inline before the upgrade. */
713
+ l-dialog:not(:defined),
714
+ l-drawer:not(:defined),
715
+ l-dropdown:not(:defined),
716
+ l-popover:not(:defined),
717
+ l-tooltip:not(:defined) {
718
+ display: none;
719
+ }
710
720
  }
711
721
 
712
722
  /* https://github.com/tailwindlabs/tailwindcss/blob/main/packages/tailwindcss/theme.css */