flikkui 0.1.0-beta.2 → 0.1.0-beta.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.
Files changed (104) hide show
  1. package/dist/components/charts/index.d.ts +2 -0
  2. package/dist/components/charts/shared/ChartLegend/ChartLegend.d.ts +7 -0
  3. package/dist/components/charts/shared/ChartLegend/ChartLegendContent.d.ts +7 -0
  4. package/dist/components/charts/shared/ChartLegend/index.d.ts +2 -0
  5. package/dist/components/core/AvatarGroup/AvatarGroup.animations.d.ts +1 -1
  6. package/dist/components/core/AvatarGroup/AvatarGroup.theme.d.ts +1 -0
  7. package/dist/components/core/Breadcrumbs/Breadcrumbs.js +8 -7
  8. package/dist/components/core/Button/Button.animations.d.ts +0 -12
  9. package/dist/components/core/Button/Button.animations.js +4 -19
  10. package/dist/components/core/Button/Button.js +40 -37
  11. package/dist/components/core/Button/Button.theme.d.ts +0 -4
  12. package/dist/components/core/Button/Button.theme.js +14 -9
  13. package/dist/components/core/Button/Button.types.d.ts +1 -1
  14. package/dist/components/core/Divider/Divider.types.d.ts +8 -2
  15. package/dist/components/core/Drawer/Drawer.types.d.ts +1 -1
  16. package/dist/components/core/Modal/Modal.types.d.ts +1 -1
  17. package/dist/components/core/Pagination/Pagination.types.d.ts +25 -13
  18. package/dist/components/core/Popover/Popover.animations.d.ts +34 -3
  19. package/dist/components/core/Popover/Popover.animations.js +19 -0
  20. package/dist/components/core/Popover/Popover.theme.js +2 -2
  21. package/dist/components/core/Popover/PopoverContent.js +5 -14
  22. package/dist/components/core/Segmented/Segmented.types.d.ts +17 -0
  23. package/dist/components/core/Tabs/Tabs.js +2 -8
  24. package/dist/components/core/Tabs/Tabs.theme.d.ts +8 -45
  25. package/dist/components/core/Tabs/Tabs.theme.js +14 -64
  26. package/dist/components/core/Tabs/Tabs.types.d.ts +4 -36
  27. package/dist/components/core/Tabs/TabsContent.js +3 -8
  28. package/dist/components/core/Tabs/TabsList.js +3 -10
  29. package/dist/components/core/Tabs/TabsTrigger.js +3 -15
  30. package/dist/components/core/Tabs/index.d.ts +1 -1
  31. package/dist/components/core/Tooltip/Tooltip.animations.d.ts +1 -1
  32. package/dist/components/core/Tooltip/Tooltip.d.ts +1 -1
  33. package/dist/components/core/Tooltip/Tooltip.theme.d.ts +0 -1
  34. package/dist/components/core/Tooltip/Tooltip.types.d.ts +15 -15
  35. package/dist/components/core/Tooltip/useTooltipPositioning.d.ts +12 -0
  36. package/dist/components/core/Tree/Tree.types.d.ts +8 -45
  37. package/dist/components/core/Tree/index.d.ts +1 -3
  38. package/dist/components/data-display/Table/Table.animations.d.ts +21 -0
  39. package/dist/components/data-display/Table/Table.types.d.ts +56 -13
  40. package/dist/components/data-display/Table/components/TableActionsMenu.d.ts +1 -1
  41. package/dist/components/data-display/Table/components/TableColumnManager/TableColumnManager.theme.d.ts +16 -0
  42. package/dist/components/data-display/Table/components/TablePagination/TablePagination.d.ts +17 -0
  43. package/dist/components/data-display/Table/components/TablePagination/TablePagination.types.d.ts +21 -0
  44. package/dist/components/data-display/Table/components/TablePagination/index.d.ts +2 -0
  45. package/dist/components/data-display/Table/index.d.ts +6 -3
  46. package/dist/components/feedback/Alert/Alert.types.d.ts +4 -0
  47. package/dist/components/feedback/ChatMessage/ChatMessage.types.d.ts +20 -14
  48. package/dist/components/feedback/Empty/Empty.theme.d.ts +4 -14
  49. package/dist/components/feedback/Empty/Empty.types.d.ts +8 -20
  50. package/dist/components/feedback/Empty/index.d.ts +2 -2
  51. package/dist/components/feedback/Notification/Notification.theme.d.ts +16 -1
  52. package/dist/components/feedback/Notification/Notification.types.d.ts +18 -40
  53. package/dist/components/feedback/Notification/index.d.ts +2 -2
  54. package/dist/components/feedback/Toast/Toast.animations.d.ts +31 -0
  55. package/dist/components/feedback/Toast/Toast.types.d.ts +1 -1
  56. package/dist/components/feedback/index.d.ts +3 -3
  57. package/dist/components/forms/Checkbox/Checkbox.js +10 -16
  58. package/dist/components/forms/Checkbox/Checkbox.theme.js +8 -6
  59. package/dist/components/forms/Checkbox/Checkbox.types.d.ts +13 -30
  60. package/dist/components/forms/FormLabel/FormLabel.d.ts +1 -2
  61. package/dist/components/forms/FormLabel/FormLabel.js +7 -14
  62. package/dist/components/forms/FormLabel/FormLabel.theme.d.ts +3 -4
  63. package/dist/components/forms/FormLabel/FormLabel.theme.js +6 -6
  64. package/dist/components/forms/FormLabel/FormLabel.types.d.ts +10 -18
  65. package/dist/components/forms/FormLabel/index.d.ts +3 -3
  66. package/dist/components/forms/Input/Input.d.ts +0 -1
  67. package/dist/components/forms/Input/Input.js +51 -85
  68. package/dist/components/forms/Input/Input.theme.d.ts +4 -4
  69. package/dist/components/forms/Input/Input.theme.js +26 -26
  70. package/dist/components/forms/Input/Input.types.d.ts +41 -64
  71. package/dist/components/forms/Input/index.d.ts +1 -1
  72. package/dist/components/forms/InputAddress/InputAddress.theme.d.ts +2 -2
  73. package/dist/components/forms/InputAddress/InputAddress.types.d.ts +3 -3
  74. package/dist/components/forms/InputCreditCard/InputCreditCard.theme.d.ts +3 -3
  75. package/dist/components/forms/InputCreditCard/InputCreditCard.types.d.ts +4 -4
  76. package/dist/components/forms/Radio/Radio.js +12 -18
  77. package/dist/components/forms/Radio/Radio.theme.d.ts +2 -18
  78. package/dist/components/forms/Radio/Radio.theme.js +10 -19
  79. package/dist/components/forms/Radio/Radio.types.d.ts +16 -32
  80. package/dist/components/forms/Select/Select.js +1 -9
  81. package/dist/components/forms/Signature/Signature.js +5 -4
  82. package/dist/components/forms/Signature/Signature.theme.js +1 -3
  83. package/dist/components/forms/Signature/Signature.types.d.ts +0 -4
  84. package/dist/components/layout/DragDrop/DragDrop.js +62 -0
  85. package/dist/components/layout/DragDrop/DragDrop.theme.js +8 -0
  86. package/dist/components/layout/Sortable/Sortable.animations.js +81 -0
  87. package/dist/components/layout/Sortable/Sortable.js +165 -0
  88. package/dist/components/layout/Sortable/Sortable.theme.js +7 -0
  89. package/dist/components/navigation/index.d.ts +1 -1
  90. package/dist/index.d.ts +1 -0
  91. package/dist/index.js +3 -1
  92. package/dist/node_modules/@heroicons/react/24/outline/esm/Bars3Icon.js +28 -0
  93. package/dist/node_modules/@heroicons/react/24/outline/esm/LockClosedIcon.js +28 -0
  94. package/dist/styles.css +1 -1
  95. package/dist/utils/debounce.d.ts +9 -0
  96. package/dist/utils/index.d.ts +1 -0
  97. package/package.json +2 -1
  98. package/dist/components/core/Popover/test-popover.d.ts +0 -3
  99. package/dist/components/core/Tabs/test-tabs.d.ts +0 -3
  100. package/dist/components/core/Tree/TreeIcon.d.ts +0 -3
  101. package/dist/components/core/Tree/TreeNode.d.ts +0 -6
  102. package/dist/components/forms/Input/Input.AdvancedStories.d.ts +0 -13
  103. package/dist/node_modules/framer-motion/dist/es/animation/hooks/animation-controls.js +0 -80
  104. package/dist/node_modules/framer-motion/dist/es/animation/hooks/use-animation.js +0 -41
@@ -19,7 +19,7 @@ import React from 'react';
19
19
  * @property {PasswordStrengthIndicator} passwordStrengthIndicator - Password strength indicator configuration
20
20
  * @property {number} currencyDecimalPlaces - Number of decimal places for currency inputs
21
21
  */
22
- export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type'> {
22
+ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'className'> {
23
23
  /** The size of the input */
24
24
  size?: InputSize;
25
25
  /** The state of the input (default, disabled, invalid) */
@@ -43,7 +43,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
43
43
  addonSuffix?: React.ReactNode;
44
44
  /** Keyboard shortcut to display on the right side */
45
45
  keyboardShortcut?: React.ReactNode;
46
- /** Additional class name for the input */
46
+ /** Additional class name for the input (highest priority) */
47
47
  className?: string;
48
48
  /** Additional class name for the label */
49
49
  labelClassName?: string;
@@ -53,8 +53,6 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
53
53
  wrapperClassName?: string;
54
54
  /** Additional class name for the input group */
55
55
  inputGroupClassName?: string;
56
- /** Component-level theme overrides */
57
- theme?: InputThemeOverrides;
58
56
  /** Whether the input is required */
59
57
  required?: boolean;
60
58
  /** Whether to show a toggle button for password fields. Only works when type="password" */
@@ -92,71 +90,50 @@ export interface PasswordStrengthIndicator {
92
90
  */
93
91
  export type PasswordStrength = 'weak' | 'moderate' | 'strong' | 'very-strong';
94
92
  /**
95
- * Theme overrides for the Input component
93
+ * Clean theme structure for Input component - following current Flikkui patterns
96
94
  */
97
- export interface InputThemeOverrides {
98
- /** Style for the outermost wrapper */
99
- wrapperStyle?: string;
100
- /** Style for the input group container (input + addons) */
101
- inputGroupStyle?: string;
102
- /** Base style for the input element */
103
- baseStyle?: string;
104
- /** Size variants for the input */
105
- sizes?: Partial<Record<InputSize, string>>;
106
- /** State variants applied to the input group */
107
- states?: Partial<Record<InputState, string>>;
108
- /** Base style for the helper text */
109
- helperText?: string;
110
- /** Common style for both prefix and suffix addons */
111
- addonStyle?: string;
112
- /** Additional style for the addon prefix */
113
- addonPrefixStyle?: string;
114
- /** Additional style for the addon suffix */
115
- addonSuffixStyle?: string;
116
- /** Style for the keyboard shortcut */
117
- keyboardShortcutStyle?: string;
118
- /** Style for the left icon container */
119
- leftIconStyle?: string;
120
- /** Style for the right icon container */
121
- rightIconStyle?: string;
122
- /** Padding styles for icons */
123
- iconPadding?: {
124
- left?: string;
125
- right?: string;
95
+ export interface InputTheme {
96
+ wrapperStyle: string;
97
+ inputGroupStyle: string;
98
+ baseStyle: string;
99
+ sizes: Record<InputSize, string>;
100
+ states: Record<InputState, string>;
101
+ helperText: string;
102
+ leftIconStyle: string;
103
+ rightIconStyle: string;
104
+ iconPadding: {
105
+ left: string;
106
+ right: string;
126
107
  };
127
- /** Style for the password toggle button */
128
- passwordToggleStyle?: string;
129
- /** Style for number buttons container */
130
- numberButtonsContainerStyle?: string;
131
- /** Base style for number buttons */
132
- numberButtonStyle?: string;
133
- /** Styles specific to input types */
134
- typeStyles?: {
135
- password?: {
136
- toggleIconActive?: string;
137
- toggleIconInactive?: string;
138
- };
139
- search?: {
140
- iconStyle?: string;
108
+ addonStyle: string;
109
+ addonPrefixStyle: string;
110
+ addonSuffixStyle: string;
111
+ keyboardShortcutStyle: string;
112
+ passwordToggleStyle: string;
113
+ numberButtonsContainerStyle: string;
114
+ numberButtonStyle: string;
115
+ typeStyles: {
116
+ password: {
117
+ toggleIconActive: string;
118
+ toggleIconInactive: string;
141
119
  };
142
- number?: {
143
- incrementIconStyle?: string;
144
- decrementIconStyle?: string;
120
+ search: {
121
+ iconStyle: string;
145
122
  };
146
- currency?: {
147
- symbolStyle?: string;
123
+ number: {
124
+ incrementIconStyle: string;
125
+ decrementIconStyle: string;
148
126
  };
149
127
  };
150
- /** Styles for password strength indicator */
151
- passwordStrengthIndicator?: {
152
- containerStyle?: string;
153
- labelStyle?: string;
154
- dotStyle?: string;
155
- dotActiveStyle?: string;
156
- dotInactiveStyle?: string;
157
- strengthStyles?: Partial<Record<PasswordStrength, {
158
- label?: string;
159
- color?: string;
160
- }>>;
128
+ passwordStrengthIndicator: {
129
+ containerStyle: string;
130
+ labelStyle: string;
131
+ dotStyle: string;
132
+ dotActiveStyle: string;
133
+ dotInactiveStyle: string;
134
+ strengthStyles: Record<PasswordStrength, {
135
+ label: string;
136
+ color: string;
137
+ }>;
161
138
  };
162
139
  }
@@ -1,3 +1,3 @@
1
1
  export { Input } from './Input';
2
- export type { InputProps, InputSize, InputState, InputThemeOverrides } from './Input.types';
2
+ export type { InputProps, InputSize, InputState, InputTheme, InputType, PasswordStrength, PasswordStrengthIndicator } from './Input.types';
3
3
  export { inputTheme } from './Input.theme';
@@ -13,8 +13,8 @@ export declare const styledInputAddressTheme: {
13
13
  contentStyles?: string;
14
14
  countryWrapperStyles?: string;
15
15
  postalCodeWrapperStyles?: string;
16
- countryInput?: InputThemeOverrides;
17
- postalCodeInput?: InputThemeOverrides;
16
+ countryInput?: import("..").InputTheme;
17
+ postalCodeInput?: import("..").InputTheme;
18
18
  inputPositions?: import("./InputAddress.types").InputPositionStyles;
19
19
  chevronStyles?: string;
20
20
  baseInputGroupStyle?: string;
@@ -1,4 +1,4 @@
1
- import { InputProps, InputThemeOverrides } from '../../core/Input/Input.types';
1
+ import { InputProps, InputTheme } from '../Input/Input.types';
2
2
  /**
3
3
  * InputAddress component props
4
4
  * @property {boolean} showCountrySelector - Whether to show the country selector
@@ -71,9 +71,9 @@ export interface InputAddressThemeOverrides {
71
71
  /** Styles for the postal code input wrapper */
72
72
  postalCodeWrapperStyles?: string;
73
73
  /** Country input theme overrides */
74
- countryInput?: InputThemeOverrides;
74
+ countryInput?: InputTheme;
75
75
  /** Postal code input theme overrides */
76
- postalCodeInput?: InputThemeOverrides;
76
+ postalCodeInput?: InputTheme;
77
77
  /** Styles for input positions */
78
78
  inputPositions?: InputPositionStyles;
79
79
  /** Styles for the chevron icon */
@@ -13,9 +13,9 @@ export declare const styledInputCreditCardTheme: {
13
13
  contentStyles?: string;
14
14
  expiryDateWrapperStyles?: string;
15
15
  cvcWrapperStyles?: string;
16
- cardNumberInput?: import("..").InputThemeOverrides;
17
- expiryDateInput?: import("..").InputThemeOverrides;
18
- cvcInput?: import("..").InputThemeOverrides;
16
+ cardNumberInput?: import("..").InputTheme;
17
+ expiryDateInput?: import("..").InputTheme;
18
+ cvcInput?: import("..").InputTheme;
19
19
  inputPositions?: import("./InputCreditCard.types").InputPositionStyles;
20
20
  chevronStyles?: string;
21
21
  baseInputGroupStyle?: string;
@@ -1,4 +1,4 @@
1
- import { InputProps, InputThemeOverrides } from '../Input/Input.types';
1
+ import { InputProps, InputTheme } from '../Input/Input.types';
2
2
  /**
3
3
  * InputCreditCard component props
4
4
  * @property {function} onCardNumberChange - Callback when card number changes
@@ -64,11 +64,11 @@ export interface InputCreditCardThemeOverrides {
64
64
  /** Styles for the CVC input wrapper */
65
65
  cvcWrapperStyles?: string;
66
66
  /** Card number input theme overrides */
67
- cardNumberInput?: InputThemeOverrides;
67
+ cardNumberInput?: InputTheme;
68
68
  /** Expiry date input theme overrides */
69
- expiryDateInput?: InputThemeOverrides;
69
+ expiryDateInput?: InputTheme;
70
70
  /** CVC input theme overrides */
71
- cvcInput?: InputThemeOverrides;
71
+ cvcInput?: InputTheme;
72
72
  /** Styles for input positions */
73
73
  inputPositions?: InputPositionStyles;
74
74
  /** Styles for the chevron icon */
@@ -1,20 +1,20 @@
1
+ import { __rest, __assign } from '../../../node_modules/tslib/tslib.es6.js';
1
2
  import React__default, { useState } from 'react';
2
- import { useRadioTheme } from './Radio.theme.js';
3
+ import { radioTheme } from './Radio.theme.js';
3
4
  import { FormLabel } from '../FormLabel/FormLabel.js';
5
+ import { cn } from '../../../utils/cn.js';
4
6
 
5
7
  /**
6
8
  * Radio component for selecting one option from a group
7
9
  */
8
10
  var Radio = function (_a) {
9
- var id = _a.id, name = _a.name, value = _a.value, controlledChecked = _a.checked, onChange = _a.onChange, label = _a.label, description = _a.description, _b = _a.state, state = _b === void 0 ? "default" : _b, themeOverrides = _a.theme;
10
- var _c = useState(false), internalChecked = _c[0], setInternalChecked = _c[1];
11
- var theme = useRadioTheme(themeOverrides === null || themeOverrides === void 0 ? void 0 : themeOverrides.baseStyle);
11
+ var id = _a.id, name = _a.name, value = _a.value, controlledChecked = _a.checked, onChange = _a.onChange, label = _a.label, description = _a.description, _b = _a.state, state = _b === void 0 ? "default" : _b, _c = _a.size, size = _c === void 0 ? "md" : _c, className = _a.className, restProps = __rest(_a, ["id", "name", "value", "checked", "onChange", "label", "description", "state", "size", "className"]);
12
+ var _d = useState(false), internalChecked = _d[0], setInternalChecked = _d[1];
12
13
  // Determine if component is controlled or uncontrolled
13
14
  var isControlled = controlledChecked !== undefined;
14
15
  var isChecked = isControlled ? controlledChecked : internalChecked;
15
16
  // Derive state flags
16
17
  var isDisabled = state === "disabled";
17
- var isInvalid = state === "invalid";
18
18
  var handleChange = function (e) {
19
19
  if (isDisabled)
20
20
  return;
@@ -23,19 +23,13 @@ var Radio = function (_a) {
23
23
  }
24
24
  onChange === null || onChange === void 0 ? void 0 : onChange(e.target.checked, value);
25
25
  };
26
- // Create state class for CSS selectors (like other components)
27
- var stateClass = isInvalid
28
- ? "state-invalid"
29
- : isDisabled
30
- ? "state-disabled"
31
- : "state-default";
32
- return (React__default.createElement("div", { className: "".concat(theme.container, " ").concat(stateClass) },
33
- React__default.createElement("div", { className: theme.inputContainer },
34
- React__default.createElement("input", { type: "radio", id: id, name: name, value: value, checked: isChecked, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? "".concat(id, "-description") : undefined, "aria-invalid": isInvalid, className: theme.input }),
35
- React__default.createElement("div", { className: "".concat(theme.dot, " ").concat(isChecked ? 'opacity-100' : '') })),
36
- (label || description) && (React__default.createElement("div", { className: theme.labelContainer },
37
- label && React__default.createElement(FormLabel, { htmlFor: id, state: state }, label),
38
- description && (React__default.createElement("div", { id: "".concat(id, "-description"), className: theme.description }, description))))));
26
+ return (React__default.createElement("div", __assign({ className: cn(radioTheme.baseStyle, className) }, restProps),
27
+ React__default.createElement("div", { className: cn(radioTheme.inputContainerStyle, radioTheme.sizes[size]) },
28
+ React__default.createElement("input", { type: "radio", id: id, name: name, value: value, checked: isChecked, onChange: handleChange, disabled: isDisabled, "aria-describedby": description ? "".concat(id, "-description") : undefined, "data-state": isDisabled ? "disabled" : "default", className: cn(radioTheme.inputStyle, radioTheme.sizes[size]) }),
29
+ isChecked && (React__default.createElement("div", { className: cn(radioTheme.dotStyle, size === "sm" ? "size-2" : "size-3", "opacity-100") }))),
30
+ (label || description) && (React__default.createElement("div", { className: "cursor-pointer" },
31
+ label && (React__default.createElement(FormLabel, { htmlFor: id, className: "!mb-0", state: state }, label)),
32
+ description && (React__default.createElement("div", { id: "".concat(id, "-description"), className: radioTheme.descriptionStyle }, description))))));
39
33
  };
40
34
 
41
35
  export { Radio, Radio as default };
@@ -1,21 +1,5 @@
1
- import { RadioThemeConfig } from "./Radio.types";
1
+ import { RadioTheme } from "./Radio.types";
2
2
  /**
3
3
  * Default theme configuration for the Radio component
4
4
  */
5
- export declare const radioTheme: RadioThemeConfig;
6
- /**
7
- * Utility function to merge default theme with overrides
8
- */
9
- export declare const useRadioTheme: (overrides?: Partial<RadioThemeConfig["baseStyle"]>) => {
10
- container: string;
11
- inputContainer: string;
12
- labelContainer: string;
13
- input: string;
14
- dot: string;
15
- description: string;
16
- states?: {
17
- default: string;
18
- disabled: string;
19
- invalid: string;
20
- };
21
- };
5
+ export declare const radioTheme: RadioTheme;
@@ -1,25 +1,16 @@
1
- import { __assign } from '../../../node_modules/tslib/tslib.es6.js';
2
-
3
1
  /**
4
2
  * Default theme configuration for the Radio component
5
3
  */
6
4
  var radioTheme = {
7
- baseStyle: {
8
- container: "relative flex items-start gap-3",
9
- inputContainer: "relative flex-shrink-0 size-6 flex items-center justify-center",
10
- labelContainer: "cursor-pointer",
11
- input: "size-6 appearance-none rounded-full border-2 border-gray-300 bg-white checked:border-primary-600 checked:bg-white disabled:border-gray-300 disabled:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 checked:outline-2 checked:outline-primary-100 checked:outline-offset-1 transition-all duration-400",
12
- dot: "absolute pointer-events-none size-3 rounded-full bg-primary-600 opacity-0 checked:opacity-100 disabled:bg-gray-400 transition-all duration-400",
13
- description: "text-sm text-text-secondary -mt-1",
14
- },
15
- };
16
- /**
17
- * Utility function to merge default theme with overrides
18
- */
19
- var useRadioTheme = function (overrides) {
20
- if (!overrides)
21
- return radioTheme.baseStyle;
22
- return __assign(__assign({}, radioTheme.baseStyle), overrides);
5
+ baseStyle: "relative flex items-start gap-3",
6
+ inputContainerStyle: "relative flex-shrink-0 flex items-center justify-center",
7
+ inputStyle: "appearance-none rounded-full border-2 border-gray-300 bg-white checked:border-primary-base checked:bg-white disabled:border-gray-300 disabled:bg-gray-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-600 checked:outline-2 checked:outline-primary-100 checked:outline-offset-1 transition-all duration-400 data-[state=disabled]:border-gray-300 data-[state=disabled]:bg-gray-100",
8
+ dotStyle: "absolute pointer-events-none rounded-full bg-primary-base opacity-0 transition-all duration-400",
9
+ descriptionStyle: "text-sm text-text-secondary mt-1",
10
+ sizes: {
11
+ sm: "size-5 mt-0.25",
12
+ md: "size-6"
13
+ }
23
14
  };
24
15
 
25
- export { radioTheme, useRadioTheme };
16
+ export { radioTheme };
@@ -1,20 +1,16 @@
1
+ import React from 'react';
1
2
  /**
2
3
  * State variants for the radio component
3
4
  */
4
- export type RadioState = 'default' | 'disabled' | 'invalid';
5
+ export type RadioState = 'default' | 'disabled';
6
+ /**
7
+ * Size variants for the radio component
8
+ */
9
+ export type RadioSize = 'sm' | 'md';
5
10
  /**
6
11
  * Radio component props
7
- * @property {string} id - Unique identifier for the radio input
8
- * @property {string} name - Name for the radio input group
9
- * @property {string} value - Value for the radio input
10
- * @property {boolean} checked - Whether the radio is checked
11
- * @property {(checked: boolean, value: string) => void} onChange - Function called when the radio state changes
12
- * @property {string} label - Label text for the radio
13
- * @property {string} description - Optional description text
14
- * @property {RadioState} state - The state of the radio (default, disabled, invalid)
15
- * @property {RadioThemeOverrides} theme - Optional theme overrides
16
12
  */
17
- export interface RadioProps {
13
+ export interface RadioProps extends Omit<React.HTMLAttributes<HTMLInputElement>, 'onChange' | 'size'> {
18
14
  id: string;
19
15
  name: string;
20
16
  value: string;
@@ -23,29 +19,17 @@ export interface RadioProps {
23
19
  label?: string;
24
20
  description?: string;
25
21
  state?: RadioState;
26
- theme?: RadioThemeOverrides;
22
+ size?: RadioSize;
23
+ className?: string;
27
24
  }
28
25
  /**
29
26
  * Radio theme configuration
30
27
  */
31
- export interface RadioThemeConfig {
32
- baseStyle: {
33
- container: string;
34
- inputContainer: string;
35
- labelContainer: string;
36
- input: string;
37
- dot: string;
38
- description: string;
39
- states?: {
40
- default: string;
41
- disabled: string;
42
- invalid: string;
43
- };
44
- };
45
- }
46
- /**
47
- * Radio theme overrides
48
- */
49
- export interface RadioThemeOverrides {
50
- baseStyle?: Partial<RadioThemeConfig['baseStyle']>;
28
+ export interface RadioTheme {
29
+ baseStyle: string;
30
+ inputContainerStyle: string;
31
+ inputStyle: string;
32
+ dotStyle: string;
33
+ descriptionStyle: string;
34
+ sizes: Record<RadioSize, string>;
51
35
  }
@@ -151,18 +151,10 @@ var SelectOptions = function (_a) {
151
151
  searchable && (React__default.createElement("div", { className: "sticky top-0 py-1 bg-white z-10 border-b border-neutral-100 ".concat(searchInputStyle), style: {
152
152
  '--form-rounded': '0',
153
153
  } },
154
- React__default.createElement(Input, { placeholder: "Search...", value: searchValue, onChange: handleSearchChange, type: "search", className: "border-none outline-none ring-0 shadow-none [&:focus]:outline-none [&:focus]:ring-0 [&:focus]:border-none [&:focus-visible]:outline-none [&:focus-visible]:ring-0 [&:focus-visible]:border-none", leftIcon: React__default.createElement(SearchIcon, { size: "sm", className: "text-neutral-400 group-focus-within:text-neutral-900" }), wrapperClassName: "!border-none !outline-none !ring-0 !shadow-none", style: {
154
+ React__default.createElement(Input, { placeholder: "Search...", value: searchValue, onChange: handleSearchChange, type: "search", className: "w-full block bg-white border-none outline-none ring-0 shadow-none [&:focus]:outline-none [&:focus]:ring-0 [&:focus]:border-none [&:focus-visible]:outline-none [&:focus-visible]:ring-0 [&:focus-visible]:border-none", leftIcon: React__default.createElement(SearchIcon, { size: "sm", className: "text-neutral-400 group-focus-within:text-neutral-900" }), wrapperClassName: "!border-none !outline-none !ring-0 !shadow-none", inputGroupClassName: "!border-none !outline-none !ring-0 !shadow-none flex items-center", style: {
155
155
  border: "none",
156
156
  outline: "none",
157
157
  boxShadow: "none"
158
- }, theme: {
159
- baseStyle: "w-full block bg-white",
160
- states: {
161
- default: "!border-none !outline-none !ring-0 !shadow-none",
162
- disabled: "!border-none !outline-none !ring-0 !shadow-none",
163
- },
164
- inputGroupStyle: "!border-none !outline-none !ring-0 !shadow-none flex items-center",
165
- wrapperStyle: "!border-none !outline-none !ring-0 !shadow-none"
166
158
  } }))),
167
159
  React__default.createElement("div", { style: { maxHeight: maxHeightValue, overflow: "auto" } }, children)))));
168
160
  };
@@ -2,6 +2,7 @@ import { __rest, __assign } from '../../../node_modules/tslib/tslib.es6.js';
2
2
  import React__default, { useRef, useState, useEffect, useCallback } from 'react';
3
3
  import { cn } from '../../../utils/cn.js';
4
4
  import { signatureTheme } from './Signature.theme.js';
5
+ import Button from '../../core/Button/Button.js';
5
6
 
6
7
  var Signature = React__default.forwardRef(function (_a, ref) {
7
8
  var _b = _a.width, width = _b === void 0 ? 400 : _b, _c = _a.height, height = _c === void 0 ? 200 : _c, _d = _a.strokeColor, strokeColor = _d === void 0 ? '#000000' : _d, _e = _a.strokeWidth, strokeWidth = _e === void 0 ? 2 : _e, _f = _a.backgroundColor, backgroundColor = _f === void 0 ? 'transparent' : _f, className = _a.className, _g = _a.theme, customTheme = _g === void 0 ? {} : _g, onChange = _a.onChange, onClear = _a.onClear, _h = _a.showControls, showControls = _h === void 0 ? true : _h, _j = _a.placeholder, placeholder = _j === void 0 ? 'Sign here' : _j, props = __rest(_a, ["width", "height", "strokeColor", "strokeWidth", "backgroundColor", "className", "theme", "onChange", "onClear", "showControls", "placeholder"]);
@@ -110,10 +111,10 @@ var Signature = React__default.forwardRef(function (_a, ref) {
110
111
  }, []);
111
112
  return (React__default.createElement("div", __assign({ ref: ref, className: cn(theme.baseStyle, className), style: { width: width, height: height } }, props),
112
113
  React__default.createElement("canvas", { ref: canvasRef, className: theme.canvasStyle, onMouseDown: startDrawing, onMouseMove: draw, onMouseUp: stopDrawing, onMouseLeave: stopDrawing, onTouchStart: startDrawing, onTouchMove: draw, onTouchEnd: stopDrawing }),
113
- isEmpty && placeholder && (React__default.createElement("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none text-gray-400" }, placeholder)),
114
- showControls && (React__default.createElement("div", { className: theme.controlsStyle },
115
- React__default.createElement("button", { type: "button", className: theme.buttonStyle, onClick: clear }, "Clear"),
116
- React__default.createElement("button", { type: "button", className: theme.buttonStyle, onClick: save, disabled: isEmpty }, "Save")))));
114
+ isEmpty && placeholder && (React__default.createElement("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none text-text-placeholder text-sm" }, placeholder)),
115
+ showControls && (React__default.createElement("div", { className: "absolute bottom-2 right-2 flex gap-1" },
116
+ React__default.createElement(Button, { size: "sm", variant: "clear", onClick: clear }, "Clear"),
117
+ React__default.createElement(Button, { size: "sm", variant: "outline", onClick: save, disabled: isEmpty }, "Download")))));
117
118
  });
118
119
  Signature.displayName = 'Signature';
119
120
 
@@ -1,8 +1,6 @@
1
1
  var signatureTheme = {
2
- baseStyle: 'relative border border-gray-300 rounded-lg bg-white',
2
+ baseStyle: 'relative border border-border rounded-[var(--form-rounded)] bg-white',
3
3
  canvasStyle: 'block w-full h-full cursor-crosshair',
4
- controlsStyle: 'absolute top-2 right-2 flex gap-2',
5
- buttonStyle: 'px-3 py-1 text-sm bg-white border border-gray-300 rounded hover:bg-gray-50 transition-colors',
6
4
  };
7
5
 
8
6
  export { signatureTheme };
@@ -2,14 +2,10 @@ import { HTMLAttributes } from 'react';
2
2
  export interface SignatureTheme {
3
3
  baseStyle: string;
4
4
  canvasStyle: string;
5
- controlsStyle: string;
6
- buttonStyle: string;
7
5
  }
8
6
  export interface SignatureThemeOverrides {
9
7
  baseStyle?: string;
10
8
  canvasStyle?: string;
11
- controlsStyle?: string;
12
- buttonStyle?: string;
13
9
  }
14
10
  export interface SignatureProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
15
11
  /** Canvas width */
@@ -0,0 +1,62 @@
1
+ import { __rest, __assign } from '../../../node_modules/tslib/tslib.es6.js';
2
+ import React__default, { useState, useCallback } from 'react';
3
+ import { cn } from '../../../utils/cn.js';
4
+ import { dragDropTheme } from './DragDrop.theme.js';
5
+
6
+ var Draggable = React__default.forwardRef(function (_a, ref) {
7
+ var children = _a.children, dragData = _a.dragData, className = _a.className, _b = _a.theme, customTheme = _b === void 0 ? {} : _b, onDragStart = _a.onDragStart, onDragEnd = _a.onDragEnd, props = __rest(_a, ["children", "dragData", "className", "theme", "onDragStart", "onDragEnd"]);
8
+ var _c = useState(false), isDragging = _c[0], setIsDragging = _c[1];
9
+ var theme = __assign(__assign({}, dragDropTheme), customTheme);
10
+ var handleDragStart = useCallback(function (event) {
11
+ setIsDragging(true);
12
+ event.dataTransfer.setData('application/json', JSON.stringify(dragData));
13
+ event.dataTransfer.effectAllowed = 'move';
14
+ onDragStart === null || onDragStart === void 0 ? void 0 : onDragStart(dragData, event);
15
+ }, [dragData, onDragStart]);
16
+ var handleDragEnd = useCallback(function (event) {
17
+ setIsDragging(false);
18
+ onDragEnd === null || onDragEnd === void 0 ? void 0 : onDragEnd(dragData, event);
19
+ }, [dragData, onDragEnd]);
20
+ return (React__default.createElement("div", __assign({ ref: ref, draggable: true, className: cn(theme.draggableStyle, isDragging && theme.dragPreviewStyle, className), onDragStart: handleDragStart, onDragEnd: handleDragEnd }, props), children));
21
+ });
22
+ Draggable.displayName = 'Draggable';
23
+ var Droppable = React__default.forwardRef(function (_a, ref) {
24
+ var children = _a.children, acceptedTypes = _a.acceptedTypes, className = _a.className, _b = _a.theme, customTheme = _b === void 0 ? {} : _b, onDrop = _a.onDrop, onDragEnter = _a.onDragEnter, onDragLeave = _a.onDragLeave, onDragOver = _a.onDragOver, props = __rest(_a, ["children", "acceptedTypes", "className", "theme", "onDrop", "onDragEnter", "onDragLeave", "onDragOver"]);
25
+ var _c = useState(false), isDragOver = _c[0], setIsDragOver = _c[1];
26
+ var theme = __assign(__assign({}, dragDropTheme), customTheme);
27
+ var handleDragEnter = useCallback(function (event) {
28
+ event.preventDefault();
29
+ setIsDragOver(true);
30
+ onDragEnter === null || onDragEnter === void 0 ? void 0 : onDragEnter(event);
31
+ }, [onDragEnter]);
32
+ var handleDragLeave = useCallback(function (event) {
33
+ event.preventDefault();
34
+ setIsDragOver(false);
35
+ onDragLeave === null || onDragLeave === void 0 ? void 0 : onDragLeave(event);
36
+ }, [onDragLeave]);
37
+ var handleDragOver = useCallback(function (event) {
38
+ event.preventDefault();
39
+ onDragOver === null || onDragOver === void 0 ? void 0 : onDragOver(event);
40
+ }, [onDragOver]);
41
+ var handleDrop = useCallback(function (event) {
42
+ event.preventDefault();
43
+ setIsDragOver(false);
44
+ try {
45
+ var data = JSON.parse(event.dataTransfer.getData('application/json'));
46
+ // Check if the dropped type is accepted
47
+ if (acceptedTypes && acceptedTypes.length > 0) {
48
+ if (!acceptedTypes.includes(data.type || '')) {
49
+ return;
50
+ }
51
+ }
52
+ onDrop === null || onDrop === void 0 ? void 0 : onDrop(data, event);
53
+ }
54
+ catch (error) {
55
+ console.warn('Failed to parse drag data:', error);
56
+ }
57
+ }, [acceptedTypes, onDrop]);
58
+ return (React__default.createElement("div", __assign({ ref: ref, className: cn(theme.droppableStyle, isDragOver && theme.dragOverStyle, className), onDragEnter: handleDragEnter, onDragLeave: handleDragLeave, onDragOver: handleDragOver, onDrop: handleDrop }, props), children));
59
+ });
60
+ Droppable.displayName = 'Droppable';
61
+
62
+ export { Draggable, Droppable };
@@ -0,0 +1,8 @@
1
+ var dragDropTheme = {
2
+ draggableStyle: 'cursor-move select-none transition-all duration-200 hover:opacity-90',
3
+ droppableStyle: 'min-h-20 border-2 border-dashed border-gray-300 rounded-lg transition-all duration-200',
4
+ dragOverStyle: 'border-blue-500 bg-blue-50',
5
+ dragPreviewStyle: 'opacity-50 scale-95',
6
+ };
7
+
8
+ export { dragDropTheme };
@@ -0,0 +1,81 @@
1
+ import { __assign } from '../../../node_modules/tslib/tslib.es6.js';
2
+
3
+ // Spring configuration for smooth, natural animations
4
+ var springConfig = {
5
+ type: 'spring',
6
+ stiffness: 300,
7
+ damping: 30,
8
+ mass: 1,
9
+ };
10
+ var fastSpringConfig = {
11
+ type: 'spring',
12
+ stiffness: 400,
13
+ damping: 25,
14
+ mass: 0.8,
15
+ };
16
+ var layoutSpringConfig = {
17
+ type: 'spring',
18
+ stiffness: 200,
19
+ damping: 25,
20
+ mass: 1,
21
+ };
22
+ // Drag state animations
23
+ var dragAnimations = {
24
+ initial: {
25
+ opacity: 1,
26
+ scale: 1,
27
+ zIndex: 1,
28
+ rotate: 0,
29
+ },
30
+ dragging: {
31
+ opacity: 0.9,
32
+ scale: 1.02,
33
+ zIndex: 10,
34
+ rotate: 2,
35
+ transition: springConfig,
36
+ },
37
+ idle: {
38
+ opacity: 1,
39
+ scale: 1,
40
+ zIndex: 1,
41
+ rotate: 0,
42
+ transition: springConfig,
43
+ },
44
+ };
45
+ // Layout animation configuration
46
+ var layoutAnimations = {
47
+ layout: __assign(__assign({}, layoutSpringConfig), {
48
+ // Slightly slower for smooth settling effect
49
+ stiffness: 180, damping: 28 }),
50
+ layoutId: function (id) { return "sortable-item-".concat(id); },
51
+ };
52
+ // Drag handle animations
53
+ var dragHandleAnimations = {
54
+ hover: {
55
+ scale: 1.1,
56
+ transition: fastSpringConfig,
57
+ },
58
+ tap: {
59
+ scale: 0.9,
60
+ transition: __assign(__assign({}, fastSpringConfig), { stiffness: 500 }),
61
+ },
62
+ };
63
+ // Container animations
64
+ var containerAnimations = {
65
+ layout: layoutSpringConfig,
66
+ };
67
+ // Animation variants for different states
68
+ var itemVariants = {
69
+ initial: dragAnimations.initial,
70
+ dragging: dragAnimations.dragging,
71
+ idle: dragAnimations.idle,
72
+ };
73
+ // Export configuration objects
74
+ var sortableAnimations = {
75
+ layout: layoutAnimations,
76
+ dragHandle: dragHandleAnimations,
77
+ container: containerAnimations,
78
+ variants: itemVariants,
79
+ };
80
+
81
+ export { containerAnimations, dragAnimations, dragHandleAnimations, itemVariants, layoutAnimations, sortableAnimations };