@multiplatform.one/components 0.2.16 → 0.7.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/LICENSE +201 -0
- package/dist/cjs/forms/FormCheckBox/FormCheckBox.stories.js +30 -1
- package/dist/cjs/forms/FormCheckBox/FormCheckBox.stories.js.map +1 -1
- package/dist/cjs/forms/{RadioSimple/RadioSimple.stories.js → FormProgress/FormProgress.stories.js} +18 -13
- package/dist/cjs/forms/FormProgress/FormProgress.stories.js.map +6 -0
- package/dist/cjs/forms/FormProgress/index.js +104 -0
- package/dist/cjs/forms/FormProgress/index.js.map +6 -0
- package/dist/cjs/forms/FormRadioGroup/FormRadioGroup.stories.js +3 -1
- package/dist/cjs/forms/FormRadioGroup/FormRadioGroup.stories.js.map +1 -1
- package/dist/cjs/forms/FormSlider/FormSlider.stories.js +2 -1
- package/dist/cjs/forms/FormSlider/FormSlider.stories.js.map +1 -1
- package/dist/cjs/forms/FormSwitch/FormSwitch.stories.js +11 -1
- package/dist/cjs/forms/FormSwitch/FormSwitch.stories.js.map +1 -1
- package/dist/cjs/forms/FormTextArea/FormTextArea.stories.js +11 -1
- package/dist/cjs/forms/FormTextArea/FormTextArea.stories.js.map +1 -1
- package/dist/cjs/forms/SimpleForm/SimpleForm.stories.js +16 -1
- package/dist/cjs/forms/SimpleForm/SimpleForm.stories.js.map +1 -1
- package/dist/cjs/hooks/useAssets/index.js +6 -13
- package/dist/cjs/hooks/useAssets/index.js.map +1 -1
- package/dist/cjs/hooks/useAssets/index.native.js +4 -10
- package/dist/cjs/hooks/useAssets/index.native.js.map +1 -1
- package/dist/cjs/images/SimpleImage/index.js +104 -123
- package/dist/cjs/images/SimpleImage/index.js.map +2 -2
- package/dist/cjs/images/SimpleImage/index.stories.js +26 -2
- package/dist/cjs/images/SimpleImage/index.stories.js.map +1 -1
- package/dist/cjs/images/index.js +2 -2
- package/dist/cjs/images/index.js.map +1 -1
- package/dist/cjs/organize/SimpleTabs/SimpleTabs.stories.js +54 -0
- package/dist/cjs/organize/SimpleTabs/SimpleTabs.stories.js.map +6 -0
- package/dist/cjs/organize/SimpleTabs/index.js +132 -0
- package/dist/cjs/organize/SimpleTabs/index.js.map +6 -0
- package/dist/cjs/{forms/RadioSimple/index.js → panels/SimpleToast/SimpleToast.stories.js} +23 -20
- package/dist/cjs/panels/SimpleToast/SimpleToast.stories.js.map +6 -0
- package/dist/cjs/panels/SimpleToast/index.js +59 -0
- package/dist/cjs/panels/SimpleToast/index.js.map +6 -0
- package/dist/esm/forms/FormCheckBox/FormCheckBox.stories.js +31 -2
- package/dist/esm/forms/FormCheckBox/FormCheckBox.stories.js.map +1 -1
- package/dist/esm/forms/FormProgress/FormProgress.stories.js +19 -0
- package/dist/esm/forms/FormProgress/FormProgress.stories.js.map +6 -0
- package/dist/esm/forms/FormProgress/index.js +71 -0
- package/dist/esm/forms/FormProgress/index.js.map +6 -0
- package/dist/esm/forms/FormRadioGroup/FormRadioGroup.stories.js +3 -1
- package/dist/esm/forms/FormRadioGroup/FormRadioGroup.stories.js.map +1 -1
- package/dist/esm/forms/FormSlider/FormSlider.stories.js +2 -1
- package/dist/esm/forms/FormSlider/FormSlider.stories.js.map +1 -1
- package/dist/esm/forms/FormSwitch/FormSwitch.stories.js +11 -1
- package/dist/esm/forms/FormSwitch/FormSwitch.stories.js.map +1 -1
- package/dist/esm/forms/FormTextArea/FormTextArea.stories.js +11 -1
- package/dist/esm/forms/FormTextArea/FormTextArea.stories.js.map +1 -1
- package/dist/esm/forms/SimpleForm/SimpleForm.stories.js +16 -1
- package/dist/esm/forms/SimpleForm/SimpleForm.stories.js.map +1 -1
- package/dist/esm/hooks/useAssets/index.js +6 -13
- package/dist/esm/hooks/useAssets/index.js.map +1 -1
- package/dist/esm/hooks/useAssets/index.native.js +4 -10
- package/dist/esm/hooks/useAssets/index.native.js.map +1 -1
- package/dist/esm/images/SimpleImage/index.js +106 -125
- package/dist/esm/images/SimpleImage/index.js.map +2 -2
- package/dist/esm/images/SimpleImage/index.stories.js +23 -1
- package/dist/esm/images/SimpleImage/index.stories.js.map +1 -1
- package/dist/esm/images/index.js +1 -1
- package/dist/esm/organize/SimpleTabs/SimpleTabs.stories.js +20 -0
- package/dist/esm/organize/SimpleTabs/SimpleTabs.stories.js.map +6 -0
- package/dist/esm/organize/SimpleTabs/index.js +96 -0
- package/dist/esm/organize/SimpleTabs/index.js.map +6 -0
- package/dist/esm/panels/SimpleToast/SimpleToast.stories.js +23 -0
- package/dist/esm/panels/SimpleToast/SimpleToast.stories.js.map +6 -0
- package/dist/esm/panels/SimpleToast/index.js +26 -0
- package/dist/esm/panels/SimpleToast/index.js.map +6 -0
- package/dist/jsx/forms/FormCheckBox/FormCheckBox.stories.js +24 -2
- package/dist/jsx/forms/FormCheckBox/FormCheckBox.stories.js.map +1 -1
- package/dist/jsx/forms/FormCheckBox/FormCheckBox.stories.mjs +24 -2
- package/dist/jsx/forms/FormCheckBox/FormCheckBox.stories.mjs.map +1 -1
- package/dist/jsx/forms/FormProgress/FormProgress.stories.js +18 -0
- package/dist/jsx/forms/FormProgress/FormProgress.stories.js.map +6 -0
- package/dist/jsx/forms/FormProgress/FormProgress.stories.mjs +18 -0
- package/dist/jsx/forms/FormProgress/FormProgress.stories.mjs.map +6 -0
- package/dist/jsx/forms/FormProgress/index.js +57 -0
- package/dist/jsx/forms/FormProgress/index.js.map +6 -0
- package/dist/jsx/forms/FormProgress/index.mjs +57 -0
- package/dist/jsx/forms/FormProgress/index.mjs.map +6 -0
- package/dist/jsx/forms/FormRadioGroup/FormRadioGroup.stories.js +2 -0
- package/dist/jsx/forms/FormRadioGroup/FormRadioGroup.stories.js.map +1 -1
- package/dist/jsx/forms/FormRadioGroup/FormRadioGroup.stories.mjs +2 -0
- package/dist/jsx/forms/FormRadioGroup/FormRadioGroup.stories.mjs.map +1 -1
- package/dist/jsx/forms/FormSlider/FormSlider.stories.js +2 -1
- package/dist/jsx/forms/FormSlider/FormSlider.stories.js.map +1 -1
- package/dist/jsx/forms/FormSlider/FormSlider.stories.mjs +2 -1
- package/dist/jsx/forms/FormSlider/FormSlider.stories.mjs.map +1 -1
- package/dist/jsx/forms/FormSwitch/FormSwitch.stories.js +8 -1
- package/dist/jsx/forms/FormSwitch/FormSwitch.stories.js.map +1 -1
- package/dist/jsx/forms/FormSwitch/FormSwitch.stories.mjs +8 -1
- package/dist/jsx/forms/FormSwitch/FormSwitch.stories.mjs.map +1 -1
- package/dist/jsx/forms/FormTextArea/FormTextArea.stories.js +8 -1
- package/dist/jsx/forms/FormTextArea/FormTextArea.stories.js.map +1 -1
- package/dist/jsx/forms/FormTextArea/FormTextArea.stories.mjs +8 -1
- package/dist/jsx/forms/FormTextArea/FormTextArea.stories.mjs.map +1 -1
- package/dist/jsx/forms/SimpleForm/SimpleForm.stories.js +15 -0
- package/dist/jsx/forms/SimpleForm/SimpleForm.stories.js.map +1 -1
- package/dist/jsx/forms/SimpleForm/SimpleForm.stories.mjs +15 -0
- package/dist/jsx/forms/SimpleForm/SimpleForm.stories.mjs.map +1 -1
- package/dist/jsx/hooks/useAssets/index.js +6 -13
- package/dist/jsx/hooks/useAssets/index.js.map +1 -1
- package/dist/jsx/hooks/useAssets/index.mjs +6 -13
- package/dist/jsx/hooks/useAssets/index.mjs.map +1 -1
- package/dist/jsx/hooks/useAssets/index.native.js +4 -10
- package/dist/jsx/hooks/useAssets/index.native.js.map +1 -1
- package/dist/jsx/hooks/useAssets/index.native.mjs +4 -10
- package/dist/jsx/hooks/useAssets/index.native.mjs.map +1 -1
- package/dist/jsx/images/SimpleImage/index.js +105 -119
- package/dist/jsx/images/SimpleImage/index.js.map +2 -2
- package/dist/jsx/images/SimpleImage/index.mjs +105 -119
- package/dist/jsx/images/SimpleImage/index.mjs.map +2 -2
- package/dist/jsx/images/SimpleImage/index.stories.js +21 -1
- package/dist/jsx/images/SimpleImage/index.stories.js.map +1 -1
- package/dist/jsx/images/SimpleImage/index.stories.mjs +21 -1
- package/dist/jsx/images/SimpleImage/index.stories.mjs.map +1 -1
- package/dist/jsx/images/index.js +1 -1
- package/dist/jsx/images/index.mjs +1 -1
- package/dist/jsx/organize/SimpleTabs/SimpleTabs.stories.js +41 -0
- package/dist/jsx/organize/SimpleTabs/SimpleTabs.stories.js.map +6 -0
- package/dist/jsx/organize/SimpleTabs/SimpleTabs.stories.mjs +41 -0
- package/dist/jsx/organize/SimpleTabs/SimpleTabs.stories.mjs.map +6 -0
- package/dist/jsx/organize/SimpleTabs/index.js +80 -0
- package/dist/jsx/organize/SimpleTabs/index.js.map +6 -0
- package/dist/jsx/organize/SimpleTabs/index.mjs +80 -0
- package/dist/jsx/organize/SimpleTabs/index.mjs.map +6 -0
- package/dist/jsx/panels/SimpleToast/SimpleToast.stories.js +25 -0
- package/dist/jsx/panels/SimpleToast/SimpleToast.stories.js.map +6 -0
- package/dist/jsx/panels/SimpleToast/SimpleToast.stories.mjs +25 -0
- package/dist/jsx/panels/SimpleToast/SimpleToast.stories.mjs.map +6 -0
- package/dist/jsx/panels/SimpleToast/index.js +24 -0
- package/dist/jsx/panels/SimpleToast/index.js.map +6 -0
- package/dist/jsx/panels/SimpleToast/index.mjs +24 -0
- package/dist/jsx/panels/SimpleToast/index.mjs.map +6 -0
- package/package.json +15 -13
- package/src/forms/FormCheckBox/FormCheckBox.stories.tsx +24 -4
- package/src/forms/FormProgress/FormProgress.stories.tsx +16 -0
- package/src/forms/FormProgress/index.tsx +74 -0
- package/src/forms/FormRadioGroup/FormRadioGroup.stories.tsx +2 -0
- package/src/forms/FormSlider/FormSlider.stories.tsx +2 -1
- package/src/forms/FormSwitch/FormSwitch.stories.tsx +8 -1
- package/src/forms/FormTextArea/FormTextArea.stories.tsx +8 -1
- package/src/forms/SimpleForm/SimpleForm.stories.tsx +15 -0
- package/src/hooks/useAssets/index.native.ts +8 -14
- package/src/hooks/useAssets/index.ts +8 -28
- package/src/images/SimpleImage/index.stories.tsx +26 -0
- package/src/images/SimpleImage/index.tsx +137 -150
- package/src/images/index.ts +1 -1
- package/src/organize/SimpleTabs/SimpleTabs.stories.tsx +63 -0
- package/src/organize/SimpleTabs/index.tsx +118 -0
- package/src/panels/SimpleToast/SimpleToast.stories.tsx +27 -0
- package/src/panels/SimpleToast/index.tsx +27 -0
- package/types/code/Code/index.d.ts +49 -15
- package/types/code/Code/index.d.ts.map +1 -1
- package/types/code/Pre/index.d.ts +16 -7
- package/types/code/Pre/index.d.ts.map +1 -1
- package/types/forms/FormCheckBox/FormCheckBox.stories.d.ts.map +1 -1
- package/types/forms/FormProgress/FormProgress.stories.d.ts +15 -0
- package/types/forms/FormProgress/FormProgress.stories.d.ts.map +1 -0
- package/types/forms/FormProgress/index.d.ts +11 -0
- package/types/forms/FormProgress/index.d.ts.map +1 -0
- package/types/forms/FormRadioGroup/FormRadioGroup.stories.d.ts.map +1 -1
- package/types/forms/FormSlider/FormSlider.stories.d.ts.map +1 -1
- package/types/forms/FormSwitch/FormSwitch.stories.d.ts.map +1 -1
- package/types/forms/FormTextArea/FormTextArea.stories.d.ts.map +1 -1
- package/types/forms/SimpleForm/SimpleForm.stories.d.ts.map +1 -1
- package/types/hooks/useAssets/index.d.ts +2 -3
- package/types/hooks/useAssets/index.d.ts.map +1 -1
- package/types/hooks/useAssets/index.native.d.ts +2 -2
- package/types/hooks/useAssets/index.native.d.ts.map +1 -1
- package/types/images/SimpleImage/index.d.ts +15 -22
- package/types/images/SimpleImage/index.d.ts.map +1 -1
- package/types/images/SimpleImage/index.stories.d.ts +8 -2
- package/types/images/SimpleImage/index.stories.d.ts.map +1 -1
- package/types/images/SvgUri/index.native.d.ts +5 -5
- package/types/images/index.d.ts +1 -1
- package/types/images/index.d.ts.map +1 -1
- package/types/mdx/LI/LI.stories.d.ts +29 -12
- package/types/mdx/LI/LI.stories.d.ts.map +1 -1
- package/types/mdx/LI/index.d.ts +29 -12
- package/types/mdx/LI/index.d.ts.map +1 -1
- package/types/mdx/UL/UL.stories.d.ts +16 -7
- package/types/mdx/UL/UL.stories.d.ts.map +1 -1
- package/types/mdx/UL/index.d.ts +16 -7
- package/types/mdx/UL/index.d.ts.map +1 -1
- package/types/mdx/components.d.ts +16 -7
- package/types/mdx/components.d.ts.map +1 -1
- package/types/organize/SimpleTabs/SimpleTabs.stories.d.ts +15 -0
- package/types/organize/SimpleTabs/SimpleTabs.stories.d.ts.map +1 -0
- package/types/organize/SimpleTabs/index.d.ts +21 -0
- package/types/organize/SimpleTabs/index.d.ts.map +1 -0
- package/types/{forms/RadioSimple/RadioSimple.stories.d.ts → panels/SimpleToast/SimpleToast.stories.d.ts} +4 -4
- package/types/panels/SimpleToast/SimpleToast.stories.d.ts.map +1 -0
- package/types/panels/SimpleToast/index.d.ts +3 -0
- package/types/panels/SimpleToast/index.d.ts.map +1 -0
- package/types/table/Table/Table.stories.d.ts +51 -10
- package/types/table/Table/Table.stories.d.ts.map +1 -1
- package/types/table/Table/index.d.ts +51 -10
- package/types/table/Table/index.d.ts.map +1 -1
- package/types/table/TableCell/index.d.ts +20 -3
- package/types/table/TableCell/index.d.ts.map +1 -1
- package/types/table/TableCol/index.d.ts +31 -7
- package/types/table/TableCol/index.d.ts.map +1 -1
- package/dist/cjs/forms/RadioSimple/RadioSimple.stories.js.map +0 -6
- package/dist/cjs/forms/RadioSimple/index.js.map +0 -6
- package/dist/cjs/hooks/useAssets/types.js +0 -16
- package/dist/cjs/hooks/useAssets/types.js.map +0 -6
- package/dist/esm/forms/RadioSimple/RadioSimple.stories.js +0 -15
- package/dist/esm/forms/RadioSimple/RadioSimple.stories.js.map +0 -6
- package/dist/esm/forms/RadioSimple/index.js +0 -20
- package/dist/esm/forms/RadioSimple/index.js.map +0 -6
- package/dist/esm/hooks/useAssets/types.js +0 -1
- package/dist/esm/hooks/useAssets/types.js.map +0 -6
- package/dist/jsx/forms/RadioSimple/RadioSimple.stories.js +0 -14
- package/dist/jsx/forms/RadioSimple/RadioSimple.stories.js.map +0 -6
- package/dist/jsx/forms/RadioSimple/RadioSimple.stories.mjs +0 -14
- package/dist/jsx/forms/RadioSimple/RadioSimple.stories.mjs.map +0 -6
- package/dist/jsx/forms/RadioSimple/index.js +0 -26
- package/dist/jsx/forms/RadioSimple/index.js.map +0 -6
- package/dist/jsx/forms/RadioSimple/index.mjs +0 -26
- package/dist/jsx/forms/RadioSimple/index.mjs.map +0 -6
- package/dist/jsx/hooks/useAssets/types.js +0 -1
- package/dist/jsx/hooks/useAssets/types.js.map +0 -6
- package/dist/jsx/hooks/useAssets/types.mjs +0 -1
- package/dist/jsx/hooks/useAssets/types.mjs.map +0 -6
- package/src/forms/RadioSimple/RadioSimple.stories.tsx +0 -12
- package/src/forms/RadioSimple/index.tsx +0 -42
- package/src/hooks/useAssets/types.ts +0 -3
- package/types/forms/RadioSimple/RadioSimple.stories.d.ts.map +0 -1
- package/types/forms/RadioSimple/index.d.ts +0 -8
- package/types/forms/RadioSimple/index.d.ts.map +0 -1
- package/types/hooks/useAssets/types.d.ts +0 -3
- package/types/hooks/useAssets/types.d.ts.map +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SimpleTabs, TabContent, TabsList, Tab } from "./index";
|
|
2
|
+
import { H5, SizableText } from "tamagui";
|
|
3
|
+
var SimpleTabs_stories_default = {
|
|
4
|
+
title: "organize/SimpleTabs",
|
|
5
|
+
component: SimpleTabs,
|
|
6
|
+
parameters: {
|
|
7
|
+
status: {
|
|
8
|
+
type: "beta"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const horizontalTabs = () => <SimpleTabs defaultRoute="contact" fullScreen>
|
|
13
|
+
<TabsList>
|
|
14
|
+
<Tab path="home">Home</Tab>
|
|
15
|
+
<Tab path="about">About</Tab>
|
|
16
|
+
<Tab path="contact">Contact</Tab>
|
|
17
|
+
<Tab path="description"><SizableText textAlign="center">Description</SizableText></Tab>
|
|
18
|
+
</TabsList>
|
|
19
|
+
<TabContent route="home"><H5>Home</H5></TabContent>
|
|
20
|
+
<TabContent route="about"><H5>About</H5></TabContent>
|
|
21
|
+
<TabContent route="contact"><H5>Contact</H5></TabContent>
|
|
22
|
+
<TabContent route="description" jc="center" ai="center"><H5>Default</H5></TabContent>
|
|
23
|
+
</SimpleTabs>;
|
|
24
|
+
const verticalTabs = () => <SimpleTabs defaultRoute="about" orientation="vertical" width="100%" height="100%">
|
|
25
|
+
<TabsList fullHeight={false}>
|
|
26
|
+
<Tab path="home">Home</Tab>
|
|
27
|
+
<Tab path="about">About</Tab>
|
|
28
|
+
<Tab path="contact">Contact</Tab>
|
|
29
|
+
<Tab path="description"><SizableText textAlign="center">Description</SizableText></Tab>
|
|
30
|
+
</TabsList>
|
|
31
|
+
<TabContent route="home"><H5>Home</H5></TabContent>
|
|
32
|
+
<TabContent route="about"><H5>About</H5></TabContent>
|
|
33
|
+
<TabContent route="contact"><H5>Contact</H5></TabContent>
|
|
34
|
+
<TabContent route="description" jc="center" ai="center"><H5>Default</H5></TabContent>
|
|
35
|
+
</SimpleTabs>;
|
|
36
|
+
export {
|
|
37
|
+
SimpleTabs_stories_default as default,
|
|
38
|
+
horizontalTabs,
|
|
39
|
+
verticalTabs
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=SimpleTabs.stories.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/organize/SimpleTabs/SimpleTabs.stories.tsx"],
|
|
4
|
+
"mappings": "AACA,SAAS,YAAY,YAAY,UAAU,WAAW;AACtD,SAAS,IAAI,mBAAmB;AAEhC,IAAO,6BAAQ;AAAA,EACb,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,IACV,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEO,MAAM,iBAAiB,MAC5B,CAAC,WAAW,aAAa,UAAU;AAAA,EACjC,CAAC;AAAA,IACC,CAAC,IAAI,KAAK,OAAO,IAAI,EAApB;AAAA,IACD,CAAC,IA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41 @@
|
|
|
1
|
+
import { SimpleTabs, TabContent, TabsList, Tab } from "./index";
|
|
2
|
+
import { H5, SizableText } from "tamagui";
|
|
3
|
+
var SimpleTabs_stories_default = {
|
|
4
|
+
title: "organize/SimpleTabs",
|
|
5
|
+
component: SimpleTabs,
|
|
6
|
+
parameters: {
|
|
7
|
+
status: {
|
|
8
|
+
type: "beta"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
const horizontalTabs = () => <SimpleTabs defaultRoute="contact" fullScreen>
|
|
13
|
+
<TabsList>
|
|
14
|
+
<Tab path="home">Home</Tab>
|
|
15
|
+
<Tab path="about">About</Tab>
|
|
16
|
+
<Tab path="contact">Contact</Tab>
|
|
17
|
+
<Tab path="description"><SizableText textAlign="center">Description</SizableText></Tab>
|
|
18
|
+
</TabsList>
|
|
19
|
+
<TabContent route="home"><H5>Home</H5></TabContent>
|
|
20
|
+
<TabContent route="about"><H5>About</H5></TabContent>
|
|
21
|
+
<TabContent route="contact"><H5>Contact</H5></TabContent>
|
|
22
|
+
<TabContent route="description" jc="center" ai="center"><H5>Default</H5></TabContent>
|
|
23
|
+
</SimpleTabs>;
|
|
24
|
+
const verticalTabs = () => <SimpleTabs defaultRoute="about" orientation="vertical" width="100%" height="100%">
|
|
25
|
+
<TabsList fullHeight={false}>
|
|
26
|
+
<Tab path="home">Home</Tab>
|
|
27
|
+
<Tab path="about">About</Tab>
|
|
28
|
+
<Tab path="contact">Contact</Tab>
|
|
29
|
+
<Tab path="description"><SizableText textAlign="center">Description</SizableText></Tab>
|
|
30
|
+
</TabsList>
|
|
31
|
+
<TabContent route="home"><H5>Home</H5></TabContent>
|
|
32
|
+
<TabContent route="about"><H5>About</H5></TabContent>
|
|
33
|
+
<TabContent route="contact"><H5>Contact</H5></TabContent>
|
|
34
|
+
<TabContent route="description" jc="center" ai="center"><H5>Default</H5></TabContent>
|
|
35
|
+
</SimpleTabs>;
|
|
36
|
+
export {
|
|
37
|
+
SimpleTabs_stories_default as default,
|
|
38
|
+
horizontalTabs,
|
|
39
|
+
verticalTabs
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=SimpleTabs.stories.mjs.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/organize/SimpleTabs/SimpleTabs.stories.tsx"],
|
|
4
|
+
"mappings": "AACA,SAAS,YAAY,YAAY,UAAU,WAAW;AACtD,SAAS,IAAI,mBAAmB;AAEhC,IAAO,6BAAQ;AAAA,EACb,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,IACV,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEO,MAAM,iBAAiB,MAC5B,CAAC,WAAW,aAAa,UAAU;AAAA,EACjC,CAAC;AAAA,IACC,CAAC,IAAI,KAAK,OAAO,IAAI,EAApB;AAAA,IACD,CAAC,IAAI,KAAK,QAAQ,KAAK,EAAtB;AAAA,IACD,CAAC,IAAI,KAAK,UAAU,OAAO,EAA1B;AAAA,IACD,CAAC,IAAI,KAAK,cACR,CAAC,YAAY,UAAU,SAAS,WAAW,EAA1C,YACH,EAFC;AAAA,EAGH,EAPC;AAAA,EAQD,CAAC,WAAW,MAAM,OAChB,CAAC,GAAG,IAAI,EAAP,GACH,EAFC;AAAA,EAGD,CAAC,WAAW,MAAM,QAChB,CAAC,GAAG,KAAK,EAAR,GACH,EAFC;AAAA,EAGD,CAAC,WAAW,MAAM,UAChB,CAAC,GAAG,OAAO,EAAV,GACH,EAFC;AAAA,EAGD,CAAC,WAAW,MAAM,cAAc,GAAG,SAAS,GAAG,SAC7C,CAAC,GAAG,OAAO,EAAV,GACH,EAFC;AAGH,EArBC;AAwBI,MAAM,eAAe,MAC1B,CAAC,WAAW,aAAa,QAAQ,YAAY,WAAW,MAAM,OAAO,OAAO;AAAA,EAC1E,CAAC,SAAS,YAAY;AAAA,IACpB,CAAC,IAAI,KAAK,OAAO,IAAI,EAApB;AAAA,IACD,CAAC,IAAI,KAAK,QAAQ,KAAK,EAAtB;AAAA,IACD,CAAC,IAAI,KAAK,UAAU,OAAO,EAA1B;AAAA,IACD,CAAC,IAAI,KAAK,cACR,CAAC,YAAY,UAAU,SAAS,WAAW,EAA1C,YACH,EAFC;AAAA,EAGH,EAPC;AAAA,EAQD,CAAC,WAAW,MAAM,OAChB,CAAC,GAAG,IAAI,EAAP,GACH,EAFC;AAAA,EAGD,CAAC,WAAW,MAAM,QAChB,CAAC,GAAG,KAAK,EAAR,GACH,EAFC;AAAA,EAGD,CAAC,WAAW,MAAM,UAChB,CAAC,GAAG,OAAO,EAAV,GACH,EAFC;AAAA,EAGD,CAAC,WAAW,MAAM,cAAc,GAAG,SAAS,GAAG,SAC7C,CAAC,GAAG,OAAO,EAAV,GACH,EAFC;AAGH,EArBC;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { SizableText } from "tamagui";
|
|
3
|
+
import { Separator } from "tamagui";
|
|
4
|
+
import { Tabs } from "tamagui";
|
|
5
|
+
const SimpleTabsContext = React.createContext(null);
|
|
6
|
+
const TabsListContext = React.createContext(null);
|
|
7
|
+
function SimpleTabs({
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
fullScreen,
|
|
11
|
+
defaultRoute,
|
|
12
|
+
orientation = "horizontal",
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const contextValue = useMemo(() => ({ orientation, width }), [orientation, width]);
|
|
16
|
+
return <SimpleTabsContext.Provider value={contextValue}><Tabs
|
|
17
|
+
borderRadius="$4"
|
|
18
|
+
borderWidth="$0.25"
|
|
19
|
+
overflow="hidden"
|
|
20
|
+
borderColor="$borderColor"
|
|
21
|
+
flexDirection={orientation === "vertical" ? "row" : "column"}
|
|
22
|
+
defaultValue={defaultRoute}
|
|
23
|
+
{...props}
|
|
24
|
+
width={fullScreen ? "100%" : width ?? 300}
|
|
25
|
+
height={fullScreen ? "100%" : height ?? 150}
|
|
26
|
+
>{props.children}</Tabs></SimpleTabsContext.Provider>;
|
|
27
|
+
}
|
|
28
|
+
function TabsList({ fullHeight = false, ...props }) {
|
|
29
|
+
const context = React.useContext(SimpleTabsContext);
|
|
30
|
+
if (!context)
|
|
31
|
+
throw new Error("TabsList must be used inside SimpleTabs");
|
|
32
|
+
const { orientation } = context;
|
|
33
|
+
const contextValue = useMemo(() => ({ fullHeight }), [fullHeight]);
|
|
34
|
+
return <TabsListContext.Provider value={contextValue}><Tabs.List
|
|
35
|
+
separator={<Separator vertical={orientation === "horizontal"} />}
|
|
36
|
+
disablePassBorderRadius={orientation === "horizontal" ? "bottom" : "end"}
|
|
37
|
+
aria-label="Manage your account"
|
|
38
|
+
flex={0}
|
|
39
|
+
style={orientation === "vertical" ? { display: "flex", flexDirection: "column" } : {}}
|
|
40
|
+
{...props}
|
|
41
|
+
>{props.children}</Tabs.List></TabsListContext.Provider>;
|
|
42
|
+
}
|
|
43
|
+
function TabContent({ route, ...props }) {
|
|
44
|
+
return <Tabs.Content
|
|
45
|
+
backgroundColor="$background"
|
|
46
|
+
key={route}
|
|
47
|
+
padding="$2"
|
|
48
|
+
flex={1}
|
|
49
|
+
borderColor="$background"
|
|
50
|
+
borderRadius="$2"
|
|
51
|
+
borderTopLeftRadius={0}
|
|
52
|
+
borderTopRightRadius={0}
|
|
53
|
+
borderWidth="$2"
|
|
54
|
+
value={route}
|
|
55
|
+
{...props}
|
|
56
|
+
>{props.children}</Tabs.Content>;
|
|
57
|
+
}
|
|
58
|
+
function Tab({ path, ...props }) {
|
|
59
|
+
const context = React.useContext(SimpleTabsContext);
|
|
60
|
+
const listContext = React.useContext(TabsListContext);
|
|
61
|
+
if (!context)
|
|
62
|
+
throw new Error("Tab must be used inside TabList");
|
|
63
|
+
const { orientation } = context;
|
|
64
|
+
if (!listContext)
|
|
65
|
+
throw new Error("Tab must be used inside TabList");
|
|
66
|
+
const { fullHeight } = listContext;
|
|
67
|
+
return <Tabs.Tab
|
|
68
|
+
key={path}
|
|
69
|
+
f={orientation === "horizontal" || orientation === "vertical" && fullHeight ? 1 : 0}
|
|
70
|
+
value={path}
|
|
71
|
+
{...props}
|
|
72
|
+
>{typeof props.children === "string" ? <SizableText>{props.children}</SizableText> : props.children}</Tabs.Tab>;
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
SimpleTabs,
|
|
76
|
+
Tab,
|
|
77
|
+
TabContent,
|
|
78
|
+
TabsList
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/organize/SimpleTabs/index.tsx"],
|
|
4
|
+
"mappings": "AACA,OAAO,SAAS,eAAe;AAE/B,SAAS,mBAAmB;AAC5B,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AAmBrB,MAAM,oBAAoB,MAAM,cAA6C,IAAI;AAEjF,MAAM,kBAAkB,MAAM,cAA0C,IAAI;AAErE,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,GAAG;AACL,GAAoB;AAClB,QAAM,eAAe,QAAQ,OAAO,EAAE,aAAa,MAAM,IAAI,CAAC,aAAa,KAAK,CAAC;AAEjF,SACE,CAAC,kBAAkB,SAAS,OAAO,cACjC,CAAC;AAAA,IACC,aAAa;AAAA,IACb,YAAY;AAAA,IACZ,SAAS;AAAA,IACT,YAAY;AAAA,IACZ,eAAe,gBAAgB,aAAa,QAAQ;AAAA,IACpD,cAAc;AAAA,QACV;AAAA,IACJ,OAAO,aAAa,SAAS,SAAS;AAAA,IACtC,QAAQ,aAAa,SAAS,UAAU;AAAA,IAEvC,MAAM,SACT,EAZC,KAaH,EAdC,kBAAkB;AAgBvB;AAEO,SAAS,SAAS,EAAE,aA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aAAc,IAAI;AAAA,IACpF,OAAO;AAAA,QACH;AAAA,IAEH,OAAO,MAAM,aAAa,WAAW,CAAC,aAAa,MAAM,SAAS,EAA5B,eAA6C,MAAM,SAC5F,EAPC,KAAK;AASV;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { SizableText } from "tamagui";
|
|
3
|
+
import { Separator } from "tamagui";
|
|
4
|
+
import { Tabs } from "tamagui";
|
|
5
|
+
const SimpleTabsContext = React.createContext(null);
|
|
6
|
+
const TabsListContext = React.createContext(null);
|
|
7
|
+
function SimpleTabs({
|
|
8
|
+
width,
|
|
9
|
+
height,
|
|
10
|
+
fullScreen,
|
|
11
|
+
defaultRoute,
|
|
12
|
+
orientation = "horizontal",
|
|
13
|
+
...props
|
|
14
|
+
}) {
|
|
15
|
+
const contextValue = useMemo(() => ({ orientation, width }), [orientation, width]);
|
|
16
|
+
return <SimpleTabsContext.Provider value={contextValue}><Tabs
|
|
17
|
+
borderRadius="$4"
|
|
18
|
+
borderWidth="$0.25"
|
|
19
|
+
overflow="hidden"
|
|
20
|
+
borderColor="$borderColor"
|
|
21
|
+
flexDirection={orientation === "vertical" ? "row" : "column"}
|
|
22
|
+
defaultValue={defaultRoute}
|
|
23
|
+
{...props}
|
|
24
|
+
width={fullScreen ? "100%" : width ?? 300}
|
|
25
|
+
height={fullScreen ? "100%" : height ?? 150}
|
|
26
|
+
>{props.children}</Tabs></SimpleTabsContext.Provider>;
|
|
27
|
+
}
|
|
28
|
+
function TabsList({ fullHeight = false, ...props }) {
|
|
29
|
+
const context = React.useContext(SimpleTabsContext);
|
|
30
|
+
if (!context)
|
|
31
|
+
throw new Error("TabsList must be used inside SimpleTabs");
|
|
32
|
+
const { orientation } = context;
|
|
33
|
+
const contextValue = useMemo(() => ({ fullHeight }), [fullHeight]);
|
|
34
|
+
return <TabsListContext.Provider value={contextValue}><Tabs.List
|
|
35
|
+
separator={<Separator vertical={orientation === "horizontal"} />}
|
|
36
|
+
disablePassBorderRadius={orientation === "horizontal" ? "bottom" : "end"}
|
|
37
|
+
aria-label="Manage your account"
|
|
38
|
+
flex={0}
|
|
39
|
+
style={orientation === "vertical" ? { display: "flex", flexDirection: "column" } : {}}
|
|
40
|
+
{...props}
|
|
41
|
+
>{props.children}</Tabs.List></TabsListContext.Provider>;
|
|
42
|
+
}
|
|
43
|
+
function TabContent({ route, ...props }) {
|
|
44
|
+
return <Tabs.Content
|
|
45
|
+
backgroundColor="$background"
|
|
46
|
+
key={route}
|
|
47
|
+
padding="$2"
|
|
48
|
+
flex={1}
|
|
49
|
+
borderColor="$background"
|
|
50
|
+
borderRadius="$2"
|
|
51
|
+
borderTopLeftRadius={0}
|
|
52
|
+
borderTopRightRadius={0}
|
|
53
|
+
borderWidth="$2"
|
|
54
|
+
value={route}
|
|
55
|
+
{...props}
|
|
56
|
+
>{props.children}</Tabs.Content>;
|
|
57
|
+
}
|
|
58
|
+
function Tab({ path, ...props }) {
|
|
59
|
+
const context = React.useContext(SimpleTabsContext);
|
|
60
|
+
const listContext = React.useContext(TabsListContext);
|
|
61
|
+
if (!context)
|
|
62
|
+
throw new Error("Tab must be used inside TabList");
|
|
63
|
+
const { orientation } = context;
|
|
64
|
+
if (!listContext)
|
|
65
|
+
throw new Error("Tab must be used inside TabList");
|
|
66
|
+
const { fullHeight } = listContext;
|
|
67
|
+
return <Tabs.Tab
|
|
68
|
+
key={path}
|
|
69
|
+
f={orientation === "horizontal" || orientation === "vertical" && fullHeight ? 1 : 0}
|
|
70
|
+
value={path}
|
|
71
|
+
{...props}
|
|
72
|
+
>{typeof props.children === "string" ? <SizableText>{props.children}</SizableText> : props.children}</Tabs.Tab>;
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
SimpleTabs,
|
|
76
|
+
Tab,
|
|
77
|
+
TabContent,
|
|
78
|
+
TabsList
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingUR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,IACX,MAAM;AAAA,IACN,OAAO,gBAAgB,aAAa,EAAE,SAAS,QAAQ,eAAe,SAAS,IAAI,CAAC;AAAA,QAChF;AAAA,IAEH,MAAM,SACT,EATC,KAAK,KAUR,EAXC,gBAAgB;AAarB;AAEO,SAAS,WAAW,EAAE,OAAO,GAAG,MAAM,GAAiB;AAC5D,SACE,CAAC,KAAK;AAAA,IACJ,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,YAAY;AAAA,IACZ,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,sBAAsB;AAAA,IACtB,YAAY;AAAA,IACZ,OAAO;AAAA,QACH;AAAA,IAEH,MAAM,SACT,EAdC,KAAK;AAgBV;AAEO,SAAS,IAAI,EAAE,MAAM,GAAG,MAAM,GAAa;AAChD,QAAM,UAAU,MAAM,WAAW,iBAAiB;AAClD,QAAM,cAAc,MAAM,WAAW,eAAe;AACpD,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,iCAAiC;AAC/D,QAAM,EAAE,YAAY,IAAI;AACxB,MAAI,CAAC;AAAa,UAAM,IAAI,MAAM,iCAAiC;AACnE,QAAM,EAAE,WAAW,IAAI;AAEvB,SACE,CAAC,KAAK;AAAA,IACJ,KAAK;AAAA,IACL,GAAG,gBAAgB,gBAAiB,gBAAgB,cAAc,aAAc,IAAI;AAAA,IACpF,OAAO;AAAA,QACH;AAAA,IAEH,OAAO,MAAM,aAAa,WAAW,CAAC,aAAa,MAAM,SAAS,EAA5B,eAA6C,MAAM,SAC5F,EAPC,KAAK;AASV;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SimpleToast } from "./index";
|
|
2
|
+
import { useToastController } from "@tamagui/toast";
|
|
3
|
+
import { YStack, Button } from "tamagui";
|
|
4
|
+
var SimpleToast_stories_default = {
|
|
5
|
+
title: "panels/SimpleToast",
|
|
6
|
+
component: SimpleToast,
|
|
7
|
+
parameters: {
|
|
8
|
+
status: {
|
|
9
|
+
type: "code"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const Main = () => {
|
|
14
|
+
const toastState = useToastController();
|
|
15
|
+
return <YStack>
|
|
16
|
+
<SimpleToast />
|
|
17
|
+
<Button onPress={() => toastState.show(JSON.stringify({ title: "Hello", message: "World" }))}>Add Toast</Button>
|
|
18
|
+
</YStack>;
|
|
19
|
+
};
|
|
20
|
+
const Default = () => <Main />;
|
|
21
|
+
export {
|
|
22
|
+
Default,
|
|
23
|
+
SimpleToast_stories_default as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=SimpleToast.stories.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/panels/SimpleToast/SimpleToast.stories.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,0BAA0B;AACnC,SAAS,QAAQ,cAAc;AAE/B,IAAO,8BAAQ;AAAA,EACb,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,IACV,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,MAAM,OAAO,MAAM;AACjB,QAAM,aAAa,mBAAmB;AAEtC,SACE,CAAC;AAAA,IACC,CAAC,YAAY;AAAA,IACb,CAAC,OAAO,SAAS,MAAM,WAAW,KAAK,KAAK,UAAU,EAAE,OAAO,SAAS,SAAS,QAAQ,CAAC,CAAC,GAAG,SAAS,EAAtG;AAAA,EACH,EAHC;AAKL;AAEO,MAAM,UAAU,MAAM,CAAC,KAAK;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SimpleToast } from "./index";
|
|
2
|
+
import { useToastController } from "@tamagui/toast";
|
|
3
|
+
import { YStack, Button } from "tamagui";
|
|
4
|
+
var SimpleToast_stories_default = {
|
|
5
|
+
title: "panels/SimpleToast",
|
|
6
|
+
component: SimpleToast,
|
|
7
|
+
parameters: {
|
|
8
|
+
status: {
|
|
9
|
+
type: "code"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
const Main = () => {
|
|
14
|
+
const toastState = useToastController();
|
|
15
|
+
return <YStack>
|
|
16
|
+
<SimpleToast />
|
|
17
|
+
<Button onPress={() => toastState.show(JSON.stringify({ title: "Hello", message: "World" }))}>Add Toast</Button>
|
|
18
|
+
</YStack>;
|
|
19
|
+
};
|
|
20
|
+
const Default = () => <Main />;
|
|
21
|
+
export {
|
|
22
|
+
Default,
|
|
23
|
+
SimpleToast_stories_default as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=SimpleToast.stories.mjs.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/panels/SimpleToast/SimpleToast.stories.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,0BAA0B;AACnC,SAAS,QAAQ,cAAc;AAE/B,IAAO,8BAAQ;AAAA,EACb,OAAO;AAAA,EACP,WAAW;AAAA,EACX,YAAY;AAAA,IACV,QAAQ;AAAA,MACN,MAAM;AAAA,IACR;AAAA,EACF;AACF;AAEA,MAAM,OAAO,MAAM;AACjB,QAAM,aAAa,mBAAmB;AAEtC,SACE,CAAC;AAAA,IACC,CAAC,YAAY;AAAA,IACb,CAAC,OAAO,SAAS,MAAM,WAAW,KAAK,KAAK,UAAU,EAAE,OAAO,SAAS,SAAS,QAAQ,CAAC,CAAC,GAAG,SAAS,EAAtG;AAAA,EACH,EAHC;AAKL;AAEO,MAAM,UAAU,MAAM,CAAC,KAAK;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { YStack } from "tamagui";
|
|
2
|
+
import { Toast, useToastState } from "@tamagui/toast";
|
|
3
|
+
function SimpleToast() {
|
|
4
|
+
const currentToast = useToastState();
|
|
5
|
+
if (!currentToast || currentToast.isHandledNatively)
|
|
6
|
+
return null;
|
|
7
|
+
return <Toast
|
|
8
|
+
key={currentToast.id}
|
|
9
|
+
duration={currentToast.duration}
|
|
10
|
+
enterStyle={{ opacity: 0, scale: 0.5, y: -25 }}
|
|
11
|
+
exitStyle={{ opacity: 0, scale: 1, y: -20 }}
|
|
12
|
+
y={0}
|
|
13
|
+
opacity={1}
|
|
14
|
+
scale={1}
|
|
15
|
+
viewportName={currentToast.viewportName}
|
|
16
|
+
><YStack>
|
|
17
|
+
<Toast.Title>{currentToast.title}</Toast.Title>
|
|
18
|
+
{!!currentToast.message && <Toast.Description>{currentToast.message}</Toast.Description>}
|
|
19
|
+
</YStack></Toast>;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
SimpleToast
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/panels/SimpleToast/index.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,OAAO,qBAAqB;AAG9B,SAAS,cAAc;AAC5B,QAAM,eAAe,cAAc;AAEnC,MAAI,CAAC,gBAAgB,aAAa;AAAmB,WAAO;AAC5D,SACE,CAAC;AAAA,IACC,KAAK,aAAa;AAAA,IAClB,UAAU,aAAa;AAAA,IACvB,YAAY,EAAE,SAAS,GAAG,OAAO,KAAK,GAAG,IAAI;AAAA,IAC7C,WAAW,EAAE,SAAS,GAAG,OAAO,GAAG,GAAG,IAAI;AAAA,IAC1C,GAAG;AAAA,IACH,SAAS;AAAA,IACT,OAAO;AAAA,IAEP,cAAc,aAAa;AAAA,GAE3B,CAAC;AAAA,IACC,CAAC,MAAM,OAAO,aAAa,MAAM,EAAhC,MAAM;AAAA,KACN,CAAC,CAAC,aAAa,WAAW,CAAC,MAAM,aAAa,aAAa,QAAQ,EAAxC,MAAM;AAAA,EACpC,EAHC,OAIH,EAfC;AAiBL;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { YStack } from "tamagui";
|
|
2
|
+
import { Toast, useToastState } from "@tamagui/toast";
|
|
3
|
+
function SimpleToast() {
|
|
4
|
+
const currentToast = useToastState();
|
|
5
|
+
if (!currentToast || currentToast.isHandledNatively)
|
|
6
|
+
return null;
|
|
7
|
+
return <Toast
|
|
8
|
+
key={currentToast.id}
|
|
9
|
+
duration={currentToast.duration}
|
|
10
|
+
enterStyle={{ opacity: 0, scale: 0.5, y: -25 }}
|
|
11
|
+
exitStyle={{ opacity: 0, scale: 1, y: -20 }}
|
|
12
|
+
y={0}
|
|
13
|
+
opacity={1}
|
|
14
|
+
scale={1}
|
|
15
|
+
viewportName={currentToast.viewportName}
|
|
16
|
+
><YStack>
|
|
17
|
+
<Toast.Title>{currentToast.title}</Toast.Title>
|
|
18
|
+
{!!currentToast.message && <Toast.Description>{currentToast.message}</Toast.Description>}
|
|
19
|
+
</YStack></Toast>;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
SimpleToast
|
|
23
|
+
};
|
|
24
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/panels/SimpleToast/index.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,cAAc;AACvB,SAAS,OAAO,qBAAqB;AAG9B,SAAS,cAAc;AAC5B,QAAM,eAAe,cAAc;AAEnC,MAAI,CAAC,gBAAgB,aAAa;AAAmB,WAAO;AAC5D,SACE,CAAC;AAAA,IACC,KAAK,aAAa;AAAA,IAClB,UAAU,aAAa;AAAA,IACvB,YAAY,EAAE,SAAS,GAAG,OAAO,KAAK,GAAG,IAAI;AAAA,IAC7C,WAAW,EAAE,SAAS,GAAG,OAAO,GAAG,GAAG,IAAI;AAAA,IAC1C,GAAG;AAAA,IACH,SAAS;AAAA,IACT,OAAO;AAAA,IAEP,cAAc,aAAa;AAAA,GAE3B,CAAC;AAAA,IACC,CAAC,MAAM,OAAO,aAAa,MAAM,EAAhC,MAAM;AAAA,KACN,CAAC,CAAC,aAAa,WAAW,CAAC,MAAM,aAAa,aAAa,QAAQ,EAAxC,MAAM;AAAA,EACpC,EAHC,OAIH,EAfC;AAiBL;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -40,18 +40,20 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@mdx-js/mdx": "^2.3.0",
|
|
42
42
|
"@mdx-js/react": "^2.3.0",
|
|
43
|
-
"@tamagui/font-inter": "^1.
|
|
44
|
-
"@tamagui/logo": "^1.
|
|
45
|
-
"@tamagui/react-native-media-driver": "^1.
|
|
46
|
-
"@tamagui/shorthands": "^1.
|
|
47
|
-
"@tamagui/themes": "^1.
|
|
48
|
-
"
|
|
49
|
-
"
|
|
43
|
+
"@tamagui/font-inter": "^1.35.8",
|
|
44
|
+
"@tamagui/logo": "^1.35.8",
|
|
45
|
+
"@tamagui/react-native-media-driver": "^1.35.8",
|
|
46
|
+
"@tamagui/shorthands": "^1.35.8",
|
|
47
|
+
"@tamagui/themes": "^1.35.8",
|
|
48
|
+
"burnt": "^0.11.7",
|
|
49
|
+
"expo-asset": "^8.10.0",
|
|
50
|
+
"expo-image": "^1.3.0",
|
|
51
|
+
"fast-xml-parser": "^4.2.5",
|
|
50
52
|
"gray-matter": "^4.0.3",
|
|
51
53
|
"hast-util-to-html": "^8.0.4",
|
|
52
54
|
"immer": "^10.0.2",
|
|
53
55
|
"parse-numeric-range": "^1.3.0",
|
|
54
|
-
"react-hook-form": "^7.
|
|
56
|
+
"react-hook-form": "^7.45.0",
|
|
55
57
|
"react-native-svg": "13.9.0",
|
|
56
58
|
"refractor": "^4.8.1",
|
|
57
59
|
"rehype-autolink-headings": "^6.1.1",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"rehype-slug": "^5.1.0",
|
|
60
62
|
"remark-frontmatter": "^4.0.1",
|
|
61
63
|
"remark-mdx-frontmatter": "^3.0.0",
|
|
62
|
-
"tamagui": "^1.
|
|
64
|
+
"tamagui": "^1.35.8",
|
|
63
65
|
"unist-util-visit": "^4.1.2"
|
|
64
66
|
},
|
|
65
67
|
"peerDependencies": {
|
|
@@ -68,11 +70,11 @@
|
|
|
68
70
|
"solito": "^3.2.6"
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
71
|
-
"@tamagui/build": "^1.
|
|
73
|
+
"@tamagui/build": "^1.35.8",
|
|
72
74
|
"moti": "^0.25.3",
|
|
73
75
|
"react-native-reanimated": "2.14.4",
|
|
74
|
-
"solito": "^3.2.
|
|
75
|
-
"ui": "
|
|
76
|
+
"solito": "^3.2.9",
|
|
77
|
+
"ui": "workspace:^"
|
|
76
78
|
},
|
|
77
79
|
"jest": {
|
|
78
80
|
"testRegex": "((/(tests|__tests__)((/|/[^_.\n][^/\n]*(/[^_.\n][^/\n]+)*/)[^_.\n][^/\n]*))|((/|/.*/)(([^_.\n][^/\n]*.(spec|test))|(spec|test)))).[jt]sx?$",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormCheckBox } from './index';
|
|
3
|
-
import {
|
|
3
|
+
import { YStack } from 'tamagui';
|
|
4
|
+
import { action } from '@storybook/addon-actions';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
6
7
|
title: 'forms/FormCheckBox',
|
|
@@ -9,7 +10,26 @@ export default {
|
|
|
9
10
|
};
|
|
10
11
|
|
|
11
12
|
export const main = () => (
|
|
12
|
-
<
|
|
13
|
-
<
|
|
14
|
-
|
|
13
|
+
<YStack>
|
|
14
|
+
<FormCheckBox
|
|
15
|
+
name="checkbox"
|
|
16
|
+
checkBoxElement={{ label: 'mango', value: 'mango' }}
|
|
17
|
+
onCheckedChange={action('onCheckedChange')}
|
|
18
|
+
/>
|
|
19
|
+
<FormCheckBox
|
|
20
|
+
name="checkbox"
|
|
21
|
+
checkBoxElement={{ label: 'orange', value: 'orange' }}
|
|
22
|
+
onCheckedChange={action('onCheckedChange')}
|
|
23
|
+
/>
|
|
24
|
+
<FormCheckBox
|
|
25
|
+
name="checkbox"
|
|
26
|
+
checkBoxElement={{ label: 'banana', value: 'banana' }}
|
|
27
|
+
onCheckedChange={action('onCheckedChange')}
|
|
28
|
+
/>
|
|
29
|
+
<FormCheckBox
|
|
30
|
+
name="checkbox"
|
|
31
|
+
checkBoxElement={{ label: 'lemon', value: 'lemon' }}
|
|
32
|
+
onCheckedChange={action('onCheckedChange')}
|
|
33
|
+
/>
|
|
34
|
+
</YStack>
|
|
15
35
|
);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FormProgress } from './index';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'forms/FormProgress',
|
|
6
|
+
component: FormProgress,
|
|
7
|
+
parameters: {
|
|
8
|
+
status: {
|
|
9
|
+
type: 'beta',
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const vertical = (args) => <FormProgress value={80} size={3} width={20} vertical name="progress" {...args} />;
|
|
15
|
+
|
|
16
|
+
export const horizontal = (args) => <FormProgress value={80} size={3} width={20} name="progress" {...args} />;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import React, { useId } from 'react';
|
|
2
|
+
import type { ProgressProps, SizeTokens } from 'tamagui';
|
|
3
|
+
import { Progress } from 'tamagui';
|
|
4
|
+
import { useFormContext, Controller } from 'react-hook-form';
|
|
5
|
+
import type { FormFieldProps } from '../FormField';
|
|
6
|
+
import { FormField } from '../FormField';
|
|
7
|
+
import type { FormControllerProps } from '../types';
|
|
8
|
+
|
|
9
|
+
export type FormProgressProps = ProgressProps &
|
|
10
|
+
FormControllerProps & { vertical?: boolean } & {
|
|
11
|
+
fieldProps?: Omit<FormFieldProps, 'helperText' | 'required' | 'error' | 'label'>;
|
|
12
|
+
} & Pick<FormFieldProps, 'helperText' | 'required' | 'error' | 'label'>;
|
|
13
|
+
|
|
14
|
+
export function FormProgress({
|
|
15
|
+
control,
|
|
16
|
+
defaultValue,
|
|
17
|
+
error,
|
|
18
|
+
fieldProps,
|
|
19
|
+
helperText,
|
|
20
|
+
label,
|
|
21
|
+
name,
|
|
22
|
+
required,
|
|
23
|
+
rules,
|
|
24
|
+
size,
|
|
25
|
+
vertical,
|
|
26
|
+
...progressProps
|
|
27
|
+
}: FormProgressProps) {
|
|
28
|
+
const formContext = useFormContext();
|
|
29
|
+
const id = useId();
|
|
30
|
+
const propSize = typeof size === 'number' ? (`$${size}` as SizeTokens) : (size as SizeTokens);
|
|
31
|
+
if (!formContext) {
|
|
32
|
+
console.log('FormProgress', progressProps);
|
|
33
|
+
return (
|
|
34
|
+
<FormField id={id} error={!!error} helperText={helperText} label={label} required={required} {...fieldProps}>
|
|
35
|
+
<Progress
|
|
36
|
+
mt={vertical ? 86 : undefined}
|
|
37
|
+
ml={vertical ? -80 : undefined}
|
|
38
|
+
rotate={vertical ? '270deg' : undefined}
|
|
39
|
+
{...progressProps}
|
|
40
|
+
size={propSize}
|
|
41
|
+
>
|
|
42
|
+
<Progress.Indicator animation="bouncy" />
|
|
43
|
+
</Progress>
|
|
44
|
+
</FormField>
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
return (
|
|
48
|
+
<Controller
|
|
49
|
+
name={name}
|
|
50
|
+
control={control}
|
|
51
|
+
rules={rules}
|
|
52
|
+
defaultValue={defaultValue}
|
|
53
|
+
render={({ field: { value }, fieldState: { error } }) => (
|
|
54
|
+
<FormField
|
|
55
|
+
id={id}
|
|
56
|
+
error={!!error}
|
|
57
|
+
helperText={error ? error.message : helperText}
|
|
58
|
+
label={label}
|
|
59
|
+
required={required}
|
|
60
|
+
{...fieldProps}
|
|
61
|
+
>
|
|
62
|
+
<Progress
|
|
63
|
+
mt={vertical ? 86 : undefined}
|
|
64
|
+
ml={vertical ? -80 : undefined}
|
|
65
|
+
rotate={vertical ? '270deg' : undefined}
|
|
66
|
+
{...progressProps}
|
|
67
|
+
size={propSize}
|
|
68
|
+
value={value ?? 0}
|
|
69
|
+
/>
|
|
70
|
+
</FormField>
|
|
71
|
+
)}
|
|
72
|
+
/>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormRadioGroup } from './index';
|
|
3
|
+
import { action } from '@storybook/addon-actions';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: 'forms/FormRadioGroup',
|
|
@@ -18,5 +19,6 @@ export const main = () => (
|
|
|
18
19
|
{ label: 'option 2', value: 'option2' },
|
|
19
20
|
{ label: 'option 3', value: 'option3' },
|
|
20
21
|
]}
|
|
22
|
+
onValueChange={action('onValueChange')}
|
|
21
23
|
/>
|
|
22
24
|
);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormSlider } from './index';
|
|
3
|
+
import { action } from '@storybook/addon-actions';
|
|
3
4
|
|
|
4
5
|
export default {
|
|
5
6
|
title: 'forms/FormSlider',
|
|
@@ -9,4 +10,4 @@ export default {
|
|
|
9
10
|
},
|
|
10
11
|
};
|
|
11
12
|
|
|
12
|
-
export const main = () => <FormSlider name="FormSlider" />;
|
|
13
|
+
export const main = () => <FormSlider name="FormSlider" onValueChange={action(`onValueChange`)} />;
|