aliascss 1.4.5 → 1.5.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 (75) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/bin/aliascss.js +118 -1
  3. package/dist/aliascss.js +1 -1
  4. package/lib/classPrinter.js +347 -21
  5. package/lib/compilers/color.js +5 -5
  6. package/lib/compilers/gradient.js +3 -3
  7. package/lib/compilers/stringAndContent.js +2 -1
  8. package/lib/component-elements.d.ts +155 -0
  9. package/lib/component-elements.js +223 -0
  10. package/lib/config.d.ts +2 -0
  11. package/lib/config.js +3 -1
  12. package/lib/css-properties-all.js +337 -202
  13. package/lib/custom-css-compilers.js +49 -116
  14. package/lib/extras-elements.d.ts +87 -0
  15. package/lib/extras-elements.js +184 -0
  16. package/lib/form-elements.d.ts +75 -0
  17. package/lib/form-elements.js +186 -0
  18. package/lib/layout-elements.d.ts +59 -0
  19. package/lib/layout-elements.js +113 -0
  20. package/lib/nav-elements.d.ts +71 -0
  21. package/lib/nav-elements.js +243 -0
  22. package/lib/node/compileFile-BK-291026.d.ts +27 -0
  23. package/lib/node/compileFile-BK-291026.js +309 -0
  24. package/lib/node/compileFile-bk.d.ts +14 -12
  25. package/lib/node/compileFile-bk.js +263 -252
  26. package/lib/node/compileFile.js +1 -1
  27. package/lib/node/extractClassNamesFromFile.js +208 -86
  28. package/lib/prebuild.d.ts +546 -12
  29. package/lib/prebuild.js +3 -852
  30. package/lib/prefix/PseudoPrefixNew.js +301 -16
  31. package/lib/prefix/attribute-selector.js +4 -2
  32. package/lib/prefix/element-selector.js +93 -20
  33. package/lib/prefix/extractPrefix.d.ts +1 -1
  34. package/lib/prefix/extractPrefix.js +113 -70
  35. package/lib/prefix/pseudoSelectorNew.js +184 -49
  36. package/lib/prefix/responsive.d.ts +13 -9
  37. package/lib/prefix/responsive.js +131 -9
  38. package/lib/returnPropertyAndValue.js +9 -4
  39. package/lib/returnStatement-bk-291026.d.ts +5 -0
  40. package/lib/returnStatement-bk-291026.js +470 -0
  41. package/lib/returnStatement-bk.d.ts +5 -0
  42. package/lib/returnStatement-bk.js +311 -0
  43. package/lib/returnStatement.d.ts +1 -0
  44. package/lib/returnStatement.js +262 -12
  45. package/lib/static/customStaticClassNames.js +35 -35
  46. package/lib/static/staticClassNamesAlias.js +18 -16
  47. package/lib/table-elements.d.ts +39 -0
  48. package/lib/table-elements.js +90 -0
  49. package/lib/utils/helper.d.ts +6 -0
  50. package/lib/utils/helper.js +52 -0
  51. package/lib/x-classes/x-bundle.d.ts +589 -0
  52. package/lib/x-classes/x-bundle.js +12 -0
  53. package/lib/x-classes/x-comps.d.ts +87 -0
  54. package/lib/x-classes/x-comps.js +189 -0
  55. package/lib/x-classes/x-extras.d.ts +155 -0
  56. package/lib/x-classes/x-extras.js +223 -0
  57. package/lib/x-classes/x-form-components.d.ts +75 -0
  58. package/lib/x-classes/x-form-components.js +186 -0
  59. package/lib/x-classes/x-helper-components.d.ts +63 -0
  60. package/lib/x-classes/x-helper-components.js +91 -0
  61. package/lib/x-classes/x-layout-components.d.ts +59 -0
  62. package/lib/x-classes/x-layout-components.js +113 -0
  63. package/lib/x-classes/x-menu.d.ts +23 -0
  64. package/lib/x-classes/x-menu.js +55 -0
  65. package/lib/x-classes/x-navs.d.ts +71 -0
  66. package/lib/x-classes/x-navs.js +243 -0
  67. package/lib/x-classes/x-row-col.d.ts +29 -0
  68. package/lib/x-classes/x-row-col.js +52 -0
  69. package/lib/x-classes/x-table.d.ts +39 -0
  70. package/lib/x-classes/x-table.js +90 -0
  71. package/lib/x-classes/x-theme.d.ts +15 -0
  72. package/lib/x-classes/x-theme.js +32 -0
  73. package/lib/x-imports.d.ts +31 -0
  74. package/lib/x-imports.js +748 -0
  75. package/package.json +1 -1
@@ -2,41 +2,10 @@ import prebuild from "./prebuild.js";
2
2
  import { cssVarWithDefault } from "./utils/helper.js";
3
3
  import color from './compilers/color.js';
4
4
  import length from './compilers/length.js';
5
- const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
6
- // 'Button':{
7
- // type:'group',
8
- // compiler:(value,custom)=>{
9
- // let stm='';
10
- // const order=['color','background-color','border-color'];
11
- // const values=value.replace(/^\(|\)$/g,'').split(',');
12
- // values.forEach((e,i)=>{
13
- // if(i<order.length){
14
- // stm+=`${order[i]}:${color(e,custom)};`
15
- // }
16
- // });
17
- // return stm;
18
- // }
19
- // options:{
20
- // 'solid':'background-color:var(--main-color),color:var(--main-text-color,#fff)',
21
- // 'outline':'--background-color:var(--outline-bg-color,transparent),--button-color:var(--main-color)',
22
- // 'link':'background-color:var(--outline-bg-color,transparent),color:var(--main-color),border:none',
23
- // 'ghost':'background:transparent',
24
- // 'primary':'--button-main-color:var(--primary-color,),',
25
- // 'success':'',
26
- // 'error':'',
27
- // 'warning':'',
28
- // 'info':'',
29
- // 'xs':'border-radius: 4px;padding: 0px 8px;font-size: 12px;height: 24px;line-height: 16px;gap: 4px;',
30
- // 'sm':'border-radius: 4px;padding: 0px 12px;font-size: 14px;height: 32px;line-height: 20px;gap: 8px;',
31
- // 'md':'border-radius: 4px;padding: 0px 15px;font-size: 15px;font-weight: 500;height: 35px;line-height: 1;',
32
- // 'lg':'border-radius: 6px;padding: 0px 16px;font-size: 16px;height: 40px;line-height: 24px;gap: 12px;',
33
- // 'lg':'border-radius: 6px; padding: 0px 24px;font-size: 18px;height: 48px;line-height: 26px;gap: 14px;',
34
- // },
35
- // },
36
- 'InsetRA': {
5
+ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), { 'InsetRA': {
37
6
  type: 'group',
38
7
  compiler: (value, custom) => {
39
- const val = value.replace(/^\(/, '').replace(/\)$/, '').trim();
8
+ // const val=value.replace(/^\(/,'').replace(/\)$/,'').trim();
40
9
  const stm = `
41
10
  --lightness-1000: 67.0121%;
42
11
  --border-color: var(--gray-400,${color('grayRATheme400', custom)});
@@ -120,8 +89,8 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
120
89
  compiler: (value, custom) => {
121
90
  const val = value.replace(/^\(/, '').replace(/\)$/, '').trim();
122
91
  const stm = `
123
- ${val ? '--accentColor:' + color(val, custom) + ';' : ''}
124
- --border-color: ${color('accentRA', custom)};
92
+ ${val ? ('--accentColor:' + color(val, custom) + ";") : ''}
93
+ --button-color: ${color('accentRA', custom)};
125
94
  --button-background: ${color('accentRATheme100', custom)};
126
95
  --button-gradient:${color('accentRATheme200', custom)};
127
96
  --button-border: ${color('accentRATheme300', custom)};
@@ -150,7 +119,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
150
119
  -webkit-tap-highlight-color: transparent;
151
120
 
152
121
  @media (prefers-color-scheme: dark) {
153
- --button-shadow: ${color('accentRATheme200', custom)};;
122
+ --button-shadow: ${color('accentRATheme200', custom)};
154
123
  --button-highlight: rgb(255 255 255 / 0.15);
155
124
  box-shadow:
156
125
  inset 0 var(--button-border-size) 0 var(--button-highlight), /* top specular highlight */
@@ -179,7 +148,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
179
148
 
180
149
  &:where([data-hovered], [data-pressed]) {
181
150
  --button-background: ${color('accentRATheme200', custom)};
182
- --button-text: var(--${name}-1400);
151
+ --button-text: ${color('accentRATheme1400', custom)};
183
152
  box-shadow: 0 0 0 1px ${color('accentRATheme200', custom)};
184
153
  }
185
154
  }
@@ -471,8 +440,8 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
471
440
  'padding-x': {
472
441
  type: 'group',
473
442
  compiler: (y) => {
474
- if (/^--[a-z]/.test(y)) {
475
- return `padding-left:var(${y});padding-right:var(${y})`;
443
+ if (/^--[a-zA-Z]/.test(y)) {
444
+ return `padding-left:${cssVarWithDefault(y, length)};padding-right:${cssVarWithDefault(y, length)}`;
476
445
  }
477
446
  const value = y.split('-');
478
447
  if (value.length === 3) {
@@ -501,7 +470,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
501
470
  }, 'px': {
502
471
  type: 'group',
503
472
  compiler: (y) => {
504
- if (/^--[a-z]/.test(y)) {
473
+ if (/^--[a-zA-Z]/.test(y)) {
505
474
  return `padding-left:var(${y});padding-right:var(${y})`;
506
475
  }
507
476
  const value = y.split('-');
@@ -531,7 +500,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
531
500
  }, 'padding-y': {
532
501
  type: 'group',
533
502
  compiler: (y) => {
534
- if (/^--[a-z]/.test(y)) {
503
+ if (/^--[a-zA-Z]/.test(y)) {
535
504
  return `padding-top:var(${y});padding-bottom:var(${y})`;
536
505
  }
537
506
  const value = y.split('-');
@@ -547,21 +516,21 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
547
516
  },
548
517
  groups: {
549
518
  0: "padding-top:0;padding-bottom:0",
550
- 1: `padding-top:var(--space-1,${1 / 4}rem);padding-bottom:var(--space-1,var(--space-1,${1 / 4}rem))`,
551
- 2: `padding-top:var(--space-2,var(--space-2,${2 / 4}rem));padding-bottom:var(--space-2,var(--space-2,${2 / 4}rem))`,
552
- 3: `padding-top:var(--space-3,var(--space-3,${3 / 4}rem));padding-bottom:var(--space-3,var(--space-3,${3 / 4}rem))`,
553
- 4: `padding-top:var(--space-4,var(--space-4,${4 / 4}rem));padding-bottom:var(--space-4,var(--space-4,${4 / 4}rem))`,
554
- 5: `padding-top:var(--space-5,var(--space-5,${5 / 4}rem));padding-bottom:var(--space-5,var(--space-5,${5 / 4}rem))`,
555
- 6: `padding-top:var(--space-6,var(--space-6,${6 / 4}rem));padding-bottom:var(--space-6,var(--space-6,${6 / 4}rem))`,
556
- 7: `padding-top:var(--space-7,var(--space-7,${7 / 4}rem));padding-bottom:var(--space-7,var(--space-7,${7 / 4}rem))`,
557
- 8: `padding-top:var(--space-8,var(--space-8,${8 / 4}rem));padding-bottom:var(--space-8,var(--space-8,${8 / 4}rem))`,
558
- 9: `padding-top:var(--space-9,var(--space-9,${9 / 4}rem));padding-bottom:var(--space-9,${9 / 4}rem)`,
559
- 10: `padding-top:var(--space-10,var(--space-10,${10 / 4}rem));padding-bottom:var(--space-10,${10 / 4}rem)`,
519
+ 1: `padding-top:var(--space-1,${1 / 4}rem);padding-bottom:var(--space-1,${1 / 4}rem)`,
520
+ 2: `padding-top:var(--space-2,${2 / 4}rem);padding-bottom:var(--space-2,${2 / 4}rem)`,
521
+ 3: `padding-top:var(--space-3,${3 / 4}rem);padding-bottom:var(--space-3,${3 / 4}rem)`,
522
+ 4: `padding-top:var(--space-4,${4 / 4}rem);padding-bottom:var(--space-4,${4 / 4}rem)`,
523
+ 5: `padding-top:var(--space-5,${5 / 4}rem);padding-bottom:var(--space-5,${5 / 4}rem)`,
524
+ 6: `padding-top:var(--space-6,${6 / 4}rem);padding-bottom:var(--space-6,${6 / 4}rem)`,
525
+ 7: `padding-top:var(--space-7,${7 / 4}rem);padding-bottom:var(--space-7,${7 / 4}rem)`,
526
+ 8: `padding-top:var(--space-8,${8 / 4}rem);padding-bottom:var(--space-8,${8 / 4}rem)`,
527
+ 9: `padding-top:var(--space-9,${9 / 4}rem);padding-bottom:var(--space-9,${9 / 4}rem)`,
528
+ 10: `padding-top:var(--space-10,${10 / 4}rem);padding-bottom:var(--space-10,${10 / 4}rem)`,
560
529
  },
561
530
  }, 'py': {
562
531
  type: 'group',
563
532
  compiler: (y) => {
564
- if (/^--[a-z]/.test(y)) {
533
+ if (/^--[a-zA-Z]/.test(y)) {
565
534
  return `padding-top:var(${y});padding-bottom:var(${y})`;
566
535
  }
567
536
  const value = y.split('-');
@@ -593,7 +562,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
593
562
  'margin-x': {
594
563
  type: 'group',
595
564
  compiler: (y) => {
596
- if (/^--[a-z]/.test(y)) {
565
+ if (/^--[a-zA-Z]/.test(y)) {
597
566
  return `margin-left:var(${y});margin-right:var(${y})`;
598
567
  }
599
568
  const value = y.replace(/--/g, '-M').split('-');
@@ -633,7 +602,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
633
602
  }, 'mx': {
634
603
  type: 'group',
635
604
  compiler: (y) => {
636
- if (/^--[a-z]/.test(y)) {
605
+ if (/^--[a-zA-Z]/.test(y)) {
637
606
  return `margin-left:var(${y});margin-right:var(${y})`;
638
607
  }
639
608
  const value = y.replace(/--/g, '-M').split('-');
@@ -673,7 +642,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
673
642
  }, 'margin-y': {
674
643
  type: 'group',
675
644
  compiler: (y) => {
676
- if (/^--[a-z]/.test(y)) {
645
+ if (/^--[a-zA-Z]/.test(y)) {
677
646
  return `margin-top:var(${y});margin-bottom:var(${y})`;
678
647
  }
679
648
  const value = y.replace(/--/g, '-M').split('-');
@@ -713,7 +682,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
713
682
  }, 'my': {
714
683
  type: 'group',
715
684
  compiler: (y) => {
716
- if (/^--[a-z]/.test(y)) {
685
+ if (/^--[a-zA-Z]/.test(y)) {
717
686
  return `margin-top:var(${y});margin-bottom:var(${y})`;
718
687
  }
719
688
  const value = y.replace(/--/g, '-M').split('-');
@@ -752,42 +721,6 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
752
721
  },
753
722
  },
754
723
  // ---------------------x-custom-compiler
755
- 'x-row': {
756
- type: 'group',
757
- compiler: (value) => {
758
- return `--x-row-gap:${value.trim() ? value.replace(/^-(\d)/, '$1') : '16px'};display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,${value.replace(/^-(\d)/, '$1')}) * -0.5);margin-right:calc(var(--x-row-gap,${value.replace(/^-(\d)/, '$1')}) * 0.5);`;
759
- },
760
- groups: {
761
- 'xs': `--x-row-gap:4px;display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,4px) * -0.5);margin-right:calc(var(--x-row-gap,16px) * 0.5);`,
762
- 'sm': `--x-row-gap:8px;display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,8px) * -0.5);margin-right:calc(var(--x-row-gap,16px) * 0.5);`,
763
- 'md': `--x-row-gap:16px;display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,16px) * -0.5);margin-right:calc(var(--x-row-gap,16px) * 0.5);`,
764
- 'lg': `--x-row-gap:24px;display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,24px) * -0.5);margin-right:calc(var(--x-row-gap,16px) * 0.5);`,
765
- 'xl': `--x-row-gap:32px;display:flex;flex-wrap:wrap;margin-left:calc(var(--x-row-gap,32px) * -0.5);margin-right:calc(var(--x-row-gap,16px) * 0.5);`,
766
- },
767
- }, 'x-col': {
768
- type: 'group',
769
- compiler: (value) => {
770
- return `--x-col-width:${value.replace(/^-(\d)/, '$1')};padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5);box-sizing:border-box;flex:0 0 var(--x-col-width,${value.replace(/^-(\d)/, '$1')});max-width:var(--x-col-width,${value.replace(/^-(\d)/, '$1')});`;
771
- },
772
- groups: {
773
- '1': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 8.333%;max-width:8.333%;`,
774
- '2': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 16.6667%;max-width:16.6667%;`,
775
- '3': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 25%;max-width:25%;`,
776
- '4': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 33.3333%;max-width:33.3333%;`,
777
- '5': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 41.6667%;max-width:41.6667%;`,
778
- '6': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 50%;max-width:50%;`,
779
- '7': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 58.3333%;max-width:58.3333%;`,
780
- '8': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 66.6667%;max-width:66.6667%;`,
781
- '9': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 75%;max-width:75%;`,
782
- '10': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 83.3333%;max-width:83.3333%;`,
783
- '11': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 91.6667%;max-width:91.6667%;`,
784
- '12': `padding-left:calc(var(--x-row-gap,16px) * 0.5);padding-right:calc(var(--x-row-gap,16px) * 0.5); box-sizing:border-box;flex:0 0 100%;max-width:100%;`,
785
- },
786
- },
787
- // 'x-col-responsive':{
788
- // type:'statement',
789
- // statement:`[]`,
790
- // },
791
724
  'x-square': {
792
725
  type: 'group',
793
726
  compiler: (value) => {
@@ -797,42 +730,42 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
797
730
  v = cssVarWithDefault(value) || '';
798
731
  }
799
732
  else {
800
- v = value.replace(/^-([-]?[\d])/g, '$1').replace(/([/d])p$/, '$1%');
733
+ v = value.replace(/^-([-]?[\d])/g, '$1').replace(/([\d])p$/, '$1%');
801
734
  }
802
735
  const val = `calc(${v} - var(--x-square-shrink, 0px) + var(--x-square-grow, 0px))`;
803
736
  return `width:${val};height:${val};flex: 0 0 ${val}`;
804
737
  },
805
738
  groups: {
806
739
  '0': 'width:0px;height:0px;flex: 0 0 0px',
807
- '1': `width:var(--space-1,${1 / 4}rem;height:1px;flex: 0 0 var(--space-1,${1 / 4}rem`,
808
- '2': `width:var(--space-2,${2 / 4}rem;height:1px;flex: 0 0 var(--space-2,${2 / 4}rem`,
809
- '3': `width:var(--space-3,${3 / 4}rem;height:1px;flex: 0 0 var(--space-3,${3 / 4}rem`,
810
- '4': `width:var(--space-4,${4 / 4}rem;height:1px;flex: 0 0 var(--space-4,${4 / 4}rem`,
811
- '5': `width:var(--space-5,${5 / 4}rem;height:1px;flex: 0 0 var(--space-5,${5 / 4}rem`,
812
- '6': `width:var(--space-6,${6 / 4}rem;height:1px;flex: 0 0 var(--space-6,${6 / 4}rem`,
813
- '7': `width:var(--space-7,${7 / 4}rem;height:1px;flex: 0 0 var(--space-7,${7 / 4}rem`,
814
- '8': `width:var(--space-8,${8 / 4}rem;height:1px;flex: 0 0 var(--space-8,${8 / 4}rem`,
815
- '9': `width:var(--space-9,${9 / 4}rem;height:1px;flex: 0 0 var(--space-9,${9 / 4}rem`,
816
- '10': `width:var(--space-10,${10 / 4}rem;height:1px;flex: 0 0 var(--space-10,${10 / 4}rem`,
817
- '12': `width:var(--space-12,${12 / 4}rem;height:1px;flex: 0 0 var(--space-12,${12 / 4}rem`,
818
- '16': `width:var(--space-16,${16 / 4}rem;height:1px;flex: 0 0 var(--space-16,${16 / 4}rem`,
819
- '20': `width:var(--space-20,${20 / 4}rem;height:1px;flex: 0 0 var(--space-20,${20 / 4}rem`,
820
- '32': `width:var(--space-32,${32 / 4}rem;height:1px;flex: 0 0 var(--space-32,${32 / 4}rem`,
740
+ '1': `width:var(--space-1,${1 / 4}rem);height:var(--space-1,${1 / 4}rem);flex: 0 0 var(--space-1,${1 / 4}rem)`,
741
+ '2': `width:var(--space-2,${2 / 4}rem);height:var(--space-2,${2 / 4}rem);flex: 0 0 var(--space-2,${2 / 4}rem)`,
742
+ '3': `width:var(--space-3,${3 / 4}rem);height:var(--space-3,${3 / 4}rem);flex: 0 0 var(--space-3,${3 / 4}rem)`,
743
+ '4': `width:var(--space-4,${4 / 4}rem);height:var(--space-4,${4 / 4}rem);flex: 0 0 var(--space-4,${4 / 4}rem)`,
744
+ '5': `width:var(--space-5,${5 / 4}rem);height:var(--space-5,${5 / 4}rem);flex: 0 0 var(--space-5,${5 / 4}rem)`,
745
+ '6': `width:var(--space-6,${6 / 4}rem);height:var(--space-6,${6 / 4}rem);flex: 0 0 var(--space-6,${6 / 4}rem)`,
746
+ '7': `width:var(--space-7,${7 / 4}rem);height:var(--space-7,${7 / 4}rem);flex: 0 0 var(--space-7,${7 / 4}rem)`,
747
+ '8': `width:var(--space-8,${8 / 4}rem);height:var(--space-8,${8 / 4}rem);flex: 0 0 var(--space-8,${8 / 4}rem)`,
748
+ '9': `width:var(--space-9,${9 / 4}rem);height:var(--space-9,${9 / 4}rem);flex: 0 0 var(--space-9,${9 / 4}rem)`,
749
+ '10': `width:var(--space-10,${10 / 4}rem);height:var(--space-10,${10 / 4}rem);flex: 0 0 var(--space-10,${10 / 4}rem)`,
750
+ '12': `width:var(--space-12,${12 / 4}rem);height:var(--space-12,${12 / 4}rem);flex: 0 0 var(--space-12,${12 / 4}rem)`,
751
+ '16': `width:var(--space-16,${16 / 4}rem);height:var(--space-16,${16 / 4}rem);flex: 0 0 var(--space-16,${16 / 4}rem)`,
752
+ '20': `width:var(--space-20,${20 / 4}rem);height:var(--space-20,${20 / 4}rem);flex: 0 0 var(--space-20,${20 / 4}rem)`,
753
+ '32': `width:var(--space-32,${32 / 4}rem);height:var(--space-32,${32 / 4}rem);flex: 0 0 var(--space-32,${32 / 4}rem)`,
821
754
  'xs': 'width:4px;height:4px;flex: 0 0 4px',
822
755
  'sm': 'width:8px;height:8px;flex: 0 0 8px',
823
756
  'md': 'width:16px;height:16px;flex: 0 0 16px',
824
- 'lg': 'width:24px;height:1px;flex: 0 0 24px',
825
- 'xl': 'width:32px;height:1px;flex: 0 0 32px',
826
- 'xxl': 'width:64px;height:1px;flex: 0 0 64px',
757
+ 'lg': 'width:24px;height:24px;flex: 0 0 24px',
758
+ 'xl': 'width:32px;height:32px;flex: 0 0 32px',
759
+ 'xxl': 'width:64px;height:64px;flex: 0 0 64px',
827
760
  }
828
761
  }, 'x-width': {
829
762
  type: 'group',
830
763
  compiler: (value) => {
831
764
  if (/^--[a-zA-Z]/.test(value)) {
832
765
  if (value.includes(':')) {
833
- const val = value.slice(value.indexOf(':')).replace(':', '');
834
- const cssVar = value.replace(val, '').replace(':', '');
835
- return `width:calc(var(${cssVar},${val}) + var(--x-width-grow,0px) - var(--x-width-shrink,0px))`;
766
+ const val = value.slice(value.indexOf(':')); // .replace(':','');
767
+ const cssVar = value.replace(val, ''); // .replace(':','');
768
+ return `width:calc(var(${cssVar},${val.replace(':', '')}) + var(--x-width-grow,0px) - var(--x-width-shrink,0px))`;
836
769
  }
837
770
  return `width:calc(var(${value}) + var(--x-width-grow,0px) - var(--x-width-shrink,0px))`;
838
771
  }
@@ -843,9 +776,9 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
843
776
  compiler: (value) => {
844
777
  if (/^--[a-zA-Z]/.test(value)) {
845
778
  if (value.includes(':')) {
846
- const val = value.slice(value.indexOf(':')).replace(':', '');
847
- const cssVar = value.replace(val, '').replace(':', '');
848
- return `height:calc(var(${cssVar},${val}) + var(--x-height-grow,0px) - var(--x-height-shrink,0px))`;
779
+ const val = value.slice(value.indexOf(':')); // .replace(':','');
780
+ const cssVar = value.replace(val, ''); // .replace(':','');
781
+ return `height:calc(var(${cssVar},${val.replace(':', '')}) + var(--x-height-grow,0px) - var(--x-height-shrink,0px))`;
849
782
  }
850
783
  return `height:calc(var(${value}) + var(--x-height-grow,0px) - var(--x-height-shrink,0px))`;
851
784
  }
@@ -0,0 +1,87 @@
1
+ declare const extrasComponents: {
2
+ 'x-keyframes-spin': {
3
+ type: string;
4
+ statement: string;
5
+ };
6
+ 'x-keyframes-shimmer': {
7
+ type: string;
8
+ statement: string;
9
+ };
10
+ 'x-keyframes-progress': {
11
+ type: string;
12
+ statement: string;
13
+ };
14
+ 'x-input-group': {
15
+ type: string;
16
+ statement: string;
17
+ };
18
+ 'x-input-addon': {
19
+ type: string;
20
+ statement: string;
21
+ };
22
+ 'x-range': {
23
+ type: string;
24
+ statement: string;
25
+ };
26
+ 'x-file': {
27
+ type: string;
28
+ statement: string;
29
+ };
30
+ 'x-progress': {
31
+ type: string;
32
+ statement: string;
33
+ };
34
+ 'x-spinner': {
35
+ type: string;
36
+ statement: string;
37
+ };
38
+ 'x-spinner-sm': {
39
+ type: string;
40
+ statement: string;
41
+ };
42
+ 'x-spinner-lg': {
43
+ type: string;
44
+ statement: string;
45
+ };
46
+ 'x-skeleton': {
47
+ type: string;
48
+ statement: string;
49
+ };
50
+ 'x-skeleton-text': {
51
+ type: string;
52
+ statement: string;
53
+ };
54
+ 'x-skeleton-circle': {
55
+ type: string;
56
+ statement: string;
57
+ };
58
+ 'x-avatar': {
59
+ type: string;
60
+ statement: string;
61
+ };
62
+ 'x-avatar-xs': {
63
+ type: string;
64
+ statement: string;
65
+ };
66
+ 'x-avatar-sm': {
67
+ type: string;
68
+ statement: string;
69
+ };
70
+ 'x-avatar-lg': {
71
+ type: string;
72
+ statement: string;
73
+ };
74
+ 'x-avatar-xl': {
75
+ type: string;
76
+ statement: string;
77
+ };
78
+ 'x-avatar-square': {
79
+ type: string;
80
+ statement: string;
81
+ };
82
+ 'x-avatar-group': {
83
+ type: string;
84
+ statement: string;
85
+ };
86
+ };
87
+ export default extrasComponents;
@@ -0,0 +1,184 @@
1
+ // AliasCSS components: input group, range, file, progress, spinner, skeleton, avatar
2
+ // ------------------------------------------------------------------
3
+ // Same conventions as before: @components layer, --x-* variables with
4
+ // token fallbacks, plain utilities override everything.
5
+ //
6
+ // Browser-specific pseudo-elements (range thumb/track, progress bar) are not in
7
+ // the pseudo map, so they use the raw selector escape @(…). Each one is its own
8
+ // rule on purpose: an unknown vendor pseudo-element invalidates a whole rule.
9
+ //
10
+ // Animations use small `raw` entries for @keyframes. A statement that includes
11
+ // the raw key (e.g. x-keyframes-spin) emits the @keyframes once with the class.
12
+ // ------------------------------------------------------------------
13
+ const extrasComponents = {
14
+ // ---------------- Keyframes (raw) ----------------
15
+ 'x-keyframes-spin': {
16
+ type: 'raw',
17
+ statement: `@keyframes x-spin{to{transform:rotate(360deg)}}`
18
+ },
19
+ 'x-keyframes-shimmer': {
20
+ type: 'raw',
21
+ statement: `@keyframes x-shimmer{from{background-position:120% 0}to{background-position:-20% 0}}`
22
+ },
23
+ 'x-keyframes-progress': {
24
+ type: 'raw',
25
+ statement: `@keyframes x-progress{from{background-position:-70% 0}to{background-position:170% 0}}`
26
+ },
27
+ // ================================================================
28
+ // INPUT GROUP
29
+ // <div class="x-input-group">
30
+ // <span class="x-input-addon">https://</span>
31
+ // <input class="x-input" placeholder="example.com">
32
+ // <button class="x-button x-button-secondary">Copy</button>
33
+ // </div>
34
+ // Any mix of addons, inputs, selects and buttons; corners and borders join automatically.
35
+ // ================================================================
36
+ 'x-input-group': {
37
+ type: 'statement',
38
+ statement: `
39
+ @components[d-flex,align-items-stretch,w-100%]
40
+ @components__all--not(--first-child)[margin-left--1px,border-top-left-radius-0px,border-bottom-left-radius-0px]
41
+ @components__all--not(--last-child)[border-top-right-radius-0px,border-bottom-right-radius-0px]
42
+ @components__all--focus[position-relative,zi-1]
43
+ @components__all--focus-visible[position-relative,zi-1]
44
+ @components__input[flex(1_1_0%),w-auto,mw-0px]
45
+ @components__select[flex(1_1_0%),w-auto,mw-0px]
46
+ `
47
+ },
48
+ // vars: --x-form-addon-bg (gray50), --x-form-addon-color (gray500)
49
+ 'x-input-addon': {
50
+ type: 'statement',
51
+ statement: `@components[d-flex,aic,flex-shrink-0,padding-inline-12px,h--x-form-height:40px,box-sizing-border-box,fs-14px,white-space-nowrap,bgc--x-form-addon-bg:gray50,c--x-form-addon-color:gray500,border-width-1px,border-style-solid,border-color--x-form-border-color:gray300,br--x-form-radius:8px]`
52
+ },
53
+ // ================================================================
54
+ // RANGE
55
+ // <input type="range" class="x-range" min="0" max="100" value="40">
56
+ // Filled part of the track: Firefox draws it natively; for Chrome/Safari set
57
+ // --x-range-fill (e.g. "40%") from JavaScript on input (see the test page).
58
+ // vars: --x-range-track-height (6px), --x-range-thumb-size (18px),
59
+ // --x-range-track-bg, --x-form-accent-color, --x-range-fill (0%)
60
+ // ================================================================
61
+ 'x-range': {
62
+ type: 'statement',
63
+ statement: `
64
+ @base-[appearance-none,m-0]
65
+ @components[d-block,w-100%,h--x-range-thumb-size:18px,bgc-transparent,cursor-pointer]
66
+ @components-@(::-webkit-slider-runnable-track)[h--x-range-track-height:6px,br-999px,background(linear-gradient(var(--x-form-accent-color,#7F56D9),var(--x-form-accent-color,#7F56D9))_0_/_var(--x-range-fill,0%)_100%_no-repeat,var(--x-range-track-bg,#EAECF0))]
67
+ @components-@(::-moz-range-track)[h--x-range-track-height:6px,br-999px,bgc--x-range-track-bg:gray200]
68
+ @components-@(::-moz-range-progress)[h--x-range-track-height:6px,br-999px,bgc--x-form-accent-color:primary600]
69
+ @components-@(::-webkit-slider-thumb)[appearance-none,w--x-range-thumb-size:18px,h--x-range-thumb-size:18px,box-sizing-border-box,br-50%,bgc-white,border-width-2px,border-style-solid,border-color--x-form-accent-color:primary600,box-shadow(0_1px_2px_rgb(16_24_40_/_0.2)),margin-top(calc((var(--x-range-track-height,6px)_-_var(--x-range-thumb-size,18px))_/_2))]
70
+ @components-@(::-moz-range-thumb)[w--x-range-thumb-size:18px,h--x-range-thumb-size:18px,box-sizing-border-box,br-50%,bgc-white,border-width-2px,border-style-solid,border-color--x-form-accent-color:primary600,box-shadow(0_1px_2px_rgb(16_24_40_/_0.2))]
71
+ @components--focus-visible-@(::-webkit-slider-thumb)-box-shadow(0_0_0_4px_var(--x-form-ring-color,rgb(127_86_217_/_0.25)))
72
+ @components--focus-visible-@(::-moz-range-thumb)-box-shadow(0_0_0_4px_var(--x-form-ring-color,rgb(127_86_217_/_0.25)))
73
+ @components--focus-visible-outline-none
74
+ @components--disabled[o-0.5,cursor-not-allowed]
75
+ `
76
+ },
77
+ // ================================================================
78
+ // FILE INPUT
79
+ // <input type="file" class="x-file">
80
+ // vars: --x-file-hover-bg (gray50) + the shared --x-form-* variables
81
+ // ================================================================
82
+ 'x-file': {
83
+ type: 'statement',
84
+ statement: `
85
+ @components[d-block,w-100%,fs-14px,lh-20px,c--x-form-hint-color:gray500,cursor-pointer]
86
+ @components--file-selector-button[m-0px-12px-0px-0px,h-36px,padding-inline-14px,box-sizing-border-box,br--x-form-radius:8px,border-width-1px,border-style-solid,border-color--x-form-border-color:gray300,bgc--x-form-bg:white,c--x-form-color:gray700,ff-inherit,fs-14px,fw-600,cursor-pointer,transition-property-background-color,transition-duration-0.15s]
87
+ @components--hover--file-selector-button-bgc--x-file-hover-bg:gray50
88
+ @components--focus-visible[outline-style-solid,outline-width-2px,outline-color--x-form-accent-color:primary600,outline-offset-2px,br--x-form-radius:8px]
89
+ @components--disabled[o-0.5,cursor-not-allowed]
90
+ `
91
+ },
92
+ // ================================================================
93
+ // PROGRESS (native <progress>)
94
+ // <progress class="x-progress" value="60" max="100"></progress>
95
+ // <progress class="x-progress"></progress> (no value = indeterminate, animated)
96
+ // vars: --x-progress-height (8px), --x-progress-track-bg (gray200), --x-form-accent-color
97
+ // ================================================================
98
+ 'x-progress': {
99
+ type: 'statement',
100
+ statement: `
101
+ x-keyframes-progress
102
+ @base-[appearance-none,border-width-0px]
103
+ @components[d-block,w-100%,h--x-progress-height:8px,br-999px,overflow-hidden,bgc--x-progress-track-bg:gray200,c--x-form-accent-color:primary600]
104
+ @components-@(::-webkit-progress-bar)[bgc--x-progress-track-bg:gray200,br-999px]
105
+ @components-@(::-webkit-progress-value)[bgc--x-form-accent-color:primary600,br-999px,transition-property-width,transition-duration-0.3s]
106
+ @components-@(::-moz-progress-bar)[bgc--x-form-accent-color:primary600,br-999px]
107
+ @components--indeterminate[background(linear-gradient(90deg,transparent,var(--x-form-accent-color,#7F56D9),transparent)_var(--x-progress-track-bg,#EAECF0)),background-size(40%_100%),background-repeat-no-repeat,animation-name-x-progress,animation-duration-1.2s,animation-timing-function-ease-in-out,animation-iteration-count-infinite]
108
+ @components--indeterminate-@(::-webkit-progress-bar)-bgc-transparent
109
+ @components--indeterminate-@(::-moz-progress-bar)-bgc-transparent
110
+ @motion-reduce--indeterminate-animation-duration-3s
111
+ `
112
+ },
113
+ // ================================================================
114
+ // SPINNER
115
+ // <span class="x-spinner" role="status" aria-label="Loading"></span>
116
+ // Color follows currentColor (use c-* utilities). Sizes: x-spinner-sm, x-spinner-lg
117
+ // vars: --x-spinner-size (20px), --x-spinner-width (2px)
118
+ // ================================================================
119
+ 'x-spinner': {
120
+ type: 'statement',
121
+ statement: `
122
+ x-keyframes-spin
123
+ @components[d-inline-block,flex-shrink-0,w--x-spinner-size:20px,h--x-spinner-size:20px,box-sizing-border-box,br-50%,border-width--x-spinner-width:2px,border-style-solid,border-color(color-mix(in_srgb,currentColor_20%,transparent)),border-top-color-currentColor,vertical-align-middle,animation-name-x-spin,animation-duration-0.75s,animation-timing-function-linear,animation-iteration-count-infinite]
124
+ @motion-reduce-animation-duration-1.5s
125
+ `
126
+ },
127
+ 'x-spinner-sm': { type: 'statement', statement: `--x-spinner-size:14px --x-spinner-width:2px` },
128
+ 'x-spinner-lg': { type: 'statement', statement: `--x-spinner-size:32px --x-spinner-width:3px` },
129
+ // ================================================================
130
+ // SKELETON
131
+ // <div class="x-skeleton w-100% h-160px"></div> block (size it with utilities)
132
+ // <div class="x-skeleton x-skeleton-text w-60%"></div> text line
133
+ // <div class="x-skeleton x-skeleton-circle w-40px"></div>
134
+ // vars: --x-skeleton-bg (gray200), --x-skeleton-highlight, --x-skeleton-radius (6px)
135
+ // ================================================================
136
+ 'x-skeleton': {
137
+ type: 'statement',
138
+ statement: `
139
+ x-keyframes-shimmer
140
+ @components[d-block,br--x-skeleton-radius:6px,bgc--x-skeleton-bg:gray200,background-image(linear-gradient(90deg,transparent,var(--x-skeleton-highlight,rgb(255_255_255_/_0.6)),transparent)),background-size(200%_100%),background-repeat-no-repeat,animation-name-x-shimmer,animation-duration-1.4s,animation-timing-function-ease-in-out,animation-iteration-count-infinite]
141
+ @motion-reduce-animation-name-none
142
+ `
143
+ },
144
+ 'x-skeleton-text': {
145
+ type: 'statement',
146
+ statement: `@components-[class][h-0.8em,margin-block-0.3em,br-4px]`
147
+ },
148
+ 'x-skeleton-circle': {
149
+ type: 'statement',
150
+ statement: `@components-[class][br-50%,aspect-ratio-1/1,flex-shrink-0]`
151
+ },
152
+ // ================================================================
153
+ // AVATAR
154
+ // <span class="x-avatar"><img src="…" alt="Asha Rao"></span>
155
+ // <span class="x-avatar" aria-label="Asha Rao">AR</span> (initials)
156
+ // Sizes: x-avatar-xs, -sm, -lg, -xl Shape: x-avatar-square
157
+ // vars: --x-avatar-size (40px), --x-avatar-radius (50%), --x-avatar-bg, --x-avatar-color
158
+ //
159
+ // <div class="x-avatar-group"> …avatars… </div> overlapping stack
160
+ // vars: --x-avatar-ring-color (white), --x-avatar-overlap (10px, how much avatars overlap)
161
+ // ================================================================
162
+ 'x-avatar': {
163
+ type: 'statement',
164
+ statement: `
165
+ @components[d-inline-flex,aic,jcc,flex-shrink-0,w--x-avatar-size:40px,h--x-avatar-size:40px,box-sizing-border-box,br--x-avatar-radius:50%,overflow-hidden,bgc--x-avatar-bg:gray100,c--x-avatar-color:gray600,fs(calc(var(--x-avatar-size,40px)_*_0.38)),fw-600,lh-1,text-transform-uppercase,user-select-none,vertical-align-middle]
166
+ @components__img[d-block,w-100%,h-100%,object-fit-cover]
167
+ `
168
+ },
169
+ 'x-avatar-xs': { type: 'statement', statement: `--x-avatar-size:24px` },
170
+ 'x-avatar-sm': { type: 'statement', statement: `--x-avatar-size:32px` },
171
+ 'x-avatar-lg': { type: 'statement', statement: `--x-avatar-size:48px` },
172
+ 'x-avatar-xl': { type: 'statement', statement: `--x-avatar-size:64px` },
173
+ 'x-avatar-square': { type: 'statement', statement: `--x-avatar-radius:25%` },
174
+ 'x-avatar-group': {
175
+ type: 'statement',
176
+ statement: `
177
+ --x-avatar-shift:(calc(var(--x-avatar-overlap,10px)_*_-1))
178
+ @components[d-inline-flex,aic]
179
+ @components__all[box-shadow(0_0_0_2px_var(--x-avatar-ring-color,#fff))]
180
+ @components__all--not(--first-child)-margin-inline-start--x-avatar-shift
181
+ `
182
+ },
183
+ };
184
+ export default extrasComponents;
@@ -0,0 +1,75 @@
1
+ declare const formComponents: {
2
+ 'x-button': {
3
+ type: string;
4
+ statement: string;
5
+ };
6
+ 'x-button-secondary': {
7
+ type: string;
8
+ statement: string;
9
+ };
10
+ 'x-button-ghost': {
11
+ type: string;
12
+ statement: string;
13
+ };
14
+ 'x-button-danger': {
15
+ type: string;
16
+ statement: string;
17
+ };
18
+ 'x-button-sm': {
19
+ type: string;
20
+ statement: string;
21
+ };
22
+ 'x-button-lg': {
23
+ type: string;
24
+ statement: string;
25
+ };
26
+ 'x-button-icon': {
27
+ type: string;
28
+ statement: string;
29
+ };
30
+ 'x-input': {
31
+ type: string;
32
+ statement: string;
33
+ };
34
+ 'x-textarea': {
35
+ type: string;
36
+ statement: string;
37
+ };
38
+ 'x-select': {
39
+ type: string;
40
+ statement: string;
41
+ };
42
+ 'x-checkbox': {
43
+ type: string;
44
+ statement: string;
45
+ };
46
+ 'x-radio': {
47
+ type: string;
48
+ statement: string;
49
+ };
50
+ 'x-switch': {
51
+ type: string;
52
+ statement: string;
53
+ };
54
+ 'x-field': {
55
+ type: string;
56
+ statement: string;
57
+ };
58
+ 'x-label': {
59
+ type: string;
60
+ statement: string;
61
+ };
62
+ 'x-hint': {
63
+ type: string;
64
+ statement: string;
65
+ };
66
+ 'x-error-text': {
67
+ type: string;
68
+ statement: string;
69
+ };
70
+ 'x-choice': {
71
+ type: string;
72
+ statement: string;
73
+ };
74
+ };
75
+ export default formComponents;