aliascss 1.4.5 → 1.4.7
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.
- package/dist/aliascss.js +1 -1
- package/lib/compilers/color.js +5 -5
- package/lib/compilers/gradient.js +3 -3
- package/lib/compilers/stringAndContent.js +2 -1
- package/lib/component-elements.d.ts +155 -0
- package/lib/component-elements.js +223 -0
- package/lib/config.d.ts +1 -0
- package/lib/config.js +2 -1
- package/lib/css-properties-all.js +337 -202
- package/lib/custom-css-compilers.js +54 -54
- package/lib/extras-elements.d.ts +87 -0
- package/lib/extras-elements.js +184 -0
- package/lib/form-elements.d.ts +75 -0
- package/lib/form-elements.js +186 -0
- package/lib/layout-elements.d.ts +59 -0
- package/lib/layout-elements.js +113 -0
- package/lib/nav-elements.d.ts +71 -0
- package/lib/nav-elements.js +243 -0
- package/lib/prebuild.d.ts +520 -12
- package/lib/prebuild.js +9 -852
- package/lib/prefix/PseudoPrefixNew.js +301 -16
- package/lib/prefix/attribute-selector.js +4 -2
- package/lib/prefix/pseudoSelectorNew.js +184 -49
- package/lib/prefix/responsive.d.ts +13 -9
- package/lib/prefix/responsive.js +131 -9
- package/lib/returnPropertyAndValue.js +9 -4
- package/lib/returnStatement-bk.d.ts +5 -0
- package/lib/returnStatement-bk.js +311 -0
- package/lib/returnStatement.js +165 -2
- package/lib/static/customStaticClassNames.js +35 -35
- package/lib/static/staticClassNamesAlias.js +18 -16
- package/lib/table-elements.d.ts +39 -0
- package/lib/table-elements.js +90 -0
- package/lib/utils/helper.d.ts +6 -0
- package/lib/utils/helper.js +52 -0
- package/lib/x-classes/x-bundle.d.ts +563 -0
- package/lib/x-classes/x-bundle.js +11 -0
- package/lib/x-classes/x-comps.d.ts +87 -0
- package/lib/x-classes/x-comps.js +189 -0
- package/lib/x-classes/x-extras.d.ts +155 -0
- package/lib/x-classes/x-extras.js +223 -0
- package/lib/x-classes/x-form-components.d.ts +75 -0
- package/lib/x-classes/x-form-components.js +186 -0
- package/lib/x-classes/x-helper-components.d.ts +63 -0
- package/lib/x-classes/x-helper-components.js +91 -0
- package/lib/x-classes/x-layout-components.d.ts +59 -0
- package/lib/x-classes/x-layout-components.js +113 -0
- package/lib/x-classes/x-menu.d.ts +23 -0
- package/lib/x-classes/x-menu.js +55 -0
- package/lib/x-classes/x-navs.d.ts +71 -0
- package/lib/x-classes/x-navs.js +243 -0
- package/lib/x-classes/x-table.d.ts +39 -0
- package/lib/x-classes/x-table.js +90 -0
- package/lib/x-classes/x-theme.d.ts +15 -0
- package/lib/x-classes/x-theme.js +32 -0
- package/lib/x-imports.d.ts +31 -0
- package/lib/x-imports.js +748 -0
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
36
36
|
'InsetRA': {
|
|
37
37
|
type: 'group',
|
|
38
38
|
compiler: (value, custom) => {
|
|
39
|
-
const val
|
|
39
|
+
// const val=value.replace(/^\(/,'').replace(/\)$/,'').trim();
|
|
40
40
|
const stm = `
|
|
41
41
|
--lightness-1000: 67.0121%;
|
|
42
42
|
--border-color: var(--gray-400,${color('grayRATheme400', custom)});
|
|
@@ -120,8 +120,8 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
120
120
|
compiler: (value, custom) => {
|
|
121
121
|
const val = value.replace(/^\(/, '').replace(/\)$/, '').trim();
|
|
122
122
|
const stm = `
|
|
123
|
-
${val ? '--accentColor:' + color(val, custom) +
|
|
124
|
-
--
|
|
123
|
+
${val ? ('--accentColor:' + color(val, custom) + ";") : ''}
|
|
124
|
+
--button-color: ${color('accentRA', custom)};
|
|
125
125
|
--button-background: ${color('accentRATheme100', custom)};
|
|
126
126
|
--button-gradient:${color('accentRATheme200', custom)};
|
|
127
127
|
--button-border: ${color('accentRATheme300', custom)};
|
|
@@ -150,7 +150,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
150
150
|
-webkit-tap-highlight-color: transparent;
|
|
151
151
|
|
|
152
152
|
@media (prefers-color-scheme: dark) {
|
|
153
|
-
--button-shadow: ${color('accentRATheme200', custom)}
|
|
153
|
+
--button-shadow: ${color('accentRATheme200', custom)};
|
|
154
154
|
--button-highlight: rgb(255 255 255 / 0.15);
|
|
155
155
|
box-shadow:
|
|
156
156
|
inset 0 var(--button-border-size) 0 var(--button-highlight), /* top specular highlight */
|
|
@@ -179,7 +179,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
179
179
|
|
|
180
180
|
&:where([data-hovered], [data-pressed]) {
|
|
181
181
|
--button-background: ${color('accentRATheme200', custom)};
|
|
182
|
-
--button-text:
|
|
182
|
+
--button-text: ${color('accentRATheme1400', custom)};
|
|
183
183
|
box-shadow: 0 0 0 1px ${color('accentRATheme200', custom)};
|
|
184
184
|
}
|
|
185
185
|
}
|
|
@@ -471,8 +471,8 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
471
471
|
'padding-x': {
|
|
472
472
|
type: 'group',
|
|
473
473
|
compiler: (y) => {
|
|
474
|
-
if (/^--[a-
|
|
475
|
-
return `padding-left
|
|
474
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
475
|
+
return `padding-left:${cssVarWithDefault(y, length)};padding-right:${cssVarWithDefault(y, length)}`;
|
|
476
476
|
}
|
|
477
477
|
const value = y.split('-');
|
|
478
478
|
if (value.length === 3) {
|
|
@@ -501,7 +501,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
501
501
|
}, 'px': {
|
|
502
502
|
type: 'group',
|
|
503
503
|
compiler: (y) => {
|
|
504
|
-
if (/^--[a-
|
|
504
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
505
505
|
return `padding-left:var(${y});padding-right:var(${y})`;
|
|
506
506
|
}
|
|
507
507
|
const value = y.split('-');
|
|
@@ -531,7 +531,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
531
531
|
}, 'padding-y': {
|
|
532
532
|
type: 'group',
|
|
533
533
|
compiler: (y) => {
|
|
534
|
-
if (/^--[a-
|
|
534
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
535
535
|
return `padding-top:var(${y});padding-bottom:var(${y})`;
|
|
536
536
|
}
|
|
537
537
|
const value = y.split('-');
|
|
@@ -547,21 +547,21 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
547
547
|
},
|
|
548
548
|
groups: {
|
|
549
549
|
0: "padding-top:0;padding-bottom:0",
|
|
550
|
-
1: `padding-top:var(--space-1,${1 / 4}rem);padding-bottom:var(--space-1
|
|
551
|
-
2: `padding-top:var(--space-2
|
|
552
|
-
3: `padding-top:var(--space-3
|
|
553
|
-
4: `padding-top:var(--space-4
|
|
554
|
-
5: `padding-top:var(--space-5
|
|
555
|
-
6: `padding-top:var(--space-6
|
|
556
|
-
7: `padding-top:var(--space-7
|
|
557
|
-
8: `padding-top:var(--space-8
|
|
558
|
-
9: `padding-top:var(--space-9
|
|
559
|
-
10: `padding-top:var(--space-10
|
|
550
|
+
1: `padding-top:var(--space-1,${1 / 4}rem);padding-bottom:var(--space-1,${1 / 4}rem)`,
|
|
551
|
+
2: `padding-top:var(--space-2,${2 / 4}rem);padding-bottom:var(--space-2,${2 / 4}rem)`,
|
|
552
|
+
3: `padding-top:var(--space-3,${3 / 4}rem);padding-bottom:var(--space-3,${3 / 4}rem)`,
|
|
553
|
+
4: `padding-top:var(--space-4,${4 / 4}rem);padding-bottom:var(--space-4,${4 / 4}rem)`,
|
|
554
|
+
5: `padding-top:var(--space-5,${5 / 4}rem);padding-bottom:var(--space-5,${5 / 4}rem)`,
|
|
555
|
+
6: `padding-top:var(--space-6,${6 / 4}rem);padding-bottom:var(--space-6,${6 / 4}rem)`,
|
|
556
|
+
7: `padding-top:var(--space-7,${7 / 4}rem);padding-bottom:var(--space-7,${7 / 4}rem)`,
|
|
557
|
+
8: `padding-top:var(--space-8,${8 / 4}rem);padding-bottom:var(--space-8,${8 / 4}rem)`,
|
|
558
|
+
9: `padding-top:var(--space-9,${9 / 4}rem);padding-bottom:var(--space-9,${9 / 4}rem)`,
|
|
559
|
+
10: `padding-top:var(--space-10,${10 / 4}rem);padding-bottom:var(--space-10,${10 / 4}rem)`,
|
|
560
560
|
},
|
|
561
561
|
}, 'py': {
|
|
562
562
|
type: 'group',
|
|
563
563
|
compiler: (y) => {
|
|
564
|
-
if (/^--[a-
|
|
564
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
565
565
|
return `padding-top:var(${y});padding-bottom:var(${y})`;
|
|
566
566
|
}
|
|
567
567
|
const value = y.split('-');
|
|
@@ -593,7 +593,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
593
593
|
'margin-x': {
|
|
594
594
|
type: 'group',
|
|
595
595
|
compiler: (y) => {
|
|
596
|
-
if (/^--[a-
|
|
596
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
597
597
|
return `margin-left:var(${y});margin-right:var(${y})`;
|
|
598
598
|
}
|
|
599
599
|
const value = y.replace(/--/g, '-M').split('-');
|
|
@@ -633,7 +633,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
633
633
|
}, 'mx': {
|
|
634
634
|
type: 'group',
|
|
635
635
|
compiler: (y) => {
|
|
636
|
-
if (/^--[a-
|
|
636
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
637
637
|
return `margin-left:var(${y});margin-right:var(${y})`;
|
|
638
638
|
}
|
|
639
639
|
const value = y.replace(/--/g, '-M').split('-');
|
|
@@ -673,7 +673,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
673
673
|
}, 'margin-y': {
|
|
674
674
|
type: 'group',
|
|
675
675
|
compiler: (y) => {
|
|
676
|
-
if (/^--[a-
|
|
676
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
677
677
|
return `margin-top:var(${y});margin-bottom:var(${y})`;
|
|
678
678
|
}
|
|
679
679
|
const value = y.replace(/--/g, '-M').split('-');
|
|
@@ -713,7 +713,7 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
713
713
|
}, 'my': {
|
|
714
714
|
type: 'group',
|
|
715
715
|
compiler: (y) => {
|
|
716
|
-
if (/^--[a-
|
|
716
|
+
if (/^--[a-zA-Z]/.test(y)) {
|
|
717
717
|
return `margin-top:var(${y});margin-bottom:var(${y})`;
|
|
718
718
|
}
|
|
719
719
|
const value = y.replace(/--/g, '-M').split('-');
|
|
@@ -755,14 +755,14 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
755
755
|
'x-row': {
|
|
756
756
|
type: 'group',
|
|
757
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);`;
|
|
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
759
|
},
|
|
760
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,
|
|
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,
|
|
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,
|
|
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,
|
|
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,4px) * -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,8px) * -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,24px) * -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,32px) * -0.5);`,
|
|
766
766
|
},
|
|
767
767
|
}, 'x-col': {
|
|
768
768
|
type: 'group',
|
|
@@ -797,42 +797,42 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
797
797
|
v = cssVarWithDefault(value) || '';
|
|
798
798
|
}
|
|
799
799
|
else {
|
|
800
|
-
v = value.replace(/^-([-]?[\d])/g, '$1').replace(/([
|
|
800
|
+
v = value.replace(/^-([-]?[\d])/g, '$1').replace(/([\d])p$/, '$1%');
|
|
801
801
|
}
|
|
802
802
|
const val = `calc(${v} - var(--x-square-shrink, 0px) + var(--x-square-grow, 0px))`;
|
|
803
803
|
return `width:${val};height:${val};flex: 0 0 ${val}`;
|
|
804
804
|
},
|
|
805
805
|
groups: {
|
|
806
806
|
'0': 'width:0px;height:0px;flex: 0 0 0px',
|
|
807
|
-
'1': `width:var(--space-1,${1 / 4}rem;height:
|
|
808
|
-
'2': `width:var(--space-2,${2 / 4}rem;height:
|
|
809
|
-
'3': `width:var(--space-3,${3 / 4}rem;height:
|
|
810
|
-
'4': `width:var(--space-4,${4 / 4}rem;height:
|
|
811
|
-
'5': `width:var(--space-5,${5 / 4}rem;height:
|
|
812
|
-
'6': `width:var(--space-6,${6 / 4}rem;height:
|
|
813
|
-
'7': `width:var(--space-7,${7 / 4}rem;height:
|
|
814
|
-
'8': `width:var(--space-8,${8 / 4}rem;height:
|
|
815
|
-
'9': `width:var(--space-9,${9 / 4}rem;height:
|
|
816
|
-
'10': `width:var(--space-10,${10 / 4}rem;height:
|
|
817
|
-
'12': `width:var(--space-12,${12 / 4}rem;height:
|
|
818
|
-
'16': `width:var(--space-16,${16 / 4}rem;height:
|
|
819
|
-
'20': `width:var(--space-20,${20 / 4}rem;height:
|
|
820
|
-
'32': `width:var(--space-32,${32 / 4}rem;height:
|
|
807
|
+
'1': `width:var(--space-1,${1 / 4}rem);height:var(--space-1,${1 / 4}rem);flex: 0 0 var(--space-1,${1 / 4}rem)`,
|
|
808
|
+
'2': `width:var(--space-2,${2 / 4}rem);height:var(--space-2,${2 / 4}rem);flex: 0 0 var(--space-2,${2 / 4}rem)`,
|
|
809
|
+
'3': `width:var(--space-3,${3 / 4}rem);height:var(--space-3,${3 / 4}rem);flex: 0 0 var(--space-3,${3 / 4}rem)`,
|
|
810
|
+
'4': `width:var(--space-4,${4 / 4}rem);height:var(--space-4,${4 / 4}rem);flex: 0 0 var(--space-4,${4 / 4}rem)`,
|
|
811
|
+
'5': `width:var(--space-5,${5 / 4}rem);height:var(--space-5,${5 / 4}rem);flex: 0 0 var(--space-5,${5 / 4}rem)`,
|
|
812
|
+
'6': `width:var(--space-6,${6 / 4}rem);height:var(--space-6,${6 / 4}rem);flex: 0 0 var(--space-6,${6 / 4}rem)`,
|
|
813
|
+
'7': `width:var(--space-7,${7 / 4}rem);height:var(--space-7,${7 / 4}rem);flex: 0 0 var(--space-7,${7 / 4}rem)`,
|
|
814
|
+
'8': `width:var(--space-8,${8 / 4}rem);height:var(--space-8,${8 / 4}rem);flex: 0 0 var(--space-8,${8 / 4}rem)`,
|
|
815
|
+
'9': `width:var(--space-9,${9 / 4}rem);height:var(--space-9,${9 / 4}rem);flex: 0 0 var(--space-9,${9 / 4}rem)`,
|
|
816
|
+
'10': `width:var(--space-10,${10 / 4}rem);height:var(--space-10,${10 / 4}rem);flex: 0 0 var(--space-10,${10 / 4}rem)`,
|
|
817
|
+
'12': `width:var(--space-12,${12 / 4}rem);height:var(--space-12,${12 / 4}rem);flex: 0 0 var(--space-12,${12 / 4}rem)`,
|
|
818
|
+
'16': `width:var(--space-16,${16 / 4}rem);height:var(--space-16,${16 / 4}rem);flex: 0 0 var(--space-16,${16 / 4}rem)`,
|
|
819
|
+
'20': `width:var(--space-20,${20 / 4}rem);height:var(--space-20,${20 / 4}rem);flex: 0 0 var(--space-20,${20 / 4}rem)`,
|
|
820
|
+
'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
821
|
'xs': 'width:4px;height:4px;flex: 0 0 4px',
|
|
822
822
|
'sm': 'width:8px;height:8px;flex: 0 0 8px',
|
|
823
823
|
'md': 'width:16px;height:16px;flex: 0 0 16px',
|
|
824
|
-
'lg': 'width:24px;height:
|
|
825
|
-
'xl': 'width:32px;height:
|
|
826
|
-
'xxl': 'width:64px;height:
|
|
824
|
+
'lg': 'width:24px;height:24px;flex: 0 0 24px',
|
|
825
|
+
'xl': 'width:32px;height:32px;flex: 0 0 32px',
|
|
826
|
+
'xxl': 'width:64px;height:64px;flex: 0 0 64px',
|
|
827
827
|
}
|
|
828
828
|
}, 'x-width': {
|
|
829
829
|
type: 'group',
|
|
830
830
|
compiler: (value) => {
|
|
831
831
|
if (/^--[a-zA-Z]/.test(value)) {
|
|
832
832
|
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))`;
|
|
833
|
+
const val = value.slice(value.indexOf(':')); // .replace(':','');
|
|
834
|
+
const cssVar = value.replace(val, ''); // .replace(':','');
|
|
835
|
+
return `width:calc(var(${cssVar},${val.replace(':', '')}) + var(--x-width-grow,0px) - var(--x-width-shrink,0px))`;
|
|
836
836
|
}
|
|
837
837
|
return `width:calc(var(${value}) + var(--x-width-grow,0px) - var(--x-width-shrink,0px))`;
|
|
838
838
|
}
|
|
@@ -843,9 +843,9 @@ const cssCustomCompilers = Object.assign(Object.assign({}, prebuild), {
|
|
|
843
843
|
compiler: (value) => {
|
|
844
844
|
if (/^--[a-zA-Z]/.test(value)) {
|
|
845
845
|
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))`;
|
|
846
|
+
const val = value.slice(value.indexOf(':')); // .replace(':','');
|
|
847
|
+
const cssVar = value.replace(val, ''); // .replace(':','');
|
|
848
|
+
return `height:calc(var(${cssVar},${val.replace(':', '')}) + var(--x-height-grow,0px) - var(--x-height-shrink,0px))`;
|
|
849
849
|
}
|
|
850
850
|
return `height:calc(var(${value}) + var(--x-height-grow,0px) - var(--x-height-shrink,0px))`;
|
|
851
851
|
}
|
|
@@ -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;
|