@acorex/styles 21.0.3-next.35 → 21.0.3-next.36

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.
@@ -2,14 +2,11 @@
2
2
 
3
3
  @layer base {
4
4
  .ax-editor-container {
5
- @apply h-9 min-h-9 px-3 py-3 text-sm;
5
+ @apply rounded-default relative flex h-default min-h-default items-center justify-between overflow-hidden px-3 py-3 text-sm leading-5;
6
+
6
7
  .ax-content {
7
8
  @apply text-sm;
8
9
  }
9
- }
10
-
11
- .ax-editor-container {
12
- @apply rounded-default relative flex h-9 min-h-9 items-center justify-between overflow-hidden px-3 py-3 text-sm leading-5;
13
10
 
14
11
  .ax-editor-container {
15
12
  @apply p-0;
@@ -30,40 +27,65 @@
30
27
  }
31
28
 
32
29
  &.ax-state-error {
33
- @apply border-danger-600! focus-within:ring-danger-600/30!;
30
+ @apply border-danger-600!;
31
+ &:focus-within {
32
+ @apply outline-2 outline-offset-0 outline-danger-light;
33
+ }
34
34
  }
35
35
 
36
- &:has(.ax-general-button-control, .ax-general-button-icon) {
36
+ /* Keep end padding for spin/clear controls, but not when a suffix button is attached */
37
+ &:has(.ax-general-button-control, .ax-general-button-icon):not(:has(ax-suffix > ax-button)) {
37
38
  @apply pe-2;
38
39
  }
39
40
 
40
- &:has(ax-prefix ax-button) {
41
- @apply ps-0;
41
+ ax-suffix > ax-icon,
42
+ ax-prefix > ax-icon {
43
+ @apply text-muted;
42
44
  }
43
45
 
44
- &:has(ax-suffix ax-button) {
45
- @apply pe-0;
46
+ ax-prefix,
47
+ ax-suffix {
48
+ @apply flex items-center self-stretch gap-2;
46
49
  }
47
50
 
48
- ax-prefix > ax-button {
49
- @apply rounded-e-none!;
51
+ ax-prefix:has(> ax-button),
52
+ ax-suffix:has(> ax-button) {
53
+ @apply items-stretch;
50
54
  }
51
55
 
52
- ax-suffix > ax-button {
53
- @apply rounded-s-none!;
56
+ ax-prefix {
57
+ @apply pe-2;
54
58
  }
59
+ }
60
+ }
55
61
 
56
- ax-suffix > ax-icon,
57
- ax-prefix > ax-icon {
58
- @apply text-muted;
62
+ /* Components layer so these beat button size utilities and spin-button pe-2 */
63
+ @layer components {
64
+ .ax-editor-container {
65
+ &:has(ax-prefix > ax-button),
66
+ &:has(ax-suffix > ax-button) {
67
+ @apply py-0;
59
68
  }
60
69
 
61
- ax-prefix,
62
- ax-suffix {
63
- @apply flex items-center gap-2;
70
+ &:has(ax-prefix > ax-button) {
71
+ @apply ps-0!;
64
72
  }
65
- ax-prefix {
66
- @apply pe-2;
73
+
74
+ &:has(ax-suffix > ax-button) {
75
+ @apply pe-0!;
76
+ }
77
+
78
+ ax-prefix > ax-button,
79
+ ax-suffix > ax-button {
80
+ @apply self-stretch shrink-0 rounded-none!;
81
+
82
+ > button {
83
+ @apply h-full min-h-0 rounded-[inherit]!;
84
+ }
85
+
86
+ &.ax-button-icon > button {
87
+ @apply aspect-square size-auto! h-full w-auto!;
88
+ }
67
89
  }
68
90
  }
69
91
  }
@@ -7,7 +7,9 @@
7
7
  @apply disabled:cursor-not-allowed disabled:opacity-50;
8
8
  @apply text-text-default/50 hover:text-text-default/70;
9
9
  @apply hover:bg-bg-default/10;
10
- @apply focus-visible:ring-primary/30 focus-visible:ring-3 focus-visible:outline-none;
10
+ &:focus-visible {
11
+ @apply ax-focus-ring;
12
+ }
11
13
  * {
12
14
  @apply cursor-[inherit];
13
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex/styles",
3
- "version": "21.0.3-next.35",
3
+ "version": "21.0.3-next.36",
4
4
  "main": "index.css",
5
5
  "author": "Ali Safari",
6
6
  "license": "ISC",
@@ -48,27 +48,13 @@ html.ax-dark {
48
48
  color: rgba(var(--ax-sys-color-on-darkest-surface));
49
49
  }
50
50
 
51
- .ax-xs {
52
- --ax-sys-size: ax-xs;
53
- }
54
- .ax-sm {
55
- --ax-sys-size: ax-sm;
56
- }
57
- .ax-md {
58
- --ax-sys-size: ax-md;
59
- }
60
- .ax-lg {
61
- --ax-sys-size: ax-lg;
62
- }
63
- .ax-xl {
64
- --ax-sys-size: ax-xl;
65
- }
66
-
67
51
  :root {
68
52
  --ax-sys-theme-isDark: 0;
69
53
  --ax-sys-icon-size: 100%;
70
54
  --ax-sys-icon-weight: 400;
71
- --ax-sys-size-base: 2.5rem;
55
+ /* Immutable md control height — size utilities derive --ax-sys-size-base from this */
56
+ --ax-sys-size-md: 2.5rem;
57
+ --ax-sys-size-base: var(--ax-sys-size-md);
72
58
  --ax-overlay-full-width: 93;
73
59
  --ax-sys-icon-width: inherit;
74
60
  --ax-sys-icon-height: inherit;
@@ -1776,6 +1762,9 @@ html.ax-dark {
1776
1762
  --color-text-default: rgba(var(--ax-sys-color-text-default));
1777
1763
  --color-border-default: rgba(var(--ax-sys-color-border-default));
1778
1764
  --radius-default: var(--ax-sys-border-radius);
1765
+ --spacing-default: var(--ax-sys-size-base);
1766
+ --height-default: var(--ax-sys-size-base);
1767
+ --min-height-default: var(--ax-sys-size-base);
1779
1768
  --breakpoint-3xl: 1920px;
1780
1769
  --breakpoint-4xl: 2560px;
1781
1770
  /* Surface Surfaces */
@@ -2245,17 +2234,12 @@ html.ax-dark {
2245
2234
  --color-on-accent6-darkest: rgba(var(--ax-sys-color-on-accent6-darkest-surface));
2246
2235
  --color-border-accent6-darkest: rgba(var(--ax-sys-color-border-accent6-darkest-surface));
2247
2236
 
2248
- /* Default scale (matches ax-md) — wired to base tokens so all utilities respond to theme changes */
2249
- --spacing: var(--ax-sys-spacing-base);
2250
- --text-xs: var(--ax-sys-text-xs-base);
2251
- --text-sm: var(--ax-sys-text-sm-base);
2252
- --text-base: var(--ax-sys-body-font-size);
2253
- --text-lg: var(--ax-sys-text-lg-base);
2254
- --text-xl: var(--ax-sys-text-xl-base);
2255
- --leading-3: var(--ax-sys-leading-3-base);
2256
- --leading-4: var(--ax-sys-leading-4-base);
2257
- --leading-5: var(--ax-sys-leading-5-base);
2258
- --leading-6: var(--ax-sys-leading-6-base);
2237
+ /*
2238
+ * Do NOT put --spacing / --text-* / --leading-* in @theme inline.
2239
+ * inline would bake var(--ax-sys-*-base) into utilities (e.g. p-3 → calc(var(--ax-sys-spacing-base) * 3)),
2240
+ * so ax-sm/ax-lg overrides of --spacing would never take effect.
2241
+ * Those tokens live on :root (and size utilities) so utilities keep referencing var(--spacing) etc.
2242
+ */
2259
2243
  }
2260
2244
 
2261
2245
  @utility text-muted {
@@ -3224,6 +3208,14 @@ html.ax-dark {
3224
3208
  @apply cursor-text opacity-70 *:cursor-text;
3225
3209
  }
3226
3210
 
3211
+ @utility ax-focus-ring {
3212
+ @apply outline-none shadow-[0_0_0_1px_var(--ax-comp-text,var(--color-on-primary)),0_0_0_3px_var(--ax-comp-bg-light,var(--color-primary-light))];
3213
+ }
3214
+
3215
+ @utility ax-focus-ring-editor {
3216
+ @apply outline-2 outline-offset-0 outline-(--ax-comp-bg-light,var(--color-primary-light));
3217
+ }
3218
+
3227
3219
  @utility ax-fill {
3228
3220
  @apply bg-(--ax-comp-bg-lightest,var(--color-lighter)) text-(--ax-comp-text-lightest,var(--color-on-lighter)) dark:bg-(--ax-comp-bg-lightest,var(--color-darker)) dark:text-(--ax-comp-text-lightest,var(--color-on-darker));
3229
3221
  &.ax-default {
@@ -3233,7 +3225,9 @@ html.ax-dark {
3233
3225
  @apply bg-(--ax-comp-bg-lighter,var(--color-light)) text-(--ax-comp-text-lighter,var(--color-on-light)) dark:bg-(--ax-comp-bg-lighter,var(--color-dark)) dark:text-(--ax-comp-text-lighter,var(--color-on-dark));
3234
3226
  }
3235
3227
  &.ax-editor-container {
3236
- @apply focus-within:ring-primary/30 focus-within:border-primary focus-within:ring-3;
3228
+ &:focus-within {
3229
+ @apply ax-focus-ring-editor;
3230
+ }
3237
3231
  }
3238
3232
  }
3239
3233
 
@@ -3257,7 +3251,7 @@ html.ax-dark {
3257
3251
  }
3258
3252
  &:focus-visible,
3259
3253
  &.ax-state-focus {
3260
- @apply ring-primary/30 ring-3;
3254
+ @apply ax-focus-ring;
3261
3255
  }
3262
3256
  }
3263
3257
  &:not(.ax-state-disabled, .ax-state-loading, .ax-state-selected):active {
@@ -3275,7 +3269,9 @@ html.ax-dark {
3275
3269
  @apply border-(--ax-comp-bg-darker,var(--color-border-light)) text-(--ax-comp-bg-darker,var(--color-on-light));
3276
3270
  }
3277
3271
  &.ax-editor-container {
3278
- @apply focus-within:border-primary!;
3272
+ &:focus-within {
3273
+ border-color: var(--ax-comp-bg, var(--color-primary)) !important;
3274
+ }
3279
3275
  }
3280
3276
  }
3281
3277
 
@@ -3295,7 +3291,7 @@ html.ax-dark {
3295
3291
  }
3296
3292
  &:focus-visible,
3297
3293
  &.ax-state-focus {
3298
- @apply ring-primary/30 ring-3;
3294
+ @apply ax-focus-ring;
3299
3295
  }
3300
3296
  }
3301
3297
  &:not(.ax-state-disabled, .ax-state-loading, .ax-state-selected):active {
@@ -3313,7 +3309,9 @@ html.ax-dark {
3313
3309
  @apply bg-(--ax-comp-bg-darker,var(--color-light)) text-(--ax-comp-text-darker,var(--color-on-light)) dark:bg-(--ax-comp-bg-darker,var(--color-dark)) dark:text-(--ax-comp-text-darker,var(--color-on-dark));
3314
3310
  }
3315
3311
  &.ax-editor-container {
3316
- @apply focus-within:ring-primary/30 focus-within:border-primary focus-within:ring-3;
3312
+ &:focus-within {
3313
+ @apply ax-focus-ring-editor;
3314
+ }
3317
3315
  }
3318
3316
  }
3319
3317
 
@@ -3337,7 +3335,7 @@ html.ax-dark {
3337
3335
  }
3338
3336
  &:focus-visible,
3339
3337
  &.ax-state-focus {
3340
- @apply ring-primary/30 ring-3;
3338
+ @apply ax-focus-ring;
3341
3339
  }
3342
3340
  }
3343
3341
  &:not(.ax-state-disabled, .ax-state-loading, .ax-state-selected):active {
@@ -3361,7 +3359,9 @@ html.ax-dark {
3361
3359
  @apply border-(--ax-comp-bg-darker,var(--color-border-light)) text-(--ax-comp-bg-darker,var(--color-on-light));
3362
3360
  }
3363
3361
  &.ax-editor-container {
3364
- @apply focus-within:ring-primary/30 focus-within:border-primary focus-within:ring-3;
3362
+ &:focus-within {
3363
+ @apply ax-focus-ring-editor;
3364
+ }
3365
3365
  }
3366
3366
  }
3367
3367
 
@@ -3381,7 +3381,7 @@ html.ax-dark {
3381
3381
  }
3382
3382
  &:focus-visible,
3383
3383
  &.ax-state-focus {
3384
- @apply ring-primary/30 ring-3;
3384
+ @apply ax-focus-ring;
3385
3385
  }
3386
3386
  }
3387
3387
  &:not(.ax-state-disabled, .ax-state-loading, .ax-state-selected):active {
@@ -3417,7 +3417,7 @@ html.ax-dark {
3417
3417
  }
3418
3418
  &:focus-visible,
3419
3419
  &.ax-state-focus {
3420
- @apply ring-primary/30 ring-3;
3420
+ @apply ax-focus-ring;
3421
3421
  }
3422
3422
  }
3423
3423
  &:not(.ax-state-disabled, .ax-state-loading, .ax-state-selected):active {
@@ -3453,7 +3453,7 @@ html.ax-dark {
3453
3453
  }
3454
3454
  &:focus-visible,
3455
3455
  &.ax-state-focus {
3456
- @apply ring-primary/30 ring-3;
3456
+ @apply ax-focus-ring;
3457
3457
  }
3458
3458
  }
3459
3459
  &:not(.ax-state-disabled, .ax-state-loading, .ax-state-selected):active {
@@ -3484,7 +3484,7 @@ html.ax-dark {
3484
3484
  }
3485
3485
  &:focus-visible,
3486
3486
  &.ax-state-focus {
3487
- @apply ring-primary/30 ring-3;
3487
+ @apply ax-focus-ring;
3488
3488
  }
3489
3489
  }
3490
3490
  &:not(.ax-state-disabled, .ax-state-loading, .ax-state-selected):active {
@@ -3561,6 +3561,10 @@ html.ax-dark {
3561
3561
  }
3562
3562
 
3563
3563
  @utility ax-xs {
3564
+ --ax-sys-size: ax-xs;
3565
+ /* Control height — 1.5rem at default md of 2.5rem */
3566
+ --ax-sys-size-base: calc(var(--ax-sys-size-md) * 0.6);
3567
+
3564
3568
  /* Spacing */
3565
3569
  --spacing: calc(var(--ax-sys-spacing-base) * 0.5);
3566
3570
  --ax-sys-border-radius: calc(var(--ax-sys-border-radius-base) * 0.5);
@@ -3580,6 +3584,10 @@ html.ax-dark {
3580
3584
  }
3581
3585
 
3582
3586
  @utility ax-sm {
3587
+ --ax-sys-size: ax-sm;
3588
+ /* Control height — 2rem at default md of 2.5rem */
3589
+ --ax-sys-size-base: calc(var(--ax-sys-size-md) * 0.8);
3590
+
3583
3591
  /* Spacing */
3584
3592
  --spacing: calc(var(--ax-sys-spacing-base) * 0.75);
3585
3593
  --ax-sys-border-radius: calc(var(--ax-sys-border-radius-base) * 0.75);
@@ -3599,6 +3607,9 @@ html.ax-dark {
3599
3607
  }
3600
3608
 
3601
3609
  @utility ax-md {
3610
+ --ax-sys-size: ax-md;
3611
+ --ax-sys-size-base: var(--ax-sys-size-md);
3612
+
3602
3613
  /* Tailwind Default Scale */
3603
3614
  --spacing: var(--ax-sys-spacing-base);
3604
3615
  --ax-sys-border-radius: var(--ax-sys-border-radius-base);
@@ -3618,6 +3629,10 @@ html.ax-dark {
3618
3629
  }
3619
3630
 
3620
3631
  @utility ax-lg {
3632
+ --ax-sys-size: ax-lg;
3633
+ /* Control height — 3.375rem at default md of 2.5rem */
3634
+ --ax-sys-size-base: calc(var(--ax-sys-size-md) * 1.35);
3635
+
3621
3636
  /* Spacing */
3622
3637
  --spacing: calc(var(--ax-sys-spacing-base) * 1.25);
3623
3638
  --ax-sys-border-radius: calc(var(--ax-sys-border-radius-base) * 1.25);
@@ -3637,6 +3652,10 @@ html.ax-dark {
3637
3652
  }
3638
3653
 
3639
3654
  @utility ax-xl {
3655
+ --ax-sys-size: ax-xl;
3656
+ /* Control height — 4rem at default md of 2.5rem */
3657
+ --ax-sys-size-base: calc(var(--ax-sys-size-md) * 1.6);
3658
+
3640
3659
  /* Spacing */
3641
3660
  --spacing: calc(var(--ax-sys-spacing-base) * 1.5);
3642
3661
  --ax-sys-border-radius: calc(var(--ax-sys-border-radius-base) * 1.5);