@foi/design-system 0.0.0 → 0.0.2

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 (118) hide show
  1. package/dist/components/atoms/Button/Button.d.ts +10 -0
  2. package/dist/components/atoms/Button/Button.emotion.d.ts +2 -0
  3. package/dist/components/atoms/Button/Button.interface.d.ts +29 -0
  4. package/dist/components/atoms/Button/index.d.ts +3 -0
  5. package/dist/components/atoms/Checkbox/Checkbox.d.ts +7 -0
  6. package/dist/components/atoms/Checkbox/Checkbox.emotion.d.ts +2 -0
  7. package/dist/components/atoms/Checkbox/Checkbox.interface.d.ts +64 -0
  8. package/dist/components/atoms/Checkbox/index.d.ts +4 -0
  9. package/dist/components/atoms/DatePicker/DatePicker.d.ts +17 -0
  10. package/dist/components/atoms/DatePicker/DatePicker.emotion.d.ts +2 -0
  11. package/dist/components/atoms/DatePicker/DatePicker.interface.d.ts +105 -0
  12. package/dist/components/atoms/DatePicker/DatePicker.utils.d.ts +50 -0
  13. package/dist/components/atoms/DatePicker/DatePickerMenu/DatePickerMenu.d.ts +14 -0
  14. package/dist/components/atoms/DatePicker/DatePickerMenu/DatePickerMenu.emotion.d.ts +2 -0
  15. package/dist/components/atoms/DatePicker/DatePickerMenu/DatePickerMenu.interface.d.ts +46 -0
  16. package/dist/components/atoms/DatePicker/DatePickerMenu/index.d.ts +4 -0
  17. package/dist/components/atoms/DatePicker/index.d.ts +4 -0
  18. package/dist/components/atoms/IconButton/IconButton.d.ts +9 -0
  19. package/dist/components/atoms/IconButton/IconButton.emotion.d.ts +2 -0
  20. package/dist/components/atoms/IconButton/IconButton.interface.d.ts +21 -0
  21. package/dist/components/atoms/IconButton/index.d.ts +3 -0
  22. package/dist/components/atoms/Input/Input.d.ts +11 -0
  23. package/dist/components/atoms/Input/Input.emotion.d.ts +2 -0
  24. package/dist/components/atoms/Input/Input.interface.d.ts +55 -0
  25. package/dist/components/atoms/Input/index.d.ts +4 -0
  26. package/dist/components/atoms/Radio/Radio.d.ts +12 -0
  27. package/dist/components/atoms/Radio/Radio.emotion.d.ts +2 -0
  28. package/dist/components/atoms/Radio/Radio.interface.d.ts +51 -0
  29. package/dist/components/atoms/Radio/RadioGroup.context.d.ts +15 -0
  30. package/dist/components/atoms/Radio/index.d.ts +3 -0
  31. package/dist/components/atoms/Select/Select.d.ts +11 -0
  32. package/dist/components/atoms/Select/Select.emotion.d.ts +2 -0
  33. package/dist/components/atoms/Select/Select.interface.d.ts +55 -0
  34. package/dist/components/atoms/Select/SelectMenu/SelectMenu.d.ts +9 -0
  35. package/dist/components/atoms/Select/SelectMenu/SelectMenu.emotion.d.ts +2 -0
  36. package/dist/components/atoms/Select/SelectMenu/SelectMenu.interface.d.ts +33 -0
  37. package/dist/components/atoms/Select/SelectMenu/index.d.ts +4 -0
  38. package/dist/components/atoms/Select/index.d.ts +4 -0
  39. package/dist/components/atoms/Slider/Slider.d.ts +13 -0
  40. package/dist/components/atoms/Slider/Slider.emotion.d.ts +2 -0
  41. package/dist/components/atoms/Slider/Slider.interface.d.ts +59 -0
  42. package/dist/components/atoms/Slider/index.d.ts +4 -0
  43. package/dist/components/atoms/Switch/Switch.d.ts +11 -0
  44. package/dist/components/atoms/Switch/Switch.emotion.d.ts +2 -0
  45. package/dist/components/atoms/Switch/Switch.interface.d.ts +27 -0
  46. package/dist/components/atoms/Switch/index.d.ts +4 -0
  47. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.context.d.ts +13 -0
  48. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.d.ts +23 -0
  49. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.emotion.d.ts +2 -0
  50. package/dist/components/molecules/CheckboxGroup/CheckboxGroup.interface.d.ts +38 -0
  51. package/dist/components/molecules/CheckboxGroup/index.d.ts +4 -0
  52. package/dist/components/molecules/CheckboxTree/CheckboxTree.context.d.ts +13 -0
  53. package/dist/components/molecules/CheckboxTree/CheckboxTree.d.ts +23 -0
  54. package/dist/components/molecules/CheckboxTree/CheckboxTree.emotion.d.ts +2 -0
  55. package/dist/components/molecules/CheckboxTree/CheckboxTree.interface.d.ts +42 -0
  56. package/dist/components/molecules/CheckboxTree/index.d.ts +4 -0
  57. package/dist/components/molecules/RadioGroup/RadioGroup.d.ts +19 -0
  58. package/dist/components/molecules/RadioGroup/RadioGroup.emotion.d.ts +2 -0
  59. package/dist/components/molecules/RadioGroup/RadioGroup.interface.d.ts +38 -0
  60. package/dist/components/molecules/RadioGroup/index.d.ts +4 -0
  61. package/dist/hocs/MarginPage/index.d.ts +6 -0
  62. package/dist/hocs/OutsideEvent/index.d.ts +7 -0
  63. package/dist/hocs/ScrollToTop/index.d.ts +2 -0
  64. package/dist/hocs/ThemeProvider/ThemeProvider.d.ts +4 -0
  65. package/dist/hocs/ThemeProvider/ThemeProvider.interface.d.ts +29 -0
  66. package/dist/hocs/ThemeProvider/components/Button.d.ts +36 -0
  67. package/dist/hocs/ThemeProvider/components/Checkbox.d.ts +60 -0
  68. package/dist/hocs/ThemeProvider/components/CheckboxGroup.d.ts +20 -0
  69. package/dist/hocs/ThemeProvider/components/CheckboxTree.d.ts +20 -0
  70. package/dist/hocs/ThemeProvider/components/DatePicker.d.ts +60 -0
  71. package/dist/hocs/ThemeProvider/components/DatePickerMenu.d.ts +36 -0
  72. package/dist/hocs/ThemeProvider/components/IconButton.d.ts +36 -0
  73. package/dist/hocs/ThemeProvider/components/Input.d.ts +60 -0
  74. package/dist/hocs/ThemeProvider/components/Radio.d.ts +60 -0
  75. package/dist/hocs/ThemeProvider/components/RadioGroup.d.ts +20 -0
  76. package/dist/hocs/ThemeProvider/components/Select.d.ts +60 -0
  77. package/dist/hocs/ThemeProvider/components/SelectMenu.d.ts +32 -0
  78. package/dist/hocs/ThemeProvider/components/Slider.d.ts +36 -0
  79. package/dist/hocs/ThemeProvider/components/Switch.d.ts +40 -0
  80. package/dist/hocs/ThemeProvider/components/index.d.ts +13 -0
  81. package/dist/hocs/ThemeProvider/createComponentStyles.d.ts +2 -0
  82. package/dist/hocs/ThemeProvider/fonts/index.d.ts +6 -0
  83. package/dist/hocs/ThemeProvider/index.d.ts +1 -0
  84. package/dist/hocs/ThemeProvider/interfaces/Components.interface.d.ts +16 -0
  85. package/dist/hocs/ThemeProvider/interfaces/Events.interface.d.ts +16 -0
  86. package/dist/hocs/ThemeProvider/interfaces/Styles.interface.d.ts +54 -0
  87. package/dist/hocs/ThemeProvider/interfaces/Typography.interface.d.ts +10 -0
  88. package/dist/hocs/ThemeProvider/interfaces/index.d.ts +4 -0
  89. package/dist/hocs/ThemeProvider/useThemeProvider.hook.d.ts +10 -0
  90. package/dist/hocs/ThemeProvider/useThemeProvider.store.d.ts +2 -0
  91. package/dist/hooks/useOnClickOutside.d.ts +10 -0
  92. package/dist/hooks/useStateCallback.d.ts +1 -0
  93. package/dist/index.d.ts +27 -0
  94. package/dist/index.mjs +2728 -3254
  95. package/dist/index.mjs.map +1 -1
  96. package/dist/interfaces/Option.d.ts +10 -0
  97. package/dist/interfaces/index.d.ts +1 -0
  98. package/dist/theme/dark/colors.d.ts +31 -0
  99. package/dist/theme/dark/components/Button.d.ts +35 -0
  100. package/dist/theme/dark/components/Checkbox.d.ts +64 -0
  101. package/dist/theme/dark/components/CheckboxGroup.d.ts +18 -0
  102. package/dist/theme/dark/components/CheckboxTree.d.ts +17 -0
  103. package/dist/theme/dark/components/DatePicker.d.ts +58 -0
  104. package/dist/theme/dark/components/DatePickerMenu.d.ts +31 -0
  105. package/dist/theme/dark/components/IconButton.d.ts +30 -0
  106. package/dist/theme/dark/components/Input.d.ts +58 -0
  107. package/dist/theme/dark/components/Radio.d.ts +61 -0
  108. package/dist/theme/dark/components/RadioGroup.d.ts +18 -0
  109. package/dist/theme/dark/components/Select.d.ts +58 -0
  110. package/dist/theme/dark/components/SelectMenu.d.ts +30 -0
  111. package/dist/theme/dark/components/Slider.d.ts +46 -0
  112. package/dist/theme/dark/components/Switch.d.ts +55 -0
  113. package/dist/theme/dark/components/index.d.ts +540 -0
  114. package/dist/theme/dark/fonts.d.ts +6 -0
  115. package/dist/theme/dark/index.d.ts +547 -0
  116. package/dist/theme/index.d.ts +549 -0
  117. package/dist/utilities/emotion/styles.d.ts +2 -0
  118. package/package.json +81 -81
@@ -0,0 +1,55 @@
1
+ import type { EVENTS } from '@hocs/ThemeProvider/components/Select';
2
+ import type { Control, FieldValues } from 'react-hook-form';
3
+ import type { OptionProp } from '@interfaces';
4
+ export interface SelectStyleProps<TFieldValues extends FieldValues = FieldValues> {
5
+ /** RHF field name. The form value will be a `string` (the selected option's `value`). */
6
+ name: string;
7
+ /** Floating label displayed inside the select field border. */
8
+ label: string;
9
+ /** RHF control object. */
10
+ control: Control<TFieldValues>;
11
+ /** Array of selectable options. Each item must have at minimum `{ value, label }`. */
12
+ options: Array<OptionProp>;
13
+ /** Prevents all interaction when `true`.
14
+ * @default false
15
+ */
16
+ disabled?: boolean;
17
+ /** Number of options rendered per "page" — additional options are loaded as the user scrolls.
18
+ * Must be greater than 3 to activate virtual scrolling. Defaults to all options at once.
19
+ * @default 100
20
+ */
21
+ range?: number;
22
+ /** When `true`, the dropdown renders in the document flow (no absolute positioning),
23
+ * preventing it from overlapping adjacent elements.
24
+ * @default false
25
+ */
26
+ hasStaticOptions?: boolean;
27
+ /** When `true`, activates a search input inside the dropdown.
28
+ * Filtering starts after the user types at least 3 characters.
29
+ * @default false
30
+ */
31
+ hasSearch?: boolean;
32
+ /** When `true`, renders a secondary description line for each option
33
+ * (requires `description` to be set on each `OptionProp`).
34
+ * @default false
35
+ */
36
+ hasDescription?: boolean;
37
+ /** When `false`, validation error text below the field is hidden.
38
+ * @default true
39
+ */
40
+ showErrorText?: boolean;
41
+ /** When `true`, adds bottom padding below the helper text area.
42
+ * @default false
43
+ */
44
+ hasPadding?: boolean;
45
+ /** Helper text displayed below the field when there is no active error. */
46
+ helperText?: string;
47
+ /** Additional CSS class applied to the root element. */
48
+ className?: string;
49
+ /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
50
+ theme?: EVENTS;
51
+ }
52
+ export interface SelectProps<TFieldValues extends FieldValues = FieldValues> extends SelectStyleProps<TFieldValues> {
53
+ /** Theme tokens injected by the ThemeProvider HOC. Do not pass manually. */
54
+ style: Record<string, string>;
55
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { SelectMenuProps } from './SelectMenu.interface';
3
+ /**
4
+ * @internal Dropdown list rendered by `<Select>`.
5
+ * Scrolls the focused option into view on keyboard navigation and calls `onChange` on click.
6
+ * Not intended for direct use — use `<Select>` instead.
7
+ */
8
+ declare const SelectMenu: React.ForwardRefExoticComponent<SelectMenuProps & React.RefAttributes<HTMLDivElement>>;
9
+ export default SelectMenu;
@@ -0,0 +1,2 @@
1
+ declare const Style: (theme: Record<string, string>) => import("@emotion/utils").SerializedStyles;
2
+ export default Style;
@@ -0,0 +1,33 @@
1
+ import React from 'react';
2
+ import type { EVENTS } from '@hocs/ThemeProvider/components/SelectMenu';
3
+ import type { MenuOption } from '@interfaces';
4
+ export interface SelectMenuStyleProps {
5
+ /** The current list of options to render. Controlled by the parent Select. */
6
+ displayOptions: Array<MenuOption>;
7
+ /** The value of the currently selected option, used to highlight the active row. */
8
+ value: string | undefined;
9
+ /** Whether the dropdown is open. When `false` the menu is hidden (CSS-driven). */
10
+ isOpen: boolean;
11
+ /** When `true`, the menu renders in the document flow instead of floating above other elements. */
12
+ hasStaticOptions?: boolean;
13
+ /** When `true`, each row renders a secondary description line below the label. */
14
+ hasDescription?: boolean;
15
+ /** Index of the option that should receive the `:active` highlight (keyboard navigation).
16
+ * Pass `-1` when no option is focused.
17
+ */
18
+ focusedElement: number;
19
+ /** Callback fired when the user clicks or selects an option. Receives the full `MenuOption`. */
20
+ onChange: (option: MenuOption) => void;
21
+ /** Callback fired on scroll inside the menu container.
22
+ * Used by Select to implement lazy loading of options.
23
+ */
24
+ onScroll: (event: React.UIEvent<HTMLDivElement, UIEvent>) => void;
25
+ /** Additional CSS class applied to the root element. */
26
+ className?: string;
27
+ /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
28
+ theme?: EVENTS;
29
+ }
30
+ export interface SelectMenuProps extends SelectMenuStyleProps {
31
+ /** Theme tokens injected by the ThemeProvider HOC. Do not pass manually. */
32
+ style: Record<string, string>;
33
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { SelectMenuStyleProps } from './SelectMenu.interface';
3
+ declare const SelectMenu: React.ForwardRefExoticComponent<SelectMenuStyleProps & React.RefAttributes<HTMLDivElement>>;
4
+ export default SelectMenu;
@@ -0,0 +1,4 @@
1
+ import type { SelectStyleProps } from './Select.interface';
2
+ import type { FieldValues } from 'react-hook-form';
3
+ declare const Select: <TFieldValues extends FieldValues = FieldValues>({ theme, ...rest }: SelectStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export default Select;
@@ -0,0 +1,13 @@
1
+ import type { SliderProps } from './Slider.interface';
2
+ import { type FieldValues } from 'react-hook-form';
3
+ /**
4
+ * A slider lets users select a numeric value (or range) by dragging a thumb along a track.
5
+ *
6
+ * The form value is `number[]`:
7
+ * - **Single-thumb mode** — pass a 1-element array, e.g. `[50]`.
8
+ * - **Range mode** — pass a 2-element array, e.g. `[20, 80]`.
9
+ *
10
+ * Use the `track` prop to control which side of the thumb the filled track appears on.
11
+ */
12
+ declare const Slider: <TFieldValues extends FieldValues = FieldValues>({ min, max, name, step, distance, disabled, iconMin, iconMax, showMarks, direction, track, control, style, }: SliderProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
13
+ export default Slider;
@@ -0,0 +1,2 @@
1
+ declare const Style: (theme: Record<string, string>) => import("@emotion/utils").SerializedStyles;
2
+ export default Style;
@@ -0,0 +1,59 @@
1
+ import { type JSX } from 'react';
2
+ import type { EVENTS } from '@hocs/ThemeProvider/components/Slider';
3
+ import type { Control, FieldValues } from 'react-hook-form';
4
+ export interface SliderStyleProps<TFieldValues extends FieldValues = FieldValues> {
5
+ /** RHF field name. The form value must be `number[]`.
6
+ * Pass a **1-element array** for single-thumb mode, or a **2-element array** for range mode.
7
+ */
8
+ name: string;
9
+ /** RHF control object. */
10
+ control: Control<TFieldValues>;
11
+ /** Minimum selectable value (left / bottom end of the track).
12
+ * @default 0
13
+ */
14
+ min: number;
15
+ /** Maximum selectable value (right / top end of the track).
16
+ * Use `Infinity` to disable click-to-seek on the rail.
17
+ */
18
+ max: number;
19
+ /** Prevents all interaction when `true`.
20
+ * @default false
21
+ */
22
+ disabled?: boolean;
23
+ /** Granularity of the value — each thumb snaps to multiples of `step`.
24
+ * @default 1
25
+ */
26
+ step?: number;
27
+ /** Minimum distance enforced between the two thumbs in range mode.
28
+ * Has no effect in single-thumb mode.
29
+ * @default 0
30
+ */
31
+ distance?: number;
32
+ /** Helper text displayed below the slider. */
33
+ helperText?: string;
34
+ /** Icon rendered inside the **min** thumb (or the only thumb in single-thumb mode). */
35
+ iconMin?: JSX.Element;
36
+ /** Icon rendered inside the **max** thumb. Only visible in range mode. */
37
+ iconMax?: JSX.Element;
38
+ /** When `true`, renders a small dot at every `step` position along the track.
39
+ * Requires a finite `max` value.
40
+ * @default false
41
+ */
42
+ showMarks?: boolean;
43
+ /** Layout orientation of the slider.
44
+ * @default 'horizontal'
45
+ */
46
+ direction?: 'horizontal' | 'vertical';
47
+ /** Controls which side of the thumb the filled track appears on.
48
+ * - `'normal'` — fills from `min` toward the value (or between thumbs in range mode).
49
+ * - `'inverted'` — fills from the value toward `max` (or outside the thumbs in range mode).
50
+ * @default 'normal'
51
+ */
52
+ track?: 'normal' | 'inverted';
53
+ /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
54
+ theme?: EVENTS;
55
+ }
56
+ export interface SliderProps<TFieldValues extends FieldValues = FieldValues> extends SliderStyleProps<TFieldValues> {
57
+ /** Theme tokens injected by the ThemeProvider HOC. Do not pass manually. */
58
+ style: Record<string, string>;
59
+ }
@@ -0,0 +1,4 @@
1
+ import type { SliderStyleProps } from './Slider.interface';
2
+ import type { FieldValues } from 'react-hook-form';
3
+ declare const Slider: <TFieldValues extends FieldValues = FieldValues>({ theme, ...rest }: SliderStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export default Slider;
@@ -0,0 +1,11 @@
1
+ import type { SwitchProps } from './Switch.interface';
2
+ import { type FieldValues } from 'react-hook-form';
3
+ /**
4
+ * A switch (toggle) lets users turn a single setting on or off, like a physical light switch.
5
+ * Unlike a checkbox, a switch is expected to apply its effect immediately without a submit action.
6
+ *
7
+ * Optionally accepts `iconOn` and `iconOff` to visually communicate both states.
8
+ * The form value is a `boolean`.
9
+ */
10
+ declare const Switch: <TFieldValues extends FieldValues = FieldValues>({ name, control, iconOn, iconOff, disabled, label, helperText, className, style, ...rest }: SwitchProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
11
+ export default Switch;
@@ -0,0 +1,2 @@
1
+ declare const Style: (theme: Record<string, string>) => import("@emotion/utils").SerializedStyles;
2
+ export default Style;
@@ -0,0 +1,27 @@
1
+ import React, { type JSX } from 'react';
2
+ import type { EVENTS } from '@hocs/ThemeProvider/components/Switch';
3
+ import type { Control, FieldValues } from 'react-hook-form';
4
+ export interface SwitchStyleProps<TFieldValues extends FieldValues = FieldValues> extends React.InputHTMLAttributes<HTMLInputElement> {
5
+ /** RHF field name. The form value will be a `boolean`. */
6
+ name: string;
7
+ /** RHF control object. */
8
+ control: Control<TFieldValues>;
9
+ /** Prevents all interaction when `true`.
10
+ * @default false
11
+ */
12
+ disabled?: boolean;
13
+ /** Icon rendered on the thumb when the switch is **on** (checked). */
14
+ iconOn?: JSX.Element;
15
+ /** Icon rendered on the thumb when the switch is **off** (unchecked). */
16
+ iconOff?: JSX.Element;
17
+ /** Text label displayed next to the switch. */
18
+ label?: string;
19
+ /** Helper text displayed below the switch when there is no active error. */
20
+ helperText?: string;
21
+ /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
22
+ theme?: EVENTS;
23
+ }
24
+ export interface SwitchProps<TFieldValues extends FieldValues = FieldValues> extends SwitchStyleProps<TFieldValues> {
25
+ /** Theme tokens injected by the ThemeProvider HOC. Do not pass manually. */
26
+ style: Record<string, string>;
27
+ }
@@ -0,0 +1,4 @@
1
+ import type { SwitchStyleProps } from './Switch.interface';
2
+ import type { FieldValues } from 'react-hook-form';
3
+ declare const Switch: <TFieldValues extends FieldValues = FieldValues>({ theme, ...rest }: SwitchStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export default Switch;
@@ -0,0 +1,13 @@
1
+ export interface CheckboxGroupContextValue {
2
+ /** Array of currently checked option values */
3
+ checkedValues: string[];
4
+ /** Toggle a value in/out of the checked array */
5
+ onChange: (value: string, checked: boolean) => void;
6
+ /** Group-level disabled state */
7
+ disabled?: boolean;
8
+ /** Group-level validation error */
9
+ error?: {
10
+ message?: string;
11
+ };
12
+ }
13
+ export declare const CheckboxGroupContext: import("react").Context<CheckboxGroupContextValue | null>;
@@ -0,0 +1,23 @@
1
+ import type { CheckboxGroupProps } from './CheckboxGroup.interface';
2
+ import { type FieldValues } from 'react-hook-form';
3
+ /**
4
+ * CheckboxGroup manages a set of `<Checkbox>` children as a single RHF field.
5
+ * The form value is `string[]` — the `value` props of every checked child.
6
+ *
7
+ * Validation (min, max, custom) is declared on the Zod schema:
8
+ * ```ts
9
+ * z.object({
10
+ * options: z.array(z.string()).min(1, 'Select at least one').max(3, 'Select at most 3'),
11
+ * })
12
+ * ```
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <CheckboxGroup name="options" control={control} label="Skills">
17
+ * <Checkbox value="react" label="React" />
18
+ * <Checkbox value="vue" label="Vue" />
19
+ * </CheckboxGroup>
20
+ * ```
21
+ */
22
+ declare const CheckboxGroup: <TFieldValues extends FieldValues = FieldValues>({ name, control, children, label, helperText, showErrorText, disabled, direction, style, className, }: CheckboxGroupProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ export default CheckboxGroup;
@@ -0,0 +1,2 @@
1
+ declare const Style: (theme: Record<string, string>) => import("@emotion/utils").SerializedStyles;
2
+ export default Style;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import type { EVENTS } from '@hocs/ThemeProvider/components/CheckboxGroup';
3
+ import type { Control, FieldValues } from 'react-hook-form';
4
+ export interface CheckboxGroupStyleProps<TFieldValues extends FieldValues = FieldValues> {
5
+ /** RHF field name. The form value will be `string[]` — the `value` props of all checked children. */
6
+ name: string;
7
+ /** RHF control object. */
8
+ control: Control<TFieldValues>;
9
+ /** `<Checkbox>` elements to render inside the group.
10
+ * Each child must have a `value` prop that identifies it.
11
+ */
12
+ children: React.ReactNode;
13
+ /** Group label displayed above the checkboxes. */
14
+ label?: string;
15
+ /** Disables every checkbox in the group when `true`.
16
+ * Individual checkboxes can also be disabled independently.
17
+ * @default false
18
+ */
19
+ disabled?: boolean;
20
+ /** When `false`, the group-level error message is suppressed.
21
+ * @default true
22
+ */
23
+ showErrorText?: boolean;
24
+ /** Helper text displayed below the group when there is no active error. */
25
+ helperText?: string;
26
+ /** Layout direction of the checkbox items.
27
+ * @default 'vertical'
28
+ */
29
+ direction?: 'vertical' | 'horizontal';
30
+ /** Additional CSS class applied to the root element. */
31
+ className?: string;
32
+ /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
33
+ theme?: EVENTS;
34
+ }
35
+ export interface CheckboxGroupProps<TFieldValues extends FieldValues = FieldValues> extends CheckboxGroupStyleProps<TFieldValues> {
36
+ /** Theme tokens injected by the ThemeProvider HOC. Do not pass manually. */
37
+ style: Record<string, string>;
38
+ }
@@ -0,0 +1,4 @@
1
+ import type { CheckboxGroupStyleProps } from './CheckboxGroup.interface';
2
+ import type { FieldValues } from 'react-hook-form';
3
+ declare const CheckboxGroup: <TFieldValues extends FieldValues = FieldValues>({ theme, ...rest }: CheckboxGroupStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export default CheckboxGroup;
@@ -0,0 +1,13 @@
1
+ export interface CheckboxTreeContextValue {
2
+ /** Array of currently checked option values */
3
+ checkedValues: string[];
4
+ /** Toggle a value in/out of the checked array */
5
+ onChange: (value: string, checked: boolean) => void;
6
+ /** Tree-level disabled state */
7
+ disabled?: boolean;
8
+ /** Tree-level validation error */
9
+ error?: {
10
+ message?: string;
11
+ };
12
+ }
13
+ export declare const CheckboxTreeContext: import("react").Context<CheckboxTreeContextValue | null>;
@@ -0,0 +1,23 @@
1
+ import { type FieldValues } from 'react-hook-form';
2
+ import type { CheckboxTreeProps } from './CheckboxTree.interface';
3
+ /**
4
+ * CheckboxTree renders a parent `<Checkbox>` that controls all of its `<Checkbox>` children.
5
+ *
6
+ * Parent states:
7
+ * - **Checked** — all children are checked.
8
+ * - **Unchecked** — no children are checked.
9
+ * - **Indeterminate** — some (but not all) children are checked.
10
+ *
11
+ * The form value is `string[]` — the `value` props of every checked child.
12
+ * Validation is declared on the Zod schema, the same way as CheckboxGroup.
13
+ *
14
+ * @example
15
+ * ```tsx
16
+ * <CheckboxTree name="options" control={control} label="Select all">
17
+ * <Checkbox value="a" label="Option A" />
18
+ * <Checkbox value="b" label="Option B" />
19
+ * </CheckboxTree>
20
+ * ```
21
+ */
22
+ declare const CheckboxTree: <TFieldValues extends FieldValues = FieldValues>({ name, control, children, label, iconChecked, iconIndeterminate, helperText, showErrorText, disabled, style, className, }: CheckboxTreeProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
23
+ export default CheckboxTree;
@@ -0,0 +1,2 @@
1
+ declare const Style: (theme: Record<string, string>) => import("@emotion/utils").SerializedStyles;
2
+ export default Style;
@@ -0,0 +1,42 @@
1
+ import React, { type JSX } from 'react';
2
+ import type { Control, FieldValues } from 'react-hook-form';
3
+ import type { EVENTS } from '@hocs/ThemeProvider/components/Checkbox';
4
+ export interface CheckboxTreeStyleProps<TFieldValues extends FieldValues = FieldValues> {
5
+ /** RHF field name. The form value will be `string[]` — the `value` props of all checked children. */
6
+ name: string;
7
+ /** RHF control object. */
8
+ control: Control<TFieldValues>;
9
+ /** `<Checkbox>` elements rendered as children of the tree.
10
+ * The parent checkbox controls all children at once.
11
+ */
12
+ children: React.ReactNode;
13
+ /** Text label displayed on the parent (select-all) checkbox. */
14
+ label?: string;
15
+ /** Icon rendered on the parent checkbox when **all** children are checked.
16
+ * @default `<CheckOutlinedIcon />`
17
+ */
18
+ iconChecked?: JSX.Element;
19
+ /** Icon rendered on the parent checkbox when **some** (but not all) children are checked,
20
+ * indicating an indeterminate state.
21
+ * @default `<RemoveOutlinedIcon />`
22
+ */
23
+ iconIndeterminate?: JSX.Element;
24
+ /** Disables the parent and all children when `true`.
25
+ * @default false
26
+ */
27
+ disabled?: boolean;
28
+ /** When `false`, the error message below the tree is suppressed.
29
+ * @default true
30
+ */
31
+ showErrorText?: boolean;
32
+ /** Helper text displayed below the tree when there is no active error. */
33
+ helperText?: string;
34
+ /** Additional CSS class applied to the root element. */
35
+ className?: string;
36
+ /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
37
+ theme?: EVENTS;
38
+ }
39
+ export interface CheckboxTreeProps<TFieldValues extends FieldValues = FieldValues> extends CheckboxTreeStyleProps<TFieldValues> {
40
+ /** Theme tokens injected by the ThemeProvider HOC. Do not pass manually. */
41
+ style: Record<string, string>;
42
+ }
@@ -0,0 +1,4 @@
1
+ import type { CheckboxTreeStyleProps } from './CheckboxTree.interface';
2
+ import type { FieldValues } from 'react-hook-form';
3
+ declare const CheckboxTree: <TFieldValues extends FieldValues = FieldValues>({ theme, ...rest }: CheckboxTreeStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export default CheckboxTree;
@@ -0,0 +1,19 @@
1
+ import type { RadioGroupProps } from './RadioGroup.interface';
2
+ import { type FieldValues } from 'react-hook-form';
3
+ /**
4
+ * RadioGroup manages a set of `<Radio>` children as a single RHF field.
5
+ * The form value is a `string` — the `value` prop of the selected Radio.
6
+ *
7
+ * Provides a `RadioGroupContext` that every child `<Radio>` reads its selected state from.
8
+ * Rendering a `<Radio>` outside a RadioGroup throws an error.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <RadioGroup name="option" control={control} label="Pick one">
13
+ * <Radio value="a" label="Option A" />
14
+ * <Radio value="b" label="Option B" />
15
+ * </RadioGroup>
16
+ * ```
17
+ */
18
+ declare const RadioGroup: <TFieldValues extends FieldValues = FieldValues>({ name, control, children, label, helperText, showErrorText, disabled, direction, style, className, }: RadioGroupProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
19
+ export default RadioGroup;
@@ -0,0 +1,2 @@
1
+ declare const Style: (theme: Record<string, string>) => import("@emotion/utils").SerializedStyles;
2
+ export default Style;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+ import type { EVENTS } from '@hocs/ThemeProvider/components/RadioGroup';
3
+ import type { Control, FieldValues } from 'react-hook-form';
4
+ export interface RadioGroupStyleProps<TFieldValues extends FieldValues = FieldValues> {
5
+ /** RHF field name. The form value will be a `string` — the `value` prop of the selected Radio. */
6
+ name: string;
7
+ /** RHF control object. */
8
+ control: Control<TFieldValues>;
9
+ /** `<Radio>` elements to render inside the group.
10
+ * Each child must have a unique `value` prop.
11
+ */
12
+ children: React.ReactNode;
13
+ /** Group label displayed above the radio buttons. */
14
+ label?: string;
15
+ /** Disables every radio in the group when `true`.
16
+ * Individual radios can also be disabled independently.
17
+ * @default false
18
+ */
19
+ disabled?: boolean;
20
+ /** When `false`, the group-level error message is suppressed.
21
+ * @default true
22
+ */
23
+ showErrorText?: boolean;
24
+ /** Helper text displayed below the group when there is no active error. */
25
+ helperText?: string;
26
+ /** Layout direction of the radio items.
27
+ * @default 'vertical'
28
+ */
29
+ direction?: 'vertical' | 'horizontal';
30
+ /** Additional CSS class applied to the root element. */
31
+ className?: string;
32
+ /** Theme override tokens. Pass a partial `EVENTS` object to customise colours. */
33
+ theme?: EVENTS;
34
+ }
35
+ export interface RadioGroupProps<TFieldValues extends FieldValues = FieldValues> extends RadioGroupStyleProps<TFieldValues> {
36
+ /** Theme tokens injected by the ThemeProvider HOC. Do not pass manually. */
37
+ style: Record<string, string>;
38
+ }
@@ -0,0 +1,4 @@
1
+ import type { RadioGroupStyleProps } from './RadioGroup.interface';
2
+ import type { FieldValues } from 'react-hook-form';
3
+ declare const RadioGroup: <TFieldValues extends FieldValues = FieldValues>({ theme, ...rest }: RadioGroupStyleProps<TFieldValues>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export default RadioGroup;
@@ -0,0 +1,6 @@
1
+ import { JSX } from 'react';
2
+ type Props = {
3
+ children: JSX.Element;
4
+ };
5
+ declare const MarginPage: (props: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
6
+ export default MarginPage;
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ type Props = {
3
+ onEvent: () => void;
4
+ children: ReactNode;
5
+ };
6
+ declare const OutsideEvent: (props: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
7
+ export default OutsideEvent;
@@ -0,0 +1,2 @@
1
+ declare const ScrollToTop: () => null;
2
+ export default ScrollToTop;
@@ -0,0 +1,4 @@
1
+ import { ThemeProviderComponent } from './ThemeProvider.interface';
2
+ import type { Theme } from './ThemeProvider.interface';
3
+ declare const ThemeProvider: <T extends readonly Theme[]>(props: ThemeProviderComponent<T>) => import("@emotion/react/jsx-runtime").JSX.Element;
4
+ export default ThemeProvider;
@@ -0,0 +1,29 @@
1
+ import { type JSX } from 'react';
2
+ import COMPONTENTS from './components';
3
+ import { Component } from './interfaces';
4
+ import FONTS from './fonts';
5
+ export interface Theme {
6
+ name: string;
7
+ components: COMPONTENTS;
8
+ fonts: FONTS;
9
+ }
10
+ export interface ThemeProviderStore {
11
+ themes: {
12
+ [key: string]: Record<Component, Record<string, string>>;
13
+ };
14
+ theme: string;
15
+ setThemes: (themes: {
16
+ [key: string]: Record<Component, Record<string, string>>;
17
+ }) => void;
18
+ setTheme: (theme: string) => void;
19
+ }
20
+ export type ThemeNames<T extends readonly {
21
+ name: string;
22
+ }[] = readonly {
23
+ name: string;
24
+ }[]> = T[number]['name'];
25
+ export interface ThemeProviderComponent<T extends readonly Theme[] = readonly Theme[]> {
26
+ themes: T;
27
+ theme: ThemeNames<T>;
28
+ children: JSX.Element;
29
+ }
@@ -0,0 +1,36 @@
1
+ import { Component, Event, StyleValues, Styles } from '../interfaces';
2
+ declare const ROOT_KEYS: readonly [StyleValues.BORDER_RADIUS];
3
+ declare const ENABLED_KEYS: readonly [StyleValues.BACKGROUND_COLOR, StyleValues.COLOR_PRIMARY, StyleValues.BORDER_COLOR, StyleValues.BORDER_WIDTH, StyleValues.BORDER_STYLE];
4
+ declare const HOVER_KEYS: readonly [StyleValues.BACKGROUND_COLOR];
5
+ declare const ACTIVE_KEYS: readonly [StyleValues.BACKGROUND_COLOR];
6
+ declare const FOCUS_KEYS: readonly [StyleValues.OUTLINE_COLOR, StyleValues.OUTLINE_WIDTH, StyleValues.OUTLINE_STYLE, StyleValues.OUTLINE_OFFSET];
7
+ declare const DISABLED_KEYS: readonly [StyleValues.BACKGROUND_COLOR, StyleValues.COLOR_PRIMARY, StyleValues.BORDER_COLOR, StyleValues.BORDER_WIDTH, StyleValues.BORDER_STYLE];
8
+ declare const LOADING_KEYS: readonly [StyleValues.BACKGROUND_COLOR, StyleValues.COLOR_PRIMARY, StyleValues.BORDER_COLOR, StyleValues.BORDER_WIDTH, StyleValues.BORDER_STYLE];
9
+ export interface ROOT extends Pick<Styles, (typeof ROOT_KEYS)[number]> {
10
+ }
11
+ export interface ENABLED extends Pick<Styles, (typeof ENABLED_KEYS)[number]> {
12
+ }
13
+ export interface HOVER extends Pick<Styles, (typeof HOVER_KEYS)[number]> {
14
+ }
15
+ export interface ACTIVE extends Pick<Styles, (typeof ACTIVE_KEYS)[number]> {
16
+ }
17
+ export interface FOCUS extends Pick<Styles, (typeof FOCUS_KEYS)[number]> {
18
+ }
19
+ export interface DISABLED extends Pick<Styles, (typeof DISABLED_KEYS)[number]> {
20
+ }
21
+ export interface LOADING extends Pick<Styles, (typeof LOADING_KEYS)[number]> {
22
+ }
23
+ export interface EVENTS {
24
+ [Event.ENABLED]?: ENABLED;
25
+ [Event.HOVER]?: HOVER;
26
+ [Event.ACTIVE]?: ACTIVE;
27
+ [Event.FOCUS]?: FOCUS;
28
+ [Event.DISABLED]?: DISABLED;
29
+ [Event.LOADING]?: LOADING;
30
+ }
31
+ export interface BUTTON extends Record<Component.BUTTON, {
32
+ ROOT?: ROOT;
33
+ EVENTS?: EVENTS;
34
+ }> {
35
+ }
36
+ export {};