@xmart/xorder-ui 0.0.21

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 (48) hide show
  1. package/dist/components/button/button.css.d.ts +5 -0
  2. package/dist/components/button/button.d.ts +43 -0
  3. package/dist/components/button/button.test.d.ts +1 -0
  4. package/dist/components/button/index.d.ts +1 -0
  5. package/dist/components/icon-button/icon-button.css.d.ts +5 -0
  6. package/dist/components/icon-button/icon-button.d.ts +20 -0
  7. package/dist/components/icon-button/icon-button.test.d.ts +1 -0
  8. package/dist/components/icon-button/index.d.ts +1 -0
  9. package/dist/components/index.d.ts +8 -0
  10. package/dist/components/input/components/InputClearButton/InputClearButton.css.d.ts +1 -0
  11. package/dist/components/input/components/InputClearButton/InputClearButton.d.ts +8 -0
  12. package/dist/components/input/index.d.ts +1 -0
  13. package/dist/components/input/input.css.d.ts +4 -0
  14. package/dist/components/input/input.d.ts +37 -0
  15. package/dist/components/input/input.test.d.ts +1 -0
  16. package/dist/components/radio-group/index.d.ts +1 -0
  17. package/dist/components/radio-group/radio-group.css.d.ts +6 -0
  18. package/dist/components/radio-group/radio-group.d.ts +34 -0
  19. package/dist/components/radio-group/radio-group.test.d.ts +1 -0
  20. package/dist/components/select-box/index.d.ts +1 -0
  21. package/dist/components/select-box/select-box.css.d.ts +6 -0
  22. package/dist/components/select-box/select-box.d.ts +53 -0
  23. package/dist/components/select-box/select-box.test.d.ts +1 -0
  24. package/dist/components/spinner/index.d.ts +1 -0
  25. package/dist/components/spinner/spinner.css.d.ts +3 -0
  26. package/dist/components/spinner/spinner.d.ts +9 -0
  27. package/dist/components/spinner/spinner.test.d.ts +1 -0
  28. package/dist/components/switch/index.d.ts +1 -0
  29. package/dist/components/switch/switch.css.d.ts +4 -0
  30. package/dist/components/switch/switch.d.ts +33 -0
  31. package/dist/components/switch/switch.test.d.ts +1 -0
  32. package/dist/components/tag/index.d.ts +1 -0
  33. package/dist/components/tag/tag.css.d.ts +8 -0
  34. package/dist/components/tag/tag.d.ts +25 -0
  35. package/dist/components/tag/tag.test.d.ts +1 -0
  36. package/dist/hooks/index.d.ts +1 -0
  37. package/dist/hooks/use-uncontrolled/use-uncontrolled.d.ts +19 -0
  38. package/dist/hooks/use-uncontrolled/use-uncontrolled.test.d.ts +1 -0
  39. package/dist/index.cjs.js +43 -0
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.esm.js +3081 -0
  42. package/dist/styles/index.css.d.ts +1 -0
  43. package/dist/styles/tokens/index.d.ts +2 -0
  44. package/dist/styles/tokens/primitive.css.d.ts +201 -0
  45. package/dist/styles/tokens/semantic.css.d.ts +64 -0
  46. package/dist/utils.d.ts +25 -0
  47. package/dist/xorder-ui.css +1 -0
  48. package/package.json +49 -0
@@ -0,0 +1,5 @@
1
+ export declare const root: string;
2
+ export declare const outlined: string;
3
+ export declare const white: string;
4
+ export declare const loading: string;
5
+ export declare const section: string;
@@ -0,0 +1,43 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ type ButtonOwnProps = {
3
+ /**
4
+ * trueの場合、ボタンのレンダリングを子要素に委譲します
5
+ */
6
+ asChild?: boolean;
7
+ /**
8
+ * ボタンテキストのフォントウェイトを制御します
9
+ * @default filledとoutlinedバリアントでは'bold'、whiteバリアントでは'normal'
10
+ */
11
+ bold?: 'bold' | 'normal';
12
+ /**
13
+ * ボタンの幅を親要素の幅に合わせて100%にします
14
+ */
15
+ fullWidth?: boolean;
16
+ /**
17
+ * ボタンの左側に表示するコンテンツ(アイコンなど)
18
+ */
19
+ leftSection?: ReactNode;
20
+ /**
21
+ * trueの場合、ローディングスピナーを表示し、操作を防止します
22
+ */
23
+ loading?: boolean;
24
+ /**
25
+ * ボタンの右側に表示するコンテンツ(アイコンなど)
26
+ */
27
+ rightSection?: ReactNode;
28
+ /**
29
+ * ボタンのサイズを制御します
30
+ * @default 'md'
31
+ */
32
+ size?: 'sm' | 'md' | 'lg';
33
+ /**
34
+ * ボタンの視覚的なスタイルを制御します
35
+ * @default 'filled'
36
+ */
37
+ variant?: 'filled' | 'outlined' | 'white';
38
+ };
39
+ interface ButtonProps extends ComponentPropsWithRef<'button'>, ButtonOwnProps {
40
+ }
41
+ declare const Button: import('react').ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
42
+ export { Button };
43
+ export type { ButtonProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { Button, type ButtonProps } from './button';
@@ -0,0 +1,5 @@
1
+ declare const defaultColorTheme: string;
2
+ export declare const root: string;
3
+ export declare const variants: Record<"filled" | "outlined" | "borderless", string>;
4
+ export declare const loading: string;
5
+ export { defaultColorTheme };
@@ -0,0 +1,20 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ type ButtonOwnProps = {
3
+ /**
4
+ * trueの場合、ボタンのレンダリングを子要素に委譲します
5
+ */
6
+ asChild?: boolean;
7
+ /**
8
+ * trueの場合、ローディングスピナーを表示し、操作を防止します
9
+ */
10
+ loading?: boolean;
11
+ /**
12
+ * ボタンの視覚的なスタイルを制御します
13
+ * @default 'borderless'
14
+ */
15
+ variant?: 'borderless' | 'outlined' | 'filled';
16
+ };
17
+ type IconButtonProps = Omit<ComponentPropsWithoutRef<'button'>, keyof ButtonOwnProps> & ButtonOwnProps;
18
+ declare const IconButton: import('react').ForwardRefExoticComponent<Omit<Omit<import('react').DetailedHTMLProps<import('react').ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, keyof ButtonOwnProps> & ButtonOwnProps & import('react').RefAttributes<HTMLButtonElement>>;
19
+ export { IconButton };
20
+ export type { IconButtonProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { IconButton, type IconButtonProps } from './icon-button';
@@ -0,0 +1,8 @@
1
+ export { Button, type ButtonProps } from './button';
2
+ export { IconButton, type IconButtonProps } from './icon-button';
3
+ export { Input, type InputProps } from './input';
4
+ export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, RadioGroupRoot, type RadioGroupRootProps } from './radio-group';
5
+ export { SelectBox, type SelectBoxOption, type SelectBoxProps } from './select-box';
6
+ export { Spinner, type SpinnerProps } from './spinner';
7
+ export { Switch, type SwitchProps } from './switch';
8
+ export { Tag, type TagProps } from './tag';
@@ -0,0 +1 @@
1
+ export declare const root: string;
@@ -0,0 +1,8 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ type InputClearButtonProps = ComponentPropsWithRef<'button'>;
3
+ declare const InputClearButton: {
4
+ ({ className, ...props }: InputClearButtonProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export { InputClearButton };
8
+ export type { InputClearButtonProps };
@@ -0,0 +1 @@
1
+ export { Input, type InputProps } from './input';
@@ -0,0 +1,4 @@
1
+ export declare const root: string;
2
+ export declare const input: string;
3
+ export declare const leftSection: string;
4
+ export declare const rightSection: string;
@@ -0,0 +1,37 @@
1
+ import { ComponentPropsWithRef, ReactNode } from 'react';
2
+ type InputOwnProps = {
3
+ /**
4
+ * クリアボタンを表示するかどうか
5
+ * @default false
6
+ */
7
+ clearable?: boolean;
8
+ /**
9
+ * エラー状態を表示するかどうか
10
+ * @default false
11
+ */
12
+ error?: boolean;
13
+ /**
14
+ * プレースホルダーテキスト
15
+ */
16
+ placeholder?: string;
17
+ /**
18
+ * 入力フィールドの左側に表示するコンテンツ(主にアイコン)
19
+ */
20
+ leftSection?: ReactNode;
21
+ /**
22
+ * 入力フィールドの右側に表示するコンテンツ(主にアイコン)
23
+ */
24
+ rightSection?: ReactNode;
25
+ };
26
+ interface InputProps extends Omit<ComponentPropsWithRef<'input'>, 'size'>, InputOwnProps {
27
+ }
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;
30
+ displayName: string;
31
+ ClearButton: {
32
+ ({ className, ...props }: import('./components/InputClearButton/InputClearButton').InputClearButtonProps): import("react/jsx-runtime").JSX.Element;
33
+ displayName: string;
34
+ };
35
+ };
36
+ export { Input };
37
+ export type { InputProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { RadioGroup, RadioGroupItem, type RadioGroupItemProps, RadioGroupRoot, type RadioGroupRootProps, } from './radio-group';
@@ -0,0 +1,6 @@
1
+ export declare const root: string;
2
+ export declare const horizontal: string;
3
+ export declare const item: string;
4
+ export declare const indicator: string;
5
+ export declare const indicatorInner: string;
6
+ export declare const label: string;
@@ -0,0 +1,34 @@
1
+ import { ComponentPropsWithoutRef, ReactNode } from 'react';
2
+ import * as RadixRadioGroup from '@radix-ui/react-radio-group';
3
+ type RadioGroupRootOwnProps = {
4
+ /**
5
+ * ラジオグループの値が変更されたときに呼び出されるコールバック関数
6
+ * @param value 選択された値
7
+ */
8
+ onChange?: (value: string) => void;
9
+ /**
10
+ * ラジオグループの方向を制御します
11
+ * @default 'vertical'
12
+ */
13
+ orientation?: 'horizontal' | 'vertical';
14
+ };
15
+ type RadioGroupRootProps = Omit<ComponentPropsWithoutRef<typeof RadixRadioGroup.Root>, 'onValueChange' | keyof RadioGroupRootOwnProps> & RadioGroupRootOwnProps;
16
+ declare const RadioGroupRoot: import('react').ForwardRefExoticComponent<Omit<Omit<RadixRadioGroup.RadioGroupProps & import('react').RefAttributes<HTMLDivElement>, "ref">, "onValueChange" | keyof RadioGroupRootOwnProps> & RadioGroupRootOwnProps & import('react').RefAttributes<HTMLDivElement>>;
17
+ type RadioGroupItemOwnProps = {
18
+ /**
19
+ * trueの場合、ラジオボタンのレンダリングを子要素に委譲します
20
+ */
21
+ asChild?: boolean;
22
+ /**
23
+ * ラジオボタンの子要素
24
+ */
25
+ children?: ReactNode;
26
+ };
27
+ type RadioGroupItemProps = ComponentPropsWithoutRef<typeof RadixRadioGroup.Item> & RadioGroupItemOwnProps;
28
+ declare const RadioGroupItem: import('react').ForwardRefExoticComponent<Omit<RadixRadioGroup.RadioGroupItemProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & RadioGroupItemOwnProps & import('react').RefAttributes<HTMLButtonElement>>;
29
+ declare const RadioGroup: {
30
+ Root: import('react').ForwardRefExoticComponent<Omit<Omit<RadixRadioGroup.RadioGroupProps & import('react').RefAttributes<HTMLDivElement>, "ref">, "onValueChange" | keyof RadioGroupRootOwnProps> & RadioGroupRootOwnProps & import('react').RefAttributes<HTMLDivElement>>;
31
+ Item: import('react').ForwardRefExoticComponent<Omit<RadixRadioGroup.RadioGroupItemProps & import('react').RefAttributes<HTMLButtonElement>, "ref"> & RadioGroupItemOwnProps & import('react').RefAttributes<HTMLButtonElement>>;
32
+ };
33
+ export { RadioGroup, RadioGroupItem, RadioGroupRoot };
34
+ export type { RadioGroupItemProps, RadioGroupRootProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { SelectBox, type SelectBoxOption, type SelectBoxProps } from './select-box';
@@ -0,0 +1,6 @@
1
+ export declare const root: string;
2
+ export declare const trigger: string;
3
+ export declare const icon: string;
4
+ export declare const content: string;
5
+ export declare const viewport: string;
6
+ export declare const item: string;
@@ -0,0 +1,53 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ import * as Select from '@radix-ui/react-select';
3
+ export type SelectBoxOption = {
4
+ label: string;
5
+ value: string;
6
+ disabled?: boolean;
7
+ };
8
+ type SelectBoxOwnProps = {
9
+ /**
10
+ * カスタムクラス名
11
+ */
12
+ className?: string;
13
+ /**
14
+ * エラー状態を表示するかどうか
15
+ * @default false
16
+ */
17
+ error?: boolean;
18
+ /**
19
+ * プレースホルダーテキスト
20
+ */
21
+ placeholder?: string;
22
+ /**
23
+ * 選択肢のリスト
24
+ */
25
+ options?: SelectBoxOption[];
26
+ /**
27
+ * 選択された値
28
+ */
29
+ value?: string;
30
+ /**
31
+ * デフォルトで選択される値
32
+ */
33
+ defaultValue?: string;
34
+ /**
35
+ * 値が変更されたときに呼ばれるコールバック
36
+ */
37
+ onValueChange?: (value: string) => void;
38
+ /**
39
+ * アクセシビリティラベル
40
+ */
41
+ ariaLabel?: string;
42
+ /**
43
+ * アクセシビリティラベルの参照ID
44
+ */
45
+ ariaLabelledby?: string;
46
+ };
47
+ type SelectBoxProps = Omit<ComponentPropsWithRef<typeof Select.Root>, keyof SelectBoxOwnProps> & SelectBoxOwnProps;
48
+ declare const SelectBox: {
49
+ ({ className: classNameProp, disabled, error, placeholder, options, value, defaultValue, onValueChange, ariaLabel, ariaLabelledby, ...other }: SelectBoxProps): import("react/jsx-runtime").JSX.Element;
50
+ displayName: string;
51
+ };
52
+ export { SelectBox };
53
+ export type { SelectBoxProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { Spinner, type SpinnerProps } from './spinner';
@@ -0,0 +1,3 @@
1
+ export declare const loaderSize: `var(--${string})`;
2
+ export declare const loaderColor: `var(--${string})`;
3
+ export declare const root: string;
@@ -0,0 +1,9 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ type SpinnerOwnProps = {
3
+ color?: string;
4
+ size?: string | number;
5
+ };
6
+ type SpinnerProps = ComponentPropsWithoutRef<'div'> & SpinnerOwnProps;
7
+ declare const Spinner: import('react').ForwardRefExoticComponent<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & SpinnerOwnProps & import('react').RefAttributes<HTMLDivElement>>;
8
+ export { Spinner };
9
+ export type { SpinnerProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { Switch, type SwitchProps } from './switch';
@@ -0,0 +1,4 @@
1
+ export declare const root: string;
2
+ export declare const track: string;
3
+ export declare const thumb: string;
4
+ export declare const inLabel: string;
@@ -0,0 +1,33 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ type SwitchOwnProps = {
3
+ /**
4
+ * ONの時に表示するラベル
5
+ */
6
+ onLabel?: string;
7
+ /**
8
+ * OFFの時に表示するラベル
9
+ */
10
+ offLabel?: string;
11
+ /**
12
+ * スイッチの状態(制御されたコンポーネント)
13
+ */
14
+ checked?: boolean;
15
+ /**
16
+ * スイッチの初期状態(非制御コンポーネント)
17
+ */
18
+ defaultChecked?: boolean;
19
+ /**
20
+ * スイッチが無効かどうか
21
+ */
22
+ disabled?: boolean;
23
+ /**
24
+ * スイッチの状態が変化した時のコールバック
25
+ * @param checked 新しい状態
26
+ * @return void
27
+ */
28
+ onCheckedChange?: (checked: boolean) => void;
29
+ };
30
+ export interface SwitchProps extends Omit<ComponentPropsWithRef<'button'>, 'size' | 'type' | 'onClick' | 'children'>, SwitchOwnProps {
31
+ }
32
+ export declare const Switch: import('react').ForwardRefExoticComponent<Omit<SwitchProps, "ref"> & import('react').RefAttributes<HTMLButtonElement>>;
33
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { Tag, type TagProps } from './tag';
@@ -0,0 +1,8 @@
1
+ declare const tagColor: `var(--${string})`;
2
+ declare const tagBackgroundColor: `var(--${string})`;
3
+ declare const tagBorderColor: `var(--${string})`;
4
+ export declare const root: string;
5
+ export declare const colorVariants: Record<"red" | "orange" | "green" | "blue" | "purple" | "orange-brown", string>;
6
+ export declare const colorFilledVariants: Record<"red" | "orange" | "green" | "blue" | "purple" | "orange-brown", string>;
7
+ export declare const colorOutlinedVariants: Record<"red" | "orange" | "green" | "blue" | "purple" | "orange-brown", string>;
8
+ export { tagBackgroundColor, tagBorderColor, tagColor };
@@ -0,0 +1,25 @@
1
+ import { ComponentPropsWithRef } from 'react';
2
+ type TagOwnProps = {
3
+ /**
4
+ * プリセットカラー(デザインシステム定義色)
5
+ * presetとcolorの両方が指定された場合、presetが優先されます
6
+ */
7
+ preset?: 'green' | 'orange' | 'orange-brown' | 'purple' | 'red' | 'blue';
8
+ /**
9
+ * カスタムカラー(HEXカラーコード or HTML標準カラー名)
10
+ * 例: '#0066CC', 'red', 'blue'
11
+ */
12
+ color?: string;
13
+ /**
14
+ * タグのバリアント
15
+ * @default 'default'
16
+ */
17
+ variant?: 'default' | 'filled' | 'outlined';
18
+ };
19
+ type TagProps = ComponentPropsWithRef<'span'> & TagOwnProps;
20
+ declare const Tag: {
21
+ (props: TagProps): import("react/jsx-runtime").JSX.Element;
22
+ displayName: string;
23
+ };
24
+ export { Tag };
25
+ export type { TagProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export { useUncontrolled } from './use-uncontrolled/use-uncontrolled';
@@ -0,0 +1,19 @@
1
+ export interface UseUncontrolledOptions<T> {
2
+ /** Value for controlled state */
3
+ value?: T;
4
+ /** Initial value for uncontrolled state */
5
+ defaultValue?: T;
6
+ /** Final value for uncontrolled state when value and defaultValue are not provided */
7
+ finalValue?: T;
8
+ /** Controlled state onChange handler */
9
+ onChange?: (value: T, ...payload: unknown[]) => void;
10
+ }
11
+ export type UseUncontrolledReturnValue<T> = [
12
+ /** Current value */
13
+ T,
14
+ /** Handler to update the state, passes `value` and `payload` to `onChange` */
15
+ (value: T, ...payload: unknown[]) => void,
16
+ /** True if the state is controlled, false if uncontrolled */
17
+ boolean
18
+ ];
19
+ export declare function useUncontrolled<T>({ value, defaultValue, finalValue, onChange, }: UseUncontrolledOptions<T>): UseUncontrolledReturnValue<T>;