@anker-in/headless-ui 0.0.11 → 0.0.12
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 +6 -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/heading.d.ts +9 -1
- 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.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/heading.stories.d.ts +68 -0
- package/dist/cjs/stories/heading.stories.js +2 -0
- package/dist/cjs/stories/heading.stories.js.map +7 -0
- package/dist/cjs/stories/radio.stories.d.ts +34 -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 +33 -1
- package/dist/cjs/stories/text.stories.js +9 -1
- package/dist/cjs/stories/text.stories.js.map +3 -3
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- 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/heading.d.ts +9 -1
- 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.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/heading.stories.d.ts +68 -0
- package/dist/esm/stories/heading.stories.js +2 -0
- package/dist/esm/stories/heading.stories.js.map +7 -0
- package/dist/esm/stories/radio.stories.d.ts +34 -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 +33 -1
- package/dist/esm/stories/text.stories.js +9 -1
- package/dist/esm/stories/text.stories.js.map +3 -3
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/checkbox.tsx +33 -17
- package/src/components/heading.tsx +59 -4
- package/src/components/index.ts +1 -0
- package/src/components/input.tsx +1 -1
- package/src/components/radio.tsx +60 -25
- package/src/components/skeleton.tsx +33 -2
- package/src/components/text.tsx +13 -4
- package/src/stories/checkbox.stories.tsx +80 -3
- package/src/stories/heading.stories.tsx +88 -0
- package/src/stories/radio.stories.tsx +51 -15
- package/src/stories/skeleton.stories.tsx +36 -2
- package/src/stories/text.stories.tsx +68 -10
- package/src/styles/global.css +5 -5
- package/style.css +70 -19
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
3
|
-
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const checkboxVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "lg" | "base" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
7
|
+
interface CheckboxProps extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>, VariantProps<typeof checkboxVariants> {
|
|
8
|
+
}
|
|
9
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
|
|
4
10
|
export default Checkbox;
|
|
11
|
+
export type { CheckboxProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as e}from"react/jsx-runtime";import*as
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as n from"react";import*as i from"@radix-ui/react-checkbox";import{CheckIcon as f}from"@radix-ui/react-icons";import{cn as a}from"../helpers/index.js";import{cva as p}from"class-variance-authority";const b=p("ai-border-primary ai-ring-offset-background focus-visible:ai-ring-ring data-[state=checked]:ai-bg-primary data-[state=checked]:ai-text-primary-foreground ai-peer ai-shrink-0 ai-rounded-sm ai-border focus-visible:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-cursor-not-allowed disabled:ai-opacity-50 disabled:ai-bg-btn-primary-disabled",{variants:{size:{sm:"ai-size-[14px]",base:"ai-size-4",lg:"ai-size-5"}},defaultVariants:{size:"base"}}),o=n.forwardRef(({className:t,size:r,...s},c)=>e(i.Root,{ref:c,className:a(b({size:r}),t),...s,children:e(i.Indicator,{className:a("ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full"),children:e(f,{})})}));o.displayName=i.Root.displayName;var h=o;export{h as default};
|
|
2
2
|
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/checkbox.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { CheckIcon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "React", "CheckboxPrimitive", "CheckIcon", "cn", "Checkbox", "className", "props", "ref", "checkbox_default"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as CheckboxPrimitive from '@radix-ui/react-checkbox'\nimport { CheckIcon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst checkboxVariants = cva(\n 'ai-border-primary ai-ring-offset-background focus-visible:ai-ring-ring data-[state=checked]:ai-bg-primary data-[state=checked]:ai-text-primary-foreground ai-peer ai-shrink-0 ai-rounded-sm ai-border focus-visible:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-cursor-not-allowed disabled:ai-opacity-50 disabled:ai-bg-btn-primary-disabled',\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 CheckboxProps\n extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,\n VariantProps<typeof checkboxVariants> {}\n\nconst Checkbox = React.forwardRef<React.ElementRef<typeof CheckboxPrimitive.Root>, CheckboxProps>(\n ({ className, size, ...props }, ref) => (\n <CheckboxPrimitive.Root ref={ref} className={cn(checkboxVariants({ size }), className)} {...props}>\n <CheckboxPrimitive.Indicator\n className={cn('ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full')}\n >\n <CheckIcon />\n </CheckboxPrimitive.Indicator>\n </CheckboxPrimitive.Root>\n )\n)\nCheckbox.displayName = CheckboxPrimitive.Root.displayName\n\nexport default Checkbox\nexport type { CheckboxProps }\n"],
|
|
5
|
+
"mappings": "aAmCQ,cAAAA,MAAA,oBAjCR,UAAYC,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,aAAAC,MAAiB,wBAE1B,OAAS,MAAAC,MAAU,sBACnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAmBD,EACvB,uXACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,iBACJ,KAAM,YACN,GAAI,WACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAMME,EAAWN,EAAM,WACrB,CAAC,CAAE,UAAAO,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IAC9BX,EAACE,EAAkB,KAAlB,CAAuB,IAAKS,EAAK,UAAWP,EAAGE,EAAiB,CAAE,KAAAG,CAAK,CAAC,EAAGD,CAAS,EAAI,GAAGE,EAC1F,SAAAV,EAACE,EAAkB,UAAlB,CACC,UAAWE,EAAG,+EAA+E,EAE7F,SAAAJ,EAACG,EAAA,EAAU,EACb,EACF,CAEJ,EACAI,EAAS,YAAcL,EAAkB,KAAK,YAE9C,IAAOU,EAAQL",
|
|
6
|
+
"names": ["jsx", "React", "CheckboxPrimitive", "CheckIcon", "cn", "cva", "checkboxVariants", "Checkbox", "className", "size", "props", "ref", "checkbox_default"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
1
2
|
import React from 'react';
|
|
2
|
-
|
|
3
|
+
declare const headingVariants: (props?: ({
|
|
4
|
+
size?: 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> {
|
|
3
8
|
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | undefined;
|
|
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 x}from"../helpers/index.js";import{Slot as c}from"@radix-ui/react-slot";import{cva as u}from"class-variance-authority";import P from"react";const y=u("",{variants:{size:{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:3,weights:"normal"}}),n=P.forwardRef((l,s)=>{const{children:t,className:r,size:m,weights:h,asChild:d,as:g="h1",color:e,html:a,...p}=l,i=a?{dangerouslySetInnerHTML:{__html:a}}:null,f=e?{style:{color:e}}:null;return o(c,{...p,ref:s,className:x(y({size:m,weights:h}),r),...i,...f,children:d?t:o(g,{children:i?null:t})})});n.displayName="Heading";export{n 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' | undefined\n asChild?: boolean\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const { children, className, asChild, as: Tag = 'h1', color, ...headingProps } = props\n
|
|
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 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: 3,\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' | undefined\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": "AAqE4B,cAAAA,MAAA,oBArE5B,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAW,QAElB,MAAMC,EAAkBF,EAAI,GAAI,CAC9B,SAAU,CACR,KAAM,CACJ,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,EACN,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 o from"react";import*as e 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=o.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=o.forwardRef(({className:a,children:r,size:t,...s},p)=>i(e.Root,{className:d("grid gap-2",a),...s,ref:p,children:i(n.Provider,{value:{size:t},children:r})}));m.displayName=e.Root.displayName;const u=o.forwardRef(({className:a,size:r,...t},s)=>{const{size:p}=o.useContext(n);return i(e.Item,{ref:s,className:d(R({size:r??p}),a),...t,children:i(e.Indicator,{className:"ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full",children:i(c,{})})})});u.displayName=e.Item.displayName;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 = RadioGroupPrimitive.Root.displayName\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 = RadioGroupPrimitive.Item.displayName\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,YAAcN,EAAoB,KAAK,YAMlD,MAAMY,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,YAAcZ,EAAoB,KAAK",
|
|
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
|
+
/** 是否正在加载 */
|
|
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 */\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,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import*as h from"react";import{Slot as g}from"@radix-ui/react-slot";import{cn as T}from"../helpers/index.js";import{cva as u}from"class-variance-authority";const P=u("",{variants:{size:{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:3,weights:"normal"}}),s=h.forwardRef((l,i)=>{const{children:t,size:r,weights:x,className:m,asChild:p,as:f="span",color:e,html:a,...c}=l,o=a?{dangerouslySetInnerHTML:{__html:a}}:null,d=e?{style:{color:e}}:null;return n(g,{...c,ref:i,className:T(P({size:r,weights:x}),m),...o,...d,children:p?t:n(f,{children:o?null:t})})});s.displayName="Text";export{s 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: 3,\n weights: 'normal',\n },\n})\n\ntype TextElement = React.ElementRef<'span'>\ninterface TextProps extends React.ComponentPropsWithoutRef<'span'>, VariantProps<typeof textVariants> {\n as?: 'div' | 'label' | 'p' | 'span' | undefined\n asChild?: boolean\n color?: string\n /** \u76F8\u5F53\u4E8E dangerouslySetInnerHTML */\n html?: string\n}\n\nconst Text = React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const { children, size, className, asChild, as: Tag = 'span', color, html, ...textProps } = props\n\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: html },\n }\n : null\n\n return (\n <Slot\n {...textProps}\n ref={forwardedRef}\n className={cn(\n textVariants({\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'\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: 3,\n weights: 'normal',\n },\n})\n\ntype TextElement = React.ElementRef<'span'>\ninterface TextProps extends React.ComponentPropsWithoutRef<'span'>, VariantProps<typeof textVariants> {\n as?: 'div' | 'label' | 'p' | 'span' | undefined\n asChild?: boolean\n color?: string\n /** \u76F8\u5F53\u4E8E dangerouslySetInnerHTML */\n html?: string\n}\n\nconst Text = React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const { children, size, 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": "AAuE4B,cAAAA,MAAA,oBAvE5B,UAAYC,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,MAAAC,MAAU,sBACnB,OAA4B,OAAAC,MAAW,2BAEvC,MAAMC,EAAeD,EAAI,GAAI,CAC3B,SAAU,CACR,KAAM,CACJ,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,EACN,QAAS,QACX,CACF,CAAC,EAWKE,EAAOL,EAAM,WAAmC,CAACM,EAAOC,IAAiB,CAC7E,KAAM,CAAE,SAAAC,EAAU,KAAAC,EAAM,QAAAC,EAAS,UAAAC,EAAW,QAAAC,EAAS,GAAIC,EAAM,OAAQ,MAAAC,EAAO,KAAAC,EAAM,GAAGC,CAAU,EAAIV,EAE/FW,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
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
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: 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: "color";
|
|
41
|
+
};
|
|
42
|
+
as: {
|
|
43
|
+
control: {
|
|
44
|
+
type: "select";
|
|
45
|
+
};
|
|
46
|
+
options: string[];
|
|
47
|
+
description: string;
|
|
48
|
+
table: {
|
|
49
|
+
defaultValue: {
|
|
50
|
+
summary: string;
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
html: {
|
|
55
|
+
type: "string";
|
|
56
|
+
description: string;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
args: {
|
|
60
|
+
as: "h1";
|
|
61
|
+
size: 3;
|
|
62
|
+
weights: "normal";
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
export default meta;
|
|
66
|
+
type Story = StoryObj<typeof meta>;
|
|
67
|
+
export declare const Default: Story;
|
|
68
|
+
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:[1,2,3,4,5,6,7,8,9],description:"1~9",table:{defaultValue:{summary:"3"}}},weights:{control:{type:"select"},options:["light","normal","medium","bold"],table:{defaultValue:{summary:"normal"}}},color:{control:"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:3,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: [1, 2, 3, 4, 5, 6, 7, 8, 9],\n description: '1~9',\n table: {\n defaultValue: { summary: '3' },\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: 'color',\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: 3,\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": "AA2EI,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBAzEJ,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,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EACnC,YAAa,MACb,MAAO,CACL,aAAc,CAAE,QAAS,GAAI,CAC/B,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,OACX,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,EACN,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,5 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
import type { StoryObj } from '@storybook/react/*';
|
|
2
|
+
import { RadioGroup } from '../components/index';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
declare const meta: {
|
|
2
5
|
title: string;
|
|
6
|
+
component: React.ForwardRefExoticComponent<import("../components/radio").RadioGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: string;
|
|
9
|
+
docs: {
|
|
10
|
+
description: {
|
|
11
|
+
component: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
tags: string[];
|
|
16
|
+
argTypes: {
|
|
17
|
+
size: {
|
|
18
|
+
control: {
|
|
19
|
+
type: "select";
|
|
20
|
+
};
|
|
21
|
+
options: string[];
|
|
22
|
+
description: string;
|
|
23
|
+
table: {
|
|
24
|
+
defaultValue: {
|
|
25
|
+
summary: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
args: {
|
|
31
|
+
size: "base";
|
|
32
|
+
};
|
|
3
33
|
};
|
|
4
|
-
export default
|
|
5
|
-
|
|
34
|
+
export default meta;
|
|
35
|
+
type Story = StoryObj<typeof RadioGroup>;
|
|
36
|
+
export declare const Default: Story;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as o,jsxs as
|
|
1
|
+
import{Fragment as r,jsx as o,jsxs as e}from"react/jsx-runtime";import{RadioGroup as a,RadioGroupItem as t}from"../components/index";import"react";const i={title:"Components/Radio",component:a,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 d={args:{size:"base",children:e(r,{children:[e("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[o(t,{value:"option-one",id:"option-one"}),o("label",{htmlFor:"option-one",children:"Option One"})]}),e("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[o(t,{value:"option-two",id:"option-two"}),o("label",{htmlFor:"option-two",children:"Option Two"})]})]})}};export{d 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 { RadioGroup, RadioGroupItem } from '../components/index'\nimport React from 'react'\n\
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "RadioGroup", "RadioGroupItem", "radio_stories_default", "Default"]
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react/*'\nimport { RadioGroup, RadioGroupItem } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Radio',\n component: RadioGroup,\n // subcomponents: { RadioGroupItem },\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,sBAC3C,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,mBACP,UAAWF,EAEX,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,IAAOG,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
|
+
"names": ["Fragment", "jsx", "jsxs", "RadioGroup", "RadioGroupItem", "meta", "radio_stories_default", "Default"]
|
|
7
7
|
}
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import type { StoryObj } from '@storybook/react';
|
|
2
|
-
import
|
|
2
|
+
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component:
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../components/skeleton").SkeletonProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
|
+
docs: {
|
|
9
|
+
description: {
|
|
10
|
+
component: string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
8
13
|
};
|
|
9
14
|
tags: string[];
|
|
10
15
|
};
|
|
11
16
|
export default meta;
|
|
12
17
|
type Story = StoryObj<typeof meta>;
|
|
13
18
|
export declare const Default: Story;
|
|
14
|
-
export declare const
|
|
19
|
+
export declare const Multiple: Story;
|
|
20
|
+
export declare const WithText: Story;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as
|
|
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};
|
|
2
2
|
//# sourceMappingURL=skeleton.stories.js.map
|