visits-style 2.0.2 → 2.0.3
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 +9 -2
- package/dist/index.d.ts +62 -62
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -29,13 +29,20 @@ bun add -D tailwindcss
|
|
|
29
29
|
|
|
30
30
|
```css
|
|
31
31
|
@import "tailwindcss"
|
|
32
|
-
@import "visits-style/
|
|
32
|
+
@import "visits-style/lib.css";
|
|
33
|
+
@source "../node_modules/visits-style";
|
|
33
34
|
|
|
34
35
|
/** カスタムグロバールcss定義 */
|
|
35
36
|
```
|
|
36
37
|
```tsx
|
|
38
|
+
import { Button } from 'visits-style';
|
|
37
39
|
export default function TestComponent() {
|
|
38
|
-
return
|
|
40
|
+
return (
|
|
41
|
+
<div role="alert" className="bg-warn-fore px-2 py-1 flex justify-between items-center">
|
|
42
|
+
<p>Warning message!</p>
|
|
43
|
+
<Button variant="ghost">Dismiss</Button>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
39
46
|
}
|
|
40
47
|
```
|
|
41
48
|
|
package/dist/index.d.ts
CHANGED
|
@@ -17,9 +17,9 @@ import { RefObject } from 'react';
|
|
|
17
17
|
import { SVGAttributes } from 'react';
|
|
18
18
|
import { TextareaHTMLAttributes } from 'react';
|
|
19
19
|
|
|
20
|
-
export
|
|
20
|
+
export function Accordion({ header, show, children, timeout, ...rest }: AccordionProps): JSX.Element;
|
|
21
21
|
|
|
22
|
-
export
|
|
22
|
+
export interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
23
23
|
/**
|
|
24
24
|
* ボタンなどの表示するラベル\
|
|
25
25
|
* showを変更するロジックのイベントが必要となります
|
|
@@ -35,15 +35,15 @@ export declare interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
35
35
|
timeout?: number;
|
|
36
36
|
}
|
|
37
37
|
|
|
38
|
-
export
|
|
38
|
+
export function Button({ size, variant, className, ...rest }: ButtonProps): JSX.Element;
|
|
39
39
|
|
|
40
|
-
export
|
|
40
|
+
export function ButtonGroup({ className, ...rest }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
41
41
|
|
|
42
|
-
export
|
|
42
|
+
export type ButtonProps = InnerButtonProps & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
43
43
|
|
|
44
|
-
export
|
|
44
|
+
export function Checkbox({ checked, indeterminate, className, id, name, onChange, value, ...rest }: CheckboxProps): JSX.Element;
|
|
45
45
|
|
|
46
|
-
export
|
|
46
|
+
export interface CheckboxProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'onChange' | 'type' | 'role'> {
|
|
47
47
|
children?: ReactNode;
|
|
48
48
|
checked?: boolean;
|
|
49
49
|
indeterminate?: boolean;
|
|
@@ -54,9 +54,9 @@ export declare interface CheckboxProps extends Omit<ButtonHTMLAttributes<HTMLBut
|
|
|
54
54
|
|
|
55
55
|
export { clsx }
|
|
56
56
|
|
|
57
|
-
export
|
|
57
|
+
export function Dialog({ open, children, timeout, padding, verticalAlign, closeOnOverlay, closeOnEsc, onExited, className, onOpenChange, size, ...rest }: DialogProps): JSX.Element;
|
|
58
58
|
|
|
59
|
-
export
|
|
59
|
+
export interface DialogProps extends HTMLAttributes<HTMLDivElement> {
|
|
60
60
|
/** trueの場合、モーダルを表示します。 */
|
|
61
61
|
open?: boolean;
|
|
62
62
|
/** モーダルのbodyに入れる内容 */
|
|
@@ -94,16 +94,16 @@ export declare interface DialogProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
94
94
|
verticalAlign?: 'start' | 'center' | 'end';
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
export
|
|
97
|
+
export function Divider({ className, orientation, ...props }: DividerProps): JSX.Element;
|
|
98
98
|
|
|
99
|
-
export
|
|
99
|
+
export interface DividerProps extends HTMLAttributes<HTMLElement> {
|
|
100
100
|
/** @default 'horizontal' */
|
|
101
101
|
orientation?: 'horizontal' | 'vertical';
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
export
|
|
104
|
+
export function FormField({ label, children, required, htmlFor, error, help, helpBefore, className, innerClass, ...rest }: FormFieldProps): JSX.Element;
|
|
105
105
|
|
|
106
|
-
export
|
|
106
|
+
export interface FormFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
107
107
|
label?: string;
|
|
108
108
|
htmlFor?: string;
|
|
109
109
|
error?: string;
|
|
@@ -118,54 +118,54 @@ export declare interface FormFieldProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
118
118
|
required?: boolean;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
export
|
|
121
|
+
export function FormLabel({ className, ...rest }: LabelHTMLAttributes<HTMLLabelElement>): JSX.Element;
|
|
122
122
|
|
|
123
|
-
export
|
|
123
|
+
export function IconAlert(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
124
124
|
|
|
125
|
-
export
|
|
125
|
+
export function IconApproved(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
126
126
|
|
|
127
|
-
export
|
|
127
|
+
export function IconArrowDown(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
128
128
|
|
|
129
|
-
export
|
|
129
|
+
export function IconCaution(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
130
130
|
|
|
131
|
-
export
|
|
131
|
+
export function IconCheck(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
132
132
|
|
|
133
|
-
export
|
|
133
|
+
export function IconChevronRound(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
134
134
|
|
|
135
|
-
export
|
|
135
|
+
export function IconClose(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
136
136
|
|
|
137
|
-
export
|
|
137
|
+
export function IconFileRound(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
138
138
|
|
|
139
|
-
export
|
|
139
|
+
export function IconPencil(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
140
140
|
|
|
141
|
-
export
|
|
141
|
+
export function IconPlus(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
142
142
|
|
|
143
|
-
export
|
|
143
|
+
export function IconRefresh(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
144
144
|
|
|
145
|
-
export
|
|
145
|
+
export function IconUser(props: SVGAttributes<SVGSVGElement>): JSX.Element;
|
|
146
146
|
|
|
147
147
|
declare interface InnerButtonProps {
|
|
148
148
|
variant?: 'primary' | 'info' | 'warn' | 'link' | 'outline' | 'ghost' | 'danger';
|
|
149
149
|
size?: 'icon' | 'none';
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
export
|
|
152
|
+
export const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
153
153
|
|
|
154
|
-
export
|
|
154
|
+
export function InputField({ error, unstyled, className, ...rest }: InputFieldProps): JSX.Element;
|
|
155
155
|
|
|
156
|
-
export
|
|
156
|
+
export interface InputFieldProps extends HTMLAttributes<HTMLInputElement> {
|
|
157
157
|
error?: boolean;
|
|
158
158
|
/** 基本スタイルを全部外し、完全にclassNameの定義によせます */
|
|
159
159
|
unstyled?: boolean;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
-
export
|
|
162
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
163
163
|
error?: boolean;
|
|
164
164
|
/** 基本スタイルを全部外し、完全にclassNameの定義によせます */
|
|
165
165
|
unstyled?: boolean;
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
export
|
|
168
|
+
export function merge(a: string, b?: string): string;
|
|
169
169
|
|
|
170
170
|
declare interface OptionRenderConfig {
|
|
171
171
|
index: number;
|
|
@@ -178,11 +178,11 @@ declare type OptionType<T> = {
|
|
|
178
178
|
label: string;
|
|
179
179
|
} | string;
|
|
180
180
|
|
|
181
|
-
export
|
|
181
|
+
export function Placeholder({ className, ...props }: HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
182
182
|
|
|
183
|
-
export
|
|
183
|
+
export const Popover: ForwardRefExoticComponent<PopoverProps & RefAttributes<PopoverRef>>;
|
|
184
184
|
|
|
185
|
-
export
|
|
185
|
+
export interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
186
186
|
/** ボタンの内容 */
|
|
187
187
|
label: ReactElement;
|
|
188
188
|
/** 内容のリスト */
|
|
@@ -225,22 +225,22 @@ export declare interface PopoverProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
225
225
|
unstyled?: boolean;
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
-
export
|
|
228
|
+
export interface PopoverRef {
|
|
229
229
|
open: () => void;
|
|
230
230
|
close: () => void;
|
|
231
231
|
}
|
|
232
232
|
|
|
233
|
-
export
|
|
233
|
+
export function Portal({ children, container, disabled }: PortalProps): ReactPortal | null;
|
|
234
234
|
|
|
235
|
-
export
|
|
235
|
+
export interface PortalProps {
|
|
236
236
|
children: ReactNode;
|
|
237
237
|
container?: HTMLElement;
|
|
238
238
|
disabled?: boolean;
|
|
239
239
|
}
|
|
240
240
|
|
|
241
|
-
export
|
|
241
|
+
export function Progress({ value, max, className, ...rest }: ProgressProps): JSX.Element;
|
|
242
242
|
|
|
243
|
-
export
|
|
243
|
+
export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
244
244
|
/** 現状の進捗 */
|
|
245
245
|
value: number;
|
|
246
246
|
/**
|
|
@@ -263,9 +263,9 @@ declare type PublishArgs = ({
|
|
|
263
263
|
config: Partial<ToastConfig>;
|
|
264
264
|
});
|
|
265
265
|
|
|
266
|
-
export
|
|
266
|
+
export function Radio({ checked, className, id, name, onChange, value, ...rest }: RadioProps): JSX.Element;
|
|
267
267
|
|
|
268
|
-
export
|
|
268
|
+
export interface RadioProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'onChange' | 'type' | 'role'> {
|
|
269
269
|
children?: ReactNode;
|
|
270
270
|
checked?: boolean;
|
|
271
271
|
/** idが未指定の場合、nameが代わりに使われます */
|
|
@@ -273,9 +273,9 @@ export declare interface RadioProps extends Omit<ButtonHTMLAttributes<HTMLButton
|
|
|
273
273
|
onChange?: (checked: boolean) => void;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
export
|
|
276
|
+
export function Select<T = any>({ className, placeholder, options, error, unstyled, disabled, value, maxHeight, arrow, onChange, onClear, renderItem, ...rest }: SelectProps<T>): JSX.Element;
|
|
277
277
|
|
|
278
|
-
export
|
|
278
|
+
export interface SelectProps<T> extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onChange' | 'onClick' | 'type' | 'value' | 'children'> {
|
|
279
279
|
/** 配列の値の入力の場合、複数選択モードに切り替えます */
|
|
280
280
|
value: T | T[];
|
|
281
281
|
options: OptionType<T>[];
|
|
@@ -289,9 +289,9 @@ export declare interface SelectProps<T> extends Omit<ButtonHTMLAttributes<HTMLBu
|
|
|
289
289
|
unstyled?: boolean;
|
|
290
290
|
}
|
|
291
291
|
|
|
292
|
-
export
|
|
292
|
+
export function Sheet({ open, timeout, onOpenChange, position, overlay, ...rest }: SheetProps): JSX.Element;
|
|
293
293
|
|
|
294
|
-
export
|
|
294
|
+
export interface SheetProps extends HTMLAttributes<HTMLDivElement> {
|
|
295
295
|
/** trueの場合、モーダルを表示します。 */
|
|
296
296
|
open?: boolean;
|
|
297
297
|
/**
|
|
@@ -315,33 +315,33 @@ export declare interface SheetProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
315
315
|
unstyled?: boolean;
|
|
316
316
|
}
|
|
317
317
|
|
|
318
|
-
export
|
|
318
|
+
export interface SinnerProps extends HTMLAttributes<HTMLDivElement> {
|
|
319
319
|
/** サイズ */
|
|
320
320
|
size?: number;
|
|
321
321
|
label?: string;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
export
|
|
324
|
+
export function Spinner({ size, label, ...rest }: SinnerProps): JSX.Element;
|
|
325
325
|
|
|
326
|
-
export
|
|
326
|
+
export const Switch: ForwardRefExoticComponent<SwitchProps & RefAttributes<HTMLInputElement>>;
|
|
327
327
|
|
|
328
|
-
export
|
|
328
|
+
export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'onClick' | 'onChange' | 'type' | 'role'> {
|
|
329
329
|
checked?: boolean;
|
|
330
330
|
onChange?: (checked: boolean) => void;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
|
-
export
|
|
333
|
+
export const Textarea: ForwardRefExoticComponent<TextareaProps & RefAttributes<HTMLTextAreaElement>>;
|
|
334
334
|
|
|
335
|
-
export
|
|
335
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
336
336
|
error?: boolean;
|
|
337
337
|
unstyled?: boolean;
|
|
338
338
|
}
|
|
339
339
|
|
|
340
|
-
export
|
|
340
|
+
export function Toast({ className, margin, position, max, ListItem, }: ToasterProps): JSX.Element;
|
|
341
341
|
|
|
342
|
-
export
|
|
342
|
+
export const toast: ToastObserver;
|
|
343
343
|
|
|
344
|
-
export
|
|
344
|
+
export interface ToastConfig {
|
|
345
345
|
/** 認識ID */
|
|
346
346
|
id: string;
|
|
347
347
|
label: ReactNode;
|
|
@@ -356,9 +356,9 @@ export declare interface ToastConfig {
|
|
|
356
356
|
className?: string;
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
export
|
|
359
|
+
export type ToasterPosition = 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left';
|
|
360
360
|
|
|
361
|
-
export
|
|
361
|
+
export interface ToasterProps {
|
|
362
362
|
className?: string;
|
|
363
363
|
/** レンダリング対象のコンポーネント */
|
|
364
364
|
/**
|
|
@@ -386,9 +386,9 @@ export declare interface ToasterProps {
|
|
|
386
386
|
ListItem?: FunctionComponent<ToastItemProps>;
|
|
387
387
|
}
|
|
388
388
|
|
|
389
|
-
export
|
|
389
|
+
export function ToastItem({ type, label, message }: ToastItemProps): JSX.Element;
|
|
390
390
|
|
|
391
|
-
export
|
|
391
|
+
export type ToastItemProps = Omit<ToastConfig, 'duration' | 'className'>;
|
|
392
392
|
|
|
393
393
|
declare class ToastObserver {
|
|
394
394
|
/** システムで1つしか存在しない前提とする */
|
|
@@ -403,11 +403,11 @@ declare class ToastObserver {
|
|
|
403
403
|
clear: () => void;
|
|
404
404
|
}
|
|
405
405
|
|
|
406
|
-
export
|
|
406
|
+
export type ToastType = 'info' | 'success' | 'error' | 'warn' | 'loading';
|
|
407
407
|
|
|
408
|
-
export
|
|
408
|
+
export const Tooltip: ForwardRefExoticComponent<TooltipProps & RefAttributes<TooltipRef>>;
|
|
409
409
|
|
|
410
|
-
export
|
|
410
|
+
export interface TooltipProps {
|
|
411
411
|
/** 吹き出しとして表示したい内容 */
|
|
412
412
|
label: ReactNode;
|
|
413
413
|
/** マウスオーバーの対象になるelement */
|
|
@@ -437,7 +437,7 @@ export declare interface TooltipProps {
|
|
|
437
437
|
className?: string;
|
|
438
438
|
}
|
|
439
439
|
|
|
440
|
-
export
|
|
440
|
+
export interface TooltipRef {
|
|
441
441
|
floating: RefObject<HTMLElement | null>;
|
|
442
442
|
reference: RefObject<ReferenceElement | null>;
|
|
443
443
|
open: () => void;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "visits-style",
|
|
3
3
|
"repository": "https://github.com/visits-works/visits-style",
|
|
4
4
|
"homepage": "https://github.com/visits-works/visits-style",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.3",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./dist/index.cjs.js",
|
|
8
8
|
"module": "./dist/index.es.js",
|