@sakura-ui/sakura-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/README.md +27 -1
- package/package.json +4 -4
- package/packages/config/package.json +2 -3
- package/packages/config/src/index.ts +1 -4
- package/packages/config/vite.config.ts +1 -13
- package/packages/forms/dist/components/Checkbox.d.ts +5 -0
- package/packages/forms/dist/components/Checkbox.d.ts.map +1 -0
- package/packages/forms/dist/components/Radio.d.ts +5 -0
- package/packages/forms/dist/components/Radio.d.ts.map +1 -0
- package/packages/forms/dist/components/Select.d.ts +5 -0
- package/packages/forms/dist/components/Select.d.ts.map +1 -0
- package/packages/forms/dist/components/Text.d.ts +5 -0
- package/packages/forms/dist/components/Text.d.ts.map +1 -0
- package/packages/forms/dist/components/Textarea.d.ts +5 -0
- package/packages/forms/dist/components/Textarea.d.ts.map +1 -0
- package/packages/forms/dist/components/controlled/CheckboxGroup.d.ts +9 -0
- package/packages/forms/dist/components/controlled/CheckboxGroup.d.ts.map +1 -0
- package/packages/forms/dist/components/controlled/InputItem.d.ts +5 -0
- package/packages/forms/dist/components/controlled/InputItem.d.ts.map +1 -0
- package/packages/forms/dist/components/controlled/RadioGroup.d.ts +9 -0
- package/packages/forms/dist/components/controlled/RadioGroup.d.ts.map +1 -0
- package/packages/forms/dist/components/controlled/Select.d.ts +6 -0
- package/packages/forms/dist/components/controlled/Select.d.ts.map +1 -0
- package/packages/forms/dist/components/controlled/Text.d.ts +6 -0
- package/packages/forms/dist/components/controlled/Text.d.ts.map +1 -0
- package/packages/forms/dist/components/controlled/Textarea.d.ts +6 -0
- package/packages/forms/dist/components/controlled/Textarea.d.ts.map +1 -0
- package/packages/forms/dist/components/controlled/index.d.ts +6 -0
- package/packages/forms/dist/components/controlled/index.d.ts.map +1 -0
- package/packages/forms/dist/components/index.d.ts +6 -0
- package/packages/forms/dist/components/index.d.ts.map +1 -0
- package/packages/forms/dist/index.cjs.js +112 -0
- package/packages/forms/dist/index.cjs.js.map +1 -0
- package/packages/forms/dist/index.d.ts +3 -0
- package/packages/forms/dist/index.d.ts.map +1 -0
- package/packages/forms/dist/index.es.js +844 -0
- package/packages/forms/dist/index.es.js.map +1 -0
- package/packages/{icons → forms}/node_modules/.bin/autoprefixer +2 -2
- package/packages/{icons → forms}/node_modules/.bin/jest +2 -2
- package/packages/{icons → forms}/node_modules/.bin/npm-run-all +2 -2
- package/packages/{icons → forms}/node_modules/.bin/run-p +2 -2
- package/packages/{icons → forms}/node_modules/.bin/run-s +2 -2
- package/packages/{icons → forms}/node_modules/.bin/tailwind +2 -2
- package/packages/{icons → forms}/node_modules/.bin/tailwindcss +2 -2
- package/packages/{icons → forms}/node_modules/.bin/ts-jest +2 -2
- package/packages/{icons → forms}/node_modules/.bin/ts-node +2 -2
- package/packages/{icons → forms}/node_modules/.bin/ts-node-cwd +2 -2
- package/packages/{icons → forms}/node_modules/.bin/ts-node-esm +2 -2
- package/packages/{icons → forms}/node_modules/.bin/ts-node-script +2 -2
- package/packages/{icons → forms}/node_modules/.bin/ts-node-transpile-only +2 -2
- package/packages/{icons → forms}/node_modules/.bin/ts-script +2 -2
- package/packages/{icons → forms}/node_modules/.bin/tsc +2 -2
- package/packages/{icons → forms}/node_modules/.bin/tsc-alias +2 -2
- package/packages/{icons → forms}/node_modules/.bin/tsserver +2 -2
- package/packages/{icons → forms}/node_modules/.bin/vite +2 -2
- package/packages/{icons → forms}/package.json +3 -3
- package/packages/forms/src/components/Checkbox.tsx +59 -0
- package/packages/{react → forms}/src/components/Radio.tsx +7 -5
- package/packages/{react → forms}/src/components/Select.tsx +19 -17
- package/packages/{react → forms}/src/components/Text.tsx +14 -14
- package/packages/{react → forms}/src/components/Textarea.tsx +14 -14
- package/packages/forms/src/components/controlled/CheckboxGroup.tsx +31 -0
- package/packages/forms/src/components/controlled/InputItem.ts +4 -0
- package/packages/forms/src/components/controlled/RadioGroup.tsx +36 -0
- package/packages/forms/src/components/controlled/Select.tsx +22 -0
- package/packages/forms/src/components/controlled/Text.tsx +22 -0
- package/packages/forms/src/components/controlled/Textarea.tsx +23 -0
- package/packages/forms/src/components/controlled/index.ts +5 -0
- package/packages/forms/src/components/index.ts +5 -0
- package/packages/forms/src/index.ts +9 -0
- package/packages/react/package.json +1 -1
- package/packages/react/src/components/IconButton.tsx +78 -6
- package/packages/react/src/components/List.tsx +1 -0
- package/packages/react/src/components/index.ts +1 -6
- package/packages/react/src/index.ts +2 -7
- package/packages/config/src/material-symbols-outlined.woff2 +0 -0
- package/packages/icons/dist/components/Icon.d.ts +0 -6
- package/packages/icons/dist/components/Icon.d.ts.map +0 -1
- package/packages/icons/dist/components/IconButton.d.ts +0 -8
- package/packages/icons/dist/components/IconButton.d.ts.map +0 -1
- package/packages/icons/dist/components/index.d.ts +0 -3
- package/packages/icons/dist/components/index.d.ts.map +0 -1
- package/packages/icons/dist/index.cjs.js +0 -88
- package/packages/icons/dist/index.cjs.js.map +0 -1
- package/packages/icons/dist/index.d.ts +0 -2
- package/packages/icons/dist/index.d.ts.map +0 -1
- package/packages/icons/dist/index.es.js +0 -725
- package/packages/icons/dist/index.es.js.map +0 -1
- package/packages/icons/src/components/IconButton.tsx +0 -94
- package/packages/icons/src/components/index.ts +0 -2
- package/packages/icons/src/index.ts +0 -1
- package/packages/react/src/components/Checkbox.tsx +0 -56
- package/packages/react/src/components/RadioGroup.tsx +0 -38
- /package/packages/{icons → forms}/dist/utils/index.d.ts +0 -0
- /package/packages/{icons → forms}/dist/utils/index.d.ts.map +0 -0
- /package/packages/{icons → forms}/src/utils/index.ts +0 -0
- /package/packages/{icons → forms}/src/vite-env.d.ts +0 -0
- /package/packages/{icons → forms}/tsconfig.json +0 -0
- /package/packages/{icons → forms}/tsconfig.node.json +0 -0
- /package/packages/{icons → forms}/vite.config.ts +0 -0
- /package/packages/{icons → react}/src/components/Icon.tsx +0 -0
|
@@ -8,20 +8,20 @@ export const Text = React.forwardRef<HTMLInputElement, TextProps>(
|
|
|
8
8
|
const { className, ...newProps } = props
|
|
9
9
|
|
|
10
10
|
const style = `
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
p-4
|
|
12
|
+
rounded-lg
|
|
13
|
+
border
|
|
14
|
+
border-solid
|
|
15
|
+
border-sumi-900
|
|
16
|
+
focus:outline
|
|
17
|
+
focus:outline-2
|
|
18
|
+
focus:outline-wood-500
|
|
19
|
+
disabled:bg-sumi-500
|
|
20
|
+
disabled:text-white-1000
|
|
21
|
+
disabled:border
|
|
22
|
+
disabled:border-solid
|
|
23
|
+
disabled:border-sumi-500
|
|
24
|
+
`
|
|
25
25
|
|
|
26
26
|
return (
|
|
27
27
|
<input
|
|
@@ -9,20 +9,20 @@ export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
9
9
|
const { className, children, ...newProps } = props
|
|
10
10
|
|
|
11
11
|
const style = `
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
12
|
+
p-4
|
|
13
|
+
rounded-lg
|
|
14
|
+
border
|
|
15
|
+
border-solid
|
|
16
|
+
border-sumi-900
|
|
17
|
+
focus:outline
|
|
18
|
+
focus:outline-2
|
|
19
|
+
focus:outline-wood-500
|
|
20
|
+
disabled:bg-sumi-500
|
|
21
|
+
disabled:text-white-1000
|
|
22
|
+
disabled:border
|
|
23
|
+
disabled:border-solid
|
|
24
|
+
disabled:border-sumi-500
|
|
25
|
+
`
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<textarea className={cx(style, className)} {...newProps} ref={ref}>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Checkbox } from '../Checkbox'
|
|
3
|
+
import { InputItem } from './InputItem'
|
|
4
|
+
import { cx } from '../../utils'
|
|
5
|
+
|
|
6
|
+
export interface CheckboxGroupProps
|
|
7
|
+
extends Omit<React.ComponentProps<'fieldset'>, 'onChange'> {
|
|
8
|
+
items: InputItem[]
|
|
9
|
+
onChange: React.ChangeEventHandler<HTMLInputElement>
|
|
10
|
+
label: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const CheckboxGroup = (props: CheckboxGroupProps) => {
|
|
14
|
+
const { items, onChange, label, className, ...newProps } = props
|
|
15
|
+
const groupName = `checkbox_group_${Math.random()}`
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<fieldset className={cx('mb-4', className)} {...newProps}>
|
|
19
|
+
<legend>{label}</legend>
|
|
20
|
+
{items.map(({ label, value }, index) => {
|
|
21
|
+
return (
|
|
22
|
+
<div key={index}>
|
|
23
|
+
<Checkbox name={groupName} value={value} onChange={onChange}>
|
|
24
|
+
{label}
|
|
25
|
+
</Checkbox>
|
|
26
|
+
</div>
|
|
27
|
+
)
|
|
28
|
+
})}
|
|
29
|
+
</fieldset>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { Radio } from '../Radio'
|
|
3
|
+
import { InputItem } from './InputItem'
|
|
4
|
+
import { cx } from '../../utils'
|
|
5
|
+
|
|
6
|
+
export interface RadioGroupProps
|
|
7
|
+
extends Omit<React.ComponentProps<'fieldset'>, 'onChange'> {
|
|
8
|
+
items: InputItem[]
|
|
9
|
+
onChange: React.ChangeEventHandler<HTMLInputElement>
|
|
10
|
+
label: string
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const RadioGroup = (props: RadioGroupProps) => {
|
|
14
|
+
const { items, onChange, label, className, ...newProps } = props
|
|
15
|
+
const groupName = `radio_group_${Math.random()}`
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<fieldset className={cx('mb-4', className)} {...newProps}>
|
|
19
|
+
<legend>{label}</legend>
|
|
20
|
+
{items.map(({ label, value }, index) => {
|
|
21
|
+
return (
|
|
22
|
+
<div key={index}>
|
|
23
|
+
<Radio
|
|
24
|
+
name={groupName}
|
|
25
|
+
value={value}
|
|
26
|
+
onChange={onChange}
|
|
27
|
+
defaultChecked={index === 0}
|
|
28
|
+
>
|
|
29
|
+
{label}
|
|
30
|
+
</Radio>
|
|
31
|
+
</div>
|
|
32
|
+
)
|
|
33
|
+
})}
|
|
34
|
+
</fieldset>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cx } from '../../utils'
|
|
3
|
+
import { Select as Atom } from '../Select'
|
|
4
|
+
|
|
5
|
+
export interface SelectProps extends React.ComponentPropsWithoutRef<'select'> {
|
|
6
|
+
label: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Select = React.forwardRef<HTMLSelectElement, SelectProps>(
|
|
10
|
+
(props, ref) => {
|
|
11
|
+
const { label, className, ...newProps } = props
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={cx('mb-4', className)}>
|
|
15
|
+
<label>
|
|
16
|
+
<div className="block mb-2">{label}</div>
|
|
17
|
+
<Atom ref={ref} {...newProps} />
|
|
18
|
+
</label>
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cx } from '../../utils'
|
|
3
|
+
import { Text as Atom } from '../Text'
|
|
4
|
+
|
|
5
|
+
export interface TextProps extends React.ComponentPropsWithoutRef<'input'> {
|
|
6
|
+
label: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const Text = React.forwardRef<HTMLInputElement, TextProps>(
|
|
10
|
+
(props, ref) => {
|
|
11
|
+
const { label, className, ...newProps } = props
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<div className={cx('mb-4', className)}>
|
|
15
|
+
<label>
|
|
16
|
+
<div className="block mb-2">{label}</div>
|
|
17
|
+
<Atom ref={ref} {...newProps} />
|
|
18
|
+
</label>
|
|
19
|
+
</div>
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import { cx } from '../../utils'
|
|
3
|
+
import { Textarea as Atom } from '../Textarea'
|
|
4
|
+
|
|
5
|
+
export interface TextareaProps
|
|
6
|
+
extends React.ComponentPropsWithoutRef<'textarea'> {
|
|
7
|
+
label: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
11
|
+
(props, ref) => {
|
|
12
|
+
const { label, className, ...newProps } = props
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<div className={cx('mb-4', className)}>
|
|
16
|
+
<label>
|
|
17
|
+
<div className="block mb-2">{label}</div>
|
|
18
|
+
<Atom ref={ref} {...newProps} />
|
|
19
|
+
</label>
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
)
|
|
@@ -1,22 +1,94 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { cx } from '../utils'
|
|
3
3
|
|
|
4
4
|
export interface IconButtonProps extends React.ComponentProps<'button'> {
|
|
5
5
|
variant?: 'primary' | 'secondary'
|
|
6
|
+
iconLayout?: 'left' | 'right'
|
|
6
7
|
icon: string
|
|
7
8
|
}
|
|
8
9
|
|
|
9
10
|
export const IconButton = React.forwardRef<HTMLButtonElement, IconButtonProps>(
|
|
10
11
|
(props, ref) => {
|
|
11
|
-
const { children, icon, ...newProps } =
|
|
12
|
+
const { className, children, variant, icon, iconLayout, ...newProps } =
|
|
13
|
+
props
|
|
14
|
+
|
|
15
|
+
const layout = iconLayout ?? 'left'
|
|
12
16
|
|
|
13
17
|
const align = 'center'
|
|
14
18
|
|
|
19
|
+
const style = `
|
|
20
|
+
inline-block
|
|
21
|
+
p-4
|
|
22
|
+
text-base
|
|
23
|
+
font-bold
|
|
24
|
+
rounded-lg
|
|
25
|
+
text-${align}
|
|
26
|
+
cursor-pointer
|
|
27
|
+
whitespace-nowrap
|
|
28
|
+
`
|
|
29
|
+
|
|
30
|
+
const primary = `
|
|
31
|
+
text-white-1000
|
|
32
|
+
border
|
|
33
|
+
border-solid
|
|
34
|
+
border-sea-600
|
|
35
|
+
bg-sea-600
|
|
36
|
+
hover:bg-sea-800
|
|
37
|
+
active:bg-sea-800
|
|
38
|
+
focus:outline
|
|
39
|
+
focus:outline-2
|
|
40
|
+
focus:outline-wood-500
|
|
41
|
+
disabled:bg-sumi-500
|
|
42
|
+
disabled:text-white-1000
|
|
43
|
+
disabled:border
|
|
44
|
+
disabled:border-solid
|
|
45
|
+
disabled:border-sumi-500
|
|
46
|
+
disabled:cursor-not-allowed
|
|
47
|
+
`
|
|
48
|
+
const secondary = `
|
|
49
|
+
text-sea-600
|
|
50
|
+
border
|
|
51
|
+
border-solid
|
|
52
|
+
border-sea-600
|
|
53
|
+
hover:bg-sea-100
|
|
54
|
+
active:bg-sea-100
|
|
55
|
+
focus:outline
|
|
56
|
+
focus:outline-2
|
|
57
|
+
focus:outline-wood-500
|
|
58
|
+
disabled:hover:bg-white-1000
|
|
59
|
+
disabled:text-sumi-500
|
|
60
|
+
disabled:border
|
|
61
|
+
disabled:border-solid
|
|
62
|
+
disabled:border-sumi-500
|
|
63
|
+
disabled:cursor-not-allowed
|
|
64
|
+
`
|
|
65
|
+
|
|
66
|
+
const styles = {
|
|
67
|
+
primary: primary,
|
|
68
|
+
secondary: secondary
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const iconStyle = `
|
|
72
|
+
inline-block
|
|
73
|
+
align-middle
|
|
74
|
+
font-icon
|
|
75
|
+
text-2xl
|
|
76
|
+
font-light
|
|
77
|
+
leading-4
|
|
78
|
+
antialiased
|
|
79
|
+
mb-1
|
|
80
|
+
`
|
|
81
|
+
|
|
15
82
|
return (
|
|
16
|
-
<
|
|
17
|
-
|
|
18
|
-
{
|
|
19
|
-
|
|
83
|
+
<button
|
|
84
|
+
className={cx(style, styles[variant ?? 'primary'], className)}
|
|
85
|
+
{...newProps}
|
|
86
|
+
ref={ref}
|
|
87
|
+
>
|
|
88
|
+
{layout == 'left' && <span className={cx(iconStyle)}>{icon}</span>}
|
|
89
|
+
{children && <span className="mx-1 inline-block">{children}</span>}
|
|
90
|
+
{layout == 'right' && <span className={cx(iconStyle)}>{icon}</span>}
|
|
91
|
+
</button>
|
|
20
92
|
)
|
|
21
93
|
}
|
|
22
94
|
)
|
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
export { Button } from './Button'
|
|
2
2
|
export { Card } from './Card'
|
|
3
|
-
export { Checkbox } from './Checkbox'
|
|
4
3
|
export { Code } from './Code'
|
|
5
4
|
export { H1, H2, H3, H4, H5, H6 } from './Heading'
|
|
5
|
+
export { Icon } from './Icon'
|
|
6
6
|
export { IconButton } from './IconButton'
|
|
7
7
|
export { InfoCard } from './InfoCard'
|
|
8
8
|
export { Link } from './Link'
|
|
9
9
|
export { Ol, Ul } from './List'
|
|
10
10
|
export { Pre } from './Pre'
|
|
11
|
-
export { Radio } from './Radio'
|
|
12
|
-
export { RadioGroup } from './RadioGroup'
|
|
13
|
-
export { Select } from './Select'
|
|
14
11
|
export { Table, Caption, Thead, Tbody, Th, Tr, Td } from './Table'
|
|
15
|
-
export { Text } from './Text'
|
|
16
|
-
export { Textarea } from './Textarea'
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export {
|
|
2
2
|
Button,
|
|
3
3
|
Card,
|
|
4
|
-
Checkbox,
|
|
5
4
|
Code,
|
|
6
5
|
H1,
|
|
7
6
|
H2,
|
|
@@ -9,22 +8,18 @@ export {
|
|
|
9
8
|
H4,
|
|
10
9
|
H5,
|
|
11
10
|
H6,
|
|
11
|
+
Icon,
|
|
12
12
|
IconButton,
|
|
13
13
|
InfoCard,
|
|
14
14
|
Link,
|
|
15
15
|
Ol,
|
|
16
16
|
Ul,
|
|
17
17
|
Pre,
|
|
18
|
-
Radio,
|
|
19
|
-
RadioGroup,
|
|
20
|
-
Select,
|
|
21
18
|
Table,
|
|
22
19
|
Caption,
|
|
23
20
|
Thead,
|
|
24
21
|
Tbody,
|
|
25
22
|
Th,
|
|
26
23
|
Tr,
|
|
27
|
-
Td
|
|
28
|
-
Text,
|
|
29
|
-
Textarea
|
|
24
|
+
Td
|
|
30
25
|
} from './components'
|
|
Binary file
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface IconProps extends React.ComponentProps<'span'> {
|
|
3
|
-
icon: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const Icon: React.ForwardRefExoticComponent<Omit<IconProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
6
|
-
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../src/components/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC;IAC7D,IAAI,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,IAAI,4FAmBf,CAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface IconButtonProps extends React.ComponentProps<'button'> {
|
|
3
|
-
variant?: 'primary' | 'secondary';
|
|
4
|
-
iconLayout?: 'left' | 'right';
|
|
5
|
-
icon: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const IconButton: React.ForwardRefExoticComponent<Omit<IconButtonProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
-
//# sourceMappingURL=IconButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IconButton.d.ts","sourceRoot":"","sources":["../../src/components/IconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,MAAM,WAAW,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC;IACrE,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAA;IACjC,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;IAC7B,IAAI,EAAE,MAAM,CAAA;CACb;AAED,eAAO,MAAM,UAAU,wGAoFtB,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA"}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("react");var C={},sr={get exports(){return C},set exports(p){C=p}},N={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var we;function ur(){if(we)return N;we=1;var p=q,m=Symbol.for("react.element"),x=Symbol.for("react.fragment"),g=Object.prototype.hasOwnProperty,T=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,y={key:!0,ref:!0,__self:!0,__source:!0};function O(E,c,P){var f,h={},w=null,j=null;P!==void 0&&(w=""+P),c.key!==void 0&&(w=""+c.key),c.ref!==void 0&&(j=c.ref);for(f in c)g.call(c,f)&&!y.hasOwnProperty(f)&&(h[f]=c[f]);if(E&&E.defaultProps)for(f in c=E.defaultProps,c)h[f]===void 0&&(h[f]=c[f]);return{$$typeof:m,type:E,key:w,ref:j,props:h,_owner:T.current}}return N.Fragment=x,N.jsx=O,N.jsxs=O,N}var W={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var xe;function lr(){return xe||(xe=1,process.env.NODE_ENV!=="production"&&function(){var p=q,m=Symbol.for("react.element"),x=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),E=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),w=Symbol.for("react.lazy"),j=Symbol.for("react.offscreen"),A=Symbol.iterator,Oe="@@iterator";function Pe(e){if(e===null||typeof e!="object")return null;var r=A&&e[A]||e[Oe];return typeof r=="function"?r:null}var k=p.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function d(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];Se("error",e,t)}}function Se(e,r,t){{var n=k.ReactDebugCurrentFrame,i=n.getStackAddendum();i!==""&&(r+="%s",t=t.concat([i]));var s=t.map(function(o){return String(o)});s.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,s)}}var Ce=!1,je=!1,ke=!1,De=!1,Fe=!1,ee;ee=Symbol.for("react.module.reference");function Ae(e){return!!(typeof e=="string"||typeof e=="function"||e===g||e===y||Fe||e===T||e===P||e===f||De||e===j||Ce||je||ke||typeof e=="object"&&e!==null&&(e.$$typeof===w||e.$$typeof===h||e.$$typeof===O||e.$$typeof===E||e.$$typeof===c||e.$$typeof===ee||e.getModuleId!==void 0))}function Ie(e,r,t){var n=e.displayName;if(n)return n;var i=r.displayName||r.name||"";return i!==""?t+"("+i+")":t}function re(e){return e.displayName||"Context"}function R(e){if(e==null)return null;if(typeof e.tag=="number"&&d("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case g:return"Fragment";case x:return"Portal";case y:return"Profiler";case T:return"StrictMode";case P:return"Suspense";case f:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case E:var r=e;return re(r)+".Consumer";case O:var t=e;return re(t._context)+".Provider";case c:return Ie(e,e.render,"ForwardRef");case h:var n=e.displayName||null;return n!==null?n:R(e.type)||"Memo";case w:{var i=e,s=i._payload,o=i._init;try{return R(o(s))}catch{return null}}}return null}var S=Object.assign,I=0,te,ne,ae,oe,ie,se,ue;function le(){}le.__reactDisabledLog=!0;function $e(){{if(I===0){te=console.log,ne=console.info,ae=console.warn,oe=console.error,ie=console.group,se=console.groupCollapsed,ue=console.groupEnd;var e={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}I++}}function Ne(){{if(I--,I===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:S({},e,{value:te}),info:S({},e,{value:ne}),warn:S({},e,{value:ae}),error:S({},e,{value:oe}),group:S({},e,{value:ie}),groupCollapsed:S({},e,{value:se}),groupEnd:S({},e,{value:ue})})}I<0&&d("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var J=k.ReactCurrentDispatcher,G;function Y(e,r,t){{if(G===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);G=n&&n[1]||""}return`
|
|
18
|
-
`+G+e}}var z=!1,L;{var We=typeof WeakMap=="function"?WeakMap:Map;L=new We}function ce(e,r){if(!e||z)return"";{var t=L.get(e);if(t!==void 0)return t}var n;z=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var s;s=J.current,J.current=null,$e();try{if(r){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(o,[])}catch(_){n=_}Reflect.construct(e,[],o)}else{try{o.call()}catch(_){n=_}e.call(o.prototype)}}else{try{throw Error()}catch(_){n=_}e()}}catch(_){if(_&&n&&typeof _.stack=="string"){for(var a=_.stack.split(`
|
|
19
|
-
`),v=n.stack.split(`
|
|
20
|
-
`),u=a.length-1,l=v.length-1;u>=1&&l>=0&&a[u]!==v[l];)l--;for(;u>=1&&l>=0;u--,l--)if(a[u]!==v[l]){if(u!==1||l!==1)do if(u--,l--,l<0||a[u]!==v[l]){var b=`
|
|
21
|
-
`+a[u].replace(" at new "," at ");return e.displayName&&b.includes("<anonymous>")&&(b=b.replace("<anonymous>",e.displayName)),typeof e=="function"&&L.set(e,b),b}while(u>=1&&l>=0);break}}}finally{z=!1,J.current=s,Ne(),Error.prepareStackTrace=i}var F=e?e.displayName||e.name:"",Te=F?Y(F):"";return typeof e=="function"&&L.set(e,Te),Te}function Ye(e,r,t){return ce(e,!1)}function Le(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function M(e,r,t){if(e==null)return"";if(typeof e=="function")return ce(e,Le(e));if(typeof e=="string")return Y(e);switch(e){case P:return Y("Suspense");case f:return Y("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return Ye(e.render);case h:return M(e.type,r,t);case w:{var n=e,i=n._payload,s=n._init;try{return M(s(i),r,t)}catch{}}}return""}var V=Object.prototype.hasOwnProperty,fe={},de=k.ReactDebugCurrentFrame;function U(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);de.setExtraStackFrame(t)}else de.setExtraStackFrame(null)}function Me(e,r,t,n,i){{var s=Function.call.bind(V);for(var o in e)if(s(e,o)){var a=void 0;try{if(typeof e[o]!="function"){var v=Error((n||"React class")+": "+t+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw v.name="Invariant Violation",v}a=e[o](r,o,n,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(u){a=u}a&&!(a instanceof Error)&&(U(i),d("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",t,o,typeof a),U(null)),a instanceof Error&&!(a.message in fe)&&(fe[a.message]=!0,U(i),d("Failed %s type: %s",t,a.message),U(null))}}}var Ve=Array.isArray;function K(e){return Ve(e)}function Ue(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function Be(e){try{return ve(e),!1}catch{return!0}}function ve(e){return""+e}function pe(e){if(Be(e))return d("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ue(e)),ve(e)}var $=k.ReactCurrentOwner,qe={key:!0,ref:!0,__self:!0,__source:!0},be,ge,H;H={};function Je(e){if(V.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function Ge(e){if(V.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function ze(e,r){if(typeof e.ref=="string"&&$.current&&r&&$.current.stateNode!==r){var t=R($.current.type);H[t]||(d('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',R($.current.type),e.ref),H[t]=!0)}}function Ke(e,r){{var t=function(){be||(be=!0,d("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function He(e,r){{var t=function(){ge||(ge=!0,d("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var Xe=function(e,r,t,n,i,s,o){var a={$$typeof:m,type:e,key:r,ref:t,props:o,_owner:s};return a._store={},Object.defineProperty(a._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(a,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(a,"_source",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.freeze&&(Object.freeze(a.props),Object.freeze(a)),a};function Ze(e,r,t,n,i){{var s,o={},a=null,v=null;t!==void 0&&(pe(t),a=""+t),Ge(r)&&(pe(r.key),a=""+r.key),Je(r)&&(v=r.ref,ze(r,i));for(s in r)V.call(r,s)&&!qe.hasOwnProperty(s)&&(o[s]=r[s]);if(e&&e.defaultProps){var u=e.defaultProps;for(s in u)o[s]===void 0&&(o[s]=u[s])}if(a||v){var l=typeof e=="function"?e.displayName||e.name||"Unknown":e;a&&Ke(o,l),v&&He(o,l)}return Xe(e,a,v,i,n,$.current,o)}}var X=k.ReactCurrentOwner,he=k.ReactDebugCurrentFrame;function D(e){if(e){var r=e._owner,t=M(e.type,e._source,r?r.type:null);he.setExtraStackFrame(t)}else he.setExtraStackFrame(null)}var Z;Z=!1;function Q(e){return typeof e=="object"&&e!==null&&e.$$typeof===m}function me(){{if(X.current){var e=R(X.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function Qe(e){{if(e!==void 0){var r=e.fileName.replace(/^.*[\\\/]/,""),t=e.lineNumber;return`
|
|
24
|
-
|
|
25
|
-
Check your code at `+r+":"+t+"."}return""}}var ye={};function er(e){{var r=me();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
26
|
-
|
|
27
|
-
Check the top-level render call using <`+t+">.")}return r}}function Ee(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=er(r);if(ye[t])return;ye[t]=!0;var n="";e&&e._owner&&e._owner!==X.current&&(n=" It was passed a child from "+R(e._owner.type)+"."),D(e),d('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,n),D(null)}}function Re(e,r){{if(typeof e!="object")return;if(K(e))for(var t=0;t<e.length;t++){var n=e[t];Q(n)&&Ee(n,r)}else if(Q(e))e._store&&(e._store.validated=!0);else if(e){var i=Pe(e);if(typeof i=="function"&&i!==e.entries)for(var s=i.call(e),o;!(o=s.next()).done;)Q(o.value)&&Ee(o.value,r)}}}function rr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===h))t=r.propTypes;else return;if(t){var n=R(r);Me(t,e.props,"prop",n,e)}else if(r.PropTypes!==void 0&&!Z){Z=!0;var i=R(r);d("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",i||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&d("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function tr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var n=r[t];if(n!=="children"&&n!=="key"){D(e),d("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),D(null);break}}e.ref!==null&&(D(e),d("Invalid attribute `ref` supplied to `React.Fragment`."),D(null))}}function _e(e,r,t,n,i,s){{var o=Ae(e);if(!o){var a="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(a+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var v=Qe(i);v?a+=v:a+=me();var u;e===null?u="null":K(e)?u="array":e!==void 0&&e.$$typeof===m?(u="<"+(R(e.type)||"Unknown")+" />",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,d("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var l=Ze(e,r,t,i,s);if(l==null)return l;if(o){var b=r.children;if(b!==void 0)if(n)if(K(b)){for(var F=0;F<b.length;F++)Re(b[F],e);Object.freeze&&Object.freeze(b)}else d("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Re(b,e)}return e===g?tr(l):rr(l),l}}function nr(e,r,t){return _e(e,r,t,!0)}function ar(e,r,t){return _e(e,r,t,!1)}var or=ar,ir=nr;W.Fragment=g,W.jsx=or,W.jsxs=ir}()),W}(function(p){process.env.NODE_ENV==="production"?p.exports=ur():p.exports=lr()})(sr);const B=(...p)=>p.filter(Boolean).join(" "),cr=q.forwardRef((p,m)=>{const{className:x,children:g,variant:T,icon:y,iconLayout:O,...E}=p,c=O??"left",f=`
|
|
28
|
-
inline-block
|
|
29
|
-
p-4
|
|
30
|
-
text-base
|
|
31
|
-
font-bold
|
|
32
|
-
rounded-lg
|
|
33
|
-
text-center
|
|
34
|
-
cursor-pointer
|
|
35
|
-
whitespace-nowrap
|
|
36
|
-
`,j={primary:`
|
|
37
|
-
text-white-1000
|
|
38
|
-
border
|
|
39
|
-
border-solid
|
|
40
|
-
border-sea-600
|
|
41
|
-
bg-sea-600
|
|
42
|
-
hover:bg-sea-800
|
|
43
|
-
active:bg-sea-800
|
|
44
|
-
focus:outline
|
|
45
|
-
focus:outline-2
|
|
46
|
-
focus:outline-wood-500
|
|
47
|
-
disabled:bg-sumi-500
|
|
48
|
-
disabled:text-white-1000
|
|
49
|
-
disabled:border
|
|
50
|
-
disabled:border-solid
|
|
51
|
-
disabled:border-sumi-500
|
|
52
|
-
disabled:cursor-not-allowed
|
|
53
|
-
`,secondary:`
|
|
54
|
-
text-sea-600
|
|
55
|
-
border
|
|
56
|
-
border-solid
|
|
57
|
-
border-sea-600
|
|
58
|
-
hover:bg-sea-100
|
|
59
|
-
active:bg-sea-100
|
|
60
|
-
focus:outline
|
|
61
|
-
focus:outline-2
|
|
62
|
-
focus:outline-wood-500
|
|
63
|
-
disabled:hover:bg-white-1000
|
|
64
|
-
disabled:text-sumi-500
|
|
65
|
-
disabled:border
|
|
66
|
-
disabled:border-solid
|
|
67
|
-
disabled:border-sumi-500
|
|
68
|
-
disabled:cursor-not-allowed
|
|
69
|
-
`},A=`
|
|
70
|
-
inline-block
|
|
71
|
-
align-middle
|
|
72
|
-
font-icon
|
|
73
|
-
text-2xl
|
|
74
|
-
font-light
|
|
75
|
-
leading-4
|
|
76
|
-
antialiased
|
|
77
|
-
mb-1
|
|
78
|
-
`;return C.jsxs("button",{className:B(f,j[T??"primary"],x),...E,ref:m,children:[c=="left"&&C.jsx("span",{className:B(A),children:y}),g&&C.jsx("span",{className:"mx-1 inline-block",children:g}),c=="right"&&C.jsx("span",{className:B(A),children:y})]})}),fr=q.forwardRef((p,m)=>{const{className:x,icon:g,...T}=p,y=`
|
|
79
|
-
inline-block
|
|
80
|
-
align-middle
|
|
81
|
-
font-icon
|
|
82
|
-
text-2xl
|
|
83
|
-
font-light
|
|
84
|
-
leading-none
|
|
85
|
-
antialiased
|
|
86
|
-
mb-1
|
|
87
|
-
`;return C.jsx("span",{className:B(y,x),...T,ref:m,children:g})});exports.Icon=fr;exports.IconButton=cr;
|
|
88
|
-
//# sourceMappingURL=index.cjs.js.map
|