@sakura-ui/forms 0.1.12 → 0.2.0
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/index.cjs.js +92 -81
- package/dist/index.es.js +697 -627
- package/dist/types/components/Checkbox.d.ts +3 -1
- package/dist/types/components/Checkbox.d.ts.map +1 -1
- package/dist/types/components/FileInput.d.ts.map +1 -1
- package/dist/types/components/Input.d.ts +3 -1
- package/dist/types/components/Input.d.ts.map +1 -1
- package/dist/types/components/Radio.d.ts +3 -1
- package/dist/types/components/Radio.d.ts.map +1 -1
- package/dist/types/components/Select.d.ts +3 -1
- package/dist/types/components/Select.d.ts.map +1 -1
- package/dist/types/components/Textarea.d.ts.map +1 -1
- package/dist/types/components/controlled/CheckboxGroup.d.ts +3 -1
- package/dist/types/components/controlled/CheckboxGroup.d.ts.map +1 -1
- package/dist/types/components/controlled/RadioGroup.d.ts +3 -1
- package/dist/types/components/controlled/RadioGroup.d.ts.map +1 -1
- package/dist/types/components/controlled/index.d.ts +0 -2
- package/dist/types/components/controlled/index.d.ts.map +1 -1
- package/dist/types/components/inputStyle.d.ts +13 -0
- package/dist/types/components/inputStyle.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/class.d.ts.map +1 -1
- package/package.json +15 -14
- package/dist/components/Checkbox.js +0 -46
- package/dist/components/Checkbox.js.map +0 -1
- package/dist/components/FieldsetControl.js +0 -20
- package/dist/components/FieldsetControl.js.map +0 -1
- package/dist/components/FileInput.js +0 -55
- package/dist/components/FileInput.js.map +0 -1
- package/dist/components/Input.js +0 -29
- package/dist/components/Input.js.map +0 -1
- package/dist/components/LabelControl.js +0 -24
- package/dist/components/LabelControl.js.map +0 -1
- package/dist/components/Radio.js +0 -45
- package/dist/components/Radio.js.map +0 -1
- package/dist/components/Select.js +0 -41
- package/dist/components/Select.js.map +0 -1
- package/dist/components/Textarea.js +0 -36
- package/dist/components/Textarea.js.map +0 -1
- package/dist/components/context.js +0 -8
- package/dist/components/context.js.map +0 -1
- package/dist/components/controlled/CheckboxGroup.js +0 -12
- package/dist/components/controlled/CheckboxGroup.js.map +0 -1
- package/dist/components/controlled/InputItem.js +0 -2
- package/dist/components/controlled/InputItem.js.map +0 -1
- package/dist/components/controlled/RadioGroup.js +0 -12
- package/dist/components/controlled/RadioGroup.js.map +0 -1
- package/dist/components/controlled/SelectControl.js +0 -10
- package/dist/components/controlled/SelectControl.js.map +0 -1
- package/dist/components/controlled/TextareaControl.js +0 -10
- package/dist/components/controlled/TextareaControl.js.map +0 -1
- package/dist/components/controlled/index.js +0 -5
- package/dist/components/controlled/index.js.map +0 -1
- package/dist/components/index.js +0 -9
- package/dist/components/index.js.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/types/components/controlled/SelectControl.d.ts +0 -10
- package/dist/types/components/controlled/SelectControl.d.ts.map +0 -1
- package/dist/types/components/controlled/TextareaControl.d.ts +0 -10
- package/dist/types/components/controlled/TextareaControl.d.ts.map +0 -1
- package/dist/utils/class.js +0 -2
- package/dist/utils/class.js.map +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { type InputSize } from './inputStyle';
|
|
3
|
+
export interface CheckboxProps extends Omit<React.ComponentPropsWithRef<'input'>, 'size'> {
|
|
4
|
+
size?: InputSize;
|
|
3
5
|
}
|
|
4
6
|
export declare const Checkbox: React.ForwardRefExoticComponent<Omit<CheckboxProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
7
|
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1D,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,eAAO,MAAM,QAAQ,qGA+EpB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC;CAAG;AAE/E,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../../src/components/FileInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,cAAe,SAAQ,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC;CAAG;AAE/E,eAAO,MAAM,SAAS,sGAmErB,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { type InputSize } from './inputStyle';
|
|
3
|
+
export interface InputProps extends Omit<React.ComponentPropsWithRef<'input'>, 'size'> {
|
|
4
|
+
size?: InputSize;
|
|
3
5
|
}
|
|
4
6
|
export declare const Input: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
7
|
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1D,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,eAAO,MAAM,KAAK,kGA0BjB,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { type InputSize } from './inputStyle';
|
|
3
|
+
export interface RadioProps extends Omit<React.ComponentPropsWithRef<'input'>, 'size'> {
|
|
4
|
+
size?: InputSize;
|
|
3
5
|
}
|
|
4
6
|
export declare const Radio: React.ForwardRefExoticComponent<Omit<RadioProps, "ref"> & React.RefAttributes<HTMLInputElement>>;
|
|
5
7
|
//# sourceMappingURL=Radio.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Radio.d.ts","sourceRoot":"","sources":["../../../src/components/Radio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EACL,KAAK,SAAS,EAIf,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1D,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,eAAO,MAAM,KAAK,kGAmEjB,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { type InputSize } from './inputStyle';
|
|
3
|
+
export interface SelectProps extends Omit<React.ComponentPropsWithRef<'select'>, 'size'> {
|
|
4
|
+
size?: InputSize;
|
|
3
5
|
}
|
|
4
6
|
export declare const Select: React.ForwardRefExoticComponent<Omit<SelectProps, "ref"> & React.RefAttributes<HTMLSelectElement>>;
|
|
5
7
|
//# sourceMappingURL=Select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/Select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EACL,KAAK,SAAS,EAGf,MAAM,cAAc,CAAA;AAErB,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3D,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,eAAO,MAAM,MAAM,oGA8DlB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC;CAAG;AAEpD,eAAO,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","sourceRoot":"","sources":["../../../src/components/Textarea.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,WAAW,aACf,SAAQ,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC;CAAG;AAEpD,eAAO,MAAM,QAAQ,wGA+DpB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InputItem } from './InputItem';
|
|
2
|
+
import type { InputItem } from './InputItem';
|
|
3
|
+
import type { InputSize } from '../inputStyle';
|
|
3
4
|
export interface CheckboxGroupProps extends Omit<React.ComponentPropsWithRef<'fieldset'>, 'onChange'> {
|
|
4
5
|
items: InputItem[];
|
|
5
6
|
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -8,6 +9,7 @@ export interface CheckboxGroupProps extends Omit<React.ComponentPropsWithRef<'fi
|
|
|
8
9
|
errorMessage?: string;
|
|
9
10
|
isInvalid?: boolean;
|
|
10
11
|
isRequired?: boolean;
|
|
12
|
+
size?: InputSize;
|
|
11
13
|
}
|
|
12
14
|
export declare const CheckboxGroup: React.ForwardRefExoticComponent<Omit<CheckboxGroupProps, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
|
|
13
15
|
//# sourceMappingURL=CheckboxGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"CheckboxGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/CheckboxGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACjE,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,eAAO,MAAM,aAAa,6GA0CxB,CAAA"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { InputItem } from './InputItem';
|
|
2
|
+
import type { InputItem } from './InputItem';
|
|
3
|
+
import type { InputSize } from '../inputStyle';
|
|
3
4
|
export interface RadioGroupProps extends Omit<React.ComponentPropsWithRef<'fieldset'>, 'onChange'> {
|
|
4
5
|
items: InputItem[];
|
|
5
6
|
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
|
@@ -9,6 +10,7 @@ export interface RadioGroupProps extends Omit<React.ComponentPropsWithRef<'field
|
|
|
9
10
|
isInvalid?: boolean;
|
|
10
11
|
isRequired?: boolean;
|
|
11
12
|
defaultValue?: string;
|
|
13
|
+
size?: InputSize;
|
|
12
14
|
}
|
|
13
15
|
export declare const RadioGroup: React.ForwardRefExoticComponent<Omit<RadioGroupProps, "ref"> & React.RefAttributes<HTMLFieldSetElement>>;
|
|
14
16
|
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/RadioGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,KAAK,CAAC,qBAAqB,CAAC,UAAU,CAAC,EAAE,UAAU,CAAC;IACjE,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,QAAQ,EAAE,KAAK,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,CAAA;IACpD,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,CAAC,EAAE,SAAS,CAAA;CACjB;AAED,eAAO,MAAM,UAAU,0GA4CrB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/controlled/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type InputSize = 'lg' | 'md' | 'sm';
|
|
2
|
+
export declare const borderedInputBaseStyles = "\n bg-white\n border\n border-solid\n border-sumi-900\n outline-offset-2\n focus:outline\n focus:outline-2\n focus:outline-wood-500\n disabled:bg-transparent\n disabled:text-sumi-500\n disabled:border-sumi-500\n aria-invalid:border-sun-800\n";
|
|
3
|
+
export declare const borderedInputSizeStyles: {
|
|
4
|
+
[key in InputSize]: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const borderlessInputBaseStyles = "\n inline-block\n cursor-pointer\n border\n border-solid\n border-transparent\n";
|
|
7
|
+
export declare const borderlessInputSizeStyles: {
|
|
8
|
+
[key in InputSize]: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const iconStyles: {
|
|
11
|
+
[key in InputSize]: string;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=inputStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inputStyle.d.ts","sourceRoot":"","sources":["../../../src/components/inputStyle.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;AAE1C,eAAO,MAAM,uBAAuB,kQAanC,CAAA;AAGD,eAAO,MAAM,uBAAuB,EAAE;KAAG,GAAG,IAAI,SAAS,GAAG,MAAM;CAwBjE,CAAA;AAED,eAAO,MAAM,yBAAyB,yFAMrC,CAAA;AAGD,eAAO,MAAM,yBAAyB,EAAE;KAAG,GAAG,IAAI,SAAS,GAAG,MAAM;CAsBnE,CAAA;AAGD,eAAO,MAAM,UAAU,EAAE;KAAG,GAAG,IAAI,SAAS,GAAG,MAAM;CAIpD,CAAA"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Checkbox, Radio, Select, FileInput, Input, Textarea, LabelControl, FieldsetControl } from './components';
|
|
2
2
|
export type { CheckboxProps, RadioProps, SelectProps, FileInputProps, InputProps, TextareaProps, LabelControlProps, FieldsetControlProps } from './components';
|
|
3
|
-
export { CheckboxGroup, RadioGroup
|
|
3
|
+
export { CheckboxGroup, RadioGroup } from './components/controlled';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,eAAe,EAChB,MAAM,cAAc,CAAA;AAErB,YAAY,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAA;AAErB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,eAAe,EAChB,MAAM,cAAc,CAAA;AAErB,YAAY,EACV,aAAa,EACb,UAAU,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,oBAAoB,EACrB,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../../src/utils/class.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"class.d.ts","sourceRoot":"","sources":["../../../src/utils/class.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,EAAE,kBAAmB,GAAG,EAAE,WAAyC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sakura-ui/forms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "glassonion1",
|
|
@@ -25,9 +25,12 @@
|
|
|
25
25
|
"files": [
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
28
31
|
"scripts": {
|
|
29
32
|
"lint": "run-s lint:*",
|
|
30
|
-
"lint:
|
|
33
|
+
"lint:lint": "biome lint ./",
|
|
31
34
|
"lint:prettier": "prettier --write --ignore-path .gitignore './src/*.ts'",
|
|
32
35
|
"prebuild": "rimraf dist",
|
|
33
36
|
"build": "run-p build:*",
|
|
@@ -41,17 +44,15 @@
|
|
|
41
44
|
"tailwindcss": "^3.2.7"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
44
|
-
"@testing-library/jest-dom": "^6.4.
|
|
45
|
-
"@testing-library/react": "^
|
|
46
|
-
"@types/react": "^18.
|
|
47
|
-
"@types/react-dom": "^18.
|
|
48
|
-
"autoprefixer": "^10.4.
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"react-dom": "^18.2.0",
|
|
55
|
-
"tailwindcss": "^3.3.2"
|
|
47
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
48
|
+
"@testing-library/react": "^16.0.0",
|
|
49
|
+
"@types/react": "^18.3.3",
|
|
50
|
+
"@types/react-dom": "^18.3.0",
|
|
51
|
+
"autoprefixer": "^10.4.19",
|
|
52
|
+
"happy-dom": "^14.12.0",
|
|
53
|
+
"postcss": "^8.4.38",
|
|
54
|
+
"react": "^18.3.1",
|
|
55
|
+
"react-dom": "^18.3.1",
|
|
56
|
+
"tailwindcss": "^3.4.3"
|
|
56
57
|
}
|
|
57
58
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const Checkbox = React.forwardRef((props, ref) => {
|
|
6
|
-
const { className, children, ...restProps } = props;
|
|
7
|
-
const ctx = React.useContext(ControllerContext);
|
|
8
|
-
if (ctx.isRequired) {
|
|
9
|
-
restProps.required = true;
|
|
10
|
-
}
|
|
11
|
-
if (ctx.groupName) {
|
|
12
|
-
restProps.name = ctx.groupName;
|
|
13
|
-
}
|
|
14
|
-
const style = `
|
|
15
|
-
inline-block
|
|
16
|
-
text-base
|
|
17
|
-
cursor-pointer
|
|
18
|
-
py-2
|
|
19
|
-
mr-4
|
|
20
|
-
`;
|
|
21
|
-
const styleInput = `
|
|
22
|
-
peer
|
|
23
|
-
sr-only
|
|
24
|
-
`;
|
|
25
|
-
const styleCheck = `
|
|
26
|
-
bg-clip-content
|
|
27
|
-
w-6 h-6
|
|
28
|
-
ml-1
|
|
29
|
-
mr-2
|
|
30
|
-
rounded
|
|
31
|
-
border
|
|
32
|
-
border-solid
|
|
33
|
-
border-sumi-900
|
|
34
|
-
fill-transparent
|
|
35
|
-
peer-checked:fill-white-1000
|
|
36
|
-
peer-checked:bg-sea-600
|
|
37
|
-
peer-checked:border-none
|
|
38
|
-
peer-disabled:border-sumi-500
|
|
39
|
-
peer-focus-visible:ring-2
|
|
40
|
-
peer-focus-visible:ring-offset-2
|
|
41
|
-
peer-focus-visible:ring-wood-500
|
|
42
|
-
`;
|
|
43
|
-
return (_jsx("label", { htmlFor: restProps.id, className: cx(style, className), children: _jsxs("span", { className: "flex items-center", children: [_jsx("input", { className: styleInput, type: "checkbox", "aria-describedby": ctx.helperTextId, "aria-errormessage": ctx.errorMessageId, "aria-invalid": ctx.isInvalid ?? false, "aria-required": ctx.isRequired ?? false, ...restProps, ref: ref }), _jsx("span", { className: styleCheck, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", children: _jsx("path", { d: "m9.55 17.65-5.325-5.325 1.05-1.075 4.275 4.275 9.175-9.175 1.05 1.075Z" }) }) }), _jsx("span", { className: "peer-disabled:text-sumi-500", children: children })] }) }));
|
|
44
|
-
});
|
|
45
|
-
Checkbox.displayName = 'Checkbox';
|
|
46
|
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AAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,YAC5D,eAAM,CAAC,EAAC,wEAAwE,GAAG,GAC/E,GACD,EACP,eAAM,SAAS,EAAC,6BAA6B,YAAE,QAAQ,GAAQ,IAC1D,GACD,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,QAAQ,CAAC,WAAW,GAAG,UAAU,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const FieldsetControl = React.forwardRef((props, ref) => {
|
|
6
|
-
const id = React.useId();
|
|
7
|
-
const { labelText, className, helperText, errorMessage, isInvalid, isRequired, direction, children, ...restProps } = props;
|
|
8
|
-
const groupName = restProps.name ?? `group-${id}`;
|
|
9
|
-
const context = {
|
|
10
|
-
groupName: groupName,
|
|
11
|
-
helperTextId: `helper-text-${id}`,
|
|
12
|
-
errorMessageId: `error-message-${id}`,
|
|
13
|
-
isInvalid: isInvalid ?? false,
|
|
14
|
-
isRequired: isRequired ?? false
|
|
15
|
-
};
|
|
16
|
-
const styleDirection = direction ?? 'flex-col';
|
|
17
|
-
return (_jsx(ControllerContext.Provider, { value: context, children: _jsxs("fieldset", { className: cx('mb-4', className), ref: ref, ...restProps, children: [_jsx("legend", { children: _jsxs("p", { className: cx('block mb-2 text-label', isInvalid && 'text-sun-800'), children: [labelText, isRequired && _jsx("span", { className: "text-sun-800", children: "\u00A0*" })] }) }), _jsx("div", { className: cx('inline-flex', styleDirection), children: children }), helperText && (_jsx("p", { id: context.helperTextId, className: "text-sup text-sumi-700 mt-2", children: helperText })), isInvalid && (_jsx("p", { id: context.errorMessageId, className: cx('text-sup text-sun-800', helperText ? 'mt-1' : 'mt-2'), children: errorMessage }))] }) }));
|
|
18
|
-
});
|
|
19
|
-
FieldsetControl.displayName = 'FieldsetControl';
|
|
20
|
-
//# sourceMappingURL=FieldsetControl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldsetControl.js","sourceRoot":"","sources":["../../src/components/FieldsetControl.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAY7C,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAG7C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAA;IACxB,MAAM,EACJ,SAAS,EACT,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,SAAS,EACT,QAAQ,EACR,GAAG,SAAS,EACb,GAAG,KAAK,CAAA;IAET,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,IAAI,SAAS,EAAE,EAAE,CAAA;IAEjD,MAAM,OAAO,GAAG;QACd,SAAS,EAAE,SAAS;QACpB,YAAY,EAAE,eAAe,EAAE,EAAE;QACjC,cAAc,EAAE,iBAAiB,EAAE,EAAE;QACrC,SAAS,EAAE,SAAS,IAAI,KAAK;QAC7B,UAAU,EAAE,UAAU,IAAI,KAAK;KAChC,CAAA;IAED,MAAM,cAAc,GAAG,SAAS,IAAI,UAAU,CAAA;IAE9C,OAAO,CACL,KAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,YACxC,oBAAU,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,KAAM,SAAS,aACjE,2BACE,aACE,SAAS,EAAE,EAAE,CAAC,uBAAuB,EAAE,SAAS,IAAI,cAAc,CAAC,aAElE,SAAS,EACT,UAAU,IAAI,eAAM,SAAS,EAAC,cAAc,wBAAe,IAC1D,GACG,EACT,cAAK,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,cAAc,CAAC,YAAG,QAAQ,GAAO,EAClE,UAAU,IAAI,CACb,YAAG,EAAE,EAAE,OAAO,CAAC,YAAY,EAAE,SAAS,EAAC,6BAA6B,YACjE,UAAU,GACT,CACL,EACA,SAAS,IAAI,CACZ,YACE,EAAE,EAAE,OAAO,CAAC,cAAc,EAC1B,SAAS,EAAE,EAAE,CACX,uBAAuB,EACvB,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAC7B,YAEA,YAAY,GACX,CACL,IACQ,GACgB,CAC9B,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const FileInput = React.forwardRef((props, ref) => {
|
|
6
|
-
const { className, ...restProps } = props;
|
|
7
|
-
const ctx = React.useContext(ControllerContext);
|
|
8
|
-
if (ctx.isRequired) {
|
|
9
|
-
restProps.required = true;
|
|
10
|
-
}
|
|
11
|
-
const base = `
|
|
12
|
-
file:mr-2
|
|
13
|
-
file:inline-block
|
|
14
|
-
file:text-button
|
|
15
|
-
file:text-center
|
|
16
|
-
file:cursor-pointer
|
|
17
|
-
file:select-none
|
|
18
|
-
file:touch-manipulation
|
|
19
|
-
file:whitespace-nowrap
|
|
20
|
-
file:border
|
|
21
|
-
file:border-solid
|
|
22
|
-
file:border-sea-800
|
|
23
|
-
file:active:border-sea-1200
|
|
24
|
-
file:hover:border-sea-900
|
|
25
|
-
file:disabled:border-sumi-500
|
|
26
|
-
file:disabled:cursor-not-allowed
|
|
27
|
-
`;
|
|
28
|
-
const secondary = `
|
|
29
|
-
file:text-sea-800
|
|
30
|
-
file:bg-transparent
|
|
31
|
-
file:active:bg-sea-200
|
|
32
|
-
file:hover:bg-sea-100
|
|
33
|
-
file:active:text-sea-1200
|
|
34
|
-
file:hover:text-sea-900
|
|
35
|
-
file:disabled:text-sumi-500
|
|
36
|
-
file:disabled:bg-transparent
|
|
37
|
-
`;
|
|
38
|
-
const styleLg = `
|
|
39
|
-
file:p-4
|
|
40
|
-
file:text-button
|
|
41
|
-
file:rounded-lg
|
|
42
|
-
`;
|
|
43
|
-
const styleInput = `
|
|
44
|
-
rounded-lg
|
|
45
|
-
outline-offset-2
|
|
46
|
-
text-sumi-900
|
|
47
|
-
focus:outline
|
|
48
|
-
focus:outline-2
|
|
49
|
-
focus:outline-wood-600
|
|
50
|
-
aria-invalid:text-sun-800
|
|
51
|
-
`;
|
|
52
|
-
return (_jsx("input", { type: "file", id: restProps.id ?? ctx.id, className: cx(base, secondary, styleLg, styleInput, className), "aria-describedby": ctx.helperTextId, "aria-errormessage": ctx.errorMessageId, "aria-invalid": ctx.isInvalid ?? false, "aria-required": ctx.isRequired ?? false, ref: ref, ...restProps }));
|
|
53
|
-
});
|
|
54
|
-
FileInput.displayName = 'FileInput';
|
|
55
|
-
//# sourceMappingURL=FileInput.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FileInput.js","sourceRoot":"","sources":["../../src/components/FileInput.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAI7C,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CACvC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IACzC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC/C,IAAI,GAAG,CAAC,UAAU,EAAE;QAClB,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAA;KAC1B;IAED,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;KAgBZ,CAAA;IAED,MAAM,SAAS,GAAG;;;;;;;;;KASjB,CAAA;IACD,MAAM,OAAO,GAAG;;;;KAIf,CAAA;IACD,MAAM,UAAU,GAAG;;;;;;;;KAQlB,CAAA;IAED,OAAO,CACL,gBACE,IAAI,EAAC,MAAM,EACX,EAAE,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,EAC1B,SAAS,EAAE,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,CAAC,sBAC5C,GAAG,CAAC,YAAY,uBACf,GAAG,CAAC,cAAc,kBACvB,GAAG,CAAC,SAAS,IAAI,KAAK,mBACrB,GAAG,CAAC,UAAU,IAAI,KAAK,EACtC,GAAG,EAAE,GAAG,KACJ,SAAS,GACb,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAED,SAAS,CAAC,WAAW,GAAG,WAAW,CAAA"}
|
package/dist/components/Input.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const Input = React.forwardRef((props, ref) => {
|
|
6
|
-
const { className, ...restProps } = props;
|
|
7
|
-
const ctx = React.useContext(ControllerContext);
|
|
8
|
-
if (ctx.isRequired) {
|
|
9
|
-
restProps.required = true;
|
|
10
|
-
}
|
|
11
|
-
const style = `
|
|
12
|
-
p-4
|
|
13
|
-
rounded-lg
|
|
14
|
-
border
|
|
15
|
-
border-solid
|
|
16
|
-
border-sumi-900
|
|
17
|
-
outline-offset-2
|
|
18
|
-
focus:outline
|
|
19
|
-
focus:outline-2
|
|
20
|
-
focus:outline-wood-500
|
|
21
|
-
disabled:bg-transparent
|
|
22
|
-
disabled:text-sumi-500
|
|
23
|
-
disabled:border-sumi-500
|
|
24
|
-
aria-invalid:border-sun-800
|
|
25
|
-
`;
|
|
26
|
-
return (_jsx("input", { type: "text", id: restProps.id ?? ctx.id, className: cx(style, className), "aria-describedby": ctx.helperTextId, "aria-errormessage": ctx.errorMessageId, "aria-invalid": ctx.isInvalid ?? false, "aria-required": ctx.isRequired ?? false, ref: ref, ...restProps }));
|
|
27
|
-
});
|
|
28
|
-
Input.displayName = 'Input';
|
|
29
|
-
//# sourceMappingURL=Input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../src/components/Input.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAI7C,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CACnC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IACzC,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC/C,IAAI,GAAG,CAAC,UAAU,EAAE;QAClB,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAA;KAC1B;IAED,MAAM,KAAK,GAAG;;;;;;;;;;;;;;KAcb,CAAA;IAED,OAAO,CACL,gBACE,IAAI,EAAC,MAAM,EACX,EAAE,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,EAC1B,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,sBACb,GAAG,CAAC,YAAY,uBACf,GAAG,CAAC,cAAc,kBACvB,GAAG,CAAC,SAAS,IAAI,KAAK,mBACrB,GAAG,CAAC,UAAU,IAAI,KAAK,EACtC,GAAG,EAAE,GAAG,KACJ,SAAS,GACb,CACH,CAAA;AACH,CAAC,CACF,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const LabelControl = React.forwardRef((props, ref) => {
|
|
6
|
-
const id = React.useId();
|
|
7
|
-
const { labelText, className, helperText, errorMessage, isInvalid, isRequired, children, ...restProps } = props;
|
|
8
|
-
const context = {
|
|
9
|
-
id: props.htmlFor ?? `input-${id}`,
|
|
10
|
-
helperTextId: `helper-text-${id}`,
|
|
11
|
-
errorMessageId: `error-message-${id}`,
|
|
12
|
-
isInvalid: isInvalid ?? false,
|
|
13
|
-
isRequired: isRequired ?? false
|
|
14
|
-
};
|
|
15
|
-
const styleHelp = `
|
|
16
|
-
text-sup text-sumi-700
|
|
17
|
-
`;
|
|
18
|
-
const styleError = `
|
|
19
|
-
text-sup text-sun-800
|
|
20
|
-
`;
|
|
21
|
-
return (_jsx(ControllerContext.Provider, { value: context, children: _jsxs("div", { className: cx('mb-4', className), children: [_jsxs("label", { className: cx('block mb-2 text-label', isInvalid && 'text-sun-800'), htmlFor: context.id, ref: ref, ...restProps, children: [labelText, isRequired && (_jsx("span", { className: "text-label text-sun-800", children: "\u00A0*" }))] }), helperText && (_jsx("p", { id: context.helperTextId, className: cx(styleHelp, 'mb-2'), children: helperText })), children, isInvalid && (_jsx("p", { id: context.errorMessageId, className: cx(styleError, helperText ? 'mt-1' : 'mt-2'), children: errorMessage }))] }) }));
|
|
22
|
-
});
|
|
23
|
-
LabelControl.displayName = 'LabelControl';
|
|
24
|
-
//# sourceMappingURL=LabelControl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
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EAAE,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC,YAC1D,UAAU,GACT,CACL,EACA,QAAQ,EACR,SAAS,IAAI,CACZ,YACE,EAAE,EAAE,OAAO,CAAC,cAAc,EAC1B,SAAS,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAEtD,YAAY,GACX,CACL,IACG,GACqB,CAC9B,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAA"}
|
package/dist/components/Radio.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const Radio = React.forwardRef((props, ref) => {
|
|
6
|
-
const { className, children, ...newProps } = props;
|
|
7
|
-
const ctx = React.useContext(ControllerContext);
|
|
8
|
-
if (ctx.isRequired) {
|
|
9
|
-
newProps.required = true;
|
|
10
|
-
}
|
|
11
|
-
if (ctx.groupName) {
|
|
12
|
-
newProps.name = ctx.groupName;
|
|
13
|
-
}
|
|
14
|
-
const style = `
|
|
15
|
-
inline-block
|
|
16
|
-
text-base
|
|
17
|
-
cursor-pointer
|
|
18
|
-
py-2
|
|
19
|
-
mr-4
|
|
20
|
-
`;
|
|
21
|
-
const styleInput = `
|
|
22
|
-
peer
|
|
23
|
-
sr-only
|
|
24
|
-
`;
|
|
25
|
-
const styleRadio = `
|
|
26
|
-
bg-clip-content
|
|
27
|
-
w-6 h-6
|
|
28
|
-
ml-1
|
|
29
|
-
mr-2
|
|
30
|
-
p-1
|
|
31
|
-
rounded-full
|
|
32
|
-
border
|
|
33
|
-
border-solid
|
|
34
|
-
border-sumi-900
|
|
35
|
-
peer-checked:bg-sea-600
|
|
36
|
-
peer-checked:border-sea-600
|
|
37
|
-
peer-disabled:border-sumi-500
|
|
38
|
-
peer-focus-visible:ring-2
|
|
39
|
-
peer-focus-visible:ring-offset-2
|
|
40
|
-
peer-focus-visible:ring-wood-500
|
|
41
|
-
`;
|
|
42
|
-
return (_jsx("label", { htmlFor: newProps.id, className: cx(style, className), children: _jsxs("span", { className: "flex items-center", children: [_jsx("input", { className: styleInput, type: "radio", "aria-describedby": ctx.helperTextId, "aria-errormessage": ctx.errorMessageId, "aria-invalid": ctx.isInvalid ?? false, "aria-required": ctx.isRequired ?? false, ...newProps, ref: ref }), _jsx("span", { className: styleRadio }), _jsx("span", { className: "peer-disabled:text-sumi-500", children: children })] }) }));
|
|
43
|
-
});
|
|
44
|
-
Radio.displayName = 'Radio';
|
|
45
|
-
//# sourceMappingURL=Radio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Radio.js","sourceRoot":"","sources":["../../src/components/Radio.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAI7C,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,CACnC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,QAAQ,EAAE,GAAG,KAAK,CAAA;IAClD,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC/C,IAAI,GAAG,CAAC,UAAU,EAAE;QAClB,QAAQ,CAAC,QAAQ,GAAG,IAAI,CAAA;KACzB;IACD,IAAI,GAAG,CAAC,SAAS,EAAE;QACjB,QAAQ,CAAC,IAAI,GAAG,GAAG,CAAC,SAAS,CAAA;KAC9B;IAED,MAAM,KAAK,GAAG;;;;;;KAMb,CAAA;IAED,MAAM,UAAU,GAAG;;;KAGlB,CAAA;IAED,MAAM,UAAU,GAAG;;;;;;;;;;;;;;;;KAgBlB,CAAA;IAED,OAAO,CACL,gBAAO,OAAO,EAAE,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,SAAS,CAAC,YAC1D,gBAAM,SAAS,EAAC,mBAAmB,aACjC,gBACE,SAAS,EAAE,UAAU,EACrB,IAAI,EAAC,OAAO,sBACM,GAAG,CAAC,YAAY,uBACf,GAAG,CAAC,cAAc,kBACvB,GAAG,CAAC,SAAS,IAAI,KAAK,mBACrB,GAAG,CAAC,UAAU,IAAI,KAAK,KAClC,QAAQ,EACZ,GAAG,EAAE,GAAG,GACR,EACF,eAAM,SAAS,EAAE,UAAU,GAAS,EACpC,eAAM,SAAS,EAAC,6BAA6B,YAAE,QAAQ,GAAQ,IAC1D,GACD,CACT,CAAA;AACH,CAAC,CACF,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,OAAO,CAAA"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const Select = React.forwardRef((props, ref) => {
|
|
6
|
-
const { className, children, ...restProps } = props;
|
|
7
|
-
const ctx = React.useContext(ControllerContext);
|
|
8
|
-
if (ctx.isRequired) {
|
|
9
|
-
restProps.required = true;
|
|
10
|
-
}
|
|
11
|
-
const style = `
|
|
12
|
-
peer
|
|
13
|
-
cursor-pointer
|
|
14
|
-
appearance-none
|
|
15
|
-
text-base
|
|
16
|
-
w-full
|
|
17
|
-
bg-white-100
|
|
18
|
-
border
|
|
19
|
-
border-solid
|
|
20
|
-
border-sumi-900
|
|
21
|
-
py-4 px-4 pr-8
|
|
22
|
-
rounded-[8px]
|
|
23
|
-
outline-offset-2
|
|
24
|
-
focus:outline
|
|
25
|
-
focus:outline-2
|
|
26
|
-
focus:outline-wood-500
|
|
27
|
-
disabled:bg-transparent
|
|
28
|
-
disabled:text-sumi-500
|
|
29
|
-
disabled:border-sumi-500
|
|
30
|
-
aria-invalid:border-sun-800
|
|
31
|
-
`;
|
|
32
|
-
const styleArrow = `
|
|
33
|
-
flex items-center
|
|
34
|
-
absolute inset-y-0 right-0
|
|
35
|
-
px-2
|
|
36
|
-
pointer-events-none
|
|
37
|
-
peer-disabled:fill-sumi-500
|
|
38
|
-
`;
|
|
39
|
-
return (_jsxs("label", { className: "inline-block relative", children: [_jsx("select", { id: restProps.id ?? ctx.id, className: cx(style, props.className), "aria-describedby": ctx.helperTextId, "aria-errormessage": ctx.errorMessageId, "aria-invalid": ctx.isInvalid ?? false, "aria-required": ctx.isRequired ?? false, ...restProps, ref: ref, children: children }), _jsx("span", { className: styleArrow, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24", width: "24", children: _jsx("path", { d: "M12 15.05 6.35 9.4 7.4 8.35l4.6 4.6 4.6-4.6 1.05 1.05Z" }) }) })] }));
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../src/components/Select.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAI7C,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CACpC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IACnD,MAAM,GAAG,GAAG,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,CAAA;IAC/C,IAAI,GAAG,CAAC,UAAU,EAAE;QAClB,SAAS,CAAC,QAAQ,GAAG,IAAI,CAAA;KAC1B;IAED,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;KAoBb,CAAA;IAED,MAAM,UAAU,GAAG;;;;;;KAMlB,CAAA;IAED,OAAO,CACL,iBAAO,SAAS,EAAC,uBAAuB,aACtC,iBACE,EAAE,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,CAAC,EAAE,EAC1B,SAAS,EAAE,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,sBACnB,GAAG,CAAC,YAAY,uBACf,GAAG,CAAC,cAAc,kBACvB,GAAG,CAAC,SAAS,IAAI,KAAK,mBACrB,GAAG,CAAC,UAAU,IAAI,KAAK,KAClC,SAAS,EACb,GAAG,EAAE,GAAG,YAEP,QAAQ,GACF,EACT,eAAM,SAAS,EAAE,UAAU,YACzB,cAAK,KAAK,EAAC,4BAA4B,EAAC,MAAM,EAAC,IAAI,EAAC,KAAK,EAAC,IAAI,YAC5D,eAAM,CAAC,EAAC,wDAAwD,GAAG,GAC/D,GACD,IACD,CACT,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { cx } from '../utils/class';
|
|
4
|
-
import { ControllerContext } from './context';
|
|
5
|
-
export const Textarea = React.forwardRef((props, ref) => {
|
|
6
|
-
const { className, children, onChange, maxLength, ...restProps } = props;
|
|
7
|
-
const [count, setCount] = React.useState(0);
|
|
8
|
-
const onChangeHandler = (e) => {
|
|
9
|
-
if (onChange)
|
|
10
|
-
onChange(e);
|
|
11
|
-
setCount(e.target.value.length);
|
|
12
|
-
};
|
|
13
|
-
const ctx = React.useContext(ControllerContext);
|
|
14
|
-
if (ctx.isRequired) {
|
|
15
|
-
restProps.required = true;
|
|
16
|
-
}
|
|
17
|
-
const overtextStyle = count > (maxLength || 0) ? 'text-sun-800' : 'text-sumi-700';
|
|
18
|
-
const style = `
|
|
19
|
-
p-4
|
|
20
|
-
rounded-lg
|
|
21
|
-
border
|
|
22
|
-
border-solid
|
|
23
|
-
border-sumi-900
|
|
24
|
-
outline-offset-2
|
|
25
|
-
focus:outline
|
|
26
|
-
focus:outline-2
|
|
27
|
-
focus:outline-wood-500
|
|
28
|
-
disabled:bg-transparent
|
|
29
|
-
disabled:text-sumi-500
|
|
30
|
-
disabled:border-sumi-500
|
|
31
|
-
aria-invalid:border-sun-800
|
|
32
|
-
`;
|
|
33
|
-
return (_jsxs(_Fragment, { children: [_jsx("textarea", { id: restProps.id ?? ctx.id, className: cx(style, className), "aria-describedby": ctx.helperTextId, "aria-errormessage": ctx.errorMessageId, "aria-invalid": ctx.isInvalid ?? false, "aria-required": ctx.isRequired ?? false, onChange: onChangeHandler, ...restProps, ref: ref, children: children }), maxLength ? (_jsxs("p", { className: "text-sup text-sumi-700", children: [_jsx("span", { className: overtextStyle, children: count }), "/", _jsx("span", { children: maxLength })] })) : ('')] }));
|
|
34
|
-
});
|
|
35
|
-
Textarea.displayName = 'Textarea';
|
|
36
|
-
//# sourceMappingURL=Textarea.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.js","sourceRoot":"","sources":["../../src/components/Textarea.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAK7C,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,CAAC,UAAU,CACtC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACb,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,SAAS,EAAE,GAAG,KAAK,CAAA;IAExE,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,KAAK,CAAC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../src/components/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAWzB,MAAM,CAAC,MAAM,iBAAiB,GAAG,KAAK,CAAC,aAAa,CAAwB;IAC1E,YAAY,EAAE,EAAE;IAChB,cAAc,EAAE,EAAE;IAClB,SAAS,EAAE,KAAK;IAChB,UAAU,EAAE,KAAK;CAClB,CAAC,CAAA"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { Checkbox } from '../Checkbox';
|
|
4
|
-
import { FieldsetControl } from '../FieldsetControl';
|
|
5
|
-
export const CheckboxGroup = React.forwardRef((props, ref) => {
|
|
6
|
-
const { items, onChange, className, labelText, helperText, errorMessage, isInvalid, isRequired, ...restProps } = props;
|
|
7
|
-
return (_jsx(FieldsetControl, { className: className, labelText: labelText, helperText: helperText, errorMessage: errorMessage, isInvalid: isInvalid, isRequired: isRequired, ref: ref, ...restProps, children: items.map(({ label, value }, index) => {
|
|
8
|
-
return (_jsx(Checkbox, { value: value, onChange: onChange, children: label }, index));
|
|
9
|
-
}) }));
|
|
10
|
-
});
|
|
11
|
-
CheckboxGroup.displayName = 'CheckboxGroup';
|
|
12
|
-
//# sourceMappingURL=CheckboxGroup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CheckboxGroup.js","sourceRoot":"","sources":["../../../src/components/controlled/CheckboxGroup.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAcpD,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAG3C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,EACJ,KAAK,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,YAAY,EACZ,SAAS,EACT,UAAU,EACV,GAAG,SAAS,EACb,GAAG,KAAK,CAAA;IAET,OAAO,CACL,KAAC,eAAe,IACd,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,YAAY,EAC1B,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,UAAU,EACtB,GAAG,EAAE,GAAG,KACJ,SAAS,YAEZ,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE;YACrC,OAAO,CACL,KAAC,QAAQ,IAAa,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,YACnD,KAAK,IADO,KAAK,CAET,CACZ,CAAA;QACH,CAAC,CAAC,GACc,CACnB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"InputItem.js","sourceRoot":"","sources":["../../../src/components/controlled/InputItem.ts"],"names":[],"mappings":""}
|