@purestack/ts-components 1.1.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 (106) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/dist/ts-components.d.mts +1662 -0
  4. package/dist/ts-components.d.mts.map +1 -0
  5. package/dist/ts-components.mjs +9200 -0
  6. package/dist/ts-components.mjs.map +1 -0
  7. package/package.json +130 -0
  8. package/src/defineComponents.ts +87 -0
  9. package/src/index.ts +270 -0
  10. package/src/registerStyles.ts +63 -0
  11. package/src/standard/alertBox/alertBox.ts +64 -0
  12. package/src/standard/autoId.ts +25 -0
  13. package/src/standard/badge/badge.ts +41 -0
  14. package/src/standard/badge/badgeStyle.ts +21 -0
  15. package/src/standard/barChart/barChart.ts +338 -0
  16. package/src/standard/barChart/barChartStyle.ts +81 -0
  17. package/src/standard/btn/btn.ts +191 -0
  18. package/src/standard/btn/btnStyle.ts +59 -0
  19. package/src/standard/btnGroup/btnGroup.ts +208 -0
  20. package/src/standard/btnGroup/btnGroupStyle.ts +85 -0
  21. package/src/standard/chart/cartesianChart.ts +99 -0
  22. package/src/standard/chart/chartDefaults.ts +25 -0
  23. package/src/standard/chart/chartUtils.ts +84 -0
  24. package/src/standard/classicLogo/classicLogo.ts +429 -0
  25. package/src/standard/classicLogo/classicLogoStyle.ts +292 -0
  26. package/src/standard/componentVariant.ts +153 -0
  27. package/src/standard/composer/composer.ts +1035 -0
  28. package/src/standard/composer/composerCanvasInitialStyle.ts +225 -0
  29. package/src/standard/composer/composerCanvasRevertStyle.ts +14 -0
  30. package/src/standard/composer/composerCanvasSharedStyle.ts +60 -0
  31. package/src/standard/composer/composerCanvasStyleTypes.ts +8 -0
  32. package/src/standard/composer/composerCanvasThemeStyle.ts +53 -0
  33. package/src/standard/composer/composerStyle.ts +156 -0
  34. package/src/standard/composer/emailHtmlPolicy.ts +474 -0
  35. package/src/standard/consent/consent.ts +173 -0
  36. package/src/standard/consent/consentStyle.ts +44 -0
  37. package/src/standard/contactForm/contactForm.ts +135 -0
  38. package/src/standard/contactForm/contactFormStyle.ts +116 -0
  39. package/src/standard/doughnutChart/doughnutChart.ts +527 -0
  40. package/src/standard/doughnutChart/doughnutChartStyle.ts +64 -0
  41. package/src/standard/dropFiles/dropFiles.ts +480 -0
  42. package/src/standard/dropFiles/dropFilesStyle.ts +171 -0
  43. package/src/standard/expandablePanel/expandablePanel.ts +106 -0
  44. package/src/standard/expandablePanel/expandablePanelStyle.ts +56 -0
  45. package/src/standard/flex/flex.ts +269 -0
  46. package/src/standard/flex/flexStyle.ts +556 -0
  47. package/src/standard/footer/footer.ts +93 -0
  48. package/src/standard/footer/footerStyle.ts +39 -0
  49. package/src/standard/form/autoCompleteInput.ts +567 -0
  50. package/src/standard/form/form.ts +205 -0
  51. package/src/standard/form/formCheck.ts +96 -0
  52. package/src/standard/form/formInputField.ts +184 -0
  53. package/src/standard/form/formSelectField.ts +152 -0
  54. package/src/standard/form/formStyle.ts +585 -0
  55. package/src/standard/form/multiAutoCompleteInput.ts +880 -0
  56. package/src/standard/grid/grid.ts +177 -0
  57. package/src/standard/grid/gridStyle.ts +56 -0
  58. package/src/standard/icon/icon.ts +96 -0
  59. package/src/standard/icon/iconStyle.ts +50 -0
  60. package/src/standard/landing/codeShowcase.ts +54 -0
  61. package/src/standard/landing/comparisonColumn.ts +30 -0
  62. package/src/standard/landing/comparisonFeature.ts +22 -0
  63. package/src/standard/landing/comparisonTable.ts +38 -0
  64. package/src/standard/landing/ctaSection.ts +59 -0
  65. package/src/standard/landing/featureCard.ts +41 -0
  66. package/src/standard/landing/landing.ts +52 -0
  67. package/src/standard/landing/landingBand.ts +217 -0
  68. package/src/standard/landing/landingSection.ts +43 -0
  69. package/src/standard/landing/landingTypes.ts +141 -0
  70. package/src/standard/landing/metricItem.ts +25 -0
  71. package/src/standard/landing/metricStrip.ts +20 -0
  72. package/src/standard/lineChart/lineChart.ts +462 -0
  73. package/src/standard/lineChart/lineChartStyle.ts +91 -0
  74. package/src/standard/logo/logo.ts +192 -0
  75. package/src/standard/logo/logoStyle.ts +164 -0
  76. package/src/standard/modal/modal.ts +171 -0
  77. package/src/standard/modal/modalStore.ts +154 -0
  78. package/src/standard/modal/modalStyle.ts +190 -0
  79. package/src/standard/navMenu/navMenu.ts +278 -0
  80. package/src/standard/navMenu/navMenuStyle.ts +323 -0
  81. package/src/standard/pageLinks/pageLinks.ts +90 -0
  82. package/src/standard/pageScript/pageScript.ts +155 -0
  83. package/src/standard/pageToc/pageToc.ts +154 -0
  84. package/src/standard/pageToc/pageTocStyle.ts +372 -0
  85. package/src/standard/panel/panel.ts +55 -0
  86. package/src/standard/panel/panelStyle.ts +15 -0
  87. package/src/standard/pricing/pricing.ts +146 -0
  88. package/src/standard/searchBox/searchBox.ts +54 -0
  89. package/src/standard/searchBox/searchBoxStyle.ts +180 -0
  90. package/src/standard/sectionHeader/sectionHeader.ts +99 -0
  91. package/src/standard/signIn/signIn.ts +167 -0
  92. package/src/standard/signIn/signInStyle.ts +70 -0
  93. package/src/standard/tabs/tabs.ts +193 -0
  94. package/src/standard/tabs/tabsStyle.ts +231 -0
  95. package/src/standard/themeToggle/themeToggle.ts +33 -0
  96. package/src/standard/themeToggle/themeToggleStyle.ts +88 -0
  97. package/src/standard/toast/toastHost.ts +42 -0
  98. package/src/standard/toast/toastStore.ts +50 -0
  99. package/src/standard/topBar/topBar.ts +101 -0
  100. package/src/standard/topBar/topBarStyle.ts +169 -0
  101. package/src/standard/virtualList/variableVirtualTable.ts +371 -0
  102. package/src/standard/virtualList/virtualList.ts +423 -0
  103. package/src/standard/virtualList/virtualListStyle.ts +34 -0
  104. package/src/standard/virtualList/virtualTable.ts +179 -0
  105. package/src/standard/virtualList/virtualTableStyle.ts +24 -0
  106. package/tsconfig.json +23 -0
@@ -0,0 +1,556 @@
1
+ import type { Style } from '@purestack/ts-css'
2
+ import {
3
+ BREAKPOINTS,
4
+ mediaMin,
5
+ styleBuilder,
6
+ themes,
7
+ } from '@purestack/ts-style'
8
+
9
+ export function registerFlexStyles() {
10
+ themes.forEach((theme) => {
11
+ styleBuilder
12
+ .select('.flex', theme)
13
+ .display('flex')
14
+ .minWidth('0')
15
+ .gap('0.75rem')
16
+ .flexDirection('row')
17
+ .alignItems('stretch')
18
+ .justifyContent('flex-start')
19
+ .flexWrap('nowrap')
20
+
21
+ styleBuilder.select('.flex > *', theme).minWidth('0')
22
+
23
+ styleBuilder.select('.flex-inline', theme).display('inline-flex')
24
+ styleBuilder.select('.flex-column', theme).flexDirection('column')
25
+ styleBuilder
26
+ .select('.flex-column-reverse', theme)
27
+ .flexDirection('column-reverse')
28
+ styleBuilder.select('.flex-row-reverse', theme).flexDirection('row-reverse')
29
+
30
+ styleBuilder.select('.align-stretch', theme).alignItems('stretch')
31
+ styleBuilder.select('.align-start', theme).alignItems('start')
32
+ styleBuilder.select('.align-flex-start', theme).alignItems('flex-start')
33
+ styleBuilder.select('.align-center', theme).alignItems('center')
34
+ styleBuilder.select('.align-end', theme).alignItems('end')
35
+ styleBuilder.select('.align-flex-end', theme).alignItems('flex-end')
36
+ styleBuilder.select('.align-baseline', theme).alignItems('baseline')
37
+
38
+ styleBuilder.select('.justify-start', theme).justifyContent('flex-start')
39
+ styleBuilder.select('.justify-center', theme).justifyContent('center')
40
+ styleBuilder.select('.justify-end', theme).justifyContent('flex-end')
41
+ styleBuilder.select('.justify-stretch', theme).justifyContent('stretch')
42
+ styleBuilder
43
+ .select('.justify-between', theme)
44
+ .justifyContent('space-between')
45
+ styleBuilder.select('.justify-around', theme).justifyContent('space-around')
46
+ styleBuilder.select('.justify-evenly', theme).justifyContent('space-evenly')
47
+
48
+ styleBuilder.select('.self-stretch', theme).alignSelf('stretch')
49
+ styleBuilder.select('.self-start', theme).alignSelf('flex-start')
50
+ styleBuilder.select('.self-center', theme).alignSelf('center')
51
+ styleBuilder.select('.self-end', theme).alignSelf('flex-end')
52
+
53
+ styleBuilder.select('.flex-wrap', theme).flexWrap('wrap')
54
+ styleBuilder.select('.flex-wrap-reverse', theme).flexWrap('wrap-reverse')
55
+
56
+ applyResponsiveFlexUtilities(theme)
57
+
58
+ styleBuilder.select('.flex-auto', theme).flex('1 1 auto').minWidth('0')
59
+ styleBuilder.select('.flex-none', theme).flex('0 0 auto')
60
+ styleBuilder.select('.flex-fill', theme).flex('1 1 0%')
61
+ styleBuilder.select('.flex-1', theme).flex('1 1 0%').minWidth('0')
62
+ })
63
+ }
64
+
65
+ function applyResponsiveFlexUtilities(theme: string) {
66
+ applyResponsiveFlexDirectionStyles(theme)
67
+ applyResponsiveFlexAlignStyles(theme)
68
+ applyResponsiveFlexJustifyStyles(theme)
69
+ applyResponsiveFlexWrapStyles(theme)
70
+ }
71
+
72
+ function applyResponsiveFlexDirectionStyles(theme: string) {
73
+ applyResponsiveFlexStyle(
74
+ theme,
75
+ '.flex-direction-sm-row',
76
+ mediaMin(BREAKPOINTS.sm),
77
+ (style) => style.flexDirection('row'),
78
+ )
79
+ applyResponsiveFlexStyle(
80
+ theme,
81
+ '.flex-direction-sm-column',
82
+ mediaMin(BREAKPOINTS.sm),
83
+ (style) => style.flexDirection('column'),
84
+ )
85
+ applyResponsiveFlexStyle(
86
+ theme,
87
+ '.flex-direction-sm-column-reverse',
88
+ mediaMin(BREAKPOINTS.sm),
89
+ (style) => style.flexDirection('column-reverse'),
90
+ )
91
+ applyResponsiveFlexStyle(
92
+ theme,
93
+ '.flex-direction-sm-row-reverse',
94
+ mediaMin(BREAKPOINTS.sm),
95
+ (style) => style.flexDirection('row-reverse'),
96
+ )
97
+ applyResponsiveFlexStyle(
98
+ theme,
99
+ '.flex-direction-md-row',
100
+ mediaMin(BREAKPOINTS.md),
101
+ (style) => style.flexDirection('row'),
102
+ )
103
+ applyResponsiveFlexStyle(
104
+ theme,
105
+ '.flex-direction-md-column',
106
+ mediaMin(BREAKPOINTS.md),
107
+ (style) => style.flexDirection('column'),
108
+ )
109
+ applyResponsiveFlexStyle(
110
+ theme,
111
+ '.flex-direction-md-column-reverse',
112
+ mediaMin(BREAKPOINTS.md),
113
+ (style) => style.flexDirection('column-reverse'),
114
+ )
115
+ applyResponsiveFlexStyle(
116
+ theme,
117
+ '.flex-direction-md-row-reverse',
118
+ mediaMin(BREAKPOINTS.md),
119
+ (style) => style.flexDirection('row-reverse'),
120
+ )
121
+ applyResponsiveFlexStyle(
122
+ theme,
123
+ '.flex-direction-lg-row',
124
+ mediaMin(BREAKPOINTS.lg),
125
+ (style) => style.flexDirection('row'),
126
+ )
127
+ applyResponsiveFlexStyle(
128
+ theme,
129
+ '.flex-direction-lg-column',
130
+ mediaMin(BREAKPOINTS.lg),
131
+ (style) => style.flexDirection('column'),
132
+ )
133
+ applyResponsiveFlexStyle(
134
+ theme,
135
+ '.flex-direction-lg-column-reverse',
136
+ mediaMin(BREAKPOINTS.lg),
137
+ (style) => style.flexDirection('column-reverse'),
138
+ )
139
+ applyResponsiveFlexStyle(
140
+ theme,
141
+ '.flex-direction-lg-row-reverse',
142
+ mediaMin(BREAKPOINTS.lg),
143
+ (style) => style.flexDirection('row-reverse'),
144
+ )
145
+ applyResponsiveFlexStyle(
146
+ theme,
147
+ '.flex-direction-xl-row',
148
+ mediaMin(BREAKPOINTS.xl),
149
+ (style) => style.flexDirection('row'),
150
+ )
151
+ applyResponsiveFlexStyle(
152
+ theme,
153
+ '.flex-direction-xl-column',
154
+ mediaMin(BREAKPOINTS.xl),
155
+ (style) => style.flexDirection('column'),
156
+ )
157
+ applyResponsiveFlexStyle(
158
+ theme,
159
+ '.flex-direction-xl-column-reverse',
160
+ mediaMin(BREAKPOINTS.xl),
161
+ (style) => style.flexDirection('column-reverse'),
162
+ )
163
+ applyResponsiveFlexStyle(
164
+ theme,
165
+ '.flex-direction-xl-row-reverse',
166
+ mediaMin(BREAKPOINTS.xl),
167
+ (style) => style.flexDirection('row-reverse'),
168
+ )
169
+ }
170
+
171
+ function applyResponsiveFlexAlignStyles(theme: string) {
172
+ applyResponsiveFlexStyle(
173
+ theme,
174
+ '.align-sm-stretch',
175
+ mediaMin(BREAKPOINTS.sm),
176
+ (style) => style.alignItems('stretch'),
177
+ )
178
+ applyResponsiveFlexStyle(
179
+ theme,
180
+ '.align-sm-flex-start',
181
+ mediaMin(BREAKPOINTS.sm),
182
+ (style) => style.alignItems('flex-start'),
183
+ )
184
+ applyResponsiveFlexStyle(
185
+ theme,
186
+ '.align-sm-center',
187
+ mediaMin(BREAKPOINTS.sm),
188
+ (style) => style.alignItems('center'),
189
+ )
190
+ applyResponsiveFlexStyle(
191
+ theme,
192
+ '.align-sm-flex-end',
193
+ mediaMin(BREAKPOINTS.sm),
194
+ (style) => style.alignItems('flex-end'),
195
+ )
196
+ applyResponsiveFlexStyle(
197
+ theme,
198
+ '.align-sm-baseline',
199
+ mediaMin(BREAKPOINTS.sm),
200
+ (style) => style.alignItems('baseline'),
201
+ )
202
+
203
+ applyResponsiveFlexStyle(
204
+ theme,
205
+ '.align-md-stretch',
206
+ mediaMin(BREAKPOINTS.md),
207
+ (style) => style.alignItems('stretch'),
208
+ )
209
+ applyResponsiveFlexStyle(
210
+ theme,
211
+ '.align-md-flex-start',
212
+ mediaMin(BREAKPOINTS.md),
213
+ (style) => style.alignItems('flex-start'),
214
+ )
215
+ applyResponsiveFlexStyle(
216
+ theme,
217
+ '.align-md-center',
218
+ mediaMin(BREAKPOINTS.md),
219
+ (style) => style.alignItems('center'),
220
+ )
221
+ applyResponsiveFlexStyle(
222
+ theme,
223
+ '.align-md-flex-end',
224
+ mediaMin(BREAKPOINTS.md),
225
+ (style) => style.alignItems('flex-end'),
226
+ )
227
+ applyResponsiveFlexStyle(
228
+ theme,
229
+ '.align-md-baseline',
230
+ mediaMin(BREAKPOINTS.md),
231
+ (style) => style.alignItems('baseline'),
232
+ )
233
+
234
+ applyResponsiveFlexStyle(
235
+ theme,
236
+ '.align-lg-stretch',
237
+ mediaMin(BREAKPOINTS.lg),
238
+ (style) => style.alignItems('stretch'),
239
+ )
240
+ applyResponsiveFlexStyle(
241
+ theme,
242
+ '.align-lg-flex-start',
243
+ mediaMin(BREAKPOINTS.lg),
244
+ (style) => style.alignItems('flex-start'),
245
+ )
246
+ applyResponsiveFlexStyle(
247
+ theme,
248
+ '.align-lg-center',
249
+ mediaMin(BREAKPOINTS.lg),
250
+ (style) => style.alignItems('center'),
251
+ )
252
+ applyResponsiveFlexStyle(
253
+ theme,
254
+ '.align-lg-flex-end',
255
+ mediaMin(BREAKPOINTS.lg),
256
+ (style) => style.alignItems('flex-end'),
257
+ )
258
+ applyResponsiveFlexStyle(
259
+ theme,
260
+ '.align-lg-baseline',
261
+ mediaMin(BREAKPOINTS.lg),
262
+ (style) => style.alignItems('baseline'),
263
+ )
264
+
265
+ applyResponsiveFlexStyle(
266
+ theme,
267
+ '.align-xl-stretch',
268
+ mediaMin(BREAKPOINTS.xl),
269
+ (style) => style.alignItems('stretch'),
270
+ )
271
+ applyResponsiveFlexStyle(
272
+ theme,
273
+ '.align-xl-flex-start',
274
+ mediaMin(BREAKPOINTS.xl),
275
+ (style) => style.alignItems('flex-start'),
276
+ )
277
+ applyResponsiveFlexStyle(
278
+ theme,
279
+ '.align-xl-center',
280
+ mediaMin(BREAKPOINTS.xl),
281
+ (style) => style.alignItems('center'),
282
+ )
283
+ applyResponsiveFlexStyle(
284
+ theme,
285
+ '.align-xl-flex-end',
286
+ mediaMin(BREAKPOINTS.xl),
287
+ (style) => style.alignItems('flex-end'),
288
+ )
289
+ applyResponsiveFlexStyle(
290
+ theme,
291
+ '.align-xl-baseline',
292
+ mediaMin(BREAKPOINTS.xl),
293
+ (style) => style.alignItems('baseline'),
294
+ )
295
+ }
296
+
297
+ function applyResponsiveFlexJustifyStyles(theme: string) {
298
+ applyResponsiveFlexStyle(
299
+ theme,
300
+ '.justify-sm-start',
301
+ mediaMin(BREAKPOINTS.sm),
302
+ (style) => style.justifyContent('flex-start'),
303
+ )
304
+ applyResponsiveFlexStyle(
305
+ theme,
306
+ '.justify-sm-center',
307
+ mediaMin(BREAKPOINTS.sm),
308
+ (style) => style.justifyContent('center'),
309
+ )
310
+ applyResponsiveFlexStyle(
311
+ theme,
312
+ '.justify-sm-end',
313
+ mediaMin(BREAKPOINTS.sm),
314
+ (style) => style.justifyContent('flex-end'),
315
+ )
316
+ applyResponsiveFlexStyle(
317
+ theme,
318
+ '.justify-sm-stretch',
319
+ mediaMin(BREAKPOINTS.sm),
320
+ (style) => style.justifyContent('stretch'),
321
+ )
322
+ applyResponsiveFlexStyle(
323
+ theme,
324
+ '.justify-sm-between',
325
+ mediaMin(BREAKPOINTS.sm),
326
+ (style) => style.justifyContent('space-between'),
327
+ )
328
+ applyResponsiveFlexStyle(
329
+ theme,
330
+ '.justify-sm-around',
331
+ mediaMin(BREAKPOINTS.sm),
332
+ (style) => style.justifyContent('space-around'),
333
+ )
334
+ applyResponsiveFlexStyle(
335
+ theme,
336
+ '.justify-sm-evenly',
337
+ mediaMin(BREAKPOINTS.sm),
338
+ (style) => style.justifyContent('space-evenly'),
339
+ )
340
+
341
+ applyResponsiveFlexStyle(
342
+ theme,
343
+ '.justify-md-start',
344
+ mediaMin(BREAKPOINTS.md),
345
+ (style) => style.justifyContent('flex-start'),
346
+ )
347
+ applyResponsiveFlexStyle(
348
+ theme,
349
+ '.justify-md-center',
350
+ mediaMin(BREAKPOINTS.md),
351
+ (style) => style.justifyContent('center'),
352
+ )
353
+ applyResponsiveFlexStyle(
354
+ theme,
355
+ '.justify-md-end',
356
+ mediaMin(BREAKPOINTS.md),
357
+ (style) => style.justifyContent('flex-end'),
358
+ )
359
+ applyResponsiveFlexStyle(
360
+ theme,
361
+ '.justify-md-stretch',
362
+ mediaMin(BREAKPOINTS.md),
363
+ (style) => style.justifyContent('stretch'),
364
+ )
365
+ applyResponsiveFlexStyle(
366
+ theme,
367
+ '.justify-md-between',
368
+ mediaMin(BREAKPOINTS.md),
369
+ (style) => style.justifyContent('space-between'),
370
+ )
371
+ applyResponsiveFlexStyle(
372
+ theme,
373
+ '.justify-md-around',
374
+ mediaMin(BREAKPOINTS.md),
375
+ (style) => style.justifyContent('space-around'),
376
+ )
377
+ applyResponsiveFlexStyle(
378
+ theme,
379
+ '.justify-md-evenly',
380
+ mediaMin(BREAKPOINTS.md),
381
+ (style) => style.justifyContent('space-evenly'),
382
+ )
383
+
384
+ applyResponsiveFlexStyle(
385
+ theme,
386
+ '.justify-lg-start',
387
+ mediaMin(BREAKPOINTS.lg),
388
+ (style) => style.justifyContent('flex-start'),
389
+ )
390
+ applyResponsiveFlexStyle(
391
+ theme,
392
+ '.justify-lg-center',
393
+ mediaMin(BREAKPOINTS.lg),
394
+ (style) => style.justifyContent('center'),
395
+ )
396
+ applyResponsiveFlexStyle(
397
+ theme,
398
+ '.justify-lg-end',
399
+ mediaMin(BREAKPOINTS.lg),
400
+ (style) => style.justifyContent('flex-end'),
401
+ )
402
+ applyResponsiveFlexStyle(
403
+ theme,
404
+ '.justify-lg-stretch',
405
+ mediaMin(BREAKPOINTS.lg),
406
+ (style) => style.justifyContent('stretch'),
407
+ )
408
+ applyResponsiveFlexStyle(
409
+ theme,
410
+ '.justify-lg-between',
411
+ mediaMin(BREAKPOINTS.lg),
412
+ (style) => style.justifyContent('space-between'),
413
+ )
414
+ applyResponsiveFlexStyle(
415
+ theme,
416
+ '.justify-lg-around',
417
+ mediaMin(BREAKPOINTS.lg),
418
+ (style) => style.justifyContent('space-around'),
419
+ )
420
+ applyResponsiveFlexStyle(
421
+ theme,
422
+ '.justify-lg-evenly',
423
+ mediaMin(BREAKPOINTS.lg),
424
+ (style) => style.justifyContent('space-evenly'),
425
+ )
426
+
427
+ applyResponsiveFlexStyle(
428
+ theme,
429
+ '.justify-xl-start',
430
+ mediaMin(BREAKPOINTS.xl),
431
+ (style) => style.justifyContent('flex-start'),
432
+ )
433
+ applyResponsiveFlexStyle(
434
+ theme,
435
+ '.justify-xl-center',
436
+ mediaMin(BREAKPOINTS.xl),
437
+ (style) => style.justifyContent('center'),
438
+ )
439
+ applyResponsiveFlexStyle(
440
+ theme,
441
+ '.justify-xl-end',
442
+ mediaMin(BREAKPOINTS.xl),
443
+ (style) => style.justifyContent('flex-end'),
444
+ )
445
+ applyResponsiveFlexStyle(
446
+ theme,
447
+ '.justify-xl-stretch',
448
+ mediaMin(BREAKPOINTS.xl),
449
+ (style) => style.justifyContent('stretch'),
450
+ )
451
+ applyResponsiveFlexStyle(
452
+ theme,
453
+ '.justify-xl-between',
454
+ mediaMin(BREAKPOINTS.xl),
455
+ (style) => style.justifyContent('space-between'),
456
+ )
457
+ applyResponsiveFlexStyle(
458
+ theme,
459
+ '.justify-xl-around',
460
+ mediaMin(BREAKPOINTS.xl),
461
+ (style) => style.justifyContent('space-around'),
462
+ )
463
+ applyResponsiveFlexStyle(
464
+ theme,
465
+ '.justify-xl-evenly',
466
+ mediaMin(BREAKPOINTS.xl),
467
+ (style) => style.justifyContent('space-evenly'),
468
+ )
469
+ }
470
+
471
+ function applyResponsiveFlexWrapStyles(theme: string) {
472
+ applyResponsiveFlexStyle(
473
+ theme,
474
+ '.flex-wrap-sm',
475
+ mediaMin(BREAKPOINTS.sm),
476
+ (style) => style.flexWrap('wrap'),
477
+ )
478
+ applyResponsiveFlexStyle(
479
+ theme,
480
+ '.flex-nowrap-sm',
481
+ mediaMin(BREAKPOINTS.sm),
482
+ (style) => style.flexWrap('nowrap'),
483
+ )
484
+ applyResponsiveFlexStyle(
485
+ theme,
486
+ '.flex-wrap-sm-reverse',
487
+ mediaMin(BREAKPOINTS.sm),
488
+ (style) => style.flexWrap('wrap-reverse'),
489
+ )
490
+
491
+ applyResponsiveFlexStyle(
492
+ theme,
493
+ '.flex-wrap-md',
494
+ mediaMin(BREAKPOINTS.md),
495
+ (style) => style.flexWrap('wrap'),
496
+ )
497
+ applyResponsiveFlexStyle(
498
+ theme,
499
+ '.flex-nowrap-md',
500
+ mediaMin(BREAKPOINTS.md),
501
+ (style) => style.flexWrap('nowrap'),
502
+ )
503
+ applyResponsiveFlexStyle(
504
+ theme,
505
+ '.flex-wrap-md-reverse',
506
+ mediaMin(BREAKPOINTS.md),
507
+ (style) => style.flexWrap('wrap-reverse'),
508
+ )
509
+
510
+ applyResponsiveFlexStyle(
511
+ theme,
512
+ '.flex-wrap-lg',
513
+ mediaMin(BREAKPOINTS.lg),
514
+ (style) => style.flexWrap('wrap'),
515
+ )
516
+ applyResponsiveFlexStyle(
517
+ theme,
518
+ '.flex-nowrap-lg',
519
+ mediaMin(BREAKPOINTS.lg),
520
+ (style) => style.flexWrap('nowrap'),
521
+ )
522
+ applyResponsiveFlexStyle(
523
+ theme,
524
+ '.flex-wrap-lg-reverse',
525
+ mediaMin(BREAKPOINTS.lg),
526
+ (style) => style.flexWrap('wrap-reverse'),
527
+ )
528
+
529
+ applyResponsiveFlexStyle(
530
+ theme,
531
+ '.flex-wrap-xl',
532
+ mediaMin(BREAKPOINTS.xl),
533
+ (style) => style.flexWrap('wrap'),
534
+ )
535
+ applyResponsiveFlexStyle(
536
+ theme,
537
+ '.flex-nowrap-xl',
538
+ mediaMin(BREAKPOINTS.xl),
539
+ (style) => style.flexWrap('nowrap'),
540
+ )
541
+ applyResponsiveFlexStyle(
542
+ theme,
543
+ '.flex-wrap-xl-reverse',
544
+ mediaMin(BREAKPOINTS.xl),
545
+ (style) => style.flexWrap('wrap-reverse'),
546
+ )
547
+ }
548
+
549
+ function applyResponsiveFlexStyle(
550
+ theme: string,
551
+ selector: string,
552
+ media: string,
553
+ apply: (style: Style) => void,
554
+ ) {
555
+ apply(styleBuilder.select(selector, theme).media(media))
556
+ }
@@ -0,0 +1,93 @@
1
+ import type { SemanticTone } from '@purestack/ts-style'
2
+ import {
3
+ type ComputedRef,
4
+ computed,
5
+ defineComponent,
6
+ html,
7
+ type RefOrValue,
8
+ } from 'regor'
9
+ import {
10
+ type ComponentVariant,
11
+ resolveComponentClasses,
12
+ } from '../componentVariant'
13
+
14
+ export interface SiteFooter {
15
+ teleport?: string
16
+ ariaLabel?: string
17
+ copyright?: string
18
+ legalLabel?: string
19
+ tone?: RefOrValue<SemanticTone>
20
+ variant?: RefOrValue<ComponentVariant>
21
+ classes?: ComputedRef<string>
22
+ }
23
+
24
+ const siteFooterTemplate = html`<footer
25
+ class="site-footer doc-content"
26
+ :class="classes"
27
+ :aria-label="ariaLabel"
28
+ :r-teleport="teleport"
29
+ >
30
+ <div class="site-footer__inner"><slot></slot></div>
31
+ <Flex
32
+ class="site-footer__bottom"
33
+ direction="column-reverse"
34
+ directionMd="row"
35
+ align="center"
36
+ justify="center"
37
+ justifyMd="between"
38
+ wrap="true"
39
+ >
40
+ <Flex justify="center" justifyMd="start" class="site-footer__copyright">
41
+ {{ copyright }}
42
+ </Flex>
43
+ <Flex
44
+ container="nav"
45
+ class="site-footer__legal"
46
+ wrap="true"
47
+ align="center"
48
+ justify="center"
49
+ justifyMd="end"
50
+ :aria-label="legalLabel"
51
+ >
52
+ <slot name="legal"></slot>
53
+ <span class="consent-settings-teleport-area"></span>
54
+ <Flex><slot name="social"></slot></Flex>
55
+ </Flex>
56
+ </Flex>
57
+ </footer>`
58
+
59
+ function defineSiteFooterComponent() {
60
+ return defineComponent<SiteFooter>(siteFooterTemplate, {
61
+ props: [
62
+ 'teleport',
63
+ 'ariaLabel',
64
+ 'copyright',
65
+ 'legalLabel',
66
+ 'tone',
67
+ 'variant',
68
+ ],
69
+ context: (head) => resolveSiteFooter(head.props),
70
+ })
71
+ }
72
+
73
+ export function defineFooterComponents() {
74
+ return {
75
+ siteFooter: defineSiteFooterComponent(),
76
+ }
77
+ }
78
+
79
+ function resolveSiteFooter(props: SiteFooter): SiteFooter {
80
+ const year = new Date().getFullYear()
81
+ if (!props.teleport) props.teleport = 'body'
82
+ return {
83
+ ...props,
84
+ ariaLabel: props.ariaLabel || 'Site footer',
85
+ legalLabel: props.legalLabel || 'Legal and policy links',
86
+ copyright: props.copyright || `(c) ${year}. All rights reserved.`,
87
+ classes: computed(() =>
88
+ resolveComponentClasses(props, {
89
+ defaultVariant: 'surface',
90
+ }),
91
+ ),
92
+ }
93
+ }
@@ -0,0 +1,39 @@
1
+ import type { ThemePalette } from '@purestack/ts-style'
2
+ import { styleBuilder, type ThemeMode, themes } from '@purestack/ts-style'
3
+
4
+ export function registerFooterStyles() {
5
+ themes.forEach((theme, palette) => {
6
+ applyFooterShellStyles(theme)
7
+ applyFooterBottomStyles(theme, palette)
8
+ })
9
+ }
10
+
11
+ export function applyFooterShellStyles(theme: ThemeMode) {
12
+ styleBuilder
13
+ .select('.site-footer', theme)
14
+ .position('relative')
15
+ .overflow('hidden')
16
+ .padding('0')
17
+ }
18
+
19
+ export function applyFooterBottomStyles(
20
+ theme: ThemeMode,
21
+ palette: ThemePalette,
22
+ ) {
23
+ applyFooterBottomShellStyles(theme, palette)
24
+ }
25
+
26
+ export function applyFooterBottomShellStyles(
27
+ theme: ThemeMode,
28
+ palette: ThemePalette,
29
+ ) {
30
+ styleBuilder
31
+ .select('.site-footer__bottom', theme)
32
+ .apply(palette.applyFont(palette.font.size.xxs))
33
+ .padding('0.5em 1em 0.5em 1em')
34
+ .color(palette.current.text.subtle)
35
+ .borderTop(`1px solid ${palette.current.border.subtle}`)
36
+ styleBuilder
37
+ .select('.site-footer__bottom :where(a)', theme)
38
+ .color(palette.current.text.subtle)
39
+ }