@a-type/ui 3.0.26 → 3.0.28
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/cjs/colors.stories.js +1 -8
- package/dist/cjs/colors.stories.js.map +1 -1
- package/dist/cjs/components/dialog/Dialog.js +30 -5
- package/dist/cjs/components/dialog/Dialog.js.map +1 -1
- package/dist/cjs/components/dialog/Dialog.stories.js +1 -1
- package/dist/cjs/components/dialog/Dialog.stories.js.map +1 -1
- package/dist/cjs/components/icon/Icon.js +1 -1
- package/dist/cjs/components/icon/Icon.js.map +1 -1
- package/dist/cjs/components/index.d.ts +2 -0
- package/dist/cjs/components/index.js +2 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/lightbox/Lightbox.d.ts +25 -0
- package/dist/cjs/components/lightbox/Lightbox.js +71 -0
- package/dist/cjs/components/lightbox/Lightbox.js.map +1 -0
- package/dist/cjs/components/lightbox/Lightbox.stories.d.ts +24 -0
- package/dist/cjs/components/lightbox/Lightbox.stories.js +21 -0
- package/dist/cjs/components/lightbox/Lightbox.stories.js.map +1 -0
- package/dist/cjs/components/lists/lists.d.ts +6 -0
- package/dist/cjs/components/lists/lists.js +16 -0
- package/dist/cjs/components/lists/lists.js.map +1 -0
- package/dist/cjs/components/lists/lists.stories.d.ts +14 -0
- package/dist/cjs/components/lists/lists.stories.js +25 -0
- package/dist/cjs/components/lists/lists.stories.js.map +1 -0
- package/dist/cjs/components/provider/Provider.d.ts +1 -4
- package/dist/cjs/components/provider/Provider.js +3 -3
- package/dist/cjs/components/provider/Provider.js.map +1 -1
- package/dist/cjs/components/pwaInstall/PlatformIcons.d.ts +5 -0
- package/dist/cjs/components/pwaInstall/PlatformIcons.js +25 -0
- package/dist/cjs/components/pwaInstall/PlatformIcons.js.map +1 -0
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.d.ts +5 -0
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.js +74 -0
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.js.map +1 -0
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.stories.d.ts +15 -0
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.stories.js +23 -0
- package/dist/cjs/components/pwaInstall/PwaInstallTrigger.stories.js.map +1 -0
- package/dist/cjs/components/pwaInstall/index.d.ts +3 -0
- package/dist/cjs/components/pwaInstall/index.js +21 -0
- package/dist/cjs/components/pwaInstall/index.js.map +1 -0
- package/dist/cjs/components/pwaInstall/useIsInstallReady.d.ts +3 -0
- package/dist/cjs/components/pwaInstall/useIsInstallReady.js +58 -0
- package/dist/cjs/components/pwaInstall/useIsInstallReady.js.map +1 -0
- package/dist/cjs/components/pwaInstall/useWebManifest.d.ts +2 -0
- package/dist/cjs/components/pwaInstall/useWebManifest.js +45 -0
- package/dist/cjs/components/pwaInstall/useWebManifest.js.map +1 -0
- package/dist/cjs/components/toasts/toasts.d.ts +4 -1
- package/dist/cjs/components/toasts/toasts.js +35 -1
- package/dist/cjs/components/toasts/toasts.js.map +1 -1
- package/dist/cjs/components/toasts/toasts.stories.d.ts +13 -0
- package/dist/cjs/components/toasts/toasts.stories.js +47 -0
- package/dist/cjs/components/toasts/toasts.stories.js.map +1 -0
- package/dist/cjs/platform.d.ts +11 -0
- package/dist/cjs/platform.js +95 -0
- package/dist/cjs/platform.js.map +1 -0
- package/dist/cjs/uno/logic/color.d.ts +0 -12
- package/dist/cjs/uno/logic/color.js +0 -35
- package/dist/cjs/uno/logic/color.js.map +1 -1
- package/dist/cjs/uno/logic/color.test.js +0 -12
- package/dist/cjs/uno/logic/color.test.js.map +1 -1
- package/dist/cjs/uno/theme/index.js +8 -0
- package/dist/cjs/uno/theme/index.js.map +1 -1
- package/dist/css/main.css +6 -5
- package/dist/esm/colors.stories.js +1 -8
- package/dist/esm/colors.stories.js.map +1 -1
- package/dist/esm/components/dialog/Dialog.js +30 -5
- package/dist/esm/components/dialog/Dialog.js.map +1 -1
- package/dist/esm/components/dialog/Dialog.stories.js +1 -1
- package/dist/esm/components/dialog/Dialog.stories.js.map +1 -1
- package/dist/esm/components/icon/Icon.js +1 -1
- package/dist/esm/components/icon/Icon.js.map +1 -1
- package/dist/esm/components/index.d.ts +2 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/components/lightbox/Lightbox.d.ts +25 -0
- package/dist/esm/components/lightbox/Lightbox.js +32 -0
- package/dist/esm/components/lightbox/Lightbox.js.map +1 -0
- package/dist/esm/components/lightbox/Lightbox.stories.d.ts +24 -0
- package/dist/esm/components/lightbox/Lightbox.stories.js +18 -0
- package/dist/esm/components/lightbox/Lightbox.stories.js.map +1 -0
- package/dist/esm/components/lists/lists.d.ts +6 -0
- package/dist/esm/components/lists/lists.js +13 -0
- package/dist/esm/components/lists/lists.js.map +1 -0
- package/dist/esm/components/lists/lists.stories.d.ts +14 -0
- package/dist/esm/components/lists/lists.stories.js +22 -0
- package/dist/esm/components/lists/lists.stories.js.map +1 -0
- package/dist/esm/components/provider/Provider.d.ts +1 -4
- package/dist/esm/components/provider/Provider.js +3 -3
- package/dist/esm/components/provider/Provider.js.map +1 -1
- package/dist/esm/components/pwaInstall/PlatformIcons.d.ts +5 -0
- package/dist/esm/components/pwaInstall/PlatformIcons.js +18 -0
- package/dist/esm/components/pwaInstall/PlatformIcons.js.map +1 -0
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.d.ts +5 -0
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.js +71 -0
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.js.map +1 -0
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.stories.d.ts +15 -0
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.stories.js +20 -0
- package/dist/esm/components/pwaInstall/PwaInstallTrigger.stories.js.map +1 -0
- package/dist/esm/components/pwaInstall/index.d.ts +3 -0
- package/dist/esm/components/pwaInstall/index.js +5 -0
- package/dist/esm/components/pwaInstall/index.js.map +1 -0
- package/dist/esm/components/pwaInstall/useIsInstallReady.d.ts +3 -0
- package/dist/esm/components/pwaInstall/useIsInstallReady.js +53 -0
- package/dist/esm/components/pwaInstall/useIsInstallReady.js.map +1 -0
- package/dist/esm/components/pwaInstall/useWebManifest.d.ts +2 -0
- package/dist/esm/components/pwaInstall/useWebManifest.js +42 -0
- package/dist/esm/components/pwaInstall/useWebManifest.js.map +1 -0
- package/dist/esm/components/toasts/toasts.d.ts +4 -1
- package/dist/esm/components/toasts/toasts.js +32 -1
- package/dist/esm/components/toasts/toasts.js.map +1 -1
- package/dist/esm/components/toasts/toasts.stories.d.ts +13 -0
- package/dist/esm/components/toasts/toasts.stories.js +44 -0
- package/dist/esm/components/toasts/toasts.stories.js.map +1 -0
- package/dist/esm/platform.d.ts +11 -0
- package/dist/esm/platform.js +84 -0
- package/dist/esm/platform.js.map +1 -0
- package/dist/esm/uno/logic/color.d.ts +0 -12
- package/dist/esm/uno/logic/color.js +0 -35
- package/dist/esm/uno/logic/color.js.map +1 -1
- package/dist/esm/uno/logic/color.test.js +0 -12
- package/dist/esm/uno/logic/color.test.js.map +1 -1
- package/dist/esm/uno/theme/index.js +8 -0
- package/dist/esm/uno/theme/index.js.map +1 -1
- package/package.json +5 -7
- package/src/colors.stories.tsx +0 -12
- package/src/components/dialog/Dialog.stories.tsx +20 -6
- package/src/components/dialog/Dialog.tsx +49 -4
- package/src/components/icon/Icon.tsx +6 -1
- package/src/components/index.ts +2 -0
- package/src/components/lightbox/Lightbox.stories.tsx +28 -0
- package/src/components/lightbox/Lightbox.tsx +87 -0
- package/src/components/lists/lists.stories.tsx +38 -0
- package/src/components/lists/lists.tsx +21 -0
- package/src/components/provider/Provider.tsx +2 -9
- package/src/components/pwaInstall/PlatformIcons.tsx +75 -0
- package/src/components/pwaInstall/PwaInstallTrigger.stories.tsx +29 -0
- package/src/components/pwaInstall/PwaInstallTrigger.tsx +227 -0
- package/src/components/pwaInstall/index.ts +3 -0
- package/src/components/pwaInstall/useIsInstallReady.ts +56 -0
- package/src/components/pwaInstall/useWebManifest.ts +55 -0
- package/src/components/toasts/toasts.stories.tsx +83 -0
- package/src/components/toasts/toasts.tsx +72 -1
- package/src/platform.ts +103 -0
- package/src/uno/logic/color.test.ts +0 -27
- package/src/uno/logic/color.ts +0 -56
- package/src/uno/theme/index.ts +8 -0
- package/dist/cjs/uno/logic/oklch.d.ts +0 -3
- package/dist/cjs/uno/logic/oklch.js +0 -96
- package/dist/cjs/uno/logic/oklch.js.map +0 -1
- package/dist/esm/uno/logic/oklch.d.ts +0 -3
- package/dist/esm/uno/logic/oklch.js +0 -90
- package/dist/esm/uno/logic/oklch.js.map +0 -1
- package/src/uno/logic/oklch.ts +0 -120
|
@@ -39,20 +39,12 @@ describe('oklch color evaluation tools', () => {
|
|
|
39
39
|
});
|
|
40
40
|
it('should evaluate a valid oklch color value using element property values', () => {
|
|
41
41
|
const context = snapshotColorContext('leek');
|
|
42
|
-
expect(wash.computeSrgb(context)).toMatchInlineSnapshot(`"rgb(100% 100% 100%)"`);
|
|
43
|
-
expect(wash.computeHex(context)).toMatchInlineSnapshot(`"#fff"`);
|
|
44
42
|
expect(wash.computeOklch(context)).toMatchInlineSnapshot(`"oklch(100% 10% 165.88)"`);
|
|
45
|
-
expect(DEFAULT.computeSrgb(context)).toMatchInlineSnapshot(`"rgb(40.747% 99.344% 77.98%)"`);
|
|
46
|
-
expect(DEFAULT.computeHex(context)).toMatchInlineSnapshot(`"#68fdc7"`);
|
|
47
43
|
expect(DEFAULT.computeOklch(context)).toMatchInlineSnapshot(`"oklch(90% 37.5% 165.88)"`);
|
|
48
44
|
});
|
|
49
45
|
it('should evaluate different named palettes in addition to main', () => {
|
|
50
46
|
const context = snapshotColorContext('attention');
|
|
51
|
-
expect(wash.computeSrgb(context)).toMatchInlineSnapshot(`"rgb(100% 100% 100%)"`);
|
|
52
|
-
expect(wash.computeHex(context)).toMatchInlineSnapshot(`"#fff"`);
|
|
53
47
|
expect(wash.computeOklch(context)).toMatchInlineSnapshot(`"oklch(100% 10% 30)"`);
|
|
54
|
-
expect(DEFAULT.computeSrgb(context)).toMatchInlineSnapshot(`"rgb(100% 80.069% 75.637%)"`);
|
|
55
|
-
expect(DEFAULT.computeHex(context)).toMatchInlineSnapshot(`"#ffccc1"`);
|
|
56
48
|
expect(DEFAULT.computeOklch(context)).toMatchInlineSnapshot(`"oklch(90% 37.5% 30)"`);
|
|
57
49
|
});
|
|
58
50
|
it('works in dark mode', () => {
|
|
@@ -60,11 +52,7 @@ describe('oklch color evaluation tools', () => {
|
|
|
60
52
|
darkMode.classList.add('override-dark', 'palette-leek');
|
|
61
53
|
document.body.appendChild(darkMode);
|
|
62
54
|
const context = snapshotColorContext('leek', 'dark');
|
|
63
|
-
expect(wash.computeSrgb(context)).toMatchInlineSnapshot(`"rgb(0% 14.06% 7.3466%)"`);
|
|
64
|
-
expect(wash.computeHex(context)).toMatchInlineSnapshot(`"#002413"`);
|
|
65
55
|
expect(wash.computeOklch(context)).toMatchInlineSnapshot(`"oklch(22% 20% 165.88)"`);
|
|
66
|
-
expect(DEFAULT.computeSrgb(context)).toMatchInlineSnapshot(`"rgb(0% 60.697% 41.999%)"`);
|
|
67
|
-
expect(DEFAULT.computeHex(context)).toMatchInlineSnapshot(`"#009b6b"`);
|
|
68
56
|
expect(DEFAULT.computeOklch(context)).toMatchInlineSnapshot(`"oklch(60% 40% 165.88)"`);
|
|
69
57
|
document.body.removeChild(darkMode);
|
|
70
58
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color.test.js","sourceRoot":"","sources":["../../../../src/uno/logic/color.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAEN,wBAAwB,EACxB,oBAAoB,GACpB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,QAAQ,CAA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AAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,CAAC,MAAM,KAAK,GAAU;IAC3B,MAAM;IACN,QAAQ;IACR,UAAU;IACV,OAAO;IACP,YAAY;IACZ,SAAS;IACT,KAAK;IACL,MAAM;IACN,QAAQ,EAAE,KAAK;IACf,SAAS,EAAE,MAAM;IACjB,SAAS;IACT,MAAM;IACN,SAAS;IACT,IAAI,EAAE;QACL,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,KAAK;QACT,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,MAAM;QACb,KAAK,EAAE,MAAM;KACb;IACD,MAAM,EAAE;QACP,GAAG,EAAE,cAAc;QACnB,IAAI,EAAE,eAAe;QACrB,MAAM,EAAE,iBAAiB;QACzB,QAAQ,EAAE,mBAAmB;QAC7B,OAAO,EAAE,kBAAkB;QAC3B,QAAQ,EAAE,mBAAmB;QAC7B,aAAa,EAAE,sBAAsB;KACrC;CACD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a-type/ui",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.28",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"url": "https://github.com/a-type/ui"
|
|
@@ -66,17 +66,13 @@
|
|
|
66
66
|
"browser-image-resizer": "^2.4.1",
|
|
67
67
|
"calendar-blocks": "^0.4.0",
|
|
68
68
|
"clsx": "^2.1.1",
|
|
69
|
-
"color-interpolate": "^1.0.5",
|
|
70
|
-
"color-parse": "^2.0.2",
|
|
71
|
-
"color-space": "^2.0.1",
|
|
72
|
-
"colorjs.io": "^0.5.2",
|
|
73
69
|
"csstype": "^3.1.3",
|
|
74
70
|
"date-fns": "^4.1.0",
|
|
75
71
|
"formik": "^2.4.6",
|
|
76
72
|
"frimousse": "^0.2.0",
|
|
77
73
|
"motion": "^12.23.6",
|
|
78
74
|
"pluralize": "^8.0.0",
|
|
79
|
-
"react-hot-toast": "^2.
|
|
75
|
+
"react-hot-toast": "^2.6.0",
|
|
80
76
|
"react-is": "^19.1.0",
|
|
81
77
|
"valtio": "^2.1.4"
|
|
82
78
|
},
|
|
@@ -93,6 +89,8 @@
|
|
|
93
89
|
"@types/react-dom": "^19.0.2",
|
|
94
90
|
"@types/react-is": "^19.0.0",
|
|
95
91
|
"@types/w3c-image-capture": "^1.0.10",
|
|
92
|
+
"@types/web-app-manifest": "^1.0.9",
|
|
93
|
+
"@types/dom-chromium-installation-events": "^101.0.4",
|
|
96
94
|
"@unocss/cli": "66.5.4",
|
|
97
95
|
"@unocss/core": "66.5.4",
|
|
98
96
|
"@unocss/transformer-variant-group": "66.5.4",
|
|
@@ -107,7 +105,7 @@
|
|
|
107
105
|
"react": "19.0.0",
|
|
108
106
|
"react-dom": "19.0.0",
|
|
109
107
|
"storybook": "8.4.7",
|
|
110
|
-
"typescript": "^5.
|
|
108
|
+
"typescript": "^5.9.3",
|
|
111
109
|
"unocss": "^66.5.4",
|
|
112
110
|
"vitest": "^4.0.6",
|
|
113
111
|
"vitest-browser-react": "^2.0.2"
|
package/src/colors.stories.tsx
CHANGED
|
@@ -257,13 +257,6 @@ export const TweakOpacity: Story = {
|
|
|
257
257
|
export const ComputedColors: Story = {
|
|
258
258
|
render() {
|
|
259
259
|
const ctx = snapshotColorContext('primary');
|
|
260
|
-
const hexValues = [
|
|
261
|
-
palettes.primary.definitions.wash.computeHex(ctx),
|
|
262
|
-
palettes.primary.definitions.light.computeHex(ctx),
|
|
263
|
-
palettes.primary.definitions.default.computeHex(ctx),
|
|
264
|
-
palettes.primary.definitions.dark.computeHex(ctx),
|
|
265
|
-
palettes.primary.definitions.ink.computeHex(ctx),
|
|
266
|
-
];
|
|
267
260
|
const oklchValues = [
|
|
268
261
|
palettes.primary.definitions.wash.computeOklch(ctx),
|
|
269
262
|
palettes.primary.definitions.light.computeOklch(ctx),
|
|
@@ -280,11 +273,6 @@ export const ComputedColors: Story = {
|
|
|
280
273
|
<Swatch style={{ backgroundColor: oklch }}>OK</Swatch>
|
|
281
274
|
))}
|
|
282
275
|
</Box>
|
|
283
|
-
<Box className="h-100px">
|
|
284
|
-
{hexValues.map((hex) => (
|
|
285
|
-
<Swatch style={{ backgroundColor: hex }}>Hex</Swatch>
|
|
286
|
-
))}
|
|
287
|
-
</Box>
|
|
288
276
|
</Box>
|
|
289
277
|
);
|
|
290
278
|
},
|
|
@@ -33,12 +33,26 @@ function DummyContent() {
|
|
|
33
33
|
return (
|
|
34
34
|
<div className="col">
|
|
35
35
|
<H1>Some content</H1>
|
|
36
|
-
<
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
<div className="overflow-y-auto max-h-20vh">
|
|
37
|
+
<P>
|
|
38
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at
|
|
39
|
+
porttitor sem. Aliquam erat volutpat. Donec fermentum tortor eget
|
|
40
|
+
ligula accumsan, sit amet ullamcorper nunc ultricies. Nulla facilisi.
|
|
41
|
+
Nulla facil
|
|
42
|
+
</P>
|
|
43
|
+
<P>
|
|
44
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at
|
|
45
|
+
porttitor sem. Aliquam erat volutpat. Donec fermentum tortor eget
|
|
46
|
+
ligula accumsan, sit amet ullamcorper nunc ultricies. Nulla facilisi.
|
|
47
|
+
Nulla facil
|
|
48
|
+
</P>
|
|
49
|
+
<P>
|
|
50
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam at
|
|
51
|
+
porttitor sem. Aliquam erat volutpat. Donec fermentum tortor eget
|
|
52
|
+
ligula accumsan, sit amet ullamcorper nunc ultricies. Nulla facilisi.
|
|
53
|
+
Nulla facil
|
|
54
|
+
</P>
|
|
55
|
+
</div>
|
|
42
56
|
<Button disabled color="primary">
|
|
43
57
|
Click me
|
|
44
58
|
</Button>
|
|
@@ -26,11 +26,12 @@ const StyledOverlay = withClassName(
|
|
|
26
26
|
'layer-components:(fixed inset-0 z-backdrop animate-fade-in animate-duration-200 bg-black/15 shadow-inset shadow-[0_30px_60px_0px] shadow-black/20 border-top-1 border-top-solid border-top-gray)',
|
|
27
27
|
'layer-components:[&[data-state=closed]]:animate-fade-out',
|
|
28
28
|
'motion-reduce:animate-none',
|
|
29
|
+
'layer-components:backdrop-blur-sm',
|
|
29
30
|
);
|
|
30
31
|
|
|
31
32
|
const StyledContent = withClassName(
|
|
32
33
|
DialogPrimitive.Content,
|
|
33
|
-
'layer-components:(z-dialog fixed shadow-xl
|
|
34
|
+
'layer-components:(z-dialog fixed shadow-xl bg-white overflow-y-auto border border-gray flex flex-col border border-gray-dark)',
|
|
34
35
|
'layer-components:sm:shadow-down',
|
|
35
36
|
'transform-gpu !motion-reduce:animate-none',
|
|
36
37
|
'layer-components:(left-50% top-50% translate-[-50%] w-90vw max-w-450px max-h-85vh p-6 pt-8 rounded-lg border-b-1 pt-6)',
|
|
@@ -38,7 +39,7 @@ const StyledContent = withClassName(
|
|
|
38
39
|
'layer-components:[&[data-state=closed]]:animate-dialog-out',
|
|
39
40
|
);
|
|
40
41
|
const sheetClassNames = classNames(
|
|
41
|
-
'layer-variants:lt-sm:(translate-0 left-0 right-0 top-auto h-min-content rounded-tl-xl rounded-tr-xl rounded-b-0 border-b-0 p-6 pt-8 w-full max-w-none)',
|
|
42
|
+
'layer-variants:lt-sm:(translate-0 left-0 right-0 top-auto h-min-content rounded-tl-xl rounded-tr-xl rounded-b-0 border-b-0 p-6 pt-8 w-full max-w-none shadow-up)',
|
|
42
43
|
'layer-variants:lt-sm:pb-[calc(3rem+env(safe-area-inset-bottom,0px))]',
|
|
43
44
|
'layer-variants:lt-sm:(animate-fade-in-up)',
|
|
44
45
|
'layer-variants:lt-sm:[&[data-state=closed]]:animate-fade-out-down',
|
|
@@ -69,6 +70,34 @@ function sheetCloseGestureLogic(
|
|
|
69
70
|
content.style.setProperty('transition', last ? 'bottom 0.2s' : '');
|
|
70
71
|
}
|
|
71
72
|
|
|
73
|
+
// filter out gestures that are within scrollable descendants
|
|
74
|
+
// if those elements are not scrolled to the top already
|
|
75
|
+
function filterScrollables(
|
|
76
|
+
target: HTMLElement,
|
|
77
|
+
root: HTMLElement,
|
|
78
|
+
dy: number,
|
|
79
|
+
vy: number,
|
|
80
|
+
) {
|
|
81
|
+
// always allow upward swipes
|
|
82
|
+
if (vy < 0) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let cur: HTMLElement | null = target;
|
|
87
|
+
while (cur) {
|
|
88
|
+
if (cur === root) return false;
|
|
89
|
+
cur = cur.parentElement;
|
|
90
|
+
if (
|
|
91
|
+
cur &&
|
|
92
|
+
cur.scrollHeight > cur.clientHeight &&
|
|
93
|
+
cur.scrollTop !== 0 &&
|
|
94
|
+
vy > 0
|
|
95
|
+
)
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
|
|
72
101
|
export interface DialogContentProps
|
|
73
102
|
extends ComponentPropsWithRef<typeof DialogPrimitive.Content> {
|
|
74
103
|
width?: 'sm' | 'md' | 'lg';
|
|
@@ -146,8 +175,24 @@ export const Content = function Content({
|
|
|
146
175
|
const close = useContext(DialogCloseContext);
|
|
147
176
|
const isSmall = useMediaQuery('(max-width: 640px)');
|
|
148
177
|
const bind = useDrag(
|
|
149
|
-
({
|
|
150
|
-
|
|
178
|
+
({
|
|
179
|
+
swipe: [, swipeY],
|
|
180
|
+
movement: [, dy],
|
|
181
|
+
velocity: [, vy],
|
|
182
|
+
last,
|
|
183
|
+
active,
|
|
184
|
+
target,
|
|
185
|
+
}) => {
|
|
186
|
+
if (
|
|
187
|
+
filterScrollables(target as HTMLElement, gestureRef.current!, dy, vy)
|
|
188
|
+
) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
if (
|
|
192
|
+
(active || last) &&
|
|
193
|
+
gestureRef.current &&
|
|
194
|
+
gestureRef.current.scrollTop < 3
|
|
195
|
+
) {
|
|
151
196
|
sheetCloseGestureLogic(swipeY, dy, vy, last, close, gestureRef.current);
|
|
152
197
|
}
|
|
153
198
|
},
|
|
@@ -24,7 +24,12 @@ export const Icon = function Icon({
|
|
|
24
24
|
const loading = loadingProp !== false && (loadingProp || loadingContext);
|
|
25
25
|
|
|
26
26
|
if (loading) {
|
|
27
|
-
return
|
|
27
|
+
return (
|
|
28
|
+
<Spinner
|
|
29
|
+
size={size}
|
|
30
|
+
className={classNames('icon inline-block flex-shrink-0', className)}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
return (
|
package/src/components/index.ts
CHANGED
|
@@ -25,6 +25,7 @@ export * from './imageUploader/index.js';
|
|
|
25
25
|
export * from './infiniteLoadTrigger/InfiniteLoadTrigger.js';
|
|
26
26
|
export * from './input/index.js';
|
|
27
27
|
export * from './layouts/index.js';
|
|
28
|
+
export * from './lists/lists.js';
|
|
28
29
|
export * from './liveUpdateTextField/index.js';
|
|
29
30
|
export * from './marquee/marquee.js';
|
|
30
31
|
export * from './masonry/masonry.js';
|
|
@@ -36,6 +37,7 @@ export * from './peek/index.js';
|
|
|
36
37
|
export * from './popover/index.js';
|
|
37
38
|
export * from './progress/Progress.js';
|
|
38
39
|
export * from './provider/Provider.js';
|
|
40
|
+
export * from './pwaInstall/index.js';
|
|
39
41
|
export * from './relativeTime/index.js';
|
|
40
42
|
export * from './richEditor/index.js';
|
|
41
43
|
export * from './scrollArea/ScrollArea.js';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Lightbox } from './Lightbox.js';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/Lightbox',
|
|
6
|
+
component: Lightbox,
|
|
7
|
+
argTypes: {},
|
|
8
|
+
parameters: {
|
|
9
|
+
controls: { expanded: true },
|
|
10
|
+
},
|
|
11
|
+
} satisfies Meta<typeof Lightbox>;
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof Lightbox>;
|
|
16
|
+
|
|
17
|
+
export const Default: Story = {
|
|
18
|
+
render(args) {
|
|
19
|
+
return (
|
|
20
|
+
<Lightbox {...args}>
|
|
21
|
+
<Lightbox.Image
|
|
22
|
+
src="https://resources.biscuits.club/images/pashka.jpg"
|
|
23
|
+
alt="Sample"
|
|
24
|
+
/>
|
|
25
|
+
</Lightbox>
|
|
26
|
+
);
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import * as Dialog from '@radix-ui/react-dialog';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { withClassName } from '../../hooks.js';
|
|
4
|
+
import { Button } from '../button/Button.js';
|
|
5
|
+
import { Icon } from '../icon/Icon.js';
|
|
6
|
+
|
|
7
|
+
export interface LightboxProps {
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const LightboxRoot = Dialog.Root;
|
|
12
|
+
export const LightboxTrigger = withClassName(
|
|
13
|
+
Dialog.Trigger,
|
|
14
|
+
'layer-components:cursor-pointer',
|
|
15
|
+
'layer-components:focus-visible:(outline-none ring ring-accent)',
|
|
16
|
+
);
|
|
17
|
+
export const LightboxPortal = Dialog.Portal;
|
|
18
|
+
export const LightboxTitle = () => (
|
|
19
|
+
<Dialog.Title className="sr-only">Lightbox</Dialog.Title>
|
|
20
|
+
);
|
|
21
|
+
export const LightboxClose = (props: Dialog.DialogCloseProps) => (
|
|
22
|
+
<Dialog.Close {...props} asChild className="absolute top-md right-md">
|
|
23
|
+
<Button aria-label="Close">
|
|
24
|
+
<Icon name="x" />
|
|
25
|
+
</Button>
|
|
26
|
+
</Dialog.Close>
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const LightboxOverlay = withClassName(
|
|
30
|
+
Dialog.Overlay,
|
|
31
|
+
'layer-components:(fixed inset-0 bg-black/50 backdrop-blur-sm z-backdrop)',
|
|
32
|
+
'transform-gpu !motion-reduce:animate-none',
|
|
33
|
+
'layer-components:[&[data-state=closed]]:animate-fade-out layer-components:(animate-fade-in animate-duration-200)',
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export const LightboxContentRoot = withClassName(
|
|
37
|
+
Dialog.Content,
|
|
38
|
+
'layer-components:(fixed z-dialog bg-none border-none p-lg w-full h-full max-w-full max-h-full flex items-center justify-center)',
|
|
39
|
+
'transform-gpu !motion-reduce:animate-none',
|
|
40
|
+
'layer-components:(left-50% top-50% translate-[-50%] w-90vw max-h-85vh)',
|
|
41
|
+
'layer-components:animate-dialog-in',
|
|
42
|
+
'layer-components:[&[data-state=closed]]:animate-dialog-out',
|
|
43
|
+
'!pointer-events-none',
|
|
44
|
+
);
|
|
45
|
+
export const LightboxContent = (props: Dialog.DialogContentProps) => {
|
|
46
|
+
return (
|
|
47
|
+
<LightboxContentRoot {...props}>
|
|
48
|
+
<LightboxTitle />
|
|
49
|
+
<LightboxClose className="pointer-events-auto" />
|
|
50
|
+
<LightboxContentInner>{props.children}</LightboxContentInner>
|
|
51
|
+
</LightboxContentRoot>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const LightboxContentInner = withClassName(
|
|
56
|
+
'div',
|
|
57
|
+
'layer-components:(max-w-full max-h-full overflow-hidden flex flex-col items-center justify-center)',
|
|
58
|
+
'layer-components:pointer-events-none layer-components:[&>*]:pointer-events-auto',
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
function LightboxDefault({ children }: LightboxProps) {
|
|
62
|
+
return (
|
|
63
|
+
<Dialog.Root>
|
|
64
|
+
<Dialog.Trigger asChild>{children}</Dialog.Trigger>
|
|
65
|
+
<Dialog.Portal>
|
|
66
|
+
<LightboxOverlay />
|
|
67
|
+
<LightboxContent>{children}</LightboxContent>
|
|
68
|
+
</Dialog.Portal>
|
|
69
|
+
</Dialog.Root>
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const LightboxImage = withClassName(
|
|
74
|
+
'img',
|
|
75
|
+
'max-w-full max-h-full min-h-80px min-w-80px object-contain',
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
export const Lightbox = Object.assign(LightboxDefault, {
|
|
79
|
+
Overlay: LightboxOverlay,
|
|
80
|
+
Content: LightboxContent,
|
|
81
|
+
Image: LightboxImage,
|
|
82
|
+
Root: LightboxRoot,
|
|
83
|
+
Trigger: LightboxTrigger,
|
|
84
|
+
Close: LightboxClose,
|
|
85
|
+
Title: LightboxTitle,
|
|
86
|
+
Portal: LightboxPortal,
|
|
87
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Ol, Ul } from './lists.js';
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: 'Components/lists',
|
|
6
|
+
argTypes: {},
|
|
7
|
+
parameters: {
|
|
8
|
+
controls: { expanded: true },
|
|
9
|
+
},
|
|
10
|
+
} satisfies Meta;
|
|
11
|
+
|
|
12
|
+
export default meta;
|
|
13
|
+
|
|
14
|
+
type Story = StoryObj;
|
|
15
|
+
|
|
16
|
+
export const OrderedList: Story = {
|
|
17
|
+
render(args) {
|
|
18
|
+
return (
|
|
19
|
+
<Ol {...args}>
|
|
20
|
+
<Ol.Item>First item</Ol.Item>
|
|
21
|
+
<Ol.Item>Second item</Ol.Item>
|
|
22
|
+
<Ol.Item>Third item</Ol.Item>
|
|
23
|
+
</Ol>
|
|
24
|
+
);
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const UnorderedList: Story = {
|
|
29
|
+
render(args) {
|
|
30
|
+
return (
|
|
31
|
+
<Ul {...args}>
|
|
32
|
+
<Ul.Item>First item</Ul.Item>
|
|
33
|
+
<Ul.Item>Second item</Ul.Item>
|
|
34
|
+
<Ul.Item>Third item</Ul.Item>
|
|
35
|
+
</Ul>
|
|
36
|
+
);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { withClassName } from '../../hooks.js';
|
|
2
|
+
|
|
3
|
+
const OlBase = withClassName(
|
|
4
|
+
'ol',
|
|
5
|
+
'list-decimal list-inside m-0 p-0 flex flex-col gap-sm',
|
|
6
|
+
);
|
|
7
|
+
const OlItem = withClassName('li', 'ml-sm');
|
|
8
|
+
|
|
9
|
+
export const Ol = Object.assign(OlBase, {
|
|
10
|
+
Item: OlItem,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
const UlBase = withClassName(
|
|
14
|
+
'ul',
|
|
15
|
+
'list-disc list-inside m-0 p-0 flex flex-col gap-sm',
|
|
16
|
+
);
|
|
17
|
+
const UlItem = withClassName('li', 'ml-sm');
|
|
18
|
+
|
|
19
|
+
export const Ul = Object.assign(UlBase, {
|
|
20
|
+
Item: UlItem,
|
|
21
|
+
});
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { createContext, ReactNode, useContext } from 'react';
|
|
2
|
-
import { Toaster, ToastPosition } from 'react-hot-toast';
|
|
3
2
|
import { useThemedTitleBar, useVisualViewportOffset } from '../../hooks.js';
|
|
4
3
|
import { useVirtualKeyboardBehavior } from '../../hooks/useVirtualKeyboardBehavior.js';
|
|
5
4
|
import { IconSpritesheet } from '../icon/index.js';
|
|
6
5
|
import { ParticleLayer } from '../particles/index.js';
|
|
6
|
+
import { Toaster } from '../toasts/toasts.js';
|
|
7
7
|
import { TooltipProvider } from '../tooltip/index.js';
|
|
8
8
|
|
|
9
9
|
export interface ProviderProps {
|
|
10
10
|
children?: ReactNode;
|
|
11
11
|
disableParticles?: boolean;
|
|
12
|
-
toastPosition?: ToastPosition;
|
|
13
|
-
toastContainerClassName?: string;
|
|
14
12
|
disableViewportOffset?: boolean;
|
|
15
13
|
virtualKeyboardBehavior?: 'overlay' | 'displace';
|
|
16
14
|
disableTitleBarColor?: boolean;
|
|
@@ -22,8 +20,6 @@ export interface ProviderProps {
|
|
|
22
20
|
export function Provider({
|
|
23
21
|
children,
|
|
24
22
|
disableParticles,
|
|
25
|
-
toastPosition = 'top-center',
|
|
26
|
-
toastContainerClassName,
|
|
27
23
|
disableViewportOffset,
|
|
28
24
|
virtualKeyboardBehavior = 'displace',
|
|
29
25
|
disableTitleBarColor,
|
|
@@ -38,10 +34,7 @@ export function Provider({
|
|
|
38
34
|
const otherStuff = (
|
|
39
35
|
<>
|
|
40
36
|
<IconSpritesheet />
|
|
41
|
-
<Toaster
|
|
42
|
-
position={toastPosition}
|
|
43
|
-
containerClassName={toastContainerClassName}
|
|
44
|
-
/>
|
|
37
|
+
<Toaster />
|
|
45
38
|
</>
|
|
46
39
|
);
|
|
47
40
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export function SafariShareIcon() {
|
|
2
|
+
return (
|
|
3
|
+
<svg
|
|
4
|
+
id="pwa-share"
|
|
5
|
+
width="24"
|
|
6
|
+
height="24"
|
|
7
|
+
viewBox="0 0 17.695 26.475"
|
|
8
|
+
className="v-middle"
|
|
9
|
+
>
|
|
10
|
+
<g fill="currentColor">
|
|
11
|
+
<path d="M17.334 10.762v9.746c0 2.012-1.025 3.027-3.066 3.027H3.066C1.026 23.535 0 22.52 0 20.508v-9.746C0 8.75 1.025 7.734 3.066 7.734h2.94v1.573h-2.92c-.977 0-1.514.527-1.514 1.543v9.57c0 1.015.537 1.543 1.514 1.543h11.152c.967 0 1.524-.527 1.524-1.543v-9.57c0-1.016-.557-1.543-1.524-1.543h-2.91V7.734h2.94c2.04 0 3.066 1.016 3.066 3.028Z" />
|
|
12
|
+
<path d="M8.662 15.889c.42 0 .781-.352.781-.762V5.097l-.058-1.464.654.693 1.484 1.582a.698.698 0 0 0 .528.235c.4 0 .713-.293.713-.694 0-.205-.088-.361-.235-.508l-3.3-3.183c-.196-.196-.362-.264-.567-.264-.195 0-.361.069-.566.264L4.795 4.94a.681.681 0 0 0-.225.508c0 .4.293.694.703.694.186 0 .4-.079.538-.235l1.474-1.582.664-.693-.058 1.465v10.029c0 .41.351.762.771.762Z" />
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function SafariIcon() {
|
|
19
|
+
return (
|
|
20
|
+
<svg
|
|
21
|
+
id="pwa-safari"
|
|
22
|
+
viewBox="0 0 20.283 19.932"
|
|
23
|
+
width="25"
|
|
24
|
+
height="25"
|
|
25
|
+
className="v-middle"
|
|
26
|
+
>
|
|
27
|
+
<g fill="currentColor">
|
|
28
|
+
<path d="M9.96 19.922c5.45 0 9.962-4.522 9.962-9.961C19.922 4.51 15.4 0 9.952 0 4.511 0 0 4.512 0 9.96c0 5.44 4.521 9.962 9.96 9.962Zm0-1.66A8.26 8.26 0 0 1 1.67 9.96c0-4.61 3.672-8.3 8.281-8.3 4.61 0 8.31 3.69 8.31 8.3 0 4.61-3.69 8.3-8.3 8.3Z" />
|
|
29
|
+
<path d="m5.87 14.883 5.605-2.735a1.47 1.47 0 0 0 .683-.673l2.725-5.596c.312-.664-.166-1.182-.85-.84L8.447 7.764c-.302.136-.508.341-.674.673L5.03 14.043c-.312.645.196 1.152.84.84Zm4.09-3.72A1.19 1.19 0 0 1 8.77 9.97c0-.664.527-1.201 1.19-1.201a1.2 1.2 0 0 1 1.202 1.2c0 .655-.537 1.192-1.201 1.192Z" />
|
|
30
|
+
</g>
|
|
31
|
+
</svg>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function SafariPlusSquareIcon() {
|
|
36
|
+
return (
|
|
37
|
+
<svg
|
|
38
|
+
id="pwa-add"
|
|
39
|
+
width="24"
|
|
40
|
+
height="24"
|
|
41
|
+
viewBox="-4 -4 33 33"
|
|
42
|
+
fill="currentColor"
|
|
43
|
+
className="v-middle"
|
|
44
|
+
>
|
|
45
|
+
<g>
|
|
46
|
+
<path d="m23.40492,1.60784c-1.32504,-1.32504 -3.19052,-1.56912 -5.59644,-1.56912l-10.65243,0c-2.33622,0 -4.2017,0.24408 -5.5267,1.56912c-1.32504,1.34243 -1.56911,3.17306 -1.56911,5.50924l0,10.5827c0,2.40596 0.22665,4.254 1.55165,5.57902c1.34246,1.32501 3.19052,1.5691 5.59647,1.5691l10.60013,0c2.40592,0 4.2714,-0.24408 5.59644,-1.5691c1.325,-1.34245 1.55166,-3.17306 1.55166,-5.57902l0,-10.51293c0,-2.40596 -0.22666,-4.25401 -1.55166,-5.57901zm-0.38355,5.21289l0,11.24518c0,1.51681 -0.20924,2.94643 -1.02865,3.78327c-0.83683,0.83685 -2.30134,1.0635 -3.81815,1.0635l-11.33234,0c-1.51681,0 -2.96386,-0.22665 -3.80073,-1.0635c-0.83683,-0.83684 -1.04607,-2.26646 -1.04607,-3.78327l0,-11.19288c0,-1.5517 0.20924,-3.01617 1.02865,-3.85304c0.83687,-0.83683 2.31876,-1.04607 3.87042,-1.04607l11.28007,0c1.51681,0 2.98132,0.22666 3.81815,1.06353c0.81941,0.81941 1.02865,2.26645 1.02865,3.78327zm-10.53039,12.08205c0.64506,0 1.02861,-0.43586 1.02861,-1.13326l0,-4.34117l4.53294,0c0.66252,0 1.13326,-0.36613 1.13326,-0.99376c0,-0.64506 -0.43586,-1.02861 -1.13326,-1.02861l-4.53294,0l0,-4.53294c0,-0.6974 -0.38355,-1.13326 -1.02861,-1.13326c-0.62763,0 -0.99376,0.45332 -0.99376,1.13326l0,4.53294l-4.51552,0c-0.69737,0 -1.15069,0.38355 -1.15069,1.02861c0,0.62763 0.48817,0.99376 1.15069,0.99376l4.51552,0l0,4.34117c0,0.66252 0.36613,1.13326 0.99376,1.13326z" />
|
|
47
|
+
</g>
|
|
48
|
+
</svg>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function SafariAddToDockIcon() {
|
|
53
|
+
return (
|
|
54
|
+
<svg
|
|
55
|
+
id="pwa-add"
|
|
56
|
+
viewBox="0 0 23.389 17.979"
|
|
57
|
+
width="24"
|
|
58
|
+
height="24"
|
|
59
|
+
className="v-middle"
|
|
60
|
+
>
|
|
61
|
+
<g fill="currentColor">
|
|
62
|
+
<path d="M1.045 3.291v1.377h20.937V3.291Zm2.021 14.688h16.895c2.05 0 3.066-1.006 3.066-3.018V3.027C23.027 1.016 22.012 0 19.961 0H3.066C1.026 0 0 1.016 0 3.027v11.934c0 2.012 1.025 3.018 3.066 3.018Zm.02-1.573c-.977 0-1.514-.517-1.514-1.533V3.115c0-1.015.537-1.543 1.514-1.543H19.94c.967 0 1.514.528 1.514 1.543v11.758c0 1.016-.547 1.533-1.514 1.533Z" />
|
|
63
|
+
<path d="M4.2 14.014c0 .508.35.85.868.85h12.92c.518 0 .87-.343.87-.85v-1.465c0-.508-.352-.85-.87-.85H5.068c-.517 0-.869.342-.869.85Z" />
|
|
64
|
+
</g>
|
|
65
|
+
</svg>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function AndroidAddToHomeIcon() {
|
|
70
|
+
return (
|
|
71
|
+
<svg height="24" viewBox="0 -960 960 960" width="24" className="v-middle">
|
|
72
|
+
<path d="M320-40q-33 0-56.5-23.5T240-120v-160h80v40h400v-480H320v40h-80v-160q0-33 23.5-56.5T320-920h400q33 0 56.5 23.5T800-840v720q0 33-23.5 56.5T720-40H320Zm0-120v40h400v-40H320ZM176-280l-56-56 224-224H200v-80h280v280h-80v-144L176-280Zm144-520h400v-40H320v40Zm0 0v-40 40Zm0 640v40-40Z" />
|
|
73
|
+
</svg>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { Button } from '../button/Button.js';
|
|
3
|
+
import { Icon } from '../icon/Icon.js';
|
|
4
|
+
import { PwaInstallTrigger } from './PwaInstallTrigger.js';
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/PwaInstallTrigger',
|
|
8
|
+
component: PwaInstallTrigger,
|
|
9
|
+
argTypes: {},
|
|
10
|
+
parameters: {
|
|
11
|
+
controls: { expanded: true },
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof PwaInstallTrigger>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof PwaInstallTrigger>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
render(args) {
|
|
21
|
+
return (
|
|
22
|
+
<PwaInstallTrigger {...args} asChild>
|
|
23
|
+
<Button color="primary" emphasis="light">
|
|
24
|
+
<Icon name="star" /> Install
|
|
25
|
+
</Button>
|
|
26
|
+
</PwaInstallTrigger>
|
|
27
|
+
);
|
|
28
|
+
},
|
|
29
|
+
};
|