@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
package/CONTRIBUTING.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
# 关于
|
|
4
4
|
|
|
5
|
+
这是一个基于@radix-ui/primitive 二次封装的组件库,目标是通过 css 变量的形式,实现多主题,以达到同时支持多品牌站点开发的能力。
|
|
6
|
+
|
|
5
7
|
# 代码文件结构
|
|
6
8
|
|
|
7
9
|
```shell
|
|
@@ -68,7 +70,10 @@ pnpm run dev
|
|
|
68
70
|
# 如何新增组件
|
|
69
71
|
|
|
70
72
|
新增组件之前先看下仓库有没有类似的组件已经存在。
|
|
71
|
-
|
|
73
|
+
如果不存在,需要新增组件,
|
|
74
|
+
|
|
75
|
+
**建议新组件基于 [@radix-ui/primitive](https://www.radix-ui.com/primitives) 或者手动复制[shadcn](https://ui.shadcn.com/) 的组件 进行二次封装。**
|
|
76
|
+
|
|
72
77
|
组件目录位于`packages/ui/src`。
|
|
73
78
|
|
|
74
79
|
运行`pnpm run dev` 之后,会运行storybook 和 playground 项目,在storybook 中测试组件的功能,编写文档。
|
|
@@ -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 strict";"use client";var
|
|
1
|
+
"use strict";"use client";var l=Object.create;var r=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var x=Object.getOwnPropertyNames;var k=Object.getPrototypeOf,u=Object.prototype.hasOwnProperty;var y=(i,e)=>{for(var a in e)r(i,a,{get:e[a],enumerable:!0})},f=(i,e,a,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of x(e))!u.call(i,o)&&o!==a&&r(i,o,{get:()=>e[o],enumerable:!(t=h(e,o))||t.enumerable});return i};var p=(i,e,a)=>(a=i!=null?l(k(i)):{},f(e||!i||!i.__esModule?r(a,"default",{value:i,enumerable:!0}):a,i)),v=i=>f(r({},"__esModule",{value:!0}),i);var g={};y(g,{default:()=>R});module.exports=v(g);var s=require("react/jsx-runtime"),C=p(require("react")),c=p(require("@radix-ui/react-checkbox")),d=require("@radix-ui/react-icons"),n=require("../helpers/index.js"),m=require("class-variance-authority");const P=(0,m.cva)("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"}}),b=C.forwardRef(({className:i,size:e,...a},t)=>(0,s.jsx)(c.Root,{ref:t,className:(0,n.cn)(P({size:e}),i),...a,children:(0,s.jsx)(c.Indicator,{className:(0,n.cn)("ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full"),children:(0,s.jsx)(d.CheckIcon,{})})}));b.displayName=c.Root.displayName;var R=b;
|
|
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["checkbox_exports", "__export", "checkbox_default", "__toCommonJS", "import_jsx_runtime", "React", "CheckboxPrimitive", "import_react_icons", "import_helpers", "Checkbox", "className", "props", "ref"]
|
|
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmCQ,IAAAI,EAAA,6BAjCRC,EAAuB,oBACvBC,EAAmC,uCACnCC,EAA0B,iCAE1BC,EAAmB,+BACnBC,EAAuC,oCAEvC,MAAMC,KAAmB,OACvB,uXACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,iBACJ,KAAM,YACN,GAAI,WACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAMMC,EAAWN,EAAM,WACrB,CAAC,CAAE,UAAAO,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAGC,OAC9B,OAACT,EAAkB,KAAlB,CAAuB,IAAKS,EAAK,aAAW,MAAGL,EAAiB,CAAE,KAAAG,CAAK,CAAC,EAAGD,CAAS,EAAI,GAAGE,EAC1F,mBAACR,EAAkB,UAAlB,CACC,aAAW,MAAG,+EAA+E,EAE7F,mBAAC,cAAU,EACb,EACF,CAEJ,EACAK,EAAS,YAAcL,EAAkB,KAAK,YAE9C,IAAOJ,EAAQS",
|
|
6
|
+
"names": ["checkbox_exports", "__export", "checkbox_default", "__toCommonJS", "import_jsx_runtime", "React", "CheckboxPrimitive", "import_react_icons", "import_helpers", "import_class_variance_authority", "checkboxVariants", "Checkbox", "className", "size", "props", "ref"]
|
|
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
|
-
"use strict";var
|
|
1
|
+
"use strict";var R=Object.create;var o=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var w=Object.getPrototypeOf,C=Object.prototype.hasOwnProperty;var z=(t,e)=>{for(var a in e)o(t,a,{get:e[a],enumerable:!0})},d=(t,e,a,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of b(e))!C.call(t,i)&&i!==a&&o(t,i,{get:()=>e[i],enumerable:!(n=V(e,i))||n.enumerable});return t};var E=(t,e,a)=>(a=t!=null?R(w(t)):{},d(e||!t||!t.__esModule?o(a,"default",{value:t,enumerable:!0}):a,t)),N=t=>d(o({},"__esModule",{value:!0}),t);var T={};z(T,{Heading:()=>l});module.exports=N(T);var s=require("react/jsx-runtime"),g=require("../helpers/index.js"),p=require("@radix-ui/react-slot"),f=require("class-variance-authority"),x=E(require("react"));const S=(0,f.cva)("",{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"}}),l=x.default.forwardRef((t,e)=>{const{children:a,className:n,size:i,weights:c,asChild:u,as:P="h1",color:r,html:m,...y}=t,h=m?{dangerouslySetInnerHTML:{__html:m}}:null,H=r?{style:{color:r}}:null;return(0,s.jsx)(p.Slot,{...y,ref:e,className:(0,g.cn)(S({size:i,weights:c}),n),...h,...H,children:u?a:(0,s.jsx)(P,{children:h?null:a})})});l.displayName="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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["heading_exports", "__export", "Heading", "__toCommonJS", "import_jsx_runtime", "import_helpers", "import_react_slot", "import_react", "React", "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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqE4B,IAAAI,EAAA,6BArE5BC,EAAmB,+BACnBC,EAAqB,gCACrBC,EAAuC,oCACvCC,EAAkB,oBAElB,MAAMC,KAAkB,OAAI,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,EAWKP,EAAU,EAAAQ,QAAM,WAAyC,CAACC,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,SACE,OAAC,QACE,GAAGE,EACJ,IAAKT,EACL,aAAW,MACTH,EAAgB,CACd,KAAAM,EACA,QAAAC,CACF,CAAC,EACDF,CACF,EACC,GAAGQ,EACH,GAAGC,EAEH,SAAAN,EAAUJ,KAAW,OAACK,EAAA,CAAK,SAAAI,EAAmB,KAAOT,EAAS,EACjE,CAEJ,CAAC,EAEDX,EAAQ,YAAc",
|
|
6
|
+
"names": ["heading_exports", "__export", "Heading", "__toCommonJS", "import_jsx_runtime", "import_helpers", "import_react_slot", "import_class_variance_authority", "import_react", "headingVariants", "React", "props", "forwardedRef", "children", "className", "size", "weights", "asChild", "Tag", "color", "html", "headingProps", "htmlContentProps", "styleProps"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var n=Object.create;var
|
|
1
|
+
"use strict";var n=Object.create;var a=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var c=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var C=(e,t)=>{for(var f in t)a(e,f,{get:t[f],enumerable:!0})},p=(e,t,f,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of b(t))!g.call(e,m)&&m!==f&&a(e,m,{get:()=>t[m],enumerable:!(d=B(t,m))||d.enumerable});return e},r=(e,t,f)=>(p(e,t,"default"),f&&p(f,t,"default")),x=(e,t,f)=>(f=e!=null?n(c(e)):{},p(t||!e||!e.__esModule?a(f,"default",{value:e,enumerable:!0}):f,e)),S=e=>p(a({},"__esModule",{value:!0}),e);var o={};C(o,{Badge:()=>u.default,Button:()=>l.default,Checkbox:()=>s.default,Skeleton:()=>h.default,Theme:()=>k.default});module.exports=S(o);var l=x(require("./button.js")),u=x(require("./badge.js"));r(o,require("./input.js"),module.exports);var s=x(require("./checkbox.js")),h=x(require("./skeleton.js"));r(o,require("./dialog.js"),module.exports);r(o,require("./popover.js"),module.exports);r(o,require("./radio.js"),module.exports);r(o,require("./dialog.js"),module.exports);r(o,require("./text.js"),module.exports);r(o,require("./heading.js"),module.exports);var k=x(require("./theme.js"));
|
|
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": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6HAAAE,EAAAF,GAIA,IAAAG,EAAkC,0BAClCC,EAAiC,yBACjCC,EAAAL,EAAc,sBANd,gBAQA,IAAAM,EAAoC,4BAEpCC,EAAoC,4BACpCF,EAAAL,EAAc,uBAXd,gBAYAK,EAAAL,EAAc,wBAZd,gBAaAK,EAAAL,EAAc,sBAbd,gBAcAK,EAAAL,EAAc,uBAdd,gBAeAK,EAAAL,EAAc,qBAfd,
|
|
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": "wmBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6HAAAE,EAAAF,GAIA,IAAAG,EAAkC,0BAClCC,EAAiC,yBACjCC,EAAAL,EAAc,sBANd,gBAQA,IAAAM,EAAoC,4BAEpCC,EAAoC,4BACpCF,EAAAL,EAAc,uBAXd,gBAYAK,EAAAL,EAAc,wBAZd,gBAaAK,EAAAL,EAAc,sBAbd,gBAcAK,EAAAL,EAAc,uBAdd,gBAeAK,EAAAL,EAAc,qBAfd,gBAgBAK,EAAAL,EAAc,wBAhBd,gBAiBA,IAAAQ,EAAiC",
|
|
6
6
|
"names": ["components_exports", "__export", "__toCommonJS", "import_button", "import_badge", "__reExport", "import_checkbox", "import_skeleton", "import_theme"]
|
|
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,cAAAC,IAAA,eAAAC,EAAAJ,GAyCI,IAAAK,EAAA,6BAvCJC,EAAuB,oBACvBC,EAAmB,+BAEnBC,EAAuC,oCAEvC,MAAMC,KAAgB,OACpB,sOACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,SACJ,KAAM,UACN,GAAI,SACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAgBMN,EAAYG,EAAM,WAA6C,CAACI,EAAOC,IAAiB,CAC5F,KAAM,CAAE,UAAAC,EAAW,KAAAC,EAAM,SAAAC,EAAU,GAAGC,CAAU,EAAIL,EAEpD,SACE,OAAC,OACC,IAAKC,EACJ,GAAGI,EACJ,aAAW,MAAG,4CAA6CH,EAAW,CACpE,sBAAuBC,IAAS,OAChC,qBAAsBA,IAAS,OACjC,CAAC,EAEA,SAAAC,EACH,CAEJ,CAAC,EAEKZ,EAAQI,EAAM,WAClB,CAAC,CAAE,UAAAM,EAAW,KAAAI,EAAM,KAAAC,EAAM,SAAAH,EAAU,GAAGJ,CAAM,EAAGQ,OAE5C,QAAC,OAAI,aAAW,MAAGT,EAAc,CAAE,KAAAQ,CAAK,CAAC,EAAGL,CAAS,EACnD,oBAAC,SACC,KAAMI,EACN,aAAW,MACT,sOACF,EACA,IAAKE,EACJ,GAAGR,EACN,EACCI,GACH,CAGN,EACAZ,EAAM,YAAc,QACpBC,EAAU,YAAc",
|
|
6
6
|
"names": ["input_exports", "__export", "Input", "InputSlot", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_class_variance_authority", "inputVariants", "props", "forwardedRef", "className", "side", "children", "slotProps", "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 strict";"use client";var
|
|
1
|
+
"use strict";"use client";var G=Object.create;var p=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var b=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty;var x=(e,i)=>{for(var o in i)p(e,o,{get:i[o],enumerable:!0})},c=(e,i,o,r)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of v(i))!g.call(e,a)&&a!==o&&p(e,a,{get:()=>i[a],enumerable:!(r=y(i,a))||r.enumerable});return e};var f=(e,i,o)=>(o=e!=null?G(b(e)):{},c(i||!e||!e.__esModule?p(o,"default",{value:e,enumerable:!0}):o,e)),I=e=>c(p({},"__esModule",{value:!0}),e);var C={};x(C,{RadioGroup:()=>m,RadioGroupItem:()=>u});module.exports=I(C);var t=require("react/jsx-runtime"),d=f(require("react")),s=f(require("@radix-ui/react-radio-group")),l=require("@radix-ui/react-icons"),P=require("class-variance-authority"),n=require("../helpers/index.js");const R=d.createContext({size:"base"}),z=(0,P.cva)("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=d.forwardRef(({className:e,children:i,size:o,...r},a)=>(0,t.jsx)(s.Root,{className:(0,n.cn)("grid gap-2",e),...r,ref:a,children:(0,t.jsx)(R.Provider,{value:{size:o},children:i})}));m.displayName=s.Root.displayName;const u=d.forwardRef(({className:e,size:i,...o},r)=>{const{size:a}=d.useContext(R);return(0,t.jsx)(s.Item,{ref:r,className:(0,n.cn)(z({size:i??a}),e),...o,children:(0,t.jsx)(s.Indicator,{className:"ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full",children:(0,t.jsx)(l.CheckIcon,{})})})});u.displayName=s.Item.displayName;
|
|
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,
|
|
6
|
-
"names": ["radio_exports", "__export", "RadioGroup", "RadioGroupItem", "__toCommonJS", "import_jsx_runtime", "React", "RadioGroupPrimitive", "import_react_icons", "import_helpers", "className", "props", "ref"]
|
|
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": "ukBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAqCQ,IAAAK,EAAA,6BAnCRC,EAAuB,oBACvBC,EAAqC,0CACrCC,EAA0B,iCAC1BC,EAAuC,oCACvCC,EAAmB,+BAEnB,MAAMC,EAAeL,EAAM,cAA+C,CACxE,KAAM,MACR,CAAC,EAEKM,KAAqB,OACzB,0VACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,iBACJ,KAAM,YACN,GAAI,WACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAOMV,EAAaI,EAAM,WACvB,CAAC,CAAE,UAAAO,EAAW,SAAAC,EAAU,KAAAC,EAAM,GAAGC,CAAM,EAAGC,OAEtC,OAACV,EAAoB,KAApB,CAAyB,aAAW,MAAG,aAAcM,CAAS,EAAI,GAAGG,EAAO,IAAKC,EAChF,mBAACN,EAAa,SAAb,CAAsB,MAAO,CAAE,KAAAI,CAAK,EAAI,SAAAD,EAAS,EACpD,CAGN,EACAZ,EAAW,YAAcK,EAAoB,KAAK,YAMlD,MAAMJ,EAAiBG,EAAM,WAC3B,CAAC,CAAE,UAAAO,EAAW,KAAAE,EAAM,GAAGC,CAAM,EAAGC,IAAQ,CACtC,KAAM,CAAE,KAAMC,CAAe,EAAIZ,EAAM,WAAWK,CAAY,EAC9D,SACE,OAACJ,EAAoB,KAApB,CACC,IAAKU,EACL,aAAW,MACTL,EAAmB,CACjB,KAAMG,GAAQG,CAChB,CAAC,EACDL,CACF,EACC,GAAGG,EAEJ,mBAACT,EAAoB,UAApB,CAA8B,UAAU,gFACvC,mBAAC,cAAU,EACb,EACF,CAEJ,CACF,EACAJ,EAAe,YAAcI,EAAoB,KAAK",
|
|
6
|
+
"names": ["radio_exports", "__export", "RadioGroup", "RadioGroupItem", "__toCommonJS", "import_jsx_runtime", "React", "RadioGroupPrimitive", "import_react_icons", "import_class_variance_authority", "import_helpers", "RadioContext", "radioGroupVariants", "className", "children", "size", "props", "ref", "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
|
-
"use strict";var
|
|
1
|
+
"use strict";var b=Object.create;var i=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var S=(e,n)=>{for(var o in n)i(e,o,{get:n[o],enumerable:!0})},l=(e,n,o,a)=>{if(n&&typeof n=="object"||typeof n=="function")for(let t of u(n))!P.call(e,t)&&t!==o&&i(e,t,{get:()=>n[t],enumerable:!(a=k(n,t))||a.enumerable});return e};var v=(e,n,o)=>(o=e!=null?b(g(e)):{},l(n||!e||!e.__esModule?i(o,"default",{value:e,enumerable:!0}):o,e)),R=e=>l(i({},"__esModule",{value:!0}),e);var y={};S(y,{default:()=>h});module.exports=R(y);var m=require("react/jsx-runtime"),r=v(require("react")),p=require("../helpers/index.js"),d=require("@radix-ui/react-slot");const s=r.forwardRef((e,n)=>{const{children:o,className:a,loading:t=!0,...c}=e;if(!t)return o;const f=r.isValidElement(o)?d.Slot:"span";return(0,m.jsx)(f,{ref:n,className:(0,p.cn)(`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
|
+
`,a),"data-inline-skeleton":r.isValidElement(o)?void 0:!0,tabIndex:-1,...c,children:o})});s.displayName="Skeleton";var h=s;
|
|
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": ["skeleton_exports", "__export", "skeleton_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAmBI,IAAAI,EAAA,6BAnBJC,EAAuB,oBACvBC,EAAmB,+BACnBC,EAAqB,gCAUrB,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,EAAI,OAAO,OAEpD,SACE,OAACI,EAAA,CACC,IAAKL,EACL,aAAW,MACT;AAAA;AAAA;AAAA,UAIAE,CACF,EACA,uBAAsBP,EAAM,eAAeM,CAAQ,EAAI,OAAY,GACnE,SAAU,GACT,GAAGG,EAEH,SAAAH,EACH,CAEJ,CAAC,EAEDH,EAAS,YAAc,WAEvB,IAAON,EAAQM",
|
|
6
|
+
"names": ["skeleton_exports", "__export", "skeleton_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_react_slot", "Skeleton", "props", "forwardedRef", "children", "className", "loading", "skeletonProps", "Tag"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var y=Object.create;var n=Object.defineProperty;var R=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,w=Object.prototype.hasOwnProperty;var C=(t,e)=>{for(var a in e)n(t,a,{get:e[a],enumerable:!0})},p=(t,e,a,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of b(e))!w.call(t,o)&&o!==a&&n(t,o,{get:()=>e[o],enumerable:!(s=R(e,o))||s.enumerable});return t};var v=(t,e,a)=>(a=t!=null?y(V(t)):{},p(e||!t||!t.__esModule?n(a,"default",{value:t,enumerable:!0}):a,t)),z=t=>p(n({},"__esModule",{value:!0}),t);var S={};C(S,{Text:()=>l});module.exports=z(S);var i=require("react/jsx-runtime"),E=v(require("react")),f=require("@radix-ui/react-slot"),c=require("../helpers/index.js"),d=require("class-variance-authority");const N=(0,d.cva)("",{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"}}),l=E.forwardRef((t,e)=>{const{children:a,size:s,weights:o,className:h,asChild:g,as:T="span",color:r,html:x,...u}=t,m=x?{dangerouslySetInnerHTML:{__html:x}}:null,P=r?{style:{color:r}}:null;return(0,i.jsx)(f.Slot,{...u,ref:e,className:(0,c.cn)(N({size:s,weights:o}),h),...m,...P,children:g?a:(0,i.jsx)(T,{children:m?null:a})})});l.displayName="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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,
|
|
6
|
-
"names": ["text_exports", "__export", "Text", "__toCommonJS", "import_jsx_runtime", "React", "import_react_slot", "import_helpers", "import_class_variance_authority", "textVariants", "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": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,UAAAE,IAAA,eAAAC,EAAAH,GAuE4B,IAAAI,EAAA,6BAvE5BC,EAAuB,oBACvBC,EAAqB,gCACrBC,EAAmB,+BACnBC,EAAuC,oCAEvC,MAAMC,KAAe,OAAI,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,EAWKP,EAAOG,EAAM,WAAmC,CAACK,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,SACE,OAAC,QACE,GAAGE,EACJ,IAAKT,EACL,aAAW,MACTF,EAAa,CACX,KAAAI,EACA,QAAAC,CACF,CAAC,EACDC,CACF,EACC,GAAGM,EACH,GAAGC,EAEH,SAAAN,EAAUJ,KAAW,OAACK,EAAA,CAAK,SAAAI,EAAmB,KAAOT,EAAS,EACjE,CAEJ,CAAC,EACDV,EAAK,YAAc",
|
|
6
|
+
"names": ["text_exports", "__export", "Text", "__toCommonJS", "import_jsx_runtime", "React", "import_react_slot", "import_helpers", "import_class_variance_authority", "textVariants", "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
|
-
"use strict";var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var l=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var n=Object.prototype.hasOwnProperty;var p=(i,a)=>{for(var o in a)l(i,o,{get:a[o],enumerable:!0})},b=(i,a,o,r)=>{if(a&&typeof a=="object"||typeof a=="function")for(let s of m(a))!n.call(i,s)&&s!==o&&l(i,s,{get:()=>a[s],enumerable:!(r=d(a,s))||r.enumerable});return i};var x=i=>b(l({},"__esModule",{value:!0}),i);var v={};p(v,{Default:()=>u,Disabled:()=>g,Sizes:()=>c,default:()=>y});module.exports=x(v);var e=require("react/jsx-runtime"),t=require("../components/index"),N=require("react");const f={title:"Components/Checkbox",component:t.Checkbox,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 y=f;const u={args:{size:"base"}},c=()=>(0,e.jsxs)("div",{className:"ai-flex ai-flex-col ai-gap-2",children:[(0,e.jsxs)("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[(0,e.jsx)(t.Checkbox,{id:"terms",size:"sm"}),(0,e.jsx)("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"})]}),(0,e.jsxs)("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[(0,e.jsx)(t.Checkbox,{id:"terms1",size:"base"}),(0,e.jsx)("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"})]}),(0,e.jsxs)("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[(0,e.jsx)(t.Checkbox,{id:"terms2",size:"lg"}),(0,e.jsx)("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"})]})]});c.parameters={docs:{description:{story:"\u4E0D\u540C\u7684\u5C3A\u5BF8"}}};const g=()=>(0,e.jsxs)("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[(0,e.jsx)(t.Checkbox,{id:"terms",disabled:!0}),(0,e.jsx)("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"})]});
|
|
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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,YAAAC,IAAA,eAAAC,
|
|
6
|
-
"names": ["checkbox_stories_exports", "__export", "Default", "checkbox_stories_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react"]
|
|
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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,aAAAC,EAAA,UAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAN,GA6CI,IAAAO,EAAA,6BA5CJC,EAAyB,+BACzBC,EAAkB,iBAElB,MAAMC,EAAO,CACX,MAAO,sBACP,UAAW,WACX,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,IAAOL,EAAQK,EAIR,MAAMR,EAAiB,CAC5B,KAAM,CACJ,KAAM,MACR,CACF,EAEaE,EAAQ,OACnB,QAAC,OAAI,UAAU,+BACb,qBAAC,OAAI,UAAU,uCACb,oBAAC,YAAS,GAAG,QAAQ,KAAK,KAAK,KAC/B,OAAC,SACC,QAAQ,QACR,UAAU,4GACX,uCAED,GACF,KACA,QAAC,OAAI,UAAU,uCACb,oBAAC,YAAS,GAAG,SAAS,KAAK,OAAO,KAClC,OAAC,SACC,QAAQ,SACR,UAAU,8GACX,uCAED,GACF,KACA,QAAC,OAAI,UAAU,uCACb,oBAAC,YAAS,GAAG,SAAS,KAAK,KAAK,KAChC,OAAC,SACC,QAAQ,SACR,UAAU,4GACX,uCAED,GACF,GACF,EAEFA,EAAM,WAAa,CACjB,KAAM,CACJ,YAAa,CACX,MAAO,gCACT,CACF,CACF,EAEO,MAAMD,EAAW,OACtB,QAAC,OAAI,UAAU,uCACb,oBAAC,YAAS,GAAG,QAAQ,SAAQ,GAAC,KAC9B,OAAC,SACC,QAAQ,QACR,UAAU,4GACX,uCAED,GACF",
|
|
6
|
+
"names": ["checkbox_stories_exports", "__export", "Default", "Disabled", "Sizes", "checkbox_stories_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "meta"]
|
|
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
|
+
"use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var h=(r,t)=>{for(var i in t)s(r,i,{get:t[i],enumerable:!0})},u=(r,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of d(t))!p.call(r,a)&&a!==i&&s(r,a,{get:()=>t[a],enumerable:!(n=l(t,a))||n.enumerable});return r};var c=r=>u(s({},"__esModule",{value:!0}),r);var z={};h(z,{All:()=>f,Default:()=>y,default:()=>m});module.exports=c(z);var e=require("react/jsx-runtime"),o=require("../components/index"),H=require("react");const g={title:"Typography/Heading",component:o.Heading,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 m=g;const y={args:{as:"h1",children:" The quick brown fox jumps over the lazy dog."}},f={render:()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(o.Heading,{size:1,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:2,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:3,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:4,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:5,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:6,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:7,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:8,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Heading,{size:9,children:"The quick brown fox jumps over the lazy dog."})]})};
|
|
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": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,SAAAE,EAAA,YAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAL,GA2EI,IAAAM,EAAA,6BAzEJC,EAAwB,+BACxBC,EAAkB,iBAElB,MAAMC,EAAO,CACX,MAAO,qBACP,UAAW,UACX,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,IAAOL,EAAQK,EAIR,MAAMN,EAAiB,CAC5B,KAAM,CACJ,GAAI,KACJ,SAAU,+CACZ,CACF,EAEaD,EAAa,CACxB,OAAQ,OACN,oBACE,oBAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,KAC9D,OAAC,WAAQ,KAAM,EAAG,wDAA4C,GAChE,CAEJ",
|
|
6
|
+
"names": ["heading_stories_exports", "__export", "All", "Default", "heading_stories_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "meta"]
|
|
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
|
-
"use strict";var
|
|
1
|
+
"use strict";var s=Object.defineProperty;var n=Object.getOwnPropertyDescriptor;var l=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var c=(t,e)=>{for(var r in e)s(t,r,{get:e[r],enumerable:!0})},m=(t,e,r,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of l(e))!d.call(t,a)&&a!==r&&s(t,a,{get:()=>e[a],enumerable:!(p=n(e,a))||p.enumerable});return t};var u=t=>m(s({},"__esModule",{value:!0}),t);var g={};c(g,{Default:()=>f,default:()=>b});module.exports=u(g);var o=require("react/jsx-runtime"),i=require("../components/index"),w=require("react");const y={title:"Components/Radio",component:i.RadioGroup,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 b=y;const f={args:{size:"base",children:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[(0,o.jsx)(i.RadioGroupItem,{value:"option-one",id:"option-one"}),(0,o.jsx)("label",{htmlFor:"option-one",children:"Option One"})]}),(0,o.jsxs)("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[(0,o.jsx)(i.RadioGroupItem,{value:"option-two",id:"option-two"}),(0,o.jsx)("label",{htmlFor:"option-two",children:"Option Two"})]})]})}};
|
|
2
2
|
//# sourceMappingURL=radio.stories.js.map
|