@anker-in/headless-ui 0.0.21 → 0.0.22
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/CONTRIBUTING.md +16 -11
- package/dist/cjs/components/button.d.ts +1 -0
- package/dist/cjs/components/button.js +1 -1
- package/dist/cjs/components/button.js.map +3 -3
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/picture.d.ts +13 -0
- package/dist/cjs/components/picture.js +2 -0
- package/dist/cjs/components/picture.js.map +7 -0
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/helpers/utils.d.ts +1 -0
- package/dist/cjs/helpers/utils.js +1 -1
- package/dist/cjs/helpers/utils.js.map +3 -3
- package/dist/cjs/stories/badge.stories.d.ts +1 -1
- package/dist/cjs/stories/badge.stories.js +1 -1
- package/dist/cjs/stories/badge.stories.js.map +2 -2
- package/dist/cjs/stories/button.stories.d.ts +1 -1
- package/dist/cjs/stories/button.stories.js +1 -1
- package/dist/cjs/stories/button.stories.js.map +2 -2
- package/dist/cjs/stories/checkbox.stories.d.ts +3 -3
- package/dist/cjs/stories/checkbox.stories.js +1 -1
- package/dist/cjs/stories/checkbox.stories.js.map +2 -2
- package/dist/cjs/stories/dialog.stories.d.ts +1 -1
- package/dist/cjs/stories/dialog.stories.js +1 -1
- package/dist/cjs/stories/dialog.stories.js.map +2 -2
- package/dist/cjs/stories/heading.stories.d.ts +1 -1
- package/dist/cjs/stories/heading.stories.js +1 -1
- package/dist/cjs/stories/heading.stories.js.map +2 -2
- package/dist/cjs/stories/input.stories.d.ts +1 -1
- package/dist/cjs/stories/input.stories.js +1 -1
- package/dist/cjs/stories/input.stories.js.map +2 -2
- package/dist/cjs/stories/picture.stories.d.ts +18 -0
- package/dist/cjs/stories/picture.stories.js +4 -0
- package/dist/cjs/stories/picture.stories.js.map +7 -0
- package/dist/cjs/stories/popover.stories.d.ts +1 -1
- package/dist/cjs/stories/popover.stories.js +1 -1
- package/dist/cjs/stories/popover.stories.js.map +2 -2
- package/dist/cjs/stories/radio.stories.d.ts +4 -4
- package/dist/cjs/stories/radio.stories.js +1 -1
- package/dist/cjs/stories/radio.stories.js.map +2 -2
- package/dist/cjs/stories/skeleton.stories.d.ts +1 -1
- package/dist/cjs/stories/skeleton.stories.js +1 -1
- package/dist/cjs/stories/skeleton.stories.js.map +2 -2
- package/dist/cjs/stories/text.stories.d.ts +1 -1
- package/dist/cjs/stories/text.stories.js +1 -1
- package/dist/cjs/stories/text.stories.js.map +2 -2
- package/dist/esm/components/button.d.ts +1 -0
- package/dist/esm/components/button.js +1 -1
- package/dist/esm/components/button.js.map +3 -3
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/picture.d.ts +13 -0
- package/dist/esm/components/picture.js +2 -0
- package/dist/esm/components/picture.js.map +7 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +3 -3
- package/dist/esm/helpers/utils.d.ts +1 -0
- package/dist/esm/helpers/utils.js +1 -1
- package/dist/esm/helpers/utils.js.map +3 -3
- package/dist/esm/stories/badge.stories.d.ts +1 -1
- package/dist/esm/stories/badge.stories.js +1 -1
- package/dist/esm/stories/badge.stories.js.map +2 -2
- package/dist/esm/stories/button.stories.d.ts +1 -1
- package/dist/esm/stories/button.stories.js +1 -1
- package/dist/esm/stories/button.stories.js.map +2 -2
- package/dist/esm/stories/checkbox.stories.d.ts +3 -3
- package/dist/esm/stories/checkbox.stories.js +1 -1
- package/dist/esm/stories/checkbox.stories.js.map +2 -2
- package/dist/esm/stories/dialog.stories.d.ts +1 -1
- package/dist/esm/stories/dialog.stories.js +1 -1
- package/dist/esm/stories/dialog.stories.js.map +2 -2
- package/dist/esm/stories/heading.stories.d.ts +1 -1
- package/dist/esm/stories/heading.stories.js +1 -1
- package/dist/esm/stories/heading.stories.js.map +2 -2
- package/dist/esm/stories/input.stories.d.ts +1 -1
- package/dist/esm/stories/input.stories.js +1 -1
- package/dist/esm/stories/input.stories.js.map +2 -2
- package/dist/esm/stories/picture.stories.d.ts +18 -0
- package/dist/esm/stories/picture.stories.js +4 -0
- package/dist/esm/stories/picture.stories.js.map +7 -0
- package/dist/esm/stories/popover.stories.d.ts +1 -1
- package/dist/esm/stories/popover.stories.js +1 -1
- package/dist/esm/stories/popover.stories.js.map +2 -2
- package/dist/esm/stories/radio.stories.d.ts +4 -4
- package/dist/esm/stories/radio.stories.js +1 -1
- package/dist/esm/stories/radio.stories.js.map +2 -2
- package/dist/esm/stories/skeleton.stories.d.ts +1 -1
- package/dist/esm/stories/skeleton.stories.js +1 -1
- package/dist/esm/stories/skeleton.stories.js.map +2 -2
- package/dist/esm/stories/text.stories.d.ts +1 -1
- package/dist/esm/stories/text.stories.js +1 -1
- package/dist/esm/stories/text.stories.js.map +2 -2
- package/package.json +2 -1
- package/src/components/button.tsx +35 -11
- package/src/components/index.ts +1 -0
- package/src/components/picture.tsx +99 -0
- package/src/helpers/index.ts +1 -0
- package/src/helpers/utils.ts +2 -0
- package/src/stories/badge.stories.tsx +1 -1
- package/src/stories/button.stories.tsx +1 -1
- package/src/stories/checkbox.stories.tsx +1 -1
- package/src/stories/dialog.stories.tsx +1 -1
- package/src/stories/heading.stories.tsx +1 -1
- package/src/stories/input.stories.tsx +1 -1
- package/src/stories/picture.stories.tsx +51 -0
- package/src/stories/popover.stories.tsx +1 -1
- package/src/stories/radio.stories.tsx +1 -1
- package/src/stories/skeleton.stories.tsx +1 -1
- package/src/stories/text.stories.tsx +1 -1
- package/src/styles/global.css +9 -9
- package/style.css +18 -12
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Checkbox as a}from"../components/index";import"react";const t={title:"Components/Checkbox",component:a,parameters:{layout:"centered",docs:{description:{component:"\u590D\u9009\u6846, \u57FA\u4E8E@radix-ui/react-checkbox https://www.radix-ui.com/primitives/docs/components/checkbox"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"],description:"\u5C3A\u5BF8",table:{defaultValue:{summary:"base"}}}},args:{size:"base"}};var c=t;const d={args:{size:"base"}},s=()=>i("div",{className:"ai-flex ai-flex-col ai-gap-2",children:[i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms",size:"sm"}),e("label",{htmlFor:"terms",className:"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]}),i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms1",size:"base"}),e("label",{htmlFor:"terms1",className:"ai-text-base ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]}),i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms2",size:"lg"}),e("label",{htmlFor:"terms2",className:"ai-text-lg ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]})]});s.parameters={docs:{description:{story:"\u4E0D\u540C\u7684\u5C3A\u5BF8"}}};const m=()=>i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms",disabled:!0}),e("label",{htmlFor:"terms",className:"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]});export{d as Default,m as Disabled,s as Sizes,c as default};
|
|
1
|
+
import{jsx as e,jsxs as i}from"react/jsx-runtime";import{Checkbox as a}from"../components/index.js";import"react";const t={title:"Components/Checkbox",component:a,parameters:{layout:"centered",docs:{description:{component:"\u590D\u9009\u6846, \u57FA\u4E8E@radix-ui/react-checkbox https://www.radix-ui.com/primitives/docs/components/checkbox"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"],description:"\u5C3A\u5BF8",table:{defaultValue:{summary:"base"}}}},args:{size:"base"}};var c=t;const d={args:{size:"base"}},s=()=>i("div",{className:"ai-flex ai-flex-col ai-gap-2",children:[i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms",size:"sm"}),e("label",{htmlFor:"terms",className:"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]}),i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms1",size:"base"}),e("label",{htmlFor:"terms1",className:"ai-text-base ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]}),i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms2",size:"lg"}),e("label",{htmlFor:"terms2",className:"ai-text-lg ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]})]});s.parameters={docs:{description:{story:"\u4E0D\u540C\u7684\u5C3A\u5BF8"}}};const m=()=>i("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms",disabled:!0}),e("label",{htmlFor:"terms",className:"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70",children:"Accept terms and conditions"})]});export{d as Default,m as Disabled,s as Sizes,c as default};
|
|
2
2
|
//# sourceMappingURL=checkbox.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/checkbox.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react/*'\nimport { Checkbox } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Checkbox',\n component: Checkbox,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u590D\u9009\u6846, \u57FA\u4E8E@radix-ui/react-checkbox https://www.radix-ui.com/primitives/docs/components/checkbox',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n description: '\u5C3A\u5BF8',\n table: {\n defaultValue: { summary: 'base' },\n },\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof Checkbox>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n size: 'base',\n },\n}\n\nexport const Sizes = () => (\n <div className=\"ai-flex ai-flex-col ai-gap-2\">\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms\" size=\"sm\" />\n <label\n htmlFor=\"terms\"\n className=\"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms1\" size=\"base\" />\n <label\n htmlFor=\"terms1\"\n className=\"ai-text-base ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms2\" size=\"lg\" />\n <label\n htmlFor=\"terms2\"\n className=\"ai-text-lg ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n </div>\n)\nSizes.parameters = {\n docs: {\n description: {\n story: '\u4E0D\u540C\u7684\u5C3A\u5BF8',\n },\n },\n}\n\nexport const Disabled = () => (\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms\" disabled />\n <label\n htmlFor=\"terms\"\n className=\"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n)\n"],
|
|
5
|
-
"mappings": "AA6CI,OACE,OAAAA,EADF,QAAAC,MAAA,oBA5CJ,OAAS,YAAAC,MAAgB,
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react/*'\nimport { Checkbox } from '../components/index.js'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Checkbox',\n component: Checkbox,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u590D\u9009\u6846, \u57FA\u4E8E@radix-ui/react-checkbox https://www.radix-ui.com/primitives/docs/components/checkbox',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n description: '\u5C3A\u5BF8',\n table: {\n defaultValue: { summary: 'base' },\n },\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof Checkbox>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n size: 'base',\n },\n}\n\nexport const Sizes = () => (\n <div className=\"ai-flex ai-flex-col ai-gap-2\">\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms\" size=\"sm\" />\n <label\n htmlFor=\"terms\"\n className=\"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms1\" size=\"base\" />\n <label\n htmlFor=\"terms1\"\n className=\"ai-text-base ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms2\" size=\"lg\" />\n <label\n htmlFor=\"terms2\"\n className=\"ai-text-lg ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n </div>\n)\nSizes.parameters = {\n docs: {\n description: {\n story: '\u4E0D\u540C\u7684\u5C3A\u5BF8',\n },\n },\n}\n\nexport const Disabled = () => (\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms\" disabled />\n <label\n htmlFor=\"terms\"\n className=\"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n)\n"],
|
|
5
|
+
"mappings": "AA6CI,OACE,OAAAA,EADF,QAAAC,MAAA,oBA5CJ,OAAS,YAAAC,MAAgB,yBACzB,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,sBACP,UAAWD,EACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,uHACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,OAAQ,IAAI,EAC5B,YAAa,eACb,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,CACF,EACA,KAAM,CACJ,KAAM,MACR,CACF,EAEA,IAAOE,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,KAAM,MACR,CACF,EAEaC,EAAQ,IACnBL,EAAC,OAAI,UAAU,+BACb,UAAAA,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,QAAQ,KAAK,KAAK,EAC/BF,EAAC,SACC,QAAQ,QACR,UAAU,4GACX,uCAED,GACF,EACAC,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,SAAS,KAAK,OAAO,EAClCF,EAAC,SACC,QAAQ,SACR,UAAU,8GACX,uCAED,GACF,EACAC,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,SAAS,KAAK,KAAK,EAChCF,EAAC,SACC,QAAQ,SACR,UAAU,4GACX,uCAED,GACF,GACF,EAEFM,EAAM,WAAa,CACjB,KAAM,CACJ,YAAa,CACX,MAAO,gCACT,CACF,CACF,EAEO,MAAMC,EAAW,IACtBN,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,QAAQ,SAAQ,GAAC,EAC9BF,EAAC,SACC,QAAQ,QACR,UAAU,4GACX,uCAED,GACF",
|
|
6
6
|
"names": ["jsx", "jsxs", "Checkbox", "meta", "checkbox_stories_default", "Default", "Sizes", "Disabled"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as d,jsx as a,jsxs as e}from"react/jsx-runtime";import"react";import{Button as g,Dialog as m,DialogContent as i,DialogDescription as o,DialogFooter as t,DialogHeader as l,DialogTitle as r,DialogTrigger as s,Input as n}from"../components/index";const c={title:"Components/Dialog",component:m,subcomponents:{DialogTrigger:s,DialogContent:i,DialogHeader:l,DialogTitle:r,DialogDescription:o,DialogFooter:t},parameters:{layout:"centered",docs:{description:{component:"\u5F39\u7A97\u7EC4\u4EF6\uFF0C\u57FA\u4E8E@radix-ui/react-dialog\uFF0Chttps://www.radix-ui.com/primitives/docs/components/dialog "}}},tags:["autodocs"]};var y=c;const f={args:{children:e(d,{children:[a(s,{asChild:!0,children:a("button",{children:"Edit Profile"})}),e(i,{className:"sm:ai-max-w-[425px]",children:[e(l,{children:[a(r,{children:"Edit profile"}),a(o,{children:"Make changes to your profile here. Click save when you're done."})]}),e("div",{className:"ai-grid ai-gap-4 ai-py-4",children:[e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"name",className:"ai-text-right",children:"Name"}),a(n,{id:"name",defaultValue:"Pedro Duarte",className:"ai-col-span-3"})]}),e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"username",className:"ai-text-right",children:"Username"}),a(n,{id:"username",defaultValue:"@peduarte",className:"ai-col-span-3"})]})]}),a(t,{children:a(g,{type:"submit",children:"Save changes"})})]})]})}};export{f as Default,y as default};
|
|
1
|
+
import{Fragment as d,jsx as a,jsxs as e}from"react/jsx-runtime";import"react";import{Button as g,Dialog as m,DialogContent as i,DialogDescription as o,DialogFooter as t,DialogHeader as l,DialogTitle as r,DialogTrigger as s,Input as n}from"../components/index.js";const c={title:"Components/Dialog",component:m,subcomponents:{DialogTrigger:s,DialogContent:i,DialogHeader:l,DialogTitle:r,DialogDescription:o,DialogFooter:t},parameters:{layout:"centered",docs:{description:{component:"\u5F39\u7A97\u7EC4\u4EF6\uFF0C\u57FA\u4E8E@radix-ui/react-dialog\uFF0Chttps://www.radix-ui.com/primitives/docs/components/dialog "}}},tags:["autodocs"]};var y=c;const f={args:{children:e(d,{children:[a(s,{asChild:!0,children:a("button",{children:"Edit Profile"})}),e(i,{className:"sm:ai-max-w-[425px]",children:[e(l,{children:[a(r,{children:"Edit profile"}),a(o,{children:"Make changes to your profile here. Click save when you're done."})]}),e("div",{className:"ai-grid ai-gap-4 ai-py-4",children:[e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"name",className:"ai-text-right",children:"Name"}),a(n,{id:"name",defaultValue:"Pedro Duarte",className:"ai-col-span-3"})]}),e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"username",className:"ai-text-right",children:"Username"}),a(n,{id:"username",defaultValue:"@peduarte",className:"ai-col-span-3"})]})]}),a(t,{children:a(g,{type:"submit",children:"Save changes"})})]})]})}};export{f as Default,y as default};
|
|
2
2
|
//# sourceMappingURL=dialog.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/dialog.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n Input,\n} from '../components/index'\nimport type { Meta, StoryObj } from '@storybook/react/*'\n\nconst meta = {\n title: 'Components/Dialog',\n component: Dialog,\n subcomponents: {\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n } as any,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u5F39\u7A97\u7EC4\u4EF6\uFF0C\u57FA\u4E8E@radix-ui/react-dialog\uFF0Chttps://www.radix-ui.com/primitives/docs/components/dialog ',\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Dialog>\n\nexport default meta\n\ntype Story = StoryObj<typeof Dialog>\n\nexport const Default: Story = {\n args: {\n children: (\n <>\n <DialogTrigger asChild>\n <button>Edit Profile</button>\n </DialogTrigger>\n <DialogContent className=\"sm:ai-max-w-[425px]\">\n <DialogHeader>\n <DialogTitle>Edit profile</DialogTitle>\n <DialogDescription>Make changes to your profile here. Click save when you're done.</DialogDescription>\n </DialogHeader>\n <div className=\"ai-grid ai-gap-4 ai-py-4\">\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"name\" className=\"ai-text-right\">\n Name\n </label>\n <Input id=\"name\" defaultValue=\"Pedro Duarte\" className=\"ai-col-span-3\" />\n </div>\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"username\" className=\"ai-text-right\">\n Username\n </label>\n <Input id=\"username\" defaultValue=\"@peduarte\" className=\"ai-col-span-3\" />\n </div>\n </div>\n <DialogFooter>\n <Button type=\"submit\">Save changes</Button>\n </DialogFooter>\n </DialogContent>\n </>\n ),\n },\n}\n"],
|
|
5
|
-
"mappings": "AA2CM,mBAAAA,EAEI,OAAAC,EAGA,QAAAC,MALJ,oBA3CN,MAAkB,QAClB,OACE,UAAAC,EACA,UAAAC,EACA,iBAAAC,EACA,qBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,SAAAC,MACK,
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n Input,\n} from '../components/index.js'\nimport type { Meta, StoryObj } from '@storybook/react/*'\n\nconst meta = {\n title: 'Components/Dialog',\n component: Dialog,\n subcomponents: {\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n } as any,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u5F39\u7A97\u7EC4\u4EF6\uFF0C\u57FA\u4E8E@radix-ui/react-dialog\uFF0Chttps://www.radix-ui.com/primitives/docs/components/dialog ',\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Dialog>\n\nexport default meta\n\ntype Story = StoryObj<typeof Dialog>\n\nexport const Default: Story = {\n args: {\n children: (\n <>\n <DialogTrigger asChild>\n <button>Edit Profile</button>\n </DialogTrigger>\n <DialogContent className=\"sm:ai-max-w-[425px]\">\n <DialogHeader>\n <DialogTitle>Edit profile</DialogTitle>\n <DialogDescription>Make changes to your profile here. Click save when you're done.</DialogDescription>\n </DialogHeader>\n <div className=\"ai-grid ai-gap-4 ai-py-4\">\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"name\" className=\"ai-text-right\">\n Name\n </label>\n <Input id=\"name\" defaultValue=\"Pedro Duarte\" className=\"ai-col-span-3\" />\n </div>\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"username\" className=\"ai-text-right\">\n Username\n </label>\n <Input id=\"username\" defaultValue=\"@peduarte\" className=\"ai-col-span-3\" />\n </div>\n </div>\n <DialogFooter>\n <Button type=\"submit\">Save changes</Button>\n </DialogFooter>\n </DialogContent>\n </>\n ),\n },\n}\n"],
|
|
5
|
+
"mappings": "AA2CM,mBAAAA,EAEI,OAAAC,EAGA,QAAAC,MALJ,oBA3CN,MAAkB,QAClB,OACE,UAAAC,EACA,UAAAC,EACA,iBAAAC,EACA,qBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,SAAAC,MACK,yBAGP,MAAMC,EAAO,CACX,MAAO,oBACP,UAAWR,EACX,cAAe,CACb,cAAAM,EACA,cAAAL,EACA,aAAAG,EACA,YAAAC,EACA,kBAAAH,EACA,aAAAC,CACF,EACA,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,mIACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOM,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,SACEZ,EAAAF,EAAA,CACE,UAAAC,EAACS,EAAA,CAAc,QAAO,GACpB,SAAAT,EAAC,UAAO,wBAAY,EACtB,EACAC,EAACG,EAAA,CAAc,UAAU,sBACvB,UAAAH,EAACM,EAAA,CACC,UAAAP,EAACQ,EAAA,CAAY,wBAAY,EACzBR,EAACK,EAAA,CAAkB,2EAA+D,GACpF,EACAJ,EAAC,OAAI,UAAU,2BACb,UAAAA,EAAC,OAAI,UAAU,kDACb,UAAAD,EAAC,SAAM,QAAQ,OAAO,UAAU,gBAAgB,gBAEhD,EACAA,EAACU,EAAA,CAAM,GAAG,OAAO,aAAa,eAAe,UAAU,gBAAgB,GACzE,EACAT,EAAC,OAAI,UAAU,kDACb,UAAAD,EAAC,SAAM,QAAQ,WAAW,UAAU,gBAAgB,oBAEpD,EACAA,EAACU,EAAA,CAAM,GAAG,WAAW,aAAa,YAAY,UAAU,gBAAgB,GAC1E,GACF,EACAV,EAACM,EAAA,CACC,SAAAN,EAACE,EAAA,CAAO,KAAK,SAAS,wBAAY,EACpC,GACF,GACF,CAEJ,CACF",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "Button", "Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger", "Input", "meta", "dialog_stories_default", "Default"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<import("../components/heading").HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../components/heading.js").HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
docs: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as r,jsx as o,jsxs as a}from"react/jsx-runtime";import{Heading as e}from"../components/index";import"react";const t={title:"Typography/Heading",component:e,parameters:{layout:"centered",docs:{description:{component:"Heading \u7EC4\u4EF6, \u57FA\u672C\u548Ctext \u7EC4\u4EF6\u4E00\u6837\uFF0C\u53EA\u662F\u9ED8\u8BA4\u7684\u6807\u7B7E\u7C7B\u578B\u4E0D\u4E00\u6837"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["none",1,2,3,4,5,6,7,8,9],description:"\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8",table:{defaultValue:{summary:"none"}}},weights:{control:{type:"select"},options:["light","normal","medium","bold"],table:{defaultValue:{summary:"normal"}}},align:{control:{type:"select"},options:["left","center","right"],table:{defaultValue:{summary:"left"}}},color:{control:{type:"color"}},as:{control:{type:"select"},options:["h1","h2","h3","h4","h5","h6"],description:"html \u6807\u7B7E\u7C7B\u578B",table:{defaultValue:{summary:"h1"}}},html:{type:"string",description:"\u76F8\u5F53\u4E8E dangerouslySetInnerHTML"}},args:{as:"h1",size:"none",weights:"normal",align:"left"}};var l=t;const d={args:{as:"h1",children:" The quick brown fox jumps over the lazy dog."}},p={render:()=>a(r,{children:[o(e,{size:1,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:2,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:3,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:4,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:5,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:6,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:7,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:8,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:9,children:"The quick brown fox jumps over the lazy dog."})]})};export{p as All,d as Default,l as default};
|
|
1
|
+
import{Fragment as r,jsx as o,jsxs as a}from"react/jsx-runtime";import{Heading as e}from"../components/index.js";import"react";const t={title:"Typography/Heading",component:e,parameters:{layout:"centered",docs:{description:{component:"Heading \u7EC4\u4EF6, \u57FA\u672C\u548Ctext \u7EC4\u4EF6\u4E00\u6837\uFF0C\u53EA\u662F\u9ED8\u8BA4\u7684\u6807\u7B7E\u7C7B\u578B\u4E0D\u4E00\u6837"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["none",1,2,3,4,5,6,7,8,9],description:"\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8",table:{defaultValue:{summary:"none"}}},weights:{control:{type:"select"},options:["light","normal","medium","bold"],table:{defaultValue:{summary:"normal"}}},align:{control:{type:"select"},options:["left","center","right"],table:{defaultValue:{summary:"left"}}},color:{control:{type:"color"}},as:{control:{type:"select"},options:["h1","h2","h3","h4","h5","h6"],description:"html \u6807\u7B7E\u7C7B\u578B",table:{defaultValue:{summary:"h1"}}},html:{type:"string",description:"\u76F8\u5F53\u4E8E dangerouslySetInnerHTML"}},args:{as:"h1",size:"none",weights:"normal",align:"left"}};var l=t;const d={args:{as:"h1",children:" The quick brown fox jumps over the lazy dog."}},p={render:()=>a(r,{children:[o(e,{size:1,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:2,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:3,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:4,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:5,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:6,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:7,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:8,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:9,children:"The quick brown fox jumps over the lazy dog."})]})};export{p as All,d as Default,l as default};
|
|
2
2
|
//# sourceMappingURL=heading.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/heading.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Heading } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Typography/Heading',\n component: Heading,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: 'Heading \u7EC4\u4EF6, \u57FA\u672C\u548Ctext \u7EC4\u4EF6\u4E00\u6837\uFF0C\u53EA\u662F\u9ED8\u8BA4\u7684\u6807\u7B7E\u7C7B\u578B\u4E0D\u4E00\u6837',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['none', 1, 2, 3, 4, 5, 6, 7, 8, 9],\n description: '\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8',\n table: {\n defaultValue: { summary: 'none' },\n },\n },\n weights: {\n control: {\n type: 'select',\n },\n options: ['light', 'normal', 'medium', 'bold'],\n table: {\n defaultValue: { summary: 'normal' },\n },\n },\n align: {\n control: {\n type: 'select',\n },\n options: ['left', 'center', 'right'],\n table: {\n defaultValue: { summary: 'left' },\n },\n },\n color: {\n control: {\n type: 'color',\n },\n },\n as: {\n control: {\n type: 'select',\n },\n options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n description: 'html \u6807\u7B7E\u7C7B\u578B',\n table: {\n defaultValue: { summary: 'h1' },\n },\n },\n html: {\n type: 'string',\n description: '\u76F8\u5F53\u4E8E dangerouslySetInnerHTML',\n },\n },\n args: {\n as: 'h1',\n size: 'none',\n weights: 'normal',\n align: 'left',\n },\n} satisfies Meta<typeof Heading>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n as: 'h1',\n children: ' The quick brown fox jumps over the lazy dog.',\n },\n}\n\nexport const All: Story = {\n render: () => (\n <>\n <Heading size={1}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={2}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={3}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={4}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={5}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={6}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={7}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={8}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={9}>The quick brown fox jumps over the lazy dog.</Heading>\n </>\n ),\n}\n"],
|
|
5
|
-
"mappings": "AAuFI,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBArFJ,OAAS,WAAAC,MAAe,
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Heading } from '../components/index.js'\nimport React from 'react'\n\nconst meta = {\n title: 'Typography/Heading',\n component: Heading,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: 'Heading \u7EC4\u4EF6, \u57FA\u672C\u548Ctext \u7EC4\u4EF6\u4E00\u6837\uFF0C\u53EA\u662F\u9ED8\u8BA4\u7684\u6807\u7B7E\u7C7B\u578B\u4E0D\u4E00\u6837',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['none', 1, 2, 3, 4, 5, 6, 7, 8, 9],\n description: '\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8',\n table: {\n defaultValue: { summary: 'none' },\n },\n },\n weights: {\n control: {\n type: 'select',\n },\n options: ['light', 'normal', 'medium', 'bold'],\n table: {\n defaultValue: { summary: 'normal' },\n },\n },\n align: {\n control: {\n type: 'select',\n },\n options: ['left', 'center', 'right'],\n table: {\n defaultValue: { summary: 'left' },\n },\n },\n color: {\n control: {\n type: 'color',\n },\n },\n as: {\n control: {\n type: 'select',\n },\n options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n description: 'html \u6807\u7B7E\u7C7B\u578B',\n table: {\n defaultValue: { summary: 'h1' },\n },\n },\n html: {\n type: 'string',\n description: '\u76F8\u5F53\u4E8E dangerouslySetInnerHTML',\n },\n },\n args: {\n as: 'h1',\n size: 'none',\n weights: 'normal',\n align: 'left',\n },\n} satisfies Meta<typeof Heading>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n as: 'h1',\n children: ' The quick brown fox jumps over the lazy dog.',\n },\n}\n\nexport const All: Story = {\n render: () => (\n <>\n <Heading size={1}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={2}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={3}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={4}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={5}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={6}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={7}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={8}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={9}>The quick brown fox jumps over the lazy dog.</Heading>\n </>\n ),\n}\n"],
|
|
5
|
+
"mappings": "AAuFI,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBArFJ,OAAS,WAAAC,MAAe,yBACxB,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,qBACP,UAAWD,EACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,qJACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,OAAQ,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EAC3C,YAAa,6LACb,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,QAAS,CACP,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,QAAS,SAAU,SAAU,MAAM,EAC7C,MAAO,CACL,aAAc,CAAE,QAAS,QAAS,CACpC,CACF,EACA,MAAO,CACL,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,OAAQ,SAAU,OAAO,EACnC,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,MAAO,CACL,QAAS,CACP,KAAM,OACR,CACF,EACA,GAAI,CACF,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAI,EAC5C,YAAa,gCACb,MAAO,CACL,aAAc,CAAE,QAAS,IAAK,CAChC,CACF,EACA,KAAM,CACJ,KAAM,SACN,YAAa,4CACf,CACF,EACA,KAAM,CACJ,GAAI,KACJ,KAAM,OACN,QAAS,SACT,MAAO,MACT,CACF,EAEA,IAAOE,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,GAAI,KACJ,SAAU,+CACZ,CACF,EAEaC,EAAa,CACxB,OAAQ,IACNL,EAAAF,EAAA,CACE,UAAAC,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,GAChE,CAEJ",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "Heading", "meta", "heading_stories_default", "Default", "All"]
|
|
7
7
|
}
|
|
@@ -3,7 +3,7 @@ import type { ComponentType } from 'react';
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: React.ForwardRefExoticComponent<import("../components/input").InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("../components/input.js").InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
7
7
|
subcomponents: {
|
|
8
8
|
InputSlot: ComponentType<unknown>;
|
|
9
9
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{Button as n,Input as e,InputSlot as o}from"../components/index";import{SearchIcon as r}from"@storybook/icons";import"react";const p={title:"Components/Input",component:e,subcomponents:{InputSlot:o},parameters:{layout:"centered",docs:{description:{component:"Input \u7EC4\u4EF6, \u7528\u4E8E\u8F93\u5165\u6846, \u53EF\u4EE5\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9, \u6BD4\u5982icon, \u6309\u94AE"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"]}},args:{size:"base"}};var u=p;const m={args:{}},l={render(){return t(e,{className:"ai-rounded-3xl ai-pr-0",placeholder:"Enter your email",type:"text",children:t(o,{side:"right",children:t(n,{className:"ai-h-full ai-rounded-none",size:"sm",children:"subscribe"})})})}},y={render(){return t(e,{type:"text",placeholder:"search in site",children:t(o,{side:"left",children:t(r,{})})})}};export{m as Default,l as WithButton,y as WithIcon,u as default};
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{Button as n,Input as e,InputSlot as o}from"../components/index.js";import{SearchIcon as r}from"@storybook/icons";import"react";const p={title:"Components/Input",component:e,subcomponents:{InputSlot:o},parameters:{layout:"centered",docs:{description:{component:"Input \u7EC4\u4EF6, \u7528\u4E8E\u8F93\u5165\u6846, \u53EF\u4EE5\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9, \u6BD4\u5982icon, \u6309\u94AE"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"]}},args:{size:"base"}};var u=p;const m={args:{}},l={render(){return t(e,{className:"ai-rounded-3xl ai-pr-0",placeholder:"Enter your email",type:"text",children:t(o,{side:"right",children:t(n,{className:"ai-h-full ai-rounded-none",size:"sm",children:"subscribe"})})})}},y={render(){return t(e,{type:"text",placeholder:"search in site",children:t(o,{side:"left",children:t(r,{})})})}};export{m as Default,l as WithButton,y as WithIcon,u as default};
|
|
2
2
|
//# sourceMappingURL=input.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/input.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport type { ComponentType } from 'react'\nimport { Button, Input, InputSlot } from '../components/index'\nimport { SearchIcon } from '@storybook/icons'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Input',\n component: Input,\n subcomponents: { InputSlot: InputSlot as ComponentType<unknown> }, // TODO: \u68C0\u67E5type , \u53BB\u6389as\u7C7B\u578B\u8F6C\u6362\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: 'Input \u7EC4\u4EF6, \u7528\u4E8E\u8F93\u5165\u6846, \u53EF\u4EE5\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9, \u6BD4\u5982icon, \u6309\u94AE',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof Input>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {},\n}\n\nexport const WithButton: Story = {\n render() {\n return (\n <Input className=\"ai-rounded-3xl ai-pr-0\" placeholder=\"Enter your email\" type=\"text\">\n <InputSlot side=\"right\">\n <Button className=\"ai-h-full ai-rounded-none\" size=\"sm\">\n subscribe\n </Button>\n </InputSlot>\n </Input>\n )\n },\n}\nexport const WithIcon: Story = {\n render() {\n return (\n <Input type=\"text\" placeholder=\"search in site\">\n <InputSlot side=\"left\">\n <SearchIcon />\n </InputSlot>\n </Input>\n )\n },\n}\n"],
|
|
5
|
-
"mappings": "AA6CU,cAAAA,MAAA,oBA3CV,OAAS,UAAAC,EAAQ,SAAAC,EAAO,aAAAC,MAAiB,
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport type { ComponentType } from 'react'\nimport { Button, Input, InputSlot } from '../components/index.js'\nimport { SearchIcon } from '@storybook/icons'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Input',\n component: Input,\n subcomponents: { InputSlot: InputSlot as ComponentType<unknown> }, // TODO: \u68C0\u67E5type , \u53BB\u6389as\u7C7B\u578B\u8F6C\u6362\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: 'Input \u7EC4\u4EF6, \u7528\u4E8E\u8F93\u5165\u6846, \u53EF\u4EE5\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9, \u6BD4\u5982icon, \u6309\u94AE',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof Input>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {},\n}\n\nexport const WithButton: Story = {\n render() {\n return (\n <Input className=\"ai-rounded-3xl ai-pr-0\" placeholder=\"Enter your email\" type=\"text\">\n <InputSlot side=\"right\">\n <Button className=\"ai-h-full ai-rounded-none\" size=\"sm\">\n subscribe\n </Button>\n </InputSlot>\n </Input>\n )\n },\n}\nexport const WithIcon: Story = {\n render() {\n return (\n <Input type=\"text\" placeholder=\"search in site\">\n <InputSlot side=\"left\">\n <SearchIcon />\n </InputSlot>\n </Input>\n )\n },\n}\n"],
|
|
5
|
+
"mappings": "AA6CU,cAAAA,MAAA,oBA3CV,OAAS,UAAAC,EAAQ,SAAAC,EAAO,aAAAC,MAAiB,yBACzC,OAAS,cAAAC,MAAkB,mBAC3B,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,mBACP,UAAWH,EACX,cAAe,CAAE,UAAWC,CAAoC,EAChE,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,oKACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,OAAQ,IAAI,CAC9B,CACF,EACA,KAAM,CACJ,KAAM,MACR,CACF,EAEA,IAAOG,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CAAC,CACT,EAEaC,EAAoB,CAC/B,QAAS,CACP,OACER,EAACE,EAAA,CAAM,UAAU,yBAAyB,YAAY,mBAAmB,KAAK,OAC5E,SAAAF,EAACG,EAAA,CAAU,KAAK,QACd,SAAAH,EAACC,EAAA,CAAO,UAAU,4BAA4B,KAAK,KAAK,qBAExD,EACF,EACF,CAEJ,CACF,EACaQ,EAAkB,CAC7B,QAAS,CACP,OACET,EAACE,EAAA,CAAM,KAAK,OAAO,YAAY,iBAC7B,SAAAF,EAACG,EAAA,CAAU,KAAK,OACd,SAAAH,EAACI,EAAA,EAAW,EACd,EACF,CAEJ,CACF",
|
|
6
6
|
"names": ["jsx", "Button", "Input", "InputSlot", "SearchIcon", "meta", "input_stories_default", "Default", "WithButton", "WithIcon"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: ({ imgClassName, source, quality, deviceSizes, ...rest }: import("../components/picture.js").PictureProps) => import("react/jsx-runtime.js").JSX.Element;
|
|
5
|
+
parameters: {
|
|
6
|
+
layout: string;
|
|
7
|
+
docs: {
|
|
8
|
+
description: {
|
|
9
|
+
component: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
tags: string[];
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
export declare const Default: Story;
|
|
18
|
+
export declare const NotMatchDomain: Story;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{Picture as t}from"../components/index.js";const o="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219",e="https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627",s="https://http.cat/images/200.jpg",a="https://http.cat/images/102.jpg",r={title:"Components/Picture",component:t,parameters:{layout:"centerd",docs:{description:{component:`\u54CD\u5E94\u5F0F\u56FE\u7247\u7EC4\u4EF6, \u652F\u6301\u4F20\u5165\u4E0D\u540C\u5206\u8FA8\u7387\u4E0B\u7684\u56FE\u7247\uFF0C\u6BD4\u5982\uFF0Csource="url1 1920\uFF0C url2 1080, url3 767".
|
|
2
|
+
\u5F53\u56FE\u7247\u5339\u914D\u57DF\u540D\uFF08'cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com'\uFF09\u7684\u65F6\u5019\uFF0C\u4F1A\u81EA\u52A8\u5728\u56FE\u7247url\u540E\u9762\u6DFB\u52A0\u56FE\u7247\u5C3A\u5BF8\u540E\u7F00
|
|
3
|
+
`}}},tags:["autodocs"]};var p=r;const i={args:{source:`${o}, ${e} 768`,imgClassName:"ai-rounded-[24px]"}},m={args:{source:`${s}, ${a} 768`,className:"ai-w-[300px]"},parameters:{docs:{description:{story:"\u56FE\u7247\u4E0D\u5339\u914D\u57DF\u540D"}}}};export{i as Default,m as NotMatchDomain,p as default};
|
|
4
|
+
//# sourceMappingURL=picture.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/stories/picture.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport { Picture } from '../components/index.js'\nconst imageUrl =\n 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/Mask_group_3_f2d0041d-7b54-4d6a-a504-1dbe6c2de6ee.png?v=1718245219'\n\nconst mobImageUrl =\n 'https://cdn.shopify.com/s/files/1/0521/9411/5753/files/1_c67da28a-50c5-4821-8712-330259ea6039.png?v=1718245627'\n\nconst imageUrl2 = 'https://http.cat/images/200.jpg'\nconst mobImageUrl2 = 'https://http.cat/images/102.jpg'\n\nconst meta = {\n title: 'Components/Picture',\n component: Picture,\n parameters: {\n layout: 'centerd',\n docs: {\n description: {\n component: `\u54CD\u5E94\u5F0F\u56FE\u7247\u7EC4\u4EF6, \u652F\u6301\u4F20\u5165\u4E0D\u540C\u5206\u8FA8\u7387\u4E0B\u7684\u56FE\u7247\uFF0C\u6BD4\u5982\uFF0Csource=\"url1 1920\uFF0C url2 1080, url3 767\". \n \u5F53\u56FE\u7247\u5339\u914D\u57DF\u540D\uFF08'cdn.shopify.com', 'cdn.shopifycdn.net', 'www.facebook.com'\uFF09\u7684\u65F6\u5019\uFF0C\u4F1A\u81EA\u52A8\u5728\u56FE\u7247url\u540E\u9762\u6DFB\u52A0\u56FE\u7247\u5C3A\u5BF8\u540E\u7F00\n `,\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Picture>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n source: `${imageUrl}, ${mobImageUrl} 768`,\n imgClassName: 'ai-rounded-[24px]',\n },\n}\n\nexport const NotMatchDomain: Story = {\n args: {\n source: `${imageUrl2}, ${mobImageUrl2} 768`,\n className: 'ai-w-[300px]',\n },\n parameters: {\n docs: {\n description: {\n story: '\u56FE\u7247\u4E0D\u5339\u914D\u57DF\u540D',\n },\n },\n },\n}\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,WAAAA,MAAe,yBACxB,MAAMC,EACJ,4HAEIC,EACJ,iHAEIC,EAAY,kCACZC,EAAe,kCAEfC,EAAO,CACX,MAAO,qBACP,UAAWL,EACX,WAAY,CACV,OAAQ,UACR,KAAM,CACJ,YAAa,CACX,UAAW;AAAA;AAAA,YAGb,CACF,CACF,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOM,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,OAAQ,GAAGN,CAAQ,KAAKC,CAAW,OACnC,aAAc,mBAChB,CACF,EAEaM,EAAwB,CACnC,KAAM,CACJ,OAAQ,GAAGL,CAAS,KAAKC,CAAY,OACrC,UAAW,cACb,EACA,WAAY,CACV,KAAM,CACJ,YAAa,CACX,MAAO,4CACT,CACF,CACF,CACF",
|
|
6
|
+
"names": ["Picture", "imageUrl", "mobImageUrl", "imageUrl2", "mobImageUrl2", "meta", "picture_stories_default", "Default", "NotMatchDomain"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as n}from"react/jsx-runtime";import"react";import{Popover as t,PopoverContent as o,PopoverTrigger as s}from"../components/index";const i={title:"Components/Popover",component:t,subcomponents:{Popover:t,PopoverTrigger:s,PopoverContent:o},parameters:{layout:"centered",docs:{description:{component:"popover\u7EC4\u4EF6\uFF0C\u5728\u4E00\u4E2Aportal\u5C55\u793A\u590D\u6742ui, \u57FA\u4E8E@radix-ui/react-popover, https://www.radix-ui.com/primitives/docs/components/popover"}}},tags:["autodocs"]};var m=i;const d=()=>n(t,{children:[e(s,{asChild:!0,children:e("button",{children:"Open popover"})}),e(o,{className:"ai-w-80 ai-bg-white",side:"right",children:e("div",{className:"ai-grid ai-gap-4",children:e("p",{children:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."})})})]});export{d as Default,m as default};
|
|
1
|
+
import{jsx as e,jsxs as n}from"react/jsx-runtime";import"react";import{Popover as t,PopoverContent as o,PopoverTrigger as s}from"../components/index.js";const i={title:"Components/Popover",component:t,subcomponents:{Popover:t,PopoverTrigger:s,PopoverContent:o},parameters:{layout:"centered",docs:{description:{component:"popover\u7EC4\u4EF6\uFF0C\u5728\u4E00\u4E2Aportal\u5C55\u793A\u590D\u6742ui, \u57FA\u4E8E@radix-ui/react-popover, https://www.radix-ui.com/primitives/docs/components/popover"}}},tags:["autodocs"]};var m=i;const d=()=>n(t,{children:[e(s,{asChild:!0,children:e("button",{children:"Open popover"})}),e(o,{className:"ai-w-80 ai-bg-white",side:"right",children:e("div",{className:"ai-grid ai-gap-4",children:e("p",{children:"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum."})})})]});export{d as Default,m as default};
|
|
2
2
|
//# sourceMappingURL=popover.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/popover.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import React from 'react'\nimport { Popover, PopoverContent, PopoverTrigger } from '../components/index'\nimport type { Meta } from '@storybook/react/*'\n\nconst meta = {\n title: 'Components/Popover',\n component: Popover,\n subcomponents: { Popover, PopoverTrigger, PopoverContent } as any,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component:\n 'popover\u7EC4\u4EF6\uFF0C\u5728\u4E00\u4E2Aportal\u5C55\u793A\u590D\u6742ui, \u57FA\u4E8E@radix-ui/react-popover, https://www.radix-ui.com/primitives/docs/components/popover',\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Popover>\n\nexport default meta\n\nexport const Default = () => (\n <Popover>\n <PopoverTrigger asChild>\n <button>Open popover</button>\n </PopoverTrigger>\n <PopoverContent className=\"ai-w-80 ai-bg-white\" side=\"right\">\n <div className=\"ai-grid ai-gap-4\">\n <p>\n Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to\n make a type specimen book. It has survived not only five centuries, but also the leap into electronic\n typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset\n sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus\n PageMaker including versions of Lorem Ipsum.\n </p>\n </div>\n </PopoverContent>\n </Popover>\n)\n"],
|
|
5
|
-
"mappings": "AAuBE,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAvBF,MAAkB,QAClB,OAAS,WAAAC,EAAS,kBAAAC,EAAgB,kBAAAC,MAAsB,
|
|
4
|
+
"sourcesContent": ["import React from 'react'\nimport { Popover, PopoverContent, PopoverTrigger } from '../components/index.js'\nimport type { Meta } from '@storybook/react/*'\n\nconst meta = {\n title: 'Components/Popover',\n component: Popover,\n subcomponents: { Popover, PopoverTrigger, PopoverContent } as any,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component:\n 'popover\u7EC4\u4EF6\uFF0C\u5728\u4E00\u4E2Aportal\u5C55\u793A\u590D\u6742ui, \u57FA\u4E8E@radix-ui/react-popover, https://www.radix-ui.com/primitives/docs/components/popover',\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Popover>\n\nexport default meta\n\nexport const Default = () => (\n <Popover>\n <PopoverTrigger asChild>\n <button>Open popover</button>\n </PopoverTrigger>\n <PopoverContent className=\"ai-w-80 ai-bg-white\" side=\"right\">\n <div className=\"ai-grid ai-gap-4\">\n <p>\n Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's\n standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to\n make a type specimen book. It has survived not only five centuries, but also the leap into electronic\n typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset\n sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus\n PageMaker including versions of Lorem Ipsum.\n </p>\n </div>\n </PopoverContent>\n </Popover>\n)\n"],
|
|
5
|
+
"mappings": "AAuBE,OAEI,OAAAA,EAFJ,QAAAC,MAAA,oBAvBF,MAAkB,QAClB,OAAS,WAAAC,EAAS,kBAAAC,EAAgB,kBAAAC,MAAsB,yBAGxD,MAAMC,EAAO,CACX,MAAO,qBACP,UAAWH,EACX,cAAe,CAAE,QAAAA,EAAS,eAAAE,EAAgB,eAAAD,CAAe,EACzD,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UACE,+KACJ,CACF,CACF,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOG,EAAQD,EAER,MAAME,EAAU,IACrBN,EAACC,EAAA,CACC,UAAAF,EAACI,EAAA,CAAe,QAAO,GACrB,SAAAJ,EAAC,UAAO,wBAAY,EACtB,EACAA,EAACG,EAAA,CAAe,UAAU,sBAAsB,KAAK,QACnD,SAAAH,EAAC,OAAI,UAAU,mBACb,SAAAA,EAAC,KAAE,0kBAOH,EACF,EACF,GACF",
|
|
6
6
|
"names": ["jsx", "jsxs", "Popover", "PopoverContent", "PopoverTrigger", "meta", "popover_stories_default", "Default"]
|
|
7
7
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react/*';
|
|
2
|
-
import { RadioGroup } from '../components/index';
|
|
3
|
-
import React from 'react';
|
|
2
|
+
import { RadioGroup } from '../components/index.js';
|
|
3
|
+
import React, { type ComponentType } from 'react';
|
|
4
4
|
declare const meta: {
|
|
5
5
|
title: string;
|
|
6
|
-
component: React.ForwardRefExoticComponent<import("../components/radio").RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("../components/radio.js").RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
subcomponents: {
|
|
8
|
-
RadioGroupItem:
|
|
8
|
+
RadioGroupItem: ComponentType<unknown>;
|
|
9
9
|
};
|
|
10
10
|
parameters: {
|
|
11
11
|
layout: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as p,jsx as o,jsxs as t}from"react/jsx-runtime";import{RadioGroup as a,RadioGroupItem as e}from"../components/index";import"react";const i={title:"Components/RadioGroup",component:a,subcomponents:{RadioGroupItem:e},parameters:{layout:"centered",docs:{description:{component:"\u5355\u9009\u6846, \u57FA\u4E8E@radix-ui/react-radio-group https://www.radix-ui.com/primitives/docs/components/radio-group"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"],description:"\u5C3A\u5BF8",table:{defaultValue:{summary:"base"}}}},args:{size:"base"}};var l=i;const m={args:{size:"base",children:t(p,{children:[t("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[o(e,{value:"option-one",id:"option-one"}),o("label",{htmlFor:"option-one",children:"Option One"})]}),t("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[o(e,{value:"option-two",id:"option-two"}),o("label",{htmlFor:"option-two",children:"Option Two"})]})]})}};export{m as Default,l as default};
|
|
1
|
+
import{Fragment as p,jsx as o,jsxs as t}from"react/jsx-runtime";import{RadioGroup as a,RadioGroupItem as e}from"../components/index.js";import"react";const i={title:"Components/RadioGroup",component:a,subcomponents:{RadioGroupItem:e},parameters:{layout:"centered",docs:{description:{component:"\u5355\u9009\u6846, \u57FA\u4E8E@radix-ui/react-radio-group https://www.radix-ui.com/primitives/docs/components/radio-group"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"],description:"\u5C3A\u5BF8",table:{defaultValue:{summary:"base"}}}},args:{size:"base"}};var l=i;const m={args:{size:"base",children:t(p,{children:[t("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[o(e,{value:"option-one",id:"option-one"}),o("label",{htmlFor:"option-one",children:"Option One"})]}),t("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[o(e,{value:"option-two",id:"option-two"}),o("label",{htmlFor:"option-two",children:"Option Two"})]})]})}};export{m as Default,l as default};
|
|
2
2
|
//# sourceMappingURL=radio.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/radio.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react/*'\nimport { RadioGroup, RadioGroupItem } from '../components/index'\nimport React, { type ComponentType } from 'react'\n\nconst meta = {\n title: 'Components/RadioGroup',\n component: RadioGroup,\n subcomponents: { RadioGroupItem: RadioGroupItem as ComponentType<unknown> },\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component:\n '\u5355\u9009\u6846, \u57FA\u4E8E@radix-ui/react-radio-group https://www.radix-ui.com/primitives/docs/components/radio-group',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n description: '\u5C3A\u5BF8',\n table: {\n defaultValue: { summary: 'base' },\n },\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof RadioGroup>\n\nexport default meta\n\ntype Story = StoryObj<typeof RadioGroup>\nexport const Default: Story = {\n args: {\n size: 'base',\n children: (\n <>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <RadioGroupItem value=\"option-one\" id=\"option-one\" />\n <label htmlFor=\"option-one\">Option One</label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <RadioGroupItem value=\"option-two\" id=\"option-two\" />\n <label htmlFor=\"option-two\">Option Two</label>\n </div>\n </>\n ),\n },\n}\n"],
|
|
5
|
-
"mappings": "AA0CM,mBAAAA,EAEI,OAAAC,EADF,QAAAC,MADF,oBAzCN,OAAS,cAAAC,EAAY,kBAAAC,MAAsB,
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react/*'\nimport { RadioGroup, RadioGroupItem } from '../components/index.js'\nimport React, { type ComponentType } from 'react'\n\nconst meta = {\n title: 'Components/RadioGroup',\n component: RadioGroup,\n subcomponents: { RadioGroupItem: RadioGroupItem as ComponentType<unknown> },\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component:\n '\u5355\u9009\u6846, \u57FA\u4E8E@radix-ui/react-radio-group https://www.radix-ui.com/primitives/docs/components/radio-group',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n description: '\u5C3A\u5BF8',\n table: {\n defaultValue: { summary: 'base' },\n },\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof RadioGroup>\n\nexport default meta\n\ntype Story = StoryObj<typeof RadioGroup>\nexport const Default: Story = {\n args: {\n size: 'base',\n children: (\n <>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <RadioGroupItem value=\"option-one\" id=\"option-one\" />\n <label htmlFor=\"option-one\">Option One</label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <RadioGroupItem value=\"option-two\" id=\"option-two\" />\n <label htmlFor=\"option-two\">Option Two</label>\n </div>\n </>\n ),\n },\n}\n"],
|
|
5
|
+
"mappings": "AA0CM,mBAAAA,EAEI,OAAAC,EADF,QAAAC,MADF,oBAzCN,OAAS,cAAAC,EAAY,kBAAAC,MAAsB,yBAC3C,MAA0C,QAE1C,MAAMC,EAAO,CACX,MAAO,wBACP,UAAWF,EACX,cAAe,CAAE,eAAgBC,CAAyC,EAC1E,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UACE,6HACJ,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,OAAQ,IAAI,EAC5B,YAAa,eACb,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,CACF,EACA,KAAM,CACJ,KAAM,MACR,CACF,EAEA,IAAOE,EAAQD,EAGR,MAAME,EAAiB,CAC5B,KAAM,CACJ,KAAM,OACN,SACEL,EAAAF,EAAA,CACE,UAAAE,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACG,EAAA,CAAe,MAAM,aAAa,GAAG,aAAa,EACnDH,EAAC,SAAM,QAAQ,aAAa,sBAAU,GACxC,EACAC,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACG,EAAA,CAAe,MAAM,aAAa,GAAG,aAAa,EACnDH,EAAC,SAAM,QAAQ,aAAa,sBAAU,GACxC,GACF,CAEJ,CACF",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "RadioGroup", "RadioGroupItem", "meta", "radio_stories_default", "Default"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<import("../components/skeleton").SkeletonProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../components/skeleton.js").SkeletonProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
docs: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as i,jsx as e,jsxs as o}from"react/jsx-runtime";import{Skeleton as a}from"../components/index";import"react";const t={title:"Components/Skeleton",component:a,parameters:{layout:"centered",docs:{description:{component:"\u9AA8\u67B6\u5C4F\u7EC4\u4EF6,\u7528\u6765\u5728\u6570\u636E\u52A0\u8F7D\u65F6\u5C55\u793A\u4E00\u4E2A\u5360\u4F4D\u56FE, \u53EF\u4EE5\u5305\u5728dom \u5916\u4F7F\u7528\uFF0C\u901A\u8FC7loading \u63A7\u5236\u663E\u793A\u9690\u85CF, \u4E5F\u53EF\u4EE5\u5355\u72EC\u4F7F\u7528\uFF0C\u901A\u8FC7\u81EA\u5B9A\u4E49class\u63A7\u5236\u6837\u5F0F, \u7EC4\u5408\u6210\u60F3\u8981\u7684\u5F62\u72B6"}}},tags:["autodocs"]};var n=t;const c={args:{loading:!0,children:e("div",{className:"ai-h-14 ai-rounded-3xl ai-overflow-hidden ai-px-4 ai-py-4 w-full",children:"Fog creeps across moors, hills, and rivers. It adds an eerie charm to the landscape, but also complicates driving."})}},d={render(){return o("div",{className:"ai-flex ai-flex-col ai-items-center ai-justify-center",children:[o("div",{className:"ai-flex ai-w-full ai-justify-between",children:[e(a,{className:"ai-size-12 ai-rounded-full"}),e(a,{className:"ai-h-12 ai-w-[70%] "})]}),e(a,{className:"ai-mt-2 ai-h-40 ai-w-[200px]"})]})}},p={render(){return o(i,{children:[e(a,{loading:!0,children:"Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers, and downpours, often accompanied by gray skies."}),e("hr",{}),e(a,{loading:!1,children:"Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers, and downpours, often accompanied by gray skies."})]})}};export{c as Default,d as Multiple,p as WithText,n as default};
|
|
1
|
+
import{Fragment as i,jsx as e,jsxs as o}from"react/jsx-runtime";import{Skeleton as a}from"../components/index.js";import"react";const t={title:"Components/Skeleton",component:a,parameters:{layout:"centered",docs:{description:{component:"\u9AA8\u67B6\u5C4F\u7EC4\u4EF6,\u7528\u6765\u5728\u6570\u636E\u52A0\u8F7D\u65F6\u5C55\u793A\u4E00\u4E2A\u5360\u4F4D\u56FE, \u53EF\u4EE5\u5305\u5728dom \u5916\u4F7F\u7528\uFF0C\u901A\u8FC7loading \u63A7\u5236\u663E\u793A\u9690\u85CF, \u4E5F\u53EF\u4EE5\u5355\u72EC\u4F7F\u7528\uFF0C\u901A\u8FC7\u81EA\u5B9A\u4E49class\u63A7\u5236\u6837\u5F0F, \u7EC4\u5408\u6210\u60F3\u8981\u7684\u5F62\u72B6"}}},tags:["autodocs"]};var n=t;const c={args:{loading:!0,children:e("div",{className:"ai-h-14 ai-rounded-3xl ai-overflow-hidden ai-px-4 ai-py-4 w-full",children:"Fog creeps across moors, hills, and rivers. It adds an eerie charm to the landscape, but also complicates driving."})}},d={render(){return o("div",{className:"ai-flex ai-flex-col ai-items-center ai-justify-center",children:[o("div",{className:"ai-flex ai-w-full ai-justify-between",children:[e(a,{className:"ai-size-12 ai-rounded-full"}),e(a,{className:"ai-h-12 ai-w-[70%] "})]}),e(a,{className:"ai-mt-2 ai-h-40 ai-w-[200px]"})]})}},p={render(){return o(i,{children:[e(a,{loading:!0,children:"Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers, and downpours, often accompanied by gray skies."}),e("hr",{}),e(a,{loading:!1,children:"Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers, and downpours, often accompanied by gray skies."})]})}};export{c as Default,d as Multiple,p as WithText,n as default};
|
|
2
2
|
//# sourceMappingURL=skeleton.stories.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/skeleton.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Skeleton } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Skeleton',\n component: Skeleton,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component:\n '\u9AA8\u67B6\u5C4F\u7EC4\u4EF6,\u7528\u6765\u5728\u6570\u636E\u52A0\u8F7D\u65F6\u5C55\u793A\u4E00\u4E2A\u5360\u4F4D\u56FE, \u53EF\u4EE5\u5305\u5728dom \u5916\u4F7F\u7528\uFF0C\u901A\u8FC7loading \u63A7\u5236\u663E\u793A\u9690\u85CF, \u4E5F\u53EF\u4EE5\u5355\u72EC\u4F7F\u7528\uFF0C\u901A\u8FC7\u81EA\u5B9A\u4E49class\u63A7\u5236\u6837\u5F0F, \u7EC4\u5408\u6210\u60F3\u8981\u7684\u5F62\u72B6',\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Skeleton>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n loading: true,\n children: (\n <div className=\"ai-h-14 ai-rounded-3xl ai-overflow-hidden ai-px-4 ai-py-4 w-full\">\n Fog creeps across moors, hills, and rivers. It adds an eerie charm to the landscape, but also complicates\n driving.\n </div>\n ),\n },\n}\n\nexport const Multiple: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col ai-items-center ai-justify-center\">\n <div className=\"ai-flex ai-w-full ai-justify-between\">\n <Skeleton className=\"ai-size-12 ai-rounded-full\" />\n <Skeleton className=\"ai-h-12 ai-w-[70%] \" />\n </div>\n <Skeleton className=\"ai-mt-2 ai-h-40 ai-w-[200px]\" />\n </div>\n )\n },\n}\n\nexport const WithText: Story = {\n render() {\n return (\n <>\n <Skeleton loading={true}>\n Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers,\n and downpours, often accompanied by gray skies.\n </Skeleton>\n <hr />\n <Skeleton loading={false}>\n Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers,\n and downpours, often accompanied by gray skies.\n </Skeleton>\n </>\n )\n },\n}\n"],
|
|
5
|
-
"mappings": "AA4BM,OAyBA,YAAAA,EAzBA,OAAAC,EAYE,QAAAC,MAZF,oBA1BN,OAAS,YAAAC,MAAgB,
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Skeleton } from '../components/index.js'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Skeleton',\n component: Skeleton,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component:\n '\u9AA8\u67B6\u5C4F\u7EC4\u4EF6,\u7528\u6765\u5728\u6570\u636E\u52A0\u8F7D\u65F6\u5C55\u793A\u4E00\u4E2A\u5360\u4F4D\u56FE, \u53EF\u4EE5\u5305\u5728dom \u5916\u4F7F\u7528\uFF0C\u901A\u8FC7loading \u63A7\u5236\u663E\u793A\u9690\u85CF, \u4E5F\u53EF\u4EE5\u5355\u72EC\u4F7F\u7528\uFF0C\u901A\u8FC7\u81EA\u5B9A\u4E49class\u63A7\u5236\u6837\u5F0F, \u7EC4\u5408\u6210\u60F3\u8981\u7684\u5F62\u72B6',\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Skeleton>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n loading: true,\n children: (\n <div className=\"ai-h-14 ai-rounded-3xl ai-overflow-hidden ai-px-4 ai-py-4 w-full\">\n Fog creeps across moors, hills, and rivers. It adds an eerie charm to the landscape, but also complicates\n driving.\n </div>\n ),\n },\n}\n\nexport const Multiple: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col ai-items-center ai-justify-center\">\n <div className=\"ai-flex ai-w-full ai-justify-between\">\n <Skeleton className=\"ai-size-12 ai-rounded-full\" />\n <Skeleton className=\"ai-h-12 ai-w-[70%] \" />\n </div>\n <Skeleton className=\"ai-mt-2 ai-h-40 ai-w-[200px]\" />\n </div>\n )\n },\n}\n\nexport const WithText: Story = {\n render() {\n return (\n <>\n <Skeleton loading={true}>\n Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers,\n and downpours, often accompanied by gray skies.\n </Skeleton>\n <hr />\n <Skeleton loading={false}>\n Rainfall is a constant companion. Umbrellas are practically a national accessory. Expect drizzles, showers,\n and downpours, often accompanied by gray skies.\n </Skeleton>\n </>\n )\n },\n}\n"],
|
|
5
|
+
"mappings": "AA4BM,OAyBA,YAAAA,EAzBA,OAAAC,EAYE,QAAAC,MAZF,oBA1BN,OAAS,YAAAC,MAAgB,yBACzB,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,sBACP,UAAWD,EACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UACE,wYACJ,CACF,CACF,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOE,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,QAAS,GACT,SACEL,EAAC,OAAI,UAAU,mEAAmE,8HAGlF,CAEJ,CACF,EAEaM,EAAkB,CAC7B,QAAS,CACP,OACEL,EAAC,OAAI,UAAU,wDACb,UAAAA,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,UAAU,6BAA6B,EACjDF,EAACE,EAAA,CAAS,UAAU,sBAAsB,GAC5C,EACAF,EAACE,EAAA,CAAS,UAAU,+BAA+B,GACrD,CAEJ,CACF,EAEaK,EAAkB,CAC7B,QAAS,CACP,OACEN,EAAAF,EAAA,CACE,UAAAC,EAACE,EAAA,CAAS,QAAS,GAAM,uKAGzB,EACAF,EAAC,OAAG,EACJA,EAACE,EAAA,CAAS,QAAS,GAAO,uKAG1B,GACF,CAEJ,CACF",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "Skeleton", "meta", "skeleton_stories_default", "Default", "Multiple", "WithText"]
|
|
7
7
|
}
|
|
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: React.ForwardRefExoticComponent<import("../components/text").TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../components/text.js").TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
docs: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Text as e}from"../components/index";import"react";const r={title:"Typography/Text",component:e,parameters:{layout:"centered",docs:{description:{component:"\u6587\u672C\u7EC4\u4EF6, \u7B80\u5355\u5C01\u88C5\u4E86\u5E38\u7528\u7684\u6837\u5F0F\u5B57\u6BB5\uFF0C\u7528\u4E8E\u5C55\u793A\u6587\u672C\u5185\u5BB9."}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},description:"\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8",options:["none",1,2,3,4,5,6,7,8,9],table:{defaultValue:{summary:"none"}}},weights:{control:{type:"select"},options:["light","normal","medium","bold"],table:{defaultValue:{summary:"normal"}}},align:{control:{type:"select"},options:["left","center","right"],table:{defaultValue:{summary:"left"}}},color:{control:{type:"color"}},as:{control:{type:"select"},description:"html \u6807\u7B7E\u7C7B\u578B",options:["div","label","p","span"],table:{defaultValue:{summary:"span"}}},html:{type:"string",description:"\u76F8\u5F53\u4E8E dangerouslySetInnerHTML"}},args:{size:"none",weights:"normal",align:"left",html:""}};var i=r;const a={args:{children:" The quick brown fox jumps over the lazy dog.",size:"none",weights:"normal"}},p={render(){return t("div",{className:"ai-flex ai-flex-col",children:[o(e,{size:1,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:2,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:3,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:4,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:5,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:6,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:7,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:8,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:9,children:"The quick brown fox jumps over the lazy dog."})]})}},u={render(){return t("div",{className:"ai-flex ai-flex-col",children:[o(e,{weights:"light",children:"The quick brown fox jumps over the lazy dog."}),o(e,{weights:"normal",children:"The quick brown fox jumps over the lazy dog."}),o(e,{weights:"medium",children:"The quick brown fox jumps over the lazy dog."}),o(e,{weights:"bold",children:"The quick brown fox jumps over the lazy dog."})]})}},c={render(){return o(e,{html:`The <span style='font-size:20px;font:bold; -webkit-background-clip: text; background: linear-gradient(
|
|
1
|
+
import{jsx as o,jsxs as t}from"react/jsx-runtime";import{Text as e}from"../components/index.js";import"react";const r={title:"Typography/Text",component:e,parameters:{layout:"centered",docs:{description:{component:"\u6587\u672C\u7EC4\u4EF6, \u7B80\u5355\u5C01\u88C5\u4E86\u5E38\u7528\u7684\u6837\u5F0F\u5B57\u6BB5\uFF0C\u7528\u4E8E\u5C55\u793A\u6587\u672C\u5185\u5BB9."}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},description:"\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8",options:["none",1,2,3,4,5,6,7,8,9],table:{defaultValue:{summary:"none"}}},weights:{control:{type:"select"},options:["light","normal","medium","bold"],table:{defaultValue:{summary:"normal"}}},align:{control:{type:"select"},options:["left","center","right"],table:{defaultValue:{summary:"left"}}},color:{control:{type:"color"}},as:{control:{type:"select"},description:"html \u6807\u7B7E\u7C7B\u578B",options:["div","label","p","span"],table:{defaultValue:{summary:"span"}}},html:{type:"string",description:"\u76F8\u5F53\u4E8E dangerouslySetInnerHTML"}},args:{size:"none",weights:"normal",align:"left",html:""}};var i=r;const a={args:{children:" The quick brown fox jumps over the lazy dog.",size:"none",weights:"normal"}},p={render(){return t("div",{className:"ai-flex ai-flex-col",children:[o(e,{size:1,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:2,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:3,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:4,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:5,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:6,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:7,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:8,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:9,children:"The quick brown fox jumps over the lazy dog."})]})}},u={render(){return t("div",{className:"ai-flex ai-flex-col",children:[o(e,{weights:"light",children:"The quick brown fox jumps over the lazy dog."}),o(e,{weights:"normal",children:"The quick brown fox jumps over the lazy dog."}),o(e,{weights:"medium",children:"The quick brown fox jumps over the lazy dog."}),o(e,{weights:"bold",children:"The quick brown fox jumps over the lazy dog."})]})}},c={render(){return o(e,{html:`The <span style='font-size:20px;font:bold; -webkit-background-clip: text; background: linear-gradient(
|
|
2
2
|
to right,
|
|
3
3
|
#00ff00, /* \u7EFF\u8272 */
|
|
4
4
|
#00ff99, /* \u6D45\u7EFF\u8272 */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/stories/text.stories.tsx"],
|
|
4
|
-
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Text } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Typography/Text',\n component: Text,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u6587\u672C\u7EC4\u4EF6, \u7B80\u5355\u5C01\u88C5\u4E86\u5E38\u7528\u7684\u6837\u5F0F\u5B57\u6BB5\uFF0C\u7528\u4E8E\u5C55\u793A\u6587\u672C\u5185\u5BB9.',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n description: '\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8',\n options: ['none', 1, 2, 3, 4, 5, 6, 7, 8, 9],\n table: {\n defaultValue: { summary: 'none' },\n },\n },\n weights: {\n control: {\n type: 'select',\n },\n options: ['light', 'normal', 'medium', 'bold'],\n table: {\n defaultValue: { summary: 'normal' },\n },\n },\n align: {\n control: {\n type: 'select',\n },\n options: ['left', 'center', 'right'],\n table: {\n defaultValue: { summary: 'left' },\n },\n },\n color: {\n control: {\n type: 'color',\n },\n },\n as: {\n control: {\n type: 'select',\n },\n description: 'html \u6807\u7B7E\u7C7B\u578B',\n options: ['div', 'label', 'p', 'span'],\n table: {\n defaultValue: { summary: 'span' },\n },\n },\n html: {\n type: 'string',\n description: '\u76F8\u5F53\u4E8E dangerouslySetInnerHTML',\n },\n },\n args: {\n size: 'none',\n weights: 'normal',\n align: 'left',\n html: '',\n },\n} satisfies Meta<typeof Text>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n children: ' The quick brown fox jumps over the lazy dog.',\n size: 'none',\n weights: 'normal',\n },\n}\n\nexport const Sizes: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col\">\n <Text size={1}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={2}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={3}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={4}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={5}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={6}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={7}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={8}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={9}>The quick brown fox jumps over the lazy dog.</Text>\n </div>\n )\n },\n}\n\nexport const Weights: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col\">\n <Text weights=\"light\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"normal\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"medium\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"bold\">The quick brown fox jumps over the lazy dog.</Text>\n </div>\n )\n },\n}\n\nexport const Html: Story = {\n render() {\n return (\n <Text\n html={`The <span style='font-size:20px;font:bold; -webkit-background-clip: text; background: linear-gradient(\n to right, \n #00ff00, /* \u7EFF\u8272 */\n #00ff99, /* \u6D45\u7EFF\u8272 */\n #00ffff, /* \u9752\u8272 */\n #0099ff, /* \u6D45\u84DD\u8272 */\n #8000ff, /* \u7D2B\u8272 */\n #ff00ff /* \u7C89\u8272 */\n );color: transparent;background-clip: text;'>quick brown fox</span> <br/> jumps over the lazy dog.`}\n />\n )\n },\n}\n"],
|
|
5
|
-
"mappings": "AAwFM,OACE,OAAAA,EADF,QAAAC,MAAA,oBAtFN,OAAS,QAAAC,MAAY,
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Text } from '../components/index.js'\nimport React from 'react'\n\nconst meta = {\n title: 'Typography/Text',\n component: Text,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u6587\u672C\u7EC4\u4EF6, \u7B80\u5355\u5C01\u88C5\u4E86\u5E38\u7528\u7684\u6837\u5F0F\u5B57\u6BB5\uFF0C\u7528\u4E8E\u5C55\u793A\u6587\u672C\u5185\u5BB9.',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n description: '\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8',\n options: ['none', 1, 2, 3, 4, 5, 6, 7, 8, 9],\n table: {\n defaultValue: { summary: 'none' },\n },\n },\n weights: {\n control: {\n type: 'select',\n },\n options: ['light', 'normal', 'medium', 'bold'],\n table: {\n defaultValue: { summary: 'normal' },\n },\n },\n align: {\n control: {\n type: 'select',\n },\n options: ['left', 'center', 'right'],\n table: {\n defaultValue: { summary: 'left' },\n },\n },\n color: {\n control: {\n type: 'color',\n },\n },\n as: {\n control: {\n type: 'select',\n },\n description: 'html \u6807\u7B7E\u7C7B\u578B',\n options: ['div', 'label', 'p', 'span'],\n table: {\n defaultValue: { summary: 'span' },\n },\n },\n html: {\n type: 'string',\n description: '\u76F8\u5F53\u4E8E dangerouslySetInnerHTML',\n },\n },\n args: {\n size: 'none',\n weights: 'normal',\n align: 'left',\n html: '',\n },\n} satisfies Meta<typeof Text>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n children: ' The quick brown fox jumps over the lazy dog.',\n size: 'none',\n weights: 'normal',\n },\n}\n\nexport const Sizes: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col\">\n <Text size={1}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={2}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={3}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={4}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={5}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={6}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={7}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={8}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={9}>The quick brown fox jumps over the lazy dog.</Text>\n </div>\n )\n },\n}\n\nexport const Weights: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col\">\n <Text weights=\"light\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"normal\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"medium\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"bold\">The quick brown fox jumps over the lazy dog.</Text>\n </div>\n )\n },\n}\n\nexport const Html: Story = {\n render() {\n return (\n <Text\n html={`The <span style='font-size:20px;font:bold; -webkit-background-clip: text; background: linear-gradient(\n to right, \n #00ff00, /* \u7EFF\u8272 */\n #00ff99, /* \u6D45\u7EFF\u8272 */\n #00ffff, /* \u9752\u8272 */\n #0099ff, /* \u6D45\u84DD\u8272 */\n #8000ff, /* \u7D2B\u8272 */\n #ff00ff /* \u7C89\u8272 */\n );color: transparent;background-clip: text;'>quick brown fox</span> <br/> jumps over the lazy dog.`}\n />\n )\n },\n}\n"],
|
|
5
|
+
"mappings": "AAwFM,OACE,OAAAA,EADF,QAAAC,MAAA,oBAtFN,OAAS,QAAAC,MAAY,yBACrB,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,kBACP,UAAWD,EACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,2JACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,YAAa,6LACb,QAAS,CAAC,OAAQ,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EAC3C,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,QAAS,CACP,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,QAAS,SAAU,SAAU,MAAM,EAC7C,MAAO,CACL,aAAc,CAAE,QAAS,QAAS,CACpC,CACF,EACA,MAAO,CACL,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,OAAQ,SAAU,OAAO,EACnC,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,MAAO,CACL,QAAS,CACP,KAAM,OACR,CACF,EACA,GAAI,CACF,QAAS,CACP,KAAM,QACR,EACA,YAAa,gCACb,QAAS,CAAC,MAAO,QAAS,IAAK,MAAM,EACrC,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,KAAM,CACJ,KAAM,SACN,YAAa,4CACf,CACF,EACA,KAAM,CACJ,KAAM,OACN,QAAS,SACT,MAAO,OACP,KAAM,EACR,CACF,EAEA,IAAOE,EAAQD,EAGR,MAAME,EAAiB,CAC5B,KAAM,CACJ,SAAU,gDACV,KAAM,OACN,QAAS,QACX,CACF,EAEaC,EAAe,CAC1B,QAAS,CACP,OACEL,EAAC,OAAI,UAAU,sBACb,UAAAD,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,EAC3DF,EAACE,EAAA,CAAK,KAAM,EAAG,wDAA4C,GAC7D,CAEJ,CACF,EAEaK,EAAiB,CAC5B,QAAS,CACP,OACEN,EAAC,OAAI,UAAU,sBACb,UAAAD,EAACE,EAAA,CAAK,QAAQ,QAAQ,wDAA4C,EAClEF,EAACE,EAAA,CAAK,QAAQ,SAAS,wDAA4C,EACnEF,EAACE,EAAA,CAAK,QAAQ,SAAS,wDAA4C,EACnEF,EAACE,EAAA,CAAK,QAAQ,OAAO,wDAA4C,GACnE,CAEJ,CACF,EAEaM,EAAc,CACzB,QAAS,CACP,OACER,EAACE,EAAA,CACC,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wGASR,CAEJ,CACF",
|
|
6
6
|
"names": ["jsx", "jsxs", "Text", "meta", "text_stories_default", "Default", "Sizes", "Weights", "Html"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@anker-in/headless-ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./dist/cjs/index.js",
|
|
6
6
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"babel-jest": "^29.7.0",
|
|
60
60
|
"esbuild": "^0.20.2",
|
|
61
61
|
"esbuild-style-plugin": "^1.6.3",
|
|
62
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
62
63
|
"eslint-plugin-require-extensions": "^0.1.3",
|
|
63
64
|
"jest": "^29.7.0",
|
|
64
65
|
"jest-environment-jsdom": "^29.7.0",
|
|
@@ -11,14 +11,13 @@ import { cn } from '../helpers/index.js'
|
|
|
11
11
|
* Button Variants
|
|
12
12
|
*/
|
|
13
13
|
const buttonVariants = cva(
|
|
14
|
-
'ai-ring-offset-background focus-visible:ai-ring-ring ai-rounded-btn ai-inline-flex ai-items-center ai-justify-center ai-whitespace-nowrap ai-text-sm ai-font-medium ai-transition-colors focus-visible:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-pointer-events-none
|
|
14
|
+
'ai-ring-offset-background focus-visible:ai-ring-ring ai-rounded-btn ai-inline-flex ai-items-center ai-justify-center ai-whitespace-nowrap ai-text-sm ai-font-medium ai-transition-colors focus-visible:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-pointer-events-none',
|
|
15
15
|
{
|
|
16
16
|
variants: {
|
|
17
17
|
variant: {
|
|
18
|
-
primary:
|
|
19
|
-
'ai-bg-btn-primary ai-text-btn-primary-foreground hover:ai-bg-btn-primary-active disabled:ai-bg-btn-primary-disabled disabled:ai-text-btn-primary-disabled-foreground',
|
|
18
|
+
primary: 'ai-bg-btn-primary ai-text-btn-primary-foreground hover:ai-bg-btn-primary-active ',
|
|
20
19
|
secondary:
|
|
21
|
-
'ai-bg-btn-secondary ai-border-primary ai-text-btn-secondary-foreground hover:ai-bg-btn-secondary-active hover:ai-text-btn-secondary
|
|
20
|
+
'ai-bg-btn-secondary ai-border-primary ai-text-btn-secondary-foreground hover:ai-bg-btn-secondary-active hover:ai-text-btn-secondary ai-border ai-border-solid',
|
|
22
21
|
link: 'ai-text-primary ai-underline-offset-4 hover:ai-underline',
|
|
23
22
|
ghost: 'hover:ai-bg-btn-primary hover:ai-text-btn-primary-foreground',
|
|
24
23
|
},
|
|
@@ -33,6 +32,11 @@ const buttonVariants = cva(
|
|
|
33
32
|
none: '',
|
|
34
33
|
slide: '',
|
|
35
34
|
},
|
|
35
|
+
state: {
|
|
36
|
+
default: '',
|
|
37
|
+
disabled: '!ai-cursor-not-allowed !ai-pointer-events-auto',
|
|
38
|
+
loading: '',
|
|
39
|
+
},
|
|
36
40
|
},
|
|
37
41
|
compoundVariants: [
|
|
38
42
|
{
|
|
@@ -47,11 +51,33 @@ const buttonVariants = cva(
|
|
|
47
51
|
class:
|
|
48
52
|
'ai-z-[1] before:-ai-z-[1] before:ai-rounded-btn hover:!ai-bg-btn-secondary before:ai-bg-btn-secondary-active ai-relative ai-overflow-hidden before:ai-absolute before:ai-inset-y-0 before:ai-w-full before:-ai-translate-x-full before:ai-transition-transform before:ai-duration-300 before:ai-ease-in-out before:ai-content-[""] hover:before:ai-translate-x-0',
|
|
49
53
|
},
|
|
54
|
+
{
|
|
55
|
+
variant: 'primary',
|
|
56
|
+
state: 'loading',
|
|
57
|
+
class: 'ai-bg-btn-primary',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
variant: 'secondary',
|
|
61
|
+
state: 'loading',
|
|
62
|
+
class:
|
|
63
|
+
'ai-bg-btn-secondary disabled:ai-bg-btn-secondary-disabled disabled:ai-text-btn-secondary-disabled-foreground',
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
variant: 'primary',
|
|
67
|
+
state: 'disabled',
|
|
68
|
+
class: 'disabled:ai-bg-btn-primary-disabled disabled:ai-text-btn-primary-disabled-foreground',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
variant: 'secondary',
|
|
72
|
+
state: 'disabled',
|
|
73
|
+
class: 'disabled:ai-bg-btn-secondary-disabled disabled:ai-text-btn-secondary-disabled-foreground',
|
|
74
|
+
},
|
|
50
75
|
],
|
|
51
76
|
defaultVariants: {
|
|
52
77
|
variant: 'primary',
|
|
53
78
|
size: 'base',
|
|
54
79
|
hoverEffect: 'none',
|
|
80
|
+
state: 'default',
|
|
55
81
|
},
|
|
56
82
|
}
|
|
57
83
|
)
|
|
@@ -65,6 +91,9 @@ const loadingSvgVariants = cva('', {
|
|
|
65
91
|
ghost: 'ai-stroke-primary',
|
|
66
92
|
},
|
|
67
93
|
},
|
|
94
|
+
defaultVariants: {
|
|
95
|
+
variant: 'primary',
|
|
96
|
+
},
|
|
68
97
|
})
|
|
69
98
|
|
|
70
99
|
export interface ButtonProps
|
|
@@ -98,17 +127,12 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
|
98
127
|
) => {
|
|
99
128
|
const Comp = asChild ? Slot : 'button'
|
|
100
129
|
const isInactive = disabled || loading
|
|
130
|
+
const state = loading ? 'loading' : disabled ? 'disabled' : 'default'
|
|
101
131
|
|
|
102
132
|
return (
|
|
103
133
|
<Comp
|
|
104
134
|
disabled={isInactive}
|
|
105
|
-
className={cn(
|
|
106
|
-
buttonVariants({ variant, size, hoverEffect }),
|
|
107
|
-
{
|
|
108
|
-
'ai-cursor-not-allowed': isInactive,
|
|
109
|
-
},
|
|
110
|
-
className
|
|
111
|
-
)}
|
|
135
|
+
className={cn(buttonVariants({ variant, size, hoverEffect, state }), className)}
|
|
112
136
|
ref={ref}
|
|
113
137
|
{...props}
|
|
114
138
|
>
|