softable-pixels-web 1.1.33 → 1.2.1

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 (126) hide show
  1. package/dist/{BasePopover-BYa7SBXE.js → BasePopover-m1OfX3fO.js} +3 -3
  2. package/dist/{BasePopover-BYa7SBXE.js.map → BasePopover-m1OfX3fO.js.map} +1 -1
  3. package/dist/{Breadcrumb-BLu27RXT.js → Breadcrumb-Bm9YuwCq.js} +4 -4
  4. package/dist/{Breadcrumb-BLu27RXT.js.map → Breadcrumb-Bm9YuwCq.js.map} +1 -1
  5. package/dist/{Button-BVxsixz_.js → Button-Vm1Odbi_.js} +4 -4
  6. package/dist/{Button-BVxsixz_.js.map → Button-Vm1Odbi_.js.map} +1 -1
  7. package/dist/{CheckItem-B5O_5_Qd.js → CheckItem-3d-2-qZe.js} +4 -4
  8. package/dist/{CheckItem-B5O_5_Qd.js.map → CheckItem-3d-2-qZe.js.map} +1 -1
  9. package/dist/{Checkbox-CsSo3vk0.js → Checkbox-aFsrig0i.js} +4 -4
  10. package/dist/{Checkbox-CsSo3vk0.js.map → Checkbox-aFsrig0i.js.map} +1 -1
  11. package/dist/{Chip-CxSFYy0c.js → Chip-DWoGbX_A.js} +3 -3
  12. package/dist/{Chip-CxSFYy0c.js.map → Chip-DWoGbX_A.js.map} +1 -1
  13. package/dist/{ChipList-oMddO6fO.js → ChipList-ClC-BPyL.js} +4 -4
  14. package/dist/{ChipList-oMddO6fO.js.map → ChipList-ClC-BPyL.js.map} +1 -1
  15. package/dist/ColorPicker-BVmUDE-h.js +183 -0
  16. package/dist/ColorPicker-BVmUDE-h.js.map +1 -0
  17. package/dist/{ContextMenu-DUHmXf8f.js → ContextMenu-B8mGn0Fq.js} +5 -5
  18. package/dist/{ContextMenu-DUHmXf8f.js.map → ContextMenu-B8mGn0Fq.js.map} +1 -1
  19. package/dist/{ErrorMessage-C2FJLFsj.js → ErrorMessage-BRnYfudz.js} +3 -3
  20. package/dist/{ErrorMessage-C2FJLFsj.js.map → ErrorMessage-BRnYfudz.js.map} +1 -1
  21. package/dist/{Icon-RM-EqP7I.js → Icon-CV5fAqK7.js} +2 -2
  22. package/dist/{Icon-RM-EqP7I.js.map → Icon-CV5fAqK7.js.map} +1 -1
  23. package/dist/{IconButton-BUBVowPJ.js → IconButton-BkwXYUL1.js} +2 -2
  24. package/dist/{IconButton-BUBVowPJ.js.map → IconButton-BkwXYUL1.js.map} +1 -1
  25. package/dist/{InfoSummary-m9_WXlqI.js → InfoSummary-p7hgSIZn.js} +3 -3
  26. package/dist/{InfoSummary-m9_WXlqI.js.map → InfoSummary-p7hgSIZn.js.map} +1 -1
  27. package/dist/{Input-Cxr_P2wz.js → Input-Dam9Lbxf.js} +5 -5
  28. package/dist/{Input-Cxr_P2wz.js.map → Input-Dam9Lbxf.js.map} +1 -1
  29. package/dist/{Loader-CmESHuyP.js → Loader-DUqRFMzl.js} +2 -2
  30. package/dist/{Loader-CmESHuyP.js.map → Loader-DUqRFMzl.js.map} +1 -1
  31. package/dist/{MaskModule-eB4lPBKt.js → MaskModule-ChyYaHh2.js} +1 -1
  32. package/dist/{MaskModule-eB4lPBKt.js.map → MaskModule-ChyYaHh2.js.map} +1 -1
  33. package/dist/{Popover-zLDtSQAp.js → Popover-tzAZp6V7.js} +4 -4
  34. package/dist/{Popover-zLDtSQAp.js.map → Popover-tzAZp6V7.js.map} +1 -1
  35. package/dist/{Select-DzahPXcJ.js → Select-BR9OSXHF.js} +7 -7
  36. package/dist/{Select-DzahPXcJ.js.map → Select-BR9OSXHF.js.map} +1 -1
  37. package/dist/{Skeleton-BPFVMk3-.js → Skeleton-iCdZ2Gai.js} +2 -2
  38. package/dist/{Skeleton-BPFVMk3-.js.map → Skeleton-iCdZ2Gai.js.map} +1 -1
  39. package/dist/{Switch-DFIDbtUk.js → Switch-CiKBZRST.js} +2 -2
  40. package/dist/{Switch-DFIDbtUk.js.map → Switch-CiKBZRST.js.map} +1 -1
  41. package/dist/{TabSwitch-D0Y22fSa.js → TabSwitch-D6KaP0z5.js} +3 -3
  42. package/dist/{TabSwitch-D0Y22fSa.js.map → TabSwitch-D6KaP0z5.js.map} +1 -1
  43. package/dist/{TextArea-B0QQy0U5.js → TextArea-D9kGofdD.js} +4 -4
  44. package/dist/{TextArea-B0QQy0U5.js.map → TextArea-D9kGofdD.js.map} +1 -1
  45. package/dist/{ThemeContext-MrH1mMsc.js → ThemeContext-C9llUBqb.js} +1 -1
  46. package/dist/{ThemeContext-MrH1mMsc.js.map → ThemeContext-C9llUBqb.js.map} +1 -1
  47. package/dist/{Typography-3tAIdGuj.js → Typography-BTJk47bm.js} +2 -2
  48. package/dist/{Typography-3tAIdGuj.js.map → Typography-BTJk47bm.js.map} +1 -1
  49. package/dist/base-popover.d.ts +3 -3
  50. package/dist/base-popover.js +5 -5
  51. package/dist/breadcrumb.d.ts +1 -1
  52. package/dist/breadcrumb.js +4 -4
  53. package/dist/button.d.ts +2 -2
  54. package/dist/button.js +4 -4
  55. package/dist/check-item.d.ts +1 -1
  56. package/dist/check-item.js +4 -4
  57. package/dist/checkbox.d.ts +2 -2
  58. package/dist/checkbox.js +4 -4
  59. package/dist/chip-list.d.ts +1 -1
  60. package/dist/chip-list.js +5 -5
  61. package/dist/chip.d.ts +1 -1
  62. package/dist/chip.js +3 -3
  63. package/dist/color-picker.d.ts +2 -0
  64. package/dist/color-picker.js +7 -0
  65. package/dist/context-menu.d.ts +1 -1
  66. package/dist/context-menu.js +8 -8
  67. package/dist/icon-button.d.ts +1 -1
  68. package/dist/icon-button.js +2 -2
  69. package/dist/{index-CdTCwpWl.d.ts → index-B-f7Shgf.d.ts} +4 -4
  70. package/dist/{index-DaxLlCt_.d.ts → index-B9PAov_V.d.ts} +2 -2
  71. package/dist/{index-Cb_tkhK8.d.ts → index-BEd1qAu7.d.ts} +1 -1
  72. package/dist/{index-DR6lOsN7.d.ts → index-BbvC10jX.d.ts} +2 -2
  73. package/dist/{index-C86jTuzO.d.ts → index-By2y-Zjz.d.ts} +2 -2
  74. package/dist/{index-CBppDr5R.d.ts → index-C2rKLkDO.d.ts} +1 -1
  75. package/dist/{index-7XwQGvrk.d.ts → index-CI1pmTNs.d.ts} +3 -3
  76. package/dist/{index-DuwmDJgm.d.ts → index-CI9oUkku.d.ts} +4 -4
  77. package/dist/{index-pb46GNxT.d.ts → index-CJDqp_om.d.ts} +1 -1
  78. package/dist/{index-DTWpYpA9.d.ts → index-CL2pdJDi.d.ts} +5 -5
  79. package/dist/{index-W18JT5Ey.d.ts → index-ChkulgEl.d.ts} +2 -2
  80. package/dist/index-DOnH4ePY.d.ts +75 -0
  81. package/dist/{index-DsuLq-mw.d.ts → index-DsQyEI6l.d.ts} +1 -1
  82. package/dist/{index-BQpj6_SN.d.ts → index-Du2b4ABa.d.ts} +3 -3
  83. package/dist/{index-B2PIaNMu.d.ts → index-DvbYyCcE.d.ts} +2 -2
  84. package/dist/{index-BsTs8mui.d.ts → index-IIjo6avX.d.ts} +1 -1
  85. package/dist/{index-BS68Mp68.d.ts → index-Qqzj3D38.d.ts} +6 -6
  86. package/dist/{index-BfVdqarn.d.ts → index-XBmzyFW4.d.ts} +2 -2
  87. package/dist/index.d.ts +22 -21
  88. package/dist/index.js +28 -27
  89. package/dist/info-summary.js +3 -3
  90. package/dist/input.d.ts +1 -1
  91. package/dist/input.js +6 -6
  92. package/dist/mask-modules.d.ts +1 -1
  93. package/dist/mask-modules.js +1 -1
  94. package/dist/popover.d.ts +2 -2
  95. package/dist/popover.js +4 -4
  96. package/dist/select.d.ts +2 -2
  97. package/dist/select.js +10 -10
  98. package/dist/skeleton.d.ts +1 -1
  99. package/dist/skeleton.js +2 -2
  100. package/dist/{styleProps-CntgA2bz.d.ts → styleProps-CrD6h1FM.d.ts} +1 -1
  101. package/dist/switch.d.ts +1 -1
  102. package/dist/switch.js +2 -2
  103. package/dist/tab-switch.d.ts +1 -1
  104. package/dist/tab-switch.js +3 -3
  105. package/dist/text-area.d.ts +1 -1
  106. package/dist/text-area.js +4 -4
  107. package/dist/theme-context.d.ts +1 -1
  108. package/dist/theme-context.js +1 -1
  109. package/dist/{types-DZ6gPTYT.d.ts → types-B-zFTnqe.d.ts} +3 -3
  110. package/dist/{types-DxP32BlE.d.ts → types-B4Yk1AUa.d.ts} +1 -1
  111. package/dist/{types-FwxL7aW5.d.ts → types-Cr3L1i9Q.d.ts} +1 -1
  112. package/dist/{types-NSbCuvRr.d.ts → types-n-gj1UXJ.d.ts} +3 -3
  113. package/dist/typography.d.ts +3 -3
  114. package/dist/typography.js +2 -2
  115. package/dist/use-dismiss.js +1 -1
  116. package/dist/use-floating.d.ts +1 -1
  117. package/dist/use-floating.js +1 -1
  118. package/dist/{useDismiss-b7_pOsxk.js → useDismiss-w2spkFNN.js} +1 -1
  119. package/dist/{useDismiss-b7_pOsxk.js.map → useDismiss-w2spkFNN.js.map} +1 -1
  120. package/dist/{useFloating-CS0qswZj.js → useFloating-BkMrolmn.js} +1 -1
  121. package/dist/{useFloating-CS0qswZj.js.map → useFloating-BkMrolmn.js.map} +1 -1
  122. package/dist/{useThemedStyles-ClPrd4wW.d.ts → useThemedStyles-0XwrILh9.d.ts} +1 -1
  123. package/dist/{useThemedStyles-BBJ_TF_l.js → useThemedStyles-CV4ryZLN.js} +1 -1
  124. package/dist/{useThemedStyles-BBJ_TF_l.js.map → useThemedStyles-CV4ryZLN.js.map} +1 -1
  125. package/package.json +5 -1
  126. /package/dist/{chunk-B5kfNaIQ.js → chunk-DBn-LkE6.js} +0 -0
@@ -1,5 +1,5 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Popover } from "./Popover-zLDtSQAp.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Popover } from "./Popover-tzAZp6V7.js";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/commons/structure/BasePopover/styles.ts
@@ -49,4 +49,4 @@ const BasePopover = (props) => {
49
49
 
50
50
  //#endregion
51
51
  export { BasePopover as t };
52
- //# sourceMappingURL=BasePopover-BYa7SBXE.js.map
52
+ //# sourceMappingURL=BasePopover-m1OfX3fO.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BasePopover-BYa7SBXE.js","names":["BasePopover: React.FC<BasePopoverProps>"],"sources":["../src/components/commons/structure/BasePopover/styles.ts","../src/components/commons/structure/BasePopover/index.tsx"],"sourcesContent":["// Types\nimport type { BasePopoverProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createBasePopoverStyles({\n maxWidth = 'unset',\n minWidth = 'fit-content',\n minHeight = 'fit-content',\n maxHeight = '15rem',\n panel\n}: BasePopoverProps) {\n return styled({\n content: {\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n\n display: 'flex',\n flexDirection: 'column',\n\n zIndex: 10,\n\n overflowY: 'auto',\n overflowX: 'hidden',\n overscrollBehavior: 'contain',\n\n borderWidth: 1,\n rowGap: '0.25rem',\n padding: panel?.padding ? panel.padding : '0.5rem',\n borderRadius: '0.75rem',\n\n backgroundColor: 'var(--px-bg)',\n boxShadow: 'var(--px-shadow-default)',\n borderColor: 'var(--px-border-primary)'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Components\nimport { Popover } from '@components/commons/toolkit/Popover'\n\n// Types\nimport type { BasePopoverProps } from './types'\n\n// Styles\nimport { createBasePopoverStyles } from './styles'\n\nexport const BasePopover: React.FC<BasePopoverProps> = props => {\n const { children, ...rest } = props\n\n const { styles } = useThemedStyles(props, createBasePopoverStyles, {\n applyCommonProps: false,\n pick: p => [p.open, p.trigger]\n })\n\n return (\n <Popover\n p={0}\n hideShadow\n {...rest}\n content={({ widthTrigger }) => (\n <div style={{ ...styles.content, width: widthTrigger }}>{children}</div>\n )}\n />\n )\n}\n"],"mappings":";;;;;AAIA,SAAgB,wBAAwB,EACtC,WAAW,SACX,WAAW,eACX,YAAY,eACZ,YAAY,SACZ,SACmB;AACnB,QAAO,OAAO,EACZ,SAAS;EACP;EACA;EACA;EACA;EAEA,SAAS;EACT,eAAe;EAEf,QAAQ;EAER,WAAW;EACX,WAAW;EACX,oBAAoB;EAEpB,aAAa;EACb,QAAQ;EACR,SAAS,OAAO,UAAU,MAAM,UAAU;EAC1C,cAAc;EAEd,iBAAiB;EACjB,WAAW;EACX,aAAa;EACd,EACF,CAAC;;;;;ACrBJ,MAAaA,eAA0C,UAAS;CAC9D,MAAM,EAAE,UAAU,GAAG,SAAS;CAE9B,MAAM,EAAE,WAAW,gBAAgB,OAAO,yBAAyB;EACjE,kBAAkB;EAClB,OAAM,MAAK,CAAC,EAAE,MAAM,EAAE,QAAQ;EAC/B,CAAC;AAEF,QACE,oBAAC;EACC,GAAG;EACH;EACA,GAAI;EACJ,UAAU,EAAE,mBACV,oBAAC;GAAI,OAAO;IAAE,GAAG,OAAO;IAAS,OAAO;IAAc;GAAG;IAAe;GAE1E"}
1
+ {"version":3,"file":"BasePopover-m1OfX3fO.js","names":["BasePopover: React.FC<BasePopoverProps>"],"sources":["../src/components/commons/structure/BasePopover/styles.ts","../src/components/commons/structure/BasePopover/index.tsx"],"sourcesContent":["// Types\nimport type { BasePopoverProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createBasePopoverStyles({\n maxWidth = 'unset',\n minWidth = 'fit-content',\n minHeight = 'fit-content',\n maxHeight = '15rem',\n panel\n}: BasePopoverProps) {\n return styled({\n content: {\n minWidth,\n maxWidth,\n minHeight,\n maxHeight,\n\n display: 'flex',\n flexDirection: 'column',\n\n zIndex: 10,\n\n overflowY: 'auto',\n overflowX: 'hidden',\n overscrollBehavior: 'contain',\n\n borderWidth: 1,\n rowGap: '0.25rem',\n padding: panel?.padding ? panel.padding : '0.5rem',\n borderRadius: '0.75rem',\n\n backgroundColor: 'var(--px-bg)',\n boxShadow: 'var(--px-shadow-default)',\n borderColor: 'var(--px-border-primary)'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Components\nimport { Popover } from '@components/commons/toolkit/Popover'\n\n// Types\nimport type { BasePopoverProps } from './types'\n\n// Styles\nimport { createBasePopoverStyles } from './styles'\n\nexport const BasePopover: React.FC<BasePopoverProps> = props => {\n const { children, ...rest } = props\n\n const { styles } = useThemedStyles(props, createBasePopoverStyles, {\n applyCommonProps: false,\n pick: p => [p.open, p.trigger]\n })\n\n return (\n <Popover\n p={0}\n hideShadow\n {...rest}\n content={({ widthTrigger }) => (\n <div style={{ ...styles.content, width: widthTrigger }}>{children}</div>\n )}\n />\n )\n}\n"],"mappings":";;;;;AAIA,SAAgB,wBAAwB,EACtC,WAAW,SACX,WAAW,eACX,YAAY,eACZ,YAAY,SACZ,SACmB;AACnB,QAAO,OAAO,EACZ,SAAS;EACP;EACA;EACA;EACA;EAEA,SAAS;EACT,eAAe;EAEf,QAAQ;EAER,WAAW;EACX,WAAW;EACX,oBAAoB;EAEpB,aAAa;EACb,QAAQ;EACR,SAAS,OAAO,UAAU,MAAM,UAAU;EAC1C,cAAc;EAEd,iBAAiB;EACjB,WAAW;EACX,aAAa;EACd,EACF,CAAC;;;;;ACrBJ,MAAaA,eAA0C,UAAS;CAC9D,MAAM,EAAE,UAAU,GAAG,SAAS;CAE9B,MAAM,EAAE,WAAW,gBAAgB,OAAO,yBAAyB;EACjE,kBAAkB;EAClB,OAAM,MAAK,CAAC,EAAE,MAAM,EAAE,QAAQ;EAC/B,CAAC;AAEF,QACE,oBAAC;EACC,GAAG;EACH;EACA,GAAI;EACJ,UAAU,EAAE,mBACV,oBAAC;GAAI,OAAO;IAAE,GAAG,OAAO;IAAS,OAAO;IAAc;GAAG;IAAe;GAE1E"}
@@ -1,6 +1,6 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Typography } from "./Typography-3tAIdGuj.js";
3
- import { t as Skeleton } from "./Skeleton-BPFVMk3-.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Typography } from "./Typography-BTJk47bm.js";
3
+ import { t as Skeleton } from "./Skeleton-iCdZ2Gai.js";
4
4
  import { Fragment } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
 
@@ -84,4 +84,4 @@ const Breadcrumb = (props) => {
84
84
 
85
85
  //#endregion
86
86
  export { Breadcrumb as t };
87
- //# sourceMappingURL=Breadcrumb-BLu27RXT.js.map
87
+ //# sourceMappingURL=Breadcrumb-Bm9YuwCq.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Breadcrumb-BLu27RXT.js","names":["BreadcrumbLoading: React.FC<Props>","Breadcrumb: React.FC<BreadcrumbProps>"],"sources":["../src/components/commons/structure/Breadcrumb/styles.ts","../src/components/commons/structure/Breadcrumb/components/BreadcrumbLoading.tsx","../src/components/commons/structure/Breadcrumb/index.tsx"],"sourcesContent":["// Types\nimport type { BreadcrumbProps } from './types'\nimport type { StyleMap } from '@hooks/useThemedStyles/types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createBreadcrumbStyles(_props: BreadcrumbProps): StyleMap {\n return styled({\n container: {\n display: 'flex',\n alignItems: 'center',\n columnGap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Skeleton } from '../../Skeleton'\n\ninterface Props {\n itemsCount: number\n}\n\nexport const BreadcrumbLoading: React.FC<Props> = ({ itemsCount }) => {\n // Functions\n function renderContent() {\n return Array.from({ length: itemsCount }).map((_, index) => (\n <Skeleton\n key={`breadcrumb-skeleton-${index + 1}`}\n width=\"5rem\"\n height=\"1rem\"\n />\n ))\n }\n\n return <div>{renderContent()}</div>\n}\n","// External Libraries\nimport type React from 'react'\nimport { Fragment } from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { BreadcrumbProps } from './types'\n\n// Styles\nimport { createBreadcrumbStyles } from './styles'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { BreadcrumbLoading } from './components/BreadcrumbLoading'\nimport { Skeleton } from '../Skeleton'\n\nexport const Breadcrumb: React.FC<BreadcrumbProps> = props => {\n const {\n icon,\n labelSize = '0.875rem',\n isLoading,\n separator,\n items,\n loadingItemsCount = 3\n } = props\n\n const { styles } = useThemedStyles(props, createBreadcrumbStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p]\n })\n\n function renderContent() {\n if (isLoading) {\n return <BreadcrumbLoading itemsCount={loadingItemsCount} />\n }\n\n return items.map((item, index) => {\n const isLast = index === items.length - 1\n const hasAction = !!item.onClick || !!item.href\n\n const content =\n hasAction && !isLast ? (\n item.href ? (\n <a href={item.href} style={{ cursor: 'pointer' }}>\n <Typography\n as=\"span\"\n variant=\"b3\"\n color=\"var(--px-text-secondary)\"\n fontSize={labelSize}\n >\n {item.label}\n </Typography>\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={item.onClick}\n style={{ cursor: 'pointer' }}\n >\n <Typography\n as=\"span\"\n variant=\"b3\"\n color=\"var(--px-text-secondary)\"\n fontSize={labelSize}\n >\n {item.label}\n </Typography>\n </button>\n )\n ) : (\n <Typography\n as=\"span\"\n variant=\"b3\"\n color=\"var(--px-text-secondary)\"\n fontSize={labelSize}\n >\n {item.label}\n </Typography>\n )\n\n return (\n <Fragment key={`${item.type}-${item.label}`}>\n {content}\n\n {!isLast && (\n <Typography as=\"span\" variant=\"b3\" color=\"var(--px-text-secondary)\">\n {separator ?? '/'}\n </Typography>\n )}\n </Fragment>\n )\n })\n }\n\n return (\n <div style={styles.container}>\n {isLoading ? <Skeleton width=\"1.25rem\" height=\"1.25rem\" /> : icon}\n\n {renderContent()}\n </div>\n )\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,uBAAuB,QAAmC;AACxE,QAAO,OAAO,EACZ,WAAW;EACT,SAAS;EACT,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;;AAGJ,QACE,qBAAC;EAAI,OAAO,OAAO;aAChB,YAAY,oBAAC;GAAS,OAAM;GAAU,QAAO;IAAY,GAAG,MAE5D,eAAe;GACZ"}
1
+ {"version":3,"file":"Breadcrumb-Bm9YuwCq.js","names":["BreadcrumbLoading: React.FC<Props>","Breadcrumb: React.FC<BreadcrumbProps>"],"sources":["../src/components/commons/structure/Breadcrumb/styles.ts","../src/components/commons/structure/Breadcrumb/components/BreadcrumbLoading.tsx","../src/components/commons/structure/Breadcrumb/index.tsx"],"sourcesContent":["// Types\nimport type { BreadcrumbProps } from './types'\nimport type { StyleMap } from '@hooks/useThemedStyles/types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createBreadcrumbStyles(_props: BreadcrumbProps): StyleMap {\n return styled({\n container: {\n display: 'flex',\n alignItems: 'center',\n columnGap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Skeleton } from '../../Skeleton'\n\ninterface Props {\n itemsCount: number\n}\n\nexport const BreadcrumbLoading: React.FC<Props> = ({ itemsCount }) => {\n // Functions\n function renderContent() {\n return Array.from({ length: itemsCount }).map((_, index) => (\n <Skeleton\n key={`breadcrumb-skeleton-${index + 1}`}\n width=\"5rem\"\n height=\"1rem\"\n />\n ))\n }\n\n return <div>{renderContent()}</div>\n}\n","// External Libraries\nimport type React from 'react'\nimport { Fragment } from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { BreadcrumbProps } from './types'\n\n// Styles\nimport { createBreadcrumbStyles } from './styles'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\nimport { BreadcrumbLoading } from './components/BreadcrumbLoading'\nimport { Skeleton } from '../Skeleton'\n\nexport const Breadcrumb: React.FC<BreadcrumbProps> = props => {\n const {\n icon,\n labelSize = '0.875rem',\n isLoading,\n separator,\n items,\n loadingItemsCount = 3\n } = props\n\n const { styles } = useThemedStyles(props, createBreadcrumbStyles, {\n applyCommonProps: true,\n override: props.styles,\n pick: p => [p]\n })\n\n function renderContent() {\n if (isLoading) {\n return <BreadcrumbLoading itemsCount={loadingItemsCount} />\n }\n\n return items.map((item, index) => {\n const isLast = index === items.length - 1\n const hasAction = !!item.onClick || !!item.href\n\n const content =\n hasAction && !isLast ? (\n item.href ? (\n <a href={item.href} style={{ cursor: 'pointer' }}>\n <Typography\n as=\"span\"\n variant=\"b3\"\n color=\"var(--px-text-secondary)\"\n fontSize={labelSize}\n >\n {item.label}\n </Typography>\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={item.onClick}\n style={{ cursor: 'pointer' }}\n >\n <Typography\n as=\"span\"\n variant=\"b3\"\n color=\"var(--px-text-secondary)\"\n fontSize={labelSize}\n >\n {item.label}\n </Typography>\n </button>\n )\n ) : (\n <Typography\n as=\"span\"\n variant=\"b3\"\n color=\"var(--px-text-secondary)\"\n fontSize={labelSize}\n >\n {item.label}\n </Typography>\n )\n\n return (\n <Fragment key={`${item.type}-${item.label}`}>\n {content}\n\n {!isLast && (\n <Typography as=\"span\" variant=\"b3\" color=\"var(--px-text-secondary)\">\n {separator ?? '/'}\n </Typography>\n )}\n </Fragment>\n )\n })\n }\n\n return (\n <div style={styles.container}>\n {isLoading ? <Skeleton width=\"1.25rem\" height=\"1.25rem\" /> : icon}\n\n {renderContent()}\n </div>\n )\n}\n"],"mappings":";;;;;;;AAKA,SAAgB,uBAAuB,QAAmC;AACxE,QAAO,OAAO,EACZ,WAAW;EACT,SAAS;EACT,YAAY;EACZ,WAAW;EACZ,EACF,CAAC;;;;;ACFJ,MAAaA,qBAAsC,EAAE,iBAAiB;CAEpE,SAAS,gBAAgB;AACvB,SAAO,MAAM,KAAK,EAAE,QAAQ,YAAY,CAAC,CAAC,KAAK,GAAG,UAChD,oBAAC;GAEC,OAAM;GACN,QAAO;KAFF,uBAAuB,QAAQ,IAGpC,CACF;;AAGJ,QAAO,oBAAC,mBAAK,eAAe,GAAO;;;;;ACJrC,MAAaC,cAAwC,UAAS;CAC5D,MAAM,EACJ,MACA,YAAY,YACZ,WACA,WACA,OACA,oBAAoB,MAClB;CAEJ,MAAM,EAAE,WAAW,gBAAgB,OAAO,wBAAwB;EAChE,kBAAkB;EAClB,UAAU,MAAM;EAChB,OAAM,MAAK,CAAC,EAAE;EACf,CAAC;CAEF,SAAS,gBAAgB;AACvB,MAAI,UACF,QAAO,oBAAC,qBAAkB,YAAY,oBAAqB;AAG7D,SAAO,MAAM,KAAK,MAAM,UAAU;GAChC,MAAM,SAAS,UAAU,MAAM,SAAS;AA2CxC,UACE,qBAAC,wBA3Ce,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,KAAK,SAG5B,CAAC,SACZ,KAAK,OACH,oBAAC;IAAE,MAAM,KAAK;IAAM,OAAO,EAAE,QAAQ,WAAW;cAC9C,oBAAC;KACC,IAAG;KACH,SAAQ;KACR,OAAM;KACN,UAAU;eAET,KAAK;MACK;KACX,GAEJ,oBAAC;IACC,MAAK;IACL,SAAS,KAAK;IACd,OAAO,EAAE,QAAQ,WAAW;cAE5B,oBAAC;KACC,IAAG;KACH,SAAQ;KACR,OAAM;KACN,UAAU;eAET,KAAK;MACK;KACN,GAGX,oBAAC;IACC,IAAG;IACH,SAAQ;IACR,OAAM;IACN,UAAU;cAET,KAAK;KACK,EAOZ,CAAC,UACA,oBAAC;IAAW,IAAG;IAAO,SAAQ;IAAK,OAAM;cACtC,aAAa;KACH,KANF,GAAG,KAAK,KAAK,GAAG,KAAK,QAQzB;IAEb;;AAGJ,QACE,qBAAC;EAAI,OAAO,OAAO;aAChB,YAAY,oBAAC;GAAS,OAAM;GAAU,QAAO;IAAY,GAAG,MAE5D,eAAe;GACZ"}
@@ -1,6 +1,6 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Typography } from "./Typography-3tAIdGuj.js";
3
- import { t as Loader } from "./Loader-CmESHuyP.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Typography } from "./Typography-BTJk47bm.js";
3
+ import { t as Loader } from "./Loader-DUqRFMzl.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { AnimatePresence, motion } from "framer-motion";
6
6
 
@@ -162,4 +162,4 @@ const Button = ({ type = "button", variant = "filled", ...rest }) => {
162
162
 
163
163
  //#endregion
164
164
  export { Button as t };
165
- //# sourceMappingURL=Button-BVxsixz_.js.map
165
+ //# sourceMappingURL=Button-Vm1Odbi_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Button-BVxsixz_.js","names":["ButtonLoader: React.FC<Props>","Button: React.FC<ButtonProps>"],"sources":["../src/components/commons/buttons/Button/components/ButtonLoader/styles.ts","../src/components/commons/buttons/Button/components/ButtonLoader/index.tsx","../src/components/commons/buttons/Button/styles.ts","../src/components/commons/buttons/Button/index.tsx"],"sourcesContent":["// Types\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport function createButtonLoaderStyles(): StyleMap {\n return styled({\n container: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n borderRadius: 'var(--px-border-radius-button)',\n backgroundColor: 'inherit'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { motion } from 'framer-motion'\n\n// Components\nimport { Loader } from '@components/commons/toolkit/Loader'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createButtonLoaderStyles } from './styles'\n\ntype Props = {\n color: string\n}\n\nexport const ButtonLoader: React.FC<Props> = ({ color }) => {\n // Hooks\n const { styles } = useThemedStyles({}, createButtonLoaderStyles, {})\n\n return (\n <motion.div\n style={styles.container}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n >\n <Loader color={color} />\n </motion.div>\n )\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\nimport type { ButtonProps, ButtonSize, ButtonVariant } from './types'\n\nexport function createButtonStyles({\n size,\n color,\n variant,\n fullWidth,\n textAlign,\n outlineColor\n}: ButtonProps) {\n const finalVariant = variant ?? 'filled'\n\n return styled({\n container: {\n minHeight: getSize(size ?? 'md'),\n width: fullWidth ? '100%' : 'fit-content',\n\n position: 'relative',\n display: 'flex',\n justifyContent: textAlign || 'center',\n\n padding: '0.625rem var(--px-space-xl)',\n gap: 'var(--px-space-sm)',\n\n borderRadius: 'var(--px-radius-lg)',\n\n cursor: 'pointer',\n overflow: 'hidden',\n\n transition: 'background-color 0.5s',\n\n border: getBorder(finalVariant, outlineColor || color),\n backgroundColor: getBackgroundColor(finalVariant, color),\n boxShadow: variant === 'outlined' ? 'var(--px-shadow-xs)' : 'none',\n\n __rules: {\n '&:hover': {\n opacity: '0.85 !important'\n },\n\n '&:disabled': {\n opacity: '0.5 !important',\n cursor: 'not-allowed !important'\n },\n\n '&:focus': {\n outlineOffset: '2px',\n outline: '2px solid var(--px-color-primary) !important'\n }\n }\n },\n\n content: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n\n padding: '0',\n borderRadius: 'inherit',\n\n whiteSpace: 'nowrap',\n columnGap: 'var(--px-space-sm)',\n\n backgroundColor: 'inherit'\n }\n })\n}\n\nfunction getSize(size: ButtonSize | string): string {\n switch (size) {\n case 'lg':\n return '3.25rem'\n case 'md':\n return '2.75rem'\n case 'sm':\n return '2.25rem'\n case 'xs':\n return '1.75rem'\n default:\n return size\n }\n}\n\nfunction getBackgroundColor(variant: ButtonVariant, color?: string): string {\n if (color) return color\n\n if (variant === 'filled') return 'var(--px-btn-filled-bg)'\n\n if (variant === 'outlined') return 'transparent'\n\n if (variant === 'ghost') return 'transparent'\n\n return 'var(--px-btn-filled-bg)'\n}\n\nfunction getBorder(variant: ButtonVariant, color?: string): string {\n if (color) return `1px solid ${color}`\n\n if (variant === 'filled') return '1px solid var(--px-btn-filled-bg)'\n\n if (variant === 'outlined') return '1px solid var(--px-border-primary)'\n\n if (variant === 'ghost') return 'none'\n\n return '1px solid var(--px-color-primary)'\n}\n\nexport function getTextColor({ variant, labelColor }: ButtonProps): string {\n if (labelColor) return labelColor\n\n if (variant === 'filled') return 'var(--px-btn-filled-label)'\n\n if (variant === 'outlined') return 'var(--px-btn-outlined-label)'\n\n if (variant === 'ghost') return '--px-btn-ghost-label'\n\n return 'var(--px-btn-filled-label)'\n}\n","// External Libraries\nimport type React from 'react'\nimport type { MouseEvent } from 'react'\nimport { AnimatePresence } from 'framer-motion'\n\n// Components\nimport { ButtonLoader } from './components/ButtonLoader'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ButtonProps } from './types'\n\n// Styles\nimport { createButtonStyles, getTextColor } from './styles'\n\nexport const Button: React.FC<ButtonProps> = ({\n type = 'button',\n variant = 'filled',\n ...rest\n}) => {\n // Constants\n const disabled = rest.disabled || rest.loading\n const resolvedProps = { type, variant, disabled, ...rest }\n const textColor = getTextColor(resolvedProps)\n const { label, endIcon, startIcon, loading } = resolvedProps\n\n // Hooks\n const { styles, classes } = useThemedStyles(\n resolvedProps,\n createButtonStyles,\n {\n override: rest.styles,\n applyCommonProps: true,\n commonSlot: 'container',\n pick: p => [p.disabled, p.loading, p.variant, p.label, p.color]\n }\n )\n\n // Functions\n function handleButtonClick(event: MouseEvent<HTMLButtonElement>) {\n if (disabled) return\n\n if (rest.onClick) rest.onClick(event)\n }\n\n return (\n <button\n type={type}\n disabled={disabled}\n aria-busy={rest.loading}\n style={styles.container}\n className={classes.container}\n onClick={handleButtonClick}\n >\n <div style={styles.content}>\n {startIcon ?? null}\n\n <Typography\n color={textColor}\n fontSize={resolvedProps.fontSize}\n variant={rest.labelVariant || 'b1'}\n >\n {label}\n </Typography>\n\n {endIcon ?? null}\n\n {loading ? (\n <AnimatePresence>\n <ButtonLoader color={textColor} />\n </AnimatePresence>\n ) : null}\n </div>\n </button>\n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KACP,UAAU,cAAc;KACxB,SAAS,KAAK,gBAAgB;eAE7B;MACU;IAEZ,WAAW;IAEX,UACC,oBAAC,6BACC,oBAAC,gBAAa,OAAO,YAAa,GAClB,GAChB;;IACA;GACC"}
1
+ {"version":3,"file":"Button-Vm1Odbi_.js","names":["ButtonLoader: React.FC<Props>","Button: React.FC<ButtonProps>"],"sources":["../src/components/commons/buttons/Button/components/ButtonLoader/styles.ts","../src/components/commons/buttons/Button/components/ButtonLoader/index.tsx","../src/components/commons/buttons/Button/styles.ts","../src/components/commons/buttons/Button/index.tsx"],"sourcesContent":["// Types\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport function createButtonLoaderStyles(): StyleMap {\n return styled({\n container: {\n position: 'absolute',\n top: 0,\n left: 0,\n right: 0,\n bottom: 0,\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n borderRadius: 'var(--px-border-radius-button)',\n backgroundColor: 'inherit'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { motion } from 'framer-motion'\n\n// Components\nimport { Loader } from '@components/commons/toolkit/Loader'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createButtonLoaderStyles } from './styles'\n\ntype Props = {\n color: string\n}\n\nexport const ButtonLoader: React.FC<Props> = ({ color }) => {\n // Hooks\n const { styles } = useThemedStyles({}, createButtonLoaderStyles, {})\n\n return (\n <motion.div\n style={styles.container}\n initial={{ opacity: 0 }}\n animate={{ opacity: 1 }}\n exit={{ opacity: 0 }}\n >\n <Loader color={color} />\n </motion.div>\n )\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\nimport type { ButtonProps, ButtonSize, ButtonVariant } from './types'\n\nexport function createButtonStyles({\n size,\n color,\n variant,\n fullWidth,\n textAlign,\n outlineColor\n}: ButtonProps) {\n const finalVariant = variant ?? 'filled'\n\n return styled({\n container: {\n minHeight: getSize(size ?? 'md'),\n width: fullWidth ? '100%' : 'fit-content',\n\n position: 'relative',\n display: 'flex',\n justifyContent: textAlign || 'center',\n\n padding: '0.625rem var(--px-space-xl)',\n gap: 'var(--px-space-sm)',\n\n borderRadius: 'var(--px-radius-lg)',\n\n cursor: 'pointer',\n overflow: 'hidden',\n\n transition: 'background-color 0.5s',\n\n border: getBorder(finalVariant, outlineColor || color),\n backgroundColor: getBackgroundColor(finalVariant, color),\n boxShadow: variant === 'outlined' ? 'var(--px-shadow-xs)' : 'none',\n\n __rules: {\n '&:hover': {\n opacity: '0.85 !important'\n },\n\n '&:disabled': {\n opacity: '0.5 !important',\n cursor: 'not-allowed !important'\n },\n\n '&:focus': {\n outlineOffset: '2px',\n outline: '2px solid var(--px-color-primary) !important'\n }\n }\n },\n\n content: {\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n\n padding: '0',\n borderRadius: 'inherit',\n\n whiteSpace: 'nowrap',\n columnGap: 'var(--px-space-sm)',\n\n backgroundColor: 'inherit'\n }\n })\n}\n\nfunction getSize(size: ButtonSize | string): string {\n switch (size) {\n case 'lg':\n return '3.25rem'\n case 'md':\n return '2.75rem'\n case 'sm':\n return '2.25rem'\n case 'xs':\n return '1.75rem'\n default:\n return size\n }\n}\n\nfunction getBackgroundColor(variant: ButtonVariant, color?: string): string {\n if (color) return color\n\n if (variant === 'filled') return 'var(--px-btn-filled-bg)'\n\n if (variant === 'outlined') return 'transparent'\n\n if (variant === 'ghost') return 'transparent'\n\n return 'var(--px-btn-filled-bg)'\n}\n\nfunction getBorder(variant: ButtonVariant, color?: string): string {\n if (color) return `1px solid ${color}`\n\n if (variant === 'filled') return '1px solid var(--px-btn-filled-bg)'\n\n if (variant === 'outlined') return '1px solid var(--px-border-primary)'\n\n if (variant === 'ghost') return 'none'\n\n return '1px solid var(--px-color-primary)'\n}\n\nexport function getTextColor({ variant, labelColor }: ButtonProps): string {\n if (labelColor) return labelColor\n\n if (variant === 'filled') return 'var(--px-btn-filled-label)'\n\n if (variant === 'outlined') return 'var(--px-btn-outlined-label)'\n\n if (variant === 'ghost') return '--px-btn-ghost-label'\n\n return 'var(--px-btn-filled-label)'\n}\n","// External Libraries\nimport type React from 'react'\nimport type { MouseEvent } from 'react'\nimport { AnimatePresence } from 'framer-motion'\n\n// Components\nimport { ButtonLoader } from './components/ButtonLoader'\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ButtonProps } from './types'\n\n// Styles\nimport { createButtonStyles, getTextColor } from './styles'\n\nexport const Button: React.FC<ButtonProps> = ({\n type = 'button',\n variant = 'filled',\n ...rest\n}) => {\n // Constants\n const disabled = rest.disabled || rest.loading\n const resolvedProps = { type, variant, disabled, ...rest }\n const textColor = getTextColor(resolvedProps)\n const { label, endIcon, startIcon, loading } = resolvedProps\n\n // Hooks\n const { styles, classes } = useThemedStyles(\n resolvedProps,\n createButtonStyles,\n {\n override: rest.styles,\n applyCommonProps: true,\n commonSlot: 'container',\n pick: p => [p.disabled, p.loading, p.variant, p.label, p.color]\n }\n )\n\n // Functions\n function handleButtonClick(event: MouseEvent<HTMLButtonElement>) {\n if (disabled) return\n\n if (rest.onClick) rest.onClick(event)\n }\n\n return (\n <button\n type={type}\n disabled={disabled}\n aria-busy={rest.loading}\n style={styles.container}\n className={classes.container}\n onClick={handleButtonClick}\n >\n <div style={styles.content}>\n {startIcon ?? null}\n\n <Typography\n color={textColor}\n fontSize={resolvedProps.fontSize}\n variant={rest.labelVariant || 'b1'}\n >\n {label}\n </Typography>\n\n {endIcon ?? null}\n\n {loading ? (\n <AnimatePresence>\n <ButtonLoader color={textColor} />\n </AnimatePresence>\n ) : null}\n </div>\n </button>\n )\n}\n"],"mappings":";;;;;;;AAGA,SAAgB,2BAAqC;AACnD,QAAO,OAAO,EACZ,WAAW;EACT,UAAU;EACV,KAAK;EACL,MAAM;EACN,OAAO;EACP,QAAQ;EAER,SAAS;EACT,YAAY;EACZ,gBAAgB;EAEhB,cAAc;EACd,iBAA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./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Icon } from "./Icon-RM-EqP7I.js";
3
- import { t as Typography } from "./Typography-3tAIdGuj.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Icon } from "./Icon-CV5fAqK7.js";
3
+ import { t as Typography } from "./Typography-BTJk47bm.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/components/commons/toolkit/CheckItem/styles.ts
@@ -45,4 +45,4 @@ const CheckItem = (props) => {
45
45
 
46
46
  //#endregion
47
47
  export { CheckItem as t };
48
- //# sourceMappingURL=CheckItem-B5O_5_Qd.js.map
48
+ //# sourceMappingURL=CheckItem-3d-2-qZe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CheckItem-B5O_5_Qd.js","names":["CheckItem: React.FC<CheckItemProps>"],"sources":["../src/components/commons/toolkit/CheckItem/styles.ts","../src/components/commons/toolkit/CheckItem/index.tsx"],"sourcesContent":["// Types\nimport type { CheckItemProps } from './types'\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport function createCheckItemStyles({ checked }: CheckItemProps): StyleMap {\n return styled({\n container: {\n display: 'flex',\n flexDirection: 'row',\n columnGap: 'var(--px-space-sm)'\n },\n\n iconContainer: {\n width: '20px',\n height: '20px',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: checked\n ? 'var(--px-color-success)'\n : 'var(--px-color-disabled)',\n\n borderRadius: '50%'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { CheckItemProps } from './types'\n\n// Styles\nimport { createCheckItemStyles } from './styles'\n\nexport const CheckItem: React.FC<CheckItemProps> = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createCheckItemStyles)\n\n return (\n <div style={styles.container}>\n <div style={styles.iconContainer}>\n <Icon name=\"general-check\" color=\"white\" size=\"sm\" />\n </div>\n\n <Typography variant=\"b2\">{props.label}</Typography>\n </div>\n )\n}\n"],"mappings":";;;;;;AAIA,SAAgB,sBAAsB,EAAE,WAAqC;AAC3E,QAAO,OAAO;EACZ,WAAW;GACT,SAAS;GACT,eAAe;GACf,WAAW;GACZ;EAED,eAAe;GACb,OAAO;GACP,QAAQ;GAER,SAAS;GACT,YAAY;GACZ,gBAAgB;GAEhB,iBAAiB,UACb,4BACA;GAEJ,cAAc;GACf;EACF,CAAC;;;;;ACVJ,MAAaA,aAAsC,UAAS;CAE1D,MAAM,EAAE,WAAW,gBAAgB,OAAO,sBAAsB;AAEhE,QACE,qBAAC;EAAI,OAAO,OAAO;aACjB,oBAAC;GAAI,OAAO,OAAO;aACjB,oBAAC;IAAK,MAAK;IAAgB,OAAM;IAAQ,MAAK;KAAO;IACjD,EAEN,oBAAC;GAAW,SAAQ;aAAM,MAAM;IAAmB;GAC/C"}
1
+ {"version":3,"file":"CheckItem-3d-2-qZe.js","names":["CheckItem: React.FC<CheckItemProps>"],"sources":["../src/components/commons/toolkit/CheckItem/styles.ts","../src/components/commons/toolkit/CheckItem/index.tsx"],"sourcesContent":["// Types\nimport type { CheckItemProps } from './types'\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport function createCheckItemStyles({ checked }: CheckItemProps): StyleMap {\n return styled({\n container: {\n display: 'flex',\n flexDirection: 'row',\n columnGap: 'var(--px-space-sm)'\n },\n\n iconContainer: {\n width: '20px',\n height: '20px',\n\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: checked\n ? 'var(--px-color-success)'\n : 'var(--px-color-disabled)',\n\n borderRadius: '50%'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Icon } from '../Icon'\nimport { Typography } from '../Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { CheckItemProps } from './types'\n\n// Styles\nimport { createCheckItemStyles } from './styles'\n\nexport const CheckItem: React.FC<CheckItemProps> = props => {\n // Hooks\n const { styles } = useThemedStyles(props, createCheckItemStyles)\n\n return (\n <div style={styles.container}>\n <div style={styles.iconContainer}>\n <Icon name=\"general-check\" color=\"white\" size=\"sm\" />\n </div>\n\n <Typography variant=\"b2\">{props.label}</Typography>\n </div>\n )\n}\n"],"mappings":";;;;;;AAIA,SAAgB,sBAAsB,EAAE,WAAqC;AAC3E,QAAO,OAAO;EACZ,WAAW;GACT,SAAS;GACT,eAAe;GACf,WAAW;GACZ;EAED,eAAe;GACb,OAAO;GACP,QAAQ;GAER,SAAS;GACT,YAAY;GACZ,gBAAgB;GAEhB,iBAAiB,UACb,4BACA;GAEJ,cAAc;GACf;EACF,CAAC;;;;;ACVJ,MAAaA,aAAsC,UAAS;CAE1D,MAAM,EAAE,WAAW,gBAAgB,OAAO,sBAAsB;AAEhE,QACE,qBAAC;EAAI,OAAO,OAAO;aACjB,oBAAC;GAAI,OAAO,OAAO;aACjB,oBAAC;IAAK,MAAK;IAAgB,OAAM;IAAQ,MAAK;KAAO;IACjD,EAEN,oBAAC;GAAW,SAAQ;aAAM,MAAM;IAAmB;GAC/C"}
@@ -1,6 +1,6 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Icon } from "./Icon-RM-EqP7I.js";
3
- import { t as Typography } from "./Typography-3tAIdGuj.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Icon } from "./Icon-CV5fAqK7.js";
3
+ import { t as Typography } from "./Typography-BTJk47bm.js";
4
4
  import { useId } from "react";
5
5
  import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { Checkbox, Label } from "radix-ui";
@@ -165,4 +165,4 @@ const Checkbox$1 = (props) => {
165
165
 
166
166
  //#endregion
167
167
  export { Checkbox$1 as t };
168
- //# sourceMappingURL=Checkbox-CsSo3vk0.js.map
168
+ //# sourceMappingURL=Checkbox-aFsrig0i.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Checkbox-CsSo3vk0.js","names":["Label: React.FC<LabelProps>","LabelRadix","CHECKBOX_STYLES: Record<string, StyleMap>","Checkbox: React.FC<CheckboxProps>","CheckboxRadix","checked","Label"],"sources":["../src/components/commons/toolkit/Checkbox/components/Label/styles.ts","../src/components/commons/toolkit/Checkbox/components/Label/index.tsx","../src/components/commons/toolkit/Checkbox/hooks/useCheckbox.ts","../src/components/commons/toolkit/Checkbox/styles.ts","../src/utils/functions/getContrastingTextColor.ts","../src/components/commons/toolkit/Checkbox/index.tsx"],"sourcesContent":["// Types\nimport type { LabelProps } from './types'\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport function createLabelStyles(props: LabelProps): StyleMap {\n const { disabled } = props\n\n return styled({\n container: {\n userSelect: 'none',\n opacity: disabled ? 0.6 : 1,\n cursor: disabled ? 'not-allowed' : 'pointer',\n\n transition: 'all 200ms',\n\n __rules: {\n ':hover': { color: 'var(--px-color-secondary)' }\n }\n }\n })\n}\n","// External libraries\nimport { Label as LabelRadix } from 'radix-ui'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { LabelProps } from './types'\n\n// Styles\nimport { createLabelStyles } from './styles'\n\nexport const Label: React.FC<LabelProps> = props => {\n const { idFor, label, labelVariant } = props\n\n // Hooks\n const { styles } = useThemedStyles(props, createLabelStyles, {\n pick: p => [p.disabled, p.labelVariant, p.label],\n applyCommonProps: true\n })\n\n return (\n <LabelRadix.Root htmlFor={idFor} style={styles.container}>\n <Typography variant={labelVariant ?? 'b1'} fontWeight=\"regular\">\n {label}\n </Typography>\n </LabelRadix.Root>\n )\n}\n","// External libraries\nimport { useId } from 'react'\n\nexport function useCheckbox() {\n return {\n id: useId()\n }\n}\n","// Types\nimport type { CheckboxProps } from './types'\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport const CHECKBOX_STYLES: Record<string, StyleMap> = {\n size: {\n sm: { width: '1rem', height: '1rem' },\n md: { width: '1.25rem', height: '1.25rem' },\n lg: { width: '1.5rem', height: '1.5rem' }\n },\n radius: {\n none: { borderRadius: 0 },\n sm: { borderRadius: '0.25rem' },\n md: { borderRadius: '0.375rem' },\n lg: { borderRadius: '0.5rem' },\n full: { borderRadius: '100%' }\n }\n}\n\nexport function createCheckBoxStyles(props: CheckboxProps) {\n const {\n color,\n checked,\n size = 'md',\n radius = 'md',\n disabled = false,\n labelPlacement = 'right'\n } = props\n\n const focusIndicatorOffsetColor = '#fff'\n\n return styled({\n container: {\n display: 'flex',\n columnGap: '0.5rem',\n alignItems: 'center',\n '--px-ring-color': color ?? undefined,\n flexDirection: labelPlacement === 'right' ? 'row' : 'row-reverse'\n },\n\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: checked ? color : 'white',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: checked ? color : 'var(--px-border-primary, #e5e7eb)',\n\n transition: 'color 200ms',\n opacity: disabled ? 0.5 : 1,\n cursor: disabled ? 'not-allowed' : 'pointer',\n\n ...(CHECKBOX_STYLES.size[size] as any),\n ...(CHECKBOX_STYLES.radius[radius] as any),\n\n __rules: {\n '&:hover': { borderColor: 'var(--px-border-secondary, #e5e7eb)' },\n '&:focus-visible': {\n outline: 'none',\n boxShadow: `0 0 0 2px ${focusIndicatorOffsetColor}, 0 0 0 4px var(--px-ring-color, #2b2b2bff)`\n }\n }\n },\n\n indicator: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: 'var(--px-text-primary, #4b5563)'\n }\n })\n}\n","/**\n * Returns the contrasting text color for a given background color.\n * @param backgroundColor hexadecimal color (i.e.: \"#ffffff\", \"#000\", \"#ffcc00\")\n */\nexport function getContrastingTextColor(\n backgroundColor: string\n): 'black' | 'white' {\n let hex = backgroundColor.replace('#', '')\n\n if (hex.length === 3) {\n hex = hex\n .split('')\n .map(c => c + c)\n .join('')\n }\n\n if (hex.length === 8) {\n hex = hex.substring(0, 6)\n }\n\n if (hex.length !== 6) return 'black'\n\n const r = parseInt(hex.substring(0, 2), 16)\n const g = parseInt(hex.substring(2, 4), 16)\n const b = parseInt(hex.substring(4, 6), 16)\n\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255\n\n return luminance > 0.6 ? 'black' : 'white'\n}\n","// External Libraries\nimport type React from 'react'\nimport { Checkbox as CheckboxRadix } from 'radix-ui'\n\n// Components\nimport { Icon } from '../Icon'\nimport { Label } from './components/Label'\n\n// Hooks\nimport { useCheckbox } from './hooks/useCheckbox'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { CheckboxProps } from './types'\n\n// Styles\nimport { createCheckBoxStyles } from './styles'\nimport { getContrastingTextColor } from '@utils/functions'\n\nexport const Checkbox: React.FC<CheckboxProps> = props => {\n const {\n icon,\n label,\n color,\n labelVariant,\n checked = false,\n disabled = false,\n onChange\n } = props\n\n const iconColor = color ? getContrastingTextColor(color) : undefined\n\n // Hooks\n const { id } = useCheckbox()\n\n const { styles, classes } = useThemedStyles(props, createCheckBoxStyles)\n\n return (\n <div style={styles.container}>\n <CheckboxRadix.Root\n style={styles.root}\n className={classes.root}\n id={id}\n tabIndex={0}\n checked={checked}\n disabled={disabled}\n onCheckedChange={checked => onChange(checked === true)}\n >\n <CheckboxRadix.Indicator style={styles.indicator}>\n {icon ?? <Icon name=\"general-check\" size=\"sm\" color={iconColor} />}\n </CheckboxRadix.Indicator>\n </CheckboxRadix.Root>\n\n {label ? (\n <Label\n idFor={id}\n label={label}\n disabled={disabled}\n labelVariant={labelVariant}\n />\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAIA,SAAgB,kBAAkB,OAA6B;CAC7D,MAAM,EAAE,aAAa;AAErB,QAAO,OAAO,EACZ,WAAW;EACT,YAAY;EACZ,SA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;aAEtD,oBAACD,SAAc;IAAU,OAAO,OAAO;cACpC,QAAQ,oBAAC;KAAK,MAAK;KAAgB,MAAK;KAAK,OAAO;MAAa;KAC1C;IACP,EAEpB,QACC,oBAACE;GACC,OAAO;GACA;GACG;GACI;IACd,GACA;GACA"}
1
+ {"version":3,"file":"Checkbox-aFsrig0i.js","names":["Label: React.FC<LabelProps>","LabelRadix","CHECKBOX_STYLES: Record<string, StyleMap>","Checkbox: React.FC<CheckboxProps>","CheckboxRadix","checked","Label"],"sources":["../src/components/commons/toolkit/Checkbox/components/Label/styles.ts","../src/components/commons/toolkit/Checkbox/components/Label/index.tsx","../src/components/commons/toolkit/Checkbox/hooks/useCheckbox.ts","../src/components/commons/toolkit/Checkbox/styles.ts","../src/utils/functions/getContrastingTextColor.ts","../src/components/commons/toolkit/Checkbox/index.tsx"],"sourcesContent":["// Types\nimport type { LabelProps } from './types'\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport function createLabelStyles(props: LabelProps): StyleMap {\n const { disabled } = props\n\n return styled({\n container: {\n userSelect: 'none',\n opacity: disabled ? 0.6 : 1,\n cursor: disabled ? 'not-allowed' : 'pointer',\n\n transition: 'all 200ms',\n\n __rules: {\n ':hover': { color: 'var(--px-color-secondary)' }\n }\n }\n })\n}\n","// External libraries\nimport { Label as LabelRadix } from 'radix-ui'\n\n// Components\nimport { Typography } from '@components/commons/toolkit/Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { LabelProps } from './types'\n\n// Styles\nimport { createLabelStyles } from './styles'\n\nexport const Label: React.FC<LabelProps> = props => {\n const { idFor, label, labelVariant } = props\n\n // Hooks\n const { styles } = useThemedStyles(props, createLabelStyles, {\n pick: p => [p.disabled, p.labelVariant, p.label],\n applyCommonProps: true\n })\n\n return (\n <LabelRadix.Root htmlFor={idFor} style={styles.container}>\n <Typography variant={labelVariant ?? 'b1'} fontWeight=\"regular\">\n {label}\n </Typography>\n </LabelRadix.Root>\n )\n}\n","// External libraries\nimport { useId } from 'react'\n\nexport function useCheckbox() {\n return {\n id: useId()\n }\n}\n","// Types\nimport type { CheckboxProps } from './types'\nimport { styled, type StyleMap } from '@hooks/useThemedStyles/types'\n\nexport const CHECKBOX_STYLES: Record<string, StyleMap> = {\n size: {\n sm: { width: '1rem', height: '1rem' },\n md: { width: '1.25rem', height: '1.25rem' },\n lg: { width: '1.5rem', height: '1.5rem' }\n },\n radius: {\n none: { borderRadius: 0 },\n sm: { borderRadius: '0.25rem' },\n md: { borderRadius: '0.375rem' },\n lg: { borderRadius: '0.5rem' },\n full: { borderRadius: '100%' }\n }\n}\n\nexport function createCheckBoxStyles(props: CheckboxProps) {\n const {\n color,\n checked,\n size = 'md',\n radius = 'md',\n disabled = false,\n labelPlacement = 'right'\n } = props\n\n const focusIndicatorOffsetColor = '#fff'\n\n return styled({\n container: {\n display: 'flex',\n columnGap: '0.5rem',\n alignItems: 'center',\n '--px-ring-color': color ?? undefined,\n flexDirection: labelPlacement === 'right' ? 'row' : 'row-reverse'\n },\n\n root: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n\n backgroundColor: checked ? color : 'white',\n borderWidth: '1px',\n borderStyle: 'solid',\n borderColor: checked ? color : 'var(--px-border-primary, #e5e7eb)',\n\n transition: 'color 200ms',\n opacity: disabled ? 0.5 : 1,\n cursor: disabled ? 'not-allowed' : 'pointer',\n\n ...(CHECKBOX_STYLES.size[size] as any),\n ...(CHECKBOX_STYLES.radius[radius] as any),\n\n __rules: {\n '&:hover': { borderColor: 'var(--px-border-secondary, #e5e7eb)' },\n '&:focus-visible': {\n outline: 'none',\n boxShadow: `0 0 0 2px ${focusIndicatorOffsetColor}, 0 0 0 4px var(--px-ring-color, #2b2b2bff)`\n }\n }\n },\n\n indicator: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n color: 'var(--px-text-primary, #4b5563)'\n }\n })\n}\n","/**\n * Returns the contrasting text color for a given background color.\n * @param backgroundColor hexadecimal color (i.e.: \"#ffffff\", \"#000\", \"#ffcc00\")\n */\nexport function getContrastingTextColor(\n backgroundColor: string\n): 'black' | 'white' {\n let hex = backgroundColor.replace('#', '')\n\n if (hex.length === 3) {\n hex = hex\n .split('')\n .map(c => c + c)\n .join('')\n }\n\n if (hex.length === 8) {\n hex = hex.substring(0, 6)\n }\n\n if (hex.length !== 6) return 'black'\n\n const r = parseInt(hex.substring(0, 2), 16)\n const g = parseInt(hex.substring(2, 4), 16)\n const b = parseInt(hex.substring(4, 6), 16)\n\n const luminance = (0.299 * r + 0.587 * g + 0.114 * b) / 255\n\n return luminance > 0.6 ? 'black' : 'white'\n}\n","// External Libraries\nimport type React from 'react'\nimport { Checkbox as CheckboxRadix } from 'radix-ui'\n\n// Components\nimport { Icon } from '../Icon'\nimport { Label } from './components/Label'\n\n// Hooks\nimport { useCheckbox } from './hooks/useCheckbox'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { CheckboxProps } from './types'\n\n// Styles\nimport { createCheckBoxStyles } from './styles'\nimport { getContrastingTextColor } from '@utils/functions'\n\nexport const Checkbox: React.FC<CheckboxProps> = props => {\n const {\n icon,\n label,\n color,\n labelVariant,\n checked = false,\n disabled = false,\n onChange\n } = props\n\n const iconColor = color ? getContrastingTextColor(color) : undefined\n\n // Hooks\n const { id } = useCheckbox()\n\n const { styles, classes } = useThemedStyles(props, createCheckBoxStyles)\n\n return (\n <div style={styles.container}>\n <CheckboxRadix.Root\n style={styles.root}\n className={classes.root}\n id={id}\n tabIndex={0}\n checked={checked}\n disabled={disabled}\n onCheckedChange={checked => onChange(checked === true)}\n >\n <CheckboxRadix.Indicator style={styles.indicator}>\n {icon ?? <Icon name=\"general-check\" size=\"sm\" color={iconColor} />}\n </CheckboxRadix.Indicator>\n </CheckboxRadix.Root>\n\n {label ? (\n <Label\n idFor={id}\n label={label}\n disabled={disabled}\n labelVariant={labelVariant}\n />\n ) : null}\n </div>\n )\n}\n"],"mappings":";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,oBAACC,SAAc;GACb,OAAO,OAAO;GACd,WAAW,QAAQ;GACf;GACJ,UAAU;GACD;GACC;GACV,kBAAiB,cAAW,SAASC,cAAY,KAAK;aAEtD,oBAACD,SAAc;IAAU,OAAO,OAAO;cACpC,QAAQ,oBAAC;KAAK,MAAK;KAAgB,MAAK;KAAK,OAAO;MAAa;KAC1C;IACP,EAEpB,QACC,oBAACE;GACC,OAAO;GACA;GACG;GACI;IACd,GACA;GACA"}
@@ -1,5 +1,5 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Typography } from "./Typography-3tAIdGuj.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Typography } from "./Typography-BTJk47bm.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/commons/toolkit/Chip/styles.ts
@@ -69,4 +69,4 @@ const Chip = (props) => {
69
69
 
70
70
  //#endregion
71
71
  export { types_exports as n, Chip as t };
72
- //# sourceMappingURL=Chip-CxSFYy0c.js.map
72
+ //# sourceMappingURL=Chip-DWoGbX_A.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chip-CxSFYy0c.js","names":["Chip: React.FC<ChipProps>"],"sources":["../src/components/commons/toolkit/Chip/styles.ts","../src/components/commons/toolkit/Chip/types.ts","../src/components/commons/toolkit/Chip/index.tsx"],"sourcesContent":["// Types\nimport type { ChipProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createChipStyles(props: ChipProps) {\n return styled({\n container: {\n display: 'flex',\n alignItems: 'center',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n paddingBlock: '0.25rem',\n paddingRight: '0.625rem',\n paddingLeft: props.data.icon ? '0.5rem' : '0.625rem',\n\n cursor: !props.viewOnly ? 'pointer' : 'default',\n\n boxShadow: 'var(--px-shadow-default)',\n borderColor: 'var(--px-border-primary)',\n color: props.isSelected ? 'white' : 'var(--px-text-primary)',\n backgroundColor: props.isSelected\n ? 'var(--px-color-primary)'\n : 'var(--px-bg)',\n\n whiteSpace: 'nowrap',\n userSelect: props.viewOnly ? 'auto' : 'none',\n MozUserSelect: props.viewOnly ? 'auto' : 'none',\n msUserSelect: props.viewOnly ? 'inherit' : 'none',\n WebkitUserSelect: props.viewOnly ? 'auto' : 'none',\n\n transition: 'background-color 0.25s ease-out',\n opacity: checkDisabled(props) ? 0.5 : 1,\n\n __rules: {\n '&:hover': {\n opacity: props.viewOnly ? 1 : 0.85\n },\n\n '&:disabled': {\n opacity: '0.5 !important',\n cursor: 'not-allowed !important'\n }\n }\n }\n })\n}\n\nfunction checkDisabled(props: ChipProps) {\n if (!props.viewOnly) return false\n return props.listDisabled || props.data.disabled\n}\n","export interface ChipProps {\n data: ChipOption\n viewOnly?: boolean\n isSelected?: boolean\n listDisabled?: boolean\n\n onClick?(value: ChipOption): void\n}\n\nexport interface ChipOption {\n value: string\n label: string\n\n disabled?: boolean\n icon?: React.ReactNode\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Typography } from '../Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ChipProps } from './types'\n\n// Styles\nimport { createChipStyles } from './styles'\n\nexport * as ChipTypes from './types'\n\nexport const Chip: React.FC<ChipProps> = props => {\n // Hooks\n const { styles, classes } = useThemedStyles(props, createChipStyles)\n\n // Constants\n const Component = props.viewOnly ? 'span' : 'button'\n const isDisabled = props.listDisabled || props.data.disabled\n\n // Functions\n function handleClick() {\n if (isDisabled || props.viewOnly) return\n props.onClick?.(props.data)\n }\n\n return (\n <Component\n disabled={isDisabled}\n style={styles.container}\n className={classes.container}\n onClick={handleClick}\n >\n {props.data.icon}\n\n <Typography variant=\"b2\" lineHeight=\"1.25rem\" color=\"inherit\">\n {props.data.label}\n </Typography>\n </Component>\n )\n}\n"],"mappings":";;;;;AAIA,SAAgB,iBAAiB,OAAkB;AACjD,QAAO,OAAO,EACZ,WAAW;EACT,SAAS;EACT,YAAY;EAEZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa,MAAM,KAAK,OAAO,WAAW;EAE1C,QAAQ,CAAC,MAAM,WAAW,YAAY;EAEtC,WAAW;EACX,aAAa;EACb,OAAO,MAAM,aAAa,UAAU;EACpC,iBAAiB,MAAM,aACnB,4BACA;EAEJ,YAAY;EACZ,YAAY,MAAM,WAAW,SAAS;EACtC,eAAe,MAAM,WAAW,SAAS;EACzC,cAAc,MAAM,WAAW,YAAY;EAC3C,kBAAkB,MAAM,WAAW,SAAS;EAE5C,YAAY;EACZ,SAAS,cAAc,MAAM,GAAG,KAAM;EAEtC,SAAS;GACP,WAAW,EACT,SAAS,MAAM,WAAW,IAAI,KAC/B;GAED,cAAc;IACZ,SAAS;IACT,QAAQ;IACT;GACF;EACF,EACF,CAAC;;AAGJ,SAAS,cAAc,OAAkB;AACvC,KAAI,CAAC,MAAM,SAAU,QAAO;AAC5B,QAAO,MAAM,gBAAgB,MAAM,KAAK;;;;;;;;;AElC1C,MAAaA,QAA4B,UAAS;CAEhD,MAAM,EAAE,QAAQ,YAAY,gBAAgB,OAAO,iBAAiB;CAGpE,MAAM,YAAY,MAAM,WAAW,SAAS;CAC5C,MAAM,aAAa,MAAM,gBAAgB,MAAM,KAAK;CAGpD,SAAS,cAAc;AACrB,MAAI,cAAc,MAAM,SAAU;AAClC,QAAM,UAAU,MAAM,KAAK;;AAG7B,QACE,qBAAC;EACC,UAAU;EACV,OAAO,OAAO;EACd,WAAW,QAAQ;EACnB,SAAS;aAER,MAAM,KAAK,MAEZ,oBAAC;GAAW,SAAQ;GAAK,YAAW;GAAU,OAAM;aACjD,MAAM,KAAK;IACD;GACH"}
1
+ {"version":3,"file":"Chip-DWoGbX_A.js","names":["Chip: React.FC<ChipProps>"],"sources":["../src/components/commons/toolkit/Chip/styles.ts","../src/components/commons/toolkit/Chip/types.ts","../src/components/commons/toolkit/Chip/index.tsx"],"sourcesContent":["// Types\nimport type { ChipProps } from './types'\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createChipStyles(props: ChipProps) {\n return styled({\n container: {\n display: 'flex',\n alignItems: 'center',\n\n borderWidth: 1,\n columnGap: '0.25rem',\n borderRadius: '0.5rem',\n paddingBlock: '0.25rem',\n paddingRight: '0.625rem',\n paddingLeft: props.data.icon ? '0.5rem' : '0.625rem',\n\n cursor: !props.viewOnly ? 'pointer' : 'default',\n\n boxShadow: 'var(--px-shadow-default)',\n borderColor: 'var(--px-border-primary)',\n color: props.isSelected ? 'white' : 'var(--px-text-primary)',\n backgroundColor: props.isSelected\n ? 'var(--px-color-primary)'\n : 'var(--px-bg)',\n\n whiteSpace: 'nowrap',\n userSelect: props.viewOnly ? 'auto' : 'none',\n MozUserSelect: props.viewOnly ? 'auto' : 'none',\n msUserSelect: props.viewOnly ? 'inherit' : 'none',\n WebkitUserSelect: props.viewOnly ? 'auto' : 'none',\n\n transition: 'background-color 0.25s ease-out',\n opacity: checkDisabled(props) ? 0.5 : 1,\n\n __rules: {\n '&:hover': {\n opacity: props.viewOnly ? 1 : 0.85\n },\n\n '&:disabled': {\n opacity: '0.5 !important',\n cursor: 'not-allowed !important'\n }\n }\n }\n })\n}\n\nfunction checkDisabled(props: ChipProps) {\n if (!props.viewOnly) return false\n return props.listDisabled || props.data.disabled\n}\n","export interface ChipProps {\n data: ChipOption\n viewOnly?: boolean\n isSelected?: boolean\n listDisabled?: boolean\n\n onClick?(value: ChipOption): void\n}\n\nexport interface ChipOption {\n value: string\n label: string\n\n disabled?: boolean\n icon?: React.ReactNode\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Typography } from '../Typography'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ChipProps } from './types'\n\n// Styles\nimport { createChipStyles } from './styles'\n\nexport * as ChipTypes from './types'\n\nexport const Chip: React.FC<ChipProps> = props => {\n // Hooks\n const { styles, classes } = useThemedStyles(props, createChipStyles)\n\n // Constants\n const Component = props.viewOnly ? 'span' : 'button'\n const isDisabled = props.listDisabled || props.data.disabled\n\n // Functions\n function handleClick() {\n if (isDisabled || props.viewOnly) return\n props.onClick?.(props.data)\n }\n\n return (\n <Component\n disabled={isDisabled}\n style={styles.container}\n className={classes.container}\n onClick={handleClick}\n >\n {props.data.icon}\n\n <Typography variant=\"b2\" lineHeight=\"1.25rem\" color=\"inherit\">\n {props.data.label}\n </Typography>\n </Component>\n )\n}\n"],"mappings":";;;;;AAIA,SAAgB,iBAAiB,OAAkB;AACjD,QAAO,OAAO,EACZ,WAAW;EACT,SAAS;EACT,YAAY;EAEZ,aAAa;EACb,WAAW;EACX,cAAc;EACd,cAAc;EACd,cAAc;EACd,aAAa,MAAM,KAAK,OAAO,WAAW;EAE1C,QAAQ,CAAC,MAAM,WAAW,YAAY;EAEtC,WAAW;EACX,aAAa;EACb,OAAO,MAAM,aAAa,UAAU;EACpC,iBAAiB,MAAM,aACnB,4BACA;EAEJ,YAAY;EACZ,YAAY,MAAM,WAAW,SAAS;EACtC,eAAe,MAAM,WAAW,SAAS;EACzC,cAAc,MAAM,WAAW,YAAY;EAC3C,kBAAkB,MAAM,WAAW,SAAS;EAE5C,YAAY;EACZ,SAAS,cAAc,MAAM,GAAG,KAAM;EAEtC,SAAS;GACP,WAAW,EACT,SAAS,MAAM,WAAW,IAAI,KAC/B;GAED,cAAc;IACZ,SAAS;IACT,QAAQ;IACT;GACF;EACF,EACF,CAAC;;AAGJ,SAAS,cAAc,OAAkB;AACvC,KAAI,CAAC,MAAM,SAAU,QAAO;AAC5B,QAAO,MAAM,gBAAgB,MAAM,KAAK;;;;;;;;;AElC1C,MAAaA,QAA4B,UAAS;CAEhD,MAAM,EAAE,QAAQ,YAAY,gBAAgB,OAAO,iBAAiB;CAGpE,MAAM,YAAY,MAAM,WAAW,SAAS;CAC5C,MAAM,aAAa,MAAM,gBAAgB,MAAM,KAAK;CAGpD,SAAS,cAAc;AACrB,MAAI,cAAc,MAAM,SAAU;AAClC,QAAM,UAAU,MAAM,KAAK;;AAG7B,QACE,qBAAC;EACC,UAAU;EACV,OAAO,OAAO;EACd,WAAW,QAAQ;EACnB,SAAS;aAER,MAAM,KAAK,MAEZ,oBAAC;GAAW,SAAQ;GAAK,YAAW;GAAU,OAAM;aACjD,MAAM,KAAK;IACD;GACH"}
@@ -1,6 +1,6 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Chip } from "./Chip-CxSFYy0c.js";
3
- import { n as Label, t as ErrorMessage } from "./ErrorMessage-C2FJLFsj.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Chip } from "./Chip-DWoGbX_A.js";
3
+ import { n as Label, t as ErrorMessage } from "./ErrorMessage-BRnYfudz.js";
4
4
  import { useEffect, useState } from "react";
5
5
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
6
 
@@ -110,4 +110,4 @@ const ChipList = (props) => {
110
110
 
111
111
  //#endregion
112
112
  export { ChipList as t };
113
- //# sourceMappingURL=ChipList-oMddO6fO.js.map
113
+ //# sourceMappingURL=ChipList-ClC-BPyL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChipList-oMddO6fO.js","names":["ChipsLoader: React.FC","ChipList: React.FC<ChipListProps>"],"sources":["../src/components/commons/toolkit/ChipList/components/ChipsLoader/styles.ts","../src/components/commons/toolkit/ChipList/components/ChipsLoader/index.tsx","../src/components/commons/toolkit/ChipList/hooks/useChipList/index.ts","../src/components/commons/toolkit/ChipList/styles.ts","../src/components/commons/toolkit/ChipList/index.tsx"],"sourcesContent":["// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createChipsLoaderStyles() {\n return styled({\n container: {\n width: '5rem',\n height: '1.75rem',\n\n display: 'flex',\n\n borderRadius: '0.5rem',\n\n backgroundColor: 'var(--px-surface)'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { useEffect, useState } from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createChipsLoaderStyles } from './styles'\n\nexport const ChipsLoader: React.FC = () => {\n // States\n const [pulseOn, setPulseOn] = useState(true)\n\n // Hooks\n const { styles } = useThemedStyles({}, createChipsLoaderStyles)\n\n useEffect(() => {\n const id = setInterval(() => setPulseOn(v => !v), 600)\n return () => clearInterval(id)\n }, [])\n\n // Functions\n function renderContent() {\n return Array.from({ length: 5 }).map((_, idx) => {\n const delayMs = idx * 120\n\n return (\n <div\n key={idx.toString()}\n style={{\n ...styles.container,\n opacity: pulseOn ? 1 : 0.6,\n transition: `opacity 600ms ease-in-out ${delayMs}ms`\n }}\n />\n )\n })\n }\n\n return <>{renderContent()}</>\n}\n","// Types\nimport type { ChipListProps } from '../../types'\nimport type { ChipOption } from '@components/commons/toolkit/Chip/types'\n\nexport function useChipList({\n value,\n canClear,\n multiple,\n onChange\n}: ChipListProps) {\n // Functions\n function handleChange(option: ChipOption) {\n const isAlreadySelected = value.includes(option.value)\n\n if (!multiple) {\n if (isAlreadySelected) {\n if (canClear) onChange?.([])\n } else onChange?.([option.value])\n\n return\n }\n\n if (isAlreadySelected) {\n if (value.length === 1) {\n if (canClear) onChange?.([])\n } else onChange?.(value.filter(v => v !== option.value))\n } else onChange?.([...value, option.value])\n }\n\n return { handleChange }\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createChipListStyles() {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n\n listContainer: {\n width: '100%',\n\n display: 'flex',\n flexWrap: 'wrap',\n\n gap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Chip } from '../Chip'\nimport { Label } from '../Label'\nimport { ErrorMessage } from '../ErrorMessage'\nimport { ChipsLoader } from './components/ChipsLoader'\n\n// Hooks\nimport { useChipList } from './hooks/useChipList'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ChipListProps } from './types'\n\n// Styles\nimport { createChipListStyles } from './styles'\n\nexport const ChipList: React.FC<ChipListProps> = props => {\n // Hooks\n const { handleChange } = useChipList(props)\n const { styles } = useThemedStyles(props, createChipListStyles)\n\n // Functions\n function renderContent() {\n if (props.isLoading) return <ChipsLoader />\n\n return props.options.map(item => (\n <Chip\n key={item.value}\n data={item}\n viewOnly={props.viewOnly}\n listDisabled={props.disabled}\n isSelected={props.value.includes(item.value)}\n onClick={handleChange}\n />\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 <div style={styles.listContainer}>{renderContent()}</div>\n\n {props.errorMessage ? (\n <ErrorMessage message={props.errorMessage} />\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;AAGA,SAAgB,0BAA0B;AACxC,QAAO,OAAO,EACZ,WAAW;EACT,OAAO;EACP,QAAQ;EAER,SAAS;EAET,cAAc;EAEd,iBAAiB;EAClB,EACF,CAAC;;;;;ACLJ,MAAaA,oBAA8B;CAEzC,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAG5C,MAAM,EAAE,WAAW,gBAAgB,EAAE,EAAE,wBAAwB;AAE/D,iBAAgB;EACd,MAAM,KAAK,kBAAkB,YAAW,MAAK,CAAC,EAAE,EAAE,IAAI;AACtD,eAAa,cAAc,GAAG;IAC7B,EAAE,CAAC;CAGN,SAAS,gBAAgB;AACvB,SAAO,MAAM,KAAK,EAAE,QAAQ,GAAG,CAAC,CAAC,KAAK,GAAG,QAAQ;GAC/C,MAAM,UAAU,MAAM;AAEtB,UACE,oBAAC,SAEC,OAAO;IACL,GAAG,OAAO;IACV,SAAS,UAAU,IAAI;IACvB,YAAY,6BAA6B,QAAQ;IAClD,IALI,IAAI,U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GAExD,MAAM,eACL,oBAAC,gBAAa,SAAS,MAAM,eAAgB,GAC3C;;GACA"}
1
+ {"version":3,"file":"ChipList-ClC-BPyL.js","names":["ChipsLoader: React.FC","ChipList: React.FC<ChipListProps>"],"sources":["../src/components/commons/toolkit/ChipList/components/ChipsLoader/styles.ts","../src/components/commons/toolkit/ChipList/components/ChipsLoader/index.tsx","../src/components/commons/toolkit/ChipList/hooks/useChipList/index.ts","../src/components/commons/toolkit/ChipList/styles.ts","../src/components/commons/toolkit/ChipList/index.tsx"],"sourcesContent":["// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createChipsLoaderStyles() {\n return styled({\n container: {\n width: '5rem',\n height: '1.75rem',\n\n display: 'flex',\n\n borderRadius: '0.5rem',\n\n backgroundColor: 'var(--px-surface)'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\nimport { useEffect, useState } from 'react'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Styles\nimport { createChipsLoaderStyles } from './styles'\n\nexport const ChipsLoader: React.FC = () => {\n // States\n const [pulseOn, setPulseOn] = useState(true)\n\n // Hooks\n const { styles } = useThemedStyles({}, createChipsLoaderStyles)\n\n useEffect(() => {\n const id = setInterval(() => setPulseOn(v => !v), 600)\n return () => clearInterval(id)\n }, [])\n\n // Functions\n function renderContent() {\n return Array.from({ length: 5 }).map((_, idx) => {\n const delayMs = idx * 120\n\n return (\n <div\n key={idx.toString()}\n style={{\n ...styles.container,\n opacity: pulseOn ? 1 : 0.6,\n transition: `opacity 600ms ease-in-out ${delayMs}ms`\n }}\n />\n )\n })\n }\n\n return <>{renderContent()}</>\n}\n","// Types\nimport type { ChipListProps } from '../../types'\nimport type { ChipOption } from '@components/commons/toolkit/Chip/types'\n\nexport function useChipList({\n value,\n canClear,\n multiple,\n onChange\n}: ChipListProps) {\n // Functions\n function handleChange(option: ChipOption) {\n const isAlreadySelected = value.includes(option.value)\n\n if (!multiple) {\n if (isAlreadySelected) {\n if (canClear) onChange?.([])\n } else onChange?.([option.value])\n\n return\n }\n\n if (isAlreadySelected) {\n if (value.length === 1) {\n if (canClear) onChange?.([])\n } else onChange?.(value.filter(v => v !== option.value))\n } else onChange?.([...value, option.value])\n }\n\n return { handleChange }\n}\n","// Types\nimport { styled } from '@hooks/useThemedStyles/types'\n\nexport function createChipListStyles() {\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n\n listContainer: {\n width: '100%',\n\n display: 'flex',\n flexWrap: 'wrap',\n\n gap: '0.5rem'\n }\n })\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Chip } from '../Chip'\nimport { Label } from '../Label'\nimport { ErrorMessage } from '../ErrorMessage'\nimport { ChipsLoader } from './components/ChipsLoader'\n\n// Hooks\nimport { useChipList } from './hooks/useChipList'\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ChipListProps } from './types'\n\n// Styles\nimport { createChipListStyles } from './styles'\n\nexport const ChipList: React.FC<ChipListProps> = props => {\n // Hooks\n const { handleChange } = useChipList(props)\n const { styles } = useThemedStyles(props, createChipListStyles)\n\n // Functions\n function renderContent() {\n if (props.isLoading) return <ChipsLoader />\n\n return props.options.map(item => (\n <Chip\n key={item.value}\n data={item}\n viewOnly={props.viewOnly}\n listDisabled={props.disabled}\n isSelected={props.value.includes(item.value)}\n onClick={handleChange}\n />\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 <div style={styles.listContainer}>{renderContent()}</div>\n\n {props.errorMessage ? (\n <ErrorMessage message={props.errorMessage} />\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;AAGA,SAAgB,0BAA0B;AACxC,QAAO,OAAO,EACZ,WAAW;EACT,OAAO;EACP,QAAQ;EAER,SAAS;EAET,cAAc;EAEd,iBAAiB;EAClB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YAAY,MAAM;CAC3C,MAAM,EAAE,WAAW,gBAAgB,OAAO,qBAAqB;CAG/D,SAAS,gBAAgB;AACvB,MAAI,MAAM,UAAW,QAAO,oBAAC,gBAAc;AAE3C,SAAO,MAAM,QAAQ,KAAI,SACvB,oBAAC;GAEC,MAAM;GACN,UAAU,MAAM;GAChB,cAAc,MAAM;GACpB,YAAY,MAAM,MAAM,SAAS,KAAK,MAAM;GAC5C,SAAS;KALJ,KAAK,MAMV,CACF;;AAGJ,QACE,qBAAC;EAAI,OAAO,OAAO;;GAChB,MAAM,YAAY,OACjB,oBAAC;IACC,OAAO,MAAM;IACb,UAAU,MAAM;IAChB,eAAe,MAAM;IACrB,GAAI,MAAM;KACV;GAGJ,oBAAC;IAAI,OAAO,OAAO;cAAgB,eAAe;KAAO;GAExD,MAAM,eACL,oBAAC,gBAAa,SAAS,MAAM,eAAgB,GAC3C;;GACA"}
@@ -0,0 +1,183 @@
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { n as Label, t as ErrorMessage } from "./ErrorMessage-BRnYfudz.js";
3
+ import { t as Skeleton } from "./Skeleton-iCdZ2Gai.js";
4
+ import { useId, useMemo } from "react";
5
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
6
+
7
+ //#region src/components/commons/inputs/ColorPicker/components/ColorButton/styles.ts
8
+ const DEFAULT_BUTTON_SIZE = "2.25rem";
9
+ function createColorButtonStyles(props) {
10
+ const resolvedSize = props.size || DEFAULT_BUTTON_SIZE;
11
+ return styled({ container: {
12
+ width: resolvedSize,
13
+ height: resolvedSize,
14
+ cursor: "pointer",
15
+ position: "relative",
16
+ borderWidth: 1,
17
+ borderRadius: props.borderRadius || resolvedSize,
18
+ backgroundColor: props.color,
19
+ borderColor: "var(--px-border-primary)",
20
+ outlineOffset: "2px",
21
+ outline: props.isSelected ? "2px solid var(--px-color-primary)" : "none",
22
+ __rules: {
23
+ "&:hover": { opacity: "0.85 !important" },
24
+ "&:focus": {
25
+ outlineOffset: "2px",
26
+ outline: "2px solid var(--px-color-primary) !important"
27
+ },
28
+ "&:disabled": {
29
+ opacity: "0.5 !important",
30
+ cursor: "not-allowed !important"
31
+ }
32
+ }
33
+ } });
34
+ }
35
+
36
+ //#endregion
37
+ //#region src/components/commons/inputs/ColorPicker/components/ColorButton/index.tsx
38
+ const ColorButton = ({ color, disabled, onClick, ...rest }) => {
39
+ const { styles, classes } = useThemedStyles({
40
+ ...rest,
41
+ color
42
+ }, createColorButtonStyles);
43
+ function handleClick() {
44
+ if (disabled) return;
45
+ onClick(color);
46
+ }
47
+ return /* @__PURE__ */ jsx("button", {
48
+ type: "button",
49
+ disabled,
50
+ style: styles.container,
51
+ className: classes.container,
52
+ onClick: handleClick
53
+ });
54
+ };
55
+
56
+ //#endregion
57
+ //#region src/components/commons/inputs/ColorPicker/components/ColorsLoader/index.tsx
58
+ const ColorsLoader = ({ size, borderRadius }) => {
59
+ const resolvedSize = size || DEFAULT_BUTTON_SIZE;
60
+ const resolvedRadius = borderRadius || DEFAULT_BUTTON_SIZE;
61
+ function renderContent() {
62
+ return Array.from({ length: 5 }).map((_, idx) => /* @__PURE__ */ jsx(Skeleton, {
63
+ width: resolvedSize,
64
+ height: resolvedSize,
65
+ borderRadius: resolvedRadius
66
+ }, idx.toString()));
67
+ }
68
+ return /* @__PURE__ */ jsx(Fragment$1, { children: renderContent() });
69
+ };
70
+
71
+ //#endregion
72
+ //#region src/components/commons/inputs/ColorPicker/styles.ts
73
+ function createColorPickerStyles(props) {
74
+ const isCustomColor = !props.options.includes(props.value);
75
+ return styled({
76
+ container: {
77
+ width: "100%",
78
+ display: "flex",
79
+ flexDirection: "column",
80
+ rowGap: "0.375rem"
81
+ },
82
+ content: {
83
+ width: "100%",
84
+ display: "flex",
85
+ alignItems: "center",
86
+ flexWrap: "wrap",
87
+ gap: "0.625rem"
88
+ },
89
+ inputWrapper: {
90
+ width: props.size || DEFAULT_BUTTON_SIZE,
91
+ height: props.size || DEFAULT_BUTTON_SIZE,
92
+ cursor: "pointer",
93
+ overflow: "hidden",
94
+ position: "relative",
95
+ borderWidth: 1,
96
+ borderColor: "var(--px-border-primary)",
97
+ borderRadius: props.borderRadius || DEFAULT_BUTTON_SIZE,
98
+ outlineOffset: "2px",
99
+ outline: isCustomColor && props.value ? `2px solid var(--px-color-primary)` : "none",
100
+ background: isCustomColor && props.value ? props.value : "linear-gradient(90deg, #ff6b6b 0%, #ffd93d 16.66%, #6bff95 33.33%, #6be7ff 50%, #6b83ff 66.66%, #d36bff 83.33%, #ff6bb5 100%)",
101
+ __rules: { "&:focus-within": {
102
+ outlineOffset: "2px",
103
+ outline: `2px solid var(--px-color-primary) !important`
104
+ } }
105
+ },
106
+ nativeInput: {
107
+ width: "100%",
108
+ height: "100%",
109
+ position: "absolute",
110
+ inset: 0,
111
+ opacity: 0,
112
+ border: "none",
113
+ cursor: "pointer"
114
+ }
115
+ });
116
+ }
117
+
118
+ //#endregion
119
+ //#region src/components/commons/inputs/ColorPicker/types.ts
120
+ var types_exports = {};
121
+
122
+ //#endregion
123
+ //#region src/components/commons/inputs/ColorPicker/index.tsx
124
+ const ColorPicker = (props) => {
125
+ const reactId = useId();
126
+ const inputId = useMemo(() => {
127
+ return props.id || `color-picker-${reactId}`;
128
+ }, [props.id, reactId]);
129
+ const { styles, classes } = useThemedStyles(props, createColorPickerStyles, {
130
+ override: props.styles,
131
+ applyCommonProps: true,
132
+ commonSlot: "container"
133
+ });
134
+ function handleInputChange(e) {
135
+ props.onChange(e.target.value);
136
+ }
137
+ function renderColors() {
138
+ if (props.isLoading) return /* @__PURE__ */ jsx(ColorsLoader, {
139
+ size: props.size,
140
+ borderRadius: props.borderRadius
141
+ });
142
+ return props.options.map((option) => /* @__PURE__ */ jsx(ColorButton, {
143
+ color: option,
144
+ size: props.size,
145
+ disabled: props.disabled,
146
+ borderRadius: props.borderRadius,
147
+ isSelected: props.value === option,
148
+ onClick: props.onChange
149
+ }, option));
150
+ }
151
+ return /* @__PURE__ */ jsxs("div", {
152
+ style: styles.container,
153
+ children: [
154
+ !props.hideLabel ? /* @__PURE__ */ jsx(Label, {
155
+ htmlFor: inputId,
156
+ label: props.label,
157
+ required: props.required,
158
+ requiredColor: props.requiredColor,
159
+ ...props.labelConfig
160
+ }) : null,
161
+ /* @__PURE__ */ jsxs("div", {
162
+ id: inputId,
163
+ style: styles.content,
164
+ children: [renderColors(), props.canPickCustom ? /* @__PURE__ */ jsx("div", {
165
+ style: styles.inputWrapper,
166
+ className: classes.inputWrapper,
167
+ children: /* @__PURE__ */ jsx("input", {
168
+ type: "color",
169
+ value: props.value,
170
+ style: styles.nativeInput,
171
+ "aria-label": "Pick a custom color",
172
+ onChange: handleInputChange
173
+ })
174
+ }) : null]
175
+ }),
176
+ props.errorMessage ? /* @__PURE__ */ jsx(ErrorMessage, { message: props.errorMessage }) : null
177
+ ]
178
+ });
179
+ };
180
+
181
+ //#endregion
182
+ export { types_exports as n, ColorPicker as t };
183
+ //# sourceMappingURL=ColorPicker-BVmUDE-h.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ColorPicker-BVmUDE-h.js","names":["ColorButton: React.FC<ColorButtonProps>","ColorsLoader: React.FC<Props>","ColorPicker: React.FC<ColorPickerProps>"],"sources":["../src/components/commons/inputs/ColorPicker/components/ColorButton/styles.ts","../src/components/commons/inputs/ColorPicker/components/ColorButton/index.tsx","../src/components/commons/inputs/ColorPicker/components/ColorsLoader/index.tsx","../src/components/commons/inputs/ColorPicker/styles.ts","../src/components/commons/inputs/ColorPicker/types.ts","../src/components/commons/inputs/ColorPicker/index.tsx"],"sourcesContent":["import { styled } from '@hooks/useThemedStyles/types'\n\ninterface Params {\n size?: string\n color: string\n isSelected: boolean\n borderRadius?: string\n}\n\nexport const DEFAULT_BUTTON_SIZE = '2.25rem'\n\nexport function createColorButtonStyles(props: Params) {\n const resolvedSize = props.size || DEFAULT_BUTTON_SIZE\n\n return styled({\n container: {\n width: resolvedSize,\n height: resolvedSize,\n\n cursor: 'pointer',\n position: 'relative',\n\n borderWidth: 1,\n borderRadius: props.borderRadius || resolvedSize,\n\n backgroundColor: props.color,\n borderColor: 'var(--px-border-primary)',\n\n outlineOffset: '2px',\n outline: props.isSelected ? '2px solid var(--px-color-primary)' : 'none',\n\n __rules: {\n '&:hover': {\n opacity: '0.85 !important'\n },\n\n '&:focus': {\n outlineOffset: '2px',\n outline: '2px solid var(--px-color-primary) !important'\n },\n\n '&:disabled': {\n opacity: '0.5 !important',\n cursor: 'not-allowed !important'\n }\n }\n }\n })\n}\n","// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ColorButtonProps } from './types'\n\n// Styles\nimport { createColorButtonStyles } from './styles'\n\nexport const ColorButton: React.FC<ColorButtonProps> = ({\n color,\n disabled,\n onClick,\n ...rest\n}) => {\n // Hooks\n const { styles, classes } = useThemedStyles(\n { ...rest, color },\n createColorButtonStyles\n )\n\n // Functions\n function handleClick() {\n if (disabled) return\n onClick(color)\n }\n\n return (\n <button\n type=\"button\"\n disabled={disabled}\n style={styles.container}\n className={classes.container}\n onClick={handleClick}\n />\n )\n}\n","// External Libraries\nimport type React from 'react'\n\n// Components\nimport { Skeleton } from '@components/commons/structure/Skeleton'\n\n// Constants\nimport { DEFAULT_BUTTON_SIZE } from '../ColorButton/styles'\n\ninterface Props {\n size?: string\n borderRadius?: string\n}\n\nexport const ColorsLoader: React.FC<Props> = ({ size, borderRadius }) => {\n // Constants\n const resolvedSize = size || DEFAULT_BUTTON_SIZE\n const resolvedRadius = borderRadius || DEFAULT_BUTTON_SIZE\n\n // Functions\n function renderContent() {\n return Array.from({ length: 5 }).map((_, idx) => (\n <Skeleton\n key={idx.toString()}\n width={resolvedSize}\n height={resolvedSize}\n borderRadius={resolvedRadius}\n />\n ))\n }\n\n return <>{renderContent()}</>\n}\n","// Hooks\nimport { styled } from '@hooks/useThemedStyles/types'\n\n// Types\nimport type { ColorPickerProps } from './types'\nimport { DEFAULT_BUTTON_SIZE } from './components/ColorButton/styles'\n\nexport function createColorPickerStyles(props: ColorPickerProps) {\n const isCustomColor = !props.options.includes(props.value)\n\n return styled({\n container: {\n width: '100%',\n\n display: 'flex',\n flexDirection: 'column',\n\n rowGap: '0.375rem'\n },\n content: {\n width: '100%',\n\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n\n gap: '0.625rem'\n },\n inputWrapper: {\n width: props.size || DEFAULT_BUTTON_SIZE,\n height: props.size || DEFAULT_BUTTON_SIZE,\n\n cursor: 'pointer',\n overflow: 'hidden',\n position: 'relative',\n\n borderWidth: 1,\n borderColor: 'var(--px-border-primary)',\n borderRadius: props.borderRadius || DEFAULT_BUTTON_SIZE,\n\n outlineOffset: '2px',\n outline:\n isCustomColor && props.value\n ? `2px solid var(--px-color-primary)`\n : 'none',\n\n background:\n isCustomColor && props.value\n ? props.value\n : 'linear-gradient(90deg, #ff6b6b 0%, #ffd93d 16.66%, #6bff95 33.33%, #6be7ff 50%, #6b83ff 66.66%, #d36bff 83.33%, #ff6bb5 100%)',\n\n __rules: {\n '&:focus-within': {\n outlineOffset: '2px',\n outline: `2px solid var(--px-color-primary) !important`\n }\n }\n },\n\n nativeInput: {\n width: '100%',\n height: '100%',\n\n position: 'absolute',\n inset: 0,\n\n opacity: 0,\n border: 'none',\n cursor: 'pointer'\n }\n })\n}\n","import type {\n StylesOf,\n TextProps,\n LayoutProps,\n MarginProps\n} from '@hooks/useThemedStyles/types'\nimport type { createColorPickerStyles } from './styles'\n\nexport interface ColorPickerProps extends LayoutProps, MarginProps {\n id?: string\n\n label: string\n value: ColorOption\n options: ColorOption[]\n\n size?: string\n required?: boolean\n disabled?: boolean\n hideLabel?: boolean\n errorMessage?: string\n canPickCustom?: boolean\n isLoading?: boolean\n\n borderRadius?: string\n requiredColor?: string\n labelConfig?: TextProps\n styles?: StylesOf<typeof createColorPickerStyles>\n\n onChange: (value: string) => void\n}\n\nexport type ColorOption = `#${string}`\n","// External Libraries\nimport { useId, useMemo } from 'react'\n\n// Components\nimport { ColorButton } from './components/ColorButton'\nimport { ColorsLoader } from './components/ColorsLoader'\nimport { Label } from '@components/commons/toolkit/Label'\nimport { ErrorMessage } from '@components/commons/toolkit/ErrorMessage'\n\n// Hooks\nimport { useThemedStyles } from '@hooks/useThemedStyles'\n\n// Types\nimport type { ColorPickerProps } from './types'\n\n// Styles\nimport { createColorPickerStyles } from './styles'\n\nexport * as ColorPickerTypes from './types'\n\nexport const ColorPicker: React.FC<ColorPickerProps> = props => {\n // Constants\n const reactId = useId()\n const inputId = useMemo(() => {\n return props.id || `color-picker-${reactId}`\n }, [props.id, reactId])\n\n // Hooks\n const { styles, classes } = useThemedStyles(props, createColorPickerStyles, {\n override: props.styles,\n applyCommonProps: true,\n commonSlot: 'container'\n })\n\n // Functions\n function handleInputChange(e: React.ChangeEvent<HTMLInputElement>) {\n props.onChange(e.target.value)\n }\n\n function renderColors() {\n if (props.isLoading) {\n return (\n <ColorsLoader size={props.size} borderRadius={props.borderRadius} />\n )\n }\n\n return props.options.map(option => (\n <ColorButton\n key={option}\n color={option}\n size={props.size}\n disabled={props.disabled}\n borderRadius={props.borderRadius}\n isSelected={props.value === option}\n onClick={props.onChange}\n />\n ))\n }\n\n return (\n <div style={styles.container}>\n {!props.hideLabel ? (\n <Label\n htmlFor={inputId}\n label={props.label}\n required={props.required}\n requiredColor={props.requiredColor}\n {...props.labelConfig}\n />\n ) : null}\n\n <div id={inputId} style={styles.content}>\n {renderColors()}\n\n {props.canPickCustom ? (\n <div style={styles.inputWrapper} className={classes.inputWrapper}>\n <input\n type=\"color\"\n value={props.value}\n style={styles.nativeInput}\n aria-label=\"Pick a custom color\"\n onChange={handleInputChange}\n />\n </div>\n ) : null}\n </div>\n\n {props.errorMessage ? (\n <ErrorMessage message={props.errorMessage} />\n ) : null}\n </div>\n )\n}\n"],"mappings":";;;;;;;AASA,MAAa,sBAAsB;AAEnC,SAAgB,wBAAwB,OAAe;CACrD,MAAM,eAAe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;eAClD,oBAAC;MACC,MAAK;MACL,OAAO,MAAM;MACb,OAAO,OAAO;MACd,cAAW;MACX,UAAU;OACV;MACE,GACJ;KACA;GAEL,MAAM,eACL,oBAAC,gBAAa,SAAS,MAAM,eAAgB,GAC3C;;GACA"}
@@ -1,7 +1,7 @@
1
- import { n as styled, t as useThemedStyles } from "./useThemedStyles-BBJ_TF_l.js";
2
- import { t as Switch } from "./Switch-DFIDbtUk.js";
3
- import { t as Typography } from "./Typography-3tAIdGuj.js";
4
- import { t as BasePopover } from "./BasePopover-BYa7SBXE.js";
1
+ import { n as styled, t as useThemedStyles } from "./useThemedStyles-CV4ryZLN.js";
2
+ import { t as Switch } from "./Switch-CiKBZRST.js";
3
+ import { t as Typography } from "./Typography-BTJk47bm.js";
4
+ import { t as BasePopover } from "./BasePopover-m1OfX3fO.js";
5
5
  import { useEffect, useMemo, useRef, useState } from "react";
6
6
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
7
 
@@ -319,4 +319,4 @@ const ContextMenu = (props) => {
319
319
 
320
320
  //#endregion
321
321
  export { types_exports as n, ContextMenu as t };
322
- //# sourceMappingURL=ContextMenu-DUHmXf8f.js.map
322
+ //# sourceMappingURL=ContextMenu-B8mGn0Fq.js.map