@anker-in/headless-ui 0.0.11 → 0.0.13
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 +20 -1
- package/README.md +1 -1
- package/dist/cjs/components/checkbox.d.ts +8 -1
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +3 -3
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +2 -2
- package/dist/cjs/components/heading.d.ts +10 -2
- package/dist/cjs/components/heading.js +1 -1
- package/dist/cjs/components/heading.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 +2 -2
- package/dist/cjs/components/input.d.ts +1 -1
- package/dist/cjs/components/input.js.map +1 -1
- package/dist/cjs/components/radio.d.ts +13 -2
- package/dist/cjs/components/radio.js +1 -1
- package/dist/cjs/components/radio.js.map +3 -3
- package/dist/cjs/components/skeleton.d.ts +6 -3
- package/dist/cjs/components/skeleton.js +4 -1
- package/dist/cjs/components/skeleton.js.map +3 -3
- package/dist/cjs/components/text.d.ts +17 -3
- package/dist/cjs/components/text.js +1 -1
- package/dist/cjs/components/text.js.map +3 -3
- package/dist/cjs/stories/checkbox.stories.d.ts +44 -3
- package/dist/cjs/stories/checkbox.stories.js +1 -1
- package/dist/cjs/stories/checkbox.stories.js.map +3 -3
- package/dist/cjs/stories/dialog.stories.d.ts +18 -3
- package/dist/cjs/stories/dialog.stories.js +1 -1
- package/dist/cjs/stories/dialog.stories.js.map +3 -3
- package/dist/cjs/stories/heading.stories.d.ts +70 -0
- package/dist/cjs/stories/heading.stories.js +2 -0
- package/dist/cjs/stories/heading.stories.js.map +7 -0
- package/dist/cjs/stories/input.stories.d.ts +5 -0
- package/dist/cjs/stories/input.stories.js +1 -1
- package/dist/cjs/stories/input.stories.js.map +2 -2
- package/dist/cjs/stories/radio.stories.d.ts +37 -3
- package/dist/cjs/stories/radio.stories.js +1 -1
- package/dist/cjs/stories/radio.stories.js.map +3 -3
- package/dist/cjs/stories/skeleton.stories.d.ts +9 -3
- package/dist/cjs/stories/skeleton.stories.js +1 -1
- package/dist/cjs/stories/skeleton.stories.js.map +3 -3
- package/dist/cjs/stories/text.stories.d.ts +38 -3
- package/dist/cjs/stories/text.stories.js +9 -1
- package/dist/cjs/stories/text.stories.js.map +3 -3
- package/dist/esm/components/checkbox.d.ts +8 -1
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +3 -3
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +2 -2
- package/dist/esm/components/heading.d.ts +10 -2
- package/dist/esm/components/heading.js +1 -1
- package/dist/esm/components/heading.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/input.d.ts +1 -1
- package/dist/esm/components/input.js.map +1 -1
- package/dist/esm/components/radio.d.ts +13 -2
- package/dist/esm/components/radio.js +1 -1
- package/dist/esm/components/radio.js.map +3 -3
- package/dist/esm/components/skeleton.d.ts +6 -3
- package/dist/esm/components/skeleton.js +4 -1
- package/dist/esm/components/skeleton.js.map +3 -3
- package/dist/esm/components/text.d.ts +17 -3
- package/dist/esm/components/text.js +1 -1
- package/dist/esm/components/text.js.map +3 -3
- package/dist/esm/stories/checkbox.stories.d.ts +44 -3
- package/dist/esm/stories/checkbox.stories.js +1 -1
- package/dist/esm/stories/checkbox.stories.js.map +3 -3
- package/dist/esm/stories/dialog.stories.d.ts +18 -3
- package/dist/esm/stories/dialog.stories.js +1 -1
- package/dist/esm/stories/dialog.stories.js.map +3 -3
- package/dist/esm/stories/heading.stories.d.ts +70 -0
- package/dist/esm/stories/heading.stories.js +2 -0
- package/dist/esm/stories/heading.stories.js.map +7 -0
- package/dist/esm/stories/input.stories.d.ts +5 -0
- package/dist/esm/stories/input.stories.js +1 -1
- package/dist/esm/stories/input.stories.js.map +2 -2
- package/dist/esm/stories/radio.stories.d.ts +37 -3
- package/dist/esm/stories/radio.stories.js +1 -1
- package/dist/esm/stories/radio.stories.js.map +3 -3
- package/dist/esm/stories/skeleton.stories.d.ts +9 -3
- package/dist/esm/stories/skeleton.stories.js +1 -1
- package/dist/esm/stories/skeleton.stories.js.map +3 -3
- package/dist/esm/stories/text.stories.d.ts +38 -3
- package/dist/esm/stories/text.stories.js +9 -1
- package/dist/esm/stories/text.stories.js.map +3 -3
- package/package.json +1 -1
- package/src/components/checkbox.tsx +34 -18
- package/src/components/dialog.tsx +1 -0
- package/src/components/heading.tsx +61 -5
- package/src/components/index.ts +1 -0
- package/src/components/input.tsx +1 -1
- package/src/components/radio.tsx +63 -28
- package/src/components/skeleton.tsx +33 -2
- package/src/components/text.tsx +25 -7
- package/src/stories/checkbox.stories.tsx +80 -3
- package/src/stories/dialog.stories.tsx +60 -31
- package/src/stories/heading.stories.tsx +90 -0
- package/src/stories/input.stories.tsx +5 -0
- package/src/stories/radio.stories.tsx +52 -16
- package/src/stories/skeleton.stories.tsx +36 -2
- package/src/stories/text.stories.tsx +74 -13
- package/src/styles/global.css +5 -5
- package/style.css +70 -19
- package/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/dist/esm/tsconfig.tsbuildinfo +0 -1
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
declare const headingVariants: (props?: ({
|
|
4
|
+
size?: "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
|
|
5
|
+
weights?: "bold" | "light" | "normal" | "medium" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
7
|
+
interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {
|
|
8
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
4
9
|
asChild?: boolean;
|
|
10
|
+
color?: string;
|
|
11
|
+
html?: string;
|
|
5
12
|
}
|
|
6
13
|
declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
7
14
|
export { Heading };
|
|
15
|
+
export type { HeadingProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o}from"react/jsx-runtime";import{cn as
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{cn as f}from"../helpers/index.js";import{Slot as c}from"@radix-ui/react-slot";import{cva as P}from"class-variance-authority";import u from"react";const y=P("",{variants:{size:{none:"",1:"ai-text-xs",2:"ai-text-sm",3:"ai-text-base",4:"ai-text-lg",5:"ai-text-xl",6:"ai-text-2xl",7:"ai-text-3xl",8:"ai-text-4xl",9:"ai-text-5xl"},weights:{light:"ai-font-light",normal:"ai-font-normal",medium:"ai-font-medium",bold:"ai-font-bold"}},defaultVariants:{size:"none",weights:"normal"}}),i=u.forwardRef((l,s)=>{const{children:t,className:r,size:m,weights:h,asChild:d,as:g="h1",color:e,html:a,...p}=l,n=a?{dangerouslySetInnerHTML:{__html:a}}:null,x=e?{style:{color:e}}:null;return o(c,{...p,ref:s,className:f(y({size:m,weights:h}),r),...n,...x,children:d?t:o(g,{children:n?null:t})})});i.displayName="Heading";export{i as Heading};
|
|
2
2
|
//# sourceMappingURL=heading.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/heading.tsx"],
|
|
4
|
-
"sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport React from 'react'\n\ntype HeadingElement = React.ElementRef<'h1'>\n\ninterface HeadingProps extends React.ComponentPropsWithoutRef<'h1'> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "cn", "Slot", "React", "Heading", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "headingProps"]
|
|
4
|
+
"sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\n\nconst headingVariants = cva('', {\n variants: {\n size: {\n none: '',\n 1: 'ai-text-xs',\n 2: 'ai-text-sm',\n 3: 'ai-text-base',\n 4: 'ai-text-lg',\n 5: 'ai-text-xl',\n 6: 'ai-text-2xl',\n 7: 'ai-text-3xl',\n 8: 'ai-text-4xl',\n 9: 'ai-text-5xl',\n },\n weights: {\n light: 'ai-font-light',\n normal: 'ai-font-normal',\n medium: 'ai-font-medium',\n bold: 'ai-font-bold',\n },\n },\n defaultVariants: {\n size: 'none',\n weights: 'normal',\n },\n})\n\ntype HeadingElement = React.ElementRef<'h1'>\n\ninterface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n asChild?: boolean\n color?: string\n html?: string\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const { children, className, size, weights, asChild, as: Tag = 'h1', color, html, ...headingProps } = props\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: html },\n }\n : null\n\n const styleProps = color\n ? {\n style: {\n color,\n },\n }\n : null\n return (\n <Slot\n {...headingProps}\n ref={forwardedRef}\n className={cn(\n headingVariants({\n size,\n weights,\n }),\n className\n )}\n {...htmlContentProps}\n {...styleProps}\n >\n {asChild ? children : <Tag>{htmlContentProps ? null : children}</Tag>}\n </Slot>\n )\n})\n\nHeading.displayName = 'Heading'\n\nexport { Heading }\nexport type { HeadingProps }\n"],
|
|
5
|
+
"mappings": "AAsE4B,cAAAA,MAAA,oBAtE5B,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAW,QAElB,MAAMC,EAAkBF,EAAI,GAAI,CAC9B,SAAU,CACR,KAAM,CACJ,KAAM,GACN,EAAG,aACH,EAAG,aACH,EAAG,eACH,EAAG,aACH,EAAG,aACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,aACL,EACA,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,OAAQ,iBACR,KAAM,cACR,CACF,EACA,gBAAiB,CACf,KAAM,OACN,QAAS,QACX,CACF,CAAC,EAWKG,EAAUF,EAAM,WAAyC,CAACG,EAAOC,IAAiB,CACtF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,KAAAC,EAAM,QAAAC,EAAS,QAAAC,EAAS,GAAIC,EAAM,KAAM,MAAAC,EAAO,KAAAC,EAAM,GAAGC,CAAa,EAAIV,EAChGW,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACA,KAEEG,EAAaJ,EACf,CACE,MAAO,CACL,MAAAA,CACF,CACF,EACA,KACJ,OACEf,EAACE,EAAA,CACE,GAAGe,EACJ,IAAKT,EACL,UAAWP,EACTI,EAAgB,CACd,KAAAM,EACA,QAAAC,CACF,CAAC,EACDF,CACF,EACC,GAAGQ,EACH,GAAGC,EAEH,SAAAN,EAAUJ,EAAWT,EAACc,EAAA,CAAK,SAAAI,EAAmB,KAAOT,EAAS,EACjE,CAEJ,CAAC,EAEDH,EAAQ,YAAc",
|
|
6
|
+
"names": ["jsx", "cn", "Slot", "cva", "React", "headingVariants", "Heading", "props", "forwardedRef", "children", "className", "size", "weights", "asChild", "Tag", "color", "html", "headingProps", "htmlContentProps", "styleProps"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{default as
|
|
1
|
+
import{default as e}from"./button.js";import{default as f}from"./badge.js";export*from"./input.js";import{default as p}from"./checkbox.js";import{default as d}from"./skeleton.js";export*from"./dialog.js";export*from"./popover.js";export*from"./radio.js";export*from"./dialog.js";export*from"./text.js";export*from"./heading.js";import{default as b}from"./theme.js";export{f as Badge,e as Button,p as Checkbox,d as Skeleton,b as Theme};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/index.ts"],
|
|
4
|
-
"sourcesContent": ["// theme\n// export { default as Theme } from './theme'\n\n// components\nexport { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport * from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport * from './dialog.js'\nexport * from './popover.js'\nexport * from './radio.js'\nexport * from './dialog.js'\nexport * from './text.js'\nexport { default as Theme } from './theme.js'\n"],
|
|
5
|
-
"mappings": "AAIA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,WAAc,aAEd,OAAoB,WAAXA,MAA2B,gBAEpC,OAAoB,WAAXA,MAA2B,gBACpC,WAAc,cACd,WAAc,eACd,WAAc,aACd,WAAc,cACd,WAAc,YACd,OAAoB,WAAXA,MAAwB",
|
|
4
|
+
"sourcesContent": ["// theme\n// export { default as Theme } from './theme'\n\n// components\nexport { default as Button } from './button.js'\nexport { default as Badge } from './badge.js'\nexport * from './input.js'\n\nexport { default as Checkbox } from './checkbox.js'\n\nexport { default as Skeleton } from './skeleton.js'\nexport * from './dialog.js'\nexport * from './popover.js'\nexport * from './radio.js'\nexport * from './dialog.js'\nexport * from './text.js'\nexport * from './heading.js'\nexport { default as Theme } from './theme.js'\n"],
|
|
5
|
+
"mappings": "AAIA,OAAoB,WAAXA,MAAyB,cAClC,OAAoB,WAAXA,MAAwB,aACjC,WAAc,aAEd,OAAoB,WAAXA,MAA2B,gBAEpC,OAAoB,WAAXA,MAA2B,gBACpC,WAAc,cACd,WAAc,eACd,WAAc,aACd,WAAc,cACd,WAAc,YACd,WAAc,eACd,OAAoB,WAAXA,MAAwB",
|
|
6
6
|
"names": ["default"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { ComponentPropsWithout, RemovedProps } from '
|
|
2
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
3
3
|
import { type VariantProps } from 'class-variance-authority';
|
|
4
4
|
declare const inputVariants: (props?: ({
|
|
5
5
|
size?: "sm" | "lg" | "base" | null | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/input.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n 'ai-border-input ai-bg-background focus-visible:ai-ring-ring ai-ring-offset-background ai-flex ai-flex-row ai-items-center ai-overflow-hidden ai-rounded-md ai-border ai-px-3 focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2',\n {\n variants: {\n size: {\n sm: 'ai-h-8',\n base: 'ai-h-10',\n lg: 'ai-h-12',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\nexport interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {}\n\ntype InputSlotElement = React.ElementRef<'div'>\ninterface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {\n /**\n * \u63D2\u69FD\u7684\u4F4D\u7F6E\n */\n side: 'left' | 'right'\n}\n\n/**\n * InputSlot\n * \u7528\u6765\u5728 Input \u7EC4\u4EF6\u4E2D\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9\uFF0C\u6BD4\u5982icon \uFF0C\u6309\u94AE\n */\nconst InputSlot = React.forwardRef<InputSlotElement, InputSlotProps>((props, forwardedRef) => {\n const { className, side, children, ...slotProps } = props\n\n return (\n <div\n ref={forwardedRef}\n {...slotProps}\n className={cn('ai-flex ai-h-full ai-items-center ai-px-2', className, {\n '-ai-order-1 ai-pl-0': side === 'left',\n 'ai-order-2 ai-pr-0': side === 'right',\n })}\n >\n {children}\n </div>\n )\n})\n\nconst Input = React.forwardRef<React.ElementRef<'input'>, InputProps>(\n ({ className, type, size, children, ...props }, ref) => {\n return (\n <div className={cn(inputVariants({ size }), className)}>\n <input\n type={type}\n className={cn(\n 'placeholder:ai-text-muted-foreground ai-flex ai-size-full ai-text-sm file:ai-border-0 file:ai-bg-transparent file:ai-text-sm file:ai-font-medium focus-visible:ai-outline-none disabled:ai-cursor-not-allowed disabled:ai-opacity-50'\n )}\n ref={ref}\n {...props}\n />\n {children}\n </div>\n )\n }\n)\nInput.displayName = 'Input'\nInputSlot.displayName = 'InputSlot'\n\nexport { Input, InputSlot }\n"],
|
|
5
5
|
"mappings": "aAyCI,cAAAA,EAgBE,QAAAC,MAhBF,oBAvCJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAgBD,EACpB,sOACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,SACJ,KAAM,UACN,GAAI,SACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAgBME,EAAYJ,EAAM,WAA6C,CAACK,EAAOC,IAAiB,CAC5F,KAAM,CAAE,UAAAC,EAAW,KAAAC,EAAM,SAAAC,EAAU,GAAGC,CAAU,EAAIL,EAEpD,OACEP,EAAC,OACC,IAAKQ,EACJ,GAAGI,EACJ,UAAWT,EAAG,4CAA6CM,EAAW,CACpE,sBAAuBC,IAAS,OAChC,qBAAsBA,IAAS,OACjC,CAAC,EAEA,SAAAC,EACH,CAEJ,CAAC,EAEKE,EAAQX,EAAM,WAClB,CAAC,CAAE,UAAAO,EAAW,KAAAK,EAAM,KAAAC,EAAM,SAAAJ,EAAU,GAAGJ,CAAM,EAAGS,IAE5Cf,EAAC,OAAI,UAAWE,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAGN,CAAS,EACnD,UAAAT,EAAC,SACC,KAAMc,EACN,UAAWX,EACT,sOACF,EACA,IAAKa,EACJ,GAAGT,EACN,EACCI,GACH,CAGN,EACAE,EAAM,YAAc,QACpBP,EAAU,YAAc",
|
|
6
6
|
"names": ["jsx", "jsxs", "React", "cn", "cva", "inputVariants", "InputSlot", "props", "forwardedRef", "className", "side", "children", "slotProps", "Input", "type", "size", "ref"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
3
|
-
|
|
4
|
-
declare const
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const radioGroupVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "lg" | "base" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
7
|
+
interface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {
|
|
8
|
+
/** 尺寸 */
|
|
9
|
+
size?: 'sm' | 'base' | 'lg';
|
|
10
|
+
}
|
|
11
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
interface RadioGroupItemProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>, VariantProps<typeof radioGroupVariants> {
|
|
13
|
+
}
|
|
14
|
+
declare const RadioGroupItem: React.ForwardRefExoticComponent<RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
15
|
export { RadioGroup, RadioGroupItem };
|
|
16
|
+
export type { RadioGroupProps, RadioGroupItemProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import*as e from"react";import*as p from"@radix-ui/react-radio-group";import{CheckIcon as c}from"@radix-ui/react-icons";import{cva as f}from"class-variance-authority";import{cn as d}from"../helpers/index.js";const n=e.createContext({size:"base"}),R=f("ai-border-primary ai-text-primary ai-ring-offset-background focus-visible:ai-ring-ring ai-aspect-square ai-rounded-full ai-border focus:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-cursor-not-allowed disabled:ai-opacity-50 data-[state=checked]:ai-bg-primary data-[state=checked]:ai-text-primary-foreground",{variants:{size:{sm:"ai-size-[14px]",base:"ai-size-4",lg:"ai-size-5"}},defaultVariants:{size:"base"}}),m=e.forwardRef(({className:o,children:a,size:r,...t},s)=>i(p.Root,{className:d("grid gap-2",o),...t,ref:s,children:i(n.Provider,{value:{size:r},children:a})}));m.displayName="RadioGroup";const u=e.forwardRef(({className:o,size:a,...r},t)=>{const{size:s}=e.useContext(n);return i(p.Item,{ref:t,className:d(R({size:a??s}),o),...r,children:i(p.Indicator,{className:"ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full",children:i(c,{})})})});u.displayName="RadioGroupItem";export{m as RadioGroup,u as RadioGroupItem};
|
|
2
2
|
//# sourceMappingURL=radio.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/radio.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { CheckIcon } from '@radix-ui/react-icons'\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "React", "RadioGroupPrimitive", "CheckIcon", "cn", "RadioGroup", "className", "props", "ref", "RadioGroupItem"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { CheckIcon } from '@radix-ui/react-icons'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\nconst RadioContext = React.createContext<{ size?: 'sm' | 'base' | 'lg' }>({\n size: 'base',\n})\n\nconst radioGroupVariants = cva(\n 'ai-border-primary ai-text-primary ai-ring-offset-background focus-visible:ai-ring-ring ai-aspect-square ai-rounded-full ai-border focus:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-cursor-not-allowed disabled:ai-opacity-50 data-[state=checked]:ai-bg-primary data-[state=checked]:ai-text-primary-foreground',\n {\n variants: {\n size: {\n sm: 'ai-size-[14px]',\n base: 'ai-size-4',\n lg: 'ai-size-5',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\ninterface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** \u5C3A\u5BF8 */\n size?: 'sm' | 'base' | 'lg'\n}\n\nconst RadioGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioGroupProps>(\n ({ className, children, size, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref}>\n <RadioContext.Provider value={{ size }}>{children}</RadioContext.Provider>\n </RadioGroupPrimitive.Root>\n )\n }\n)\nRadioGroup.displayName = 'RadioGroup'\n\ninterface RadioGroupItemProps\n extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n VariantProps<typeof radioGroupVariants> {}\n\nconst RadioGroupItem = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioGroupItemProps>(\n ({ className, size, ...props }, ref) => {\n const { size: sizeFromParent } = React.useContext(RadioContext)\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n radioGroupVariants({\n size: size ?? sizeFromParent,\n }),\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full\">\n <CheckIcon />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n }\n)\nRadioGroupItem.displayName = 'RadioGroupItem'\n\nexport { RadioGroup, RadioGroupItem }\nexport type { RadioGroupProps, RadioGroupItemProps }\n"],
|
|
5
|
+
"mappings": "aAqCQ,cAAAA,MAAA,oBAnCR,UAAYC,MAAW,QACvB,UAAYC,MAAyB,8BACrC,OAAS,aAAAC,MAAiB,wBAC1B,OAAS,OAAAC,MAA8B,2BACvC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAeL,EAAM,cAA+C,CACxE,KAAM,MACR,CAAC,EAEKM,EAAqBH,EACzB,0VACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,iBACJ,KAAM,YACN,GAAI,WACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAOMI,EAAaP,EAAM,WACvB,CAAC,CAAE,UAAAQ,EAAW,SAAAC,EAAU,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IAEtCb,EAACE,EAAoB,KAApB,CAAyB,UAAWG,EAAG,aAAcI,CAAS,EAAI,GAAGG,EAAO,IAAKC,EAChF,SAAAb,EAACM,EAAa,SAAb,CAAsB,MAAO,CAAE,KAAAK,CAAK,EAAI,SAAAD,EAAS,EACpD,CAGN,EACAF,EAAW,YAAc,aAMzB,MAAMM,EAAiBb,EAAM,WAC3B,CAAC,CAAE,UAAAQ,EAAW,KAAAE,EAAM,GAAGC,CAAM,EAAGC,IAAQ,CACtC,KAAM,CAAE,KAAME,CAAe,EAAId,EAAM,WAAWK,CAAY,EAC9D,OACEN,EAACE,EAAoB,KAApB,CACC,IAAKW,EACL,UAAWR,EACTE,EAAmB,CACjB,KAAMI,GAAQI,CAChB,CAAC,EACDN,CACF,EACC,GAAGG,EAEJ,SAAAZ,EAACE,EAAoB,UAApB,CAA8B,UAAU,gFACvC,SAAAF,EAACG,EAAA,EAAU,EACb,EACF,CAEJ,CACF,EACAW,EAAe,YAAc",
|
|
6
|
+
"names": ["jsx", "React", "RadioGroupPrimitive", "CheckIcon", "cva", "cn", "RadioContext", "radioGroupVariants", "RadioGroup", "className", "children", "size", "props", "ref", "RadioGroupItem", "sizeFromParent"]
|
|
7
7
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
3
|
+
interface SkeletonProps extends ComponentPropsWithout<'span', RemovedProps> {
|
|
4
|
+
/** 是否正在加载 , 默认是true*/
|
|
5
|
+
loading?: boolean;
|
|
5
6
|
}
|
|
7
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
8
|
export default Skeleton;
|
|
9
|
+
export type { SkeletonProps };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as m}from"react/jsx-runtime";import*as n from"react";import{cn as p}from"../helpers/index.js";import{Slot as d}from"@radix-ui/react-slot";const o=n.forwardRef((t,a)=>{const{children:e,className:i,loading:r=!0,...l}=t;if(!r)return e;const s=n.isValidElement(e)?d:"span";return m(s,{ref:a,className:p(`ai-bg-skeleton ai-animate-pulse empty:ai-block data-[inline-skeleton=true]:ai-leading-[0] !ai-bg-none !ai-bg-clip-border !ai-border-none !ai-shadow-none
|
|
2
|
+
!ai-text-transparent !ai-outline-none !ai-select-none !ai-cursor-default !ai-pointer-events-none !ai-decoration-clone
|
|
3
|
+
after:!ai-invisible before:!ai-invisible [&>*]:!ai-invisible
|
|
4
|
+
`,i),"data-inline-skeleton":n.isValidElement(e)?void 0:!0,tabIndex:-1,...l,children:e})});o.displayName="Skeleton";var b=o;export{b as default};
|
|
2
5
|
//# sourceMappingURL=skeleton.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/skeleton.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\nimport { cn } from '../helpers/index.js'\n\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "cn", "Skeleton", "className", "
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\ntype SkeletonElement = React.ElementRef<'span'>\n\ninterface SkeletonProps extends ComponentPropsWithout<'span', RemovedProps> {\n /** \u662F\u5426\u6B63\u5728\u52A0\u8F7D , \u9ED8\u8BA4\u662Ftrue*/\n loading?: boolean\n}\n\nconst Skeleton = React.forwardRef<SkeletonElement, SkeletonProps>((props, forwardedRef) => {\n const { children, className, loading = true, ...skeletonProps } = props\n\n if (!loading) return children\n const Tag = React.isValidElement(children) ? Slot : 'span'\n\n return (\n <Tag\n ref={forwardedRef}\n className={cn(\n `ai-bg-skeleton ai-animate-pulse empty:ai-block data-[inline-skeleton=true]:ai-leading-[0] !ai-bg-none !ai-bg-clip-border !ai-border-none !ai-shadow-none \n !ai-text-transparent !ai-outline-none !ai-select-none !ai-cursor-default !ai-pointer-events-none !ai-decoration-clone\n after:!ai-invisible before:!ai-invisible [&>*]:!ai-invisible\n `,\n className\n )}\n data-inline-skeleton={React.isValidElement(children) ? undefined : true}\n tabIndex={-1}\n {...skeletonProps}\n >\n {children}\n </Tag>\n )\n})\n\nSkeleton.displayName = 'Skeleton'\n\nexport default Skeleton\nexport type { SkeletonProps }\n"],
|
|
5
|
+
"mappings": "AAmBI,cAAAA,MAAA,oBAnBJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBAUrB,MAAMC,EAAWH,EAAM,WAA2C,CAACI,EAAOC,IAAiB,CACzF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,GAAM,GAAGC,CAAc,EAAIL,EAElE,GAAI,CAACI,EAAS,OAAOF,EACrB,MAAMI,EAAMV,EAAM,eAAeM,CAAQ,EAAIJ,EAAO,OAEpD,OACEH,EAACW,EAAA,CACC,IAAKL,EACL,UAAWJ,EACT;AAAA;AAAA;AAAA,UAIAM,CACF,EACA,uBAAsBP,EAAM,eAAeM,CAAQ,EAAI,OAAY,GACnE,SAAU,GACT,GAAGG,EAEH,SAAAH,EACH,CAEJ,CAAC,EAEDH,EAAS,YAAc,WAEvB,IAAOQ,EAAQR",
|
|
6
|
+
"names": ["jsx", "React", "cn", "Slot", "Skeleton", "props", "forwardedRef", "children", "className", "loading", "skeletonProps", "Tag", "skeleton_default"]
|
|
7
7
|
}
|
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
3
4
|
declare const textVariants: (props?: ({
|
|
4
|
-
size?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
|
|
5
|
+
size?: "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
|
|
5
6
|
weights?: "bold" | "light" | "normal" | "medium" | null | undefined;
|
|
6
7
|
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
7
|
-
|
|
8
|
-
as?: '
|
|
8
|
+
type TextSpanProps = {
|
|
9
|
+
as?: 'span';
|
|
10
|
+
} & ComponentPropsWithout<'span', RemovedProps>;
|
|
11
|
+
type TextDivProps = {
|
|
12
|
+
as: 'div';
|
|
13
|
+
} & ComponentPropsWithout<'div', RemovedProps>;
|
|
14
|
+
type TextLabelProps = {
|
|
15
|
+
as: 'label';
|
|
16
|
+
} & ComponentPropsWithout<'label', RemovedProps>;
|
|
17
|
+
type TextPProps = {
|
|
18
|
+
as: 'p';
|
|
19
|
+
} & ComponentPropsWithout<'p', RemovedProps>;
|
|
20
|
+
interface CommonTextProps extends VariantProps<typeof textVariants> {
|
|
21
|
+
as?: 'div' | 'label' | 'p' | 'span';
|
|
9
22
|
asChild?: boolean;
|
|
10
23
|
color?: string;
|
|
11
24
|
/** 相当于 dangerouslySetInnerHTML */
|
|
12
25
|
html?: string;
|
|
13
26
|
}
|
|
27
|
+
type TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);
|
|
14
28
|
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
15
29
|
export { Text };
|
|
16
30
|
export type { TextProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as p}from"react/jsx-runtime";import*as h from"react";import{Slot as f}from"@radix-ui/react-slot";import{cn as c}from"../helpers/index.js";import{cva as y}from"class-variance-authority";const u=y("",{variants:{size:{none:"",1:"ai-text-xs",2:"ai-text-sm",3:"ai-text-base",4:"ai-text-lg",5:"ai-text-xl",6:"ai-text-2xl",7:"ai-text-3xl",8:"ai-text-4xl",9:"ai-text-5xl"},weights:{light:"ai-font-light",normal:"ai-font-normal",medium:"ai-font-medium",bold:"ai-font-bold"}},defaultVariants:{size:"none",weights:"normal"}}),a=h.forwardRef((n,r)=>{const{children:t,size:i="none",weights:l,className:m,asChild:x,as:P="span",color:e,html:o,...d}=n,s=o?{dangerouslySetInnerHTML:{__html:o}}:null,T=e?{style:{color:e}}:null;return p(f,{...d,ref:r,className:c(u({size:i,weights:l}),m),...s,...T,children:x?t:p(P,{children:s?null:t})})});a.displayName="Text";export{a as Text};
|
|
2
2
|
//# sourceMappingURL=text.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/text.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nconst textVariants = cva('', {\n variants: {\n size: {\n 1: 'ai-text-xs',\n 2: 'ai-text-sm',\n 3: 'ai-text-base',\n 4: 'ai-text-lg',\n 5: 'ai-text-xl',\n 6: 'ai-text-2xl',\n 7: 'ai-text-3xl',\n 8: 'ai-text-4xl',\n 9: 'ai-text-5xl',\n },\n weights: {\n light: 'ai-font-light',\n normal: 'ai-font-normal',\n medium: 'ai-font-medium',\n bold: 'ai-font-bold',\n },\n },\n defaultVariants: {\n size:
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "React", "Slot", "cn", "cva", "textVariants", "Text", "props", "forwardedRef", "children", "size", "className", "asChild", "Tag", "color", "html", "textProps", "htmlContentProps"]
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\nconst textVariants = cva('', {\n variants: {\n size: {\n none: '',\n 1: 'ai-text-xs',\n 2: 'ai-text-sm',\n 3: 'ai-text-base',\n 4: 'ai-text-lg',\n 5: 'ai-text-xl',\n 6: 'ai-text-2xl',\n 7: 'ai-text-3xl',\n 8: 'ai-text-4xl',\n 9: 'ai-text-5xl',\n },\n weights: {\n light: 'ai-font-light',\n normal: 'ai-font-normal',\n medium: 'ai-font-medium',\n bold: 'ai-font-bold',\n },\n },\n defaultVariants: {\n size: 'none',\n weights: 'normal',\n },\n})\n\ntype TextElement = React.ElementRef<'span'>\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>\n\ninterface CommonTextProps extends VariantProps<typeof textVariants> {\n as?: 'div' | 'label' | 'p' | 'span'\n asChild?: boolean\n color?: string\n /** \u76F8\u5F53\u4E8E dangerouslySetInnerHTML */\n html?: string\n}\n\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps)\n\nconst Text = React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const { children, size = 'none', weights, className, asChild, as: Tag = 'span', color, html, ...textProps } = props\n\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: html },\n }\n : null\n\n const styleProps = color\n ? {\n style: {\n color,\n },\n }\n : null\n\n return (\n <Slot\n {...textProps}\n ref={forwardedRef}\n className={cn(\n textVariants({\n size,\n weights,\n }),\n className\n )}\n {...htmlContentProps}\n {...styleProps}\n >\n {asChild ? children : <Tag>{htmlContentProps ? null : children}</Tag>}\n </Slot>\n )\n})\nText.displayName = 'Text'\n\nexport { Text }\nexport type { TextProps }\n"],
|
|
5
|
+
"mappings": "AAgF4B,cAAAA,MAAA,oBAhF5B,UAAYC,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,MAAAC,MAAU,sBACnB,OAA4B,OAAAC,MAAW,2BAGvC,MAAMC,EAAeD,EAAI,GAAI,CAC3B,SAAU,CACR,KAAM,CACJ,KAAM,GACN,EAAG,aACH,EAAG,aACH,EAAG,eACH,EAAG,aACH,EAAG,aACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,aACL,EACA,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,OAAQ,iBACR,KAAM,cACR,CACF,EACA,gBAAiB,CACf,KAAM,OACN,QAAS,QACX,CACF,CAAC,EAkBKE,EAAOL,EAAM,WAAmC,CAACM,EAAOC,IAAiB,CAC7E,KAAM,CAAE,SAAAC,EAAU,KAAAC,EAAO,OAAQ,QAAAC,EAAS,UAAAC,EAAW,QAAAC,EAAS,GAAIC,EAAM,OAAQ,MAAAC,EAAO,KAAAC,EAAM,GAAGC,CAAU,EAAIV,EAExGW,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACA,KAEEG,EAAaJ,EACf,CACE,MAAO,CACL,MAAAA,CACF,CACF,EACA,KAEJ,OACEf,EAACE,EAAA,CACE,GAAGe,EACJ,IAAKT,EACL,UAAWL,EACTE,EAAa,CACX,KAAAK,EACA,QAAAC,CACF,CAAC,EACDC,CACF,EACC,GAAGM,EACH,GAAGC,EAEH,SAAAN,EAAUJ,EAAWT,EAACc,EAAA,CAAK,SAAAI,EAAmB,KAAOT,EAAS,EACjE,CAEJ,CAAC,EACDH,EAAK,YAAc",
|
|
6
|
+
"names": ["jsx", "React", "Slot", "cn", "cva", "textVariants", "Text", "props", "forwardedRef", "children", "size", "weights", "className", "asChild", "Tag", "color", "html", "textProps", "htmlContentProps", "styleProps"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,46 @@
|
|
|
1
|
-
|
|
1
|
+
import type { StoryObj } from '@storybook/react/*';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
2
4
|
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../components/checkbox").CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
argTypes: {
|
|
16
|
+
size: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "select";
|
|
19
|
+
};
|
|
20
|
+
options: string[];
|
|
21
|
+
description: string;
|
|
22
|
+
table: {
|
|
23
|
+
defaultValue: {
|
|
24
|
+
summary: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
args: {
|
|
30
|
+
size: "base";
|
|
31
|
+
};
|
|
3
32
|
};
|
|
4
|
-
export default
|
|
5
|
-
|
|
33
|
+
export default meta;
|
|
34
|
+
type Story = StoryObj<typeof meta>;
|
|
35
|
+
export declare const Default: Story;
|
|
36
|
+
export declare const Sizes: {
|
|
37
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
parameters: {
|
|
39
|
+
docs: {
|
|
40
|
+
description: {
|
|
41
|
+
story: string;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const Disabled: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as
|
|
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};
|
|
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 { Checkbox } from '../components/index'\nimport React from 'react'\n\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "Checkbox", "checkbox_stories_default", "Default"]
|
|
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,sBACzB,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
|
+
"names": ["jsx", "jsxs", "Checkbox", "meta", "checkbox_stories_default", "Default", "Sizes", "Disabled"]
|
|
7
7
|
}
|
|
@@ -1,5 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Dialog } from '../components/index';
|
|
3
|
+
import type { StoryObj } from '@storybook/react/*';
|
|
4
|
+
declare const meta: {
|
|
2
5
|
title: string;
|
|
6
|
+
component: React.FC<import("@radix-ui/react-dialog").DialogProps>;
|
|
7
|
+
subcomponents: any;
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: string;
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component: string;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
tags: string[];
|
|
3
17
|
};
|
|
4
|
-
export default
|
|
5
|
-
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof Dialog>;
|
|
20
|
+
export declare const Default: Story;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as a,jsxs as e}from"react/jsx-runtime";import"react";import{Button as
|
|
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};
|
|
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'\n\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "Button", "Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger", "Input", "dialog_stories_default", "Default"]
|
|
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,sBAGP,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
|
+
"names": ["Fragment", "jsx", "jsxs", "Button", "Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger", "Input", "meta", "dialog_stories_default", "Default"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../components/heading").HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
tags: string[];
|
|
15
|
+
argTypes: {
|
|
16
|
+
size: {
|
|
17
|
+
control: {
|
|
18
|
+
type: "select";
|
|
19
|
+
};
|
|
20
|
+
options: (string | number)[];
|
|
21
|
+
description: string;
|
|
22
|
+
table: {
|
|
23
|
+
defaultValue: {
|
|
24
|
+
summary: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
weights: {
|
|
29
|
+
control: {
|
|
30
|
+
type: "select";
|
|
31
|
+
};
|
|
32
|
+
options: string[];
|
|
33
|
+
table: {
|
|
34
|
+
defaultValue: {
|
|
35
|
+
summary: string;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
color: {
|
|
40
|
+
control: {
|
|
41
|
+
type: "color";
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
as: {
|
|
45
|
+
control: {
|
|
46
|
+
type: "select";
|
|
47
|
+
};
|
|
48
|
+
options: string[];
|
|
49
|
+
description: string;
|
|
50
|
+
table: {
|
|
51
|
+
defaultValue: {
|
|
52
|
+
summary: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
html: {
|
|
57
|
+
type: "string";
|
|
58
|
+
description: string;
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
args: {
|
|
62
|
+
as: "h1";
|
|
63
|
+
size: "none";
|
|
64
|
+
weights: "normal";
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
export default meta;
|
|
68
|
+
type Story = StoryObj<typeof meta>;
|
|
69
|
+
export declare const Default: Story;
|
|
70
|
+
export declare const All: Story;
|
|
@@ -0,0 +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"}}},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"}};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
|
+
//# sourceMappingURL=heading.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 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 },\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": "AA6EI,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBA3EJ,OAAS,WAAAC,MAAe,sBACxB,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,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,QACX,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
|
+
"names": ["Fragment", "jsx", "jsxs", "Heading", "meta", "heading_stories_default", "Default", "All"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as t}from"react/jsx-runtime";import{Button as
|
|
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};
|
|
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 },\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": "
|
|
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,sBACzC,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
|
}
|