@flexmatch-dev/react-ui 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (184) hide show
  1. package/cjs/assets/icon-check.d.ts +7 -0
  2. package/cjs/assets/icon-check.d.ts.map +1 -0
  3. package/cjs/assets/icon-check.js +28 -0
  4. package/cjs/assets/icon-close.d.ts +3 -0
  5. package/cjs/assets/icon-close.d.ts.map +1 -0
  6. package/cjs/assets/icon-close.js +24 -0
  7. package/cjs/assets/icon-selectbox-arrow.d.ts +7 -0
  8. package/cjs/assets/icon-selectbox-arrow.d.ts.map +1 -0
  9. package/cjs/assets/icon-selectbox-arrow.js +28 -0
  10. package/cjs/assets/index.d.ts +4 -0
  11. package/cjs/assets/index.d.ts.map +1 -0
  12. package/cjs/assets/index.js +27 -0
  13. package/cjs/components/Input/Chip/InputChipButton.d.ts +5 -0
  14. package/cjs/components/Input/Chip/InputChipButton.d.ts.map +1 -0
  15. package/cjs/components/Input/Chip/InputChipButton.js +31 -0
  16. package/cjs/components/Input/Chip/InputChipRow.d.ts +13 -0
  17. package/cjs/components/Input/Chip/InputChipRow.d.ts.map +1 -0
  18. package/cjs/components/Input/Chip/InputChipRow.js +96 -0
  19. package/cjs/components/Input/Chip/InputTextbox.d.ts +5 -0
  20. package/cjs/components/Input/Chip/InputTextbox.d.ts.map +1 -0
  21. package/cjs/components/Input/Chip/InputTextbox.js +30 -0
  22. package/cjs/components/Input/Chip/index.d.ts +15 -0
  23. package/cjs/components/Input/Chip/index.d.ts.map +1 -0
  24. package/cjs/components/Input/Chip/index.js +17 -0
  25. package/cjs/components/Input/Selectable/InputButtonMultiSelect.d.ts +14 -0
  26. package/cjs/components/Input/Selectable/InputButtonMultiSelect.d.ts.map +1 -0
  27. package/cjs/components/Input/Selectable/InputButtonMultiSelect.js +96 -0
  28. package/cjs/components/Input/Selectable/InputButtonSelect.d.ts +14 -0
  29. package/cjs/components/Input/Selectable/InputButtonSelect.d.ts.map +1 -0
  30. package/cjs/components/Input/Selectable/InputButtonSelect.js +65 -0
  31. package/cjs/components/Input/Selectable/InputButtonSelectButton.d.ts +14 -0
  32. package/cjs/components/Input/Selectable/InputButtonSelectButton.d.ts.map +1 -0
  33. package/cjs/components/Input/Selectable/InputButtonSelectButton.js +78 -0
  34. package/cjs/components/Input/Selectable/InputCardSelect.d.ts +14 -0
  35. package/cjs/components/Input/Selectable/InputCardSelect.d.ts.map +1 -0
  36. package/cjs/components/Input/Selectable/InputCardSelect.js +65 -0
  37. package/cjs/components/Input/Selectable/InputCardSelectButton.d.ts +14 -0
  38. package/cjs/components/Input/Selectable/InputCardSelectButton.d.ts.map +1 -0
  39. package/cjs/components/Input/Selectable/InputCardSelectButton.js +85 -0
  40. package/cjs/components/Input/Selectable/InputCheckbox.d.ts +11 -0
  41. package/cjs/components/Input/Selectable/InputCheckbox.d.ts.map +1 -0
  42. package/cjs/components/Input/Selectable/InputCheckbox.js +43 -0
  43. package/cjs/components/Input/Selectable/InputOptionSwitch.d.ts.map +1 -1
  44. package/cjs/components/Input/Selectable/InputOptionSwitch.js +5 -2
  45. package/cjs/components/Input/Selectable/InputOptionSwitchButton.d.ts +2 -1
  46. package/cjs/components/Input/Selectable/InputOptionSwitchButton.d.ts.map +1 -1
  47. package/cjs/components/Input/Selectable/InputOptionSwitchButton.js +5 -1
  48. package/cjs/components/Input/Selectable/InputRadiobutton.d.ts +10 -0
  49. package/cjs/components/Input/Selectable/InputRadiobutton.d.ts.map +1 -0
  50. package/cjs/components/Input/Selectable/InputRadiobutton.js +45 -0
  51. package/cjs/components/Input/Selectable/InputSelectbox.d.ts +12 -0
  52. package/cjs/components/Input/Selectable/InputSelectbox.d.ts.map +1 -0
  53. package/cjs/components/Input/Selectable/InputSelectbox.js +92 -0
  54. package/cjs/components/atoms/button.ui.d.ts +6 -0
  55. package/cjs/components/atoms/button.ui.d.ts.map +1 -0
  56. package/cjs/components/atoms/button.ui.js +31 -0
  57. package/cjs/components/atoms/card-select.ui.d.ts +14 -0
  58. package/cjs/components/atoms/card-select.ui.d.ts.map +1 -0
  59. package/cjs/components/atoms/card-select.ui.js +72 -0
  60. package/cjs/components/atoms/checkbox.ui.d.ts +9 -0
  61. package/cjs/components/atoms/checkbox.ui.d.ts.map +1 -0
  62. package/cjs/components/atoms/checkbox.ui.js +86 -0
  63. package/cjs/components/atoms/chip.ui.d.ts +10 -0
  64. package/cjs/components/atoms/chip.ui.d.ts.map +1 -0
  65. package/cjs/components/atoms/chip.ui.js +35 -0
  66. package/cjs/components/atoms/index.d.ts +9 -0
  67. package/cjs/components/atoms/index.d.ts.map +1 -0
  68. package/cjs/components/atoms/index.js +62 -0
  69. package/cjs/components/atoms/info-card.ui.d.ts +7 -0
  70. package/cjs/components/atoms/info-card.ui.d.ts.map +1 -0
  71. package/cjs/components/atoms/info-card.ui.js +36 -0
  72. package/cjs/components/atoms/radio.ui.d.ts +14 -0
  73. package/cjs/components/atoms/radio.ui.d.ts.map +1 -0
  74. package/cjs/components/atoms/radio.ui.js +52 -0
  75. package/cjs/components/atoms/select.ui.d.ts +19 -0
  76. package/cjs/components/atoms/select.ui.d.ts.map +1 -0
  77. package/cjs/components/atoms/select.ui.js +87 -0
  78. package/cjs/components/atoms/textarea.ui.d.ts +5 -0
  79. package/cjs/components/atoms/textarea.ui.d.ts.map +1 -0
  80. package/cjs/components/atoms/textarea.ui.js +33 -0
  81. package/cjs/components/atoms/textbox.ui.d.ts +6 -1
  82. package/cjs/components/atoms/textbox.ui.d.ts.map +1 -1
  83. package/cjs/components/atoms/textbox.ui.js +54 -7
  84. package/cjs/constant/chip.constant.d.ts +5 -0
  85. package/cjs/constant/chip.constant.d.ts.map +1 -0
  86. package/cjs/constant/chip.constant.js +10 -0
  87. package/cjs/context/Input.d.ts +15 -0
  88. package/cjs/context/Input.d.ts.map +1 -1
  89. package/cjs/index.d.ts +12 -1
  90. package/cjs/index.d.ts.map +1 -1
  91. package/cjs/index.js +77 -16
  92. package/dist/index.css +1083 -3
  93. package/lib/assets/icon-check.d.ts +7 -0
  94. package/lib/assets/icon-check.d.ts.map +1 -0
  95. package/lib/assets/icon-check.js +22 -0
  96. package/lib/assets/icon-close.d.ts +3 -0
  97. package/lib/assets/icon-close.d.ts.map +1 -0
  98. package/lib/assets/icon-close.js +18 -0
  99. package/lib/assets/icon-selectbox-arrow.d.ts +7 -0
  100. package/lib/assets/icon-selectbox-arrow.d.ts.map +1 -0
  101. package/lib/assets/icon-selectbox-arrow.js +22 -0
  102. package/lib/assets/index.d.ts +4 -0
  103. package/lib/assets/index.d.ts.map +1 -0
  104. package/lib/assets/index.js +3 -0
  105. package/lib/components/Input/Chip/InputChipButton.d.ts +5 -0
  106. package/lib/components/Input/Chip/InputChipButton.d.ts.map +1 -0
  107. package/lib/components/Input/Chip/InputChipButton.js +24 -0
  108. package/lib/components/Input/Chip/InputChipRow.d.ts +13 -0
  109. package/lib/components/Input/Chip/InputChipRow.d.ts.map +1 -0
  110. package/lib/components/Input/Chip/InputChipRow.js +89 -0
  111. package/lib/components/Input/Chip/InputTextbox.d.ts +5 -0
  112. package/lib/components/Input/Chip/InputTextbox.d.ts.map +1 -0
  113. package/lib/components/Input/Chip/InputTextbox.js +23 -0
  114. package/lib/components/Input/Chip/index.d.ts +15 -0
  115. package/lib/components/Input/Chip/index.d.ts.map +1 -0
  116. package/lib/components/Input/Chip/index.js +10 -0
  117. package/lib/components/Input/Selectable/InputButtonMultiSelect.d.ts +14 -0
  118. package/lib/components/Input/Selectable/InputButtonMultiSelect.d.ts.map +1 -0
  119. package/lib/components/Input/Selectable/InputButtonMultiSelect.js +89 -0
  120. package/lib/components/Input/Selectable/InputButtonSelect.d.ts +14 -0
  121. package/lib/components/Input/Selectable/InputButtonSelect.d.ts.map +1 -0
  122. package/lib/components/Input/Selectable/InputButtonSelect.js +58 -0
  123. package/lib/components/Input/Selectable/InputButtonSelectButton.d.ts +14 -0
  124. package/lib/components/Input/Selectable/InputButtonSelectButton.d.ts.map +1 -0
  125. package/lib/components/Input/Selectable/InputButtonSelectButton.js +71 -0
  126. package/lib/components/Input/Selectable/InputCardSelect.d.ts +14 -0
  127. package/lib/components/Input/Selectable/InputCardSelect.d.ts.map +1 -0
  128. package/lib/components/Input/Selectable/InputCardSelect.js +58 -0
  129. package/lib/components/Input/Selectable/InputCardSelectButton.d.ts +14 -0
  130. package/lib/components/Input/Selectable/InputCardSelectButton.d.ts.map +1 -0
  131. package/lib/components/Input/Selectable/InputCardSelectButton.js +78 -0
  132. package/lib/components/Input/Selectable/InputCheckbox.d.ts +11 -0
  133. package/lib/components/Input/Selectable/InputCheckbox.d.ts.map +1 -0
  134. package/lib/components/Input/Selectable/InputCheckbox.js +37 -0
  135. package/lib/components/Input/Selectable/InputOptionSwitch.d.ts.map +1 -1
  136. package/lib/components/Input/Selectable/InputOptionSwitch.js +6 -2
  137. package/lib/components/Input/Selectable/InputOptionSwitchButton.d.ts +2 -1
  138. package/lib/components/Input/Selectable/InputOptionSwitchButton.d.ts.map +1 -1
  139. package/lib/components/Input/Selectable/InputOptionSwitchButton.js +4 -1
  140. package/lib/components/Input/Selectable/InputRadiobutton.d.ts +10 -0
  141. package/lib/components/Input/Selectable/InputRadiobutton.d.ts.map +1 -0
  142. package/lib/components/Input/Selectable/InputRadiobutton.js +38 -0
  143. package/lib/components/Input/Selectable/InputSelectbox.d.ts +12 -0
  144. package/lib/components/Input/Selectable/InputSelectbox.d.ts.map +1 -0
  145. package/lib/components/Input/Selectable/InputSelectbox.js +85 -0
  146. package/lib/components/atoms/button.ui.d.ts +6 -0
  147. package/lib/components/atoms/button.ui.d.ts.map +1 -0
  148. package/lib/components/atoms/button.ui.js +24 -0
  149. package/lib/components/atoms/card-select.ui.d.ts +14 -0
  150. package/lib/components/atoms/card-select.ui.d.ts.map +1 -0
  151. package/lib/components/atoms/card-select.ui.js +65 -0
  152. package/lib/components/atoms/checkbox.ui.d.ts +9 -0
  153. package/lib/components/atoms/checkbox.ui.d.ts.map +1 -0
  154. package/lib/components/atoms/checkbox.ui.js +79 -0
  155. package/lib/components/atoms/chip.ui.d.ts +10 -0
  156. package/lib/components/atoms/chip.ui.d.ts.map +1 -0
  157. package/lib/components/atoms/chip.ui.js +28 -0
  158. package/lib/components/atoms/index.d.ts +9 -0
  159. package/lib/components/atoms/index.d.ts.map +1 -0
  160. package/lib/components/atoms/index.js +8 -0
  161. package/lib/components/atoms/info-card.ui.d.ts +7 -0
  162. package/lib/components/atoms/info-card.ui.d.ts.map +1 -0
  163. package/lib/components/atoms/info-card.ui.js +29 -0
  164. package/lib/components/atoms/radio.ui.d.ts +14 -0
  165. package/lib/components/atoms/radio.ui.d.ts.map +1 -0
  166. package/lib/components/atoms/radio.ui.js +45 -0
  167. package/lib/components/atoms/select.ui.d.ts +19 -0
  168. package/lib/components/atoms/select.ui.d.ts.map +1 -0
  169. package/lib/components/atoms/select.ui.js +80 -0
  170. package/lib/components/atoms/textarea.ui.d.ts +5 -0
  171. package/lib/components/atoms/textarea.ui.d.ts.map +1 -0
  172. package/lib/components/atoms/textarea.ui.js +26 -0
  173. package/lib/components/atoms/textbox.ui.d.ts +6 -1
  174. package/lib/components/atoms/textbox.ui.d.ts.map +1 -1
  175. package/lib/components/atoms/textbox.ui.js +56 -9
  176. package/lib/constant/chip.constant.d.ts +5 -0
  177. package/lib/constant/chip.constant.d.ts.map +1 -0
  178. package/lib/constant/chip.constant.js +4 -0
  179. package/lib/context/Input.d.ts +15 -0
  180. package/lib/context/Input.d.ts.map +1 -1
  181. package/lib/index.d.ts +12 -1
  182. package/lib/index.d.ts.map +1 -1
  183. package/lib/index.js +17 -3
  184. package/package.json +1 -1
@@ -0,0 +1,14 @@
1
+ import { InputSelectableExtraOption, InputSelectableProps } from '@/context/Input';
2
+ export interface InputCardSelectProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, InputSelectableProps<T> {
3
+ id?: string | undefined;
4
+ title?: string | undefined;
5
+ description?: string | undefined;
6
+ extraOptions: InputSelectableExtraOption<T>[];
7
+ size?: 'small' | 'normal';
8
+ }
9
+ declare const InputCardSelect: {
10
+ <T>({ id, className, options, size, value, onChange, title, description, extraOptions, ...props }: InputCardSelectProps<T>): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ export default InputCardSelect;
14
+ //# sourceMappingURL=InputCardSelect.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputCardSelect.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCardSelect.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAInF,MAAM,WAAW,oBAAoB,CAAC,CAAC,CACrC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,YAAY,EAAE,0BAA0B,CAAC,CAAC,CAAC,EAAE,CAAC;IAC9C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;CAC3B;AACD,QAAA,MAAM,eAAe;KAAI,CAAC,iGAWvB,oBAAoB,CAAC,CAAC,CAAC;;CAiCzB,CAAC;AAEF,eAAe,eAAe,CAAC"}
@@ -0,0 +1,58 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["id", "className", "options", "size", "value", "onChange", "title", "description", "extraOptions"];
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
10
+ import clsx from 'clsx';
11
+ import { useCallback } from 'react';
12
+ import InputCardSelectButton from "./InputCardSelectButton";
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ var InputCardSelect = function InputCardSelect(_ref) {
15
+ var id = _ref.id,
16
+ className = _ref.className,
17
+ options = _ref.options,
18
+ _ref$size = _ref.size,
19
+ size = _ref$size === void 0 ? 'normal' : _ref$size,
20
+ value = _ref.value,
21
+ onChange = _ref.onChange,
22
+ title = _ref.title,
23
+ description = _ref.description,
24
+ extraOptions = _ref.extraOptions,
25
+ props = _objectWithoutProperties(_ref, _excluded);
26
+ var handleSelect = useCallback(function (eventKey) {
27
+ if (eventKey !== null) {
28
+ var option = options.find(function (opt) {
29
+ return String(opt.value) === String(eventKey);
30
+ });
31
+ if (option && onChange) {
32
+ onChange(option.value);
33
+ }
34
+ }
35
+ }, [options, onChange]);
36
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
37
+ id: id,
38
+ className: clsx(className, 'flexmatch-card-select-container')
39
+ }, props), {}, {
40
+ children: options.map(function (option) {
41
+ var extraOption = extraOptions.find(function (opt) {
42
+ return opt.value === option.value;
43
+ });
44
+ return /*#__PURE__*/_jsx(InputCardSelectButton, {
45
+ size: size,
46
+ disabled: option.disabled,
47
+ isSelected: option.value === value,
48
+ eventKey: String(option.value),
49
+ onSelect: handleSelect,
50
+ title: option.label,
51
+ description: extraOption === null || extraOption === void 0 ? void 0 : extraOption.description,
52
+ icon: extraOption === null || extraOption === void 0 ? void 0 : extraOption.icon
53
+ }, String(option.value));
54
+ })
55
+ }));
56
+ };
57
+ InputCardSelect.displayName = 'InputCardSelect';
58
+ export default InputCardSelect;
@@ -0,0 +1,14 @@
1
+ interface InputCardSelectButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
2
+ size?: 'small' | 'normal';
3
+ title?: string | undefined;
4
+ icon?: React.ReactNode | undefined;
5
+ description?: string | undefined;
6
+ disabled?: boolean | undefined;
7
+ isSelected?: boolean | undefined;
8
+ eventKey?: string | number | null | undefined;
9
+ onSelect?: ((eventKey: string | number | null, event: React.SyntheticEvent<HTMLElement>) => void) | undefined;
10
+ onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
11
+ }
12
+ declare const InputCardSelectButton: ({ title, size, icon, description, disabled, isSelected, eventKey, onSelect, onClick, children, className, ...props }: InputCardSelectButtonProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default InputCardSelectButton;
14
+ //# sourceMappingURL=InputCardSelectButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputCardSelectButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCardSelectButton.tsx"],"names":[],"mappings":"AAUA,UAAU,0BAA2B,SAAQ,IAAI,CAC/C,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX;IACC,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAE1B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,SAAS,CAAC;IAEnC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAE9C,QAAQ,CAAC,EACL,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,GACtF,SAAS,CAAC;IAEd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC/D;AAED,QAAA,MAAM,qBAAqB,GAAI,sHAa5B,0BAA0B,4CAgE5B,CAAC;AACF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,78 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["title", "size", "icon", "description", "disabled", "isSelected", "eventKey", "onSelect", "onClick", "children", "className"];
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
10
+ import clsx from 'clsx';
11
+ import { useCallback } from 'react';
12
+ import { CardSelectContainerUI, CardSelectIconUI, CardSelectContentUI, CardSelectContentButtonUI } from "../../atoms/card-select.ui";
13
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
14
+ var InputCardSelectButton = function InputCardSelectButton(_ref) {
15
+ var title = _ref.title,
16
+ _ref$size = _ref.size,
17
+ size = _ref$size === void 0 ? 'normal' : _ref$size,
18
+ icon = _ref.icon,
19
+ description = _ref.description,
20
+ disabled = _ref.disabled,
21
+ isSelected = _ref.isSelected,
22
+ eventKey = _ref.eventKey,
23
+ onSelect = _ref.onSelect,
24
+ onClick = _ref.onClick,
25
+ children = _ref.children,
26
+ className = _ref.className,
27
+ props = _objectWithoutProperties(_ref, _excluded);
28
+ var handleClick = useCallback(function (e) {
29
+ if (disabled) {
30
+ e.preventDefault();
31
+ e.stopPropagation();
32
+ return;
33
+ }
34
+ if (onClick) {
35
+ onClick(e);
36
+ }
37
+ if (!e.defaultPrevented) {
38
+ if (onSelect) {
39
+ onSelect(eventKey !== null && eventKey !== void 0 ? eventKey : null, e);
40
+ }
41
+ }
42
+ }, [disabled, onClick, onSelect, eventKey]);
43
+ var handleKeyDown = useCallback(function (e) {
44
+ if (disabled) {
45
+ e.preventDefault();
46
+ e.stopPropagation();
47
+ return;
48
+ }
49
+ if (e.key === 'Enter' || e.key === ' ') {
50
+ e.preventDefault();
51
+ if (onClick) {
52
+ onClick(e);
53
+ }
54
+ if (!e.defaultPrevented) {
55
+ if (onSelect) {
56
+ onSelect(eventKey !== null && eventKey !== void 0 ? eventKey : null, e);
57
+ }
58
+ }
59
+ }
60
+ }, [disabled, onClick, onSelect, eventKey]);
61
+ return /*#__PURE__*/_jsxs(CardSelectContainerUI, _objectSpread(_objectSpread({
62
+ className: clsx(className, isSelected && 'selected', size === 'small' && 'small', size === 'normal' && 'normal'),
63
+ onClick: handleClick,
64
+ onKeyDown: handleKeyDown,
65
+ tabIndex: disabled ? -1 : 0,
66
+ "aria-disabled": disabled
67
+ }, props), {}, {
68
+ children: [/*#__PURE__*/_jsx(CardSelectIconUI, {
69
+ children: icon
70
+ }), /*#__PURE__*/_jsx(CardSelectContentUI, {
71
+ title: title,
72
+ description: description
73
+ }), /*#__PURE__*/_jsx(CardSelectContentButtonUI, {
74
+ isSelected: isSelected
75
+ })]
76
+ }));
77
+ };
78
+ export default InputCardSelectButton;
@@ -0,0 +1,11 @@
1
+ import { InputSelectableProps } from '@/context/Input';
2
+ export interface InputCheckboxProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, InputSelectableProps<boolean> {
3
+ id?: string | undefined;
4
+ disabled?: boolean | undefined;
5
+ label?: string | undefined;
6
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
7
+ required?: boolean;
8
+ }
9
+ declare const InputCheckbox: import("react").ForwardRefExoticComponent<InputCheckboxProps & import("react").RefAttributes<HTMLInputElement>>;
10
+ export default InputCheckbox;
11
+ //# sourceMappingURL=InputCheckbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputCheckbox.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputCheckbox.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC;IAC7F,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,aAAa,iHAiBlB,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -0,0 +1,37 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["id", "className", "label", "disabled", "value", "onChange", "size", "required"];
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
10
+ import { forwardRef } from 'react';
11
+ import { CheckboxUI } from "../../atoms";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ var InputCheckbox = /*#__PURE__*/forwardRef(function (_ref, ref) {
14
+ var id = _ref.id,
15
+ className = _ref.className,
16
+ label = _ref.label,
17
+ disabled = _ref.disabled,
18
+ value = _ref.value,
19
+ onChange = _ref.onChange,
20
+ _ref$size = _ref.size,
21
+ size = _ref$size === void 0 ? 'md' : _ref$size,
22
+ required = _ref.required,
23
+ props = _objectWithoutProperties(_ref, _excluded);
24
+ return /*#__PURE__*/_jsx(CheckboxUI, _objectSpread({
25
+ id: id,
26
+ className: className,
27
+ label: label,
28
+ disabled: disabled,
29
+ checked: value !== null && value !== void 0 ? value : true,
30
+ onChange: onChange,
31
+ size: size,
32
+ required: required,
33
+ ref: ref
34
+ }, props));
35
+ });
36
+ InputCheckbox.displayName = 'InputCheckbox';
37
+ export default InputCheckbox;
@@ -1 +1 @@
1
- {"version":3,"file":"InputOptionSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputOptionSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAOtD,MAAM,WAAW,sBAAsB,CAAC,CAAC,CACvC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB;KAAI,CAAC,gDAMzB,sBAAsB,CAAC,CAAC,CAAC;;CAoC3B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"InputOptionSwitch.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputOptionSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAStD,MAAM,WAAW,sBAAsB,CAAC,CAAC,CACvC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,QAAA,MAAM,iBAAiB;KAAI,CAAC,gDAMzB,sBAAsB,CAAC,CAAC,CAAC;;CAqC3B,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1,8 +1,11 @@
1
1
  import { OptionSwitchContainerUI, OptionSwitchSelectionUI } from "../../atoms/option-switch.ui";
2
2
  import { useCallback, useMemo } from 'react';
3
3
  import InputOptionSwitchButton from "./InputOptionSwitchButton";
4
+
5
+ // 값이 이원화되어있습니다.
6
+ // 해당 값을 변경할 경우 react-ui/src/css/option-switch.ui.css 파일의 --flexmatch-input-option-switch-size 값을 수정해주세요.
4
7
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
- var size = 100;
8
+ var FLEXMATCH_INPUT_OPTION_SWITCH_SIZE = 100;
6
9
  var InputOptionSwitch = function InputOptionSwitch(_ref) {
7
10
  var id = _ref.id,
8
11
  className = _ref.className,
@@ -16,7 +19,7 @@ var InputOptionSwitch = function InputOptionSwitch(_ref) {
16
19
  if (index === -1) {
17
20
  return 0;
18
21
  }
19
- return index * size;
22
+ return index * FLEXMATCH_INPUT_OPTION_SWITCH_SIZE;
20
23
  }, [options, value]);
21
24
  var handleSelect = useCallback(function (eventKey) {
22
25
  if (eventKey !== null) {
@@ -37,6 +40,7 @@ var InputOptionSwitch = function InputOptionSwitch(_ref) {
37
40
  }
38
41
  }), options.map(function (option) {
39
42
  return /*#__PURE__*/_jsx(InputOptionSwitchButton, {
43
+ isSelected: option.value === value,
40
44
  eventKey: String(option.value),
41
45
  disabled: !!option.disabled,
42
46
  onSelect: function onSelect(eventKey) {
@@ -1,9 +1,10 @@
1
1
  export interface InputOptionSwitchButtonProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
2
2
  disabled?: boolean | undefined;
3
+ isSelected?: boolean | undefined;
3
4
  eventKey?: string | number | null | undefined;
4
5
  onSelect?: ((eventKey: string | number | null, event: React.SyntheticEvent<HTMLElement>) => void) | undefined;
5
6
  onClick?: React.MouseEventHandler<HTMLDivElement> | undefined;
6
7
  }
7
- declare const InputOptionSwitchButton: ({ disabled, eventKey, onSelect, onClick, children, ...props }: InputOptionSwitchButtonProps) => import("react/jsx-runtime").JSX.Element;
8
+ declare const InputOptionSwitchButton: ({ disabled, isSelected, eventKey, onSelect, onClick, children, ...props }: InputOptionSwitchButtonProps) => import("react/jsx-runtime").JSX.Element;
8
9
  export default InputOptionSwitchButton;
9
10
  //# sourceMappingURL=InputOptionSwitchButton.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InputOptionSwitchButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputOptionSwitchButton.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CACxD,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX;IACC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAE9C,QAAQ,CAAC,EACL,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,GACtF,SAAS,CAAC;IAEd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC/D;AACD,QAAA,MAAM,uBAAuB,GAAI,+DAO9B,4BAA4B,4CA0D9B,CAAC;AACF,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"InputOptionSwitchButton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputOptionSwitchButton.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,4BAA6B,SAAQ,IAAI,CACxD,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EACpC,UAAU,CACX;IACC,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAE/B,UAAU,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAE9C,QAAQ,CAAC,EACL,CAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC,GACtF,SAAS,CAAC;IAEd,OAAO,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CAC/D;AACD,QAAA,MAAM,uBAAuB,GAAI,2EAQ9B,4BAA4B,4CA2D9B,CAAC;AACF,eAAe,uBAAuB,CAAC"}
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["disabled", "eventKey", "onSelect", "onClick", "children"];
2
+ var _excluded = ["disabled", "isSelected", "eventKey", "onSelect", "onClick", "children"];
3
3
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
4
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
5
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
@@ -8,10 +8,12 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
8
8
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
9
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
10
10
  import { OptionSwitchButtonUI } from "../../atoms/option-switch.ui";
11
+ import clsx from 'clsx';
11
12
  import { useCallback } from 'react';
12
13
  import { jsx as _jsx } from "react/jsx-runtime";
13
14
  var InputOptionSwitchButton = function InputOptionSwitchButton(_ref) {
14
15
  var disabled = _ref.disabled,
16
+ isSelected = _ref.isSelected,
15
17
  eventKey = _ref.eventKey,
16
18
  onSelect = _ref.onSelect,
17
19
  onClick = _ref.onClick,
@@ -51,6 +53,7 @@ var InputOptionSwitchButton = function InputOptionSwitchButton(_ref) {
51
53
  }
52
54
  }, [disabled, onClick, onSelect, eventKey]);
53
55
  return /*#__PURE__*/_jsx(OptionSwitchButtonUI, _objectSpread(_objectSpread({
56
+ className: clsx('no-drag', isSelected && 'selected'),
54
57
  disabled: !!disabled,
55
58
  onClick: handleClick,
56
59
  onKeyDown: handleKeyDown,
@@ -0,0 +1,10 @@
1
+ import { InputSelectableProps } from '@/context/Input';
2
+ export interface InputRadiobuttonProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, InputSelectableProps<T> {
3
+ id?: string | undefined;
4
+ }
5
+ declare const InputRadiobutton: {
6
+ <T>({ id, className, options, value, onChange, }: InputRadiobuttonProps<T>): import("react/jsx-runtime").JSX.Element;
7
+ displayName: string;
8
+ };
9
+ export default InputRadiobutton;
10
+ //# sourceMappingURL=InputRadiobutton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputRadiobutton.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputRadiobutton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,qBAAqB,CAAC,CAAC,CACtC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,QAAA,MAAM,gBAAgB;KAAI,CAAC,gDAMxB,qBAAqB,CAAC,CAAC,CAAC;;CA2B1B,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import clsx from 'clsx';
2
+ import { useCallback } from 'react';
3
+ import { RadioUI } from "../../atoms";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ var InputRadiobutton = function InputRadiobutton(_ref) {
6
+ var id = _ref.id,
7
+ className = _ref.className,
8
+ options = _ref.options,
9
+ value = _ref.value,
10
+ onChange = _ref.onChange;
11
+ var handleClick = useCallback(function (eventKey) {
12
+ if (eventKey !== null) {
13
+ var option = options.find(function (opt) {
14
+ return String(opt.value) === String(eventKey);
15
+ });
16
+ if (option && onChange) {
17
+ onChange(option.value);
18
+ }
19
+ }
20
+ }, [options, onChange]);
21
+ return /*#__PURE__*/_jsx("div", {
22
+ id: id,
23
+ className: clsx(className, 'flexmatch-radiobutton-container'),
24
+ children: options.map(function (option) {
25
+ return /*#__PURE__*/_jsx(RadioUI, {
26
+ className: 'flexmatch-radiobutton-item',
27
+ onClick: function onClick() {
28
+ return !option.disabled && handleClick(String(option.value));
29
+ },
30
+ checked: option.value === value,
31
+ disabled: !!option.disabled,
32
+ children: option.label
33
+ }, String(option.value));
34
+ })
35
+ });
36
+ };
37
+ InputRadiobutton.displayName = 'InputRadiobutton';
38
+ export default InputRadiobutton;
@@ -0,0 +1,12 @@
1
+ import { InputSelectableProps } from '@/context/Input';
2
+ export interface InputSelectboxProps<T> extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'>, InputSelectableProps<T> {
3
+ id?: string | undefined;
4
+ disabled?: boolean | undefined;
5
+ placeholder?: string | undefined;
6
+ }
7
+ declare const InputSelectbox: {
8
+ <T>({ id, className, options, value, onChange, disabled, placeholder, }: InputSelectboxProps<T>): import("react/jsx-runtime").JSX.Element;
9
+ displayName: string;
10
+ };
11
+ export default InputSelectbox;
12
+ //# sourceMappingURL=InputSelectbox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InputSelectbox.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/Selectable/InputSelectbox.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAEvD,MAAM,WAAW,mBAAmB,CAAC,CAAC,CACpC,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC,CAAC;IACvF,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAClC;AACD,QAAA,MAAM,cAAc;KAAI,CAAC,uEAQtB,mBAAmB,CAAC,CAAC,CAAC;;CAiExB,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,85 @@
1
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
4
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
7
+ import clsx from 'clsx';
8
+ import { useCallback, useEffect, useMemo, useState } from 'react';
9
+ import { SelectBoxUI } from "../../atoms";
10
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
+ var InputSelectbox = function InputSelectbox(_ref) {
12
+ var id = _ref.id,
13
+ className = _ref.className,
14
+ options = _ref.options,
15
+ value = _ref.value,
16
+ onChange = _ref.onChange,
17
+ disabled = _ref.disabled,
18
+ placeholder = _ref.placeholder;
19
+ var _useState = useState(false),
20
+ _useState2 = _slicedToArray(_useState, 2),
21
+ isOpen = _useState2[0],
22
+ setIsOpen = _useState2[1];
23
+ var selectedOption = useMemo(function () {
24
+ return options.find(function (option) {
25
+ return option.value === value;
26
+ });
27
+ }, [options, value]);
28
+ var handleClickOpen = useCallback(function (e) {
29
+ if (disabled) {
30
+ return;
31
+ }
32
+ e.preventDefault();
33
+ e.stopPropagation();
34
+ setIsOpen(true);
35
+ }, [disabled, setIsOpen]);
36
+ useEffect(function () {
37
+ var handleClickOutside = function handleClickOutside(e) {
38
+ var isClickInside = e.target instanceof HTMLElement && (id ? e.target.closest('#' + id) : e.target.closest('.flexmatch-selectbox-container'));
39
+ if (!isClickInside) {
40
+ setIsOpen(false);
41
+ }
42
+ };
43
+ document.addEventListener('click', handleClickOutside);
44
+ return function () {
45
+ document.removeEventListener('click', handleClickOutside);
46
+ };
47
+ }, [id, setIsOpen]);
48
+ return /*#__PURE__*/_jsxs("div", {
49
+ id: id,
50
+ className: clsx(className, 'flexmatch-selectbox-container'),
51
+ children: [/*#__PURE__*/_jsxs(SelectBoxUI.Button, {
52
+ className: className,
53
+ onClick: handleClickOpen,
54
+ disabled: disabled,
55
+ children: [/*#__PURE__*/_jsx(SelectBoxUI.ItemText, {
56
+ className: clsx(!selectedOption && 'placeholder', disabled && 'disabled'),
57
+ children: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) || placeholder || '옵션을 선택해주세요'
58
+ }), /*#__PURE__*/_jsx(SelectBoxUI.Toggle, {
59
+ isOpen: isOpen
60
+ })]
61
+ }), isOpen && !disabled && /*#__PURE__*/_jsxs(SelectBoxUI.Menu, {
62
+ children: [/*#__PURE__*/_jsx(SelectBoxUI.ButtonOverlay, {
63
+ onClick: function onClick() {
64
+ return setIsOpen(false);
65
+ }
66
+ }), /*#__PURE__*/_jsx(SelectBoxUI.ItemBackground, {
67
+ children: options.map(function (option) {
68
+ return /*#__PURE__*/_jsx(SelectBoxUI.Item, {
69
+ disabled: option.disabled,
70
+ onClick: function onClick() {
71
+ onChange === null || onChange === void 0 || onChange(option.value);
72
+ setIsOpen(false);
73
+ },
74
+ children: /*#__PURE__*/_jsx(SelectBoxUI.ItemText, {
75
+ className: clsx(option.disabled && 'disabled'),
76
+ children: option.label
77
+ })
78
+ }, String(option.value));
79
+ })
80
+ })]
81
+ })]
82
+ });
83
+ };
84
+ InputSelectbox.displayName = 'InputSelectbox';
85
+ export default InputSelectbox;
@@ -0,0 +1,6 @@
1
+ interface ButtonUIProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
2
+ variant?: 'chip-add';
3
+ }
4
+ declare const ButtonUI: import("react").ForwardRefExoticComponent<ButtonUIProps & import("react").RefAttributes<HTMLButtonElement>>;
5
+ export default ButtonUI;
6
+ //# sourceMappingURL=button.ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/button.ui.tsx"],"names":[],"mappings":"AAGA,UAAU,aAAc,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC;IAC3E,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB;AAED,QAAA,MAAM,QAAQ,6GAeZ,CAAC;AAGH,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,24 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["className"];
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
10
+ import clsx from 'clsx';
11
+ import { forwardRef } from 'react';
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ var ButtonUI = /*#__PURE__*/forwardRef(function (_ref, ref) {
14
+ var className = _ref.className,
15
+ props = _objectWithoutProperties(_ref, _excluded);
16
+ return /*#__PURE__*/_jsx("button", _objectSpread(_objectSpread({
17
+ ref: ref
18
+ }, props), {}, {
19
+ className: clsx(className, 'flexmatch-btn', props.disabled && 'disabled', props.variant === 'chip-add' && 'flexmatch-btn-chip-add'),
20
+ children: props.children
21
+ }));
22
+ });
23
+ ButtonUI.displayName = 'ButtonUI';
24
+ export default ButtonUI;
@@ -0,0 +1,14 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const CardSelectContainerUI: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const CardSelectIconUI: ({ children, className, ...props }: HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
4
+ interface CardSelectContentUIProps extends HTMLAttributes<HTMLDivElement> {
5
+ title?: string;
6
+ description?: string;
7
+ }
8
+ export declare const CardSelectContentUI: ({ className, title, description, ...props }: CardSelectContentUIProps) => import("react/jsx-runtime").JSX.Element;
9
+ interface CardSelectContentButtonUIProps extends HTMLAttributes<HTMLDivElement> {
10
+ isSelected?: boolean;
11
+ }
12
+ export declare const CardSelectContentButtonUI: ({ isSelected, className, ...props }: CardSelectContentButtonUIProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
14
+ //# sourceMappingURL=card-select.ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card-select.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/card-select.ui.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAIvC,eAAO,MAAM,qBAAqB,GAAI,mCAInC,cAAc,CAAC,cAAc,CAAC,4CAMhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAI,mCAI9B,cAAc,CAAC,cAAc,CAAC,4CAMhC,CAAC;AACF,UAAU,wBAAyB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACvE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AACD,eAAO,MAAM,mBAAmB,GAAI,6CAKjC,wBAAwB,4CAW1B,CAAC;AACF,UAAU,8BAA+B,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC7E,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AACD,eAAO,MAAM,yBAAyB,GAAI,qCAIvC,8BAA8B,4CAShC,CAAC"}
@@ -0,0 +1,65 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["children", "className"],
3
+ _excluded2 = ["children", "className"],
4
+ _excluded3 = ["className", "title", "description"],
5
+ _excluded4 = ["isSelected", "className"];
6
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
7
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
8
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
12
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
13
+ import clsx from 'clsx';
14
+ import { IconCheck } from "../../assets";
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ export var CardSelectContainerUI = function CardSelectContainerUI(_ref) {
17
+ var children = _ref.children,
18
+ className = _ref.className,
19
+ props = _objectWithoutProperties(_ref, _excluded);
20
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
21
+ className: clsx('flexmatch-card-select-button-container', className)
22
+ }, props), {}, {
23
+ children: children
24
+ }));
25
+ };
26
+ export var CardSelectIconUI = function CardSelectIconUI(_ref2) {
27
+ var children = _ref2.children,
28
+ className = _ref2.className,
29
+ props = _objectWithoutProperties(_ref2, _excluded2);
30
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
31
+ className: clsx('flexmatch-card-select-button-icon', className)
32
+ }, props), {}, {
33
+ children: children
34
+ }));
35
+ };
36
+ export var CardSelectContentUI = function CardSelectContentUI(_ref3) {
37
+ var className = _ref3.className,
38
+ title = _ref3.title,
39
+ description = _ref3.description,
40
+ props = _objectWithoutProperties(_ref3, _excluded3);
41
+ return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
42
+ className: clsx('flexmatch-card-select-button-content', className)
43
+ }, props), {}, {
44
+ children: [title && /*#__PURE__*/_jsx("div", {
45
+ className: "flexmatch-card-select-button-content-title text-b2-l",
46
+ children: title
47
+ }), description && /*#__PURE__*/_jsx("div", {
48
+ className: "flexmatch-card-select-button-content-description text-caption",
49
+ children: description
50
+ })]
51
+ }));
52
+ };
53
+ export var CardSelectContentButtonUI = function CardSelectContentButtonUI(_ref4) {
54
+ var isSelected = _ref4.isSelected,
55
+ className = _ref4.className,
56
+ props = _objectWithoutProperties(_ref4, _excluded4);
57
+ return /*#__PURE__*/_jsx("div", _objectSpread(_objectSpread({
58
+ className: clsx('flexmatch-card-select-button-check', isSelected && 'active', className)
59
+ }, props), {}, {
60
+ children: isSelected && /*#__PURE__*/_jsx(IconCheck, {
61
+ color: "var(--color-gray-900)",
62
+ size: 12
63
+ })
64
+ }));
65
+ };
@@ -0,0 +1,9 @@
1
+ interface CheckboxUIProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'> {
2
+ onChange?: (checked: boolean) => void;
3
+ label?: string;
4
+ required?: boolean;
5
+ size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
6
+ }
7
+ declare const CheckboxUI: import("react").ForwardRefExoticComponent<CheckboxUIProps & import("react").RefAttributes<HTMLInputElement>>;
8
+ export default CheckboxUI;
9
+ //# sourceMappingURL=checkbox.ui.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkbox.ui.d.ts","sourceRoot":"","sources":["../../../src/components/atoms/checkbox.ui.tsx"],"names":[],"mappings":"AAKA,UAAU,eAAgB,SAAQ,IAAI,CACpC,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAC3C,UAAU,GAAG,MAAM,CACpB;IACC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;CACzC;AA8BD,QAAA,MAAM,UAAU,8GAiCf,CAAC;AAEF,eAAe,UAAU,CAAC"}