softable-pixels-web 1.1.15 → 1.1.17

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 (99) hide show
  1. package/dist/BasePopover-DOi9H3B4.js +49 -0
  2. package/dist/BasePopover-DOi9H3B4.js.map +1 -0
  3. package/dist/{Button-DOEMYhEA.js → Button-A1POxp3L.js} +3 -3
  4. package/dist/{Button-DOEMYhEA.js.map → Button-A1POxp3L.js.map} +1 -1
  5. package/dist/{CheckItem-Cnw5hlwV.js → CheckItem-CJqWCE1W.js} +4 -4
  6. package/dist/{CheckItem-Cnw5hlwV.js.map → CheckItem-CJqWCE1W.js.map} +1 -1
  7. package/dist/{Checkbox-DaRHUBSb.js → Checkbox-j9ZnSxT7.js} +4 -4
  8. package/dist/{Checkbox-DaRHUBSb.js.map → Checkbox-j9ZnSxT7.js.map} +1 -1
  9. package/dist/{ContextMenu-CPjeo0m1.js → ContextMenu-l9GdmRqh.js} +7 -8
  10. package/dist/{ContextMenu-CPjeo0m1.js.map → ContextMenu-l9GdmRqh.js.map} +1 -1
  11. package/dist/{Icon-kjpHbCbF.js → Icon-KzwFJI_k.js} +2 -2
  12. package/dist/{Icon-kjpHbCbF.js.map → Icon-KzwFJI_k.js.map} +1 -1
  13. package/dist/{IconButton-DZjuxp2Q.js → IconButton-CH8DZizu.js} +2 -2
  14. package/dist/{IconButton-DZjuxp2Q.js.map → IconButton-CH8DZizu.js.map} +1 -1
  15. package/dist/{InfoSummary-C7mxow-z.js → InfoSummary-Cf2ein9V.js} +3 -3
  16. package/dist/{InfoSummary-C7mxow-z.js.map → InfoSummary-Cf2ein9V.js.map} +1 -1
  17. package/dist/{Input-B0J7yEux.js → Input-FFQ1J5SC.js} +4 -4
  18. package/dist/Input-FFQ1J5SC.js.map +1 -0
  19. package/dist/{Label-BVkidQlv.js → Label-C5AIUqYV.js} +3 -3
  20. package/dist/Label-C5AIUqYV.js.map +1 -0
  21. package/dist/{Popover-DI9wSxIa.js → Popover-B6DCtCvD.js} +56 -27
  22. package/dist/Popover-B6DCtCvD.js.map +1 -0
  23. package/dist/{Select-R22kJLFr.js → Select-DtU_3TOA.js} +57 -59
  24. package/dist/Select-DtU_3TOA.js.map +1 -0
  25. package/dist/{Switch-ZmanGt2r.js → Switch-DJNZbvzy.js} +2 -2
  26. package/dist/{Switch-ZmanGt2r.js.map → Switch-DJNZbvzy.js.map} +1 -1
  27. package/dist/{TabSwitch-2WIjQ2Ie.js → TabSwitch-DlXdgLPc.js} +3 -3
  28. package/dist/{TabSwitch-2WIjQ2Ie.js.map → TabSwitch-DlXdgLPc.js.map} +1 -1
  29. package/dist/{TextArea-DGCFyZrW.js → TextArea-DY7hxFbx.js} +5 -5
  30. package/dist/TextArea-DY7hxFbx.js.map +1 -0
  31. package/dist/{ThemeContext-bVaozqut.js → ThemeContext-DhXvmWKO.js} +1 -1
  32. package/dist/{ThemeContext-bVaozqut.js.map → ThemeContext-DhXvmWKO.js.map} +1 -1
  33. package/dist/{Typography-CHkdzH2K.js → Typography-BkFV7BhK.js} +2 -2
  34. package/dist/{Typography-CHkdzH2K.js.map → Typography-BkFV7BhK.js.map} +1 -1
  35. package/dist/base-popover.d.ts +3 -0
  36. package/dist/base-popover.js +7 -0
  37. package/dist/button.d.ts +2 -2
  38. package/dist/button.js +3 -3
  39. package/dist/check-item.d.ts +1 -1
  40. package/dist/check-item.js +4 -4
  41. package/dist/checkbox.d.ts +2 -2
  42. package/dist/checkbox.js +4 -4
  43. package/dist/chunk-SwsWFa5-.js +18 -0
  44. package/dist/context-menu.d.ts +2 -2
  45. package/dist/context-menu.js +8 -8
  46. package/dist/icon-button.d.ts +1 -1
  47. package/dist/icon-button.js +2 -2
  48. package/dist/{index-ZGo_xs-Q.d.ts → index-B1QUSkjv.d.ts} +3 -3
  49. package/dist/{index-liMvHPFh.d.ts → index-B1ejLAYY.d.ts} +4 -6
  50. package/dist/{index-CM9BXEm3.d.ts → index-BWV7SXNm.d.ts} +1 -1
  51. package/dist/{index--Oqbm-1T.d.ts → index-B_Soaf4t.d.ts} +2 -2
  52. package/dist/{index-DDvfWEcX.d.ts → index-BszVk1Tx.d.ts} +1 -1
  53. package/dist/{index-CQWwox_y.d.ts → index-CNn6Rkw1.d.ts} +19 -9
  54. package/dist/index-CdNWNIsY.d.ts +17 -0
  55. package/dist/{index-Bw_XZiTz.d.ts → index-DZE-RE4B.d.ts} +1 -1
  56. package/dist/{index-CvSwNc4e.d.ts → index-DpH49YA0.d.ts} +4 -4
  57. package/dist/{index-Rsf19S6N.d.ts → index-Dud1UL9T.d.ts} +7 -23
  58. package/dist/{index-Cz1S_fwn.d.ts → index-E0ifwXgE.d.ts} +4 -4
  59. package/dist/{index-jLN0CEbk.d.ts → index-QQdIoKht.d.ts} +2 -2
  60. package/dist/{index-BLvNLvv2.d.ts → index-fjoAYF43.d.ts} +1 -1
  61. package/dist/index.d.ts +15 -14
  62. package/dist/index.js +21 -20
  63. package/dist/info-summary.js +3 -3
  64. package/dist/input.d.ts +1 -1
  65. package/dist/input.js +5 -5
  66. package/dist/popover.d.ts +2 -2
  67. package/dist/popover.js +5 -5
  68. package/dist/select.d.ts +2 -2
  69. package/dist/select.js +10 -6
  70. package/dist/{styleProps-DEmfU40p.d.ts → styleProps-B2pBEf9N.d.ts} +2 -1
  71. package/dist/switch.d.ts +1 -1
  72. package/dist/switch.js +2 -2
  73. package/dist/tab-switch.d.ts +1 -1
  74. package/dist/tab-switch.js +3 -3
  75. package/dist/text-area.d.ts +2 -2
  76. package/dist/text-area.js +5 -5
  77. package/dist/theme-context.d.ts +1 -1
  78. package/dist/theme-context.js +1 -1
  79. package/dist/{types-0c2OAbj2.d.ts → types-Ck6jQYTO.d.ts} +3 -3
  80. package/dist/{types-CGI_6rDa.d.ts → types-V8tEaVpX.d.ts} +1 -1
  81. package/dist/typography.d.ts +1 -1
  82. package/dist/typography.js +2 -2
  83. package/dist/use-dismiss.js +1 -1
  84. package/dist/use-floating.d.ts +1 -1
  85. package/dist/use-floating.js +1 -1
  86. package/dist/{useDismiss-o9kMS5dK.js → useDismiss-CAEk_GV-.js} +1 -1
  87. package/dist/{useDismiss-o9kMS5dK.js.map → useDismiss-CAEk_GV-.js.map} +1 -1
  88. package/dist/{useFloating-DMJ2SdMi.js → useFloating-cvZUo5wI.js} +1 -1
  89. package/dist/{useFloating-DMJ2SdMi.js.map → useFloating-cvZUo5wI.js.map} +1 -1
  90. package/dist/{useThemedStyles-gOkfhYkd.d.ts → useThemedStyles-C23Tevdv.d.ts} +1 -1
  91. package/dist/{useThemedStyles-D4si38PM.js → useThemedStyles-CrarDyWc.js} +2 -1
  92. package/dist/useThemedStyles-CrarDyWc.js.map +1 -0
  93. package/package.json +8 -1
  94. package/dist/Input-B0J7yEux.js.map +0 -1
  95. package/dist/Label-BVkidQlv.js.map +0 -1
  96. package/dist/Popover-DI9wSxIa.js.map +0 -1
  97. package/dist/Select-R22kJLFr.js.map +0 -1
  98. package/dist/TextArea-DGCFyZrW.js.map +0 -1
  99. package/dist/useThemedStyles-D4si38PM.js.map +0 -1
@@ -1,6 +1,6 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-D4si38PM.js";
2
- import { t as Icon } from "./Icon-kjpHbCbF.js";
3
- import { t as Label } from "./Label-BVkidQlv.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
2
+ import { t as Icon } from "./Icon-KzwFJI_k.js";
3
+ import { t as Label } from "./Label-C5AIUqYV.js";
4
4
  import { forwardRef, useId, useImperativeHandle, useMemo, useRef, useState } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
 
@@ -174,4 +174,4 @@ Input.displayName = "Input";
174
174
 
175
175
  //#endregion
176
176
  export { Input as t };
177
- //# sourceMappingURL=Input-B0J7yEux.js.map
177
+ //# sourceMappingURL=Input-FFQ1J5SC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input-FFQ1J5SC.js","names":[],"sources":["../src/components/commons/inputs/Input/hooks/useInput/index.ts","../src/components/commons/inputs/Input/styles.ts","../src/components/commons/inputs/Input/index.tsx"],"sourcesContent":["// External Libraries\nimport { useState, useRef } from 'react'\n\n// Types\nimport type { InputProps } from '../../types'\n\nexport function useInput({ onChange }: InputProps) {\n // Refs\n const inputRef = useRef<HTMLInputElement>(null)\n\n // States\n const [showPassword, setShowPassword] = useState(false)\n\n // Functions\n function togglePasswordVisibility() {\n setShowPassword(prev => !prev)\n }\n\n function handleRefMethods() {\n return { focus: handleFocus, blur: handleBlur }\n }\n\n function handleFocus() {\n inputRef.current?.focus()\n }\n\n function handleBlur() {\n inputRef.current?.blur()\n }\n\n function handleChange(e: React.ChangeEvent<HTMLInputElement>) {\n const value = e.target.value\n onChange?.(value)\n }\n\n return {\n inputRef,\n showPassword,\n handleChange,\n handleRefMethods,\n togglePasswordVisibility\n }\n}\n","// Hooks\nimport { styled } from '@hooks/useThemedStyles/types'\n\n// Types\nimport type { InputProps } from './types'\n\nexport function createInputStyles(props: InputProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n wrapper: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n opacity: props.disabled ? 0.5 : 1,\n boxShadow: 'var(--px-shadow-default)',\n borderColor: props.errorMessage\n ? 'var(--px-color-error)'\n : 'var(--px-border-primary)',\n\n __rules: {\n '&:focus-within': {\n outlineOffset: '-1px',\n outline: `2px solid var(${props.errorMessage ? '--px-color-error' : '--px-color-primary'})`\n }\n }\n },\n\n input: {\n flex: 1,\n\n fontWeight: 500,\n fontSize: '1rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n\n __rules: {\n '&:disabled': {\n cursor: 'not-allowed'\n },\n\n '&:focus': {\n outline: 'none'\n },\n\n '&::placeholder': {\n fontWeight: 400,\n color: 'var(--px-text-secondary)'\n }\n }\n },\n\n error: {\n display: 'block',\n fontWeight: 400,\n lineHeight: '1rem',\n fontSize: '0.75rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-error)'\n },\n\n button: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n cursor: 'pointer',\n padding: '0.25rem',\n borderRadius: '0.5rem',\n\n __rules: {\n '&:focus': {\n outline: '1px solid var(--px-border-primary)'\n }\n }\n }\n })\n}\n","// External Libraries\nimport { forwardRef, useId, useImperativeHandle, useMemo } from 'react'\n\n// Components\nimport { Label } from '../../toolkit/Label'\nimport { Icon } from '@components/commons/toolkit/Icon'\n\n// Types\nimport type { InputProps, InputMethods } from './types'\n\n// Hooks\nimport { useInput } from './hooks/useInput'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createInputStyles } from './styles'\n\nexport const Input = forwardRef<InputMethods, InputProps>((props, ref) => {\n // Constants\n const reactId = useId()\n const inputId = useMemo(() => {\n return props.id || `input-${reactId}`\n }, [props.id, reactId])\n\n // Hooks\n const {\n inputRef,\n showPassword,\n handleChange,\n handleRefMethods,\n togglePasswordVisibility\n } = useInput(props)\n useImperativeHandle(ref, handleRefMethods)\n\n // Hooks\n const { styles, classes } = useThemedStyles(props, createInputStyles, {\n pick: p => [p.disabled, p.errorMessage],\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n // Functions\n function getType() {\n if (props.type === 'password' && showPassword) return 'text'\n return props.type\n }\n\n function renderEndContent() {\n if (props.type === 'password') {\n return (\n <button\n type=\"button\"\n style={styles.button}\n className={classes.button}\n onClick={togglePasswordVisibility}\n >\n <Icon\n size=\"sm\"\n name={showPassword ? 'general-eye-off' : 'general-eye'}\n />\n </button>\n )\n }\n\n return props.endIcon ?? null\n }\n\n return (\n <div style={styles.container}>\n {props.hideLabel ? null : (\n <Label\n htmlFor={inputId}\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n )}\n\n <div style={styles.wrapper} className={classes.wrapper}>\n {props.startIcon}\n\n <input\n ref={inputRef}\n id={inputId}\n type={getType()}\n value={props.value}\n style={styles.input}\n required={props.required}\n disabled={props.disabled}\n className={classes.input}\n minLength={props.minLength}\n maxLength={props.maxLength}\n placeholder={props.placeholder}\n aria-label={!props.hideLabel ? undefined : props.label}\n onChange={handleChange}\n />\n\n {renderEndContent()}\n </div>\n\n {props.errorMessage ? (\n <span style={styles.error}>{props.errorMessage}</span>\n ) : null}\n </div>\n )\n})\n\nInput.displayName = 'Input'\n"],"mappings":";;;;;;;AAMA,SAAgB,SAAS,EAAE,YAAwB;CAEjD,MAAM,WAAW,OAAyB,KAAK;CAG/C,MAAM,CAAC,cAAc,mBAAmB,SAAS,MAAM;CAGvD,SAAS,2BAA2B;AAClC,mBAAgB,SAAQ,CAAC,KAAK;;CAGhC,SAAS,mBAAmB;AAC1B,SAAO;GAAE,OAAO;GAAa,MAAM;GAAY;;CAGjD,SAAS,cAAc;AACrB,WAAS,SAAS,OAAO;;CAG3B,SAAS,aAAa;AACpB,WAAS,SAAS,MAAM;;CAG1B,SAAS,aAAa,GAAwC;EAC5D,MAAM,QAAQ,EAAE,OAAO;AACvB,aAAW,MAAM;;AAGnB,QAAO;EACL;EACA;EACA;EACA;EACA;EACD;;;;;ACnCH,SAAgB,kBAAkB,OAAmB;AACnD,QAAO,OAAO;EACZ,WAAW;GACT,OAAO;GAEP,SAAS;GACT,eAAe;GAEf,QAAQ;GACT;EACD,SAAS;GACP,OAAO;GACP,SAAS;GACT,YAAY;GAEZ,aAAa;GACb,WAAW;GACX,cAAc;GACd,SAAS;GAET,SAAS,MAAM,WAAW,KAAM;GAChC,WAAW;GACX,aAAa,MAAM,eACf,0BACA;GAEJ,SAAS,EACP,kBAAkB;IAChB,eAAe;IACf,SAAS,iBAAiB,MAAM,eAAe,qBAAqB,qBAAqB;IAC1F,EACF;GACF;EAED,OAAO;GACL,MAAM;GAEN,Y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,GAAI,MAAM;KACV;GAGJ,qBAAC;IAAI,OAAO,OAAO;IAAS,WAAW,QAAQ;;KAC5C,MAAM;KAEP,oBAAC;MACC,KAAK;MACL,IAAI;MACJ,MAAM,SAAS;MACf,OAAO,MAAM;MACb,OAAO,OAAO;MACd,UAAU,MAAM;MAChB,UAAU,MAAM;MAChB,WAAW,QAAQ;MACnB,WAAW,MAAM;MACjB,WAAW,MAAM;MACjB,aAAa,MAAM;MACnB,cAAY,CAAC,MAAM,YAAY,SAAY,MAAM;MACjD,UAAU;OACV;KAED,kBAAkB;;KACf;GAEL,MAAM,eACL,oBAAC;IAAK,OAAO,OAAO;cAAQ,MAAM;KAAoB,GACpD;;GACA;EAER;AAEF,MAAM,cAAc"}
@@ -1,7 +1,7 @@
1
- import { t as Typography } from "./Typography-CHkdzH2K.js";
1
+ import { t as Typography } from "./Typography-BkFV7BhK.js";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
 
4
- //#region src/components/commons/Label/index.tsx
4
+ //#region src/components/commons/toolkit/Label/index.tsx
5
5
  const Label = (props) => {
6
6
  const { label, color, htmlFor, required, requiredColor, variant = "b2", ...rest } = props;
7
7
  return /* @__PURE__ */ jsx("label", {
@@ -22,4 +22,4 @@ const Label = (props) => {
22
22
 
23
23
  //#endregion
24
24
  export { Label as t };
25
- //# sourceMappingURL=Label-BVkidQlv.js.map
25
+ //# sourceMappingURL=Label-C5AIUqYV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Label-C5AIUqYV.js","names":["Label: React.FC<LabelProps>"],"sources":["../src/components/commons/toolkit/Label/index.tsx"],"sourcesContent":["// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Types\nimport type { LabelProps } from './types'\n\nexport const Label: React.FC<LabelProps> = props => {\n const {\n label,\n color,\n htmlFor,\n required,\n requiredColor,\n variant = 'b2',\n ...rest\n } = props\n\n return (\n <label htmlFor={htmlFor}>\n <Typography\n variant={variant}\n color={color ?? 'var(px-text-primary)'}\n {...rest}\n >\n {label}\n\n {required ? (\n <Typography\n as=\"span\"\n variant=\"b2\"\n color={requiredColor ?? 'var(--px-text-error)'}\n >\n {' '}\n *\n </Typography>\n ) : null}\n </Typography>\n </label>\n )\n}\n"],"mappings":";;;;AAMA,MAAaA,SAA8B,UAAS;CAClD,MAAM,EACJ,OACA,OACA,SACA,UACA,eACA,UAAU,MACV,GAAG,SACD;AAEJ,QACE,oBAAC;EAAe;YACd,qBAAC;GACU;GACT,OAAO,SAAS;GAChB,GAAI;cAEH,OAEA,WACC,qBAAC;IACC,IAAG;IACH,SAAQ;IACR,OAAO,iBAAiB;eAEvB,KAAI;KAEM,GACX;IACO;GACP"}
@@ -1,43 +1,54 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-D4si38PM.js";
2
- import { t as useDismiss } from "./useDismiss-o9kMS5dK.js";
3
- import { t as useFloating } from "./useFloating-DMJ2SdMi.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
2
+ import { t as useDismiss } from "./useDismiss-CAEk_GV-.js";
3
+ import { t as useFloating } from "./useFloating-cvZUo5wI.js";
4
4
  import { useCallback, useEffect, useRef, useState } from "react";
5
5
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
6
  import { createPortal } from "react-dom";
7
7
 
8
8
  //#region src/components/commons/toolkit/Popover/styles.ts
9
- function createPopoverStyles(_props) {
10
- return styled({ popoverNode: {
11
- position: "fixed",
12
- left: 0,
13
- top: 0,
14
- zIndex: 10,
15
- padding: "0.25rem",
16
- boxShadow: "var(--px-ring-1)",
17
- backgroundColor: "var(--px-bg)",
18
- borderRadius: "var(--px-radius-xl)"
19
- } });
9
+ function createPopoverStyles({ hideShadow = false }) {
10
+ return styled({
11
+ popoverNode: {
12
+ position: "fixed",
13
+ left: 0,
14
+ top: 0,
15
+ zIndex: 10,
16
+ padding: "0.25rem",
17
+ backgroundColor: "var(--px-bg)",
18
+ boxShadow: hideShadow ? "none" : "var(--px-ring-1)",
19
+ borderRadius: "var(--px-radius-xl)"
20
+ },
21
+ trigger: {
22
+ width: "fit-content",
23
+ height: "fit-content"
24
+ }
25
+ });
20
26
  }
21
27
 
28
+ //#endregion
29
+ //#region src/components/commons/toolkit/Popover/types.ts
30
+ var types_exports = {};
31
+
22
32
  //#endregion
23
33
  //#region src/components/commons/toolkit/Popover/index.tsx
24
34
  const Popover = (props) => {
25
35
  const { anchorRef, floatingOptions, closeOnEscape = true, open: controlledOpen, closeOnOutsideClick = true, trigger, content, onOpenChange, onMouseEnter, onMouseLeave } = props;
36
+ const triggerRef = useRef(null);
37
+ const popoverRef = useRef(null);
38
+ const resolvedAnchorRef = anchorRef ?? triggerRef;
26
39
  const [uncontrolledOpen, setUncontrolledOpen] = useState(false);
40
+ const [widthTrigger, setWidthTrigger] = useState(triggerRef.current?.offsetWidth ?? 0);
27
41
  const open = controlledOpen ?? uncontrolledOpen;
28
42
  const { styles } = useThemedStyles(props, createPopoverStyles, {
29
43
  applyCommonProps: true,
30
44
  override: props.styles,
31
- pick: (p) => [p.open, p.content]
45
+ commonSlot: "popoverNode",
46
+ pick: (p) => [
47
+ p.open,
48
+ p.content,
49
+ p.trigger
50
+ ]
32
51
  });
33
- function setOpen(v) {
34
- onOpenChange?.(v);
35
- if (controlledOpen === void 0) setUncontrolledOpen(v);
36
- }
37
- const close = useCallback(() => setOpen(false), [setOpen]);
38
- const triggerRef = useRef(null);
39
- const resolvedAnchorRef = anchorRef ?? triggerRef;
40
- const popoverRef = useRef(null);
41
52
  const { floatingRef, update } = useFloating(resolvedAnchorRef, {
42
53
  offsetY: 6,
43
54
  strategy: "fixed",
@@ -45,6 +56,11 @@ const Popover = (props) => {
45
56
  placement: "bottom-start",
46
57
  ...floatingOptions
47
58
  });
59
+ function setOpen(v) {
60
+ onOpenChange?.(v);
61
+ if (controlledOpen === void 0) setUncontrolledOpen(v);
62
+ }
63
+ const close = useCallback(() => setOpen(false), [setOpen]);
48
64
  useDismiss({
49
65
  open,
50
66
  closeOnEscape,
@@ -54,9 +70,19 @@ const Popover = (props) => {
54
70
  });
55
71
  useEffect(() => {
56
72
  if (open) requestAnimationFrame(update);
73
+ setWidthTrigger(triggerRef.current?.offsetWidth ?? 0);
57
74
  }, [open, update]);
75
+ useEffect(() => {
76
+ const handleResize = () => {
77
+ setWidthTrigger(triggerRef.current?.offsetWidth ?? 0);
78
+ };
79
+ window.addEventListener("resize", handleResize);
80
+ return () => {
81
+ window.removeEventListener("resize", handleResize);
82
+ };
83
+ }, []);
58
84
  const triggerNode = trigger?.({
59
- "aria-expanded": open,
85
+ ariaExpanded: open,
60
86
  ref: triggerRef,
61
87
  onClick: () => setOpen(!open)
62
88
  }) ?? null;
@@ -71,11 +97,14 @@ const Popover = (props) => {
71
97
  onMouseLeave,
72
98
  onMouseDownCapture: (e) => e.stopPropagation(),
73
99
  onPointerDownCapture: (e) => e.stopPropagation(),
74
- children: content({ close })
100
+ children: content({
101
+ close,
102
+ widthTrigger
103
+ })
75
104
  }) : null;
76
105
  return /* @__PURE__ */ jsxs(Fragment, { children: [triggerNode, typeof document !== "undefined" ? createPortal(popoverNode, document.body) : null] });
77
106
  };
78
107
 
79
108
  //#endregion
80
- export { Popover as t };
81
- //# sourceMappingURL=Popover-DI9wSxIa.js.map
109
+ export { types_exports as n, Popover as t };
110
+ //# sourceMappingURL=Popover-B6DCtCvD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Popover-B6DCtCvD.js","names":["Popover: React.FC<PopoverProps>"],"sources":["../src/components/commons/toolkit/Popover/styles.ts","../src/components/commons/toolkit/Popover/types.ts","../src/components/commons/toolkit/Popover/index.tsx"],"sourcesContent":["// Types\nimport type { PopoverProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createPopoverStyles({ hideShadow = false }: PopoverProps) {\n return styled({\n popoverNode: {\n position: 'fixed',\n left: 0,\n top: 0,\n\n zIndex: 10,\n\n padding: '0.25rem',\n\n backgroundColor: 'var(--px-bg)',\n boxShadow: hideShadow ? 'none' : 'var(--px-ring-1)',\n\n borderRadius: 'var(--px-radius-xl)'\n },\n\n trigger: {\n width: 'fit-content',\n height: 'fit-content'\n }\n })\n}\n","// External Libraries\nimport type { MouseEventHandler, ReactNode, RefObject } from 'react'\n\n// Types\nimport type { createPopoverStyles } from './styles'\nimport type { FloatingOptions } from '@hooks/useFloating/types'\nimport type { PaddingProps } from '@hooks/useThemedStyles/types'\n\nexport type PopoverTriggerRenderProps = {\n ariaExpanded: boolean\n ref: RefObject<HTMLElement>\n onClick: () => void\n}\n\nexport interface PopoverProps extends PaddingProps {\n open?: boolean\n hideShadow?: boolean\n closeOnEscape?: boolean\n closeOnOutsideClick?: boolean\n floatingOptions?: FloatingOptions\n anchorRef?: RefObject<HTMLElement>\n\n onOpenChange?: (v: boolean) => void\n onMouseEnter?: MouseEventHandler<HTMLDivElement>\n onMouseLeave?: MouseEventHandler<HTMLDivElement>\n content: (ctx: { close: () => void; widthTrigger: number }) => ReactNode\n trigger?: (props: PopoverTriggerRenderProps) => ReactNode\n\n styles?: Partial<ReturnType<typeof createPopoverStyles>>\n}\n","// External Libraries\n/** biome-ignore-all lint/suspicious/noExplicitAny: <Not needed> */\n/** biome-ignore-all lint/correctness/useExhaustiveDependencies: <Not needed> */\nimport type React from 'react'\nimport { createPortal } from 'react-dom'\nimport { useCallback, useEffect, useRef, useState } from 'react'\n\n// Hooks\nimport { useDismiss } from '@hooks/useDismiss'\nimport { useFloating } from '@hooks/useFloating'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { PopoverProps } from './types'\n\n// Styles\nimport { createPopoverStyles } from './styles'\n\nexport * as PopoverTypes from './types'\n\nexport const Popover: React.FC<PopoverProps> = props => {\n const {\n anchorRef,\n floatingOptions,\n closeOnEscape = true,\n open: controlledOpen,\n closeOnOutsideClick = true,\n trigger,\n content,\n onOpenChange,\n onMouseEnter,\n onMouseLeave\n } = props\n\n // Refs\n const triggerRef = useRef<HTMLElement | null>(null)\n const popoverRef = useRef<HTMLDivElement | null>(null)\n const resolvedAnchorRef = (anchorRef ?? triggerRef) as any\n\n // States\n const [uncontrolledOpen, setUncontrolledOpen] = useState(false)\n const [widthTrigger, setWidthTrigger] = useState(\n triggerRef.current?.offsetWidth ?? 0\n )\n\n const open = controlledOpen ?? uncontrolledOpen\n\n // Hooks\n const { styles } = useThemedStyles(props, createPopoverStyles, {\n applyCommonProps: true,\n override: props.styles,\n commonSlot: 'popoverNode',\n pick: p => [p.open, p.content, p.trigger]\n })\n\n const { floatingRef, update } = useFloating(resolvedAnchorRef, {\n offsetY: 6,\n strategy: 'fixed',\n keepInViewport: true,\n placement: 'bottom-start',\n ...floatingOptions\n })\n\n // Functions\n function setOpen(v: boolean) {\n onOpenChange?.(v)\n if (controlledOpen === undefined) setUncontrolledOpen(v)\n }\n\n const close = useCallback(() => setOpen(false), [setOpen])\n\n useDismiss({\n open,\n closeOnEscape,\n closeOnOutsideClick,\n refs: [resolvedAnchorRef, popoverRef],\n onClose: close\n })\n\n // UseEffects\n useEffect(() => {\n if (open) requestAnimationFrame(update)\n\n setWidthTrigger(triggerRef.current?.offsetWidth ?? 0)\n }, [open, update])\n\n useEffect(() => {\n const handleResize = () => {\n setWidthTrigger(triggerRef.current?.offsetWidth ?? 0)\n }\n\n window.addEventListener('resize', handleResize)\n\n return () => {\n window.removeEventListener('resize', handleResize)\n }\n }, [])\n\n const triggerNode =\n trigger?.({\n ariaExpanded: open,\n ref: triggerRef as any,\n onClick: () => setOpen(!open)\n }) ?? null\n\n const popoverNode = open ? (\n <div\n ref={el => {\n popoverRef.current = el\n floatingRef(el)\n }}\n role=\"dialog\"\n style={styles.popoverNode}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n onMouseDownCapture={e => e.stopPropagation()}\n onPointerDownCapture={e => e.stopPropagation()}\n >\n {content({ close, widthTrigger })}\n </div>\n ) : null\n\n return (\n <>\n {triggerNode}\n {typeof document !== 'undefined'\n ? createPortal(popo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S,eAAe,EAAE;IACpD,CAAC,MAAM,OAAO,CAAC;AAElB,iBAAgB;EACd,MAAM,qBAAqB;AACzB,mBAAgB,WAAW,SAAS,eAAe,EAAE;;AAGvD,SAAO,iBAAiB,UAAU,aAAa;AAE/C,eAAa;AACX,UAAO,oBAAoB,UAAU,aAAa;;IAEnD,EAAE,CAAC;CAEN,MAAM,cACJ,UAAU;EACR,cAAc;EACd,KAAK;EACL,eAAe,QAAQ,CAAC,KAAK;EAC9B,CAAC,IAAI;CAER,MAAM,cAAc,OAClB,oBAAC;EACC,MAAK,OAAM;AACT,cAAW,UAAU;AACrB,eAAY,GAAG;;EAEjB,MAAK;EACL,OAAO,OAAO;EACA;EACA;EACd,qBAAoB,MAAK,EAAE,iBAAiB;EAC5C,uBAAsB,MAAK,EAAE,iBAAiB;YAE7C,QAAQ;GAAE;GAAO;GAAc,CAAC;GAC7B,GACJ;AAEJ,QACE,4CACG,aACA,OAAO,aAAa,cACjB,aAAa,aAAa,SAAS,KAAK,GACxC,QACH"}
@@ -1,11 +1,12 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-D4si38PM.js";
2
- import { t as Icon } from "./Icon-kjpHbCbF.js";
3
- import { t as Label } from "./Label-BVkidQlv.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
2
+ import { t as Icon } from "./Icon-KzwFJI_k.js";
3
+ import { t as Label } from "./Label-C5AIUqYV.js";
4
+ import { t as BasePopover } from "./BasePopover-DOi9H3B4.js";
4
5
  import { useMemo, useState } from "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
 
7
8
  //#region src/components/commons/inputs/Select/components/OptionItem/styles.ts
8
- function createOptionsStyles(_props) {
9
+ function createOptionsStyles({ isSelected }) {
9
10
  return styled({
10
11
  container: {
11
12
  width: "100%",
@@ -16,8 +17,9 @@ function createOptionsStyles(_props) {
16
17
  padding: "0.5rem 0.75rem",
17
18
  cursor: "pointer",
18
19
  transition: "background-color 0.2s ease-out",
20
+ backgroundColor: isSelected ? "var(--px-background-card-hover)" : "transparent",
19
21
  __rules: {
20
- "&:hover": { backgroundColor: "var(--px-background-card-hover)" },
22
+ "&:hover": { backgroundColor: "var(--px-background-card-hover) !important" },
21
23
  "&:focus": {
22
24
  outlineOffset: "-1px",
23
25
  outline: "2px solid var(--px-color-primary)"
@@ -102,7 +104,6 @@ function createSelectStyles(props) {
102
104
  display: "flex",
103
105
  flexDirection: "column",
104
106
  position: "relative",
105
- isolation: "isolate",
106
107
  rowGap: "0.375rem"
107
108
  },
108
109
  content: {
@@ -119,8 +120,8 @@ function createSelectStyles(props) {
119
120
  boxShadow: "var(--px-shadow-default)",
120
121
  borderColor: props.errorMessage ? "var(--px-color-error)" : "var(--px-border-primary)",
121
122
  __rules: { "&:focus-within": {
122
- outlineOffset: "-1px",
123
- outline: `2px solid var(${props.errorMessage ? "--px-color-error" : "--px-color-primary"})`
123
+ outlineOffset: "-1px !important",
124
+ outline: `2px solid var(${props.errorMessage ? "--px-color-error" : "--px-color-primary"}) !important`
124
125
  } }
125
126
  },
126
127
  text: {
@@ -143,28 +144,14 @@ function createSelectStyles(props) {
143
144
  fontFamily: "inherit",
144
145
  color: "var(--px-text-error)"
145
146
  },
146
- panel: {
147
- width: "100%",
148
- height: "12rem",
149
- display: "flex",
150
- flexDirection: "column",
151
- position: "absolute",
152
- top: "calc(100% + 0.25rem)",
153
- left: "0",
154
- zIndex: 10,
155
- overflowY: "auto",
156
- overscrollBehavior: "contain",
157
- borderWidth: 1,
158
- rowGap: "0.25rem",
159
- padding: "0.25rem",
160
- borderRadius: "0.5rem",
161
- backgroundColor: "var(--px-bg)",
162
- boxShadow: "var(--px-shadow-default)",
163
- borderColor: "var(--px-border-primary)"
164
- }
147
+ panel: { width: "100%" }
165
148
  });
166
149
  }
167
150
 
151
+ //#endregion
152
+ //#region src/components/commons/inputs/Select/types.ts
153
+ var types_exports = {};
154
+
168
155
  //#endregion
169
156
  //#region src/components/commons/inputs/Select/index.tsx
170
157
  const Select = (props) => {
@@ -190,6 +177,32 @@ const Select = (props) => {
190
177
  if (hiddenCount > 0) result += ` +${hiddenCount}`;
191
178
  return result;
192
179
  }
180
+ function renderTrigger({ ref, ariaExpanded, onClick }) {
181
+ return /* @__PURE__ */ jsxs("button", {
182
+ ref,
183
+ dir: "ltr",
184
+ type: "button",
185
+ role: "combobox",
186
+ style: styles.content,
187
+ "aria-autocomplete": "none",
188
+ "aria-label": props.label,
189
+ className: classes.content,
190
+ "aria-expanded": ariaExpanded,
191
+ onClick,
192
+ children: [
193
+ props.value.length ? props.startIcon : null,
194
+ /* @__PURE__ */ jsx("span", {
195
+ id: "text-content",
196
+ style: styles.text,
197
+ children: renderContent()
198
+ }),
199
+ /* @__PURE__ */ jsx(Icon, {
200
+ size: "sm",
201
+ name: "chevrons-down"
202
+ })
203
+ ]
204
+ });
205
+ }
193
206
  return /* @__PURE__ */ jsxs("div", {
194
207
  style: styles.container,
195
208
  children: [
@@ -199,37 +212,22 @@ const Select = (props) => {
199
212
  requiredColor: props.requiredColor,
200
213
  ...props.labelConfig
201
214
  }),
202
- /* @__PURE__ */ jsxs("button", {
203
- dir: "ltr",
204
- type: "button",
205
- role: "combobox",
206
- "aria-expanded": open,
207
- style: styles.content,
208
- "aria-autocomplete": "none",
209
- "aria-label": props.label,
210
- className: classes.content,
211
- onClick: togglePanel,
212
- children: [
213
- props.startIcon,
214
- /* @__PURE__ */ jsx("span", {
215
- id: "text-content",
216
- style: styles.text,
217
- children: renderContent()
218
- }),
219
- /* @__PURE__ */ jsx(Icon, {
220
- size: "sm",
221
- name: "chevrons-down"
222
- })
223
- ]
215
+ /* @__PURE__ */ jsx(BasePopover, {
216
+ p: 0,
217
+ hideShadow: true,
218
+ open,
219
+ trigger: renderTrigger,
220
+ onOpenChange: togglePanel,
221
+ floatingOptions: { viewportMargin: 0 },
222
+ children: /* @__PURE__ */ jsx("div", {
223
+ style: styles.panel,
224
+ children: props.options.map((option) => /* @__PURE__ */ jsx(OptionItem, {
225
+ option,
226
+ isSelected: props.value.includes(option.value),
227
+ onClick: handleOptionClick
228
+ }, option.value))
229
+ })
224
230
  }),
225
- open ? /* @__PURE__ */ jsx("div", {
226
- style: styles.panel,
227
- children: props.options.map((option) => /* @__PURE__ */ jsx(OptionItem, {
228
- option,
229
- isSelected: props.value.includes(option.value),
230
- onClick: handleOptionClick
231
- }, option.value))
232
- }) : null,
233
231
  props.errorMessage ? /* @__PURE__ */ jsx("span", {
234
232
  style: styles.error,
235
233
  children: props.errorMessage
@@ -239,5 +237,5 @@ const Select = (props) => {
239
237
  };
240
238
 
241
239
  //#endregion
242
- export { Select as t };
243
- //# sourceMappingURL=Select-R22kJLFr.js.map
240
+ export { types_exports as n, Select as t };
241
+ //# sourceMappingURL=Select-DtU_3TOA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Select-DtU_3TOA.js","names":["OptionItem: React.FC<OptionItemProps>","Select: React.FC<SelectProps>"],"sources":["../src/components/commons/inputs/Select/components/OptionItem/styles.ts","../src/components/commons/inputs/Select/components/OptionItem/index.tsx","../src/components/commons/inputs/Select/hooks/useSelect/index.ts","../src/components/commons/inputs/Select/styles.ts","../src/components/commons/inputs/Select/types.ts","../src/components/commons/inputs/Select/index.tsx"],"sourcesContent":["import { styled } from '@hooks/useThemedStyles/types'\nimport type { OptionItemProps } from './types'\n\nexport function createOptionsStyles({ isSelected }: OptionItemProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n alignItems: 'center',\n textAlign: 'left',\n\n borderRadius: '0.25rem',\n padding: '0.5rem 0.75rem',\n\n cursor: 'pointer',\n transition: 'background-color 0.2s ease-out',\n\n backgroundColor: isSelected\n ? 'var(--px-background-card-hover)'\n : 'transparent',\n\n __rules: {\n '&:hover': {\n backgroundColor: 'var(--px-background-card-hover) !important'\n },\n\n '&:focus': {\n outlineOffset: '-1px',\n outline: '2px solid var(--px-color-primary)'\n }\n }\n },\n\n text: {\n flex: 1,\n\n fontSize: '1rem',\n fontWeight: 500,\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-primary)',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis'\n }\n })\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { OptionItemProps } from './types'\n\n// Styles\nimport { createOptionsStyles } from './styles'\n\nexport const OptionItem: React.FC<OptionItemProps> = props => {\n // Hooks\n const { styles, classes } = useThemedStyles(props, createOptionsStyles)\n\n // Functions\n function handleClick() {\n props.onClick(props.option.value)\n }\n\n return (\n <button\n type=\"button\"\n role=\"option\"\n style={styles.container}\n className={classes.container}\n aria-label={props.option.label}\n aria-selected={props.isSelected}\n onClick={handleClick}\n >\n <span style={styles.text}>{props.option.label}</span>\n </button>\n )\n}\n","// External Libraries\nimport { useState } from 'react'\n\n// Types\nimport type { SelectProps } from '../../types'\n\nexport function useSelect({\n value,\n multiple,\n canClear,\n onChange\n}: SelectProps) {\n // States\n const [open, setOpen] = useState(false)\n\n // Functions\n function handleOptionClick(option: string) {\n const isAlreadySelected = value.includes(option)\n\n if (!multiple) {\n if (isAlreadySelected) {\n if (canClear) onChange([])\n } else onChange([option])\n\n setOpen(false)\n return\n }\n\n if (isAlreadySelected) {\n if (value.length === 1) {\n if (canClear) onChange([])\n } else onChange(value.filter(v => v !== option))\n } else onChange([...value, option])\n }\n\n function togglePanel() {\n setOpen(prev => !prev)\n }\n\n function closePanel() {\n setOpen(false)\n }\n\n return { open, togglePanel, closePanel, handleOptionClick }\n}\n","import { styled } from '@hooks/useThemedStyles/types'\nimport type { SelectProps } from './types'\n\nexport function createSelectStyles(props: SelectProps) {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n position: 'relative',\n\n rowGap: '0.375rem'\n },\n\n content: {\n width: '100%',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n padding: '0.625rem 0.875rem',\n\n opacity: props.disabled ? 0.5 : 1,\n cursor: props.disabled ? 'not-allowed' : 'pointer',\n boxShadow: 'var(--px-shadow-default)',\n borderColor: props.errorMessage\n ? 'var(--px-color-error)'\n : 'var(--px-border-primary)',\n\n __rules: {\n '&:focus-within': {\n outlineOffset: '-1px !important',\n outline: `2px solid var(${props.errorMessage ? '--px-color-error' : '--px-color-primary'}) !important`\n }\n }\n },\n\n text: {\n flex: 1,\n\n textAlign: 'left',\n\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n textOverflow: 'ellipsis',\n\n fontSize: '1rem',\n lineHeight: '1.5rem',\n fontFamily: 'inherit',\n fontWeight: props.value.length ? 500 : 400,\n color: props.value.length\n ? 'var(--px-text-primary)'\n : 'var(--px-text-secondary)'\n },\n\n error: {\n display: 'block',\n fontWeight: 400,\n lineHeight: '1rem',\n fontSize: '0.75rem',\n fontFamily: 'inherit',\n color: 'var(--px-text-error)'\n },\n\n panel: {\n width: '100%'\n }\n })\n}\n","import type {\n StylesOf,\n TextProps,\n LayoutProps,\n MarginProps\n} from '@hooks/useThemedStyles/types'\nimport type { createSelectStyles } from './styles'\n\nexport interface SelectProps extends LayoutProps, MarginProps {\n label: string\n value: string[]\n placeholder?: string\n options: SelectOption[]\n\n canClear?: boolean\n multiple?: boolean\n required?: boolean\n disabled?: boolean\n hideLabel?: boolean\n errorMessage?: string\n maxVisibleItems?: number\n\n startIcon?: React.ReactNode\n styles?: StylesOf<typeof createSelectStyles>\n\n requiredColor?: string\n labelConfig?: TextProps\n\n onChange: (value: string[]) => void\n}\n\nexport interface SelectOption {\n label: string\n value: string\n}\n","/** biome-ignore-all lint/a11y/useSemanticElements: It's a custom select component */\n// External Libraries\nimport type React from 'react'\nimport { useMemo } from 'react'\n\n// Components\nimport { OptionItem } from './components/OptionItem'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Label } from '@components/commons/toolkit/Label'\n\n// Hooks\nimport { useSelect } from './hooks/useSelect'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SelectProps } from './types'\nimport type { PopoverTriggerRenderProps } from '@components/commons/toolkit/Popover/types'\n\n// Styles\nimport { createSelectStyles } from './styles'\nimport { BasePopover } from '@components/commons/structure/BasePopover'\n\nexport * as SelectTypes from './types'\n\nexport const Select: React.FC<SelectProps> = props => {\n // Hooks\n const { open, togglePanel, handleOptionClick } = useSelect(props)\n const { styles, classes } = useThemedStyles(props, createSelectStyles, {\n pick: p => [p.disabled, p.errorMessage, p.value],\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n // Constants\n const maxVisible = props.maxVisibleItems ?? Infinity\n const optionsMap = useMemo(\n () => new Map(props.options.map(option => [option.value, option.label])),\n [props.options]\n )\n\n // Functions\n function renderContent() {\n if (!props.value?.length) return props.placeholder\n\n const resolvedValues = props.value.map(val => optionsMap.get(val) ?? val)\n\n const visibleItems = resolvedValues.slice(0, maxVisible)\n const hiddenCount = resolvedValues.length - visibleItems.length\n\n let result = visibleItems.join(', ')\n if (hiddenCount > 0) result += ` +${hiddenCount}`\n\n return result\n }\n\n function renderTrigger({\n ref,\n ariaExpanded,\n onClick\n }: PopoverTriggerRenderProps) {\n return (\n <button\n ref={ref as any}\n dir=\"ltr\"\n type=\"button\"\n role=\"combobox\"\n style={styles.content}\n aria-autocomplete=\"none\"\n aria-label={props.label}\n className={classes.content}\n aria-expanded={ariaExpanded}\n onClick={onClick}\n >\n {props.value.length ? props.startIcon : null}\n\n <span id=\"text-content\" style={styles.text}>\n {renderContent()}\n </span>\n\n <Icon size=\"sm\" name=\"chevrons-down\" />\n </button>\n )\n }\n\n return (\n <div style={styles.container}>\n {props.hideLabel ? null : (\n <Label\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n )}\n\n <BasePopover\n p={0}\n hideShadow\n open={open}\n trigger={renderTrigger}\n onOpenChange={togglePanel}\n floatingOptions={{ viewportMargin: 0 }}\n >\n <div style={styles.panel}>\n {props.options.map(option => (\n <OptionItem\n key={option.value}\n option={option}\n isSelected={props.value.includes(option.value)}\n onClick={handleOptionClick}\n />\n ))}\n </div>\n </BasePopover>\n\n {props.errorMessage ? (\n <span style={styles.error}>{props.errorMessage}</span>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAGA,SAAgB,oBAAoB,EAAE,cAA+B;AACnE,QAAO,OAAO;EACZ,WAAW;GACT,OAAO;GAEP,SAAS;GACT,YAAY;GACZ,WAAW;GAEX,cAAc;GACd,SAAS;GAET,QAAQ;GACR,YAAY;GAEZ,iBAAiB,aACb,oCACA;GAEJ,SAAS;IACP,WAAW,EACT,iBAAiB,8CAClB;IAED,WAAW;KACT,eAAe;KACf,SAAS;KACV;IACF;GACF;EAED,MAAM;GACJ,MAAM;GAEN,UAAU;GACV,YAAY;GACZ,YAAY;GACZ,YAAY;GACZ,OAAO;GAEP,UAAU;GACV,YAAY;GACZ,cAAc;GACf;EACF,CAAC;;;;;;ACrCJ,MAAaA,cAAwC,UAAS;CAE5D,MAAM,EAAE,QAAQ,YAAY,gBAAgB,OAAO,oBAAoB;CAGvE,SAAS,cAAc;AACrB,QAAM,QAAQ,MAAM,OAAO,MAAM;;AAGnC,QACE,oBAAC;EACC,MAAK;EACL,MAAK;EACL,OAAO,OAAO;EACd,WAAW,QAAQ;EACnB,cAAY,MAAM,OAAO;EACzB,iBAAe,MAAM;EACrB,SAAS;YAET,oBAAC;GAAK,OAAO,OAAO;aAAO,MAAM,OAAO;IAAa;GAC9C;;;;;ACxBb,SAAgB,UAAU,EACxB,OACA,UACA,UACA,YACc;CAEd,MAAM,CAAC,MAAM,WAAW,SAAS,MAAM;CAGvC,SAAS,kBAAkB,QAAgB;EACzC,MAAM,oBAAoB,MAAM,SAAS,OAAO;AAEhD,MAAI,CAAC,UAAU;AACb,OAAI,mBACF;QAAI,SAAU,UAA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,QAAQ,KAAI,WACjB,oBAAC;MAES;MACR,YAAY,MAAM,MAAM,SAAS,OAAO,MAAM;MAC9C,SAAS;QAHJ,OAAO,MAIZ,CACF;MACE;KACM;GAEb,MAAM,eACL,oBAAC;IAAK,OAAO,OAAO;cAAQ,MAAM;KAAoB,GACpD;;GACA"}
@@ -1,4 +1,4 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-D4si38PM.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/commons/toolkit/Switch/styles.ts
@@ -46,4 +46,4 @@ const Switch = (props) => {
46
46
 
47
47
  //#endregion
48
48
  export { Switch as t };
49
- //# sourceMappingURL=Switch-ZmanGt2r.js.map
49
+ //# sourceMappingURL=Switch-DJNZbvzy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Switch-ZmanGt2r.js","names":["Switch: React.FC<SwitchThumbProps>"],"sources":["../src/components/commons/toolkit/Switch/styles.ts","../src/components/commons/toolkit/Switch/index.tsx"],"sourcesContent":["// Types\nimport type { SwitchThumbProps } from './types'\n\n// Styles\nimport { styled } from '@hooks/useThemedStyles/types'\nexport function createSwitchThumbStyles({\n checked,\n colorActive,\n colorInactive,\n colorIndicator\n}: SwitchThumbProps) {\n return styled({\n container: {\n width: '2.5rem',\n height: '1.25rem',\n\n position: 'relative',\n\n display: 'inline-flex',\n alignItems: 'center',\n marginLeft: '0.5rem',\n\n borderRadius: '2rem',\n padding: '0.125rem',\n\n transition: 'background-color 0.5s',\n backgroundColor: checked\n ? (colorActive ?? 'var(--px-color-success)')\n : (colorInactive ?? 'var(--px-color-disabled)')\n },\n\n indicator: {\n height: '1rem',\n width: '1rem',\n\n position: 'absolute',\n left: '0.125rem',\n top: '0.125rem',\n\n borderRadius: '9999px',\n backgroundColor: colorIndicator ?? 'var(--px-surface)',\n\n transition: 'transform 0.5s',\n transform: checked ? 'translateX(1.25rem)' : 'translateX(0)',\n willChange: 'transform'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SwitchThumbProps } from './types'\n\n// Styles\nimport { createSwitchThumbStyles } from './styles'\n\nexport const Switch: React.FC<SwitchThumbProps> = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createSwitchThumbStyles, {\n applyCommonProps: true,\n pick: p => [p.checked]\n })\n\n return (\n <span style={styles.container}>\n <span style={styles.indicator} />\n </span>\n )\n}\n"],"mappings":";;;;AAKA,SAAgB,wBAAwB,EACtC,SACA,aACA,eACA,kBACmB;AACnB,QAAO,OAAO;EACZ,WAAW;GACT,OAAO;GACP,QAAQ;GAER,UAAU;GAEV,SAAS;GACT,YAAY;GACZ,YAAY;GAEZ,cAAc;GACd,SAAS;GAET,YAAY;GACZ,iBAAiB,UACZ,eAAe,4BACf,iBAAiB;GACvB;EAED,WAAW;GACT,QAAQ;GACR,OAAO;GAEP,UAAU;GACV,MAAM;GACN,KAAK;GAEL,cAAc;GACd,iBAAiB,kBAAkB;GAEnC,YAAY;GACZ,WAAW,UAAU,wBAAwB;GAC7C,YAAY;GACb;EACF,CAAC;;;;;AClCJ,MAAaA,UAAqC,UAAS;CAEzD,MAAM,EAAE,WAAW,gBAAgB,OAAO,yBAAyB;EACjE,kBAAkB;EAClB,OAAM,MAAK,CAAC,EAAE,QAAQ;EACvB,CAAC;AAEF,QACE,oBAAC;EAAK,OAAO,OAAO;YAClB,oBAAC,UAAK,OAAO,OAAO,YAAa;GAC5B"}
1
+ {"version":3,"file":"Switch-DJNZbvzy.js","names":["Switch: React.FC<SwitchThumbProps>"],"sources":["../src/components/commons/toolkit/Switch/styles.ts","../src/components/commons/toolkit/Switch/index.tsx"],"sourcesContent":["// Types\nimport type { SwitchThumbProps } from './types'\n\n// Styles\nimport { styled } from '@hooks/useThemedStyles/types'\nexport function createSwitchThumbStyles({\n checked,\n colorActive,\n colorInactive,\n colorIndicator\n}: SwitchThumbProps) {\n return styled({\n container: {\n width: '2.5rem',\n height: '1.25rem',\n\n position: 'relative',\n\n display: 'inline-flex',\n alignItems: 'center',\n marginLeft: '0.5rem',\n\n borderRadius: '2rem',\n padding: '0.125rem',\n\n transition: 'background-color 0.5s',\n backgroundColor: checked\n ? (colorActive ?? 'var(--px-color-success)')\n : (colorInactive ?? 'var(--px-color-disabled)')\n },\n\n indicator: {\n height: '1rem',\n width: '1rem',\n\n position: 'absolute',\n left: '0.125rem',\n top: '0.125rem',\n\n borderRadius: '9999px',\n backgroundColor: colorIndicator ?? 'var(--px-surface)',\n\n transition: 'transform 0.5s',\n transform: checked ? 'translateX(1.25rem)' : 'translateX(0)',\n willChange: 'transform'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SwitchThumbProps } from './types'\n\n// Styles\nimport { createSwitchThumbStyles } from './styles'\n\nexport const Switch: React.FC<SwitchThumbProps> = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createSwitchThumbStyles, {\n applyCommonProps: true,\n pick: p => [p.checked]\n })\n\n return (\n <span style={styles.container}>\n <span style={styles.indicator} />\n </span>\n )\n}\n"],"mappings":";;;;AAKA,SAAgB,wBAAwB,EACtC,SACA,aACA,eACA,kBACmB;AACnB,QAAO,OAAO;EACZ,WAAW;GACT,OAAO;GACP,QAAQ;GAER,UAAU;GAEV,SAAS;GACT,YAAY;GACZ,YAAY;GAEZ,cAAc;GACd,SAAS;GAET,YAAY;GACZ,iBAAiB,UACZ,eAAe,4BACf,iBAAiB;GACvB;EAED,WAAW;GACT,QAAQ;GACR,OAAO;GAEP,UAAU;GACV,MAAM;GACN,KAAK;GAEL,cAAc;GACd,iBAAiB,kBAAkB;GAEnC,YAAY;GACZ,WAAW,UAAU,wBAAwB;GAC7C,YAAY;GACb;EACF,CAAC;;;;;AClCJ,MAAaA,UAAqC,UAAS;CAEzD,MAAM,EAAE,WAAW,gBAAgB,OAAO,yBAAyB;EACjE,kBAAkB;EAClB,OAAM,MAAK,CAAC,EAAE,QAAQ;EACvB,CAAC;AAEF,QACE,oBAAC;EAAK,OAAO,OAAO;YAClB,oBAAC,UAAK,OAAO,OAAO,YAAa;GAC5B"}
@@ -1,5 +1,5 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-D4si38PM.js";
2
- import { t as Typography } from "./Typography-CHkdzH2K.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
2
+ import { t as Typography } from "./Typography-BkFV7BhK.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import { motion } from "framer-motion";
5
5
 
@@ -120,4 +120,4 @@ const TabSwitch = (props) => {
120
120
 
121
121
  //#endregion
122
122
  export { TabSwitch as t };
123
- //# sourceMappingURL=TabSwitch-2WIjQ2Ie.js.map
123
+ //# sourceMappingURL=TabSwitch-DlXdgLPc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TabSwitch-2WIjQ2Ie.js","names":[],"sources":["../src/components/commons/toolkit/TabSwitch/components/TabSwitchItem/styles.ts","../src/components/commons/toolkit/TabSwitch/components/TabSwitchItem/index.tsx","../src/components/commons/toolkit/TabSwitch/styles.ts","../src/components/commons/toolkit/TabSwitch/index.tsx"],"sourcesContent":["// External Libraries\nimport { styled } from '@hooks/useThemedStyles/types'\n\ninterface Params {\n disabled?: boolean\n selected?: boolean\n selectedColor?: string\n variant: 'default' | 'underline'\n}\n\nexport function createTabSwitchItemStyles({\n variant,\n disabled,\n selected,\n selectedColor\n}: Params) {\n const accent = selectedColor ?? 'var(--px-color-primary)'\n\n return styled({\n item: {\n minHeight: '1.25rem',\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n background: 'transparent',\n border: 0,\n padding: '8px 10px',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n userSelect: 'none',\n whiteSpace: 'nowrap',\n __rules: { '& > p': { zIndex: 1 } }\n },\n\n selectedBg:\n variant === 'default'\n ? {\n position: 'absolute',\n inset: 0,\n borderRadius: 6,\n border: '1px solid var(--px-border-primary)',\n background: selected ? accent : 'transparent'\n }\n : {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: -2,\n height: 2,\n background: selected ? accent : 'transparent'\n }\n })\n}\n","// External Libraries\nimport { motion } from 'framer-motion'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SwitchOption } from '../../types'\n\n// Styles\nimport { createTabSwitchItemStyles } from './styles'\n\ntype Props<T> = {\n option: SwitchOption<T>\n selected: boolean\n layoutId?: string\n disabled?: boolean\n selectedColor?: string\n selectedLabelColor?: string\n variant: 'default' | 'underline'\n onClick: (value: T) => void\n}\n\nexport const SwitchItem = <T,>(props: Props<T>) => {\n const { option, disabled, selected, layoutId, onClick } = props\n\n const { styles, classes } = useThemedStyles(\n props,\n createTabSwitchItemStyles,\n {\n pick: p => [p.variant, p.selectedColor, p.selectedLabelColor, p.selected]\n }\n )\n\n const isDisabled = disabled || option.disabled\n\n return (\n <button\n type=\"button\"\n style={styles.item}\n className={classes.item}\n tabIndex={isDisabled ? -1 : 0}\n onClick={() => !isDisabled && onClick(option.value)}\n >\n {selected ? (\n <motion.div\n layoutId={layoutId || 'pixel-tabswitch-selected'}\n style={styles.selectedBg}\n />\n ) : null}\n\n {option.icon ? (\n <span style={{ display: 'inline-flex' }}>{option.icon}</span>\n ) : null}\n\n <Typography variant=\"b1\" fontWeight=\"bold\">\n {option.label}\n </Typography>\n </button>\n )\n}\n","// Types\nimport type { TabSwitchProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createTabSwitchStyles<T>(props: TabSwitchProps<T>) {\n const { fitContent } = props\n\n return styled({\n container: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n color: 'var(--px-text-primary, #4b5563)',\n width: fitContent ? 'fit-content' : '100%',\n borderBottom: '1px solid var(--px-border-primary, #e5e7eb)',\n gap: 0,\n __rules: { '& svg': { zIndex: 1 } }\n }\n })\n}\n","// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Components\nimport { SwitchItem } from './components/TabSwitchItem'\n\n// Types\nimport type { TabSwitchProps } from './types'\n\n// Styles\nimport { createTabSwitchStyles } from './styles'\n\nexport * from './types'\n\nexport const TabSwitch = <T,>(props: TabSwitchProps<T>) => {\n {\n const {\n options,\n disabled,\n layoutId,\n currentValue,\n variant = 'default',\n onChange\n } = props\n\n const { styles, classes } = useThemedStyles(props, createTabSwitchStyles, {\n pick: p => [p.disabled, p.currentValue],\n override: props.styles,\n applyCommonProps: true\n })\n\n return (\n <div style={styles.container} className={classes.container}>\n {options.map(opt => (\n <SwitchItem\n key={String(opt.value)}\n option={opt}\n variant={variant}\n layoutId={layoutId}\n disabled={disabled}\n selectedColor={props.selectedColor}\n selected={currentValue === opt.value}\n selectedLabelColor={props.selectedLabelColor}\n onClick={onChange}\n />\n ))}\n </div>\n )\n }\n}\n"],"mappings":";;;;;;AAUA,SAAgB,0BAA0B,EACxC,SACA,UACA,UACA,iBACS;CACT,MAAM,SAAS,iBAAiB;AAEhC,QAAO,OAAO;EACZ,MAAM;GACJ,WAAW;GACX,UAAU;GACV,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,KAAK;GACL,YAAY;GACZ,QAAQ;GACR,SAAS;GACT,QAAQ,WAAW,gBAAgB;GACnC,SAAS,WAAW,KAAM;GAC1B,YAAY;GACZ,YAAY;GACZ,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,EAAE;GACpC;EAED,YACE,YAAY,YACR;GACE,UAAU;GACV,OAAO;GACP,cAAc;GACd,QAAQ;GACR,YAAY,WAAW,SAAS;GACjC,GACD;GACE,UAAU;GACV,MAAM;GACN,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,Y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,eAAe,MAAM;IACrB,UAAU,iBAAiB,IAAI;IAC/B,oBAAoB,MAAM;IAC1B,SAAS;MARJ,OAAO,IAAI,MAAM,CAStB,CACF;IACE"}
1
+ {"version":3,"file":"TabSwitch-DlXdgLPc.js","names":[],"sources":["../src/components/commons/toolkit/TabSwitch/components/TabSwitchItem/styles.ts","../src/components/commons/toolkit/TabSwitch/components/TabSwitchItem/index.tsx","../src/components/commons/toolkit/TabSwitch/styles.ts","../src/components/commons/toolkit/TabSwitch/index.tsx"],"sourcesContent":["// External Libraries\nimport { styled } from '@hooks/useThemedStyles/types'\n\ninterface Params {\n disabled?: boolean\n selected?: boolean\n selectedColor?: string\n variant: 'default' | 'underline'\n}\n\nexport function createTabSwitchItemStyles({\n variant,\n disabled,\n selected,\n selectedColor\n}: Params) {\n const accent = selectedColor ?? 'var(--px-color-primary)'\n\n return styled({\n item: {\n minHeight: '1.25rem',\n position: 'relative',\n display: 'inline-flex',\n alignItems: 'center',\n justifyContent: 'center',\n gap: 4,\n background: 'transparent',\n border: 0,\n padding: '8px 10px',\n cursor: disabled ? 'not-allowed' : 'pointer',\n opacity: disabled ? 0.5 : 1,\n userSelect: 'none',\n whiteSpace: 'nowrap',\n __rules: { '& > p': { zIndex: 1 } }\n },\n\n selectedBg:\n variant === 'default'\n ? {\n position: 'absolute',\n inset: 0,\n borderRadius: 6,\n border: '1px solid var(--px-border-primary)',\n background: selected ? accent : 'transparent'\n }\n : {\n position: 'absolute',\n left: 0,\n right: 0,\n bottom: -2,\n height: 2,\n background: selected ? accent : 'transparent'\n }\n })\n}\n","// External Libraries\nimport { motion } from 'framer-motion'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { SwitchOption } from '../../types'\n\n// Styles\nimport { createTabSwitchItemStyles } from './styles'\n\ntype Props<T> = {\n option: SwitchOption<T>\n selected: boolean\n layoutId?: string\n disabled?: boolean\n selectedColor?: string\n selectedLabelColor?: string\n variant: 'default' | 'underline'\n onClick: (value: T) => void\n}\n\nexport const SwitchItem = <T,>(props: Props<T>) => {\n const { option, disabled, selected, layoutId, onClick } = props\n\n const { styles, classes } = useThemedStyles(\n props,\n createTabSwitchItemStyles,\n {\n pick: p => [p.variant, p.selectedColor, p.selectedLabelColor, p.selected]\n }\n )\n\n const isDisabled = disabled || option.disabled\n\n return (\n <button\n type=\"button\"\n style={styles.item}\n className={classes.item}\n tabIndex={isDisabled ? -1 : 0}\n onClick={() => !isDisabled && onClick(option.value)}\n >\n {selected ? (\n <motion.div\n layoutId={layoutId || 'pixel-tabswitch-selected'}\n style={styles.selectedBg}\n />\n ) : null}\n\n {option.icon ? (\n <span style={{ display: 'inline-flex' }}>{option.icon}</span>\n ) : null}\n\n <Typography variant=\"b1\" fontWeight=\"bold\">\n {option.label}\n </Typography>\n </button>\n )\n}\n","// Types\nimport type { TabSwitchProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createTabSwitchStyles<T>(props: TabSwitchProps<T>) {\n const { fitContent } = props\n\n return styled({\n container: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n color: 'var(--px-text-primary, #4b5563)',\n width: fitContent ? 'fit-content' : '100%',\n borderBottom: '1px solid var(--px-border-primary, #e5e7eb)',\n gap: 0,\n __rules: { '& svg': { zIndex: 1 } }\n }\n })\n}\n","// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Components\nimport { SwitchItem } from './components/TabSwitchItem'\n\n// Types\nimport type { TabSwitchProps } from './types'\n\n// Styles\nimport { createTabSwitchStyles } from './styles'\n\nexport * from './types'\n\nexport const TabSwitch = <T,>(props: TabSwitchProps<T>) => {\n {\n const {\n options,\n disabled,\n layoutId,\n currentValue,\n variant = 'default',\n onChange\n } = props\n\n const { styles, classes } = useThemedStyles(props, createTabSwitchStyles, {\n pick: p => [p.disabled, p.currentValue],\n override: props.styles,\n applyCommonProps: true\n })\n\n return (\n <div style={styles.container} className={classes.container}>\n {options.map(opt => (\n <SwitchItem\n key={String(opt.value)}\n option={opt}\n variant={variant}\n layoutId={layoutId}\n disabled={disabled}\n selectedColor={props.selectedColor}\n selected={currentValue === opt.value}\n selectedLabelColor={props.selectedLabelColor}\n onClick={onChange}\n />\n ))}\n </div>\n )\n }\n}\n"],"mappings":";;;;;;AAUA,SAAgB,0BAA0B,EACxC,SACA,UACA,UACA,iBACS;CACT,MAAM,SAAS,iBAAiB;AAEhC,QAAO,OAAO;EACZ,MAAM;GACJ,WAAW;GACX,UAAU;GACV,SAAS;GACT,YAAY;GACZ,gBAAgB;GAChB,KAAK;GACL,YAAY;GACZ,QAAQ;GACR,SAAS;GACT,QAAQ,WAAW,gBAAgB;GACnC,SAAS,WAAW,KAAM;GAC1B,YAAY;GACZ,YAAY;GACZ,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,EAAE;GACpC;EAED,YACE,YAAY,YACR;GACE,UAAU;GACV,OAAO;GACP,cAAc;GACd,QAAQ;GACR,YAAY,WAAW,SAAS;GACjC,GACD;GACE,UAAU;GACV,MAAM;GACN,OAAO;GACP,QAAQ;GACR,QAAQ;GACR,YAAY,WAAW,SAAS;GACjC;EACR,CAAC;;;;;AC3BJ,MAAa,cAAkB,UAAoB;CACjD,MAAM,EAAE,QAAQ,UAAU,UAAU,UAAU,YAAY;CAE1D,MAAM,EAAE,QAAQ,YAAY,gBAC1B,OACA,2BACA,EACE,OAAM,MAAK;EAAC,EAAE;EAAS,EAAE;EAAe,EAAE;EAAoB,EAAE;EAAS,EAC1E,CACF;CAED,MAAM,aAAa,YAAY,OAAO;AAEtC,QACE,qBAAC;EACC,MAAK;EACL,OAAO,OAAO;EACd,WAAW,QAAQ;EACnB,UAAU,aAAa,KAAK;EAC5B,eAAe,CAAC,cAAc,QAAQ,OAAO,MAAM;;GAElD,WACC,oBAAC,OAAO;IACN,UAAU,YAAY;IACtB,OAAO,OAAO;KACd,GACA;GAEH,OAAO,OACN,oBAAC;IAAK,OAAO,EAAE,SAAS,eAAe;cAAG,OAAO;KAAY,GAC3D;GAEJ,oBAAC;IAAW,SAAQ;IAAK,YAAW;cACjC,OAAO;KACG;;GACN;;;;;ACzDb,SAAgB,sBAAyB,OAA0B;CACjE,MAAM,EAAE,eAAe;AAEvB,QAAO,OAAO,EACZ,WAAW;EACT,SAAS;EACT,eAAe;EACf,YAAY;EACZ,OAAO;EACP,OAAO,aAAa,gBAAgB;EACpC,cAAc;EACd,KAAK;EACL,SAAS,EAAE,SAAS,EAAE,QAAQ,GAAG,EAAE;EACpC,EACF,CAAC;;;;;ACJJ,MAAa,aAAiB,UAA6B;CACzD;EACE,MAAM,EACJ,SACA,UACA,UACA,cACA,UAAU,WACV,aACE;EAEJ,MAAM,EAAE,QAAQ,YAAY,gBAAgB,OAAO,uBAAuB;GACxE,OAAM,MAAK,CAAC,EAAE,UAAU,EAAE,aAAa;GACvC,UAAU,MAAM;GAChB,kBAAkB;GACnB,CAAC;AAEF,SACE,oBAAC;GAAI,OAAO,OAAO;GAAW,WAAW,QAAQ;aAC9C,QAAQ,KAAI,QACX,oBAAC;IAEC,QAAQ;IACC;IACC;IACA;IACV,eAAe,MAAM;IACrB,UAAU,iBAAiB,IAAI;IAC/B,oBAAoB,MAAM;IAC1B,SAAS;MARJ,OAAO,IAAI,MAAM,CAStB,CACF;IACE"}
@@ -1,7 +1,7 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-D4si38PM.js";
2
- import { t as Icon } from "./Icon-kjpHbCbF.js";
3
- import { t as Typography } from "./Typography-CHkdzH2K.js";
4
- import { t as Label } from "./Label-BVkidQlv.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CrarDyWc.js";
2
+ import { t as Icon } from "./Icon-KzwFJI_k.js";
3
+ import { t as Typography } from "./Typography-BkFV7BhK.js";
4
+ import { t as Label } from "./Label-C5AIUqYV.js";
5
5
  import { useId } from "react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
 
@@ -110,4 +110,4 @@ const TextArea = (props) => {
110
110
 
111
111
  //#endregion
112
112
  export { TextArea as t };
113
- //# sourceMappingURL=TextArea-DGCFyZrW.js.map
113
+ //# sourceMappingURL=TextArea-DY7hxFbx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextArea-DY7hxFbx.js","names":[],"sources":["../src/components/commons/inputs/TextArea/styles.ts","../src/components/commons/inputs/TextArea/index.tsx"],"sourcesContent":["// Types\nimport { styled } from '@hooks/useThemedStyles/types'\nimport type { TextAreaProps } from './types'\n\nexport function createTextAreaStyles(props: TextAreaProps) {\n const { height = '8rem', readOnly, startIcon } = props\n\n const focusRingColor = props.focusedRingColor || 'var(--px-color-info)'\n const placeHolderColor =\n props.placeholderColor || 'var(--px-text-placeholder)'\n\n return styled({\n iconContainer: {\n position: 'absolute',\n left: '0.75rem',\n top: '1.375rem',\n transform: 'translateY(-50%)'\n },\n textArea: {\n height,\n width: '100%',\n paddingBlock: '0.75rem',\n paddingInline: '0.875rem',\n borderRadius: '0.5rem',\n resize: 'none',\n\n fontWeight: '400',\n fontSize: '1rem',\n color: 'var(--px-text-primary)',\n\n border: '1px solid red',\n outlineOffset: '-1px',\n\n cursor: readOnly ? 'default' : undefined,\n paddingLeft: startIcon ? '2.5rem' : undefined,\n\n __rules: {\n '&::placeholder': {\n color: `${placeHolderColor}`\n },\n '&:focus': readOnly\n ? { outline: 'none' }\n : { outline: `2px solid ${focusRingColor}` }\n }\n }\n })\n}\n","// External Libraries\nimport { useId } from 'react'\n\n// Types\nimport type { TextAreaProps } from './types'\n\n// Components\nimport { Label } from '@components/commons/toolkit/Label'\nimport { Icon } from '@components/commons/toolkit/Icon'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createTextAreaStyles } from './styles'\n\nexport const TextArea = (props: TextAreaProps) => {\n const {\n value,\n disabled,\n readOnly,\n maxLength,\n hideMaxLength,\n textMaxLength,\n placeholder,\n\n label,\n required,\n requiredColor,\n labelColor,\n labelVariant,\n\n startIcon,\n iconColor\n } = props\n\n // Hooks\n const inputId = useId()\n\n const { styles, classes } = useThemedStyles(props, createTextAreaStyles, {\n pick: p => [\n p.height,\n p.readOnly,\n p.startIcon,\n p.placeholderColor,\n p.focusedRingColor\n ],\n override: props.styles,\n applyCommonProps: true\n })\n\n // Functions\n function handleChange(e: React.ChangeEvent<HTMLTextAreaElement>) {\n if (disabled || readOnly) return\n props.onChange?.(e.target.value)\n }\n\n function renderLabel() {\n if (!label) return null\n\n return (\n <div className=\"flex items-center gap-3\">\n <Label\n label={label}\n htmlFor={inputId}\n color={labelColor}\n required={required}\n variant={labelVariant}\n requiredColor={requiredColor}\n />\n </div>\n )\n }\n\n return (\n <div>\n {renderLabel()}\n\n <div style={{ position: 'relative' }}>\n {startIcon && (\n <div style={styles.iconContainer}>\n <Icon\n name={startIcon}\n color={iconColor ? iconColor : 'var(--px-text-primary)'}\n />\n </div>\n )}\n\n <textarea\n value={value}\n disabled={disabled}\n readOnly={readOnly}\n maxLength={maxLength}\n placeholder={placeholder}\n style={styles.textArea}\n className={classes.textArea}\n onChange={handleChange}\n />\n </div>\n\n {maxLength && !hideMaxLength ? (\n <Typography variant=\"b2\" styles={{ text: { marginLeft: 'auto' } }}>\n {value.length}/{maxLength} {textMaxLength}\n </Typography>\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,qBAAqB,OAAsB;CACzD,MAAM,EAAE,SAAS,QAAQ,UAAU,cAAc;CAEjD,MAAM,iBAAiB,MAAM,oBAAoB;CACjD,MAAM,mBACJ,MAAM,oBAAoB;AAE5B,QAAO,OAAO;EACZ,eAAe;GACb,UAAU;GACV,MAAM;GACN,KAAK;GACL,WAAW;GACZ;EACD,UAAU;GACR;GACA,OAAO;GACP,cAAc;GACd,eAAe;GACf,cAAc;GACd,QAAQ;GAER,YAAY;GACZ,UAAU;GACV,OAAO;GAEP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endregion
541
541
  export { useTheme as n, ThemeProvider as t };
542
- //# sourceMappingURL=ThemeContext-bVaozqut.js.map
542
+ //# sourceMappingURL=ThemeContext-DhXvmWKO.js.map