@xmart/xorder-ui 0.3.0 → 0.4.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.
Files changed (40) hide show
  1. package/dist/components/alert/alert.css.d.ts +5 -0
  2. package/dist/components/alert/alert.d.ts +21 -0
  3. package/dist/components/alert/alert.test.d.ts +1 -0
  4. package/dist/components/alert/index.d.ts +2 -0
  5. package/dist/components/button/button.css.d.ts +1 -0
  6. package/dist/components/button/button.d.ts +2 -2
  7. package/dist/components/index.d.ts +4 -0
  8. package/dist/components/input/components/InputClearButton/InputClearButton.d.ts +1 -1
  9. package/dist/components/input/input.d.ts +2 -2
  10. package/dist/components/modal/components/modal-body/modal-body.css.d.ts +1 -0
  11. package/dist/components/modal/components/modal-body/modal-body.d.ts +10 -0
  12. package/dist/components/modal/components/modal-close/modal-close.css.d.ts +1 -0
  13. package/dist/components/modal/components/modal-close/modal-close.d.ts +9 -0
  14. package/dist/components/modal/components/modal-footer/modal-footer.css.d.ts +1 -0
  15. package/dist/components/modal/components/modal-footer/modal-footer.d.ts +10 -0
  16. package/dist/components/modal/components/modal-footer-actions/modal-footer-actions.css.d.ts +2 -0
  17. package/dist/components/modal/components/modal-footer-actions/modal-footer-actions.d.ts +25 -0
  18. package/dist/components/modal/components/modal-header/modal-header.css.d.ts +1 -0
  19. package/dist/components/modal/components/modal-header/modal-header.d.ts +10 -0
  20. package/dist/components/modal/components/modal-title/modal-title.css.d.ts +1 -0
  21. package/dist/components/modal/components/modal-title/modal-title.d.ts +9 -0
  22. package/dist/components/modal/index.d.ts +2 -0
  23. package/dist/components/modal/modal.css.d.ts +2 -0
  24. package/dist/components/modal/modal.d.ts +65 -0
  25. package/dist/components/modal/modal.test.d.ts +1 -0
  26. package/dist/components/select-box/select-box.d.ts +1 -1
  27. package/dist/components/tag/tag.d.ts +1 -1
  28. package/dist/components/text/index.d.ts +2 -0
  29. package/dist/components/text/text.css.d.ts +1 -0
  30. package/dist/components/text/text.d.ts +30 -0
  31. package/dist/components/text/text.test.d.ts +1 -0
  32. package/dist/components/textarea/index.d.ts +1 -0
  33. package/dist/components/textarea/textarea.css.d.ts +1 -0
  34. package/dist/components/textarea/textarea.d.ts +29 -0
  35. package/dist/components/textarea/textarea.test.d.ts +1 -0
  36. package/dist/index.d.ts +1 -1
  37. package/dist/index.esm.js +5048 -1471
  38. package/dist/vite.config.d.ts +2 -0
  39. package/dist/xorder-ui.css +1 -1
  40. package/package.json +10 -8
@@ -0,0 +1,5 @@
1
+ export declare const root: string;
2
+ export declare const header: string;
3
+ export declare const icon: string;
4
+ export declare const title: string;
5
+ export declare const body: string;
@@ -0,0 +1,21 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ type AlertVariant = 'danger' | 'info' | 'warning';
3
+ type AlertOwnProps = {
4
+ /**
5
+ * アラートのバリアント
6
+ * @default 'info'
7
+ */
8
+ variant?: AlertVariant;
9
+ /**
10
+ * アラートのタイトル
11
+ * 指定した場合、バリアントに応じたアイコンとともに表示されます
12
+ */
13
+ title?: ReactNode;
14
+ };
15
+ type AlertProps = Omit<ComponentPropsWithRef<'div'>, keyof AlertOwnProps> & AlertOwnProps;
16
+ declare const Alert: {
17
+ (props: AlertProps): import("react").JSX.Element;
18
+ displayName: string;
19
+ };
20
+ export { Alert };
21
+ export type { AlertProps, AlertVariant };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export { Alert } from './alert';
2
+ export type { AlertProps, AlertVariant } from './alert';
@@ -1,5 +1,6 @@
1
1
  export declare const root: string;
2
2
  export declare const outlined: string;
3
3
  export declare const white: string;
4
+ export declare const soft: string;
4
5
  export declare const loading: string;
5
6
  export declare const section: string;
@@ -6,7 +6,7 @@ type ButtonOwnProps = {
6
6
  asChild?: boolean;
7
7
  /**
8
8
  * ボタンテキストのフォントウェイトを制御します
9
- * @default filledoutlinedバリアントでは'bold'、whiteバリアントでは'normal'
9
+ * @default filledoutlined、softバリアントでは'bold'、whiteバリアントでは'normal'
10
10
  */
11
11
  bold?: 'bold' | 'normal';
12
12
  /**
@@ -34,7 +34,7 @@ type ButtonOwnProps = {
34
34
  * ボタンの視覚的なスタイルを制御します
35
35
  * @default 'filled'
36
36
  */
37
- variant?: 'filled' | 'outlined' | 'white';
37
+ variant?: 'filled' | 'outlined' | 'white' | 'soft';
38
38
  };
39
39
  interface ButtonProps extends ComponentPropsWithRef<'button'>, ButtonOwnProps {
40
40
  }
@@ -1,8 +1,12 @@
1
+ export { Alert, type AlertProps, type AlertVariant } from './alert';
1
2
  export { Button, type ButtonProps } from './button';
2
3
  export { IconButton, type IconButtonProps } from './icon-button';
3
4
  export { Input, type InputProps } from './input';
5
+ export { Modal, type ModalBodyProps, type ModalCloseProps, type ModalFooterActionsActionWidth, type ModalFooterActionsAlign, type ModalFooterActionsProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalTitleProps, } from './modal';
4
6
  export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, RadioGroupRoot, type RadioGroupRootProps, } from './radio-group';
5
7
  export { SelectBox, type SelectBoxOption, type SelectBoxProps } from './select-box';
6
8
  export { Spinner, type SpinnerProps } from './spinner';
7
9
  export { Switch, type SwitchProps } from './switch';
8
10
  export { Tag, type TagProps } from './tag';
11
+ export { Textarea, type TextareaProps } from './textarea';
12
+ export { Text, type TextFontSize, type TextFontWeight, type TextForeground, type TextProps, } from './text';
@@ -1,7 +1,7 @@
1
1
  import { ComponentPropsWithRef } from 'react';
2
2
  type InputClearButtonProps = ComponentPropsWithRef<'button'>;
3
3
  declare const InputClearButton: {
4
- ({ className, ...props }: InputClearButtonProps): import("react/jsx-runtime").JSX.Element;
4
+ ({ className, ...props }: InputClearButtonProps): import("react").JSX.Element;
5
5
  displayName: string;
6
6
  };
7
7
  export { InputClearButton };
@@ -26,10 +26,10 @@ type InputOwnProps = {
26
26
  interface InputProps extends Omit<ComponentPropsWithRef<'input'>, 'size'>, InputOwnProps {
27
27
  }
28
28
  declare const Input: {
29
- ({ clearable, className: classNameProp, disabled, error, leftSection, placeholder, rightSection, value: valueProp, defaultValue, onChange: onChangeProp, ref, ...other }: InputProps): import("react/jsx-runtime").JSX.Element;
29
+ ({ clearable, className: classNameProp, disabled, error, leftSection, placeholder, rightSection, value: valueProp, defaultValue, onChange: onChangeProp, ref, ...other }: InputProps): import("react").JSX.Element;
30
30
  displayName: string;
31
31
  ClearButton: {
32
- ({ className, ...props }: import('./components/InputClearButton/InputClearButton').InputClearButtonProps): import("react/jsx-runtime").JSX.Element;
32
+ ({ className, ...props }: import('./components/InputClearButton/InputClearButton').InputClearButtonProps): import("react").JSX.Element;
33
33
  displayName: string;
34
34
  };
35
35
  };
@@ -0,0 +1 @@
1
+ export declare const body: string;
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ type ModalBodyOwnProps = {
3
+ children: ReactNode;
4
+ };
5
+ type ModalBodyProps = Omit<ComponentPropsWithRef<'div'>, keyof ModalBodyOwnProps> & ModalBodyOwnProps;
6
+ export declare const ModalBody: {
7
+ (props: ModalBodyProps): import("react").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export type { ModalBodyProps };
@@ -0,0 +1 @@
1
+ export declare const closeButton: string;
@@ -0,0 +1,9 @@
1
+ import { ComponentPropsWithRef, ComponentRef } from 'react';
2
+ import * as Dialog from '@radix-ui/react-dialog';
3
+ type ModalCloseElement = ComponentRef<typeof Dialog.Close>;
4
+ type ModalCloseProps = ComponentPropsWithRef<typeof Dialog.Close>;
5
+ export declare const ModalClose: {
6
+ (props: ModalCloseProps): import("react").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export type { ModalCloseElement, ModalCloseProps };
@@ -0,0 +1 @@
1
+ export declare const footer: string;
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ type ModalFooterOwnProps = {
3
+ children: ReactNode;
4
+ };
5
+ type ModalFooterProps = Omit<ComponentPropsWithRef<'div'>, keyof ModalFooterOwnProps> & ModalFooterOwnProps;
6
+ export declare const ModalFooter: {
7
+ (props: ModalFooterProps): import("react").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export type { ModalFooterProps };
@@ -0,0 +1,2 @@
1
+ export declare const actionWidth: `var(--${string})`;
2
+ export declare const actions: string;
@@ -0,0 +1,25 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ type ModalFooterActionsAlign = 'left' | 'center' | 'right';
3
+ type ModalFooterActionsActionWidth = 'auto' | 'fill' | `${number}%` | `${number}px` | `${number}rem` | `${number}em`;
4
+ type ModalFooterActionsOwnProps = {
5
+ children: ReactNode;
6
+ /**
7
+ * アクション群の寄せ方向
8
+ * @default 'right'
9
+ */
10
+ align?: ModalFooterActionsAlign;
11
+ /**
12
+ * 各アクションの幅
13
+ * - auto: 子要素本来の幅
14
+ * - fill: 子要素を等幅で広げる
15
+ * - 30% / 240px など: 明示した幅
16
+ * @default 'auto'
17
+ */
18
+ actionWidth?: ModalFooterActionsActionWidth;
19
+ };
20
+ type ModalFooterActionsProps = Omit<ComponentPropsWithRef<'div'>, keyof ModalFooterActionsOwnProps> & ModalFooterActionsOwnProps;
21
+ export declare const ModalFooterActions: {
22
+ (props: ModalFooterActionsProps): import("react").JSX.Element;
23
+ displayName: string;
24
+ };
25
+ export type { ModalFooterActionsActionWidth, ModalFooterActionsAlign, ModalFooterActionsProps };
@@ -0,0 +1 @@
1
+ export declare const header: string;
@@ -0,0 +1,10 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ type ModalHeaderOwnProps = {
3
+ children: ReactNode;
4
+ };
5
+ type ModalHeaderProps = Omit<ComponentPropsWithRef<'div'>, keyof ModalHeaderOwnProps> & ModalHeaderOwnProps;
6
+ export declare const ModalHeader: {
7
+ (props: ModalHeaderProps): import("react").JSX.Element;
8
+ displayName: string;
9
+ };
10
+ export type { ModalHeaderProps };
@@ -0,0 +1 @@
1
+ export declare const title: string;
@@ -0,0 +1,9 @@
1
+ import { ComponentPropsWithRef, ComponentRef } from 'react';
2
+ import * as Dialog from '@radix-ui/react-dialog';
3
+ type ModalTitleElement = ComponentRef<typeof Dialog.Title>;
4
+ type ModalTitleProps = ComponentPropsWithRef<typeof Dialog.Title>;
5
+ export declare const ModalTitle: {
6
+ (props: ModalTitleProps): import("react").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export type { ModalTitleElement, ModalTitleProps };
@@ -0,0 +1,2 @@
1
+ export type { ModalBodyProps, ModalCloseProps, ModalFooterActionsActionWidth, ModalFooterActionsAlign, ModalFooterActionsProps, ModalFooterProps, ModalHeaderProps, ModalProps, ModalTitleProps, } from './modal';
2
+ export { Modal } from './modal';
@@ -0,0 +1,2 @@
1
+ export declare const overlay: string;
2
+ export declare const content: string;
@@ -0,0 +1,65 @@
1
+ import { ComponentPropsWithRef, ComponentRef, RefObject } from 'react';
2
+ import * as Dialog from '@radix-ui/react-dialog';
3
+ type ModalRootElement = ComponentRef<typeof Dialog.Content>;
4
+ type ModalRootProps = ComponentPropsWithRef<typeof Dialog.Content> & {
5
+ /**
6
+ * モーダルの開閉状態を制御します
7
+ */
8
+ open: boolean;
9
+ /**
10
+ * モーダルが閉じられるときに呼び出されるコールバック関数
11
+ */
12
+ onClose: () => void;
13
+ /**
14
+ * モーダルの開閉状態が変更されたときに呼び出されるコールバック関数
15
+ */
16
+ onOpenChange?: (open: boolean) => void;
17
+ /**
18
+ * モーダルのサイズ
19
+ * @default 'md'
20
+ */
21
+ size?: 'sm' | 'md' | 'lg';
22
+ /**
23
+ * 初期フォーカスを受け取る要素への参照(オプション)
24
+ * 指定されない場合は Dialog.Content 自体がフォーカスを受け取ります
25
+ * (Radix デフォルトでは最初のフォーカス可能要素 = Modal.Close ボタンに当たり、
26
+ * 操作意図に対して不自然なため Content にフォーカスを向け直しています)
27
+ */
28
+ initialFocusRef?: RefObject<HTMLElement | null>;
29
+ };
30
+ export declare const Modal: {
31
+ (props: ModalRootProps): import("react").JSX.Element;
32
+ displayName: string;
33
+ } & {
34
+ Header: {
35
+ (props: import('./modal').ModalHeaderProps): import("react").JSX.Element;
36
+ displayName: string;
37
+ };
38
+ Title: {
39
+ (props: import('./modal').ModalTitleProps): import("react").JSX.Element;
40
+ displayName: string;
41
+ };
42
+ Close: {
43
+ (props: import('./modal').ModalCloseProps): import("react").JSX.Element;
44
+ displayName: string;
45
+ };
46
+ Body: {
47
+ (props: import('./modal').ModalBodyProps): import("react").JSX.Element;
48
+ displayName: string;
49
+ };
50
+ Footer: {
51
+ (props: import('./modal').ModalFooterProps): import("react").JSX.Element;
52
+ displayName: string;
53
+ };
54
+ FooterActions: {
55
+ (props: import('./modal').ModalFooterActionsProps): import("react").JSX.Element;
56
+ displayName: string;
57
+ };
58
+ };
59
+ export type { ModalRootProps as ModalProps, ModalRootElement };
60
+ export type { ModalBodyProps } from './components/modal-body/modal-body';
61
+ export type { ModalCloseProps } from './components/modal-close/modal-close';
62
+ export type { ModalFooterActionsActionWidth, ModalFooterActionsAlign, ModalFooterActionsProps, } from './components/modal-footer-actions/modal-footer-actions';
63
+ export type { ModalFooterProps } from './components/modal-footer/modal-footer';
64
+ export type { ModalHeaderProps } from './components/modal-header/modal-header';
65
+ export type { ModalTitleProps } from './components/modal-title/modal-title';
@@ -0,0 +1 @@
1
+ export {};
@@ -46,7 +46,7 @@ type SelectBoxOwnProps = {
46
46
  };
47
47
  type SelectBoxProps = Omit<ComponentPropsWithRef<typeof Select.Root>, keyof SelectBoxOwnProps> & SelectBoxOwnProps;
48
48
  declare const SelectBox: {
49
- ({ className: classNameProp, disabled, error, placeholder, options, value, defaultValue, onValueChange, ariaLabel, ariaLabelledby, ...other }: SelectBoxProps): import("react/jsx-runtime").JSX.Element;
49
+ ({ className: classNameProp, disabled, error, placeholder, options, value, defaultValue, onValueChange, ariaLabel, ariaLabelledby, ...other }: SelectBoxProps): import("react").JSX.Element;
50
50
  displayName: string;
51
51
  };
52
52
  export { SelectBox };
@@ -18,7 +18,7 @@ type TagOwnProps = {
18
18
  };
19
19
  type TagProps = ComponentPropsWithRef<'span'> & TagOwnProps;
20
20
  declare const Tag: {
21
- (props: TagProps): import("react/jsx-runtime").JSX.Element;
21
+ (props: TagProps): import("react").JSX.Element;
22
22
  displayName: string;
23
23
  };
24
24
  export { Tag };
@@ -0,0 +1,2 @@
1
+ export { Text } from './text';
2
+ export type { TextFontSize, TextFontWeight, TextForeground, TextProps } from './text';
@@ -0,0 +1 @@
1
+ export declare const root: string;
@@ -0,0 +1,30 @@
1
+ import { useRender } from '@base-ui/react/use-render';
2
+ import { xmVars } from '@xmart/xorder-ui-tokens';
3
+ type TextFontSize = keyof typeof xmVars.fontSize;
4
+ type TextForeground = keyof typeof xmVars.color.foreground;
5
+ type TextFontWeight = keyof typeof xmVars.fontWeight;
6
+ type TextOwnProps = {
7
+ /**
8
+ * テキストの色を制御します(`xmVars.color.foreground.*` に対応)
9
+ * @default 'default'
10
+ */
11
+ color?: TextForeground;
12
+ /**
13
+ * テキストのサイズを制御します(`xmVars.fontSize.*` に対応)
14
+ * px や rem などの任意サイズは `style` または `className` で指定してください
15
+ * @default 'md'
16
+ */
17
+ size?: TextFontSize;
18
+ /**
19
+ * テキストのフォントウェイトを制御します(`xmVars.fontWeight.*` に対応)
20
+ * @default 'regular'
21
+ */
22
+ weight?: TextFontWeight;
23
+ };
24
+ type TextProps = Omit<useRender.ComponentProps<'p'>, keyof TextOwnProps> & TextOwnProps;
25
+ declare const Text: {
26
+ (props: TextProps): import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>>;
27
+ displayName: string;
28
+ };
29
+ export { Text };
30
+ export type { TextFontSize, TextFontWeight, TextForeground, TextProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { Textarea, type TextareaProps } from './textarea';
@@ -0,0 +1 @@
1
+ export declare const textarea: string;
@@ -0,0 +1,29 @@
1
+ import { ComponentPropsWithRef, CSSProperties } from 'react';
2
+ type TextareaOwnProps = {
3
+ /**
4
+ * エラー状態を表示するかどうか
5
+ * @default false
6
+ */
7
+ error?: boolean;
8
+ /**
9
+ * プレースホルダーテキスト
10
+ */
11
+ placeholder?: string;
12
+ /**
13
+ * resize CSS プロパティ
14
+ * @default 'none'
15
+ */
16
+ resize?: CSSProperties['resize'];
17
+ /**
18
+ * 表示行数(初期の高さ)
19
+ * @default 3
20
+ */
21
+ rows?: number;
22
+ };
23
+ type TextareaProps = Omit<ComponentPropsWithRef<'textarea'>, 'size' | keyof TextareaOwnProps> & TextareaOwnProps;
24
+ declare const Textarea: {
25
+ ({ className: classNameProp, disabled, error, placeholder, resize, rows, style, value: valueProp, defaultValue, onChange: onChangeProp, ref, ...other }: TextareaProps): import("react").JSX.Element;
26
+ displayName: string;
27
+ };
28
+ export { Textarea };
29
+ export type { TextareaProps };
@@ -0,0 +1 @@
1
+ export {};
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export { Button, type ButtonProps, IconButton, type IconButtonProps, Input, type InputProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, RadioGroupRoot, type RadioGroupRootProps, Spinner, type SpinnerProps, Switch, type SwitchProps, } from './components';
1
+ export { Alert, type AlertProps, type AlertVariant, Button, type ButtonProps, IconButton, type IconButtonProps, Input, type InputProps, Modal, type ModalBodyProps, type ModalCloseProps, type ModalFooterActionsActionWidth, type ModalFooterActionsAlign, type ModalFooterActionsProps, type ModalFooterProps, type ModalHeaderProps, type ModalProps, type ModalTitleProps, RadioGroup, RadioGroupItem, type RadioGroupItemProps, RadioGroupRoot, type RadioGroupRootProps, SelectBox, type SelectBoxOption, type SelectBoxProps, Spinner, type SpinnerProps, Switch, type SwitchProps, Tag, type TagProps, Textarea, type TextareaProps, Text, type TextFontSize, type TextFontWeight, type TextForeground, type TextProps, } from './components';
2
2
  export { primitive, semantic } from './styles/tokens';