aliascss 1.4.4 → 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.
Files changed (63) hide show
  1. package/aliascss.config.js +32 -32
  2. package/dist/aliascss.js +1 -1
  3. package/lib/compilers/color.js +5 -5
  4. package/lib/compilers/gradient.js +3 -3
  5. package/lib/compilers/stringAndContent.js +2 -1
  6. package/lib/component-elements.d.ts +155 -0
  7. package/lib/component-elements.js +223 -0
  8. package/lib/config.d.ts +1 -0
  9. package/lib/config.js +2 -1
  10. package/lib/css-properties-all.js +337 -202
  11. package/lib/custom-css-compilers.js +54 -54
  12. package/lib/extras-elements.d.ts +87 -0
  13. package/lib/extras-elements.js +184 -0
  14. package/lib/form-elements.d.ts +75 -0
  15. package/lib/form-elements.js +186 -0
  16. package/lib/layout-elements.d.ts +59 -0
  17. package/lib/layout-elements.js +113 -0
  18. package/lib/nav-elements.d.ts +71 -0
  19. package/lib/nav-elements.js +243 -0
  20. package/lib/node/compileFile-bk.d.ts +27 -0
  21. package/lib/node/compileFile-bk.js +379 -0
  22. package/lib/node/compileFile.d.ts +11 -11
  23. package/lib/node/compileFile.js +170 -235
  24. package/lib/prebuild.d.ts +520 -12
  25. package/lib/prebuild.js +9 -852
  26. package/lib/prefix/PseudoPrefixNew.js +301 -16
  27. package/lib/prefix/attribute-selector.js +4 -2
  28. package/lib/prefix/pseudoSelectorNew.js +184 -49
  29. package/lib/prefix/responsive.d.ts +13 -9
  30. package/lib/prefix/responsive.js +131 -9
  31. package/lib/returnPropertyAndValue.js +9 -4
  32. package/lib/returnStatement-bk.d.ts +5 -0
  33. package/lib/returnStatement-bk.js +311 -0
  34. package/lib/returnStatement.js +165 -2
  35. package/lib/static/customStaticClassNames.js +35 -35
  36. package/lib/static/staticClassNamesAlias.js +18 -16
  37. package/lib/table-elements.d.ts +39 -0
  38. package/lib/table-elements.js +90 -0
  39. package/lib/utils/helper.d.ts +6 -0
  40. package/lib/utils/helper.js +52 -0
  41. package/lib/x-classes/x-bundle.d.ts +563 -0
  42. package/lib/x-classes/x-bundle.js +11 -0
  43. package/lib/x-classes/x-comps.d.ts +87 -0
  44. package/lib/x-classes/x-comps.js +189 -0
  45. package/lib/x-classes/x-extras.d.ts +155 -0
  46. package/lib/x-classes/x-extras.js +223 -0
  47. package/lib/x-classes/x-form-components.d.ts +75 -0
  48. package/lib/x-classes/x-form-components.js +186 -0
  49. package/lib/x-classes/x-helper-components.d.ts +63 -0
  50. package/lib/x-classes/x-helper-components.js +91 -0
  51. package/lib/x-classes/x-layout-components.d.ts +59 -0
  52. package/lib/x-classes/x-layout-components.js +113 -0
  53. package/lib/x-classes/x-menu.d.ts +23 -0
  54. package/lib/x-classes/x-menu.js +55 -0
  55. package/lib/x-classes/x-navs.d.ts +71 -0
  56. package/lib/x-classes/x-navs.js +243 -0
  57. package/lib/x-classes/x-table.d.ts +39 -0
  58. package/lib/x-classes/x-table.js +90 -0
  59. package/lib/x-classes/x-theme.d.ts +15 -0
  60. package/lib/x-classes/x-theme.js +32 -0
  61. package/lib/x-imports.d.ts +31 -0
  62. package/lib/x-imports.js +748 -0
  63. package/package.json +1 -1
@@ -0,0 +1,189 @@
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 moreComponents = {
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 (slateTheme2), --x-form-addon-color (slateTheme11)
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:slateTheme2,c--x-form-addon-color:slateTheme11,border-width-1px,border-style-solid,border-color--x-form-border-color:slateTheme7,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
+ --x-range-fill-color:--x-form-accent-color:accentRA1000
65
+ --x-range-track-color:--x-range-track-bg:slateTheme5
66
+ --x-range-ring-color:--x-form-ring-color:accentRATheme400
67
+ @base-[appearance-none,m-0]
68
+ @components[d-block,w-100%,h--x-range-thumb-size:18px,bgc-transparent,cursor-pointer]
69
+ @components--webkit-slider-runnable-track[h--x-range-track-height:6px,br-999px,background(linear-gradient(var(--x-range-fill-color),var(--x-range-fill-color))_0_/_var(--x-range-fill,0%)_100%_no-repeat,var(--x-range-track-color))]
70
+ @components--moz-range-track[h--x-range-track-height:6px,br-999px,bgc--x-range-track-bg:slateTheme5]
71
+ @components--moz-range-progress[h--x-range-track-height:6px,br-999px,bgc--x-form-accent-color:accentRA1000]
72
+ @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:accentRA1000,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))]
73
+ @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:accentRA1000,box-shadow(0_1px_2px_rgb(16_24_40_/_0.2))]
74
+ @components--focus-visible--webkit-slider-thumb-box-shadow(0_0_0_4px_var(--x-range-ring-color))
75
+ @components--focus-visible--moz-range-thumb-box-shadow(0_0_0_4px_var(--x-range-ring-color))
76
+ @components--focus-visible-outline-none
77
+ @components--disabled[o-0.5,cursor-not-allowed]
78
+ `
79
+ },
80
+ // ================================================================
81
+ // FILE INPUT
82
+ // <input type="file" class="x-file">
83
+ // vars: --x-file-hover-bg (slateTheme3) + the shared --x-form-* variables
84
+ // ================================================================
85
+ 'x-file': {
86
+ type: 'statement',
87
+ statement: `
88
+ @components[d-block,w-100%,fs-14px,lh-20px,c--x-form-hint-color:slateTheme11,cursor-pointer]
89
+ @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:slateTheme7,bgc--x-form-bg:slateTheme1,c--x-form-color:slateTheme12,ff-inherit,fs-14px,fw-600,cursor-pointer,transition-property-background-color,transition-duration-0.15s]
90
+ @components--hover--file-selector-button-bgc--x-file-hover-bg:slateTheme3
91
+ @components--focus-visible[outline-style-solid,outline-width-2px,outline-color--x-form-accent-color:accentRA1000,outline-offset-2px,br--x-form-radius:8px]
92
+ @components--disabled[o-0.5,cursor-not-allowed]
93
+ `
94
+ },
95
+ // ================================================================
96
+ // PROGRESS (native <progress>)
97
+ // <progress class="x-progress" value="60" max="100"></progress>
98
+ // <progress class="x-progress"></progress> (no value = indeterminate, animated)
99
+ // vars: --x-progress-height (8px), --x-progress-track-bg (slateTheme5), --x-form-accent-color
100
+ // ================================================================
101
+ 'x-progress': {
102
+ type: 'statement',
103
+ statement: `
104
+ x-keyframes-progress
105
+ --x-progress-fill-color:--x-form-accent-color:accentRA1000
106
+ --x-progress-track-color:--x-progress-track-bg:slateTheme5
107
+ @base-[appearance-none,border-width-0px]
108
+ @components[d-block,w-100%,h--x-progress-height:8px,br-999px,overflow-hidden,bgc--x-progress-track-bg:slateTheme5,c--x-form-accent-color:accentRA1000]
109
+ @components--webkit-progress-bar[bgc--x-progress-track-bg:slateTheme5,br-999px]
110
+ @components--webkit-progress-value[bgc--x-form-accent-color:accentRA1000,br-999px,transition-property-width,transition-duration-0.3s]
111
+ @components--moz-progress-bar[bgc--x-form-accent-color:accentRA1000,br-999px]
112
+ @components--indeterminate[background(linear-gradient(90deg,transparent,var(--x-progress-fill-color),transparent)_var(--x-progress-track-color)),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]
113
+ @components--indeterminate--webkit-progress-bar-bgc-transparent
114
+ @components--indeterminate--moz-progress-bar-bgc-transparent
115
+ @motion-reduce--indeterminate-animation-duration-3s
116
+ `
117
+ },
118
+ // ================================================================
119
+ // SPINNER
120
+ // <span class="x-spinner" role="status" aria-label="Loading"></span>
121
+ // Color follows currentColor (use c-* utilities). Sizes: x-spinner-sm, x-spinner-lg
122
+ // vars: --x-spinner-size (20px), --x-spinner-width (2px)
123
+ // ================================================================
124
+ 'x-spinner': {
125
+ type: 'statement',
126
+ statement: `
127
+ x-keyframes-spin
128
+ @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]
129
+ @motion-reduce-animation-duration-1.5s
130
+ `
131
+ },
132
+ 'x-spinner-sm': { type: 'statement', statement: `--x-spinner-size:14px --x-spinner-width:2px` },
133
+ 'x-spinner-lg': { type: 'statement', statement: `--x-spinner-size:32px --x-spinner-width:3px` },
134
+ // ================================================================
135
+ // SKELETON
136
+ // <div class="x-skeleton w-100% h-160px"></div> block (size it with utilities)
137
+ // <div class="x-skeleton x-skeleton-text w-60%"></div> text line
138
+ // <div class="x-skeleton x-skeleton-circle w-40px"></div>
139
+ // vars: --x-skeleton-bg (slateTheme4), --x-skeleton-highlight, --x-skeleton-radius (6px)
140
+ // ================================================================
141
+ 'x-skeleton': {
142
+ type: 'statement',
143
+ statement: `
144
+ x-keyframes-shimmer
145
+ @components[d-block,br--x-skeleton-radius:6px,bgc--x-skeleton-bg:slateTheme4,background-image(linear-gradient(90deg,transparent,var(--x-skeleton-highlight,light-dark(rgb(255_255_255_/_0.6),rgb(255_255_255_/_0.06))),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]
146
+ @motion-reduce-animation-name-none
147
+ `
148
+ },
149
+ 'x-skeleton-text': {
150
+ type: 'statement',
151
+ statement: `@components-[class][h-0.8em,margin-block-0.3em,br-4px]`
152
+ },
153
+ 'x-skeleton-circle': {
154
+ type: 'statement',
155
+ statement: `@components-[class][br-50%,aspect-ratio-1/1,flex-shrink-0]`
156
+ },
157
+ // ================================================================
158
+ // AVATAR
159
+ // <span class="x-avatar"><img src="…" alt="Asha Rao"></span>
160
+ // <span class="x-avatar" aria-label="Asha Rao">AR</span> (initials)
161
+ // Sizes: x-avatar-xs, -sm, -lg, -xl Shape: x-avatar-square
162
+ // vars: --x-avatar-size (40px), --x-avatar-radius (50%), --x-avatar-bg, --x-avatar-color
163
+ //
164
+ // <div class="x-avatar-group"> …avatars… </div> overlapping stack
165
+ // vars: --x-avatar-ring-color (slateTheme1, match your page background), --x-avatar-overlap (10px, how much avatars overlap)
166
+ // ================================================================
167
+ 'x-avatar': {
168
+ type: 'statement',
169
+ statement: `
170
+ @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:slateTheme3,c--x-avatar-color:slateTheme11,fs(calc(var(--x-avatar-size,40px)_*_0.38)),fw-600,lh-1,text-transform-uppercase,user-select-none,vertical-align-middle]
171
+ @components__img[d-block,w-100%,h-100%,object-fit-cover]
172
+ `
173
+ },
174
+ 'x-avatar-xs': { type: 'statement', statement: `--x-avatar-size:24px` },
175
+ 'x-avatar-sm': { type: 'statement', statement: `--x-avatar-size:32px` },
176
+ 'x-avatar-lg': { type: 'statement', statement: `--x-avatar-size:48px` },
177
+ 'x-avatar-xl': { type: 'statement', statement: `--x-avatar-size:64px` },
178
+ 'x-avatar-square': { type: 'statement', statement: `--x-avatar-radius:25%` },
179
+ 'x-avatar-group': {
180
+ type: 'statement',
181
+ statement: `
182
+ --x-avatar-group-ring-color:--x-avatar-ring-color:slateTheme1
183
+ @components[d-inline-flex,aic]
184
+ @components__all[box-shadow(0_0_0_2px_var(--x-avatar-group-ring-color))]
185
+ @components__all--not(--first-child)-margin-inline-start(calc(var(--x-avatar-overlap,10px)*-1))
186
+ `
187
+ },
188
+ };
189
+ export default moreComponents;
@@ -0,0 +1,155 @@
1
+ declare const components: {
2
+ 'x-card': {
3
+ type: string;
4
+ statement: string;
5
+ };
6
+ 'x-card-header': {
7
+ type: string;
8
+ statement: string;
9
+ };
10
+ 'x-card-body': {
11
+ type: string;
12
+ statement: string;
13
+ };
14
+ 'x-card-footer': {
15
+ type: string;
16
+ statement: string;
17
+ };
18
+ 'x-card-media': {
19
+ type: string;
20
+ statement: string;
21
+ };
22
+ 'x-card-title': {
23
+ type: string;
24
+ statement: string;
25
+ };
26
+ 'x-card-description': {
27
+ type: string;
28
+ statement: string;
29
+ };
30
+ 'x-card-elevated': {
31
+ type: string;
32
+ statement: string;
33
+ };
34
+ 'x-card-flat': {
35
+ type: string;
36
+ statement: string;
37
+ };
38
+ 'x-card-interactive': {
39
+ type: string;
40
+ statement: string;
41
+ };
42
+ 'x-badge': {
43
+ type: string;
44
+ statement: string;
45
+ };
46
+ 'x-badge-primary': {
47
+ type: string;
48
+ statement: string;
49
+ };
50
+ 'x-badge-success': {
51
+ type: string;
52
+ statement: string;
53
+ };
54
+ 'x-badge-warning': {
55
+ type: string;
56
+ statement: string;
57
+ };
58
+ 'x-badge-error': {
59
+ type: string;
60
+ statement: string;
61
+ };
62
+ 'x-badge-info': {
63
+ type: string;
64
+ statement: string;
65
+ };
66
+ 'x-badge-dot': {
67
+ type: string;
68
+ statement: string;
69
+ };
70
+ 'x-badge-sm': {
71
+ type: string;
72
+ statement: string;
73
+ };
74
+ 'x-badge-lg': {
75
+ type: string;
76
+ statement: string;
77
+ };
78
+ 'x-badge-square': {
79
+ type: string;
80
+ statement: string;
81
+ };
82
+ 'x-alert': {
83
+ type: string;
84
+ statement: string;
85
+ };
86
+ 'x-alert-title': {
87
+ type: string;
88
+ statement: string;
89
+ };
90
+ 'x-alert-info': {
91
+ type: string;
92
+ statement: string;
93
+ };
94
+ 'x-alert-success': {
95
+ type: string;
96
+ statement: string;
97
+ };
98
+ 'x-alert-warning': {
99
+ type: string;
100
+ statement: string;
101
+ };
102
+ 'x-alert-error': {
103
+ type: string;
104
+ statement: string;
105
+ };
106
+ 'x-alert-accent': {
107
+ type: string;
108
+ statement: string;
109
+ };
110
+ 'x-dialog': {
111
+ type: string;
112
+ statement: string;
113
+ };
114
+ 'x-dialog-header': {
115
+ type: string;
116
+ statement: string;
117
+ };
118
+ 'x-dialog-title': {
119
+ type: string;
120
+ statement: string;
121
+ };
122
+ 'x-dialog-body': {
123
+ type: string;
124
+ statement: string;
125
+ };
126
+ 'x-dialog-footer': {
127
+ type: string;
128
+ statement: string;
129
+ };
130
+ 'x-dialog-sm': {
131
+ type: string;
132
+ statement: string;
133
+ };
134
+ 'x-dialog-lg': {
135
+ type: string;
136
+ statement: string;
137
+ };
138
+ 'x-dialog-sheet': {
139
+ type: string;
140
+ statement: string;
141
+ };
142
+ 'x-accordion-group': {
143
+ type: string;
144
+ statement: string;
145
+ };
146
+ 'x-accordion': {
147
+ type: string;
148
+ statement: string;
149
+ };
150
+ 'x-accordion-content': {
151
+ type: string;
152
+ statement: string;
153
+ };
154
+ };
155
+ export default components;
@@ -0,0 +1,223 @@
1
+ // AliasCSS components: card, badge, alert, dialog, accordion
2
+ // ------------------------------------------------------------------
3
+ // Same conventions as the form and table components:
4
+ // - styles live in @components, so plain utilities always override them
5
+ // - everything is themeable through --x-* variables with token fallbacks
6
+ // - variants mostly just set variables, so they combine freely
7
+ // ------------------------------------------------------------------
8
+ const components = {
9
+ // ================================================================
10
+ // CARD
11
+ // <article class="x-card">
12
+ // <img class="x-card-media" src="…" alt="">
13
+ // <header class="x-card-header">
14
+ // <div><h3 class="x-card-title">Title</h3><p class="x-card-description">Subtitle</p></div>
15
+ // </header>
16
+ // <div class="x-card-body">…</div>
17
+ // <footer class="x-card-footer">…buttons…</footer>
18
+ // </article>
19
+ // Variants: x-card-elevated, x-card-flat, x-card-interactive
20
+ // Vars: --x-card-bg, --x-card-color, --x-card-border-color, --x-card-divider-color,
21
+ // --x-card-radius, --x-card-padding (as (20px) or (16px_20px)), --x-card-shadow
22
+ // ================================================================
23
+ 'x-card': {
24
+ type: 'statement',
25
+ statement: `
26
+ @components[d-flex,flex-direction-column,box-sizing-border-box,overflow-hidden,bgc--x-card-bg:slateTheme1,c--x-card-color:slateTheme12,border-width-1px,border-style-solid,border-color--x-card-border-color:slateTheme6,br--x-card-radius:12px,box-shadow(var(--x-card-shadow,none))]
27
+ `
28
+ },
29
+ 'x-card-header': {
30
+ type: 'statement',
31
+ statement: `@components[d-flex,aifs,jcsb,g-12px,padding(var(--x-card-padding,20px)),border-bottom-width-1px,border-bottom-style-solid,border-bottom-color--x-card-divider-color:slateTheme6]`
32
+ },
33
+ 'x-card-body': {
34
+ type: 'statement',
35
+ statement: `@components[padding(var(--x-card-padding,20px)),flex-grow-1]`
36
+ },
37
+ 'x-card-footer': {
38
+ type: 'statement',
39
+ statement: `@components[d-flex,aic,jc-flex-end,g-8px,padding(var(--x-card-padding,20px)),border-top-width-1px,border-top-style-solid,border-top-color--x-card-divider-color:slateTheme6]`
40
+ },
41
+ 'x-card-media': {
42
+ type: 'statement',
43
+ statement: `@components[d-block,w-100%,object-fit-cover,aspect-ratio--x-card-media-ratio:16/9]`
44
+ },
45
+ 'x-card-title': {
46
+ type: 'statement',
47
+ statement: `@components[m-0,fs-16px,fw-600,lh-24px]`
48
+ },
49
+ 'x-card-description': {
50
+ type: 'statement',
51
+ statement: `@components[m-0,fs-14px,lh-20px,c--x-card-muted-color:slateTheme11]`
52
+ },
53
+ 'x-card-elevated': {
54
+ type: 'statement',
55
+ statement: `--x-card-border-color:transparent --x-card-shadow:(0_1px_3px_rgb(16_24_40_/_0.1),0_1px_2px_rgb(16_24_40_/_0.06))`
56
+ },
57
+ 'x-card-flat': {
58
+ type: 'statement',
59
+ statement: `--x-card-border-color:transparent --x-card-bg:slateTheme3`
60
+ },
61
+ // Whole card is clickable (e.g. contains a stretched link)
62
+ 'x-card-interactive': {
63
+ type: 'statement',
64
+ statement: `
65
+ @components[cursor-pointer,transition-property-transform__box-shadow__border-color,transition-duration-0.2s]
66
+ @components--hover[tf-translateY--2px,border-color--x-card-hover-border-color:slateTheme8,box-shadow(0_12px_24px_-6px_rgb(16_24_40_/_0.12))]
67
+ @components--focus-within[outline-style-solid,outline-width-2px,outline-color--x-form-accent-color:accentRA1000,outline-offset-2px]
68
+ @motion-reduce--hover-tf-none
69
+ `
70
+ },
71
+ // ================================================================
72
+ // BADGE
73
+ // <span class="x-badge x-badge-success x-badge-dot">Active</span>
74
+ // Colors: x-badge-primary, -success, -warning, -error, -info (default is neutral gray)
75
+ // Options: x-badge-dot (status dot), x-badge-sm, x-badge-lg, x-badge-square
76
+ // Vars: --x-badge-bg, --x-badge-color, --x-badge-border-color, --x-badge-height, --x-badge-radius
77
+ // ================================================================
78
+ 'x-badge': {
79
+ type: 'statement',
80
+ statement: `@components[d-inline-flex,aic,g-6px,h--x-badge-height:22px,padding-inline--x-badge-padding:8px,box-sizing-border-box,br--x-badge-radius:999px,fs--x-badge-font-size:12px,fw-500,lh-1,white-space-nowrap,vertical-align-middle,bgc--x-badge-bg:slateTheme3,c--x-badge-color:slateTheme11,border-width-1px,border-style-solid,border-color--x-badge-border-color:slateTheme6]`
81
+ },
82
+ 'x-badge-primary': { type: 'statement', statement: `--x-badge-bg:accentRATheme200 --x-badge-color:accentRATheme1200 --x-badge-border-color:accentRATheme400` },
83
+ 'x-badge-success': { type: 'statement', statement: `--x-badge-bg:greenTheme3 --x-badge-color:greenTheme11 --x-badge-border-color:greenTheme6` },
84
+ 'x-badge-warning': { type: 'statement', statement: `--x-badge-bg:amberTheme3 --x-badge-color:amberTheme11 --x-badge-border-color:amberTheme6` },
85
+ 'x-badge-error': { type: 'statement', statement: `--x-badge-bg:redTheme3 --x-badge-color:redTheme11 --x-badge-border-color:redTheme6` },
86
+ 'x-badge-info': { type: 'statement', statement: `--x-badge-bg:blueTheme3 --x-badge-color:blueTheme11 --x-badge-border-color:blueTheme6` },
87
+ 'x-badge-dot': {
88
+ type: 'statement',
89
+ statement: `@components--before[cont,flex-shrink-0,w-6px,h-6px,br-50%,bgc-currentColor]`
90
+ },
91
+ 'x-badge-sm': { type: 'statement', statement: `--x-badge-height:18px --x-badge-padding:6px --x-badge-font-size:11px` },
92
+ 'x-badge-lg': { type: 'statement', statement: `--x-badge-height:26px --x-badge-padding:10px --x-badge-font-size:14px` },
93
+ 'x-badge-square': { type: 'statement', statement: `--x-badge-radius:6px` },
94
+ // ================================================================
95
+ // ALERT
96
+ // <div class="x-alert x-alert-warning" role="alert">
97
+ // <svg …></svg> (optional icon)
98
+ // <div>
99
+ // <p class="x-alert-title">Heads up</p>
100
+ // <p>Message text.</p>
101
+ // </div>
102
+ // </div>
103
+ // Colors: x-alert-info, -success, -warning, -error (default is neutral)
104
+ // Options: x-alert-accent (thick left border)
105
+ // Vars: --x-alert-bg, --x-alert-color, --x-alert-border-color, --x-alert-icon-color, --x-alert-radius
106
+ // ================================================================
107
+ 'x-alert': {
108
+ type: 'statement',
109
+ statement: `
110
+ @components[d-flex,aifs,g-12px,p-14px-16px,box-sizing-border-box,br--x-alert-radius:10px,fs-14px,lh-20px,bgc--x-alert-bg:slateTheme2,c--x-alert-color:slateTheme11,border-width-1px,border-style-solid,border-color--x-alert-border-color:slateTheme6]
111
+ @components_svg[flex-shrink-0,w-20px,h-20px,c--x-alert-icon-color:slateTheme9]
112
+ @components_p-m-0
113
+ `
114
+ },
115
+ 'x-alert-title': {
116
+ type: 'statement',
117
+ statement: `@components[fw-600,margin-bottom-2px]`
118
+ },
119
+ 'x-alert-info': { type: 'statement', statement: `--x-alert-bg:blueTheme2 --x-alert-color:blueTheme11 --x-alert-border-color:blueTheme6 --x-alert-icon-color:blueTheme9` },
120
+ 'x-alert-success': { type: 'statement', statement: `--x-alert-bg:greenTheme2 --x-alert-color:greenTheme11 --x-alert-border-color:greenTheme6 --x-alert-icon-color:greenTheme9` },
121
+ 'x-alert-warning': { type: 'statement', statement: `--x-alert-bg:amberTheme2 --x-alert-color:amberTheme11 --x-alert-border-color:amberTheme6 --x-alert-icon-color:amberTheme9` },
122
+ 'x-alert-error': { type: 'statement', statement: `--x-alert-bg:redTheme2 --x-alert-color:redTheme11 --x-alert-border-color:redTheme6 --x-alert-icon-color:redTheme9` },
123
+ 'x-alert-accent': {
124
+ type: 'statement',
125
+ statement: `@components-[class][border-left-width-4px,border-left-color--x-alert-icon-color:slateTheme9]`
126
+ },
127
+ // ================================================================
128
+ // DIALOG (native <dialog>)
129
+ // <dialog class="x-dialog" id="confirm">
130
+ // <header class="x-dialog-header">
131
+ // <h2 class="x-dialog-title">Delete project?</h2>
132
+ // <form method="dialog"><button class="x-button x-button-ghost x-button-icon x-button-sm" aria-label="Close">✕</button></form>
133
+ // </header>
134
+ // <div class="x-dialog-body">…</div>
135
+ // <footer class="x-dialog-footer">
136
+ // <form method="dialog"><button class="x-button x-button-secondary">Cancel</button></form>
137
+ // <button class="x-button x-button-danger">Delete</button>
138
+ // </footer>
139
+ // </dialog>
140
+ // Open: dialog.showModal() (or <button commandfor="confirm" command="show-modal"> in supporting browsers)
141
+ // Close: any <form method="dialog"> button, Esc, or dialog.close()
142
+ // Variants: x-dialog-sheet (slides in from the right), x-dialog-sm, x-dialog-lg
143
+ // Vars: --x-dialog-width, --x-dialog-padding, --x-dialog-radius, --x-dialog-bg, --x-dialog-color,
144
+ // --x-dialog-border-color, --x-dialog-backdrop-bg, --x-dialog-from (closed transform)
145
+ // ================================================================
146
+ 'x-dialog': {
147
+ type: 'statement',
148
+ statement: `
149
+ @components[w--x-dialog-width:480px,xw(calc(100vw_-_32px)),xh(calc(100dvh_-_32px)),p-0,box-sizing-border-box,overflow-auto,bgc--x-dialog-bg:slateTheme1,c--x-dialog-color:slateTheme12,border-width-1px,border-style-solid,border-color--x-dialog-border-color:slateTheme6,br--x-dialog-radius:16px,box-shadow(0_24px_48px_-12px_rgb(16_24_40_/_0.18))]
150
+ @components[o-0,transform(var(--x-dialog-from,scale(0.96))),transition-property-opacity__transform__display__overlay,transition-duration-0.2s,transition-timing-function-ease-out,transition-behavior-allow-discrete]
151
+ @components-[open][o-1,tf-none]
152
+ @[components,starting-style]-[open][o-0,transform(var(--x-dialog-from,scale(0.96)))]
153
+ @components--backdrop[bgc--x-dialog-backdrop-bg:blackA7,bf-blur-2px,o-0,transition-property-opacity__display__overlay,transition-duration-0.2s,transition-behavior-allow-discrete]
154
+ @components-[open]--backdrop-o-1
155
+ @[components,starting-style]-[open]--backdrop-o-0
156
+ @motion-reduce[transition-duration-0s,--backdrop-transition-duration-0s]
157
+ `
158
+ },
159
+ 'x-dialog-header': {
160
+ type: 'statement',
161
+ statement: `@components[d-flex,aifs,jcsb,g-16px,padding(var(--x-dialog-padding,24px)),padding-bottom-0px]`
162
+ },
163
+ 'x-dialog-title': {
164
+ type: 'statement',
165
+ statement: `@components[m-0,fs-18px,fw-600,lh-28px]`
166
+ },
167
+ 'x-dialog-body': {
168
+ type: 'statement',
169
+ statement: `@components[padding(var(--x-dialog-padding,24px)),fs-14px,lh-22px,c--x-dialog-muted-color:slateTheme11]`
170
+ },
171
+ 'x-dialog-footer': {
172
+ type: 'statement',
173
+ statement: `
174
+ @components[d-flex,aic,jc-flex-end,g-12px,padding(var(--x-dialog-padding,24px)),padding-top-0px]
175
+ @components_form-display(contents)
176
+ `
177
+ },
178
+ 'x-dialog-sm': { type: 'statement', statement: `--x-dialog-width:360px` },
179
+ 'x-dialog-lg': { type: 'statement', statement: `--x-dialog-width:720px` },
180
+ 'x-dialog-sheet': {
181
+ type: 'statement',
182
+ statement: `
183
+ --x-dialog-width:420px
184
+ --x-dialog-from:(translateX(100%))
185
+ @components-[class][m-0px-0px-0px-auto,h-100dvh,xh-none,br-0px,border-width-0px,border-left-width-1px]
186
+ `
187
+ },
188
+ // ================================================================
189
+ // ACCORDION (native <details>/<summary>)
190
+ // <div class="x-accordion-group">
191
+ // <details class="x-accordion" name="faq"> (same name = only one open at a time)
192
+ // <summary>Question</summary>
193
+ // <div class="x-accordion-content">Answer…</div>
194
+ // </details>
195
+ // </div>
196
+ // Vars: --x-accordion-border-color, --x-accordion-padding (as (16px_0)), --x-accordion-content-color
197
+ // Smooth height animation needs the `interpolate-size` property entry and a browser
198
+ // that supports ::details-content; elsewhere it simply opens without animation.
199
+ // ================================================================
200
+ 'x-accordion-group': {
201
+ type: 'statement',
202
+ statement: `@components[border-top-width-1px,border-top-style-solid,border-top-color--x-accordion-border-color:slateTheme6]`
203
+ },
204
+ 'x-accordion': {
205
+ type: 'statement',
206
+ statement: `
207
+ @components[interpolate-size-allow-keywords,border-bottom-width-1px,border-bottom-style-solid,border-bottom-color--x-accordion-border-color:slateTheme6]
208
+ @components__summary[d-flex,aic,jcsb,g-12px,padding(var(--x-accordion-padding,16px_0)),fs-15px,fw-500,lh-22px,list-style-none,cursor-pointer,user-select-none]
209
+ @components__summary--after[cont,flex-shrink-0,w-8px,h-8px,margin-right-4px,border-style-solid,border-color-currentColor,border-width-0px-2px-2px-0px,tf-rotate-45deg,transition-property-transform,transition-duration-0.2s]
210
+ @components-[open]__summary--after-tf-rotate--135deg
211
+ @components__summary--focus-visible[outline-style-solid,outline-width-2px,outline-color--x-form-accent-color:accentRA1000,outline-offset-2px]
212
+ @components--details-content[h-0,overflow-clip,transition-property-height__content-visibility,transition-duration-0.25s,transition-behavior-allow-discrete]
213
+ @components-[open]--details-content-h-auto
214
+ @motion-reduce__summary--after-transition-duration-0s
215
+ @motion-reduce--details-content-transition-duration-0s
216
+ `
217
+ },
218
+ 'x-accordion-content': {
219
+ type: 'statement',
220
+ statement: `@components[padding-bottom-16px,fs-14px,lh-22px,c--x-accordion-content-color:slateTheme11]`
221
+ },
222
+ };
223
+ export default components;
@@ -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;