@anker-in/headless-ui 0.0.14 → 0.0.16
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/dist/cjs/components/badge.d.ts +9 -0
- package/dist/cjs/components/badge.js +2 -0
- package/dist/cjs/components/badge.js.map +7 -0
- package/dist/cjs/components/button.d.ts +20 -0
- package/dist/cjs/components/button.js +2 -0
- package/dist/cjs/components/button.js.map +7 -0
- package/dist/cjs/components/checkbox.d.ts +11 -0
- package/dist/cjs/components/checkbox.js +2 -0
- package/dist/cjs/components/checkbox.js.map +7 -0
- package/dist/cjs/components/dialog.d.ts +19 -0
- package/dist/cjs/components/dialog.js +2 -0
- package/dist/cjs/components/dialog.js.map +7 -0
- package/dist/cjs/components/heading.d.ts +16 -0
- package/dist/cjs/components/heading.js +2 -0
- package/dist/cjs/components/heading.js.map +7 -0
- package/dist/cjs/components/index.d.ts +12 -0
- package/dist/cjs/components/index.js +2 -0
- package/dist/cjs/components/index.js.map +7 -0
- package/dist/cjs/components/input.d.ts +22 -0
- package/dist/cjs/components/input.js +2 -0
- package/dist/cjs/components/input.js.map +7 -0
- package/dist/cjs/components/popover.d.ts +6 -0
- package/dist/cjs/components/popover.js +2 -0
- package/dist/cjs/components/popover.js.map +7 -0
- package/dist/cjs/components/radio.d.ts +16 -0
- package/dist/cjs/components/radio.js +2 -0
- package/dist/cjs/components/radio.js.map +7 -0
- package/dist/cjs/components/skeleton.d.ts +9 -0
- package/dist/cjs/components/skeleton.js +5 -0
- package/dist/cjs/components/skeleton.js.map +7 -0
- package/dist/cjs/components/text.d.ts +31 -0
- package/dist/cjs/components/text.js +2 -0
- package/dist/cjs/components/text.js.map +7 -0
- package/dist/cjs/components/theme.d.ts +13 -0
- package/dist/cjs/components/theme.js +2 -0
- package/dist/cjs/components/theme.js.map +7 -0
- package/dist/cjs/helpers/component-props.d.ts +7 -0
- package/dist/cjs/helpers/component-props.js +2 -0
- package/dist/cjs/helpers/component-props.js.map +7 -0
- package/dist/cjs/helpers/constants.d.ts +2 -0
- package/dist/cjs/helpers/constants.js +2 -0
- package/dist/cjs/helpers/constants.js.map +7 -0
- package/dist/cjs/helpers/index.d.ts +1 -0
- package/dist/cjs/helpers/index.js +2 -0
- package/dist/cjs/helpers/index.js.map +7 -0
- package/dist/cjs/helpers/utils.d.ts +2 -0
- package/dist/cjs/helpers/utils.js +2 -0
- package/dist/cjs/helpers/utils.js.map +7 -0
- package/dist/cjs/icons/spinner.d.ts +7 -0
- package/dist/cjs/icons/spinner.js +2 -0
- package/dist/cjs/icons/spinner.js.map +7 -0
- package/dist/cjs/index.d.ts +1 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/stories/badge.stories.d.ts +26 -0
- package/dist/cjs/stories/badge.stories.js +2 -0
- package/dist/cjs/stories/badge.stories.js.map +7 -0
- package/dist/cjs/stories/button.stories.d.ts +47 -0
- package/dist/cjs/stories/button.stories.js +2 -0
- package/dist/cjs/stories/button.stories.js.map +7 -0
- package/dist/cjs/stories/checkbox.stories.d.ts +46 -0
- package/dist/cjs/stories/checkbox.stories.js +2 -0
- package/dist/cjs/stories/checkbox.stories.js.map +7 -0
- package/dist/cjs/stories/dialog.stories.d.ts +20 -0
- package/dist/cjs/stories/dialog.stories.js +2 -0
- package/dist/cjs/stories/dialog.stories.js.map +7 -0
- package/dist/cjs/stories/heading.stories.d.ts +82 -0
- package/dist/cjs/stories/heading.stories.js +2 -0
- package/dist/cjs/stories/heading.stories.js.map +7 -0
- package/dist/cjs/stories/input.stories.d.ts +35 -0
- package/dist/cjs/stories/input.stories.js +2 -0
- package/dist/cjs/stories/input.stories.js.map +7 -0
- package/dist/cjs/stories/popover.stories.d.ts +17 -0
- package/dist/cjs/stories/popover.stories.js +2 -0
- package/dist/cjs/stories/popover.stories.js.map +7 -0
- package/dist/cjs/stories/radio.stories.d.ts +39 -0
- package/dist/cjs/stories/radio.stories.js +2 -0
- package/dist/cjs/stories/radio.stories.js.map +7 -0
- package/dist/cjs/stories/skeleton.stories.d.ts +20 -0
- package/dist/cjs/stories/skeleton.stories.js +2 -0
- package/dist/cjs/stories/skeleton.stories.js.map +7 -0
- package/dist/cjs/stories/text.stories.d.ts +84 -0
- package/dist/cjs/stories/text.stories.js +10 -0
- package/dist/cjs/stories/text.stories.js.map +7 -0
- package/dist/esm/components/badge.d.ts +9 -0
- package/dist/esm/components/badge.js +2 -0
- package/dist/esm/components/badge.js.map +7 -0
- package/dist/esm/components/button.d.ts +20 -0
- package/dist/esm/components/button.js +2 -0
- package/dist/esm/components/button.js.map +7 -0
- package/dist/esm/components/checkbox.d.ts +11 -0
- package/dist/esm/components/checkbox.js +2 -0
- package/dist/esm/components/checkbox.js.map +7 -0
- package/dist/esm/components/dialog.d.ts +19 -0
- package/dist/esm/components/dialog.js +2 -0
- package/dist/esm/components/dialog.js.map +7 -0
- package/dist/esm/components/heading.d.ts +16 -0
- package/dist/esm/components/heading.js +2 -0
- package/dist/esm/components/heading.js.map +7 -0
- package/dist/esm/components/index.d.ts +12 -0
- package/dist/esm/components/index.js +2 -0
- package/dist/esm/components/index.js.map +7 -0
- package/dist/esm/components/input.d.ts +22 -0
- package/dist/esm/components/input.js +2 -0
- package/dist/esm/components/input.js.map +7 -0
- package/dist/esm/components/popover.d.ts +6 -0
- package/dist/esm/components/popover.js +2 -0
- package/dist/esm/components/popover.js.map +7 -0
- package/dist/esm/components/radio.d.ts +16 -0
- package/dist/esm/components/radio.js +2 -0
- package/dist/esm/components/radio.js.map +7 -0
- package/dist/esm/components/skeleton.d.ts +9 -0
- package/dist/esm/components/skeleton.js +5 -0
- package/dist/esm/components/skeleton.js.map +7 -0
- package/dist/esm/components/text.d.ts +31 -0
- package/dist/esm/components/text.js +2 -0
- package/dist/esm/components/text.js.map +7 -0
- package/dist/esm/components/theme.d.ts +13 -0
- package/dist/esm/components/theme.js +2 -0
- package/dist/esm/components/theme.js.map +7 -0
- package/dist/esm/helpers/component-props.d.ts +7 -0
- package/dist/esm/helpers/component-props.js +1 -0
- package/dist/esm/helpers/component-props.js.map +7 -0
- package/dist/esm/helpers/constants.d.ts +2 -0
- package/dist/esm/helpers/constants.js +2 -0
- package/dist/esm/helpers/constants.js.map +7 -0
- package/dist/esm/helpers/index.d.ts +1 -0
- package/dist/esm/helpers/index.js +2 -0
- package/dist/esm/helpers/index.js.map +7 -0
- package/dist/esm/helpers/utils.d.ts +2 -0
- package/dist/esm/helpers/utils.js +2 -0
- package/dist/esm/helpers/utils.js.map +7 -0
- package/dist/esm/icons/spinner.d.ts +7 -0
- package/dist/esm/icons/spinner.js +2 -0
- package/dist/esm/icons/spinner.js.map +7 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/stories/badge.stories.d.ts +26 -0
- package/dist/esm/stories/badge.stories.js +2 -0
- package/dist/esm/stories/badge.stories.js.map +7 -0
- package/dist/esm/stories/button.stories.d.ts +47 -0
- package/dist/esm/stories/button.stories.js +2 -0
- package/dist/esm/stories/button.stories.js.map +7 -0
- package/dist/esm/stories/checkbox.stories.d.ts +46 -0
- package/dist/esm/stories/checkbox.stories.js +2 -0
- package/dist/esm/stories/checkbox.stories.js.map +7 -0
- package/dist/esm/stories/dialog.stories.d.ts +20 -0
- package/dist/esm/stories/dialog.stories.js +2 -0
- package/dist/esm/stories/dialog.stories.js.map +7 -0
- package/dist/esm/stories/heading.stories.d.ts +82 -0
- package/dist/esm/stories/heading.stories.js +2 -0
- package/dist/esm/stories/heading.stories.js.map +7 -0
- package/dist/esm/stories/input.stories.d.ts +35 -0
- package/dist/esm/stories/input.stories.js +2 -0
- package/dist/esm/stories/input.stories.js.map +7 -0
- package/dist/esm/stories/popover.stories.d.ts +17 -0
- package/dist/esm/stories/popover.stories.js +2 -0
- package/dist/esm/stories/popover.stories.js.map +7 -0
- package/dist/esm/stories/radio.stories.d.ts +39 -0
- package/dist/esm/stories/radio.stories.js +2 -0
- package/dist/esm/stories/radio.stories.js.map +7 -0
- package/dist/esm/stories/skeleton.stories.d.ts +20 -0
- package/dist/esm/stories/skeleton.stories.js +2 -0
- package/dist/esm/stories/skeleton.stories.js.map +7 -0
- package/dist/esm/stories/text.stories.d.ts +84 -0
- package/dist/esm/stories/text.stories.js +10 -0
- package/dist/esm/stories/text.stories.js.map +7 -0
- package/package.json +1 -1
- package/src/components/input.tsx +13 -9
- package/src/styles/global.css +4 -5
- package/style.css +1335 -0
|
@@ -0,0 +1,84 @@
|
|
|
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/text").TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
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
|
+
description: string;
|
|
21
|
+
options: (string | number)[];
|
|
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
|
+
align: {
|
|
40
|
+
control: {
|
|
41
|
+
type: "select";
|
|
42
|
+
};
|
|
43
|
+
options: string[];
|
|
44
|
+
table: {
|
|
45
|
+
defaultValue: {
|
|
46
|
+
summary: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
color: {
|
|
51
|
+
control: {
|
|
52
|
+
type: "color";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
as: {
|
|
56
|
+
control: {
|
|
57
|
+
type: "select";
|
|
58
|
+
};
|
|
59
|
+
description: string;
|
|
60
|
+
options: string[];
|
|
61
|
+
table: {
|
|
62
|
+
defaultValue: {
|
|
63
|
+
summary: string;
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
html: {
|
|
68
|
+
type: "string";
|
|
69
|
+
description: string;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
args: {
|
|
73
|
+
size: "none";
|
|
74
|
+
weights: "normal";
|
|
75
|
+
align: "left";
|
|
76
|
+
html: string;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export default meta;
|
|
80
|
+
type Story = StoryObj<typeof meta>;
|
|
81
|
+
export declare const Default: Story;
|
|
82
|
+
export declare const Sizes: Story;
|
|
83
|
+
export declare const Weights: Story;
|
|
84
|
+
export declare const Html: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var p=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(r,t)=>{for(var l in t)n(r,l,{get:t[l],enumerable:!0})},f=(r,t,l,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of p(t))!u.call(r,s)&&s!==l&&n(r,s,{get:()=>t[s],enumerable:!(i=a(t,s))||i.enumerable});return r};var m=r=>f(n({},"__esModule",{value:!0}),r);var b={};c(b,{Default:()=>y,Html:()=>T,Sizes:()=>x,Weights:()=>g,default:()=>d});module.exports=m(b);var e=require("react/jsx-runtime"),o=require("../components/index"),w=require("react");const h={title:"Typography/Text",component:o.Text,parameters:{layout:"centered",docs:{description:{component:"\u6587\u672C\u7EC4\u4EF6, \u7B80\u5355\u5C01\u88C5\u4E86\u5E38\u7528\u7684\u6837\u5F0F\u5B57\u6BB5\uFF0C\u7528\u4E8E\u5C55\u793A\u6587\u672C\u5185\u5BB9."}}},tags:["autodocs"],argTypes:{size:{control:{type:"select"},description:"\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8",options:["none",1,2,3,4,5,6,7,8,9],table:{defaultValue:{summary:"none"}}},weights:{control:{type:"select"},options:["light","normal","medium","bold"],table:{defaultValue:{summary:"normal"}}},align:{control:{type:"select"},options:["left","center","right"],table:{defaultValue:{summary:"left"}}},color:{control:{type:"color"}},as:{control:{type:"select"},description:"html \u6807\u7B7E\u7C7B\u578B",options:["div","label","p","span"],table:{defaultValue:{summary:"span"}}},html:{type:"string",description:"\u76F8\u5F53\u4E8E dangerouslySetInnerHTML"}},args:{size:"none",weights:"normal",align:"left",html:""}};var d=h;const y={args:{children:" The quick brown fox jumps over the lazy dog.",size:"none",weights:"normal"}},x={render(){return(0,e.jsxs)("div",{className:"ai-flex ai-flex-col",children:[(0,e.jsx)(o.Text,{size:1,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:2,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:3,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:4,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:5,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:6,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:7,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:8,children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{size:9,children:"The quick brown fox jumps over the lazy dog."})]})}},g={render(){return(0,e.jsxs)("div",{className:"ai-flex ai-flex-col",children:[(0,e.jsx)(o.Text,{weights:"light",children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{weights:"normal",children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{weights:"medium",children:"The quick brown fox jumps over the lazy dog."}),(0,e.jsx)(o.Text,{weights:"bold",children:"The quick brown fox jumps over the lazy dog."})]})}},T={render(){return(0,e.jsx)(o.Text,{html:`The <span style='font-size:20px;font:bold; -webkit-background-clip: text; background: linear-gradient(
|
|
2
|
+
to right,
|
|
3
|
+
#00ff00, /* \u7EFF\u8272 */
|
|
4
|
+
#00ff99, /* \u6D45\u7EFF\u8272 */
|
|
5
|
+
#00ffff, /* \u9752\u8272 */
|
|
6
|
+
#0099ff, /* \u6D45\u84DD\u8272 */
|
|
7
|
+
#8000ff, /* \u7D2B\u8272 */
|
|
8
|
+
#ff00ff /* \u7C89\u8272 */
|
|
9
|
+
);color: transparent;background-clip: text;'>quick brown fox</span> <br/> jumps over the lazy dog.`})}};
|
|
10
|
+
//# sourceMappingURL=text.stories.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/stories/text.stories.tsx"],
|
|
4
|
+
"sourcesContent": ["import type { Meta, StoryObj } from '@storybook/react'\n\nimport { Text } from '../components/index'\nimport React from 'react'\n\nconst meta = {\n title: 'Typography/Text',\n component: Text,\n parameters: {\n layout: 'centered',\n docs: {\n description: {\n component: '\u6587\u672C\u7EC4\u4EF6, \u7B80\u5355\u5C01\u88C5\u4E86\u5E38\u7528\u7684\u6837\u5F0F\u5B57\u6BB5\uFF0C\u7528\u4E8E\u5C55\u793A\u6587\u672C\u5185\u5BB9.',\n },\n },\n },\n tags: ['autodocs'],\n argTypes: {\n size: {\n control: {\n type: 'select',\n },\n description: '\u6587\u672C\u5C3A\u5BF8\uFF0C\u9ED8\u8BA4\u4E3Anone\uFF0C\u6D4F\u89C8\u5668\u9ED8\u8BA4\u5927\u5C0F\u548C\u884C\u9AD8\uFF0C1\uFF5E9\u9884\u8BBE\u5B57\u4F53\u5927\u5C0F\u548C\u884C\u9AD8',\n options: ['none', 1, 2, 3, 4, 5, 6, 7, 8, 9],\n table: {\n defaultValue: { summary: 'none' },\n },\n },\n weights: {\n control: {\n type: 'select',\n },\n options: ['light', 'normal', 'medium', 'bold'],\n table: {\n defaultValue: { summary: 'normal' },\n },\n },\n align: {\n control: {\n type: 'select',\n },\n options: ['left', 'center', 'right'],\n table: {\n defaultValue: { summary: 'left' },\n },\n },\n color: {\n control: {\n type: 'color',\n },\n },\n as: {\n control: {\n type: 'select',\n },\n description: 'html \u6807\u7B7E\u7C7B\u578B',\n options: ['div', 'label', 'p', 'span'],\n table: {\n defaultValue: { summary: 'span' },\n },\n },\n html: {\n type: 'string',\n description: '\u76F8\u5F53\u4E8E dangerouslySetInnerHTML',\n },\n },\n args: {\n size: 'none',\n weights: 'normal',\n align: 'left',\n html: '',\n },\n} satisfies Meta<typeof Text>\n\nexport default meta\ntype Story = StoryObj<typeof meta>\n\nexport const Default: Story = {\n args: {\n children: ' The quick brown fox jumps over the lazy dog.',\n size: 'none',\n weights: 'normal',\n },\n}\n\nexport const Sizes: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col\">\n <Text size={1}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={2}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={3}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={4}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={5}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={6}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={7}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={8}>The quick brown fox jumps over the lazy dog.</Text>\n <Text size={9}>The quick brown fox jumps over the lazy dog.</Text>\n </div>\n )\n },\n}\n\nexport const Weights: Story = {\n render() {\n return (\n <div className=\"ai-flex ai-flex-col\">\n <Text weights=\"light\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"normal\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"medium\">The quick brown fox jumps over the lazy dog.</Text>\n <Text weights=\"bold\">The quick brown fox jumps over the lazy dog.</Text>\n </div>\n )\n },\n}\n\nexport const Html: Story = {\n render() {\n return (\n <Text\n html={`The <span style='font-size:20px;font:bold; -webkit-background-clip: text; background: linear-gradient(\n to right, \n #00ff00, /* \u7EFF\u8272 */\n #00ff99, /* \u6D45\u7EFF\u8272 */\n #00ffff, /* \u9752\u8272 */\n #0099ff, /* \u6D45\u84DD\u8272 */\n #8000ff, /* \u7D2B\u8272 */\n #ff00ff /* \u7C89\u8272 */\n );color: transparent;background-clip: text;'>quick brown fox</span> <br/> jumps over the lazy dog.`}\n />\n )\n },\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,EAAA,SAAAC,EAAA,UAAAC,EAAA,YAAAC,EAAA,YAAAC,IAAA,eAAAC,EAAAP,GAwFM,IAAAQ,EAAA,6BAtFNC,EAAqB,+BACrBC,EAAkB,iBAElB,MAAMC,EAAO,CACX,MAAO,kBACP,UAAW,OACX,WAAY,CACV,OAAQ,WACR,KAAM,CACJ,YAAa,CACX,UAAW,2JACb,CACF,CACF,EACA,KAAM,CAAC,UAAU,EACjB,SAAU,CACR,KAAM,CACJ,QAAS,CACP,KAAM,QACR,EACA,YAAa,6LACb,QAAS,CAAC,OAAQ,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,EAAG,CAAC,EAC3C,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,QAAS,CACP,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,QAAS,SAAU,SAAU,MAAM,EAC7C,MAAO,CACL,aAAc,CAAE,QAAS,QAAS,CACpC,CACF,EACA,MAAO,CACL,QAAS,CACP,KAAM,QACR,EACA,QAAS,CAAC,OAAQ,SAAU,OAAO,EACnC,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,MAAO,CACL,QAAS,CACP,KAAM,OACR,CACF,EACA,GAAI,CACF,QAAS,CACP,KAAM,QACR,EACA,YAAa,gCACb,QAAS,CAAC,MAAO,QAAS,IAAK,MAAM,EACrC,MAAO,CACL,aAAc,CAAE,QAAS,MAAO,CAClC,CACF,EACA,KAAM,CACJ,KAAM,SACN,YAAa,4CACf,CACF,EACA,KAAM,CACJ,KAAM,OACN,QAAS,SACT,MAAO,OACP,KAAM,EACR,CACF,EAEA,IAAOL,EAAQK,EAGR,MAAMT,EAAiB,CAC5B,KAAM,CACJ,SAAU,gDACV,KAAM,OACN,QAAS,QACX,CACF,EAEaE,EAAe,CAC1B,QAAS,CACP,SACE,QAAC,OAAI,UAAU,sBACb,oBAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,KAC3D,OAAC,QAAK,KAAM,EAAG,wDAA4C,GAC7D,CAEJ,CACF,EAEaC,EAAiB,CAC5B,QAAS,CACP,SACE,QAAC,OAAI,UAAU,sBACb,oBAAC,QAAK,QAAQ,QAAQ,wDAA4C,KAClE,OAAC,QAAK,QAAQ,SAAS,wDAA4C,KACnE,OAAC,QAAK,QAAQ,SAAS,wDAA4C,KACnE,OAAC,QAAK,QAAQ,OAAO,wDAA4C,GACnE,CAEJ,CACF,EAEaF,EAAc,CACzB,QAAS,CACP,SACE,OAAC,QACC,KAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wGASR,CAEJ,CACF",
|
|
6
|
+
"names": ["text_stories_exports", "__export", "Default", "Html", "Sizes", "Weights", "text_stories_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_react", "meta"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
declare const badgeVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "secondary" | "destructive" | "outline" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
6
|
+
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
7
|
+
}
|
|
8
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime.js").JSX.Element;
|
|
9
|
+
export default Badge;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as d}from"react/jsx-runtime";import"react";import{cva as r}from"class-variance-authority";import{cn as i}from"../helpers/index.js";const n=r("ai-inline-flex ai-items-center ai-font-medium ai-rounded-[20px] ai-border ai-px-[10px] ai-py-1 ai-text-xs ai-transition-colors focus:ai-outline-none",{variants:{variant:{default:"ai-bg-badge ai-text-badge-foreground ai-border-transparent",secondary:"ai-bg-secondary ai-text-secondary-foreground ai-border-transparent",destructive:"ai-bg-destructive ai-text-destructive-foreground ai-border-transparent",outline:"ai-text-foreground"}},defaultVariants:{variant:"default"}});function o({className:a,variant:e,...t}){return d("div",{className:i(n({variant:e}),a),...t})}var f=o;export{f as default};
|
|
2
|
+
//# sourceMappingURL=badge.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/badge.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react'\nimport { type VariantProps, cva } from 'class-variance-authority'\n\nimport { cn } from '../helpers/index.js'\n\nconst badgeVariants = cva(\n 'ai-inline-flex ai-items-center ai-font-medium ai-rounded-[20px] ai-border ai-px-[10px] ai-py-1 ai-text-xs ai-transition-colors focus:ai-outline-none',\n {\n variants: {\n variant: {\n default: 'ai-bg-badge ai-text-badge-foreground ai-border-transparent',\n secondary: 'ai-bg-secondary ai-text-secondary-foreground ai-border-transparent',\n destructive: 'ai-bg-destructive ai-text-destructive-foreground ai-border-transparent',\n outline: 'ai-text-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n)\n\nexport interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />\n}\n\nexport default Badge\n"],
|
|
5
|
+
"mappings": "AAyBS,cAAAA,MAAA,oBAzBT,MAAuB,QACvB,OAA4B,OAAAC,MAAW,2BAEvC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAgBF,EACpB,uJACA,CACE,SAAU,CACR,QAAS,CACP,QAAS,6DACT,UAAW,qEACX,YAAa,yEACb,QAAS,oBACX,CACF,EACA,gBAAiB,CACf,QAAS,SACX,CACF,CACF,EAIA,SAASG,EAAM,CAAE,UAAAC,EAAW,QAAAC,EAAS,GAAGC,CAAM,EAAe,CAC3D,OAAOP,EAAC,OAAI,UAAWE,EAAGC,EAAc,CAAE,QAAAG,CAAQ,CAAC,EAAGD,CAAS,EAAI,GAAGE,EAAO,CAC/E,CAEA,IAAOC,EAAQJ",
|
|
6
|
+
"names": ["jsx", "cva", "cn", "badgeVariants", "Badge", "className", "variant", "props", "badge_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
/**
|
|
4
|
+
* Button Variants
|
|
5
|
+
*/
|
|
6
|
+
declare const buttonVariants: (props?: ({
|
|
7
|
+
variant?: "link" | "primary" | "secondary" | "ghost" | null | undefined;
|
|
8
|
+
size?: "sm" | "lg" | "base" | "icon" | null | undefined;
|
|
9
|
+
hoverEffect?: "none" | "slide" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
11
|
+
export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
12
|
+
/** 设置按钮载入状态 */
|
|
13
|
+
loading?: boolean;
|
|
14
|
+
/** 设置按钮失效状态 */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** 定义自组件作为父组件的类型, 详细使用方式请参考radix-ui */
|
|
17
|
+
asChild?: boolean;
|
|
18
|
+
}
|
|
19
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
20
|
+
export default Button;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{Fragment as x,jsx as e,jsxs as h}from"react/jsx-runtime";import*as p from"react";import{Slot as u}from"@radix-ui/react-slot";import{VisuallyHidden as c}from"@radix-ui/react-visually-hidden";import{cva as m}from"class-variance-authority";import y from"../icons/spinner.js";import{cn as v}from"../helpers/index.js";const g=m("ai-ring-offset-background focus-visible:ai-ring-ring ai-rounded-btn ai-inline-flex ai-items-center ai-justify-center ai-whitespace-nowrap ai-text-sm ai-font-medium ai-transition-colors focus-visible:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-pointer-events-none disabled:ai-opacity-50",{variants:{variant:{primary:"ai-bg-btn-primary ai-text-btn-primary-foreground hover:ai-bg-btn-primary-active disabled:ai-bg-btn-primary-disabled disabled:ai-text-btn-primary-disabled-foreground",secondary:"ai-bg-btn-secondary ai-border-primary ai-text-btn-secondary-foreground hover:ai-bg-btn-secondary-active hover:ai-text-btn-secondary disabled:ai-bg-btn-secondary-disabled disabled:ai-text-btn-secondary-disabled-foreground ai-border ai-border-solid",link:"ai-text-primary ai-underline-offset-4 hover:ai-underline",ghost:"hover:ai-bg-btn-primary hover:ai-text-btn-primary-foreground"},size:{sm:"ai-h-8 ai-px-3 ai-py-1 ai-text-[12px]",base:"ai-h-10 ai-px-4 ai-py-2 ai-text-[14px]",lg:"ai-h-11 ai-px-8 ai-text-[16px]",icon:"ai-size-10 ai-rounded-full"},hoverEffect:{none:"",slide:""}},compoundVariants:[{variant:"primary",hoverEffect:"slide",class:'ai-z-[1] before:-ai-z-[1] before:ai-rounded-btn hover:!ai-bg-btn-primary before:ai-bg-btn-primary-active ai-relative ai-overflow-hidden before:ai-absolute before:ai-inset-y-0 before:ai-w-full before:-ai-translate-x-full before:ai-transition-transform before:ai-duration-300 before:ai-ease-in-out before:ai-content-[""] hover:before:ai-translate-x-0'},{variant:"secondary",hoverEffect:"slide",class:'ai-z-[1] before:-ai-z-[1] before:ai-rounded-btn hover:!ai-bg-btn-secondary before:ai-bg-btn-secondary-active ai-relative ai-overflow-hidden before:ai-absolute before:ai-inset-y-0 before:ai-w-full before:-ai-translate-x-full before:ai-transition-transform before:ai-duration-300 before:ai-ease-in-out before:ai-content-[""] hover:before:ai-translate-x-0'}],defaultVariants:{variant:"primary",size:"base",hoverEffect:"none"}}),r=p.forwardRef(({asChild:o=!1,size:t="base",children:a,variant:n,hoverEffect:s="none",className:b,disabled:i=!1,loading:d=!1,...f},l)=>e(o?u:"button",{disabled:i,className:v(g({variant:n,size:t,hoverEffect:s}),{"ai-cursor-not-allowed":i},b),ref:l,...f,children:d?h(x,{children:[e("span",{style:{display:"contents",visibility:"hidden"},"aria-hidden":!0,children:a}),e("span",{className:"ai-absolute",children:e(y,{})}),e(c,{children:a})]}):a}));r.displayName="Button";var P=r;export{P as default};
|
|
2
|
+
//# sourceMappingURL=button.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/button.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { Slot } from '@radix-ui/react-slot'\nimport { VisuallyHidden } from '@radix-ui/react-visually-hidden'\nimport { type VariantProps, cva } from 'class-variance-authority'\nimport Spinner from '../icons/spinner.js'\nimport { cn } from '../helpers/index.js'\n\n/**\n * Button Variants\n */\nconst buttonVariants = cva(\n 'ai-ring-offset-background focus-visible:ai-ring-ring ai-rounded-btn ai-inline-flex ai-items-center ai-justify-center ai-whitespace-nowrap ai-text-sm ai-font-medium ai-transition-colors focus-visible:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-pointer-events-none disabled:ai-opacity-50',\n {\n variants: {\n variant: {\n primary:\n 'ai-bg-btn-primary ai-text-btn-primary-foreground hover:ai-bg-btn-primary-active disabled:ai-bg-btn-primary-disabled disabled:ai-text-btn-primary-disabled-foreground',\n secondary:\n 'ai-bg-btn-secondary ai-border-primary ai-text-btn-secondary-foreground hover:ai-bg-btn-secondary-active hover:ai-text-btn-secondary disabled:ai-bg-btn-secondary-disabled disabled:ai-text-btn-secondary-disabled-foreground ai-border ai-border-solid',\n link: 'ai-text-primary ai-underline-offset-4 hover:ai-underline',\n ghost: 'hover:ai-bg-btn-primary hover:ai-text-btn-primary-foreground',\n },\n size: {\n sm: 'ai-h-8 ai-px-3 ai-py-1 ai-text-[12px]',\n base: 'ai-h-10 ai-px-4 ai-py-2 ai-text-[14px]',\n lg: 'ai-h-11 ai-px-8 ai-text-[16px]',\n icon: 'ai-size-10 ai-rounded-full',\n },\n /** hover \u72B6\u6001\u4E0B\u7684\u52A8\u753B\u6548\u679C,\u9700\u8981\u6CE8\u610F\u4E0D\u540Cvariant \u4E0B\u7684\u6548\u679C */\n hoverEffect: {\n none: '',\n slide: '',\n },\n },\n compoundVariants: [\n {\n variant: 'primary',\n hoverEffect: 'slide',\n class:\n 'ai-z-[1] before:-ai-z-[1] before:ai-rounded-btn hover:!ai-bg-btn-primary before:ai-bg-btn-primary-active ai-relative ai-overflow-hidden before:ai-absolute before:ai-inset-y-0 before:ai-w-full before:-ai-translate-x-full before:ai-transition-transform before:ai-duration-300 before:ai-ease-in-out before:ai-content-[\"\"] hover:before:ai-translate-x-0',\n },\n {\n variant: 'secondary',\n hoverEffect: 'slide',\n class:\n 'ai-z-[1] before:-ai-z-[1] before:ai-rounded-btn hover:!ai-bg-btn-secondary before:ai-bg-btn-secondary-active ai-relative ai-overflow-hidden before:ai-absolute before:ai-inset-y-0 before:ai-w-full before:-ai-translate-x-full before:ai-transition-transform before:ai-duration-300 before:ai-ease-in-out before:ai-content-[\"\"] hover:before:ai-translate-x-0',\n },\n ],\n defaultVariants: {\n variant: 'primary',\n size: 'base',\n hoverEffect: 'none',\n },\n }\n)\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n /** \u8BBE\u7F6E\u6309\u94AE\u8F7D\u5165\u72B6\u6001 */\n loading?: boolean\n /** \u8BBE\u7F6E\u6309\u94AE\u5931\u6548\u72B6\u6001 */\n disabled?: boolean\n /** \u5B9A\u4E49\u81EA\u7EC4\u4EF6\u4F5C\u4E3A\u7236\u7EC4\u4EF6\u7684\u7C7B\u578B\uFF0C \u8BE6\u7EC6\u4F7F\u7528\u65B9\u5F0F\u8BF7\u53C2\u8003radix-ui */\n asChild?: boolean\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n (\n {\n asChild = false,\n size = 'base',\n children,\n variant,\n hoverEffect = 'none',\n className,\n disabled = false,\n loading = false,\n ...props\n }: ButtonProps,\n ref\n ) => {\n const Comp = asChild ? Slot : 'button'\n\n return (\n <Comp\n disabled={disabled}\n className={cn(\n buttonVariants({ variant, size, hoverEffect }),\n {\n 'ai-cursor-not-allowed': disabled,\n },\n className\n )}\n ref={ref}\n {...props}\n >\n {loading ? (\n <>\n <span style={{ display: 'contents', visibility: 'hidden' }} aria-hidden>\n {children}\n </span>\n <span className=\"ai-absolute\">\n <Spinner />\n </span>\n <VisuallyHidden>{children}</VisuallyHidden>\n </>\n ) : (\n children\n )}\n </Comp>\n )\n }\n)\n\nButton.displayName = 'Button'\nexport default Button\n"],
|
|
5
|
+
"mappings": "aAoGU,mBAAAA,EACE,OAAAC,EADF,QAAAC,MAAA,oBAlGV,UAAYC,MAAW,QACvB,OAAS,QAAAC,MAAY,uBACrB,OAAS,kBAAAC,MAAsB,kCAC/B,OAA4B,OAAAC,MAAW,2BACvC,OAAOC,MAAa,sBACpB,OAAS,MAAAC,MAAU,sBAKnB,MAAMC,EAAiBH,EACrB,uUACA,CACE,SAAU,CACR,QAAS,CACP,QACE,uKACF,UACE,yPACF,KAAM,2DACN,MAAO,8DACT,EACA,KAAM,CACJ,GAAI,wCACJ,KAAM,yCACN,GAAI,iCACJ,KAAM,4BACR,EAEA,YAAa,CACX,KAAM,GACN,MAAO,EACT,CACF,EACA,iBAAkB,CAChB,CACE,QAAS,UACT,YAAa,QACb,MACE,+VACJ,EACA,CACE,QAAS,YACT,YAAa,QACb,MACE,mWACJ,CACF,EACA,gBAAiB,CACf,QAAS,UACT,KAAM,OACN,YAAa,MACf,CACF,CACF,EAaMI,EAASP,EAAM,WACnB,CACE,CACE,QAAAQ,EAAU,GACV,KAAAC,EAAO,OACP,SAAAC,EACA,QAAAC,EACA,YAAAC,EAAc,OACd,UAAAC,EACA,SAAAC,EAAW,GACX,QAAAC,EAAU,GACV,GAAGC,CACL,EACAC,IAKEnB,EAHWU,EAAUP,EAAO,SAG3B,CACC,SAAUa,EACV,UAAWT,EACTC,EAAe,CAAE,QAAAK,EAAS,KAAAF,EAAM,YAAAG,CAAY,CAAC,EAC7C,CACE,wBAAyBE,CAC3B,EACAD,CACF,EACA,IAAKI,EACJ,GAAGD,EAEH,SAAAD,EACChB,EAAAF,EAAA,CACE,UAAAC,EAAC,QAAK,MAAO,CAAE,QAAS,WAAY,WAAY,QAAS,EAAG,cAAW,GACpE,SAAAY,EACH,EACAZ,EAAC,QAAK,UAAU,cACd,SAAAA,EAACM,EAAA,EAAQ,EACX,EACAN,EAACI,EAAA,CAAgB,SAAAQ,EAAS,GAC5B,EAEAA,EAEJ,CAGN,EAEAH,EAAO,YAAc,SACrB,IAAOW,EAAQX",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "React", "Slot", "VisuallyHidden", "cva", "Spinner", "cn", "buttonVariants", "Button", "asChild", "size", "children", "variant", "hoverEffect", "className", "disabled", "loading", "props", "ref", "button_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
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>>;
|
|
10
|
+
export default Checkbox;
|
|
11
|
+
export type { CheckboxProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as i}from"react/jsx-runtime";import*as n from"react";import*as e from"@radix-ui/react-checkbox";import{CheckIcon as f}from"@radix-ui/react-icons";import{cn as a}from"../helpers/index.js";import{cva as b}from"class-variance-authority";const p=b("ai-border-primary ai-ring-offset-background focus-visible:ai-ring-ring data-[state=checked]:ai-bg-primary data-[state=checked]:ai-text-primary-foreground ai-peer ai-shrink-0 ai-rounded-sm ai-border focus-visible:ai-outline-none focus-visible:ai-ring-2 focus-visible:ai-ring-offset-2 disabled:ai-cursor-not-allowed disabled:ai-opacity-50 disabled:ai-bg-btn-primary-disabled",{variants:{size:{sm:"ai-size-[14px]",base:"ai-size-4",lg:"ai-size-5"}},defaultVariants:{size:"base"}}),o=n.forwardRef(({className:r,size:t,...s},c)=>i(e.Root,{ref:c,className:a(p({size:t}),r),...s,children:i(e.Indicator,{className:a("ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full"),children:i(f,{})})}));o.displayName="Checkbox";var h=o;export{h as default};
|
|
2
|
+
//# sourceMappingURL=checkbox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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'\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 = 'Checkbox'\n\nexport default Checkbox\nexport type { CheckboxProps }\n"],
|
|
5
|
+
"mappings": "aAmCQ,cAAAA,MAAA,oBAjCR,UAAYC,MAAW,QACvB,UAAYC,MAAuB,2BACnC,OAAS,aAAAC,MAAiB,wBAE1B,OAAS,MAAAC,MAAU,sBACnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAmBD,EACvB,uXACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,iBACJ,KAAM,YACN,GAAI,WACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAMME,EAAWN,EAAM,WACrB,CAAC,CAAE,UAAAO,EAAW,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IAC9BX,EAACE,EAAkB,KAAlB,CAAuB,IAAKS,EAAK,UAAWP,EAAGE,EAAiB,CAAE,KAAAG,CAAK,CAAC,EAAGD,CAAS,EAAI,GAAGE,EAC1F,SAAAV,EAACE,EAAkB,UAAlB,CACC,UAAWE,EAAG,+EAA+E,EAE7F,SAAAJ,EAACG,EAAA,EAAU,EACb,EACF,CAEJ,EACAI,EAAS,YAAc,WAEvB,IAAOK,EAAQL",
|
|
6
|
+
"names": ["jsx", "React", "CheckboxPrimitive", "CheckIcon", "cn", "cva", "checkboxVariants", "Checkbox", "className", "size", "props", "ref", "checkbox_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const DialogHeader: {
|
|
10
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime.js").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
13
|
+
declare const DialogFooter: {
|
|
14
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime.js").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
17
|
+
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
18
|
+
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
19
|
+
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as t,jsxs as r}from"react/jsx-runtime";import*as l from"react";import*as a from"@radix-ui/react-dialog";import{Cross2Icon as u}from"@radix-ui/react-icons";import{cn as s}from"../helpers/index.js";const d=a.Root;d.displayName="Dialog";const R=a.Trigger,m=a.Portal,v=a.Close,n=l.forwardRef(({className:e,...i},o)=>t(a.Overlay,{ref:o,className:s("data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 ai-fixed ai-inset-0 ai-z-50 ai-bg-black/80",e),...i}));n.displayName=a.Overlay.displayName;const c=l.forwardRef(({className:e,children:i,...o},y)=>r(m,{children:[t(n,{}),r(a.Content,{ref:y,className:s("ai-bg-background data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 data-[state=closed]:ai-zoom-out-95 data-[state=open]:ai-zoom-in-95 data-[state=closed]:ai-slide-out-to-left-1/2 data-[state=closed]:ai-slide-out-to-top-[48%] data-[state=open]:ai-slide-in-from-left-1/2 data-[state=open]:ai-slide-in-from-top-[48%] ai-fixed ai-left-1/2 ai-top-1/2 ai-z-50 ai-grid ai-w-full ai-max-w-lg -ai-translate-x-1/2 -ai-translate-y-1/2 ai-gap-4 ai-border ai-p-6 ai-shadow-lg ai-duration-200 sm:ai-rounded-lg",e),...o,children:[i,r(a.Close,{className:"ai-ring-offset-background focus:ai-ring-ring data-[state=open]:ai-bg-accent data-[state=open]:ai-text-muted-foreground ai-absolute ai-right-4 ai-top-4 ai-rounded-sm ai-opacity-70 ai-transition-opacity hover:ai-opacity-100 focus:ai-outline-none focus:ai-ring-2 focus:ai-ring-offset-2 disabled:ai-pointer-events-none",children:[t(u,{className:"ai-size-4"}),t("span",{className:"ai-sr-only",children:"Close"})]})]})]}));c.displayName=a.Content.displayName;const f=({className:e,...i})=>t("div",{className:s("ai-flex ai-flex-col ai-space-y-1.5 ai-text-center sm:ai-text-left",e),...i});f.displayName="DialogHeader";const p=({className:e,...i})=>t("div",{className:s("ai-flex ai-flex-col-reverse sm:ai-flex-row sm:ai-justify-end sm:ai-space-x-2",e),...i});p.displayName="DialogFooter";const g=l.forwardRef(({className:e,...i},o)=>t(a.Title,{ref:o,className:s("ai-text-lg ai-font-semibold ai-leading-none ai-tracking-tight",e),...i}));g.displayName=a.Title.displayName;const D=l.forwardRef(({className:e,...i},o)=>t(a.Description,{ref:o,className:s("ai-text-muted-foreground ai-text-sm",e),...i}));D.displayName=a.Description.displayName;export{d as Dialog,v as DialogClose,c as DialogContent,D as DialogDescription,p as DialogFooter,f as DialogHeader,n as DialogOverlay,m as DialogPortal,g as DialogTitle,R as DialogTrigger};
|
|
2
|
+
//# sourceMappingURL=dialog.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/dialog.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as DialogPrimitive from '@radix-ui/react-dialog'\nimport { Cross2Icon } from '@radix-ui/react-icons'\n\nimport { cn } from '../helpers/index.js'\n\nconst Dialog = DialogPrimitive.Root\nDialog.displayName = 'Dialog'\n\nconst DialogTrigger = DialogPrimitive.Trigger\n\nconst DialogPortal = DialogPrimitive.Portal\n\nconst DialogClose = DialogPrimitive.Close\n\nconst DialogOverlay = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Overlay\n ref={ref}\n className={cn(\n 'data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 ai-fixed ai-inset-0 ai-z-50 ai-bg-black/80',\n className\n )}\n {...props}\n />\n))\nDialogOverlay.displayName = DialogPrimitive.Overlay.displayName\n\nconst DialogContent = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>\n>(({ className, children, ...props }, ref) => (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n ref={ref}\n className={cn(\n 'ai-bg-background data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 data-[state=closed]:ai-zoom-out-95 data-[state=open]:ai-zoom-in-95 data-[state=closed]:ai-slide-out-to-left-1/2 data-[state=closed]:ai-slide-out-to-top-[48%] data-[state=open]:ai-slide-in-from-left-1/2 data-[state=open]:ai-slide-in-from-top-[48%] ai-fixed ai-left-1/2 ai-top-1/2 ai-z-50 ai-grid ai-w-full ai-max-w-lg -ai-translate-x-1/2 -ai-translate-y-1/2 ai-gap-4 ai-border ai-p-6 ai-shadow-lg ai-duration-200 sm:ai-rounded-lg',\n className\n )}\n {...props}\n >\n {children}\n <DialogPrimitive.Close className=\"ai-ring-offset-background focus:ai-ring-ring data-[state=open]:ai-bg-accent data-[state=open]:ai-text-muted-foreground ai-absolute ai-right-4 ai-top-4 ai-rounded-sm ai-opacity-70 ai-transition-opacity hover:ai-opacity-100 focus:ai-outline-none focus:ai-ring-2 focus:ai-ring-offset-2 disabled:ai-pointer-events-none\">\n <Cross2Icon className=\"ai-size-4\" />\n <span className=\"ai-sr-only\">Close</span>\n </DialogPrimitive.Close>\n </DialogPrimitive.Content>\n </DialogPortal>\n))\nDialogContent.displayName = DialogPrimitive.Content.displayName\n\nconst DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('ai-flex ai-flex-col ai-space-y-1.5 ai-text-center sm:ai-text-left', className)} {...props} />\n)\nDialogHeader.displayName = 'DialogHeader'\n\nconst DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn('ai-flex ai-flex-col-reverse sm:ai-flex-row sm:ai-justify-end sm:ai-space-x-2', className)}\n {...props}\n />\n)\nDialogFooter.displayName = 'DialogFooter'\n\nconst DialogTitle = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Title\n ref={ref}\n className={cn('ai-text-lg ai-font-semibold ai-leading-none ai-tracking-tight', className)}\n {...props}\n />\n))\nDialogTitle.displayName = DialogPrimitive.Title.displayName\n\nconst DialogDescription = React.forwardRef<\n React.ElementRef<typeof DialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <DialogPrimitive.Description ref={ref} className={cn('ai-text-muted-foreground ai-text-sm', className)} {...props} />\n))\nDialogDescription.displayName = DialogPrimitive.Description.displayName\n\nexport {\n Dialog,\n DialogPortal,\n DialogOverlay,\n DialogClose,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogFooter,\n DialogTitle,\n DialogDescription,\n}\n"],
|
|
5
|
+
"mappings": "aAqBE,cAAAA,EA0BI,QAAAC,MA1BJ,oBAnBF,UAAYC,MAAW,QACvB,UAAYC,MAAqB,yBACjC,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAASH,EAAgB,KAC/BG,EAAO,YAAc,SAErB,MAAMC,EAAgBJ,EAAgB,QAEhCK,EAAeL,EAAgB,OAE/BM,EAAcN,EAAgB,MAE9BO,EAAgBR,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,kLACAM,CACF,EACC,GAAGC,EACN,CACD,EACDF,EAAc,YAAcP,EAAgB,QAAQ,YAEpD,MAAMW,EAAgBZ,EAAM,WAG1B,CAAC,CAAE,UAAAS,EAAW,SAAAI,EAAU,GAAGH,CAAM,EAAGC,IACpCZ,EAACO,EAAA,CACC,UAAAR,EAACU,EAAA,EAAc,EACfT,EAACE,EAAgB,QAAhB,CACC,IAAKU,EACL,UAAWR,EACT,okBACAM,CACF,EACC,GAAGC,EAEH,UAAAG,EACDd,EAACE,EAAgB,MAAhB,CAAsB,UAAU,6TAC/B,UAAAH,EAACI,EAAA,CAAW,UAAU,YAAY,EAClCJ,EAAC,QAAK,UAAU,aAAa,iBAAK,GACpC,GACF,GACF,CACD,EACDc,EAAc,YAAcX,EAAgB,QAAQ,YAEpD,MAAMa,EAAe,CAAC,CAAE,UAAAL,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OAAI,UAAWK,EAAG,oEAAqEM,CAAS,EAAI,GAAGC,EAAO,EAEjHI,EAAa,YAAc,eAE3B,MAAMC,EAAe,CAAC,CAAE,UAAAN,EAAW,GAAGC,CAAM,IAC1CZ,EAAC,OACC,UAAWK,EAAG,+EAAgFM,CAAS,EACtG,GAAGC,EACN,EAEFK,EAAa,YAAc,eAE3B,MAAMC,EAAchB,EAAM,WAGxB,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,MAAhB,CACC,IAAKU,EACL,UAAWR,EAAG,gEAAiEM,CAAS,EACvF,GAAGC,EACN,CACD,EACDM,EAAY,YAAcf,EAAgB,MAAM,YAEhD,MAAMgB,EAAoBjB,EAAM,WAG9B,CAAC,CAAE,UAAAS,EAAW,GAAGC,CAAM,EAAGC,IAC1Bb,EAACG,EAAgB,YAAhB,CAA4B,IAAKU,EAAK,UAAWR,EAAG,sCAAuCM,CAAS,EAAI,GAAGC,EAAO,CACpH,EACDO,EAAkB,YAAchB,EAAgB,YAAY",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "DialogPrimitive", "Cross2Icon", "cn", "Dialog", "DialogTrigger", "DialogPortal", "DialogClose", "DialogOverlay", "className", "props", "ref", "DialogContent", "children", "DialogHeader", "DialogFooter", "DialogTitle", "DialogDescription"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
2
|
+
import React from 'react';
|
|
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
|
+
align?: "center" | "left" | "right" | null | undefined;
|
|
7
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
8
|
+
interface HeadingProps extends React.ComponentPropsWithoutRef<'h1'>, VariantProps<typeof headingVariants> {
|
|
9
|
+
as?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
10
|
+
asChild?: boolean;
|
|
11
|
+
color?: string;
|
|
12
|
+
html?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const Heading: React.ForwardRefExoticComponent<HeadingProps & React.RefAttributes<HTMLHeadingElement>>;
|
|
15
|
+
export { Heading };
|
|
16
|
+
export type { HeadingProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as o}from"react/jsx-runtime";import{cn as c}from"../helpers/index.js";import{Slot as P}from"@radix-ui/react-slot";import{cva as u}from"class-variance-authority";import y from"react";const H=u("",{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"},align:{left:"ai-text-left",center:"ai-text-center",right:"ai-text-right"}},defaultVariants:{size:"none",weights:"normal",align:"left"}}),n=y.forwardRef((l,r)=>{const{children:t,className:s,size:h,align:g="left",weights:m,asChild:d,as:p="h1",color:e,html:a,...f}=l,i=a?{dangerouslySetInnerHTML:{__html:a}}:null,x=e?{style:{color:e}}:null;return o(P,{...f,ref:r,className:c(H({size:h,weights:m,align:g}),s),...i,...x,children:d?t:o(p,{children:i?null:t})})});n.displayName="Heading";export{n as Heading};
|
|
2
|
+
//# sourceMappingURL=heading.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/heading.tsx"],
|
|
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 align: {\n left: 'ai-text-left',\n center: 'ai-text-center',\n right: 'ai-text-right',\n },\n },\n defaultVariants: {\n size: 'none',\n weights: 'normal',\n align: 'left',\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 {\n children,\n className,\n size,\n align = 'left',\n weights,\n asChild,\n as: Tag = 'h1',\n color,\n html,\n ...headingProps\n } = 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 align,\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": "AAwF4B,cAAAA,MAAA,oBAxF5B,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,EACA,MAAO,CACL,KAAM,eACN,OAAQ,iBACR,MAAO,eACT,CACF,EACA,gBAAiB,CACf,KAAM,OACN,QAAS,SACT,MAAO,MACT,CACF,CAAC,EAWKG,EAAUF,EAAM,WAAyC,CAACG,EAAOC,IAAiB,CACtF,KAAM,CACJ,SAAAC,EACA,UAAAC,EACA,KAAAC,EACA,MAAAC,EAAQ,OACR,QAAAC,EACA,QAAAC,EACA,GAAIC,EAAM,KACV,MAAAC,EACA,KAAAC,EACA,GAAGC,CACL,EAAIX,EACEY,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACA,KAEEG,EAAaJ,EACf,CACE,MAAO,CACL,MAAAA,CACF,CACF,EACA,KACJ,OACEhB,EAACE,EAAA,CACE,GAAGgB,EACJ,IAAKV,EACL,UAAWP,EACTI,EAAgB,CACd,KAAAM,EACA,QAAAE,EACA,MAAAD,CACF,CAAC,EACDF,CACF,EACC,GAAGS,EACH,GAAGC,EAEH,SAAAN,EAAUL,EAAWT,EAACe,EAAA,CAAK,SAAAI,EAAmB,KAAOV,EAAS,EACjE,CAEJ,CAAC,EAEDH,EAAQ,YAAc",
|
|
6
|
+
"names": ["jsx", "cn", "Slot", "cva", "React", "headingVariants", "Heading", "props", "forwardedRef", "children", "className", "size", "align", "weights", "asChild", "Tag", "color", "html", "headingProps", "htmlContentProps", "styleProps"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { default as Button } from './button.js';
|
|
2
|
+
export { default as Badge } from './badge.js';
|
|
3
|
+
export * from './input.js';
|
|
4
|
+
export { default as Checkbox } from './checkbox.js';
|
|
5
|
+
export { default as Skeleton } from './skeleton.js';
|
|
6
|
+
export * from './dialog.js';
|
|
7
|
+
export * from './popover.js';
|
|
8
|
+
export * from './radio.js';
|
|
9
|
+
export * from './dialog.js';
|
|
10
|
+
export * from './text.js';
|
|
11
|
+
export * from './heading.js';
|
|
12
|
+
export { default as Theme } from './theme.js';
|
|
@@ -0,0 +1,2 @@
|
|
|
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
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 * 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
|
+
"names": ["default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
3
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
4
|
+
declare const inputVariants: (props?: ({
|
|
5
|
+
size?: "sm" | "lg" | "base" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
7
|
+
export interface InputProps extends ComponentPropsWithout<'input', 'size'>, VariantProps<typeof inputVariants> {
|
|
8
|
+
}
|
|
9
|
+
interface InputSlotProps extends ComponentPropsWithout<'div', RemovedProps> {
|
|
10
|
+
/**
|
|
11
|
+
* 插槽的位置
|
|
12
|
+
* default: right
|
|
13
|
+
*/
|
|
14
|
+
side?: 'left' | 'right';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* InputSlot
|
|
18
|
+
* 用来在 Input 组件中插入额外的内容,比如icon ,按钮
|
|
19
|
+
*/
|
|
20
|
+
declare const InputSlot: React.ForwardRefExoticComponent<InputSlotProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
+
declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
22
|
+
export { Input, InputSlot };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as p,jsxs as m}from"react/jsx-runtime";import*as s from"react";import{cn as n}from"../helpers/index.js";import{cva as f}from"class-variance-authority";const l=f("ai-border-input ai-w-full ai-bg-background focus-visible:ai-outline-none ai-flex ai-flex-row ai-items-center ai-overflow-hidden ai-rounded-md ai-border",{variants:{size:{sm:"ai-h-8 ai-text-sm",base:"ai-h-10",lg:"ai-h-12 ai-text-lg"}},defaultVariants:{size:"base"}}),d=s.forwardRef((t,i)=>{const{className:a,side:e="right",children:o,...r}=t;return p("div",{ref:i,...r,className:n("ai-flex ai-h-full ai-items-center",a,{"-ai-order-1":e==="left","ai-order-2":e==="right"}),children:o})}),u=s.forwardRef(({className:t,type:i,size:a,children:e,...o},r)=>s.isValidElement(e)?m("div",{className:n(l({size:a}),t),children:[p("input",{type:i,className:n("placeholder:ai-text-muted-foreground ai-flex ai-size-full file:ai-border-0 file:ai-bg-transparent file:ai-font-medium focus-visible:ai-outline-none disabled:ai-cursor-not-allowed disabled:ai-opacity-50 ai-px-3"),ref:r,...o}),e]}):p("input",{type:i,className:n(l({size:a}),"ai-px-3",t),ref:r,...o}));u.displayName="Input",d.displayName="InputSlot";export{u as Input,d as InputSlot};
|
|
2
|
+
//# sourceMappingURL=input.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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.js'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nconst inputVariants = cva(\n 'ai-border-input ai-w-full ai-bg-background focus-visible:ai-outline-none ai-flex ai-flex-row ai-items-center ai-overflow-hidden ai-rounded-md ai-border',\n {\n variants: {\n size: {\n sm: 'ai-h-8 ai-text-sm',\n base: 'ai-h-10',\n lg: 'ai-h-12 ai-text-lg',\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 * default: right\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 = 'right', children, ...slotProps } = props\n\n return (\n <div\n ref={forwardedRef}\n {...slotProps}\n className={cn('ai-flex ai-h-full ai-items-center', className, {\n '-ai-order-1': side === 'left',\n 'ai-order-2': 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 if (!React.isValidElement(children)) {\n return <input type={type} className={cn(inputVariants({ size }), 'ai-px-3', className)} ref={ref} {...props} />\n }\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 file:ai-border-0 file:ai-bg-transparent file:ai-font-medium focus-visible:ai-outline-none disabled:ai-cursor-not-allowed disabled:ai-opacity-50 ai-px-3'\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
|
+
"mappings": "aA0CI,cAAAA,EAmBE,QAAAC,MAnBF,oBAxCJ,UAAYC,MAAW,QACvB,OAAS,MAAAC,MAAU,sBAEnB,OAAS,OAAAC,MAA8B,2BAEvC,MAAMC,EAAgBD,EACpB,0JACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,oBACJ,KAAM,UACN,GAAI,oBACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAiBME,EAAYJ,EAAM,WAA6C,CAACK,EAAOC,IAAiB,CAC5F,KAAM,CAAE,UAAAC,EAAW,KAAAC,EAAO,QAAS,SAAAC,EAAU,GAAGC,CAAU,EAAIL,EAE9D,OACEP,EAAC,OACC,IAAKQ,EACJ,GAAGI,EACJ,UAAWT,EAAG,oCAAqCM,EAAW,CAC5D,cAAeC,IAAS,OACxB,aAAcA,IAAS,OACzB,CAAC,EAEA,SAAAC,EACH,CAEJ,CAAC,EAEKE,EAAQX,EAAM,WAClB,CAAC,CAAE,UAAAO,EAAW,KAAAK,EAAM,KAAAC,EAAM,SAAAJ,EAAU,GAAGJ,CAAM,EAAGS,IACzCd,EAAM,eAAeS,CAAQ,EAIhCV,EAAC,OAAI,UAAWE,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAGN,CAAS,EACnD,UAAAT,EAAC,SACC,KAAMc,EACN,UAAWX,EACT,mNACF,EACA,IAAKa,EACJ,GAAGT,EACN,EACCI,GACH,EAbOX,EAAC,SAAM,KAAMc,EAAM,UAAWX,EAAGE,EAAc,CAAE,KAAAU,CAAK,CAAC,EAAG,UAAWN,CAAS,EAAG,IAAKO,EAAM,GAAGT,EAAO,CAgBnH,EACAM,EAAM,YAAc,QACpBP,EAAU,YAAc",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cn", "cva", "inputVariants", "InputSlot", "props", "forwardedRef", "className", "side", "children", "slotProps", "Input", "type", "size", "ref"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopoverPrimitive from '@radix-ui/react-popover';
|
|
3
|
+
declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
|
|
4
|
+
declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export { Popover, PopoverTrigger, PopoverContent };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e}from"react/jsx-runtime";import*as s from"react";import*as o from"@radix-ui/react-popover";import{cn as p}from"../helpers/utils.js";const m=o.Root,f=o.Trigger,t=s.forwardRef(({className:a,align:i="center",sideOffset:r=4,...n},d)=>e(o.Portal,{children:e(o.Content,{ref:d,align:i,sideOffset:r,className:p("ai-bg-popover ai-text-popover-foreground data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 data-[state=closed]:ai-zoom-out-95 data-[state=open]:ai-zoom-in-95 data-[side=bottom]:ai-slide-in-from-top-2 data-[side=left]:ai-slide-in-from-right-2 data-[side=right]:ai-slide-in-from-left-2 data-[side=top]:ai-slide-in-from-bottom-2 ai-z-50 ai-w-72 ai-rounded-md ai-border ai-p-4 ai-shadow-md ai-outline-none",a),...n})}));t.displayName=o.Content.displayName;export{m as Popover,t as PopoverContent,f as PopoverTrigger};
|
|
2
|
+
//# sourceMappingURL=popover.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/popover.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport * as PopoverPrimitive from '@radix-ui/react-popover'\n\nimport { cn } from '../helpers/utils.js'\n\nconst Popover = PopoverPrimitive.Root\n\nconst PopoverTrigger = PopoverPrimitive.Trigger\n\nconst PopoverContent = React.forwardRef<\n React.ElementRef<typeof PopoverPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <PopoverPrimitive.Portal>\n <PopoverPrimitive.Content\n ref={ref}\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'ai-bg-popover ai-text-popover-foreground data-[state=open]:ai-animate-in data-[state=closed]:ai-animate-out data-[state=closed]:ai-fade-out-0 data-[state=open]:ai-fade-in-0 data-[state=closed]:ai-zoom-out-95 data-[state=open]:ai-zoom-in-95 data-[side=bottom]:ai-slide-in-from-top-2 data-[side=left]:ai-slide-in-from-right-2 data-[side=right]:ai-slide-in-from-left-2 data-[side=top]:ai-slide-in-from-bottom-2 ai-z-50 ai-w-72 ai-rounded-md ai-border ai-p-4 ai-shadow-md ai-outline-none',\n className\n )}\n {...props}\n />\n </PopoverPrimitive.Portal>\n))\nPopoverContent.displayName = PopoverPrimitive.Content.displayName\n\nexport { Popover, PopoverTrigger, PopoverContent }\n"],
|
|
5
|
+
"mappings": "aAgBI,cAAAA,MAAA,oBAdJ,UAAYC,MAAW,QACvB,UAAYC,MAAsB,0BAElC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAUF,EAAiB,KAE3BG,EAAiBH,EAAiB,QAElCI,EAAiBL,EAAM,WAG3B,CAAC,CAAE,UAAAM,EAAW,MAAAC,EAAQ,SAAU,WAAAC,EAAa,EAAG,GAAGC,CAAM,EAAGC,IAC5DX,EAACE,EAAiB,OAAjB,CACC,SAAAF,EAACE,EAAiB,QAAjB,CACC,IAAKS,EACL,MAAOH,EACP,WAAYC,EACZ,UAAWN,EACT,seACAI,CACF,EACC,GAAGG,EACN,EACF,CACD,EACDJ,EAAe,YAAcJ,EAAiB,QAAQ",
|
|
6
|
+
"names": ["jsx", "React", "PopoverPrimitive", "cn", "Popover", "PopoverTrigger", "PopoverContent", "className", "align", "sideOffset", "props", "ref"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
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>>;
|
|
15
|
+
export { RadioGroup, RadioGroupItem };
|
|
16
|
+
export type { RadioGroupProps, RadioGroupItemProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as v}from"react/jsx-runtime";import*as a from"react";import*as p from"@radix-ui/react-radio-group";import{Text as R}from"./text.js";import{CheckIcon as l}from"@radix-ui/react-icons";import{cva as P}from"class-variance-authority";import{cn as d}from"../helpers/index.js";const m=a.createContext({size:"base"}),G=P("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"}}),u=a.forwardRef(({className:i,children:r,size:o,...t},s)=>e(p.Root,{className:d("grid gap-2",i),...t,ref:s,children:e(m.Provider,{value:{size:o},children:r})}));u.displayName="RadioGroup";const f=a.forwardRef(({className:i,size:r,children:o,...t},s)=>{const{size:c}=a.useContext(m),n=e(p.Item,{ref:s,className:d(G({size:r??c}),i),...t,children:e(p.Indicator,{className:"ai-flex ai-items-center ai-justify-center ai-text-current ai-w-full ai-h-full",children:e(l,{})})});return o?v(R,{as:"label",className:d("ai-flex ai-items-center ai-gap-1",i),children:[n,o]}):n});f.displayName="RadioGroupItem";export{u as RadioGroup,f as RadioGroupItem};
|
|
2
|
+
//# sourceMappingURL=radio.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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 { Text } from './text.js'\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, children, ...props }, ref) => {\n const { size: sizeFromParent } = React.useContext(RadioContext)\n\n const ItemRadio = (\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 if (children) {\n return (\n <Text as=\"label\" className={cn('ai-flex ai-items-center ai-gap-1', className)}>\n {ItemRadio}\n {children}\n </Text>\n )\n }\n return ItemRadio\n }\n)\nRadioGroupItem.displayName = 'RadioGroupItem'\n\nexport { RadioGroup, RadioGroupItem }\nexport type { RadioGroupProps, RadioGroupItemProps }\n"],
|
|
5
|
+
"mappings": "aAsCQ,cAAAA,EAkCA,QAAAC,MAlCA,oBApCR,UAAYC,MAAW,QACvB,UAAYC,MAAyB,8BACrC,OAAS,QAAAC,MAAY,YACrB,OAAS,aAAAC,MAAiB,wBAC1B,OAAS,OAAAC,MAA8B,2BACvC,OAAS,MAAAC,MAAU,sBAEnB,MAAMC,EAAeN,EAAM,cAA+C,CACxE,KAAM,MACR,CAAC,EAEKO,EAAqBH,EACzB,0VACA,CACE,SAAU,CACR,KAAM,CACJ,GAAI,iBACJ,KAAM,YACN,GAAI,WACN,CACF,EACA,gBAAiB,CACf,KAAM,MACR,CACF,CACF,EAOMI,EAAaR,EAAM,WACvB,CAAC,CAAE,UAAAS,EAAW,SAAAC,EAAU,KAAAC,EAAM,GAAGC,CAAM,EAAGC,IAEtCf,EAACG,EAAoB,KAApB,CAAyB,UAAWI,EAAG,aAAcI,CAAS,EAAI,GAAGG,EAAO,IAAKC,EAChF,SAAAf,EAACQ,EAAa,SAAb,CAAsB,MAAO,CAAE,KAAAK,CAAK,EAAI,SAAAD,EAAS,EACpD,CAGN,EACAF,EAAW,YAAc,aAMzB,MAAMM,EAAiBd,EAAM,WAC3B,CAAC,CAAE,UAAAS,EAAW,KAAAE,EAAM,SAAAD,EAAU,GAAGE,CAAM,EAAGC,IAAQ,CAChD,KAAM,CAAE,KAAME,CAAe,EAAIf,EAAM,WAAWM,CAAY,EAExDU,EACJlB,EAACG,EAAoB,KAApB,CACC,IAAKY,EACL,UAAWR,EACTE,EAAmB,CACjB,KAAMI,GAAQI,CAChB,CAAC,EACDN,CACF,EACC,GAAGG,EAEJ,SAAAd,EAACG,EAAoB,UAApB,CAA8B,UAAU,gFACvC,SAAAH,EAACK,EAAA,EAAU,EACb,EACF,EAGF,OAAIO,EAEAX,EAACG,EAAA,CAAK,GAAG,QAAQ,UAAWG,EAAG,mCAAoCI,CAAS,EACzE,UAAAO,EACAN,GACH,EAGGM,CACT,CACF,EACAF,EAAe,YAAc",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "RadioGroupPrimitive", "Text", "CheckIcon", "cva", "cn", "RadioContext", "radioGroupVariants", "RadioGroup", "className", "children", "size", "props", "ref", "RadioGroupItem", "sizeFromParent", "ItemRadio"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
3
|
+
interface SkeletonProps extends ComponentPropsWithout<'span', RemovedProps> {
|
|
4
|
+
/** 是否正在加载 , 默认是true*/
|
|
5
|
+
loading?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const Skeleton: React.ForwardRefExoticComponent<SkeletonProps & React.RefAttributes<HTMLSpanElement>>;
|
|
8
|
+
export default Skeleton;
|
|
9
|
+
export type { SkeletonProps };
|
|
@@ -0,0 +1,5 @@
|
|
|
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};
|
|
5
|
+
//# sourceMappingURL=skeleton.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/skeleton.tsx"],
|
|
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
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type VariantProps } from 'class-variance-authority';
|
|
3
|
+
import type { ComponentPropsWithout, RemovedProps } from '../helpers/component-props.js';
|
|
4
|
+
declare const textVariants: (props?: ({
|
|
5
|
+
size?: "none" | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | null | undefined;
|
|
6
|
+
weights?: "bold" | "light" | "normal" | "medium" | null | undefined;
|
|
7
|
+
align?: "center" | "left" | "right" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/dist/types.js").ClassProp) | undefined) => string;
|
|
9
|
+
type TextSpanProps = {
|
|
10
|
+
as?: 'span';
|
|
11
|
+
} & ComponentPropsWithout<'span', RemovedProps>;
|
|
12
|
+
type TextDivProps = {
|
|
13
|
+
as: 'div';
|
|
14
|
+
} & ComponentPropsWithout<'div', RemovedProps>;
|
|
15
|
+
type TextLabelProps = {
|
|
16
|
+
as: 'label';
|
|
17
|
+
} & ComponentPropsWithout<'label', RemovedProps>;
|
|
18
|
+
type TextPProps = {
|
|
19
|
+
as: 'p';
|
|
20
|
+
} & ComponentPropsWithout<'p', RemovedProps>;
|
|
21
|
+
interface CommonTextProps extends VariantProps<typeof textVariants> {
|
|
22
|
+
as?: 'div' | 'label' | 'p' | 'span';
|
|
23
|
+
asChild?: boolean;
|
|
24
|
+
color?: string;
|
|
25
|
+
/** 相当于 dangerouslySetInnerHTML */
|
|
26
|
+
html?: string;
|
|
27
|
+
}
|
|
28
|
+
type TextProps = CommonTextProps & (TextSpanProps | TextDivProps | TextLabelProps | TextPProps);
|
|
29
|
+
declare const Text: React.ForwardRefExoticComponent<TextProps & React.RefAttributes<HTMLSpanElement>>;
|
|
30
|
+
export { Text };
|
|
31
|
+
export type { TextProps };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{jsx as n}from"react/jsx-runtime";import*as T from"react";import{Slot as c}from"@radix-ui/react-slot";import{cn as g}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"},align:{left:"ai-text-left",center:"ai-text-center",right:"ai-text-right"}},defaultVariants:{size:"none",weights:"normal",align:"left"}}),a=T.forwardRef((r,p)=>{const{children:t,size:i="none",weights:l,align:m="left",className:x,asChild:P,as:d="span",color:e,html:o,...f}=r,s=o?{dangerouslySetInnerHTML:{__html:o}}:null,h=e?{style:{color:e}}:null;return n(c,{...f,ref:p,className:g(u({size:i,weights:l,align:m}),x),...s,...h,children:P?t:n(d,{children:s?null:t})})});a.displayName="Text";export{a as Text};
|
|
2
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 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'\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 align: {\n left: 'ai-text-left',\n center: 'ai-text-center',\n right: 'ai-text-right',\n },\n },\n defaultVariants: {\n size: 'none',\n weights: 'normal',\n align: 'left',\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 {\n children,\n size = 'none',\n weights,\n align = 'left',\n className,\n asChild,\n as: Tag = 'span',\n color,\n html,\n ...textProps\n } = 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 align,\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": "AAkG4B,cAAAA,MAAA,oBAlG5B,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,EACA,MAAO,CACL,KAAM,eACN,OAAQ,iBACR,MAAO,eACT,CACF,EACA,gBAAiB,CACf,KAAM,OACN,QAAS,SACT,MAAO,MACT,CACF,CAAC,EAkBKE,EAAOL,EAAM,WAAmC,CAACM,EAAOC,IAAiB,CAC7E,KAAM,CACJ,SAAAC,EACA,KAAAC,EAAO,OACP,QAAAC,EACA,MAAAC,EAAQ,OACR,UAAAC,EACA,QAAAC,EACA,GAAIC,EAAM,OACV,MAAAC,EACA,KAAAC,EACA,GAAGC,CACL,EAAIX,EAEEY,EAAmBF,EACrB,CACE,wBAAyB,CAAE,OAAQA,CAAK,CAC1C,EACA,KAEEG,EAAaJ,EACf,CACE,MAAO,CACL,MAAAA,CACF,CACF,EACA,KAEJ,OACEhB,EAACE,EAAA,CACE,GAAGgB,EACJ,IAAKV,EACL,UAAWL,EACTE,EAAa,CACX,KAAAK,EACA,QAAAC,EACA,MAAAC,CACF,CAAC,EACDC,CACF,EACC,GAAGM,EACH,GAAGC,EAEH,SAAAN,EAAUL,EAAWT,EAACe,EAAA,CAAK,SAAAI,EAAmB,KAAOV,EAAS,EACjE,CAEJ,CAAC,EACDH,EAAK,YAAc",
|
|
6
|
+
"names": ["jsx", "React", "Slot", "cn", "cva", "textVariants", "Text", "props", "forwardedRef", "children", "size", "weights", "align", "className", "asChild", "Tag", "color", "html", "textProps", "htmlContentProps", "styleProps"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Brand } from '../helpers/constants.js';
|
|
3
|
+
interface ThemeProps {
|
|
4
|
+
brand: Brand;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* @param param
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
declare const Theme: ({ brand, children }: ThemeProps) => import("react/jsx-runtime.js").JSX.Element;
|
|
13
|
+
export default Theme;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{Fragment as o,jsx as n}from"react/jsx-runtime";import*as r from"react";const a=({brand:e,children:t})=>(r.useLayoutEffect(()=>{document.querySelector("html")?.setAttribute("data-brand-theme",e)},[]),n(o,{children:t}));var c=a;export{c as default};
|
|
2
|
+
//# sourceMappingURL=theme.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/theme.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport * as React from 'react'\nimport type { Brand } from '../helpers/constants.js'\n\ninterface ThemeProps {\n brand: Brand\n children: React.ReactNode\n}\n/**\n *\n * @param param\n * @returns\n */\nconst Theme = ({ brand, children }: ThemeProps) => {\n React.useLayoutEffect(() => {\n document.querySelector('html')?.setAttribute('data-brand-theme', brand)\n }, [])\n return <>{children}</>\n}\n\nexport default Theme\n"],
|
|
5
|
+
"mappings": "aAiBS,mBAAAA,EAAA,OAAAC,MAAA,oBAhBT,UAAYC,MAAW,QAYvB,MAAMC,EAAQ,CAAC,CAAE,MAAAC,EAAO,SAAAC,CAAS,KAC/BH,EAAM,gBAAgB,IAAM,CAC1B,SAAS,cAAc,MAAM,GAAG,aAAa,mBAAoBE,CAAK,CACxE,EAAG,CAAC,CAAC,EACEH,EAAAD,EAAA,CAAG,SAAAK,EAAS,GAGrB,IAAOC,EAAQH",
|
|
6
|
+
"names": ["Fragment", "jsx", "React", "Theme", "brand", "children", "theme_default"]
|
|
7
|
+
}
|