@anker-in/headless-ui 0.0.11 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/CONTRIBUTING.md +20 -1
  2. package/README.md +1 -1
  3. package/dist/cjs/components/checkbox.d.ts +8 -1
  4. package/dist/cjs/components/checkbox.js +1 -1
  5. package/dist/cjs/components/checkbox.js.map +3 -3
  6. package/dist/cjs/components/dialog.js +1 -1
  7. package/dist/cjs/components/dialog.js.map +2 -2
  8. package/dist/cjs/components/heading.d.ts +10 -2
  9. package/dist/cjs/components/heading.js +1 -1
  10. package/dist/cjs/components/heading.js.map +3 -3
  11. package/dist/cjs/components/index.d.ts +1 -0
  12. package/dist/cjs/components/index.js +1 -1
  13. package/dist/cjs/components/index.js.map +2 -2
  14. package/dist/cjs/components/input.d.ts +1 -1
  15. package/dist/cjs/components/input.js.map +1 -1
  16. package/dist/cjs/components/radio.d.ts +13 -2
  17. package/dist/cjs/components/radio.js +1 -1
  18. package/dist/cjs/components/radio.js.map +3 -3
  19. package/dist/cjs/components/skeleton.d.ts +6 -3
  20. package/dist/cjs/components/skeleton.js +4 -1
  21. package/dist/cjs/components/skeleton.js.map +3 -3
  22. package/dist/cjs/components/text.d.ts +17 -3
  23. package/dist/cjs/components/text.js +1 -1
  24. package/dist/cjs/components/text.js.map +3 -3
  25. package/dist/cjs/stories/checkbox.stories.d.ts +44 -3
  26. package/dist/cjs/stories/checkbox.stories.js +1 -1
  27. package/dist/cjs/stories/checkbox.stories.js.map +3 -3
  28. package/dist/cjs/stories/dialog.stories.d.ts +18 -3
  29. package/dist/cjs/stories/dialog.stories.js +1 -1
  30. package/dist/cjs/stories/dialog.stories.js.map +3 -3
  31. package/dist/cjs/stories/heading.stories.d.ts +70 -0
  32. package/dist/cjs/stories/heading.stories.js +2 -0
  33. package/dist/cjs/stories/heading.stories.js.map +7 -0
  34. package/dist/cjs/stories/input.stories.d.ts +5 -0
  35. package/dist/cjs/stories/input.stories.js +1 -1
  36. package/dist/cjs/stories/input.stories.js.map +2 -2
  37. package/dist/cjs/stories/radio.stories.d.ts +37 -3
  38. package/dist/cjs/stories/radio.stories.js +1 -1
  39. package/dist/cjs/stories/radio.stories.js.map +3 -3
  40. package/dist/cjs/stories/skeleton.stories.d.ts +9 -3
  41. package/dist/cjs/stories/skeleton.stories.js +1 -1
  42. package/dist/cjs/stories/skeleton.stories.js.map +3 -3
  43. package/dist/cjs/stories/text.stories.d.ts +38 -3
  44. package/dist/cjs/stories/text.stories.js +9 -1
  45. package/dist/cjs/stories/text.stories.js.map +3 -3
  46. package/dist/esm/components/checkbox.d.ts +8 -1
  47. package/dist/esm/components/checkbox.js +1 -1
  48. package/dist/esm/components/checkbox.js.map +3 -3
  49. package/dist/esm/components/dialog.js +1 -1
  50. package/dist/esm/components/dialog.js.map +2 -2
  51. package/dist/esm/components/heading.d.ts +10 -2
  52. package/dist/esm/components/heading.js +1 -1
  53. package/dist/esm/components/heading.js.map +3 -3
  54. package/dist/esm/components/index.d.ts +1 -0
  55. package/dist/esm/components/index.js +1 -1
  56. package/dist/esm/components/index.js.map +2 -2
  57. package/dist/esm/components/input.d.ts +1 -1
  58. package/dist/esm/components/input.js.map +1 -1
  59. package/dist/esm/components/radio.d.ts +13 -2
  60. package/dist/esm/components/radio.js +1 -1
  61. package/dist/esm/components/radio.js.map +3 -3
  62. package/dist/esm/components/skeleton.d.ts +6 -3
  63. package/dist/esm/components/skeleton.js +4 -1
  64. package/dist/esm/components/skeleton.js.map +3 -3
  65. package/dist/esm/components/text.d.ts +17 -3
  66. package/dist/esm/components/text.js +1 -1
  67. package/dist/esm/components/text.js.map +3 -3
  68. package/dist/esm/stories/checkbox.stories.d.ts +44 -3
  69. package/dist/esm/stories/checkbox.stories.js +1 -1
  70. package/dist/esm/stories/checkbox.stories.js.map +3 -3
  71. package/dist/esm/stories/dialog.stories.d.ts +18 -3
  72. package/dist/esm/stories/dialog.stories.js +1 -1
  73. package/dist/esm/stories/dialog.stories.js.map +3 -3
  74. package/dist/esm/stories/heading.stories.d.ts +70 -0
  75. package/dist/esm/stories/heading.stories.js +2 -0
  76. package/dist/esm/stories/heading.stories.js.map +7 -0
  77. package/dist/esm/stories/input.stories.d.ts +5 -0
  78. package/dist/esm/stories/input.stories.js +1 -1
  79. package/dist/esm/stories/input.stories.js.map +2 -2
  80. package/dist/esm/stories/radio.stories.d.ts +37 -3
  81. package/dist/esm/stories/radio.stories.js +1 -1
  82. package/dist/esm/stories/radio.stories.js.map +3 -3
  83. package/dist/esm/stories/skeleton.stories.d.ts +9 -3
  84. package/dist/esm/stories/skeleton.stories.js +1 -1
  85. package/dist/esm/stories/skeleton.stories.js.map +3 -3
  86. package/dist/esm/stories/text.stories.d.ts +38 -3
  87. package/dist/esm/stories/text.stories.js +9 -1
  88. package/dist/esm/stories/text.stories.js.map +3 -3
  89. package/package.json +1 -1
  90. package/src/components/checkbox.tsx +34 -18
  91. package/src/components/dialog.tsx +1 -0
  92. package/src/components/heading.tsx +61 -5
  93. package/src/components/index.ts +1 -0
  94. package/src/components/input.tsx +1 -1
  95. package/src/components/radio.tsx +63 -28
  96. package/src/components/skeleton.tsx +33 -2
  97. package/src/components/text.tsx +25 -7
  98. package/src/stories/checkbox.stories.tsx +80 -3
  99. package/src/stories/dialog.stories.tsx +60 -31
  100. package/src/stories/heading.stories.tsx +90 -0
  101. package/src/stories/input.stories.tsx +5 -0
  102. package/src/stories/radio.stories.tsx +52 -16
  103. package/src/stories/skeleton.stories.tsx +36 -2
  104. package/src/stories/text.stories.tsx +74 -13
  105. package/src/styles/global.css +5 -5
  106. package/style.css +70 -19
  107. package/dist/cjs/tsconfig.tsbuildinfo +0 -1
  108. package/dist/esm/tsconfig.tsbuildinfo +0 -1
@@ -1,7 +1,15 @@
1
+ import { type VariantProps } from 'class-variance-authority';
1
2
  import React from 'react';
2
- interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'> {
3
- as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | undefined;
3
+ declare const headingVariants: (props?: ({
4
+ size?: "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
5
+ weights?: "bold" | "light" | "normal" | "medium" | null | undefined;
6
+ } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
7
+ interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {
8
+ as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
4
9
  asChild?: boolean;
10
+ color?: string;
11
+ html?: string;
5
12
  }
6
13
  declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
7
14
  export { Heading };
15
+ export type { HeadingProps };
@@ -1,2 +1,2 @@
1
- import{jsx as o}from"react/jsx-runtime";import{cn as l}from"../helpers/index.js";import{Slot as c}from"@radix-ui/react-slot";import m from"react";const a=m.forwardRef((n,t)=>{const{children:e,className:d,asChild:r,as:i="h1",color:s,...h}=n;return o(c,{"data-accent-color":s||void 0,...h,ref:t,className:l("",d),children:r?e:o(i,{children:e})})});a.displayName="Heading";export{a as Heading};
1
+ import{jsx as o}from"react/jsx-runtime";import{cn as f}from"../helpers/index.js";import{Slot as c}from"@radix-ui/react-slot";import{cva as P}from"class-variance-authority";import u from"react";const y=P("",{variants:{size:{none:"",1:"ai-text-xs",2:"ai-text-sm",3:"ai-text-base",4:"ai-text-lg",5:"ai-text-xl",6:"ai-text-2xl",7:"ai-text-3xl",8:"ai-text-4xl",9:"ai-text-5xl"},weights:{light:"ai-font-light",normal:"ai-font-normal",medium:"ai-font-medium",bold:"ai-font-bold"}},defaultVariants:{size:"none",weights:"normal"}}),i=u.forwardRef((l,s)=>{const{children:t,className:r,size:m,weights:h,asChild:d,as:g="h1",color:e,html:a,...p}=l,n=a?{dangerouslySetInnerHTML:{__html:a}}:null,x=e?{style:{color:e}}:null;return o(c,{...p,ref:s,className:f(y({size:m,weights:h}),r),...n,...x,children:d?t:o(g,{children:n?null:t})})});i.displayName="Heading";export{i as Heading};
2
2
  //# sourceMappingURL=heading.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/heading.tsx"],
4
- "sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport React from 'react'\n\ntype HeadingElement = React.ElementRef<'h1'>\n\ninterface HeadingProps extends React.ComponentPropsWithoutRef<'h1'> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 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 return (\n <Slot data-accent-color={color || undefined} {...headingProps} ref={forwardedRef} className={cn('', className)}>\n {asChild ? children : <Tag>{children}</Tag>}\n </Slot>\n )\n})\n\nHeading.displayName = 'Heading'\n\nexport { Heading }\n"],
5
- "mappings": "AAe4B,cAAAA,MAAA,oBAf5B,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBACrB,OAAOC,MAAW,QASlB,MAAMC,EAAUD,EAAM,WAAyC,CAACE,EAAOC,IAAiB,CACtF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAS,GAAIC,EAAM,KAAM,MAAAC,EAAO,GAAGC,CAAa,EAAIP,EACjF,OACEL,EAACE,EAAA,CAAK,oBAAmBS,GAAS,OAAY,GAAGC,EAAc,IAAKN,EAAc,UAAWL,EAAG,GAAIO,CAAS,EAC1G,SAAAC,EAAUF,EAAWP,EAACU,EAAA,CAAK,SAAAH,EAAS,EACvC,CAEJ,CAAC,EAEDH,EAAQ,YAAc",
6
- "names": ["jsx", "cn", "Slot", "React", "Heading", "props", "forwardedRef", "children", "className", "asChild", "Tag", "color", "headingProps"]
4
+ "sourcesContent": ["import { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport React from 'react'\n\nconst headingVariants = cva('', {\n variants: {\n size: {\n none: '',\n 1: 'ai-text-xs',\n 2: 'ai-text-sm',\n 3: 'ai-text-base',\n 4: 'ai-text-lg',\n 5: 'ai-text-xl',\n 6: 'ai-text-2xl',\n 7: 'ai-text-3xl',\n 8: 'ai-text-4xl',\n 9: 'ai-text-5xl',\n },\n weights: {\n light: 'ai-font-light',\n normal: 'ai-font-normal',\n medium: 'ai-font-medium',\n bold: 'ai-font-bold',\n },\n },\n defaultVariants: {\n size: 'none',\n weights: 'normal',\n },\n})\n\ntype HeadingElement = React.ElementRef<'h1'>\n\ninterface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {\n as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'\n asChild?: boolean\n color?: string\n html?: string\n}\n\nconst Heading = React.forwardRef<HeadingElement, HeadingProps>((props, forwardedRef) => {\n const { children, className, size, weights, asChild, as: Tag = 'h1', color, html, ...headingProps } = props\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: html },\n }\n : null\n\n const styleProps = color\n ? {\n style: {\n color,\n },\n }\n : null\n return (\n <Slot\n {...headingProps}\n ref={forwardedRef}\n className={cn(\n headingVariants({\n size,\n weights,\n }),\n className\n )}\n {...htmlContentProps}\n {...styleProps}\n >\n {asChild ? children : <Tag>{htmlContentProps ? null : children}</Tag>}\n </Slot>\n )\n})\n\nHeading.displayName = 'Heading'\n\nexport { Heading }\nexport type { HeadingProps }\n"],
5
+ "mappings": "AAsE4B,cAAAA,MAAA,oBAtE5B,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBACrB,OAAS,OAAAC,MAA8B,2BACvC,OAAOC,MAAW,QAElB,MAAMC,EAAkBF,EAAI,GAAI,CAC9B,SAAU,CACR,KAAM,CACJ,KAAM,GACN,EAAG,aACH,EAAG,aACH,EAAG,eACH,EAAG,aACH,EAAG,aACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,aACL,EACA,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,OAAQ,iBACR,KAAM,cACR,CACF,EACA,gBAAiB,CACf,KAAM,OACN,QAAS,QACX,CACF,CAAC,EAWKG,EAAUF,EAAM,WAAyC,CAACG,EAAOC,IAAiB,CACtF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,KAAAC,EAAM,QAAAC,EAAS,QAAAC,EAAS,GAAIC,EAAM,KAAM,MAAAC,EAAO,KAAAC,EAAM,GAAGC,CAAa,EAAIV,EAChGW,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACA,KAEEG,EAAaJ,EACf,CACE,MAAO,CACL,MAAAA,CACF,CACF,EACA,KACJ,OACEf,EAACE,EAAA,CACE,GAAGe,EACJ,IAAKT,EACL,UAAWP,EACTI,EAAgB,CACd,KAAAM,EACA,QAAAC,CACF,CAAC,EACDF,CACF,EACC,GAAGQ,EACH,GAAGC,EAEH,SAAAN,EAAUJ,EAAWT,EAACc,EAAA,CAAK,SAAAI,EAAmB,KAAOT,EAAS,EACjE,CAEJ,CAAC,EAEDH,EAAQ,YAAc",
6
+ "names": ["jsx", "cn", "Slot", "cva", "React", "headingVariants", "Heading", "props", "forwardedRef", "children", "className", "size", "weights", "asChild", "Tag", "color", "html", "headingProps", "htmlContentProps", "styleProps"]
7
7
  }
@@ -8,4 +8,5 @@ export * from './popover.js';
8
8
  export * from './radio.js';
9
9
  export * from './dialog.js';
10
10
  export * from './text.js';
11
+ export * from './heading.js';
11
12
  export { default as Theme } from './theme.js';
@@ -1,2 +1,2 @@
1
- import{default as r}from"./button.js";import{default as f}from"./badge.js";export*from"./input.js";import{default as a}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";import{default as B}from"./theme.js";export{f as Badge,r as Button,a as Checkbox,d as Skeleton,B as Theme};
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 '@/helpers/component-props';
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 '@/helpers/component-props'\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"],
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
- declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
4
- declare const RadioGroupItem: React.ForwardRefExoticComponent<Omit<RadioGroupPrimitive.RadioGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
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 e}from"react/jsx-runtime";import*as t from"react";import*as i from"@radix-ui/react-radio-group";import{CheckIcon as f}from"@radix-ui/react-icons";import{cn as m}from"../helpers/index.js";const s=t.forwardRef(({className:o,...a},r)=>e(i.Root,{className:m("grid gap-2",o),...a,ref:r}));s.displayName=i.Root.displayName;const p=t.forwardRef(({className:o,...a},r)=>e(i.Item,{ref:r,className:m("ai-border-primary ai-text-primary ai-ring-offset-background focus-visible:ai-ring-ring ai-aspect-square ai-size-4 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",o),...a,children:e(i.Indicator,{className:"ai-flex ai-items-center ai-justify-center",children:e(f,{className:"ai-text-primary ai-size-2.5 ai-fill-current"})})}));p.displayName=i.Item.displayName;export{s as RadioGroup,p as RadioGroupItem};
1
+ "use client";import{jsx as i}from"react/jsx-runtime";import*as e from"react";import*as p from"@radix-ui/react-radio-group";import{CheckIcon as c}from"@radix-ui/react-icons";import{cva as f}from"class-variance-authority";import{cn as d}from"../helpers/index.js";const n=e.createContext({size:"base"}),R=f("ai-border-primary ai-text-primary ai-ring-offset-background focus-visible:ai-ring-ring ai-aspect-square ai-rounded-full ai-border focus:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-cursor-not-allowed disabled:ai-opacity-50 data-[state=checked]:ai-bg-primary data-[state=checked]:ai-text-primary-foreground",{variants:{size:{sm:"ai-size-[14px]",base:"ai-size-4",lg:"ai-size-5"}},defaultVariants:{size:"base"}}),m=e.forwardRef(({className:o,children:a,size:r,...t},s)=>i(p.Root,{className:d("grid gap-2",o),...t,ref:s,children:i(n.Provider,{value:{size:r},children:a})}));m.displayName="RadioGroup";const u=e.forwardRef(({className:o,size:a,...r},t)=>{const{size:s}=e.useContext(n);return i(p.Item,{ref:t,className:d(R({size:a??s}),o),...r,children:i(p.Indicator,{className:"ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full",children:i(c,{})})})});u.displayName="RadioGroupItem";export{m as RadioGroup,u as RadioGroupItem};
2
2
  //# sourceMappingURL=radio.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/radio.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { CheckIcon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\n\nconst RadioGroup = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>\n>(({ className, ...props }, ref) => {\n return <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref} />\n})\nRadioGroup.displayName = RadioGroupPrimitive.Root.displayName\n\nconst RadioGroupItem = React.forwardRef<\n React.ElementRef<typeof RadioGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>\n>(({ className, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n 'ai-border-primary ai-text-primary ai-ring-offset-background focus-visible:ai-ring-ring ai-aspect-square ai-size-4 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',\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"ai-flex ai-items-center ai-justify-center\">\n <CheckIcon className=\"ai-text-primary ai-size-2.5 ai-fill-current\" />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n})\nRadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName\n\nexport { RadioGroup, RadioGroupItem }\n"],
5
- "mappings": "aAYS,cAAAA,MAAA,oBAVT,UAAYC,MAAW,QACvB,UAAYC,MAAyB,8BACrC,OAAS,aAAAC,MAAiB,wBAE1B,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAaJ,EAAM,WAGvB,CAAC,CAAE,UAAAK,EAAW,GAAGC,CAAM,EAAGC,IACnBR,EAACE,EAAoB,KAApB,CAAyB,UAAWE,EAAG,aAAcE,CAAS,EAAI,GAAGC,EAAO,IAAKC,EAAK,CAC/F,EACDH,EAAW,YAAcH,EAAoB,KAAK,YAElD,MAAMO,EAAiBR,EAAM,WAG3B,CAAC,CAAE,UAAAK,EAAW,GAAGC,CAAM,EAAGC,IAExBR,EAACE,EAAoB,KAApB,CACC,IAAKM,EACL,UAAWJ,EACT,iRACAE,CACF,EACC,GAAGC,EAEJ,SAAAP,EAACE,EAAoB,UAApB,CAA8B,UAAU,4CACvC,SAAAF,EAACG,EAAA,CAAU,UAAU,8CAA8C,EACrE,EACF,CAEH,EACDM,EAAe,YAAcP,EAAoB,KAAK",
6
- "names": ["jsx", "React", "RadioGroupPrimitive", "CheckIcon", "cn", "RadioGroup", "className", "props", "ref", "RadioGroupItem"]
4
+ "sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { CheckIcon } from '@radix-ui/react-icons'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport { cn } from '../helpers/index.js'\n\nconst RadioContext = React.createContext<{ size?: 'sm' | 'base' | 'lg' }>({\n size: 'base',\n})\n\nconst radioGroupVariants = cva(\n 'ai-border-primary ai-text-primary ai-ring-offset-background focus-visible:ai-ring-ring ai-aspect-square ai-rounded-full ai-border focus:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-cursor-not-allowed disabled:ai-opacity-50 data-[state=checked]:ai-bg-primary data-[state=checked]:ai-text-primary-foreground',\n {\n variants: {\n size: {\n sm: 'ai-size-[14px]',\n base: 'ai-size-4',\n lg: 'ai-size-5',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\ninterface RadioGroupProps extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root> {\n /** \u5C3A\u5BF8 */\n size?: 'sm' | 'base' | 'lg'\n}\n\nconst RadioGroup = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Root>, RadioGroupProps>(\n ({ className, children, size, ...props }, ref) => {\n return (\n <RadioGroupPrimitive.Root className={cn('grid gap-2', className)} {...props} ref={ref}>\n <RadioContext.Provider value={{ size }}>{children}</RadioContext.Provider>\n </RadioGroupPrimitive.Root>\n )\n }\n)\nRadioGroup.displayName = 'RadioGroup'\n\ninterface RadioGroupItemProps\n extends React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n VariantProps<typeof radioGroupVariants> {}\n\nconst RadioGroupItem = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioGroupItemProps>(\n ({ className, size, ...props }, ref) => {\n const { size: sizeFromParent } = React.useContext(RadioContext)\n return (\n <RadioGroupPrimitive.Item\n ref={ref}\n className={cn(\n radioGroupVariants({\n size: size ?? sizeFromParent,\n }),\n className\n )}\n {...props}\n >\n <RadioGroupPrimitive.Indicator className=\"ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full\">\n <CheckIcon />\n </RadioGroupPrimitive.Indicator>\n </RadioGroupPrimitive.Item>\n )\n }\n)\nRadioGroupItem.displayName = 'RadioGroupItem'\n\nexport { RadioGroup, RadioGroupItem }\nexport type { RadioGroupProps, RadioGroupItemProps }\n"],
5
+ "mappings": "aAqCQ,cAAAA,MAAA,oBAnCR,UAAYC,MAAW,QACvB,UAAYC,MAAyB,8BACrC,OAAS,aAAAC,MAAiB,wBAC1B,OAAS,OAAAC,MAA8B,2BACvC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAeL,EAAM,cAA+C,CACxE,KAAM,MACR,CAAC,EAEKM,EAAqBH,EACzB,0VACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,iBACJ,KAAM,YACN,GAAI,WACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAOMI,EAAaP,EAAM,WACvB,CAAC,CAAE,UAAAQ,EAAW,SAAAC,EAAU,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IAEtCb,EAACE,EAAoB,KAApB,CAAyB,UAAWG,EAAG,aAAcI,CAAS,EAAI,GAAGG,EAAO,IAAKC,EAChF,SAAAb,EAACM,EAAa,SAAb,CAAsB,MAAO,CAAE,KAAAK,CAAK,EAAI,SAAAD,EAAS,EACpD,CAGN,EACAF,EAAW,YAAc,aAMzB,MAAMM,EAAiBb,EAAM,WAC3B,CAAC,CAAE,UAAAQ,EAAW,KAAAE,EAAM,GAAGC,CAAM,EAAGC,IAAQ,CACtC,KAAM,CAAE,KAAME,CAAe,EAAId,EAAM,WAAWK,CAAY,EAC9D,OACEN,EAACE,EAAoB,KAApB,CACC,IAAKW,EACL,UAAWR,EACTE,EAAmB,CACjB,KAAMI,GAAQI,CAChB,CAAC,EACDN,CACF,EACC,GAAGG,EAEJ,SAAAZ,EAACE,EAAoB,UAApB,CAA8B,UAAU,gFACvC,SAAAF,EAACG,EAAA,EAAU,EACb,EACF,CAEJ,CACF,EACAW,EAAe,YAAc",
6
+ "names": ["jsx", "React", "RadioGroupPrimitive", "CheckIcon", "cva", "cn", "RadioContext", "radioGroupVariants", "RadioGroup", "className", "children", "size", "props", "ref", "RadioGroupItem", "sizeFromParent"]
7
7
  }
@@ -1,6 +1,9 @@
1
1
  import * as React from 'react';
2
- declare function Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime.js").JSX.Element;
3
- declare namespace Skeleton {
4
- var displayName: string;
2
+ import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
3
+ interface SkeletonProps extends ComponentPropsWithout<'span', RemovedProps> {
4
+ /** 是否正在加载 , 默认是true*/
5
+ loading?: boolean;
5
6
  }
7
+ declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLSpanElement>>;
6
8
  export default Skeleton;
9
+ export type { SkeletonProps };
@@ -1,2 +1,5 @@
1
- import{jsx as o}from"react/jsx-runtime";import"react";import{cn as i}from"../helpers/index.js";function e({className:t,...a}){return o("div",{className:i("ai-bg-skeleton ai-size-12 ai-animate-pulse",t),...a})}e.displayName="Skeleton";var m=e;export{m as default};
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\nfunction Skeleton({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) {\n return <div className={cn('ai-bg-skeleton ai-size-12 ai-animate-pulse', className)} {...props} />\n}\n\nSkeleton.displayName = 'Skeleton'\n\nexport default Skeleton\n"],
5
- "mappings": "AAIS,cAAAA,MAAA,oBAJT,MAAuB,QACvB,OAAS,MAAAC,MAAU,sBAEnB,SAASC,EAAS,CAAE,UAAAC,EAAW,GAAGC,CAAM,EAAyC,CAC/E,OAAOJ,EAAC,OAAI,UAAWC,EAAG,6CAA8CE,CAAS,EAAI,GAAGC,EAAO,CACjG,CAEAF,EAAS,YAAc,WAEvB,IAAOG,EAAQH",
6
- "names": ["jsx", "cn", "Skeleton", "className", "props", "skeleton_default"]
4
+ "sourcesContent": ["import * as React from 'react'\nimport { cn } from '../helpers/index.js'\nimport { Slot } from '@radix-ui/react-slot'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\ntype SkeletonElement = React.ElementRef<'span'>\n\ninterface SkeletonProps extends ComponentPropsWithout<'span', RemovedProps> {\n /** \u662F\u5426\u6B63\u5728\u52A0\u8F7D , \u9ED8\u8BA4\u662Ftrue*/\n loading?: boolean\n}\n\nconst Skeleton = React.forwardRef<SkeletonElement, SkeletonProps>((props, forwardedRef) => {\n const { children, className, loading = true, ...skeletonProps } = props\n\n if (!loading) return children\n const Tag = React.isValidElement(children) ? Slot : 'span'\n\n return (\n <Tag\n ref={forwardedRef}\n className={cn(\n `ai-bg-skeleton ai-animate-pulse empty:ai-block data-[inline-skeleton=true]:ai-leading-[0] !ai-bg-none !ai-bg-clip-border !ai-border-none !ai-shadow-none \n !ai-text-transparent !ai-outline-none !ai-select-none !ai-cursor-default !ai-pointer-events-none !ai-decoration-clone\n after:!ai-invisible before:!ai-invisible [&>*]:!ai-invisible\n `,\n className\n )}\n data-inline-skeleton={React.isValidElement(children) ? undefined : true}\n tabIndex={-1}\n {...skeletonProps}\n >\n {children}\n </Tag>\n )\n})\n\nSkeleton.displayName = 'Skeleton'\n\nexport default Skeleton\nexport type { SkeletonProps }\n"],
5
+ "mappings": "AAmBI,cAAAA,MAAA,oBAnBJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBACnB,OAAS,QAAAC,MAAY,uBAUrB,MAAMC,EAAWH,EAAM,WAA2C,CAACI,EAAOC,IAAiB,CACzF,KAAM,CAAE,SAAAC,EAAU,UAAAC,EAAW,QAAAC,EAAU,GAAM,GAAGC,CAAc,EAAIL,EAElE,GAAI,CAACI,EAAS,OAAOF,EACrB,MAAMI,EAAMV,EAAM,eAAeM,CAAQ,EAAIJ,EAAO,OAEpD,OACEH,EAACW,EAAA,CACC,IAAKL,EACL,UAAWJ,EACT;AAAA;AAAA;AAAA,UAIAM,CACF,EACA,uBAAsBP,EAAM,eAAeM,CAAQ,EAAI,OAAY,GACnE,SAAU,GACT,GAAGG,EAEH,SAAAH,EACH,CAEJ,CAAC,EAEDH,EAAS,YAAc,WAEvB,IAAOQ,EAAQR",
6
+ "names": ["jsx", "React", "cn", "Slot", "Skeleton", "props", "forwardedRef", "children", "className", "loading", "skeletonProps", "Tag", "skeleton_default"]
7
7
  }
@@ -1,16 +1,30 @@
1
1
  import * as React from 'react';
2
2
  import { type VariantProps } from 'class-variance-authority';
3
+ import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
3
4
  declare const textVariants: (props?: ({
4
- size?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
5
+ size?: "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
5
6
  weights?: "bold" | "light" | "normal" | "medium" | null | undefined;
6
7
  } & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
7
- interface TextProps extends React.ComponentPropsWithoutRef<'span'>, VariantProps<typeof textVariants> {
8
- as?: 'div' | 'label' | 'p' | 'span' | undefined;
8
+ type TextSpanProps = {
9
+ as?: 'span';
10
+ } & ComponentPropsWithout<'span', RemovedProps>;
11
+ type TextDivProps = {
12
+ as: 'div';
13
+ } & ComponentPropsWithout<'div', RemovedProps>;
14
+ type TextLabelProps = {
15
+ as: 'label';
16
+ } & ComponentPropsWithout<'label', RemovedProps>;
17
+ type TextPProps = {
18
+ as: 'p';
19
+ } & ComponentPropsWithout<'p', RemovedProps>;
20
+ interface CommonTextProps extends VariantProps<typeof textVariants> {
21
+ as?: 'div' | 'label' | 'p' | 'span';
9
22
  asChild?: boolean;
10
23
  color?: string;
11
24
  /** 相当于 dangerouslySetInnerHTML */
12
25
  html?: string;
13
26
  }
27
+ type TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);
14
28
  declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
15
29
  export { Text };
16
30
  export type { TextProps };
@@ -1,2 +1,2 @@
1
- import{jsx as i}from"react/jsx-runtime";import*as d from"react";import{Slot as c}from"@radix-ui/react-slot";import{cn as h}from"../helpers/index.js";import{cva as g}from"class-variance-authority";const T=g("",{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"}}),o=d.forwardRef((n,s)=>{const{children:t,size:l,className:r,asChild:x,as:m="span",color:p,html:e,...f}=n,a=e?{dangerouslySetInnerHTML:{__html:e}}:null;return i(c,{...f,ref:s,className:h(T({size:l}),r,`text-[${p}]`),...a,children:x?t:i(m,{children:a?null:t})})});o.displayName="Text";export{o as Text};
1
+ import{jsx as p}from"react/jsx-runtime";import*as h from"react";import{Slot as f}from"@radix-ui/react-slot";import{cn as c}from"../helpers/index.js";import{cva as y}from"class-variance-authority";const u=y("",{variants:{size:{none:"",1:"ai-text-xs",2:"ai-text-sm",3:"ai-text-base",4:"ai-text-lg",5:"ai-text-xl",6:"ai-text-2xl",7:"ai-text-3xl",8:"ai-text-4xl",9:"ai-text-5xl"},weights:{light:"ai-font-light",normal:"ai-font-normal",medium:"ai-font-medium",bold:"ai-font-bold"}},defaultVariants:{size:"none",weights:"normal"}}),a=h.forwardRef((n,r)=>{const{children:t,size:i="none",weights:l,className:m,asChild:x,as:P="span",color:e,html:o,...d}=n,s=o?{dangerouslySetInnerHTML:{__html:o}}:null,T=e?{style:{color:e}}:null;return p(f,{...d,ref:r,className:c(u({size:i,weights:l}),m),...s,...T,children:x?t:p(P,{children:s?null:t})})});a.displayName="Text";export{a as Text};
2
2
  //# sourceMappingURL=text.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/text.tsx"],
4
- "sourcesContent": ["import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nconst textVariants = cva('', {\n variants: {\n size: {\n 1: 'ai-text-xs',\n 2: 'ai-text-sm',\n 3: 'ai-text-base',\n 4: 'ai-text-lg',\n 5: 'ai-text-xl',\n 6: 'ai-text-2xl',\n 7: 'ai-text-3xl',\n 8: 'ai-text-4xl',\n 9: 'ai-text-5xl',\n },\n weights: {\n light: 'ai-font-light',\n normal: 'ai-font-normal',\n medium: 'ai-font-medium',\n bold: 'ai-font-bold',\n },\n },\n defaultVariants: {\n size: 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: size,\n }),\n className,\n `text-[${color}]`\n )}\n {...htmlContentProps}\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": "AA8D4B,cAAAA,MAAA,oBA9D5B,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,UAAAC,EAAW,QAAAC,EAAS,GAAIC,EAAM,OAAQ,MAAAC,EAAO,KAAAC,EAAM,GAAGC,CAAU,EAAIT,EAEtFU,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACA,KAEJ,OACEf,EAACE,EAAA,CACE,GAAGc,EACJ,IAAKR,EACL,UAAWL,EACTE,EAAa,CACX,KAAMK,CACR,CAAC,EACDC,EACA,SAASG,CAAK,GAChB,EACC,GAAGG,EAEH,SAAAL,EAAUH,EAAWT,EAACa,EAAA,CAAK,SAAAI,EAAmB,KAAOR,EAAS,EACjE,CAEJ,CAAC,EACDH,EAAK,YAAc",
6
- "names": ["jsx", "React", "Slot", "cn", "cva", "textVariants", "Text", "props", "forwardedRef", "children", "size", "className", "asChild", "Tag", "color", "html", "textProps", "htmlContentProps"]
4
+ "sourcesContent": ["import * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cn } from '../helpers/index.js'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js'\n\nconst textVariants = cva('', {\n variants: {\n size: {\n none: '',\n 1: 'ai-text-xs',\n 2: 'ai-text-sm',\n 3: 'ai-text-base',\n 4: 'ai-text-lg',\n 5: 'ai-text-xl',\n 6: 'ai-text-2xl',\n 7: 'ai-text-3xl',\n 8: 'ai-text-4xl',\n 9: 'ai-text-5xl',\n },\n weights: {\n light: 'ai-font-light',\n normal: 'ai-font-normal',\n medium: 'ai-font-medium',\n bold: 'ai-font-bold',\n },\n },\n defaultVariants: {\n size: 'none',\n weights: 'normal',\n },\n})\n\ntype TextElement = React.ElementRef<'span'>\ntype TextSpanProps = { as?: 'span' } & ComponentPropsWithout<'span', RemovedProps>\ntype TextDivProps = { as: 'div' } & ComponentPropsWithout<'div', RemovedProps>\ntype TextLabelProps = { as: 'label' } & ComponentPropsWithout<'label', RemovedProps>\ntype TextPProps = { as: 'p' } & ComponentPropsWithout<'p', RemovedProps>\n\ninterface CommonTextProps extends VariantProps<typeof textVariants> {\n as?: 'div' | 'label' | 'p' | 'span'\n asChild?: boolean\n color?: string\n /** \u76F8\u5F53\u4E8E dangerouslySetInnerHTML */\n html?: string\n}\n\ntype TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps)\n\nconst Text = React.forwardRef<TextElement, TextProps>((props, forwardedRef) => {\n const { children, size = 'none', weights, className, asChild, as: Tag = 'span', color, html, ...textProps } = props\n\n const htmlContentProps = html\n ? {\n dangerouslySetInnerHTML: { __html: html },\n }\n : null\n\n const styleProps = color\n ? {\n style: {\n color,\n },\n }\n : null\n\n return (\n <Slot\n {...textProps}\n ref={forwardedRef}\n className={cn(\n textVariants({\n size,\n weights,\n }),\n className\n )}\n {...htmlContentProps}\n {...styleProps}\n >\n {asChild ? children : <Tag>{htmlContentProps ? null : children}</Tag>}\n </Slot>\n )\n})\nText.displayName = 'Text'\n\nexport { Text }\nexport type { TextProps }\n"],
5
+ "mappings": "AAgF4B,cAAAA,MAAA,oBAhF5B,UAAYC,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,MAAAC,MAAU,sBACnB,OAA4B,OAAAC,MAAW,2BAGvC,MAAMC,EAAeD,EAAI,GAAI,CAC3B,SAAU,CACR,KAAM,CACJ,KAAM,GACN,EAAG,aACH,EAAG,aACH,EAAG,eACH,EAAG,aACH,EAAG,aACH,EAAG,cACH,EAAG,cACH,EAAG,cACH,EAAG,aACL,EACA,QAAS,CACP,MAAO,gBACP,OAAQ,iBACR,OAAQ,iBACR,KAAM,cACR,CACF,EACA,gBAAiB,CACf,KAAM,OACN,QAAS,QACX,CACF,CAAC,EAkBKE,EAAOL,EAAM,WAAmC,CAACM,EAAOC,IAAiB,CAC7E,KAAM,CAAE,SAAAC,EAAU,KAAAC,EAAO,OAAQ,QAAAC,EAAS,UAAAC,EAAW,QAAAC,EAAS,GAAIC,EAAM,OAAQ,MAAAC,EAAO,KAAAC,EAAM,GAAGC,CAAU,EAAIV,EAExGW,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACA,KAEEG,EAAaJ,EACf,CACE,MAAO,CACL,MAAAA,CACF,CACF,EACA,KAEJ,OACEf,EAACE,EAAA,CACE,GAAGe,EACJ,IAAKT,EACL,UAAWL,EACTE,EAAa,CACX,KAAAK,EACA,QAAAC,CACF,CAAC,EACDC,CACF,EACC,GAAGM,EACH,GAAGC,EAEH,SAAAN,EAAUJ,EAAWT,EAACc,EAAA,CAAK,SAAAI,EAAmB,KAAOT,EAAS,EACjE,CAEJ,CAAC,EACDH,EAAK,YAAc",
6
+ "names": ["jsx", "React", "Slot", "cn", "cva", "textVariants", "Text", "props", "forwardedRef", "children", "size", "weights", "className", "asChild", "Tag", "color", "html", "textProps", "htmlContentProps", "styleProps"]
7
7
  }
@@ -1,5 +1,46 @@
1
- declare const _default: {
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 _default;
5
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
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 t}from"react/jsx-runtime";import{Checkbox as a}from"../components/index";import"react";var s={title:"Components/Checkbox"};const m=()=>t("div",{className:"ai-flex ai-items-center ai-space-x-2",children:[e(a,{id:"terms"}),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{m as Default,s as default};
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\nexport default { title: 'Components/Checkbox' }\n\nexport const Default = () => (\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms\" />\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": "AAME,OACE,OAAAA,EADF,QAAAC,MAAA,oBANF,OAAS,YAAAC,MAAgB,sBACzB,MAAkB,QAElB,IAAOC,EAAQ,CAAE,MAAO,qBAAsB,EAEvC,MAAMC,EAAU,IACrBH,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,QAAQ,EACrBF,EAAC,SACC,QAAQ,QACR,UAAU,4GACX,uCAED,GACF",
6
- "names": ["jsx", "jsxs", "Checkbox", "checkbox_stories_default", "Default"]
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react/*'\nimport { Checkbox } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Checkbox',\n component: Checkbox,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u590D\u9009\u6846, \u57FA\u4E8E@radix-ui/react-checkbox https://www.radix-ui.com/primitives/docs/components/checkbox',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n description: '\u5C3A\u5BF8',\n table: {\n defaultValue: { summary: 'base' },\n },\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof Checkbox>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n size: 'base',\n },\n}\n\nexport const Sizes = () => (\n <div className=\"ai-flex ai-flex-col ai-gap-2\">\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms\" size=\"sm\" />\n <label\n htmlFor=\"terms\"\n className=\"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms1\" size=\"base\" />\n <label\n htmlFor=\"terms1\"\n className=\"ai-text-base ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms2\" size=\"lg\" />\n <label\n htmlFor=\"terms2\"\n className=\"ai-text-lg ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n </div>\n)\nSizes.parameters = {\n docs: {\n description: {\n story: '\u4E0D\u540C\u7684\u5C3A\u5BF8',\n },\n },\n}\n\nexport const Disabled = () => (\n <div className=\"ai-flex ai-items-center ai-space-x-2\">\n <Checkbox id=\"terms\" disabled />\n <label\n htmlFor=\"terms\"\n className=\"ai-text-sm ai-font-medium ai-leading-none peer-disabled:ai-cursor-not-allowed peer-disabled:ai-opacity-70\"\n >\n Accept terms and conditions\n </label>\n </div>\n)\n"],
5
+ "mappings": "AA6CI,OACE,OAAAA,EADF,QAAAC,MAAA,oBA5CJ,OAAS,YAAAC,MAAgB,sBACzB,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,sBACP,UAAWD,EACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,uHACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,OAAQ,IAAI,EAC5B,YAAa,eACb,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,CACF,EACA,KAAM,CACJ,KAAM,MACR,CACF,EAEA,IAAOE,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,KAAM,MACR,CACF,EAEaC,EAAQ,IACnBL,EAAC,OAAI,UAAU,+BACb,UAAAA,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,QAAQ,KAAK,KAAK,EAC/BF,EAAC,SACC,QAAQ,QACR,UAAU,4GACX,uCAED,GACF,EACAC,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,SAAS,KAAK,OAAO,EAClCF,EAAC,SACC,QAAQ,SACR,UAAU,8GACX,uCAED,GACF,EACAC,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,SAAS,KAAK,KAAK,EAChCF,EAAC,SACC,QAAQ,SACR,UAAU,4GACX,uCAED,GACF,GACF,EAEFM,EAAM,WAAa,CACjB,KAAM,CACJ,YAAa,CACX,MAAO,gCACT,CACF,CACF,EAEO,MAAMC,EAAW,IACtBN,EAAC,OAAI,UAAU,uCACb,UAAAD,EAACE,EAAA,CAAS,GAAG,QAAQ,SAAQ,GAAC,EAC9BF,EAAC,SACC,QAAQ,QACR,UAAU,4GACX,uCAED,GACF",
6
+ "names": ["jsx", "jsxs", "Checkbox", "meta", "checkbox_stories_default", "Default", "Sizes", "Disabled"]
7
7
  }
@@ -1,5 +1,20 @@
1
- declare const _default: {
1
+ import React from 'react';
2
+ import { Dialog } from '../components/index';
3
+ import type { StoryObj } from '@storybook/react/*';
4
+ declare const meta: {
2
5
  title: string;
6
+ component: React.FC<import("@radix-ui/react-dialog").DialogProps>;
7
+ subcomponents: any;
8
+ parameters: {
9
+ layout: string;
10
+ docs: {
11
+ description: {
12
+ component: string;
13
+ };
14
+ };
15
+ };
16
+ tags: string[];
3
17
  };
4
- export default _default;
5
- export declare const Default: () => import("react/jsx-runtime").JSX.Element;
18
+ export default meta;
19
+ type Story = StoryObj<typeof Dialog>;
20
+ export declare const Default: Story;
@@ -1,2 +1,2 @@
1
- import{jsx as a,jsxs as e}from"react/jsx-runtime";import"react";import{Button as l,Dialog as o,DialogContent as t,DialogDescription as r,DialogFooter as s,DialogHeader as g,DialogTitle as n,DialogTrigger as m,Input as i}from"../components/index";var D={title:"Components/Dialog"};const u=()=>e(o,{children:[a(m,{asChild:!0,children:a("button",{children:"Edit Profile"})}),e(t,{className:"sm:ai-max-w-[425px]",children:[e(g,{children:[a(n,{children:"Edit profile"}),a(r,{children:"Make changes to your profile here. Click save when you're done."})]}),e("div",{className:"ai-grid ai-gap-4 ai-py-4",children:[e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"name",className:"ai-text-right",children:"Name"}),a(i,{id:"name",defaultValue:"Pedro Duarte",className:"ai-col-span-3"})]}),e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"username",className:"ai-text-right",children:"Username"}),a(i,{id:"username",defaultValue:"@peduarte",className:"ai-col-span-3"})]})]}),a(s,{children:a(l,{type:"submit",children:"Save changes"})})]})]});export{u as Default,D as default};
1
+ import{Fragment as d,jsx as a,jsxs as e}from"react/jsx-runtime";import"react";import{Button as g,Dialog as m,DialogContent as i,DialogDescription as o,DialogFooter as t,DialogHeader as l,DialogTitle as r,DialogTrigger as s,Input as n}from"../components/index";const c={title:"Components/Dialog",component:m,subcomponents:{DialogTrigger:s,DialogContent:i,DialogHeader:l,DialogTitle:r,DialogDescription:o,DialogFooter:t},parameters:{layout:"centered",docs:{description:{component:"\u5F39\u7A97\u7EC4\u4EF6\uFF0C\u57FA\u4E8E@radix-ui/react-dialog\uFF0Chttps://www.radix-ui.com/primitives/docs/components/dialog "}}},tags:["autodocs"]};var y=c;const f={args:{children:e(d,{children:[a(s,{asChild:!0,children:a("button",{children:"Edit Profile"})}),e(i,{className:"sm:ai-max-w-[425px]",children:[e(l,{children:[a(r,{children:"Edit profile"}),a(o,{children:"Make changes to your profile here. Click save when you're done."})]}),e("div",{className:"ai-grid ai-gap-4 ai-py-4",children:[e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"name",className:"ai-text-right",children:"Name"}),a(n,{id:"name",defaultValue:"Pedro Duarte",className:"ai-col-span-3"})]}),e("div",{className:"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4",children:[a("label",{htmlFor:"username",className:"ai-text-right",children:"Username"}),a(n,{id:"username",defaultValue:"@peduarte",className:"ai-col-span-3"})]})]}),a(t,{children:a(g,{type:"submit",children:"Save changes"})})]})]})}};export{f as Default,y as default};
2
2
  //# sourceMappingURL=dialog.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/stories/dialog.stories.tsx"],
4
- "sourcesContent": ["import React from 'react'\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n Input,\n} from '../components/index'\n\nexport default { title: 'Components/Dialog' }\n\nexport const Default = () => (\n <Dialog>\n <DialogTrigger asChild>\n <button>Edit Profile</button>\n </DialogTrigger>\n <DialogContent className=\"sm:ai-max-w-[425px]\">\n <DialogHeader>\n <DialogTitle>Edit profile</DialogTitle>\n <DialogDescription>Make changes to your profile here. Click save when you're done.</DialogDescription>\n </DialogHeader>\n <div className=\"ai-grid ai-gap-4 ai-py-4\">\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"name\" className=\"ai-text-right\">\n Name\n </label>\n <Input id=\"name\" defaultValue=\"Pedro Duarte\" className=\"ai-col-span-3\" />\n </div>\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"username\" className=\"ai-text-right\">\n Username\n </label>\n <Input id=\"username\" defaultValue=\"@peduarte\" className=\"ai-col-span-3\" />\n </div>\n </div>\n <DialogFooter>\n <Button type=\"submit\">Save changes</Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n)\n"],
5
- "mappings": "AAkBM,cAAAA,EAGA,QAAAC,MAHA,oBAlBN,MAAkB,QAClB,OACE,UAAAC,EACA,UAAAC,EACA,iBAAAC,EACA,qBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,SAAAC,MACK,sBAEP,IAAOC,EAAQ,CAAE,MAAO,mBAAoB,EAErC,MAAMC,EAAU,IACrBX,EAACE,EAAA,CACC,UAAAH,EAACS,EAAA,CAAc,QAAO,GACpB,SAAAT,EAAC,UAAO,wBAAY,EACtB,EACAC,EAACG,EAAA,CAAc,UAAU,sBACvB,UAAAH,EAACM,EAAA,CACC,UAAAP,EAACQ,EAAA,CAAY,wBAAY,EACzBR,EAACK,EAAA,CAAkB,2EAA+D,GACpF,EACAJ,EAAC,OAAI,UAAU,2BACb,UAAAA,EAAC,OAAI,UAAU,kDACb,UAAAD,EAAC,SAAM,QAAQ,OAAO,UAAU,gBAAgB,gBAEhD,EACAA,EAACU,EAAA,CAAM,GAAG,OAAO,aAAa,eAAe,UAAU,gBAAgB,GACzE,EACAT,EAAC,OAAI,UAAU,kDACb,UAAAD,EAAC,SAAM,QAAQ,WAAW,UAAU,gBAAgB,oBAEpD,EACAA,EAACU,EAAA,CAAM,GAAG,WAAW,aAAa,YAAY,UAAU,gBAAgB,GAC1E,GACF,EACAV,EAACM,EAAA,CACC,SAAAN,EAACE,EAAA,CAAO,KAAK,SAAS,wBAAY,EACpC,GACF,GACF",
6
- "names": ["jsx", "jsxs", "Button", "Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger", "Input", "dialog_stories_default", "Default"]
4
+ "sourcesContent": ["import React from 'react'\nimport {\n Button,\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n DialogTrigger,\n Input,\n} from '../components/index'\nimport type { Meta, StoryObj } from '@storybook/react/*'\n\nconst meta = {\n title: 'Components/Dialog',\n component: Dialog,\n subcomponents: {\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogDescription,\n DialogFooter,\n } as any,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u5F39\u7A97\u7EC4\u4EF6\uFF0C\u57FA\u4E8E@radix-ui/react-dialog\uFF0Chttps://www.radix-ui.com/primitives/docs/components/dialog ',\n },\n },\n },\n tags: ['autodocs'],\n} satisfies Meta<typeof Dialog>\n\nexport default meta\n\ntype Story = StoryObj<typeof Dialog>\n\nexport const Default: Story = {\n args: {\n children: (\n <>\n <DialogTrigger asChild>\n <button>Edit Profile</button>\n </DialogTrigger>\n <DialogContent className=\"sm:ai-max-w-[425px]\">\n <DialogHeader>\n <DialogTitle>Edit profile</DialogTitle>\n <DialogDescription>Make changes to your profile here. Click save when you're done.</DialogDescription>\n </DialogHeader>\n <div className=\"ai-grid ai-gap-4 ai-py-4\">\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"name\" className=\"ai-text-right\">\n Name\n </label>\n <Input id=\"name\" defaultValue=\"Pedro Duarte\" className=\"ai-col-span-3\" />\n </div>\n <div className=\"ai-grid ai-grid-cols-4 ai-items-center ai-gap-4\">\n <label htmlFor=\"username\" className=\"ai-text-right\">\n Username\n </label>\n <Input id=\"username\" defaultValue=\"@peduarte\" className=\"ai-col-span-3\" />\n </div>\n </div>\n <DialogFooter>\n <Button type=\"submit\">Save changes</Button>\n </DialogFooter>\n </DialogContent>\n </>\n ),\n },\n}\n"],
5
+ "mappings": "AA2CM,mBAAAA,EAEI,OAAAC,EAGA,QAAAC,MALJ,oBA3CN,MAAkB,QAClB,OACE,UAAAC,EACA,UAAAC,EACA,iBAAAC,EACA,qBAAAC,EACA,gBAAAC,EACA,gBAAAC,EACA,eAAAC,EACA,iBAAAC,EACA,SAAAC,MACK,sBAGP,MAAMC,EAAO,CACX,MAAO,oBACP,UAAWR,EACX,cAAe,CACb,cAAAM,EACA,cAAAL,EACA,aAAAG,EACA,YAAAC,EACA,kBAAAH,EACA,aAAAC,CACF,EACA,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,mIACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,CACnB,EAEA,IAAOM,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,SACEZ,EAAAF,EAAA,CACE,UAAAC,EAACS,EAAA,CAAc,QAAO,GACpB,SAAAT,EAAC,UAAO,wBAAY,EACtB,EACAC,EAACG,EAAA,CAAc,UAAU,sBACvB,UAAAH,EAACM,EAAA,CACC,UAAAP,EAACQ,EAAA,CAAY,wBAAY,EACzBR,EAACK,EAAA,CAAkB,2EAA+D,GACpF,EACAJ,EAAC,OAAI,UAAU,2BACb,UAAAA,EAAC,OAAI,UAAU,kDACb,UAAAD,EAAC,SAAM,QAAQ,OAAO,UAAU,gBAAgB,gBAEhD,EACAA,EAACU,EAAA,CAAM,GAAG,OAAO,aAAa,eAAe,UAAU,gBAAgB,GACzE,EACAT,EAAC,OAAI,UAAU,kDACb,UAAAD,EAAC,SAAM,QAAQ,WAAW,UAAU,gBAAgB,oBAEpD,EACAA,EAACU,EAAA,CAAM,GAAG,WAAW,aAAa,YAAY,UAAU,gBAAgB,GAC1E,GACF,EACAV,EAACM,EAAA,CACC,SAAAN,EAACE,EAAA,CAAO,KAAK,SAAS,wBAAY,EACpC,GACF,GACF,CAEJ,CACF",
6
+ "names": ["Fragment", "jsx", "jsxs", "Button", "Dialog", "DialogContent", "DialogDescription", "DialogFooter", "DialogHeader", "DialogTitle", "DialogTrigger", "Input", "meta", "dialog_stories_default", "Default"]
7
7
  }
@@ -0,0 +1,70 @@
1
+ import type { StoryObj } from '@storybook/react';
2
+ import React from 'react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: React.ForwardRefExoticComponent<import("../components/heading").HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
6
+ parameters: {
7
+ layout: string;
8
+ docs: {
9
+ description: {
10
+ component: string;
11
+ };
12
+ };
13
+ };
14
+ tags: string[];
15
+ argTypes: {
16
+ size: {
17
+ control: {
18
+ type: "select";
19
+ };
20
+ options: (string | number)[];
21
+ description: string;
22
+ table: {
23
+ defaultValue: {
24
+ summary: string;
25
+ };
26
+ };
27
+ };
28
+ weights: {
29
+ control: {
30
+ type: "select";
31
+ };
32
+ options: string[];
33
+ table: {
34
+ defaultValue: {
35
+ summary: string;
36
+ };
37
+ };
38
+ };
39
+ color: {
40
+ control: {
41
+ type: "color";
42
+ };
43
+ };
44
+ as: {
45
+ control: {
46
+ type: "select";
47
+ };
48
+ options: string[];
49
+ description: string;
50
+ table: {
51
+ defaultValue: {
52
+ summary: string;
53
+ };
54
+ };
55
+ };
56
+ html: {
57
+ type: "string";
58
+ description: string;
59
+ };
60
+ };
61
+ args: {
62
+ as: "h1";
63
+ size: "none";
64
+ weights: "normal";
65
+ };
66
+ };
67
+ export default meta;
68
+ type Story = StoryObj<typeof meta>;
69
+ export declare const Default: Story;
70
+ export declare const All: Story;
@@ -0,0 +1,2 @@
1
+ import{Fragment as r,jsx as o,jsxs as a}from"react/jsx-runtime";import{Heading as e}from"../components/index";import"react";const t={title:"Typography/Heading",component:e,parameters:{layout:"centered",docs:{description:{component:"Heading \u7EC4\u4EF6, \u57FA\u672C\u548Ctext \u7EC4\u4EF6\u4E00\u6837\uFF0C\u53EA\u662F\u9ED8\u8BA4\u7684\u6807\u7B7E\u7C7B\u578B\u4E0D\u4E00\u6837"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["none",1,2,3,4,5,6,7,8,9],description:"\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8",table:{defaultValue:{summary:"none"}}},weights:{control:{type:"select"},options:["light","normal","medium","bold"],table:{defaultValue:{summary:"normal"}}},color:{control:{type:"color"}},as:{control:{type:"select"},options:["h1","h2","h3","h4","h5","h6"],description:"html \u6807\u7B7E\u7C7B\u578B",table:{defaultValue:{summary:"h1"}}},html:{type:"string",description:"\u76F8\u5F53\u4E8E dangerouslySetInnerHTML"}},args:{as:"h1",size:"none",weights:"normal"}};var l=t;const d={args:{as:"h1",children:" The quick brown fox jumps over the lazy dog."}},p={render:()=>a(r,{children:[o(e,{size:1,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:2,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:3,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:4,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:5,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:6,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:7,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:8,children:"The quick brown fox jumps over the lazy dog."}),o(e,{size:9,children:"The quick brown fox jumps over the lazy dog."})]})};export{p as All,d as Default,l as default};
2
+ //# sourceMappingURL=heading.stories.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/stories/heading.stories.tsx"],
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Heading } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Typography/Heading',\n component: Heading,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: 'Heading \u7EC4\u4EF6, \u57FA\u672C\u548Ctext \u7EC4\u4EF6\u4E00\u6837\uFF0C\u53EA\u662F\u9ED8\u8BA4\u7684\u6807\u7B7E\u7C7B\u578B\u4E0D\u4E00\u6837',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['none', 1, 2, 3, 4, 5, 6, 7, 8, 9],\n description: '\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8',\n table: {\n defaultValue: { summary: 'none' },\n },\n },\n weights: {\n control: {\n type: 'select',\n },\n options: ['light', 'normal', 'medium', 'bold'],\n table: {\n defaultValue: { summary: 'normal' },\n },\n },\n color: {\n control: {\n type: 'color',\n },\n },\n as: {\n control: {\n type: 'select',\n },\n options: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'],\n description: 'html \u6807\u7B7E\u7C7B\u578B',\n table: {\n defaultValue: { summary: 'h1' },\n },\n },\n html: {\n type: 'string',\n description: '\u76F8\u5F53\u4E8E dangerouslySetInnerHTML',\n },\n },\n args: {\n as: 'h1',\n size: 'none',\n weights: 'normal',\n },\n} satisfies Meta<typeof Heading>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n as: 'h1',\n children: ' The quick brown fox jumps over the lazy dog.',\n },\n}\n\nexport const All: Story = {\n render: () => (\n <>\n <Heading size={1}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={2}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={3}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={4}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={5}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={6}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={7}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={8}>The quick brown fox jumps over the lazy dog.</Heading>\n <Heading size={9}>The quick brown fox jumps over the lazy dog.</Heading>\n </>\n ),\n}\n"],
5
+ "mappings": "AA6EI,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBA3EJ,OAAS,WAAAC,MAAe,sBACxB,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,qBACP,UAAWD,EACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,qJACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,OAAQ,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EAC3C,YAAa,6LACb,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,QAAS,CACP,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,QAAS,SAAU,SAAU,MAAM,EAC7C,MAAO,CACL,aAAc,CAAE,QAAS,QAAS,CACpC,CACF,EACA,MAAO,CACL,QAAS,CACP,KAAM,OACR,CACF,EACA,GAAI,CACF,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,IAAI,EAC5C,YAAa,gCACb,MAAO,CACL,aAAc,CAAE,QAAS,IAAK,CAChC,CACF,EACA,KAAM,CACJ,KAAM,SACN,YAAa,4CACf,CACF,EACA,KAAM,CACJ,GAAI,KACJ,KAAM,OACN,QAAS,QACX,CACF,EAEA,IAAOE,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CACJ,GAAI,KACJ,SAAU,+CACZ,CACF,EAEaC,EAAa,CACxB,OAAQ,IACNL,EAAAF,EAAA,CACE,UAAAC,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,EAC9DF,EAACE,EAAA,CAAQ,KAAM,EAAG,wDAA4C,GAChE,CAEJ",
6
+ "names": ["Fragment", "jsx", "jsxs", "Heading", "meta", "heading_stories_default", "Default", "All"]
7
+ }
@@ -9,6 +9,11 @@ declare const meta: {
9
9
  };
10
10
  parameters: {
11
11
  layout: string;
12
+ docs: {
13
+ description: {
14
+ component: string;
15
+ };
16
+ };
12
17
  };
13
18
  tags: string[];
14
19
  argTypes: {
@@ -1,2 +1,2 @@
1
- import{jsx as t}from"react/jsx-runtime";import{Button as r,Input as e,InputSlot as o}from"../components/index";import{SearchIcon as n}from"@storybook/icons";import"react";const p={title:"Components/Input",component:e,subcomponents:{InputSlot:o},parameters:{layout:"centered"},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"]}},args:{size:"base"}};var l=p;const m={args:{}},c={render(){return t(e,{className:"ai-rounded-3xl ai-pr-0",placeholder:"Enter your email",type:"text",children:t(o,{side:"right",children:t(r,{className:"ai-h-full ai-rounded-none",size:"sm",children:"subscribe"})})})}},y={render(){return t(e,{type:"text",placeholder:"search in site",children:t(o,{side:"left",children:t(n,{})})})}};export{m as Default,c as WithButton,y as WithIcon,l as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{Button as n,Input as e,InputSlot as o}from"../components/index";import{SearchIcon as r}from"@storybook/icons";import"react";const p={title:"Components/Input",component:e,subcomponents:{InputSlot:o},parameters:{layout:"centered",docs:{description:{component:"Input \u7EC4\u4EF6, \u7528\u4E8E\u8F93\u5165\u6846, \u53EF\u4EE5\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9, \u6BD4\u5982icon, \u6309\u94AE"}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},options:["sm","base","lg"]}},args:{size:"base"}};var u=p;const m={args:{}},l={render(){return t(e,{className:"ai-rounded-3xl ai-pr-0",placeholder:"Enter your email",type:"text",children:t(o,{side:"right",children:t(n,{className:"ai-h-full ai-rounded-none",size:"sm",children:"subscribe"})})})}},y={render(){return t(e,{type:"text",placeholder:"search in site",children:t(o,{side:"left",children:t(r,{})})})}};export{m as Default,l as WithButton,y as WithIcon,u as default};
2
2
  //# sourceMappingURL=input.stories.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/stories/input.stories.tsx"],
4
- "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport type { ComponentType } from 'react'\nimport { Button, Input, InputSlot } from '../components/index'\nimport { SearchIcon } from '@storybook/icons'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Input',\n component: Input,\n subcomponents: { InputSlot: InputSlot as ComponentType<unknown> }, // TODO: \u68C0\u67E5type , \u53BB\u6389as\u7C7B\u578B\u8F6C\u6362\n parameters: {\n layout: 'centered',\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof Input>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {},\n}\n\nexport const WithButton: Story = {\n render() {\n return (\n <Input className=\"ai-rounded-3xl ai-pr-0\" placeholder=\"Enter your email\" type=\"text\">\n <InputSlot side=\"right\">\n <Button className=\"ai-h-full ai-rounded-none\" size=\"sm\">\n subscribe\n </Button>\n </InputSlot>\n </Input>\n )\n },\n}\nexport const WithIcon: Story = {\n render() {\n return (\n <Input type=\"text\" placeholder=\"search in site\">\n <InputSlot side=\"left\">\n <SearchIcon />\n </InputSlot>\n </Input>\n )\n },\n}\n"],
5
- "mappings": "AAwCU,cAAAA,MAAA,oBAtCV,OAAS,UAAAC,EAAQ,SAAAC,EAAO,aAAAC,MAAiB,sBACzC,OAAS,cAAAC,MAAkB,mBAC3B,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,mBACP,UAAWH,EACX,cAAe,CAAE,UAAWC,CAAoC,EAChE,WAAY,CACV,OAAQ,UACV,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,OAAQ,IAAI,CAC9B,CACF,EACA,KAAM,CACJ,KAAM,MACR,CACF,EAEA,IAAOG,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CAAC,CACT,EAEaC,EAAoB,CAC/B,QAAS,CACP,OACER,EAACE,EAAA,CAAM,UAAU,yBAAyB,YAAY,mBAAmB,KAAK,OAC5E,SAAAF,EAACG,EAAA,CAAU,KAAK,QACd,SAAAH,EAACC,EAAA,CAAO,UAAU,4BAA4B,KAAK,KAAK,qBAExD,EACF,EACF,CAEJ,CACF,EACaQ,EAAkB,CAC7B,QAAS,CACP,OACET,EAACE,EAAA,CAAM,KAAK,OAAO,YAAY,iBAC7B,SAAAF,EAACG,EAAA,CAAU,KAAK,OACd,SAAAH,EAACI,EAAA,EAAW,EACd,EACF,CAEJ,CACF",
4
+ "sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\nimport type { ComponentType } from 'react'\nimport { Button, Input, InputSlot } from '../components/index'\nimport { SearchIcon } from '@storybook/icons'\nimport React from 'react'\n\nconst meta = {\n title: 'Components/Input',\n component: Input,\n subcomponents: { InputSlot: InputSlot as ComponentType<unknown> }, // TODO: \u68C0\u67E5type , \u53BB\u6389as\u7C7B\u578B\u8F6C\u6362\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: 'Input \u7EC4\u4EF6, \u7528\u4E8E\u8F93\u5165\u6846, \u53EF\u4EE5\u901A\u8FC7\u63D2\u69FD\u63D2\u5165\u989D\u5916\u7684\u5185\u5BB9, \u6BD4\u5982icon, \u6309\u94AE',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n options: ['sm', 'base', 'lg'],\n },\n },\n args: {\n size: 'base',\n },\n} satisfies Meta<typeof Input>\n\nexport default meta\n\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {},\n}\n\nexport const WithButton: Story = {\n render() {\n return (\n <Input className=\"ai-rounded-3xl ai-pr-0\" placeholder=\"Enter your email\" type=\"text\">\n <InputSlot side=\"right\">\n <Button className=\"ai-h-full ai-rounded-none\" size=\"sm\">\n subscribe\n </Button>\n </InputSlot>\n </Input>\n )\n },\n}\nexport const WithIcon: Story = {\n render() {\n return (\n <Input type=\"text\" placeholder=\"search in site\">\n <InputSlot side=\"left\">\n <SearchIcon />\n </InputSlot>\n </Input>\n )\n },\n}\n"],
5
+ "mappings": "AA6CU,cAAAA,MAAA,oBA3CV,OAAS,UAAAC,EAAQ,SAAAC,EAAO,aAAAC,MAAiB,sBACzC,OAAS,cAAAC,MAAkB,mBAC3B,MAAkB,QAElB,MAAMC,EAAO,CACX,MAAO,mBACP,UAAWH,EACX,cAAe,CAAE,UAAWC,CAAoC,EAChE,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,oKACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,KAAM,OAAQ,IAAI,CAC9B,CACF,EACA,KAAM,CACJ,KAAM,MACR,CACF,EAEA,IAAOG,EAAQD,EAIR,MAAME,EAAiB,CAC5B,KAAM,CAAC,CACT,EAEaC,EAAoB,CAC/B,QAAS,CACP,OACER,EAACE,EAAA,CAAM,UAAU,yBAAyB,YAAY,mBAAmB,KAAK,OAC5E,SAAAF,EAACG,EAAA,CAAU,KAAK,QACd,SAAAH,EAACC,EAAA,CAAO,UAAU,4BAA4B,KAAK,KAAK,qBAExD,EACF,EACF,CAEJ,CACF,EACaQ,EAAkB,CAC7B,QAAS,CACP,OACET,EAACE,EAAA,CAAM,KAAK,OAAO,YAAY,iBAC7B,SAAAF,EAACG,EAAA,CAAU,KAAK,OACd,SAAAH,EAACI,EAAA,EAAW,EACd,EACF,CAEJ,CACF",
6
6
  "names": ["jsx", "Button", "Input", "InputSlot", "SearchIcon", "meta", "input_stories_default", "Default", "WithButton", "WithIcon"]
7
7
  }