@ds-gn/ui 0.6.2 → 0.8.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.
- package/README.md +21 -3
- package/custom-elements.json +202 -31
- package/dist/components/Background/src/Background.js +1 -13
- package/dist/components/Container/src/Container.d.ts +10 -5
- package/dist/components/Container/src/Container.js +85 -67
- package/dist/components/Container/src/Container.props.d.ts +19 -1
- package/dist/components/Container/src/Container.props.js +9 -4
- package/dist/components/Container/src/Container.styles.d.ts +9 -2
- package/dist/components/FeatureTabs/src/FeatureTabs.d.ts +14 -0
- package/dist/components/FeatureTabs/src/FeatureTabs.js +27 -43
- package/dist/components/FeatureTabs/src/FeatureTabs.styles.d.ts +1 -1
- package/dist/components/Footer/src/Footer.d.ts +5 -9
- package/dist/components/Footer/src/Footer.js +10 -12
- package/dist/components/Heading/src/Heading.js +1 -13
- package/dist/components/Hero/src/Hero.d.ts +5 -0
- package/dist/components/Hero/src/Hero.js +31 -5
- package/dist/components/Hero/src/Hero.styles.d.ts +1 -0
- package/dist/components/Modal/src/Modal.d.ts +4 -1
- package/dist/components/Modal/src/Modal.js +49 -264
- package/dist/components/Modal/src/Modal.props.d.ts +3 -0
- package/dist/components/Modal/src/Modal.props.js +9 -0
- package/dist/components/Modal/src/Modal.styles.d.ts +3 -7
- package/dist/components/Nav/src/Nav.js +2 -9
- package/dist/styles/hero-fallback.css +503 -0
- package/dist/styles/layout-fallback.css +168 -0
- package/package.json +11 -7
- package/dist/common/helpers/motion.d.ts +0 -9
package/README.md
CHANGED
|
@@ -95,8 +95,8 @@ Custom events are exposed as `on<EventName>` props named after their underlying
|
|
|
95
95
|
| `@ds-gn/ui/logo/full.svg` | Full DS/GN logo for light backgrounds |
|
|
96
96
|
| `@ds-gn/ui/logo/light.svg` | Full DS/GN logo for light backgrounds |
|
|
97
97
|
| `@ds-gn/ui/logo/dark.svg` | Full DS/GN logo for dark backgrounds |
|
|
98
|
-
| `@ds-gn/ui/
|
|
99
|
-
| `@ds-gn/ui/
|
|
98
|
+
| `@ds-gn/ui/layout.css` | Optional pre-upgrade styles for page layout |
|
|
99
|
+
| `@ds-gn/ui/hero/fallback.css` | Optional pre-upgrade styles for Hero |
|
|
100
100
|
| `@ds-gn/ui/playground-manifest` | Machine-readable component playground metadata |
|
|
101
101
|
|
|
102
102
|
The string helpers inherit `currentColor` for theme-aware lettering and keep the slash orange. Use `getLogoHtml({ size: 24 })` to render the full artwork at a given height with its accessible name.
|
|
@@ -107,13 +107,31 @@ The string helpers inherit `currentColor` for theme-aware lettering and keep the
|
|
|
107
107
|
Start on Node): importing `@ds-gn/ui/react` during server rendering is
|
|
108
108
|
safe. The server emits an inert `<dsgn-*>` tag that upgrades on the client.
|
|
109
109
|
Declarative Shadow DOM is not emitted, so a brief unstyled frame is possible
|
|
110
|
-
before upgrade
|
|
110
|
+
before upgrade; the pre-upgrade stylesheets below cover the layout
|
|
111
|
+
components. Reactive properties are applied client-side; pass `id`,
|
|
111
112
|
`class`, and similar values as normal attributes.
|
|
112
113
|
- **Cloudflare workerd** (including TanStack Start on Workers): full SSR is not
|
|
113
114
|
currently supported because the custom element cannot be evaluated in the
|
|
114
115
|
worker runtime. Load the wrapper client-only, such as behind a `ClientOnly`
|
|
115
116
|
boundary with a lazy import.
|
|
116
117
|
|
|
118
|
+
### Before components register
|
|
119
|
+
|
|
120
|
+
When your HTML is rendered before the component scripts run (server rendering
|
|
121
|
+
or static pages), import the optional pre-upgrade stylesheets in your page CSS:
|
|
122
|
+
|
|
123
|
+
```css
|
|
124
|
+
@import '@ds-gn/ui/layout.css';
|
|
125
|
+
@import '@ds-gn/ui/hero/fallback.css'; /* only if you use dsgn-hero */
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
They apply only until each element registers. `layout.css` holds Container,
|
|
129
|
+
Nav, FeatureTabs and Footer to their final gutters and section spacing,
|
|
130
|
+
reserves the nav bar's height, and keeps the nav's links and dropdowns hidden
|
|
131
|
+
until it lays them out. `hero/fallback.css` does the same for every Hero
|
|
132
|
+
layout. Without them, content can shift or flash as unstyled text while the
|
|
133
|
+
scripts load.
|
|
134
|
+
|
|
117
135
|
<details>
|
|
118
136
|
<summary><strong>Public Beta components and compatibility policy</strong></summary>
|
|
119
137
|
|
package/custom-elements.json
CHANGED
|
@@ -1183,20 +1183,41 @@
|
|
|
1183
1183
|
"kind": "field",
|
|
1184
1184
|
"name": "paddingX",
|
|
1185
1185
|
"type": {
|
|
1186
|
-
"text": "ContainerPaddingType"
|
|
1186
|
+
"text": "ContainerPaddingType | undefined"
|
|
1187
1187
|
},
|
|
1188
|
-
"description": "
|
|
1188
|
+
"description": "Gutter (padding-inline) step. Unset follows the inherited `--dsgn-gutter`.",
|
|
1189
1189
|
"attribute": "padding-x",
|
|
1190
1190
|
"reflects": true
|
|
1191
1191
|
},
|
|
1192
1192
|
{
|
|
1193
1193
|
"kind": "field",
|
|
1194
|
-
"name": "
|
|
1194
|
+
"name": "section",
|
|
1195
1195
|
"type": {
|
|
1196
|
-
"text": "
|
|
1196
|
+
"text": "boolean"
|
|
1197
|
+
},
|
|
1198
|
+
"default": "false",
|
|
1199
|
+
"description": "Marks the container as a page section: unset vertical sides follow the\ninherited `--dsgn-section-space` instead of having no padding.",
|
|
1200
|
+
"attribute": "section",
|
|
1201
|
+
"reflects": true
|
|
1202
|
+
},
|
|
1203
|
+
{
|
|
1204
|
+
"kind": "field",
|
|
1205
|
+
"name": "paddingTop",
|
|
1206
|
+
"type": {
|
|
1207
|
+
"text": "SectionSpaceType | undefined"
|
|
1197
1208
|
},
|
|
1198
|
-
"description": "
|
|
1199
|
-
"attribute": "padding-
|
|
1209
|
+
"description": "Space above the content.",
|
|
1210
|
+
"attribute": "padding-top",
|
|
1211
|
+
"reflects": true
|
|
1212
|
+
},
|
|
1213
|
+
{
|
|
1214
|
+
"kind": "field",
|
|
1215
|
+
"name": "paddingBottom",
|
|
1216
|
+
"type": {
|
|
1217
|
+
"text": "SectionSpaceType | undefined"
|
|
1218
|
+
},
|
|
1219
|
+
"description": "Space below the content.",
|
|
1220
|
+
"attribute": "padding-bottom",
|
|
1200
1221
|
"reflects": true
|
|
1201
1222
|
}
|
|
1202
1223
|
],
|
|
@@ -1219,17 +1240,34 @@
|
|
|
1219
1240
|
"name": "padding-x",
|
|
1220
1241
|
"fieldName": "paddingX",
|
|
1221
1242
|
"type": {
|
|
1222
|
-
"text": "ContainerPaddingType"
|
|
1243
|
+
"text": "ContainerPaddingType | undefined"
|
|
1244
|
+
},
|
|
1245
|
+
"description": "Gutter (padding-inline) step. Unset follows the inherited `--dsgn-gutter`."
|
|
1246
|
+
},
|
|
1247
|
+
{
|
|
1248
|
+
"name": "section",
|
|
1249
|
+
"fieldName": "section",
|
|
1250
|
+
"type": {
|
|
1251
|
+
"text": "boolean"
|
|
1223
1252
|
},
|
|
1224
|
-
"
|
|
1253
|
+
"default": "false",
|
|
1254
|
+
"description": "Marks the container as a page section: unset vertical sides follow the\ninherited `--dsgn-section-space` instead of having no padding."
|
|
1225
1255
|
},
|
|
1226
1256
|
{
|
|
1227
|
-
"name": "padding-
|
|
1228
|
-
"fieldName": "
|
|
1257
|
+
"name": "padding-top",
|
|
1258
|
+
"fieldName": "paddingTop",
|
|
1229
1259
|
"type": {
|
|
1230
|
-
"text": "
|
|
1260
|
+
"text": "SectionSpaceType | undefined"
|
|
1231
1261
|
},
|
|
1232
|
-
"description": "
|
|
1262
|
+
"description": "Space above the content."
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
"name": "padding-bottom",
|
|
1266
|
+
"fieldName": "paddingBottom",
|
|
1267
|
+
"type": {
|
|
1268
|
+
"text": "SectionSpaceType | undefined"
|
|
1269
|
+
},
|
|
1270
|
+
"description": "Space below the content."
|
|
1233
1271
|
}
|
|
1234
1272
|
]
|
|
1235
1273
|
}
|
|
@@ -1432,6 +1470,26 @@
|
|
|
1432
1470
|
}
|
|
1433
1471
|
],
|
|
1434
1472
|
"members": [
|
|
1473
|
+
{
|
|
1474
|
+
"kind": "field",
|
|
1475
|
+
"name": "paddingTop",
|
|
1476
|
+
"type": {
|
|
1477
|
+
"text": "SectionSpaceType | undefined"
|
|
1478
|
+
},
|
|
1479
|
+
"description": "Space above the section. Unset follows the inherited section space.",
|
|
1480
|
+
"attribute": "padding-top",
|
|
1481
|
+
"reflects": true
|
|
1482
|
+
},
|
|
1483
|
+
{
|
|
1484
|
+
"kind": "field",
|
|
1485
|
+
"name": "paddingBottom",
|
|
1486
|
+
"type": {
|
|
1487
|
+
"text": "SectionSpaceType | undefined"
|
|
1488
|
+
},
|
|
1489
|
+
"description": "Space below the section. Unset follows the inherited section space.",
|
|
1490
|
+
"attribute": "padding-bottom",
|
|
1491
|
+
"reflects": true
|
|
1492
|
+
},
|
|
1435
1493
|
{
|
|
1436
1494
|
"kind": "field",
|
|
1437
1495
|
"name": "_inView",
|
|
@@ -1447,6 +1505,21 @@
|
|
|
1447
1505
|
"privacy": "private",
|
|
1448
1506
|
"default": "new AutoRotateController( this, DEFAULT_DURATION, () => this._inView.value === true, )"
|
|
1449
1507
|
},
|
|
1508
|
+
{
|
|
1509
|
+
"kind": "field",
|
|
1510
|
+
"name": "_motion",
|
|
1511
|
+
"privacy": "private",
|
|
1512
|
+
"default": "new MotionController(this)"
|
|
1513
|
+
},
|
|
1514
|
+
{
|
|
1515
|
+
"kind": "field",
|
|
1516
|
+
"name": "_shownIndex",
|
|
1517
|
+
"type": {
|
|
1518
|
+
"text": "number | undefined"
|
|
1519
|
+
},
|
|
1520
|
+
"privacy": "private",
|
|
1521
|
+
"description": "The feature whose detail last faded in; the fade replays when it changes."
|
|
1522
|
+
},
|
|
1450
1523
|
{
|
|
1451
1524
|
"kind": "field",
|
|
1452
1525
|
"name": "surface",
|
|
@@ -1533,6 +1606,12 @@
|
|
|
1533
1606
|
"description": "Accessible label for the tab list.",
|
|
1534
1607
|
"attribute": "tabs-aria-label"
|
|
1535
1608
|
},
|
|
1609
|
+
{
|
|
1610
|
+
"kind": "method",
|
|
1611
|
+
"name": "_fadeInDetail",
|
|
1612
|
+
"privacy": "private",
|
|
1613
|
+
"description": "Fade the detail in whenever the active feature changes. `keyed` renders a\nfresh element per feature, so each change animates a new node. This runs\nafter render and before paint, so the new detail never shows unfaded."
|
|
1614
|
+
},
|
|
1536
1615
|
{
|
|
1537
1616
|
"kind": "method",
|
|
1538
1617
|
"name": "_handleTabClick",
|
|
@@ -1699,6 +1778,22 @@
|
|
|
1699
1778
|
"tagName": "dsgn-feature-tabs",
|
|
1700
1779
|
"customElement": true,
|
|
1701
1780
|
"attributes": [
|
|
1781
|
+
{
|
|
1782
|
+
"name": "padding-top",
|
|
1783
|
+
"fieldName": "paddingTop",
|
|
1784
|
+
"type": {
|
|
1785
|
+
"text": "SectionSpaceType | undefined"
|
|
1786
|
+
},
|
|
1787
|
+
"description": "Space above the section. Unset follows the inherited section space."
|
|
1788
|
+
},
|
|
1789
|
+
{
|
|
1790
|
+
"name": "padding-bottom",
|
|
1791
|
+
"fieldName": "paddingBottom",
|
|
1792
|
+
"type": {
|
|
1793
|
+
"text": "SectionSpaceType | undefined"
|
|
1794
|
+
},
|
|
1795
|
+
"description": "Space below the section. Unset follows the inherited section space."
|
|
1796
|
+
},
|
|
1702
1797
|
{
|
|
1703
1798
|
"name": "surface",
|
|
1704
1799
|
"fieldName": "surface",
|
|
@@ -1843,22 +1938,22 @@
|
|
|
1843
1938
|
},
|
|
1844
1939
|
{
|
|
1845
1940
|
"kind": "field",
|
|
1846
|
-
"name": "
|
|
1941
|
+
"name": "paddingTop",
|
|
1847
1942
|
"type": {
|
|
1848
|
-
"text": "
|
|
1943
|
+
"text": "SectionSpaceType | undefined"
|
|
1849
1944
|
},
|
|
1850
|
-
"description": "
|
|
1851
|
-
"attribute": "padding-
|
|
1945
|
+
"description": "Space above the section. Unset follows the inherited section space.",
|
|
1946
|
+
"attribute": "padding-top",
|
|
1852
1947
|
"reflects": true
|
|
1853
1948
|
},
|
|
1854
1949
|
{
|
|
1855
1950
|
"kind": "field",
|
|
1856
|
-
"name": "
|
|
1951
|
+
"name": "paddingBottom",
|
|
1857
1952
|
"type": {
|
|
1858
|
-
"text": "
|
|
1953
|
+
"text": "SectionSpaceType | undefined"
|
|
1859
1954
|
},
|
|
1860
|
-
"description": "
|
|
1861
|
-
"attribute": "padding-
|
|
1955
|
+
"description": "Space below the section. Unset follows the inherited section space.",
|
|
1956
|
+
"attribute": "padding-bottom",
|
|
1862
1957
|
"reflects": true
|
|
1863
1958
|
}
|
|
1864
1959
|
],
|
|
@@ -1886,20 +1981,20 @@
|
|
|
1886
1981
|
"description": "Container max-width size"
|
|
1887
1982
|
},
|
|
1888
1983
|
{
|
|
1889
|
-
"name": "padding-
|
|
1890
|
-
"fieldName": "
|
|
1984
|
+
"name": "padding-top",
|
|
1985
|
+
"fieldName": "paddingTop",
|
|
1891
1986
|
"type": {
|
|
1892
|
-
"text": "
|
|
1987
|
+
"text": "SectionSpaceType | undefined"
|
|
1893
1988
|
},
|
|
1894
|
-
"description": "
|
|
1989
|
+
"description": "Space above the section. Unset follows the inherited section space."
|
|
1895
1990
|
},
|
|
1896
1991
|
{
|
|
1897
|
-
"name": "padding-
|
|
1898
|
-
"fieldName": "
|
|
1992
|
+
"name": "padding-bottom",
|
|
1993
|
+
"fieldName": "paddingBottom",
|
|
1899
1994
|
"type": {
|
|
1900
|
-
"text": "
|
|
1995
|
+
"text": "SectionSpaceType | undefined"
|
|
1901
1996
|
},
|
|
1902
|
-
"description": "
|
|
1997
|
+
"description": "Space below the section. Unset follows the inherited section space."
|
|
1903
1998
|
}
|
|
1904
1999
|
]
|
|
1905
2000
|
}
|
|
@@ -2527,6 +2622,26 @@
|
|
|
2527
2622
|
"description": "Horizontal alignment of content, form, and features in the centered layout.\nHas no effect on asset-right / asset-left / asset-background layouts.",
|
|
2528
2623
|
"attribute": "content-align",
|
|
2529
2624
|
"reflects": true
|
|
2625
|
+
},
|
|
2626
|
+
{
|
|
2627
|
+
"kind": "field",
|
|
2628
|
+
"name": "paddingTop",
|
|
2629
|
+
"type": {
|
|
2630
|
+
"text": "SectionSpaceType | undefined"
|
|
2631
|
+
},
|
|
2632
|
+
"description": "Space above the section. Unset follows the inherited section space.",
|
|
2633
|
+
"attribute": "padding-top",
|
|
2634
|
+
"reflects": true
|
|
2635
|
+
},
|
|
2636
|
+
{
|
|
2637
|
+
"kind": "field",
|
|
2638
|
+
"name": "paddingBottom",
|
|
2639
|
+
"type": {
|
|
2640
|
+
"text": "SectionSpaceType | undefined"
|
|
2641
|
+
},
|
|
2642
|
+
"description": "Space below the section. Unset follows the inherited section space.",
|
|
2643
|
+
"attribute": "padding-bottom",
|
|
2644
|
+
"reflects": true
|
|
2530
2645
|
}
|
|
2531
2646
|
],
|
|
2532
2647
|
"superclass": {
|
|
@@ -2567,6 +2682,22 @@
|
|
|
2567
2682
|
"text": "HeroContentAlignType"
|
|
2568
2683
|
},
|
|
2569
2684
|
"description": "Horizontal alignment of content, form, and features in the centered layout.\nHas no effect on asset-right / asset-left / asset-background layouts."
|
|
2685
|
+
},
|
|
2686
|
+
{
|
|
2687
|
+
"name": "padding-top",
|
|
2688
|
+
"fieldName": "paddingTop",
|
|
2689
|
+
"type": {
|
|
2690
|
+
"text": "SectionSpaceType | undefined"
|
|
2691
|
+
},
|
|
2692
|
+
"description": "Space above the section. Unset follows the inherited section space."
|
|
2693
|
+
},
|
|
2694
|
+
{
|
|
2695
|
+
"name": "padding-bottom",
|
|
2696
|
+
"fieldName": "paddingBottom",
|
|
2697
|
+
"type": {
|
|
2698
|
+
"text": "SectionSpaceType | undefined"
|
|
2699
|
+
},
|
|
2700
|
+
"description": "Space below the section. Unset follows the inherited section space."
|
|
2570
2701
|
}
|
|
2571
2702
|
]
|
|
2572
2703
|
}
|
|
@@ -3510,6 +3641,13 @@
|
|
|
3510
3641
|
"attribute": "no-escape-dismiss",
|
|
3511
3642
|
"reflects": true
|
|
3512
3643
|
},
|
|
3644
|
+
{
|
|
3645
|
+
"kind": "field",
|
|
3646
|
+
"name": "_motion",
|
|
3647
|
+
"privacy": "private",
|
|
3648
|
+
"readonly": true,
|
|
3649
|
+
"default": "new MotionController(this)"
|
|
3650
|
+
},
|
|
3513
3651
|
{
|
|
3514
3652
|
"kind": "field",
|
|
3515
3653
|
"name": "_closing",
|
|
@@ -3517,8 +3655,17 @@
|
|
|
3517
3655
|
"text": "boolean"
|
|
3518
3656
|
},
|
|
3519
3657
|
"privacy": "private",
|
|
3520
|
-
"default": "false"
|
|
3521
|
-
|
|
3658
|
+
"default": "false"
|
|
3659
|
+
},
|
|
3660
|
+
{
|
|
3661
|
+
"kind": "field",
|
|
3662
|
+
"name": "_closeRun",
|
|
3663
|
+
"type": {
|
|
3664
|
+
"text": "number"
|
|
3665
|
+
},
|
|
3666
|
+
"privacy": "private",
|
|
3667
|
+
"default": "0",
|
|
3668
|
+
"description": "Invalidates an exit when reopened, disconnected, or closed externally."
|
|
3522
3669
|
},
|
|
3523
3670
|
{
|
|
3524
3671
|
"kind": "field",
|
|
@@ -3614,7 +3761,7 @@
|
|
|
3614
3761
|
"kind": "field",
|
|
3615
3762
|
"name": "_motionOrigin",
|
|
3616
3763
|
"type": {
|
|
3617
|
-
"text": "
|
|
3764
|
+
"text": "Exclude<ModalMotionType, 'inherit'>"
|
|
3618
3765
|
},
|
|
3619
3766
|
"privacy": "private",
|
|
3620
3767
|
"description": "The resolved animation origin, with `inherit` folded into `placement`.",
|
|
@@ -3690,6 +3837,30 @@
|
|
|
3690
3837
|
],
|
|
3691
3838
|
"description": "Play the exit animation, then leave the top layer. The dialog stays in the\ntop layer for the whole animation because `dialog.close()` is what removes\nit, and that is deliberately the last step — no timers involved, the wait is\non the animations' own `finished` promises."
|
|
3692
3839
|
},
|
|
3840
|
+
{
|
|
3841
|
+
"kind": "method",
|
|
3842
|
+
"name": "_animateDialog",
|
|
3843
|
+
"privacy": "private",
|
|
3844
|
+
"return": {
|
|
3845
|
+
"type": {
|
|
3846
|
+
"text": "Promise<void>"
|
|
3847
|
+
}
|
|
3848
|
+
},
|
|
3849
|
+
"parameters": [
|
|
3850
|
+
{
|
|
3851
|
+
"name": "dialog",
|
|
3852
|
+
"type": {
|
|
3853
|
+
"text": "HTMLDialogElement"
|
|
3854
|
+
}
|
|
3855
|
+
},
|
|
3856
|
+
{
|
|
3857
|
+
"name": "entering",
|
|
3858
|
+
"type": {
|
|
3859
|
+
"text": "boolean"
|
|
3860
|
+
}
|
|
3861
|
+
}
|
|
3862
|
+
]
|
|
3863
|
+
},
|
|
3693
3864
|
{
|
|
3694
3865
|
"kind": "method",
|
|
3695
3866
|
"name": "_focusInitialElement",
|
|
@@ -156,20 +156,8 @@ class Base extends LitElement {
|
|
|
156
156
|
}
|
|
157
157
|
defineElement("dsgn-base", Base);
|
|
158
158
|
|
|
159
|
-
// common/helpers/motion.ts
|
|
160
|
-
var REDUCED_MOTION_QUERY = "(prefers-reduced-motion: reduce)";
|
|
161
|
-
var cachedMatchMedia;
|
|
162
|
-
var cachedQuery = null;
|
|
163
|
-
function prefersReducedMotion() {
|
|
164
|
-
const mm = typeof matchMedia === "function" ? matchMedia : undefined;
|
|
165
|
-
if (mm !== cachedMatchMedia) {
|
|
166
|
-
cachedMatchMedia = mm;
|
|
167
|
-
cachedQuery = mm ? mm(REDUCED_MOTION_QUERY) : null;
|
|
168
|
-
}
|
|
169
|
-
return cachedQuery?.matches ?? false;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
159
|
// common/controllers/AuroraMeshController.ts
|
|
160
|
+
import { prefersReducedMotion } from "@ds-gn/motion";
|
|
173
161
|
var X_MIN = -15;
|
|
174
162
|
var X_MAX = 70;
|
|
175
163
|
var Y_MIN = -20;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../../types/global.d.ts';
|
|
2
2
|
import { type CSSResultGroup } from 'lit';
|
|
3
3
|
import { Base } from '../../../common/Base/Base.js';
|
|
4
|
-
import { type ContainerPaddingType, type ContainerSizeType } from './Container.props.js';
|
|
4
|
+
import { type ContainerPaddingType, type ContainerSizeType, type SectionSpaceType } from './Container.props.js';
|
|
5
5
|
/** @slot - Constrained page content. */
|
|
6
6
|
export declare class Container extends Base {
|
|
7
7
|
static styles: CSSResultGroup;
|
|
@@ -10,13 +10,18 @@ export declare class Container extends Base {
|
|
|
10
10
|
*/
|
|
11
11
|
size: ContainerSizeType;
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Gutter (padding-inline) step. Unset follows the inherited `--dsgn-gutter`.
|
|
14
14
|
*/
|
|
15
|
-
paddingX
|
|
15
|
+
paddingX?: ContainerPaddingType;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Marks the container as a page section: unset vertical sides follow the
|
|
18
|
+
* inherited `--dsgn-section-space` instead of having no padding.
|
|
18
19
|
*/
|
|
19
|
-
|
|
20
|
+
section: boolean;
|
|
21
|
+
/** Space above the content. */
|
|
22
|
+
paddingTop?: SectionSpaceType;
|
|
23
|
+
/** Space below the content. */
|
|
24
|
+
paddingBottom?: SectionSpaceType;
|
|
20
25
|
render(): import("lit").TemplateResult<1>;
|
|
21
26
|
}
|
|
22
27
|
declare global {
|
|
@@ -103,6 +103,14 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
103
103
|
--breakpoint-lg: 64rem;
|
|
104
104
|
--breakpoint-xl: 80rem;
|
|
105
105
|
--breakpoint-2xl: 96rem;
|
|
106
|
+
--spacing-gutter-lg: var(--dsgn-src-spacing-gutter-lg, clamp(1.5rem, 0.333rem + 4.167vw, 3rem));
|
|
107
|
+
--spacing-gutter-md: var(--dsgn-src-spacing-gutter-md, clamp(1rem, 0.25rem + 3vw, 2rem));
|
|
108
|
+
--spacing-gutter-sm: var(--dsgn-src-spacing-gutter-sm, clamp(0.5rem, 0.125rem + 1.5vw, 1rem));
|
|
109
|
+
--spacing-gutter-xl: var(--dsgn-src-spacing-gutter-xl, clamp(2rem, 6.25vw, 4rem));
|
|
110
|
+
--spacing-section-lg: var(--dsgn-src-spacing-section-lg, 3rem);
|
|
111
|
+
--spacing-section-md: var(--dsgn-src-spacing-section-md, 2rem);
|
|
112
|
+
--spacing-section-sm: var(--dsgn-src-spacing-section-sm, 1rem);
|
|
113
|
+
--spacing-section-xl: var(--dsgn-src-spacing-section-xl, 4rem);
|
|
106
114
|
}
|
|
107
115
|
}
|
|
108
116
|
@layer utilities {
|
|
@@ -151,69 +159,59 @@ var styles2 = css2`/*! tailwindcss v4.3.0 | MIT License | https://tailwindcss.co
|
|
|
151
159
|
.max-w-screen-xl {
|
|
152
160
|
max-width: var(--breakpoint-xl);
|
|
153
161
|
}
|
|
154
|
-
.px-
|
|
155
|
-
padding-inline: calc(var(--spacing) *
|
|
162
|
+
.px-0 {
|
|
163
|
+
padding-inline: calc(var(--spacing) * 0);
|
|
156
164
|
}
|
|
157
|
-
.px-
|
|
158
|
-
padding-inline:
|
|
165
|
+
.px-\\[var\\(--dsgn-gutter\\,var\\(--spacing-gutter-md\\)\\)\\] {
|
|
166
|
+
padding-inline: var(--dsgn-gutter,var(--spacing-gutter-md));
|
|
159
167
|
}
|
|
160
|
-
.px-
|
|
161
|
-
padding-inline:
|
|
168
|
+
.px-gutter-lg {
|
|
169
|
+
padding-inline: var(--spacing-gutter-lg);
|
|
162
170
|
}
|
|
163
|
-
.px-
|
|
164
|
-
padding-inline:
|
|
171
|
+
.px-gutter-md {
|
|
172
|
+
padding-inline: var(--spacing-gutter-md);
|
|
165
173
|
}
|
|
166
|
-
.
|
|
167
|
-
padding-
|
|
174
|
+
.px-gutter-sm {
|
|
175
|
+
padding-inline: var(--spacing-gutter-sm);
|
|
168
176
|
}
|
|
169
|
-
.
|
|
170
|
-
padding-
|
|
177
|
+
.px-gutter-xl {
|
|
178
|
+
padding-inline: var(--spacing-gutter-xl);
|
|
171
179
|
}
|
|
172
|
-
.
|
|
173
|
-
padding-
|
|
180
|
+
.pt-0 {
|
|
181
|
+
padding-top: calc(var(--spacing) * 0);
|
|
174
182
|
}
|
|
175
|
-
.
|
|
176
|
-
padding-
|
|
183
|
+
.pt-\\[var\\(--dsgn-section-space\\,var\\(--spacing-section-md\\)\\)\\] {
|
|
184
|
+
padding-top: var(--dsgn-section-space,var(--spacing-section-md));
|
|
177
185
|
}
|
|
178
|
-
.
|
|
179
|
-
|
|
180
|
-
padding-inline: calc(var(--spacing) * 3);
|
|
181
|
-
}
|
|
186
|
+
.pt-section-lg {
|
|
187
|
+
padding-top: var(--spacing-section-lg);
|
|
182
188
|
}
|
|
183
|
-
.
|
|
184
|
-
|
|
185
|
-
padding-inline: calc(var(--spacing) * 6);
|
|
186
|
-
}
|
|
189
|
+
.pt-section-md {
|
|
190
|
+
padding-top: var(--spacing-section-md);
|
|
187
191
|
}
|
|
188
|
-
.sm
|
|
189
|
-
|
|
190
|
-
padding-inline: calc(var(--spacing) * 8);
|
|
191
|
-
}
|
|
192
|
+
.pt-section-sm {
|
|
193
|
+
padding-top: var(--spacing-section-sm);
|
|
192
194
|
}
|
|
193
|
-
.
|
|
194
|
-
|
|
195
|
-
padding-inline: calc(var(--spacing) * 10);
|
|
196
|
-
}
|
|
195
|
+
.pt-section-xl {
|
|
196
|
+
padding-top: var(--spacing-section-xl);
|
|
197
197
|
}
|
|
198
|
-
.
|
|
199
|
-
|
|
200
|
-
padding-inline: calc(var(--spacing) * 4);
|
|
201
|
-
}
|
|
198
|
+
.pb-0 {
|
|
199
|
+
padding-bottom: calc(var(--spacing) * 0);
|
|
202
200
|
}
|
|
203
|
-
.
|
|
204
|
-
|
|
205
|
-
padding-inline: calc(var(--spacing) * 8);
|
|
206
|
-
}
|
|
201
|
+
.pb-\\[var\\(--dsgn-section-space\\,var\\(--spacing-section-md\\)\\)\\] {
|
|
202
|
+
padding-bottom: var(--dsgn-section-space,var(--spacing-section-md));
|
|
207
203
|
}
|
|
208
|
-
.lg
|
|
209
|
-
|
|
210
|
-
padding-inline: calc(var(--spacing) * 12);
|
|
211
|
-
}
|
|
204
|
+
.pb-section-lg {
|
|
205
|
+
padding-bottom: var(--spacing-section-lg);
|
|
212
206
|
}
|
|
213
|
-
.
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
207
|
+
.pb-section-md {
|
|
208
|
+
padding-bottom: var(--spacing-section-md);
|
|
209
|
+
}
|
|
210
|
+
.pb-section-sm {
|
|
211
|
+
padding-bottom: var(--spacing-section-sm);
|
|
212
|
+
}
|
|
213
|
+
.pb-section-xl {
|
|
214
|
+
padding-bottom: var(--spacing-section-xl);
|
|
217
215
|
}
|
|
218
216
|
}
|
|
219
217
|
@property --dsgn-border-sweep-angle {
|
|
@@ -271,8 +269,11 @@ var containerPaddingValues = {
|
|
|
271
269
|
LG: "lg",
|
|
272
270
|
XL: "xl"
|
|
273
271
|
};
|
|
274
|
-
var
|
|
275
|
-
var
|
|
272
|
+
var optional = (values) => [...values, undefined, null];
|
|
273
|
+
var containerPaddingXProps = enumCreator(optional(Object.values(containerPaddingValues)), "padding-x", String, { reflect: true, attribute: "padding-x" });
|
|
274
|
+
var sectionSpaceValues = containerPaddingValues;
|
|
275
|
+
var paddingTopProps = enumCreator(optional(Object.values(sectionSpaceValues)), "padding-top", String, { reflect: true, attribute: "padding-top" });
|
|
276
|
+
var paddingBottomProps = enumCreator(optional(Object.values(sectionSpaceValues)), "padding-bottom", String, { reflect: true, attribute: "padding-bottom" });
|
|
276
277
|
|
|
277
278
|
// ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
278
279
|
function r(e) {
|
|
@@ -306,34 +307,45 @@ var sizeClasses = {
|
|
|
306
307
|
"2xl": ["max-w-screen-2xl"],
|
|
307
308
|
full: ["max-w-full"]
|
|
308
309
|
};
|
|
310
|
+
var inheritedGutter = "px-[var(--dsgn-gutter,var(--spacing-gutter-md))]";
|
|
309
311
|
var paddingXClasses = {
|
|
310
|
-
none:
|
|
311
|
-
sm:
|
|
312
|
-
md:
|
|
313
|
-
lg:
|
|
314
|
-
xl:
|
|
312
|
+
none: "px-0",
|
|
313
|
+
sm: "px-gutter-sm",
|
|
314
|
+
md: "px-gutter-md",
|
|
315
|
+
lg: "px-gutter-lg",
|
|
316
|
+
xl: "px-gutter-xl"
|
|
317
|
+
};
|
|
318
|
+
var inheritedTop = "pt-[var(--dsgn-section-space,var(--spacing-section-md))]";
|
|
319
|
+
var inheritedBottom = "pb-[var(--dsgn-section-space,var(--spacing-section-md))]";
|
|
320
|
+
var paddingTopClasses = {
|
|
321
|
+
none: "pt-0",
|
|
322
|
+
sm: "pt-section-sm",
|
|
323
|
+
md: "pt-section-md",
|
|
324
|
+
lg: "pt-section-lg",
|
|
325
|
+
xl: "pt-section-xl"
|
|
315
326
|
};
|
|
316
|
-
var
|
|
317
|
-
none:
|
|
318
|
-
sm:
|
|
319
|
-
md:
|
|
320
|
-
lg:
|
|
321
|
-
xl:
|
|
327
|
+
var paddingBottomClasses = {
|
|
328
|
+
none: "pb-0",
|
|
329
|
+
sm: "pb-section-sm",
|
|
330
|
+
md: "pb-section-md",
|
|
331
|
+
lg: "pb-section-lg",
|
|
332
|
+
xl: "pb-section-xl"
|
|
322
333
|
};
|
|
323
|
-
var
|
|
334
|
+
var paddingXClassNames = (padding) => padding ? paddingXClasses[padding] : inheritedGutter;
|
|
335
|
+
var sectionSpaceClassNames = (section, top, bottom) => clsx_default(top ? paddingTopClasses[top] : section && inheritedTop, bottom ? paddingBottomClasses[bottom] : section && inheritedBottom);
|
|
336
|
+
var classNames = (size, paddingX, section, paddingTop, paddingBottom) => clsx_default(baseClasses, sizeClasses[size], paddingXClassNames(paddingX), sectionSpaceClassNames(section, paddingTop, paddingBottom));
|
|
324
337
|
|
|
325
338
|
// components/Container/src/Container.ts
|
|
326
339
|
class Container extends Base {
|
|
327
340
|
constructor() {
|
|
328
341
|
super(...arguments);
|
|
329
342
|
this.size = containerSizeValues.LG;
|
|
330
|
-
this.
|
|
331
|
-
this.paddingY = containerPaddingValues.NONE;
|
|
343
|
+
this.section = false;
|
|
332
344
|
}
|
|
333
345
|
static styles = [Base.styles, Container_default];
|
|
334
346
|
render() {
|
|
335
347
|
return html2`<div
|
|
336
|
-
class="${classNames(this.size, this.paddingX, this.
|
|
348
|
+
class="${classNames(this.size, this.paddingX ?? undefined, this.section, this.paddingTop ?? undefined, this.paddingBottom ?? undefined)}"
|
|
337
349
|
>
|
|
338
350
|
<slot></slot>
|
|
339
351
|
</div>`;
|
|
@@ -346,8 +358,14 @@ __legacyDecorateClassTS([
|
|
|
346
358
|
property({ ...containerPaddingXProps })
|
|
347
359
|
], Container.prototype, "paddingX", undefined);
|
|
348
360
|
__legacyDecorateClassTS([
|
|
349
|
-
property({
|
|
350
|
-
], Container.prototype, "
|
|
361
|
+
property({ type: Boolean, reflect: true })
|
|
362
|
+
], Container.prototype, "section", undefined);
|
|
363
|
+
__legacyDecorateClassTS([
|
|
364
|
+
property({ ...paddingTopProps })
|
|
365
|
+
], Container.prototype, "paddingTop", undefined);
|
|
366
|
+
__legacyDecorateClassTS([
|
|
367
|
+
property({ ...paddingBottomProps })
|
|
368
|
+
], Container.prototype, "paddingBottom", undefined);
|
|
351
369
|
defineElement("dsgn-container", Container);
|
|
352
370
|
export {
|
|
353
371
|
Container
|