@ahrowe/ui 0.13.0 → 0.14.0

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 (84) hide show
  1. package/dist/esm/common/animatedIcon/animatedIcon.mjs +2 -0
  2. package/dist/esm/common/animatedIcon/animatedIcon.mjs.map +1 -0
  3. package/dist/esm/common/animatedIcon/animatedIcon.module.mjs +2 -0
  4. package/dist/esm/common/animatedIcon/animatedIcon.module.mjs.map +1 -0
  5. package/dist/esm/common/breadcrumb/breadcrumb.mjs +1 -1
  6. package/dist/esm/common/breadcrumb/breadcrumb.mjs.map +1 -1
  7. package/dist/esm/common/buttonGroup/buttonGroup.mjs +2 -0
  8. package/dist/esm/common/buttonGroup/buttonGroup.mjs.map +1 -0
  9. package/dist/esm/common/buttonGroup/buttonGroup.module.mjs +2 -0
  10. package/dist/esm/common/buttonGroup/buttonGroup.module.mjs.map +1 -0
  11. package/dist/esm/common/buttonGroup/buttonGroup.types.mjs +2 -0
  12. package/dist/esm/common/buttonGroup/buttonGroup.types.mjs.map +1 -0
  13. package/dist/esm/common/divider/divider.mjs +1 -1
  14. package/dist/esm/common/divider/divider.mjs.map +1 -1
  15. package/dist/esm/common/divider/divider.module.mjs +1 -1
  16. package/dist/esm/common/divider/divider.module.mjs.map +1 -1
  17. package/dist/esm/common/divider/divider.types.mjs +1 -1
  18. package/dist/esm/common/divider/divider.types.mjs.map +1 -1
  19. package/dist/esm/common/dropdown/dropdown.module.mjs +1 -1
  20. package/dist/esm/common/dropdown/dropdown.module.mjs.map +1 -1
  21. package/dist/esm/common/fab/fab.mjs +1 -1
  22. package/dist/esm/common/fab/fab.mjs.map +1 -1
  23. package/dist/esm/common/floatingMenu/floatingMenu.mjs +1 -1
  24. package/dist/esm/common/floatingMenu/floatingMenu.mjs.map +1 -1
  25. package/dist/esm/common/floatingMenu/floatingMenu.module.mjs.map +1 -1
  26. package/dist/esm/common/hooks/useFocusBoundary.mjs +2 -0
  27. package/dist/esm/common/hooks/useFocusBoundary.mjs.map +1 -0
  28. package/dist/esm/common/input/input.mjs +1 -1
  29. package/dist/esm/common/input/input.mjs.map +1 -1
  30. package/dist/esm/common/input/input.module.mjs +1 -1
  31. package/dist/esm/common/input/input.module.mjs.map +1 -1
  32. package/dist/esm/common/input/input.types.mjs +1 -1
  33. package/dist/esm/common/input/input.types.mjs.map +1 -1
  34. package/dist/esm/common/klipyPicker/klipyPicker.mjs +1 -1
  35. package/dist/esm/common/klipyPicker/klipyPicker.mjs.map +1 -1
  36. package/dist/esm/common/numberInput/numberInput.mjs +1 -1
  37. package/dist/esm/common/numberInput/numberInput.mjs.map +1 -1
  38. package/dist/esm/common/popover/popover.mjs +1 -1
  39. package/dist/esm/common/popover/popover.mjs.map +1 -1
  40. package/dist/esm/common/splitButton/splitButton.mjs +2 -0
  41. package/dist/esm/common/splitButton/splitButton.mjs.map +1 -0
  42. package/dist/esm/common/splitButton/splitButton.module.mjs +2 -0
  43. package/dist/esm/common/splitButton/splitButton.module.mjs.map +1 -0
  44. package/dist/esm/common/virtualList/useRowDrag.mjs +1 -1
  45. package/dist/esm/common/virtualList/useRowDrag.mjs.map +1 -1
  46. package/dist/esm/common/virtualList/useVirtualWindow.mjs +1 -1
  47. package/dist/esm/common/virtualList/useVirtualWindow.mjs.map +1 -1
  48. package/dist/esm/common/virtualList/virtualList.mjs +1 -1
  49. package/dist/esm/common/virtualList/virtualList.mjs.map +1 -1
  50. package/dist/esm/common/virtualList/virtualRow.mjs +1 -1
  51. package/dist/esm/common/virtualList/virtualRow.mjs.map +1 -1
  52. package/dist/esm/index.mjs +1 -1
  53. package/dist/index.cjs +4 -4
  54. package/dist/index.cjs.map +1 -1
  55. package/dist/style.css +1 -1
  56. package/dist/types/package/common/animatedIcon/animatedIcon.d.ts +3 -0
  57. package/dist/types/package/common/animatedIcon/animatedIcon.types.d.ts +25 -0
  58. package/dist/types/package/common/animatedIcon/index.d.ts +2 -0
  59. package/dist/types/package/common/buttonGroup/buttonGroup.d.ts +4 -0
  60. package/dist/types/package/common/buttonGroup/buttonGroup.types.d.ts +12 -0
  61. package/dist/types/package/common/buttonGroup/index.d.ts +2 -0
  62. package/dist/types/package/common/configProvider/configProvider.types.d.ts +2 -0
  63. package/dist/types/package/common/divider/divider.types.d.ts +5 -0
  64. package/dist/types/package/common/hooks/useFocusBoundary.d.ts +20 -0
  65. package/dist/types/package/common/input/input.types.d.ts +5 -0
  66. package/dist/types/package/common/splitButton/index.d.ts +2 -0
  67. package/dist/types/package/common/splitButton/splitButton.d.ts +3 -0
  68. package/dist/types/package/common/splitButton/splitButton.types.d.ts +28 -0
  69. package/dist/types/package/common/themeProvider/theme.types.d.ts +1 -0
  70. package/dist/types/package/common/virtualList/useRowDrag.d.ts +4 -0
  71. package/dist/types/package/common/virtualList/useVirtualWindow.d.ts +3 -1
  72. package/dist/types/package/common/virtualList/virtualList.types.d.ts +5 -1
  73. package/dist/types/package/common/virtualList/virtualRow.d.ts +8 -1
  74. package/dist/types/package/index.d.ts +4 -0
  75. package/docs/ButtonGroup.md +90 -0
  76. package/docs/CLAUDE.md +2 -0
  77. package/docs/Divider.md +15 -3
  78. package/docs/FloatingMenu.md +7 -3
  79. package/docs/Input.md +30 -6
  80. package/docs/NumberInput.md +2 -0
  81. package/docs/SearchInput.md +6 -0
  82. package/docs/SplitButton.md +79 -0
  83. package/docs/VirtualList.md +86 -3
  84. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ import e from"./animatedIcon.module.mjs";import{useState as t}from"react";import n from"classnames";import{FontAwesomeIcon as r}from"@fortawesome/react-fontawesome";import{jsx as i,jsxs as a}from"react/jsx-runtime";function o(e){return`${e.prefix}:${e.iconName}`}var s=360;function c({icon:c,duration:l=200,spin:u=!1,className:d,style:f,onClick:p,onMouseEnter:m,onMouseLeave:h,classNames:g,styles:_,...v}){let[y,b]=t([c,c]),[x,S]=t(0),[C,w]=t(0);if(o(c)!==o(y[x])){let e=+(x===0),t=[...y];t[e]=c,b(t),S(e),u&&w(e=>e+1)}return a(`span`,{...v,className:n(e.animatedIcon,{[e.animatedIconSpin]:u},g?.root,d),style:{...f,..._?.root,"--animated-icon-duration":`${l}ms`,"--animated-icon-spin-rotation":`${C*s}deg`},onClick:p,onMouseEnter:m,onMouseLeave:h,children:[i(r,{icon:y[0],className:n(e.animatedIconLayer,{[e.animatedIconLayerFront]:x===0},g?.icon),style:_?.icon}),i(r,{icon:y[1],className:n(e.animatedIconLayer,{[e.animatedIconLayerFront]:x===1},g?.icon),style:_?.icon})]})}export{c as default};
2
+ //# sourceMappingURL=animatedIcon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animatedIcon.mjs","names":[],"sources":["../../../../package/common/animatedIcon/animatedIcon.tsx"],"sourcesContent":["import { useState } from 'react';\nimport type { CSSProperties } from 'react';\nimport cx from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport type { IconDefinition } from '@fortawesome/fontawesome-svg-core';\nimport type { AnimatedIconProps } from './animatedIcon.types';\n\nimport styles from './animatedIcon.module.pcss';\n\nfunction iconKey(icon: IconDefinition) {\n return `${icon.prefix}:${icon.iconName}`;\n}\n\n// A full turn per step, not Fab's original 225° — 225° only looked right there because the\n// resting \"open\" icon (a \"+\") happens to look identical rotated 45° (it's 4-fold symmetric).\n// For arbitrary icon pairs a shared rotation has to land on a multiple of 360° every time, or\n// the new icon ends up sitting sideways.\nconst SPIN_DEGREES_PER_STEP = 360;\n\nfunction AnimatedIcon({\n icon,\n duration = 200,\n spin = false,\n className,\n style,\n onClick,\n onMouseEnter,\n onMouseLeave,\n classNames,\n styles: slotStyles,\n ...rest\n}: AnimatedIconProps) {\n // Two permanently-mounted layers, ping-ponging which one is the visible (\"front\") icon,\n // instead of conditionally mounting/unmounting an \"outgoing\" layer. That's what lets this use\n // a real CSS `transition` (which retargets smoothly from wherever it currently is) rather than\n // a keyframe `animation` (which, once started on a freshly-mounted element, plays to\n // completion regardless of what happens mid-flight): tap the toggle again before a transition\n // finishes and it reverses smoothly from its current position — the same thing that already\n // let Fab's own hand-rolled icon rotation cancel cleanly.\n const [slots, setSlots] = useState<[IconDefinition, IconDefinition]>([icon, icon]);\n const [activeIndex, setActiveIndex] = useState<0 | 1>(0);\n const [spinStep, setSpinStep] = useState(0);\n\n // Adjusting state during render (not in an effect) on a prop change: the documented React\n // pattern for reacting to a prop that changed since the last render, without an extra tick.\n if (iconKey(icon) !== iconKey(slots[activeIndex])) {\n const nextIndex = activeIndex === 0 ? 1 : 0;\n const nextSlots: [IconDefinition, IconDefinition] = [...slots];\n nextSlots[nextIndex] = icon;\n setSlots(nextSlots);\n setActiveIndex(nextIndex);\n if (spin) setSpinStep((step) => step + 1);\n }\n\n return (\n <span\n {...rest}\n className={cx(styles.animatedIcon, { [styles.animatedIconSpin]: spin }, classNames?.root, className)}\n style={{\n ...style,\n ...slotStyles?.root,\n '--animated-icon-duration': `${duration}ms`,\n '--animated-icon-spin-rotation': `${spinStep * SPIN_DEGREES_PER_STEP}deg`,\n } as CSSProperties & Record<'--animated-icon-duration' | '--animated-icon-spin-rotation', string>}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n <FontAwesomeIcon\n icon={slots[0]}\n className={cx(styles.animatedIconLayer, { [styles.animatedIconLayerFront]: activeIndex === 0 }, classNames?.icon)}\n style={slotStyles?.icon as CSSProperties & Record<`--fa-font-${string}`, string>}\n />\n <FontAwesomeIcon\n icon={slots[1]}\n className={cx(styles.animatedIconLayer, { [styles.animatedIconLayerFront]: activeIndex === 1 }, classNames?.icon)}\n style={slotStyles?.icon as CSSProperties & Record<`--fa-font-${string}`, string>}\n />\n </span>\n );\n}\n\nexport default AnimatedIcon;\n"],"mappings":"uNASA,SAAS,EAAQ,EAAsB,CACrC,MAAO,GAAG,EAAK,OAAO,GAAG,EAAK,UAChC,CAMA,IAAM,EAAwB,IAE9B,SAAS,EAAa,CACpB,OACA,WAAW,IACX,OAAO,GACP,YACA,QACA,UACA,eACA,eACA,aACA,OAAQ,EACR,GAAG,GACiB,CAQpB,GAAM,CAAC,EAAO,GAAY,EAA2C,CAAC,EAAM,CAAI,CAAC,EAC3E,CAAC,EAAa,GAAkB,EAAgB,CAAC,EACjD,CAAC,EAAU,GAAe,EAAS,CAAC,EAI1C,GAAI,EAAQ,CAAI,IAAM,EAAQ,EAAM,EAAY,EAAG,CACjD,IAAM,EAAY,MAAgB,GAC5B,EAA8C,CAAC,GAAG,CAAK,EAC7D,EAAU,GAAa,EACvB,EAAS,CAAS,EAClB,EAAe,CAAS,EACpB,GAAM,EAAa,GAAS,EAAO,CAAC,CAC1C,CAEA,OACE,EAAC,OAAD,CACE,GAAI,EACJ,UAAW,EAAG,EAAO,aAAc,EAAG,EAAO,kBAAmB,CAAK,EAAG,GAAY,KAAM,CAAS,EACnG,MAAO,CACL,GAAG,EACH,GAAG,GAAY,KACf,2BAA4B,GAAG,EAAS,IACxC,gCAAiC,GAAG,EAAW,EAAsB,IACvE,EACS,UACK,eACA,wBAXhB,CAaE,EAAC,EAAD,CACE,KAAM,EAAM,GACZ,UAAW,EAAG,EAAO,kBAAmB,EAAG,EAAO,wBAAyB,IAAgB,CAAE,EAAG,GAAY,IAAI,EAChH,MAAO,GAAY,IACpB,CAAA,EACD,EAAC,EAAD,CACE,KAAM,EAAM,GACZ,UAAW,EAAG,EAAO,kBAAmB,EAAG,EAAO,wBAAyB,IAAgB,CAAE,EAAG,GAAY,IAAI,EAChH,MAAO,GAAY,IACpB,CAAA,CACG,GAEV"}
@@ -0,0 +1,2 @@
1
+ var e={animatedIcon:`animatedIcon_vyzvJ`,"animatedIcon-spin":`animatedIcon-spin_B9YzP`,animatedIconSpin:`animatedIcon-spin_B9YzP`,"animatedIcon-layer":`animatedIcon-layer_-9A1a`,animatedIconLayer:`animatedIcon-layer_-9A1a`,"animatedIcon-layer-front":`animatedIcon-layer-front_q9UVU`,animatedIconLayerFront:`animatedIcon-layer-front_q9UVU`};export{e as default};
2
+ //# sourceMappingURL=animatedIcon.module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"animatedIcon.module.mjs","names":[],"sources":["../../../../package/common/animatedIcon/animatedIcon.module.pcss"],"sourcesContent":[".animatedIcon {\n position: relative;\n display: inline-block;\n width: 1em;\n height: 1em;\n\n /* Fab's original technique: a single shared rotation on the whole icon, not per layer — both\n the outgoing and incoming icon sit at the exact same angle at every instant, only their\n opacity differs, which is what makes the spin read as one coherent piece rather than two\n icons independently rotating past each other. Always a further full turn per step (not\n Fab's 225°, which only worked there because its \"+\" icon looks identical rotated 45°) so an\n arbitrary icon always lands back upright, no matter how many times it's toggled. A real\n `transition`, so retapping mid-spin reverses smoothly from wherever it currently is instead\n of snapping. */\n &-spin {\n transition: transform var(--animated-icon-duration, 200ms) ease;\n transform: rotate(var(--animated-icon-spin-rotation, 0deg));\n\n /* The wrapper alone carries the rotation in this variant — the two layers underneath it\n only need to crossfade, not rotate individually. */\n .animatedIcon-layer {\n &:first-child,\n &:last-child {\n transform: none;\n }\n }\n }\n\n /* Two layers, always both mounted — never conditionally rendered. A `transition` only\n retargets smoothly when the property changes on an element already on screen; a freshly-\n mounted element with its \"final\" state applied in the same paint has no \"from\" state to\n animate from. Keeping both layers permanently in the DOM (like Fab does) and only ever\n toggling which one is `-front` is what makes this cancel cleanly mid-transition instead of\n jumping or finishing a stale animation. */\n &-layer {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n opacity: 0;\n transition: opacity var(--animated-icon-duration, 200ms) ease, transform var(--animated-icon-duration, 200ms) ease;\n\n /* Fixed per-layer resting pose (not per-toggle) — the first layer always approaches/leaves\n through +90°, the second always through -90°, so which direction a given swap rotates in\n depends only on which layer is taking over, the same way Fab's own icon always rotates\n between two fixed angles rather than accumulating. */\n &:first-child {\n transform: rotate(90deg) scale(0.5);\n\n &.animatedIcon-layer-front {\n transform: none;\n }\n }\n\n &:last-child {\n transform: rotate(-90deg) scale(0.5);\n\n &.animatedIcon-layer-front {\n transform: none;\n }\n }\n\n &-front {\n opacity: 1;\n }\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .animatedIcon-spin,\n .animatedIcon-layer {\n transition: none;\n }\n}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../interactableDiv/index.mjs";import n from"../actionIcon/actionIcon.mjs";import r from"../floatingMenu/floatingMenu.mjs";import i from"./breadcrumb.module.mjs";import{useState as a}from"react";import o from"classnames";import{FontAwesomeIcon as s}from"@fortawesome/react-fontawesome";import{faChevronRight as c,faEllipsis as l}from"@fortawesome/free-solid-svg-icons";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";function p(e,t){let n=e.map((e,t)=>({item:e,index:t}));if(!t||e.length<=t)return{leading:n,hidden:[],trailing:[]};let r=Math.max(1,t-2),i=e.length-1-r;return i<=0?{leading:n,hidden:[],trailing:[]}:{leading:n.slice(0,1),hidden:n.slice(1,1+i),trailing:n.slice(1+i)}}function m(t){let{items:u=[],separator:m,maxItems:g,"aria-label":_=`Breadcrumb`,className:v,style:y,classNames:b,styles:x,...S}=e(`Breadcrumb`,t),[C,w]=a(!1),{leading:T,hidden:E,trailing:D}=p(u,g),O=u.length-1;function k(e){return e===O?null:d(`span`,{className:o(i.breadcrumbSeparator,b?.separator),style:x?.separator,children:m??d(s,{icon:c})})}function A({item:e,index:t}){return f(`li`,{className:o(i.breadcrumbItem,b?.item),style:x?.item,children:[h(e,t===O,i,b,x),k(t)]},e.id??t)}return d(`nav`,{...S,"aria-label":_,className:o(i.breadcrumb,b?.root,v),style:{...y,...x?.root},children:f(`ol`,{className:o(i.breadcrumbList,b?.list),style:x?.list,children:[T.map(A),E.length>0&&f(`li`,{className:o(i.breadcrumbItem,b?.item),style:x?.item,children:[d(r,{isOpen:C,onOpenChange:w,content:d(`ul`,{className:o(i.breadcrumbHiddenList,b?.hiddenList),style:x?.hiddenList,children:E.map(({item:e,index:t})=>d(`li`,{className:o(i.breadcrumbHiddenItem,b?.hiddenItem),style:x?.hiddenItem,children:h({...e,onClick:t=>{e.onClick?.(t),w(!1)}},!1,i,b,x)},e.id??t))}),children:d(n,{icon:l,title:`Show hidden breadcrumbs`,"aria-label":`Show hidden breadcrumbs`,className:o(i.breadcrumbEllipsis,b?.ellipsis),style:x?.ellipsis})}),k(E[E.length-1].index)]}),D.map(A)]})})}function h(e,n,r,i,a){let c=f(u,{children:[e.icon&&d(s,{icon:e.icon,className:o(r.breadcrumbIcon,i?.icon),style:a?.icon}),e.label]});return n?d(`span`,{"aria-current":`page`,className:o(r.breadcrumbCurrent,i?.current),style:a?.current,children:c}):e.disabled?d(`span`,{className:o(r.breadcrumbLink,r.breadcrumbLinkDisabled,i?.link),style:a?.link,children:c}):e.href?d(`a`,{href:e.href,onClick:e.onClick,className:o(r.breadcrumbLink,i?.link),style:a?.link,children:c}):e.onClick?d(t,{onClick:e.onClick,className:o(r.breadcrumbLink,i?.link),style:a?.link,children:c}):d(`span`,{className:o(r.breadcrumbLink,r.breadcrumbLinkDisabled,i?.link),style:a?.link,children:c})}export{m as default};
1
+ import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../interactableDiv/index.mjs";import n from"../actionIcon/actionIcon.mjs";import r from"../floatingMenu/floatingMenu.mjs";import i from"./breadcrumb.module.mjs";import{useState as a}from"react";import o from"classnames";import{FontAwesomeIcon as s}from"@fortawesome/react-fontawesome";import{faChevronRight as c,faEllipsis as l}from"@fortawesome/free-solid-svg-icons";import{Fragment as u,jsx as d,jsxs as f}from"react/jsx-runtime";function p(e,t){let n=e.map((e,t)=>({item:e,index:t}));if(!t||e.length<=t)return{leading:n,hidden:[],trailing:[]};let r=Math.max(1,t-2),i=e.length-1-r;return i<=0?{leading:n,hidden:[],trailing:[]}:{leading:n.slice(0,1),hidden:n.slice(1,1+i),trailing:n.slice(1+i)}}function m(t){let{items:u=[],separator:m,maxItems:g,"aria-label":_=`Breadcrumb`,className:v,style:y,classNames:b,styles:x,...S}=e(`Breadcrumb`,t),[C,w]=a(!1),{leading:T,hidden:E,trailing:D}=p(u,g),O=u.length-1;function k(e){return e===O?null:d(`span`,{className:o(i.breadcrumbSeparator,b?.separator),style:x?.separator,children:m??d(s,{icon:c})})}function A({item:e,index:t}){return f(`li`,{className:o(i.breadcrumbItem,b?.item),style:x?.item,children:[h(e,t===O,i,b,x),k(t)]},e.id??t)}return d(`nav`,{...S,"aria-label":_,className:o(i.breadcrumb,b?.root,v),style:{...y,...x?.root},children:f(`ol`,{className:o(i.breadcrumbList,b?.list),style:x?.list,children:[T.map(A),E.length>0&&f(`li`,{className:o(i.breadcrumbItem,b?.item),style:x?.item,children:[d(r,{isOpen:C,onOpenChange:w,dontCloseOnChildClick:!0,content:d(`ul`,{className:o(i.breadcrumbHiddenList,b?.hiddenList),style:x?.hiddenList,children:E.map(({item:e,index:t})=>d(`li`,{className:o(i.breadcrumbHiddenItem,b?.hiddenItem),style:x?.hiddenItem,children:h({...e,onClick:t=>{e.onClick?.(t),w(!1)}},!1,i,b,x)},e.id??t))}),children:d(n,{icon:l,title:`Show hidden breadcrumbs`,"aria-label":`Show hidden breadcrumbs`,className:o(i.breadcrumbEllipsis,b?.ellipsis),style:x?.ellipsis})}),k(E[E.length-1].index)]}),D.map(A)]})})}function h(e,n,r,i,a){let c=f(u,{children:[e.icon&&d(s,{icon:e.icon,className:o(r.breadcrumbIcon,i?.icon),style:a?.icon}),e.label]});return n?d(`span`,{"aria-current":`page`,className:o(r.breadcrumbCurrent,i?.current),style:a?.current,children:c}):e.disabled?d(`span`,{className:o(r.breadcrumbLink,r.breadcrumbLinkDisabled,i?.link),style:a?.link,children:c}):e.href?d(`a`,{href:e.href,onClick:e.onClick,className:o(r.breadcrumbLink,i?.link),style:a?.link,children:c}):e.onClick?d(t,{onClick:e.onClick,className:o(r.breadcrumbLink,i?.link),style:a?.link,children:c}):d(`span`,{className:o(r.breadcrumbLink,r.breadcrumbLinkDisabled,i?.link),style:a?.link,children:c})}export{m as default};
2
2
  //# sourceMappingURL=breadcrumb.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"breadcrumb.mjs","names":[],"sources":["../../../../package/common/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { useState } from 'react';\nimport type { CSSProperties, ReactElement } from 'react';\nimport cx from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faChevronRight, faEllipsis } from '@fortawesome/free-solid-svg-icons';\n\nimport InteractableDiv from '../interactableDiv';\nimport ActionIcon from '../actionIcon';\nimport FloatingMenu from '../floatingMenu';\nimport { useComponentDefaults } from '../configProvider';\nimport type { BreadcrumbItem, BreadcrumbProps } from './breadcrumb.types';\n\nimport styles from './breadcrumb.module.pcss';\n\ninterface IndexedItem {\n item: BreadcrumbItem;\n index: number;\n}\n\nfunction getGroups(items: BreadcrumbItem[], maxItems?: number) {\n const indexed = items.map((item, index) => ({ item, index }));\n if (!maxItems || items.length <= maxItems) {\n return { leading: indexed, hidden: [] as IndexedItem[], trailing: [] as IndexedItem[] };\n }\n\n const trailingCount = Math.max(1, maxItems - 2);\n const hiddenCount = items.length - 1 - trailingCount;\n if (hiddenCount <= 0) {\n return { leading: indexed, hidden: [] as IndexedItem[], trailing: [] as IndexedItem[] };\n }\n\n return {\n leading: indexed.slice(0, 1),\n hidden: indexed.slice(1, 1 + hiddenCount),\n trailing: indexed.slice(1 + hiddenCount),\n };\n}\n\nfunction Breadcrumb(props: BreadcrumbProps): ReactElement {\n const {\n items = [],\n separator,\n maxItems,\n 'aria-label': ariaLabel = 'Breadcrumb',\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('Breadcrumb', props);\n\n const [isHiddenMenuOpen, setIsHiddenMenuOpen] = useState(false);\n const { leading, hidden, trailing } = getGroups(items, maxItems);\n const lastIndex = items.length - 1;\n\n function renderSeparatorAfter(index: number) {\n if (index === lastIndex) return null;\n return (\n <span className={cx(styles.breadcrumbSeparator, classNames?.separator)} style={slotStyles?.separator}>\n {separator ?? <FontAwesomeIcon icon={faChevronRight} />}\n </span>\n );\n }\n\n function renderItem({ item, index }: IndexedItem) {\n return (\n <li key={item.id ?? index} className={cx(styles.breadcrumbItem, classNames?.item)} style={slotStyles?.item}>\n {renderCrumb(item, index === lastIndex, styles, classNames, slotStyles)}\n {renderSeparatorAfter(index)}\n </li>\n );\n }\n\n return (\n <nav\n {...rest}\n aria-label={ariaLabel}\n className={cx(styles.breadcrumb, classNames?.root, className)}\n style={{ ...style, ...slotStyles?.root }}\n >\n <ol className={cx(styles.breadcrumbList, classNames?.list)} style={slotStyles?.list}>\n {leading.map(renderItem)}\n\n {hidden.length > 0 && (\n <li className={cx(styles.breadcrumbItem, classNames?.item)} style={slotStyles?.item}>\n <FloatingMenu\n isOpen={isHiddenMenuOpen}\n onOpenChange={setIsHiddenMenuOpen}\n content={\n <ul className={cx(styles.breadcrumbHiddenList, classNames?.hiddenList)} style={slotStyles?.hiddenList}>\n {hidden.map(({ item, index }) => (\n <li\n key={item.id ?? index}\n className={cx(styles.breadcrumbHiddenItem, classNames?.hiddenItem)}\n style={slotStyles?.hiddenItem}\n >\n {renderCrumb(\n {\n ...item,\n onClick: (event) => {\n item.onClick?.(event);\n setIsHiddenMenuOpen(false);\n },\n },\n false,\n styles,\n classNames,\n slotStyles\n )}\n </li>\n ))}\n </ul>\n }\n >\n <ActionIcon\n icon={faEllipsis}\n title=\"Show hidden breadcrumbs\"\n aria-label=\"Show hidden breadcrumbs\"\n className={cx(styles.breadcrumbEllipsis, classNames?.ellipsis)}\n style={slotStyles?.ellipsis}\n />\n </FloatingMenu>\n {renderSeparatorAfter(hidden[hidden.length - 1].index)}\n </li>\n )}\n\n {trailing.map(renderItem)}\n </ol>\n </nav>\n );\n}\n\nfunction renderCrumb(\n item: BreadcrumbItem,\n isCurrent: boolean,\n styles: Record<string, string>,\n classNames: BreadcrumbProps['classNames'],\n slotStyles: BreadcrumbProps['styles']\n) {\n const content = (\n <>\n {item.icon && (\n <FontAwesomeIcon\n icon={item.icon}\n className={cx(styles.breadcrumbIcon, classNames?.icon)}\n style={slotStyles?.icon as CSSProperties & Record<`--fa-font-${string}`, string>}\n />\n )}\n {item.label}\n </>\n );\n\n if (isCurrent) {\n return (\n <span\n aria-current=\"page\"\n className={cx(styles.breadcrumbCurrent, classNames?.current)}\n style={slotStyles?.current}\n >\n {content}\n </span>\n );\n }\n\n if (item.disabled) {\n return (\n <span className={cx(styles.breadcrumbLink, styles.breadcrumbLinkDisabled, classNames?.link)} style={slotStyles?.link}>\n {content}\n </span>\n );\n }\n\n if (item.href) {\n return (\n <a\n href={item.href}\n onClick={item.onClick}\n className={cx(styles.breadcrumbLink, classNames?.link)}\n style={slotStyles?.link}\n >\n {content}\n </a>\n );\n }\n\n if (item.onClick) {\n return (\n <InteractableDiv\n onClick={item.onClick}\n className={cx(styles.breadcrumbLink, classNames?.link)}\n style={slotStyles?.link}\n >\n {content}\n </InteractableDiv>\n );\n }\n\n return (\n <span className={cx(styles.breadcrumbLink, styles.breadcrumbLinkDisabled, classNames?.link)} style={slotStyles?.link}>\n {content}\n </span>\n );\n}\n\nexport default Breadcrumb;\n"],"mappings":"ghBAmBA,SAAS,EAAU,EAAyB,EAAmB,CAC7D,IAAM,EAAU,EAAM,KAAK,EAAM,KAAW,CAAE,OAAM,OAAM,EAAE,EAC5D,GAAI,CAAC,GAAY,EAAM,QAAU,EAC/B,MAAO,CAAE,QAAS,EAAS,OAAQ,CAAC,EAAoB,SAAU,CAAC,CAAmB,EAGxF,IAAM,EAAgB,KAAK,IAAI,EAAG,EAAW,CAAC,EACxC,EAAc,EAAM,OAAS,EAAI,EAKvC,OAJI,GAAe,EACV,CAAE,QAAS,EAAS,OAAQ,CAAC,EAAoB,SAAU,CAAC,CAAmB,EAGjF,CACL,QAAS,EAAQ,MAAM,EAAG,CAAC,EAC3B,OAAQ,EAAQ,MAAM,EAAG,EAAI,CAAW,EACxC,SAAU,EAAQ,MAAM,EAAI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C,OAAD,CAAM,UAAW,EAAG,EAAO,eAAgB,EAAO,uBAAwB,GAAY,IAAI,EAAG,MAAO,GAAY,cAC7G,CACG,CAAA,CAEV"}
1
+ {"version":3,"file":"breadcrumb.mjs","names":[],"sources":["../../../../package/common/breadcrumb/breadcrumb.tsx"],"sourcesContent":["import { useState } from 'react';\nimport type { CSSProperties, ReactElement } from 'react';\nimport cx from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faChevronRight, faEllipsis } from '@fortawesome/free-solid-svg-icons';\n\nimport InteractableDiv from '../interactableDiv';\nimport ActionIcon from '../actionIcon';\nimport FloatingMenu from '../floatingMenu';\nimport { useComponentDefaults } from '../configProvider';\nimport type { BreadcrumbItem, BreadcrumbProps } from './breadcrumb.types';\n\nimport styles from './breadcrumb.module.pcss';\n\ninterface IndexedItem {\n item: BreadcrumbItem;\n index: number;\n}\n\nfunction getGroups(items: BreadcrumbItem[], maxItems?: number) {\n const indexed = items.map((item, index) => ({ item, index }));\n if (!maxItems || items.length <= maxItems) {\n return { leading: indexed, hidden: [] as IndexedItem[], trailing: [] as IndexedItem[] };\n }\n\n const trailingCount = Math.max(1, maxItems - 2);\n const hiddenCount = items.length - 1 - trailingCount;\n if (hiddenCount <= 0) {\n return { leading: indexed, hidden: [] as IndexedItem[], trailing: [] as IndexedItem[] };\n }\n\n return {\n leading: indexed.slice(0, 1),\n hidden: indexed.slice(1, 1 + hiddenCount),\n trailing: indexed.slice(1 + hiddenCount),\n };\n}\n\nfunction Breadcrumb(props: BreadcrumbProps): ReactElement {\n const {\n items = [],\n separator,\n maxItems,\n 'aria-label': ariaLabel = 'Breadcrumb',\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('Breadcrumb', props);\n\n const [isHiddenMenuOpen, setIsHiddenMenuOpen] = useState(false);\n const { leading, hidden, trailing } = getGroups(items, maxItems);\n const lastIndex = items.length - 1;\n\n function renderSeparatorAfter(index: number) {\n if (index === lastIndex) return null;\n return (\n <span className={cx(styles.breadcrumbSeparator, classNames?.separator)} style={slotStyles?.separator}>\n {separator ?? <FontAwesomeIcon icon={faChevronRight} />}\n </span>\n );\n }\n\n function renderItem({ item, index }: IndexedItem) {\n return (\n <li key={item.id ?? index} className={cx(styles.breadcrumbItem, classNames?.item)} style={slotStyles?.item}>\n {renderCrumb(item, index === lastIndex, styles, classNames, slotStyles)}\n {renderSeparatorAfter(index)}\n </li>\n );\n }\n\n return (\n <nav\n {...rest}\n aria-label={ariaLabel}\n className={cx(styles.breadcrumb, classNames?.root, className)}\n style={{ ...style, ...slotStyles?.root }}\n >\n <ol className={cx(styles.breadcrumbList, classNames?.list)} style={slotStyles?.list}>\n {leading.map(renderItem)}\n\n {hidden.length > 0 && (\n <li className={cx(styles.breadcrumbItem, classNames?.item)} style={slotStyles?.item}>\n <FloatingMenu\n isOpen={isHiddenMenuOpen}\n onOpenChange={setIsHiddenMenuOpen}\n dontCloseOnChildClick\n content={\n <ul className={cx(styles.breadcrumbHiddenList, classNames?.hiddenList)} style={slotStyles?.hiddenList}>\n {hidden.map(({ item, index }) => (\n <li\n key={item.id ?? index}\n className={cx(styles.breadcrumbHiddenItem, classNames?.hiddenItem)}\n style={slotStyles?.hiddenItem}\n >\n {renderCrumb(\n {\n ...item,\n onClick: (event) => {\n item.onClick?.(event);\n setIsHiddenMenuOpen(false);\n },\n },\n false,\n styles,\n classNames,\n slotStyles\n )}\n </li>\n ))}\n </ul>\n }\n >\n <ActionIcon\n icon={faEllipsis}\n title=\"Show hidden breadcrumbs\"\n aria-label=\"Show hidden breadcrumbs\"\n className={cx(styles.breadcrumbEllipsis, classNames?.ellipsis)}\n style={slotStyles?.ellipsis}\n />\n </FloatingMenu>\n {renderSeparatorAfter(hidden[hidden.length - 1].index)}\n </li>\n )}\n\n {trailing.map(renderItem)}\n </ol>\n </nav>\n );\n}\n\nfunction renderCrumb(\n item: BreadcrumbItem,\n isCurrent: boolean,\n styles: Record<string, string>,\n classNames: BreadcrumbProps['classNames'],\n slotStyles: BreadcrumbProps['styles']\n) {\n const content = (\n <>\n {item.icon && (\n <FontAwesomeIcon\n icon={item.icon}\n className={cx(styles.breadcrumbIcon, classNames?.icon)}\n style={slotStyles?.icon as CSSProperties & Record<`--fa-font-${string}`, string>}\n />\n )}\n {item.label}\n </>\n );\n\n if (isCurrent) {\n return (\n <span\n aria-current=\"page\"\n className={cx(styles.breadcrumbCurrent, classNames?.current)}\n style={slotStyles?.current}\n >\n {content}\n </span>\n );\n }\n\n if (item.disabled) {\n return (\n <span className={cx(styles.breadcrumbLink, styles.breadcrumbLinkDisabled, classNames?.link)} style={slotStyles?.link}>\n {content}\n </span>\n );\n }\n\n if (item.href) {\n return (\n <a\n href={item.href}\n onClick={item.onClick}\n className={cx(styles.breadcrumbLink, classNames?.link)}\n style={slotStyles?.link}\n >\n {content}\n </a>\n );\n }\n\n if (item.onClick) {\n return (\n <InteractableDiv\n onClick={item.onClick}\n className={cx(styles.breadcrumbLink, classNames?.link)}\n style={slotStyles?.link}\n >\n {content}\n </InteractableDiv>\n );\n }\n\n return (\n <span className={cx(styles.breadcrumbLink, styles.breadcrumbLinkDisabled, classNames?.link)} style={slotStyles?.link}>\n {content}\n </span>\n );\n}\n\nexport default Breadcrumb;\n"],"mappings":"ghBAmBA,SAAS,EAAU,EAAyB,EAAmB,CAC7D,IAAM,EAAU,EAAM,KAAK,EAAM,KAAW,CAAE,OAAM,OAAM,EAAE,EAC5D,GAAI,CAAC,GAAY,EAAM,QAAU,EAC/B,MAAO,CAAE,QAAS,EAAS,OAAQ,CAAC,EAAoB,SAAU,CAAC,CAAmB,EAGxF,IAAM,EAAgB,KAAK,IAAI,EAAG,EAAW,CAAC,EACxC,EAAc,EAAM,OAAS,EAAI,EAKvC,OAJI,GAAe,EACV,CAAE,QAAS,EAAS,OAAQ,CAAC,EAAoB,SAAU,CAAC,CAAmB,EAGjF,CACL,QAAS,EAAQ,MAAM,EAAG,CAAC,EAC3B,OAAQ,EAAQ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AO,eAAgB,GAAY,IAAI,EACrD,MAAO,GAAY,cAElB,CACc,CAAA,EAKnB,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,eAAgB,EAAO,uBAAwB,GAAY,IAAI,EAAG,MAAO,GAAY,cAC7G,CACG,CAAA,CAEV"}
@@ -0,0 +1,2 @@
1
+ import{ButtonGroupOrientation as e}from"./buttonGroup.types.mjs";import t from"./buttonGroup.module.mjs";import n from"classnames";import{jsx as r}from"react/jsx-runtime";function i({children:i,orientation:a=e.Horizontal,className:o,style:s,...c}){return r(`div`,{...c,role:`group`,className:n(t.buttonGroup,{[t.buttonGroupVertical]:a===e.Vertical},o),style:s,children:i})}export{i as default};
2
+ //# sourceMappingURL=buttonGroup.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttonGroup.mjs","names":[],"sources":["../../../../package/common/buttonGroup/buttonGroup.tsx"],"sourcesContent":["import cx from 'classnames';\nimport type { ReactElement } from 'react';\n\nimport { ButtonGroupOrientation } from './buttonGroup.types';\nimport type { ButtonGroupProps } from './buttonGroup.types';\nimport styles from './buttonGroup.module.pcss';\n\nfunction ButtonGroup({\n children,\n orientation = ButtonGroupOrientation.Horizontal,\n className,\n style,\n ...rest\n}: ButtonGroupProps): ReactElement {\n return (\n <div\n {...rest}\n role=\"group\"\n className={cx(styles.buttonGroup, { [styles.buttonGroupVertical]: orientation === ButtonGroupOrientation.Vertical }, className)}\n style={style}\n >\n {children}\n </div>\n );\n}\n\nexport default ButtonGroup;\n"],"mappings":"2KAOA,SAAS,EAAY,CACnB,WACA,cAAc,EAAuB,WACrC,YACA,QACA,GAAG,GAC8B,CACjC,OACE,EAAC,MAAD,CACE,GAAI,EACJ,KAAK,QACL,UAAW,EAAG,EAAO,YAAa,EAAG,EAAO,qBAAsB,IAAgB,EAAuB,QAAS,EAAG,CAAS,EACvH,QAEN,UACE,CAAA,CAET"}
@@ -0,0 +1,2 @@
1
+ var e={buttonGroup:`buttonGroup_ZZ6sy`,"buttonGroup-vertical":`buttonGroup-vertical_XMx2u`,buttonGroupVertical:`buttonGroup-vertical_XMx2u`};export{e as default};
2
+ //# sourceMappingURL=buttonGroup.module.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttonGroup.module.mjs","names":[],"sources":["../../../../package/common/buttonGroup/buttonGroup.module.pcss"],"sourcesContent":[".buttonGroup {\n display: inline-flex;\n align-items: stretch;\n\n /* Each rule below targets its position with a pseudo-class (:first-child, :last-child, or\n :not()), which contributes extra specificity beyond a plain class selector. That's what\n reliably beats a child component's own base border-radius rule (e.g. Button's), regardless\n of which CSS module happens to load first in the final bundle — a plain \".buttonGroup > *\"\n reset would tie on specificity with Button's own class and depend on load order.\n\n A nested ButtonGroup (role=\"group\") is excluded throughout: it manages its own corners and\n spacing internally, so the outer group only arranges it as a self-contained unit rather than\n reaching into it. */\n > *:not(:first-child):not(:last-child):not([role='group']) {\n border-radius: 0;\n }\n\n > *:hover,\n > *:focus-within {\n z-index: 1;\n }\n\n &:not(&-vertical) {\n /* A separator (e.g. a vertical Divider) is meant to stay visible between two buttons, not\n merge into one of them, so it's excluded from the border-collapsing overlap below — and\n so is whatever comes right after one, since that overlap is only meant to collapse two\n adjacent button borders, not eat into the separator itself. A nested ButtonGroup is\n excluded the same way, and given real spacing instead, rather than being squeezed 1px\n into whatever's next to it. */\n > *:not(:first-child):not([role='separator']):not([role='group']) {\n margin-left: -1px;\n }\n\n /* Matches the specificity of the collapse rule above (three :not()s deep, not two) so this\n reliably wins the override regardless of source order — the collapse rule's own three\n :not()s (:first-child, [role=separator], [role=group]) outweigh an adjacency selector with\n only one, so a fourth, redundant :not() is added here purely to close that gap. The\n trailing :not([role='group']) on both lines also keeps this from matching when the\n following element is itself a nested group — that case must fall through to the dedicated\n 8px group-spacing rule below, not get zeroed. */\n > [role='separator'] + *:not(:first-child):not([role='group']),\n > [role='group'] + *:not(:first-child):not([role='separator']):not([role='group']) {\n margin-left: 0;\n }\n\n > [role='group']:not(:first-child) {\n margin-left: 8px;\n }\n\n > *:first-child:not(:last-child):not([role='group']) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n > *:last-child:not(:first-child):not([role='group']) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n }\n\n &-vertical {\n flex-direction: column;\n\n > *:not(:first-child):not([role='separator']):not([role='group']) {\n margin-top: -1px;\n }\n\n > [role='separator'] + *:not(:first-child):not([role='group']),\n > [role='group'] + *:not(:first-child):not([role='separator']):not([role='group']) {\n margin-top: 0;\n }\n\n > [role='group']:not(:first-child) {\n margin-top: 8px;\n }\n\n > *:first-child:not(:last-child):not([role='group']) {\n border-bottom-left-radius: 0;\n border-bottom-right-radius: 0;\n }\n\n > *:last-child:not(:first-child):not([role='group']) {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n }\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ var e=function(e){return e.Horizontal=`horizontal`,e.Vertical=`vertical`,e}({});export{e as ButtonGroupOrientation};
2
+ //# sourceMappingURL=buttonGroup.types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buttonGroup.types.mjs","names":[],"sources":["../../../../package/common/buttonGroup/buttonGroup.types.ts"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type { HtmlProps } from '../types/slots.types';\n\nexport enum ButtonGroupOrientation {\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\nexport interface ButtonGroupProps extends HtmlProps {\n children?: ReactNode;\n orientation?: ButtonGroupOrientation;\n className?: string;\n style?: CSSProperties;\n}\n"],"mappings":"AAGA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,WAAA,aACA,EAAA,SAAA,YACF,EAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{DividerTextPosition as t}from"./divider.types.mjs";import n from"./divider.module.mjs";import r from"classnames";import{jsx as i,jsxs as a}from"react/jsx-runtime";var o={[t.Left]:n.dividerTextLeft,[t.Center]:n.dividerTextCenter,[t.Right]:n.dividerTextRight};function s(s){let{text:c,textPosition:l=t.Center,className:u,style:d,classNames:f,styles:p,...m}=e(`Divider`,s),h=c!=null&&c!==``;return a(`div`,{...m,role:`separator`,className:r(n.divider,h&&o[l],u,f?.root),style:{...d,...p?.root},children:[i(`span`,{className:r(n.dividerLine,f?.line),style:p?.line}),h&&i(`span`,{className:r(n.dividerContent,f?.content),style:p?.content,children:c}),h&&i(`span`,{className:r(n.dividerLine,f?.line),style:p?.line})]})}export{s as default};
1
+ import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import{DividerOrientation as t,DividerTextPosition as n}from"./divider.types.mjs";import r from"./divider.module.mjs";import i from"classnames";import{jsx as a,jsxs as o}from"react/jsx-runtime";var s={[n.Left]:r.dividerTextLeft,[n.Center]:r.dividerTextCenter,[n.Right]:r.dividerTextRight};function c(c){let{text:l,textPosition:u=n.Center,orientation:d=t.Horizontal,className:f,style:p,classNames:m,styles:h,...g}=e(`Divider`,c),_=l!=null&&l!==``,v=d===t.Vertical;return o(`div`,{...g,role:`separator`,"aria-orientation":v?`vertical`:void 0,className:i(r.divider,v&&r.dividerVertical,_&&s[u],f,m?.root),style:{...p,...h?.root},children:[a(`span`,{className:i(r.dividerLine,m?.line),style:h?.line}),_&&a(`span`,{className:i(r.dividerContent,m?.content),style:h?.content,children:l}),_&&a(`span`,{className:i(r.dividerLine,m?.line),style:h?.line})]})}export{c as default};
2
2
  //# sourceMappingURL=divider.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.mjs","names":[],"sources":["../../../../package/common/divider/divider.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport cx from 'classnames';\n\nimport { DividerTextPosition } from './divider.types';\nimport type { DividerProps } from './divider.types';\nimport styles from './divider.module.pcss';\nimport { useComponentDefaults } from '../configProvider';\n\nconst CLASS_BY_TEXT_POSITION: Record<DividerTextPosition, string> = {\n [DividerTextPosition.Left]: styles.dividerTextLeft,\n [DividerTextPosition.Center]: styles.dividerTextCenter,\n [DividerTextPosition.Right]: styles.dividerTextRight,\n};\n\nfunction Divider(props: DividerProps): ReactElement {\n const {\n text,\n textPosition = DividerTextPosition.Center,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('Divider', props);\n\n const hasText = text != null && text !== '';\n\n return (\n <div\n {...rest}\n role=\"separator\"\n className={cx(\n styles.divider,\n hasText && CLASS_BY_TEXT_POSITION[textPosition],\n className,\n classNames?.root,\n )}\n style={{ ...style, ...slotStyles?.root }}\n >\n <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />\n {hasText && (\n <span className={cx(styles.dividerContent, classNames?.content)} style={slotStyles?.content}>\n {text}\n </span>\n )}\n {hasText && (\n <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />\n )}\n </div>\n );\n}\n\nexport default Divider;\n"],"mappings":"4PAQA,IAAM,EAA8D,EACjE,EAAoB,MAAO,EAAO,iBAClC,EAAoB,QAAS,EAAO,mBACpC,EAAoB,OAAQ,EAAO,gBACtC,EAEA,SAAS,EAAQ,EAAmC,CAClD,GAAM,CACJ,OACA,eAAe,EAAoB,OACnC,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACD,EAAqB,UAAW,CAAK,EAEnC,EAAU,GAAQ,MAAQ,IAAS,GAEzC,OACE,EAAC,MAAD,CACE,GAAI,EACJ,KAAK,YACL,UAAW,EACT,EAAO,QACP,GAAW,EAAuB,GAClC,EACA,GAAY,IACd,EACA,MAAO,CAAE,GAAG,EAAO,GAAG,GAAY,IAAK,WATzC,CAWE,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,EACpF,GACC,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,eAAgB,GAAY,OAAO,EAAG,MAAO,GAAY,iBACjF,CACG,CAAA,EAEP,GACC,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,CAEpF,GAET"}
1
+ {"version":3,"file":"divider.mjs","names":[],"sources":["../../../../package/common/divider/divider.tsx"],"sourcesContent":["import type { ReactElement } from 'react';\nimport cx from 'classnames';\n\nimport { DividerTextPosition, DividerOrientation } from './divider.types';\nimport type { DividerProps } from './divider.types';\nimport styles from './divider.module.pcss';\nimport { useComponentDefaults } from '../configProvider';\n\nconst CLASS_BY_TEXT_POSITION: Record<DividerTextPosition, string> = {\n [DividerTextPosition.Left]: styles.dividerTextLeft,\n [DividerTextPosition.Center]: styles.dividerTextCenter,\n [DividerTextPosition.Right]: styles.dividerTextRight,\n};\n\nfunction Divider(props: DividerProps): ReactElement {\n const {\n text,\n textPosition = DividerTextPosition.Center,\n orientation = DividerOrientation.Horizontal,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n } = useComponentDefaults('Divider', props);\n\n const hasText = text != null && text !== '';\n const isVertical = orientation === DividerOrientation.Vertical;\n\n return (\n <div\n {...rest}\n role=\"separator\"\n aria-orientation={isVertical ? 'vertical' : undefined}\n className={cx(\n styles.divider,\n isVertical && styles.dividerVertical,\n hasText && CLASS_BY_TEXT_POSITION[textPosition],\n className,\n classNames?.root,\n )}\n style={{ ...style, ...slotStyles?.root }}\n >\n <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />\n {hasText && (\n <span className={cx(styles.dividerContent, classNames?.content)} style={slotStyles?.content}>\n {text}\n </span>\n )}\n {hasText && (\n <span className={cx(styles.dividerLine, classNames?.line)} style={slotStyles?.line} />\n )}\n </div>\n );\n}\n\nexport default Divider;\n"],"mappings":"oRAQA,IAAM,EAA8D,EACjE,EAAoB,MAAO,EAAO,iBAClC,EAAoB,QAAS,EAAO,mBACpC,EAAoB,OAAQ,EAAO,gBACtC,EAEA,SAAS,EAAQ,EAAmC,CAClD,GAAM,CACJ,OACA,eAAe,EAAoB,OACnC,cAAc,EAAmB,WACjC,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACD,EAAqB,UAAW,CAAK,EAEnC,EAAU,GAAQ,MAAQ,IAAS,GACnC,EAAa,IAAgB,EAAmB,SAEtD,OACE,EAAC,MAAD,CACE,GAAI,EACJ,KAAK,YACL,mBAAkB,EAAa,WAAa,IAAA,GAC5C,UAAW,EACT,EAAO,QACP,GAAc,EAAO,gBACrB,GAAW,EAAuB,GAClC,EACA,GAAY,IACd,EACA,MAAO,CAAE,GAAG,EAAO,GAAG,GAAY,IAAK,WAXzC,CAaE,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,EACpF,GACC,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,eAAgB,GAAY,OAAO,EAAG,MAAO,GAAY,iBACjF,CACG,CAAA,EAEP,GACC,EAAC,OAAD,CAAM,UAAW,EAAG,EAAO,YAAa,GAAY,IAAI,EAAG,MAAO,GAAY,IAAO,CAAA,CAEpF,GAET"}
@@ -1,2 +1,2 @@
1
- var e={divider:`divider_OO203`,"divider-line":`divider-line_nVep8`,dividerLine:`divider-line_nVep8`,"divider-content":`divider-content_-y7ou`,dividerContent:`divider-content_-y7ou`,"divider-text-left":`divider-text-left_HYmeQ`,dividerTextLeft:`divider-text-left_HYmeQ`,"divider-text-right":`divider-text-right_RH5sH`,dividerTextRight:`divider-text-right_RH5sH`};export{e as default};
1
+ var e={divider:`divider_OO203`,"divider-line":`divider-line_nVep8`,dividerLine:`divider-line_nVep8`,"divider-content":`divider-content_-y7ou`,dividerContent:`divider-content_-y7ou`,"divider-text-left":`divider-text-left_HYmeQ`,dividerTextLeft:`divider-text-left_HYmeQ`,"divider-text-right":`divider-text-right_RH5sH`,dividerTextRight:`divider-text-right_RH5sH`,"divider-vertical":`divider-vertical_CasA6`,dividerVertical:`divider-vertical_CasA6`};export{e as default};
2
2
  //# sourceMappingURL=divider.module.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.module.mjs","names":[],"sources":["../../../../package/common/divider/divider.module.pcss"],"sourcesContent":[".divider {\n display: flex;\n align-items: center;\n width: 100%;\n\n &-line {\n flex: 1 1 auto;\n height: 1px;\n background-color: var(--border-color);\n }\n\n &-content {\n flex: 0 0 auto;\n padding: 0 0.75em;\n color: var(--text-dark);\n font-size: 0.875em;\n white-space: nowrap;\n }\n\n &-text-left &-line:first-child {\n flex-grow: 0;\n flex-basis: 1.5em;\n }\n\n &-text-right &-line:last-child {\n flex-grow: 0;\n flex-basis: 1.5em;\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"divider.module.mjs","names":[],"sources":["../../../../package/common/divider/divider.module.pcss"],"sourcesContent":[".divider {\n display: flex;\n align-items: center;\n width: 100%;\n\n &-line {\n flex: 1 1 auto;\n height: 1px;\n background-color: var(--border-color);\n }\n\n &-content {\n flex: 0 0 auto;\n padding: 0 0.75em;\n color: var(--text-dark);\n font-size: 0.875em;\n white-space: nowrap;\n }\n\n &-text-left &-line:first-child {\n flex-grow: 0;\n flex-basis: 1.5em;\n }\n\n &-text-right &-line:last-child {\n flex-grow: 0;\n flex-basis: 1.5em;\n }\n\n &-vertical {\n flex-direction: column;\n width: auto;\n align-self: stretch;\n }\n\n &-vertical &-line {\n width: 1px;\n height: auto;\n }\n\n &-vertical &-content {\n padding: 0.75em 0;\n }\n}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- var e=function(e){return e.Left=`left`,e.Center=`center`,e.Right=`right`,e}({});export{e as DividerTextPosition};
1
+ var e=function(e){return e.Left=`left`,e.Center=`center`,e.Right=`right`,e}({}),t=function(e){return e.Horizontal=`horizontal`,e.Vertical=`vertical`,e}({});export{t as DividerOrientation,e as DividerTextPosition};
2
2
  //# sourceMappingURL=divider.types.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"divider.types.mjs","names":[],"sources":["../../../../package/common/divider/divider.types.ts"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\n\nexport enum DividerTextPosition {\n Left = 'left',\n Center = 'center',\n Right = 'right',\n}\n\nexport type DividerSlots = 'root' | 'line' | 'content';\n\nexport interface DividerProps extends HtmlProps {\n text?: ReactNode;\n textPosition?: DividerTextPosition;\n className?: string;\n style?: CSSProperties;\n classNames?: SlotClassNames<DividerSlots>;\n styles?: SlotStyles<DividerSlots>;\n}\n"],"mappings":"AAGA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,OACA,EAAA,OAAA,SACA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"divider.types.mjs","names":[],"sources":["../../../../package/common/divider/divider.types.ts"],"sourcesContent":["import type { CSSProperties, ReactNode } from 'react';\nimport type { SlotClassNames, SlotStyles, HtmlProps } from '../types/slots.types';\n\nexport enum DividerTextPosition {\n Left = 'left',\n Center = 'center',\n Right = 'right',\n}\n\nexport enum DividerOrientation {\n Horizontal = 'horizontal',\n Vertical = 'vertical',\n}\n\nexport type DividerSlots = 'root' | 'line' | 'content';\n\nexport interface DividerProps extends HtmlProps {\n text?: ReactNode;\n textPosition?: DividerTextPosition;\n orientation?: DividerOrientation;\n className?: string;\n style?: CSSProperties;\n classNames?: SlotClassNames<DividerSlots>;\n styles?: SlotStyles<DividerSlots>;\n}\n"],"mappings":"AAGA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,OACA,EAAA,OAAA,SACA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,WAAA,aACA,EAAA,SAAA,YACF,EAAA,CAAA,CAAA"}
@@ -1,2 +1,2 @@
1
- var e={"required-mark":`required-mark_fy7Fm`,requiredMark:`required-mark_fy7Fm`,dropdown:`dropdown_XTshY`,"dropdown-label":`dropdown-label_TIpeK`,dropdownLabel:`dropdown-label_TIpeK`,"dropdown-label-column":`dropdown-label-column_cMCBc`,dropdownLabelColumn:`dropdown-label-column_cMCBc`,"dropdown-label-text":`dropdown-label-text_u-UKq`,dropdownLabelText:`dropdown-label-text_u-UKq`,"dropdown-input":`dropdown-input_WiPcb`,dropdownInput:`dropdown-input_WiPcb`,"dropdown-input-plain":`dropdown-input-plain_Ap12N`,dropdownInputPlain:`dropdown-input-plain_Ap12N`,"dropdown-input-readOnly":`dropdown-input-readOnly_3GWSO`,dropdownInputReadOnly:`dropdown-input-readOnly_3GWSO`,"dropdown-input-button":`dropdown-input-button_ziKKi`,dropdownInputButton:`dropdown-input-button_ziKKi`,"dropdown-input-button-disabled":`dropdown-input-button-disabled_JEaO-`,dropdownInputButtonDisabled:`dropdown-input-button-disabled_JEaO-`,"dropdown-input-button-readOnly":`dropdown-input-button-readOnly_QhBYY`,dropdownInputButtonReadOnly:`dropdown-input-button-readOnly_QhBYY`,"dropdown-input-button-icon":`dropdown-input-button-icon_jl7EY`,dropdownInputButtonIcon:`dropdown-input-button-icon_jl7EY`,"dropdown-input-button-icon-arrow":`dropdown-input-button-icon-arrow_SFJbx`,dropdownInputButtonIconArrow:`dropdown-input-button-icon-arrow_SFJbx`,"dropdown-input-button-icon-arrow-open":`dropdown-input-button-icon-arrow-open_8yQbZ`,dropdownInputButtonIconArrowOpen:`dropdown-input-button-icon-arrow-open_8yQbZ`,"dropdown-input-list-anim":`dropdown-input-list-anim_knSMT`,dropdownInputListAnim:`dropdown-input-list-anim_knSMT`,"dropdown-input-list-anim-flip":`dropdown-input-list-anim-flip_O6wWY`,dropdownInputListAnimFlip:`dropdown-input-list-anim-flip_O6wWY`,"dropdown-input-list-anim-wider":`dropdown-input-list-anim-wider_-YyLJ`,dropdownInputListAnimWider:`dropdown-input-list-anim-wider_-YyLJ`,"dropdown-input-list":`dropdown-input-list_JnMbA`,dropdownInputList:`dropdown-input-list_JnMbA`,"dropdown-input-list-item":`dropdown-input-list-item_EAy5L`,dropdownInputListItem:`dropdown-input-list-item_EAy5L`,"dropdown-input-list-item-active":`dropdown-input-list-item-active_0dhia`,dropdownInputListItemActive:`dropdown-input-list-item-active_0dhia`,"dropdown-input-list-item-selected":`dropdown-input-list-item-selected_hShJf`,dropdownInputListItemSelected:`dropdown-input-list-item-selected_hShJf`,"dropdown-input-list-item-disabled":`dropdown-input-list-item-disabled_3r-Yn`,dropdownInputListItemDisabled:`dropdown-input-list-item-disabled_3r-Yn`,"dropdown-input-list-hidden":`dropdown-input-list-hidden_huNc5`,dropdownInputListHidden:`dropdown-input-list-hidden_huNc5`,"dropdown-fieldset":`dropdown-fieldset_wQwTf`,dropdownFieldset:`dropdown-fieldset_wQwTf`,"dropdown-fieldset-legend":`dropdown-fieldset-legend_a1M4L`,dropdownFieldsetLegend:`dropdown-fieldset-legend_a1M4L`,"dropdown-fieldset-legend-active":`dropdown-fieldset-legend-active_bnR5F`,dropdownFieldsetLegendActive:`dropdown-fieldset-legend-active_bnR5F`,"dropdown-placeholder":`dropdown-placeholder_QYMPZ`,dropdownPlaceholder:`dropdown-placeholder_QYMPZ`,"dropdown-placeholder-shown":`dropdown-placeholder-shown_-IkNH`,dropdownPlaceholderShown:`dropdown-placeholder-shown_-IkNH`,fadeIn:`fadeIn_oMJZj`,"dropdown-matLabel":`dropdown-matLabel_iHQnt`,dropdownMatLabel:`dropdown-matLabel_iHQnt`,"dropdown-matLabel-floating":`dropdown-matLabel-floating_zY51S`,dropdownMatLabelFloating:`dropdown-matLabel-floating_zY51S`,"dropdown-border":`dropdown-border_9Oaex`,dropdownBorder:`dropdown-border_9Oaex`,"dropdown-border-focused":`dropdown-border-focused_Te-ER`,dropdownBorderFocused:`dropdown-border-focused_Te-ER`,"dropdown-border-searchFocused":`dropdown-border-searchFocused_AH67N`,dropdownBorderSearchFocused:`dropdown-border-searchFocused_AH67N`,"dropdown-border-plain":`dropdown-border-plain_Bbh-3`,dropdownBorderPlain:`dropdown-border-plain_Bbh-3`,"dropdown-border-invalid":`dropdown-border-invalid_ySVaS`,dropdownBorderInvalid:`dropdown-border-invalid_ySVaS`,"dropdown-border-error":`dropdown-border-error_-JB33`,dropdownBorderError:`dropdown-border-error_-JB33`};export{e as default};
1
+ var e={"required-mark":`required-mark_fy7Fm`,requiredMark:`required-mark_fy7Fm`,dropdown:`dropdown_XTshY`,"dropdown-label":`dropdown-label_TIpeK`,dropdownLabel:`dropdown-label_TIpeK`,"dropdown-label-column":`dropdown-label-column_cMCBc`,dropdownLabelColumn:`dropdown-label-column_cMCBc`,"dropdown-label-text":`dropdown-label-text_u-UKq`,dropdownLabelText:`dropdown-label-text_u-UKq`,"dropdown-input":`dropdown-input_WiPcb`,dropdownInput:`dropdown-input_WiPcb`,"dropdown-input-plain":`dropdown-input-plain_Ap12N`,dropdownInputPlain:`dropdown-input-plain_Ap12N`,"dropdown-input-readOnly":`dropdown-input-readOnly_3GWSO`,dropdownInputReadOnly:`dropdown-input-readOnly_3GWSO`,"dropdown-input-button":`dropdown-input-button_ziKKi`,dropdownInputButton:`dropdown-input-button_ziKKi`,"dropdown-input-button-disabled":`dropdown-input-button-disabled_JEaO-`,dropdownInputButtonDisabled:`dropdown-input-button-disabled_JEaO-`,"dropdown-input-button-readOnly":`dropdown-input-button-readOnly_QhBYY`,dropdownInputButtonReadOnly:`dropdown-input-button-readOnly_QhBYY`,"dropdown-input-button-icon":`dropdown-input-button-icon_jl7EY`,dropdownInputButtonIcon:`dropdown-input-button-icon_jl7EY`,"dropdown-input-button-icon-arrow":`dropdown-input-button-icon-arrow_SFJbx`,dropdownInputButtonIconArrow:`dropdown-input-button-icon-arrow_SFJbx`,"dropdown-input-button-icon-arrow-open":`dropdown-input-button-icon-arrow-open_8yQbZ`,dropdownInputButtonIconArrowOpen:`dropdown-input-button-icon-arrow-open_8yQbZ`,"dropdown-input-list-anim":`dropdown-input-list-anim_knSMT`,dropdownInputListAnim:`dropdown-input-list-anim_knSMT`,"dropdown-input-list-anim-flip":`dropdown-input-list-anim-flip_O6wWY`,dropdownInputListAnimFlip:`dropdown-input-list-anim-flip_O6wWY`,"dropdown-input-list-anim-wider":`dropdown-input-list-anim-wider_-YyLJ`,dropdownInputListAnimWider:`dropdown-input-list-anim-wider_-YyLJ`,"dropdown-input-list":`dropdown-input-list_JnMbA`,dropdownInputList:`dropdown-input-list_JnMbA`,"dropdown-input-list-item":`dropdown-input-list-item_EAy5L`,dropdownInputListItem:`dropdown-input-list-item_EAy5L`,"dropdown-input-list-item-active":`dropdown-input-list-item-active_0dhia`,dropdownInputListItemActive:`dropdown-input-list-item-active_0dhia`,"dropdown-input-list-item-selected":`dropdown-input-list-item-selected_hShJf`,dropdownInputListItemSelected:`dropdown-input-list-item-selected_hShJf`,"dropdown-input-list-item-disabled":`dropdown-input-list-item-disabled_3r-Yn`,dropdownInputListItemDisabled:`dropdown-input-list-item-disabled_3r-Yn`,"dropdown-fieldset":`dropdown-fieldset_wQwTf`,dropdownFieldset:`dropdown-fieldset_wQwTf`,"dropdown-fieldset-legend":`dropdown-fieldset-legend_a1M4L`,dropdownFieldsetLegend:`dropdown-fieldset-legend_a1M4L`,"dropdown-fieldset-legend-active":`dropdown-fieldset-legend-active_bnR5F`,dropdownFieldsetLegendActive:`dropdown-fieldset-legend-active_bnR5F`,"dropdown-placeholder":`dropdown-placeholder_QYMPZ`,dropdownPlaceholder:`dropdown-placeholder_QYMPZ`,"dropdown-placeholder-shown":`dropdown-placeholder-shown_-IkNH`,dropdownPlaceholderShown:`dropdown-placeholder-shown_-IkNH`,fadeIn:`fadeIn_oMJZj`,"dropdown-matLabel":`dropdown-matLabel_iHQnt`,dropdownMatLabel:`dropdown-matLabel_iHQnt`,"dropdown-matLabel-floating":`dropdown-matLabel-floating_zY51S`,dropdownMatLabelFloating:`dropdown-matLabel-floating_zY51S`,"dropdown-border-focused":`dropdown-border-focused_Te-ER`,dropdownBorderFocused:`dropdown-border-focused_Te-ER`,"dropdown-border-plain":`dropdown-border-plain_Bbh-3`,dropdownBorderPlain:`dropdown-border-plain_Bbh-3`,"dropdown-border-invalid":`dropdown-border-invalid_ySVaS`,dropdownBorderInvalid:`dropdown-border-invalid_ySVaS`,"dropdown-border-error":`dropdown-border-error_-JB33`,dropdownBorderError:`dropdown-border-error_-JB33`};export{e as default};
2
2
  //# sourceMappingURL=dropdown.module.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown.module.mjs","names":[],"sources":["../../../../package/common/dropdown/dropdown.module.pcss"],"sourcesContent":["\n.required-mark {\n padding: 0px 0px 0px 4px;\n color: var(--required-mark-color, var(--error-color));\n}\n\n.dropdown {\n position: relative;\n\n &-label {\n display: flex;\n\n &-column {\n flex-direction: column;\n }\n\n &-text {\n white-space: nowrap;\n margin-right: 5px;\n margin-bottom: 5px;\n display: flex;\n align-items: center;\n color: var(--text-color);\n font-size: 12px;\n position: absolute;\n top: -15px;\n }\n }\n\n &-input {\n position: relative;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: var(--input-background);\n border-radius: var(--default-border-radius);\n\n &-plain {\n background: transparent;\n }\n\n &-readOnly {\n cursor: default;\n }\n\n &:focus-within {\n outline: none;\n }\n\n &-button {\n padding: 7px 20% 7px 7.5px !important;\n background-color: transparent;\n border: none;\n font-family: inherit;\n font-size: inherit;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n text-align: left;\n width: 100%;\n line-height: 1.25;\n color: var(--text-color);\n\n &-disabled {\n background-color: var(--disabled-input-color);\n color: var(--disabled-font-color);\n border-radius: var(--default-border-radius);\n }\n\n &-readOnly {\n cursor: default;\n }\n\n &:focus {\n outline: none;\n }\n\n &-icon {\n float: right;\n background-color: transparent;\n border: none;\n position: absolute;\n outline: none;\n right: var(--spacing-s);\n top: 50%;\n transform: translateY(-50%);\n color: var(--text-color);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n &-arrow {\n transition: transform 0.25s;\n pointer-events: none;\n\n &-open {\n transform: rotate(180deg);\n }\n }\n }\n }\n\n &-list-anim {\n position: fixed;\n z-index: 1;\n color: var(--text-color);\n background: var(--background-modal);\n box-shadow: var(--card-shadow);\n border-radius: var(--default-border-radius);\n overflow: hidden;\n transform: scaleY(1);\n transition: transform 0.25s;\n transform-origin: right top;\n\n &-flip {\n transform-origin: right bottom;\n }\n\n &-wider {\n width: max-content !important;\n }\n }\n\n &-list {\n width: 100%;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 160px;\n list-style-type: none;\n\n &-item {\n border: none;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: var(--background-modal);\n padding: 8px;\n text-align: left;\n border-radius: 0;\n transition: all 0.3s;\n\n &-active {\n background-color: var(--background-accent);\n }\n\n &-selected {\n font-weight: 500;\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n background-color: var(--background-accent);\n }\n\n &-disabled {\n background-color: var(--disabled-input-color);\n color: var(--disabled-font-color);\n cursor: not-allowed;\n\n &:hover {\n background-color: var(--disabled-input-color);\n }\n }\n }\n\n &-hidden {\n transform: scaleY(0);\n }\n }\n }\n\n &-fieldset {\n position: absolute;\n width: 100%;\n margin: 0;\n box-sizing: border-box;\n border-radius: var(--default-border-radius);\n inset: -10px 0 0 0;\n padding-left: 8px;\n border-width: 1px;\n border-style: solid;\n border-color: var(--border-color);\n pointer-events: none;\n user-select: none;\n\n &-legend {\n display: block;\n max-width: 0;\n transition: max-width 0.2s;\n white-space: nowrap;\n padding: 0;\n\n &-active {\n max-width: 300px;\n }\n\n span {\n font-size: 13px;\n padding: 5px;\n opacity: 0;\n }\n\n /* With an empty label the span would still reserve its padding, leaving a gap in\n the fieldset's top border. Collapse it so the notch closes when there's no label. */\n span:empty {\n padding: 0.000001px;\n }\n }\n }\n\n &-placeholder {\n position: absolute;\n top: 8px;\n left: 7px;\n transition: all 0.2s;\n opacity: 0;\n\n &-shown {\n animation: 0.2s fadeIn 0.3s forwards;\n }\n }\n\n &-matLabel {\n position: absolute;\n transition: all 0.3s;\n inset: 9px 0 0 7px;\n font-size: 16px;\n color: var(--input-label-resting-color, var(--text-light));\n pointer-events: none;\n user-select: none;\n\n &-floating {\n inset: -9px 0 0 14px;\n font-size: 13px;\n color: var(--input-label-floating-color, var(--text-color));\n }\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 0.5;\n }\n }\n\n &-border {\n outline: 1px solid var(--border-color);\n transition: border-color;\n background-color: var(--input-background);\n outline: none;\n\n &-focused {\n outline-color: var(--primary-color);\n border-color: var(--primary-color);\n }\n\n &-searchFocused {\n outline-color: var(--search-input-color);\n outline-width: 2px;\n border-color: var(--search-input-color);\n }\n\n &-plain {\n border-color: transparent;\n outline-color: transparent;\n }\n\n &-invalid {\n outline-color: var(--error-border-color);\n border-color: var(--error-border-color);\n }\n\n &-invalid:hover {\n outline-color: var(--error-border-color);\n border-color: var(--error-border-color);\n }\n\n &-error {\n outline-color: var(--error-border-color);\n border-color: var(--error-border-color);\n }\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"dropdown.module.mjs","names":[],"sources":["../../../../package/common/dropdown/dropdown.module.pcss"],"sourcesContent":["\n.required-mark {\n padding: 0px 0px 0px 4px;\n color: var(--required-mark-color, var(--error-color));\n}\n\n.dropdown {\n position: relative;\n\n &-label {\n display: flex;\n\n &-column {\n flex-direction: column;\n }\n\n &-text {\n white-space: nowrap;\n margin-right: 5px;\n margin-bottom: 5px;\n display: flex;\n align-items: center;\n color: var(--text-color);\n font-size: 12px;\n position: absolute;\n top: -15px;\n }\n }\n\n &-input {\n position: relative;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: var(--input-background);\n border-radius: var(--default-border-radius);\n\n &-plain {\n background: transparent;\n }\n\n &-readOnly {\n cursor: default;\n }\n\n &:focus-within {\n outline: none;\n }\n\n &-button {\n padding: 7px 20% 7px 7.5px !important;\n background-color: transparent;\n border: none;\n font-family: inherit;\n font-size: inherit;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n text-align: left;\n width: 100%;\n line-height: 1.25;\n color: var(--text-color);\n\n &-disabled {\n background-color: var(--disabled-input-color);\n color: var(--disabled-font-color);\n border-radius: var(--default-border-radius);\n }\n\n &-readOnly {\n cursor: default;\n }\n\n &:focus {\n outline: none;\n }\n\n &-icon {\n float: right;\n background-color: transparent;\n border: none;\n position: absolute;\n outline: none;\n right: var(--spacing-s);\n top: 50%;\n transform: translateY(-50%);\n color: var(--text-color);\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n\n &-arrow {\n transition: transform 0.25s;\n pointer-events: none;\n\n &-open {\n transform: rotate(180deg);\n }\n }\n }\n }\n\n &-list-anim {\n position: fixed;\n z-index: 1;\n color: var(--text-color);\n background: var(--background-modal);\n box-shadow: var(--card-shadow);\n border-radius: var(--default-border-radius);\n overflow: hidden;\n transform: scaleY(1);\n transition: transform 0.25s;\n transform-origin: right top;\n\n &-flip {\n transform-origin: right bottom;\n }\n\n &-wider {\n width: max-content !important;\n }\n }\n\n &-list {\n width: 100%;\n display: flex;\n flex-direction: column;\n overflow-y: auto;\n max-height: 160px;\n list-style-type: none;\n\n &-item {\n border: none;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n background-color: var(--background-modal);\n padding: 8px;\n text-align: left;\n border-radius: 0;\n transition: all 0.3s;\n\n &-active {\n background-color: var(--background-accent);\n }\n\n &-selected {\n font-weight: 500;\n }\n\n &:focus {\n outline: none;\n }\n\n &:hover {\n background-color: var(--background-accent);\n }\n\n &-disabled {\n background-color: var(--disabled-input-color);\n color: var(--disabled-font-color);\n cursor: not-allowed;\n\n &:hover {\n background-color: var(--disabled-input-color);\n }\n }\n }\n }\n }\n\n &-fieldset {\n position: absolute;\n width: 100%;\n margin: 0;\n box-sizing: border-box;\n border-radius: var(--default-border-radius);\n inset: -10px 0 0 0;\n padding-left: 8px;\n border-width: 1px;\n border-style: solid;\n border-color: var(--border-color);\n pointer-events: none;\n user-select: none;\n\n &-legend {\n display: block;\n max-width: 0;\n transition: max-width 0.2s;\n white-space: nowrap;\n padding: 0;\n\n &-active {\n max-width: 300px;\n }\n\n span {\n font-size: 13px;\n padding: 5px;\n opacity: 0;\n }\n\n /* With an empty label the span would still reserve its padding, leaving a gap in\n the fieldset's top border. Collapse it so the notch closes when there's no label. */\n span:empty {\n padding: 0.000001px;\n }\n }\n }\n\n &-placeholder {\n position: absolute;\n top: 8px;\n left: 7px;\n transition: all 0.2s;\n opacity: 0;\n\n &-shown {\n animation: 0.2s fadeIn 0.3s forwards;\n }\n }\n\n &-matLabel {\n position: absolute;\n transition: all 0.3s;\n inset: 9px 0 0 7px;\n font-size: 16px;\n color: var(--input-label-resting-color, var(--text-light));\n pointer-events: none;\n user-select: none;\n\n &-floating {\n inset: -9px 0 0 14px;\n font-size: 13px;\n color: var(--input-label-floating-color, var(--text-color));\n }\n }\n\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 0.5;\n }\n }\n\n &-border {\n &-focused {\n outline-color: var(--primary-color);\n border-color: var(--primary-color);\n }\n\n &-plain {\n border-color: transparent;\n outline-color: transparent;\n }\n\n &-invalid {\n outline-color: var(--error-border-color);\n border-color: var(--error-border-color);\n }\n\n &-invalid:hover {\n outline-color: var(--error-border-color);\n border-color: var(--error-border-color);\n }\n\n &-error {\n outline-color: var(--error-border-color);\n border-color: var(--error-border-color);\n }\n }\n}\n"],"mappings":""}
@@ -1,2 +1,2 @@
1
- import e from"./components/fabBase/fabBase.mjs";import t from"./fab.module.mjs";import{useState as n}from"react";import r from"classnames";import{FontAwesomeIcon as i}from"@fortawesome/react-fontawesome";import{faPlus as a}from"@fortawesome/free-solid-svg-icons";import{jsx as o,jsxs as s}from"react/jsx-runtime";function c({children:c=null,size:l=`default`,menuEntries:u=[],onMenuEntryClicked:d=()=>{},onClick:f=()=>{},closeMenuOnEntryClicked:p=!0,...m}){let[h,g]=n(!1);function _(){u.length>0&&g(e=>!e),f()}function v(e,t){e.stopPropagation(),p&&g(!1),d(t)}return s(`div`,{...m,className:t.fabContainer,children:[o(`div`,{className:r(t.fabMenuBackdrop,h&&t.fabMenuBackdropOpen),onClick:e=>{e.stopPropagation(),g(!1)}}),o(`div`,{onClick:e=>e.stopPropagation(),children:o(e,{className:t.fab,size:l,onClick:_,children:s(`div`,{className:r(t.fabIcon,h&&t.fabIconMenuOpen),children:[o(`div`,{className:r(t.fabIconContent,!h&&t.fabIconContentShown),children:c}),o(`div`,{className:r(t.fabIconContent,h&&t.fabIconContentShown),children:o(i,{icon:a})})]})})}),o(`div`,{className:t.fabMenu,children:u.map(({id:n,label:a,icon:c})=>s(`div`,{className:r(t.fabMenuEntry,h&&t.fabMenuEntryShown),onClick:e=>v(e,n),children:[a&&o(`div`,{className:t.fabMenuEntryLabelContainer,children:o(`div`,{className:t.fabMenuEntryLabel,children:a})}),o(e,{size:`mini`,children:o(i,{icon:c})})]},n))})]})}export{c as default};
1
+ import{ButtonStyleType as e}from"../button/button.types.mjs";import t from"./components/fabBase/fabBase.mjs";import n from"./fab.module.mjs";import{useState as r}from"react";import i from"classnames";import{FontAwesomeIcon as a}from"@fortawesome/react-fontawesome";import{faPlus as o}from"@fortawesome/free-solid-svg-icons";import{jsx as s,jsxs as c}from"react/jsx-runtime";function l({children:l=null,size:u=`default`,menuEntries:d=[],onMenuEntryClicked:f=()=>{},onClick:p=()=>{},closeMenuOnEntryClicked:m=!0,...h}){let[g,_]=r(!1);function v(){d.length>0&&_(e=>!e),p()}function y(e,t){e.stopPropagation(),m&&_(!1),f(t)}return c(`div`,{...h,className:n.fabContainer,children:[s(`div`,{className:i(n.fabMenuBackdrop,g&&n.fabMenuBackdropOpen),onClick:e=>{e.stopPropagation(),_(!1)}}),s(`div`,{onClick:e=>e.stopPropagation(),children:s(t,{className:n.fab,size:u,onClick:v,children:c(`div`,{className:i(n.fabIcon,g&&n.fabIconMenuOpen),children:[s(`div`,{className:i(n.fabIconContent,!g&&n.fabIconContentShown),children:l}),s(`div`,{className:i(n.fabIconContent,g&&n.fabIconContentShown),children:s(a,{icon:o})})]})})}),s(`div`,{className:n.fabMenu,children:d.map(({id:r,label:o,icon:l})=>c(`div`,{className:i(n.fabMenuEntry,g&&n.fabMenuEntryShown),onClick:e=>y(e,r),children:[o&&s(`div`,{className:n.fabMenuEntryLabelContainer,children:s(`div`,{className:n.fabMenuEntryLabel,children:o})}),s(t,{size:`mini`,styleType:e.Default,children:s(a,{icon:l})})]},r))})]})}export{l as default};
2
2
  //# sourceMappingURL=fab.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"fab.mjs","names":[],"sources":["../../../../package/common/fab/fab.tsx"],"sourcesContent":["import { useState } from 'react';\nimport cx from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faPlus as addIcon } from '@fortawesome/free-solid-svg-icons';\n\nimport FabBase from './components/fabBase';\nimport type { FabProps } from './fab.types';\n\nimport styles from './fab.module.pcss';\n\nfunction Fab({\n children = null,\n size = 'default',\n menuEntries = [],\n onMenuEntryClicked = () => {},\n onClick = () => {},\n closeMenuOnEntryClicked = true,\n ...rest\n}: FabProps) {\n const [menuOpen, setMenuOpen] = useState(false);\n\n function handleFabClick() {\n if (menuEntries.length > 0) setMenuOpen((prev) => !prev);\n onClick();\n }\n\n function handleEntryClick(e: React.MouseEvent, id: string) {\n e.stopPropagation();\n if (closeMenuOnEntryClicked) setMenuOpen(false);\n onMenuEntryClicked(id);\n }\n\n return (\n <div {...rest} className={styles.fabContainer}>\n <div\n className={cx(styles.fabMenuBackdrop, menuOpen && styles.fabMenuBackdropOpen)}\n onClick={(e) => { e.stopPropagation(); setMenuOpen(false); }}\n />\n <div onClick={(e) => e.stopPropagation()}>\n <FabBase className={styles.fab} size={size} onClick={handleFabClick}>\n <div className={cx(styles.fabIcon, menuOpen && styles.fabIconMenuOpen)}>\n <div className={cx(styles.fabIconContent, !menuOpen && styles.fabIconContentShown)}>\n {children}\n </div>\n <div className={cx(styles.fabIconContent, menuOpen && styles.fabIconContentShown)}>\n <FontAwesomeIcon icon={addIcon} />\n </div>\n </div>\n </FabBase>\n </div>\n <div className={styles.fabMenu}>\n {menuEntries.map(({ id, label, icon }) => (\n <div\n key={id}\n className={cx(styles.fabMenuEntry, menuOpen && styles.fabMenuEntryShown)}\n onClick={(e) => handleEntryClick(e, id)}\n >\n {label && (\n <div className={styles.fabMenuEntryLabelContainer}>\n <div className={styles.fabMenuEntryLabel}>{label}</div>\n </div>\n )}\n <FabBase size=\"mini\">\n <FontAwesomeIcon icon={icon} />\n </FabBase>\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nexport default Fab;\n"],"mappings":"yTAUA,SAAS,EAAI,CACX,WAAW,KACX,OAAO,UACP,cAAc,CAAC,EACf,yBAA2B,CAAC,EAC5B,cAAgB,CAAC,EACjB,0BAA0B,GAC1B,GAAG,GACQ,CACX,GAAM,CAAC,EAAU,GAAe,EAAS,EAAK,EAE9C,SAAS,GAAiB,CACpB,EAAY,OAAS,GAAG,EAAa,GAAS,CAAC,CAAI,EACvD,EAAQ,CACV,CAEA,SAAS,EAAiB,EAAqB,EAAY,CACzD,EAAE,gBAAgB,EACd,GAAyB,EAAY,EAAK,EAC9C,EAAmB,CAAE,CACvB,CAEA,OACE,EAAC,MAAD,CAAK,GAAI,EAAM,UAAW,EAAO,sBAAjC,CACE,EAAC,MAAD,CACE,UAAW,EAAG,EAAO,gBAAiB,GAAY,EAAO,mBAAmB,EAC5E,QAAU,GAAM,CAAE,EAAE,gBAAgB,EAAG,EAAY,EAAK,CAAG,CAC5D,CAAA,EACD,EAAC,MAAD,CAAK,QAAU,GAAM,EAAE,gBAAgB,WACrC,EAAC,EAAD,CAAS,UAAW,EAAO,IAAW,OAAM,QAAS,WACnD,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,QAAS,GAAY,EAAO,eAAe,WAArE,CACE,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,eAAgB,CAAC,GAAY,EAAO,mBAAmB,EAC9E,UACE,CAAA,EACL,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,eAAgB,GAAY,EAAO,mBAAmB,WAC9E,EAAC,EAAD,CAAiB,KAAM,CAAU,CAAA,CAC9B,CAAA,CACF,GACE,CAAA,CACN,CAAA,EACL,EAAC,MAAD,CAAK,UAAW,EAAO,iBACpB,EAAY,KAAK,CAAE,KAAI,QAAO,UAC7B,EAAC,MAAD,CAEE,UAAW,EAAG,EAAO,aAAc,GAAY,EAAO,iBAAiB,EACvE,QAAU,GAAM,EAAiB,EAAG,CAAE,WAHxC,CAKG,GACC,EAAC,MAAD,CAAK,UAAW,EAAO,oCACrB,EAAC,MAAD,CAAK,UAAW,EAAO,2BAAoB,CAAW,CAAA,CACnD,CAAA,EAEP,EAAC,EAAD,CAAS,KAAK,gBACZ,EAAC,EAAD,CAAuB,MAAO,CAAA,CACvB,CAAA,CACN,GAZE,CAYF,CACN,CACE,CAAA,CACF,GAET"}
1
+ {"version":3,"file":"fab.mjs","names":[],"sources":["../../../../package/common/fab/fab.tsx"],"sourcesContent":["import { useState } from 'react';\nimport cx from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { faPlus as addIcon } from '@fortawesome/free-solid-svg-icons';\nimport { ButtonStyleType } from '../button/button.types';\n\nimport FabBase from './components/fabBase';\nimport type { FabProps } from './fab.types';\n\nimport styles from './fab.module.pcss';\n\nfunction Fab({\n children = null,\n size = 'default',\n menuEntries = [],\n onMenuEntryClicked = () => {},\n onClick = () => {},\n closeMenuOnEntryClicked = true,\n ...rest\n}: FabProps) {\n const [menuOpen, setMenuOpen] = useState(false);\n\n function handleFabClick() {\n if (menuEntries.length > 0) setMenuOpen((prev) => !prev);\n onClick();\n }\n\n function handleEntryClick(e: React.MouseEvent, id: string) {\n e.stopPropagation();\n if (closeMenuOnEntryClicked) setMenuOpen(false);\n onMenuEntryClicked(id);\n }\n\n return (\n <div {...rest} className={styles.fabContainer}>\n <div\n className={cx(styles.fabMenuBackdrop, menuOpen && styles.fabMenuBackdropOpen)}\n onClick={(e) => { e.stopPropagation(); setMenuOpen(false); }}\n />\n <div onClick={(e) => e.stopPropagation()}>\n <FabBase className={styles.fab} size={size} onClick={handleFabClick}>\n <div className={cx(styles.fabIcon, menuOpen && styles.fabIconMenuOpen)}>\n <div className={cx(styles.fabIconContent, !menuOpen && styles.fabIconContentShown)}>\n {children}\n </div>\n <div className={cx(styles.fabIconContent, menuOpen && styles.fabIconContentShown)}>\n <FontAwesomeIcon icon={addIcon} />\n </div>\n </div>\n </FabBase>\n </div>\n <div className={styles.fabMenu}>\n {menuEntries.map(({ id, label, icon }) => (\n <div\n key={id}\n className={cx(styles.fabMenuEntry, menuOpen && styles.fabMenuEntryShown)}\n onClick={(e) => handleEntryClick(e, id)}\n >\n {label && (\n <div className={styles.fabMenuEntryLabelContainer}>\n <div className={styles.fabMenuEntryLabel}>{label}</div>\n </div>\n )}\n <FabBase size=\"mini\" styleType={ButtonStyleType.Default}>\n <FontAwesomeIcon icon={icon} />\n </FabBase>\n </div>\n ))}\n </div>\n </div>\n );\n}\n\nexport default Fab;\n"],"mappings":"sXAWA,SAAS,EAAI,CACX,WAAW,KACX,OAAO,UACP,cAAc,CAAC,EACf,yBAA2B,CAAC,EAC5B,cAAgB,CAAC,EACjB,0BAA0B,GAC1B,GAAG,GACQ,CACX,GAAM,CAAC,EAAU,GAAe,EAAS,EAAK,EAE9C,SAAS,GAAiB,CACpB,EAAY,OAAS,GAAG,EAAa,GAAS,CAAC,CAAI,EACvD,EAAQ,CACV,CAEA,SAAS,EAAiB,EAAqB,EAAY,CACzD,EAAE,gBAAgB,EACd,GAAyB,EAAY,EAAK,EAC9C,EAAmB,CAAE,CACvB,CAEA,OACE,EAAC,MAAD,CAAK,GAAI,EAAM,UAAW,EAAO,sBAAjC,CACE,EAAC,MAAD,CACE,UAAW,EAAG,EAAO,gBAAiB,GAAY,EAAO,mBAAmB,EAC5E,QAAU,GAAM,CAAE,EAAE,gBAAgB,EAAG,EAAY,EAAK,CAAG,CAC5D,CAAA,EACD,EAAC,MAAD,CAAK,QAAU,GAAM,EAAE,gBAAgB,WACrC,EAAC,EAAD,CAAS,UAAW,EAAO,IAAW,OAAM,QAAS,WACnD,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,QAAS,GAAY,EAAO,eAAe,WAArE,CACE,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,eAAgB,CAAC,GAAY,EAAO,mBAAmB,EAC9E,UACE,CAAA,EACL,EAAC,MAAD,CAAK,UAAW,EAAG,EAAO,eAAgB,GAAY,EAAO,mBAAmB,WAC9E,EAAC,EAAD,CAAiB,KAAM,CAAU,CAAA,CAC9B,CAAA,CACF,GACE,CAAA,CACN,CAAA,EACL,EAAC,MAAD,CAAK,UAAW,EAAO,iBACpB,EAAY,KAAK,CAAE,KAAI,QAAO,UAC7B,EAAC,MAAD,CAEE,UAAW,EAAG,EAAO,aAAc,GAAY,EAAO,iBAAiB,EACvE,QAAU,GAAM,EAAiB,EAAG,CAAE,WAHxC,CAKG,GACC,EAAC,MAAD,CAAK,UAAW,EAAO,oCACrB,EAAC,MAAD,CAAK,UAAW,EAAO,2BAAoB,CAAW,CAAA,CACnD,CAAA,EAEP,EAAC,EAAD,CAAS,KAAK,OAAO,UAAW,EAAgB,iBAC9C,EAAC,EAAD,CAAuB,MAAO,CAAA,CACvB,CAAA,CACN,GAZE,CAYF,CACN,CACE,CAAA,CACF,GAET"}
@@ -1,2 +1,2 @@
1
- import e from"../bodyEnd/bodyEnd.mjs";import t from"./floatingMenu.module.mjs";import{useFloatingPosition as n}from"./useFloatingPosition.mjs";import{Align as r}from"./floatingMenu.types.mjs";import{useEffect as i,useRef as a,useState as o}from"react";import s from"classnames";import{jsx as c,jsxs as l}from"react/jsx-runtime";function u(e){return e.charAt(0).toUpperCase()+e.slice(1)}function d({align:d=r.Left,children:f=null,content:p=null,isOpen:m=!1,onOpenChange:h=()=>{},dontCloseOnChildClick:g=!1,className:_,style:v,classNames:y,styles:b,...x}){let S=a(null),C=a(null),w=a(null),T=a(h),[E,D]=o(10),O=a(!1);function k(){O.current=!0}i(()=>{T.current=h});function A(){if(!m){let e=w.current?.getBoundingClientRect();D(e?.width??10),h(!0)}}return n({isOpen:m,triggerRef:w,anchorRef:C,panelRef:S,flipClassName:t.floatingMenuAnimFlip}),i(()=>{if(!m)return;function e(e){let t=S.current,n=w.current;if(!t||!n)return;let r=O.current;O.current=!1;let i=r||t===e.target||t.contains(e.target),a=g&&(n===e.target||n.contains(e.target));!i&&!a&&T.current(!1)}return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[m,g]),l(`div`,{...x,className:s(t.floatingMenu,_,y?.root),style:{...v,...b?.root},children:[c(`div`,{className:s(t.floatingMenuContent,y?.trigger),style:b?.trigger,ref:w,onClick:A,children:f}),m&&c(e,{children:l(`div`,{ref:C,className:s(t.floatingMenuAnim,y?.menu),style:{width:`${E}px`,...b?.menu},children:[c(`div`,{className:s(t.floatingMenuContainerFlag,t[`floatingMenuContainerFlagAlign${u(d)}`])}),c(`div`,{ref:S,className:s(t.floatingMenuContainer,t[`floatingMenuContainerAlign${u(d)}`],y?.menuContainer),style:b?.menuContainer,onMouseUpCapture:k,children:p})]})})]})}export{d as default};
1
+ import e from"../bodyEnd/bodyEnd.mjs";import t from"./floatingMenu.module.mjs";import{useFloatingPosition as n}from"./useFloatingPosition.mjs";import{tabbablesIn as r,useFocusBoundary as i}from"../hooks/useFocusBoundary.mjs";import{Align as a}from"./floatingMenu.types.mjs";import{useEffect as o,useRef as s,useState as c}from"react";import l from"classnames";import{jsx as u,jsxs as d}from"react/jsx-runtime";function f(e){return e.charAt(0).toUpperCase()+e.slice(1)}function p({align:p=a.Left,children:m=null,content:h=null,isOpen:g=!1,onOpenChange:_=()=>{},dontCloseOnChildClick:v=!1,className:y,style:b,classNames:x,styles:S,...C}){let w=s(null),T=s(null),E=s(null),D=s(_),[O,k]=c(10),A=s(!1);function j(){A.current=!0}o(()=>{D.current=_});function M(){if(g){v||_(!1);return}let e=E.current?.getBoundingClientRect();k(e?.width??10),_(!0)}n({isOpen:g,triggerRef:E,anchorRef:T,panelRef:w,flipClassName:t.floatingMenuAnimFlip}),o(()=>{if(!g)return;function e(e){let t=w.current,n=E.current;if(!t||!n)return;let r=e.target;if(n===r||n.contains(r))return;let i=A.current;A.current=!1,(!(i||t===r||t.contains(r))||!v)&&D.current(!1)}return window.addEventListener(`mouseup`,e),()=>window.removeEventListener(`mouseup`,e)},[g,v]);let{restoreFocusToTrigger:N,focusAfterTrigger:P}=i({triggerRef:E,contentRef:w});function F(e){if(e.key===`Escape`){e.preventDefault(),N(),D.current(!1);return}if(e.key!==`Tab`)return;let t=r(w.current);if(t.length===0)return;let n=document.activeElement;!e.shiftKey&&n===t[t.length-1]?(e.preventDefault(),P(),D.current(!1)):e.shiftKey&&n===t[0]&&(e.preventDefault(),N(),D.current(!1))}return d(`div`,{...C,className:l(t.floatingMenu,y,x?.root),style:{...b,...S?.root},children:[u(`div`,{className:l(t.floatingMenuContent,x?.trigger),style:S?.trigger,ref:E,onClick:M,children:m}),g&&u(e,{children:d(`div`,{ref:T,className:l(t.floatingMenuAnim,x?.menu),style:{width:`${O}px`,...S?.menu},children:[u(`div`,{className:l(t.floatingMenuContainerFlag,t[`floatingMenuContainerFlagAlign${f(p)}`])}),u(`div`,{ref:w,className:l(t.floatingMenuContainer,t[`floatingMenuContainerAlign${f(p)}`],x?.menuContainer),style:S?.menuContainer,onMouseUpCapture:j,onKeyDown:F,children:h})]})})]})}export{p as default};
2
2
  //# sourceMappingURL=floatingMenu.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"floatingMenu.mjs","names":[],"sources":["../../../../package/common/floatingMenu/floatingMenu.tsx"],"sourcesContent":["import { useRef, useEffect, useState } from 'react';\nimport cx from 'classnames';\nimport BodyEnd from 'components/common/bodyEnd';\n\nimport styles from './floatingMenu.module.pcss';\nimport { useFloatingPosition } from './useFloatingPosition';\nimport { Align, FloatingMenuProps } from './floatingMenu.types';\n\nfunction capitalize(s: string) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nfunction FloatingMenu({\n align = Align.Left,\n children = null,\n content = null,\n isOpen = false,\n onOpenChange = () => {},\n dontCloseOnChildClick = false,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n}: FloatingMenuProps) {\n const menuContainerRef = useRef<HTMLDivElement>(null);\n const menuAnimRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const onOpenChangeRef = useRef(onOpenChange);\n const [triggerWidth, setTriggerWidth] = useState(10);\n\n const contentInteractedRef = useRef(false);\n function handleContentMouseUp() {\n contentInteractedRef.current = true;\n }\n\n useEffect(() => { onOpenChangeRef.current = onOpenChange; });\n\n function handleTriggerClick() {\n if (!isOpen) {\n const rect = triggerRef.current?.getBoundingClientRect();\n setTriggerWidth(rect?.width ?? 10);\n onOpenChange(true);\n }\n }\n\n useFloatingPosition({\n isOpen,\n triggerRef,\n anchorRef: menuAnimRef,\n panelRef: menuContainerRef,\n flipClassName: styles.floatingMenuAnimFlip,\n });\n\n useEffect(() => {\n if (!isOpen) return;\n\n function onMouseUp(event: MouseEvent) {\n const menuElem = menuContainerRef.current;\n const triggerElem = triggerRef.current;\n if (!menuElem || !triggerElem) return;\n\n const contentInteracted = contentInteractedRef.current;\n contentInteractedRef.current = false;\n\n const menuClicked =\n contentInteracted || menuElem === event.target || menuElem.contains(event.target as Node);\n const triggerClicked = dontCloseOnChildClick &&\n (triggerElem === event.target || triggerElem.contains(event.target as Node));\n\n if (!menuClicked && !triggerClicked) {\n onOpenChangeRef.current(false);\n }\n }\n\n window.addEventListener('mouseup', onMouseUp);\n return () => window.removeEventListener('mouseup', onMouseUp);\n }, [isOpen, dontCloseOnChildClick]);\n\n return (\n <div {...rest} className={cx(styles.floatingMenu, className, classNames?.root)} style={{ ...style, ...slotStyles?.root }}>\n <div\n className={cx(styles.floatingMenuContent, classNames?.trigger)}\n style={slotStyles?.trigger}\n ref={triggerRef}\n onClick={handleTriggerClick}\n >\n {children}\n </div>\n {isOpen && (\n <BodyEnd>\n <div\n ref={menuAnimRef}\n className={cx(styles.floatingMenuAnim, classNames?.menu)}\n style={{\n width: `${triggerWidth}px`,\n ...slotStyles?.menu,\n }}\n >\n <div className={cx(\n styles.floatingMenuContainerFlag,\n styles[`floatingMenuContainerFlagAlign${capitalize(align)}`],\n )} />\n <div\n ref={menuContainerRef}\n className={cx(\n styles.floatingMenuContainer,\n styles[`floatingMenuContainerAlign${capitalize(align)}`],\n classNames?.menuContainer,\n )}\n style={slotStyles?.menuContainer}\n onMouseUpCapture={handleContentMouseUp}\n >\n {content}\n </div>\n </div>\n </BodyEnd>\n )}\n </div>\n );\n}\n\nexport default FloatingMenu;\n"],"mappings":"wUAQA,SAAS,EAAW,EAAW,CAC7B,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,EAAI,EAAE,MAAM,CAAC,CAC9C,CAEA,SAAS,EAAa,CACpB,QAAQ,EAAM,KACd,WAAW,KACX,UAAU,KACV,SAAS,GACT,mBAAqB,CAAC,EACtB,wBAAwB,GACxB,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACiB,CACpB,IAAM,EAAmB,EAAuB,IAAI,EAC9C,EAAc,EAAuB,IAAI,EACzC,EAAa,EAAuB,IAAI,EACxC,EAAkB,EAAO,CAAY,EACrC,CAAC,EAAc,GAAmB,EAAS,EAAE,EAE7C,EAAuB,EAAO,EAAK,EACzC,SAAS,GAAuB,CAC9B,EAAqB,QAAU,EACjC,CAEA,MAAgB,CAAE,EAAgB,QAAU,CAAc,CAAC,EAE3D,SAAS,GAAqB,CAC5B,GAAI,CAAC,EAAQ,CACX,IAAM,EAAO,EAAW,SAAS,sBAAsB,EACvD,EAAgB,GAAM,OAAS,EAAE,EACjC,EAAa,EAAI,CACnB,CACF,CAmCA,OAjCA,EAAoB,CAClB,SACA,aACA,UAAW,EACX,SAAU,EACV,cAAe,EAAO,oBACxB,CAAC,EAED,MAAgB,CACd,GAAI,CAAC,EAAQ,OAEb,SAAS,EAAU,EAAmB,CACpC,IAAM,EAAW,EAAiB,QAC5B,EAAc,EAAW,QAC/B,GAAI,CAAC,GAAY,CAAC,EAAa,OAE/B,IAAM,EAAoB,EAAqB,QAC/C,EAAqB,QAAU,GAE/B,IAAM,EACJ,GAAqB,IAAa,EAAM,QAAU,EAAS,SAAS,EAAM,MAAc,EACpF,EAAiB,IACpB,IAAgB,EAAM,QAAU,EAAY,SAAS,EAAM,MAAc,GAExE,CAAC,GAAe,CAAC,GACnB,EAAgB,QAAQ,EAAK,CAEjC,CAGA,OADA,OAAO,iBAAiB,UAAW,CAAS,MAC/B,OAAO,oBAAoB,UAAW,CAAS,CAC9D,EAAG,CAAC,EAAQ,CAAqB,CAAC,EAGhC,EAAC,MAAD,CAAK,GAAI,EAAM,UAAW,EAAG,EAAO,aAAc,EAAW,GAAY,IAAI,EAAG,MAAO,CAAE,GAAG,EAAO,GAAG,GAAY,IAAK,WAAvH,CACE,EAAC,MAAD,CACE,UAAW,EAAG,EAAO,oBAAqB,GAAY,OAAO,EAC7D,MAAO,GAAY,QACnB,IAAK,EACL,QAAS,EAER,UACE,CAAA,EACJ,GACC,EAAC,EAAD,CAAA,SACE,EAAC,MAAD,CACE,IAAK,EACL,UAAW,EAAG,EAAO,iBAAkB,GAAY,IAAI,EACvD,MAAO,CACL,MAAO,GAAG,EAAa,IACvB,GAAG,GAAY,IACjB,WANF,CAQE,EAAC,MAAD,CAAK,UAAW,EACd,EAAO,0BACP,EAAO,iCAAiC,EAAW,CAAK,IAC1D,CAAI,CAAA,EACJ,EAAC,MAAD,CACE,IAAK,EACL,UAAW,EACT,EAAO,sBACP,EAAO,6BAA6B,EAAW,CAAK,KACpD,GAAY,aACd,EACA,MAAO,GAAY,cACnB,iBAAkB,WAEjB,CACE,CAAA,CACF,GACE,CAAA,CAER,GAET"}
1
+ {"version":3,"file":"floatingMenu.mjs","names":[],"sources":["../../../../package/common/floatingMenu/floatingMenu.tsx"],"sourcesContent":["import { useRef, useEffect, useState } from 'react';\nimport cx from 'classnames';\nimport BodyEnd from 'components/common/bodyEnd';\n\nimport styles from './floatingMenu.module.pcss';\nimport { useFloatingPosition } from './useFloatingPosition';\nimport { useFocusBoundary, tabbablesIn } from '../hooks/useFocusBoundary';\nimport { Align, FloatingMenuProps } from './floatingMenu.types';\n\nfunction capitalize(s: string) {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nfunction FloatingMenu({\n align = Align.Left,\n children = null,\n content = null,\n isOpen = false,\n onOpenChange = () => {},\n dontCloseOnChildClick = false,\n className,\n style,\n classNames,\n styles: slotStyles,\n ...rest\n}: FloatingMenuProps) {\n const menuContainerRef = useRef<HTMLDivElement>(null);\n const menuAnimRef = useRef<HTMLDivElement>(null);\n const triggerRef = useRef<HTMLDivElement>(null);\n const onOpenChangeRef = useRef(onOpenChange);\n const [triggerWidth, setTriggerWidth] = useState(10);\n\n const contentInteractedRef = useRef(false);\n function handleContentMouseUp() {\n contentInteractedRef.current = true;\n }\n\n useEffect(() => { onOpenChangeRef.current = onOpenChange; });\n\n function handleTriggerClick() {\n if (isOpen) {\n if (!dontCloseOnChildClick) onOpenChange(false);\n return;\n }\n const rect = triggerRef.current?.getBoundingClientRect();\n setTriggerWidth(rect?.width ?? 10);\n onOpenChange(true);\n }\n\n useFloatingPosition({\n isOpen,\n triggerRef,\n anchorRef: menuAnimRef,\n panelRef: menuContainerRef,\n flipClassName: styles.floatingMenuAnimFlip,\n });\n\n useEffect(() => {\n if (!isOpen) return;\n\n function onMouseUp(event: MouseEvent) {\n const menuElem = menuContainerRef.current;\n const triggerElem = triggerRef.current;\n if (!menuElem || !triggerElem) return;\n\n const target = event.target as Node;\n if (triggerElem === target || triggerElem.contains(target)) return;\n\n const contentInteracted = contentInteractedRef.current;\n contentInteractedRef.current = false;\n const clickedInMenu = contentInteracted || menuElem === target || menuElem.contains(target);\n\n if (!clickedInMenu || !dontCloseOnChildClick) {\n onOpenChangeRef.current(false);\n }\n }\n\n window.addEventListener('mouseup', onMouseUp);\n return () => window.removeEventListener('mouseup', onMouseUp);\n }, [isOpen, dontCloseOnChildClick]);\n\n const { restoreFocusToTrigger, focusAfterTrigger } = useFocusBoundary({\n triggerRef,\n contentRef: menuContainerRef,\n });\n\n // The menu is portaled to the end of the DOM, so Tab never flows into it naturally. When\n // `content` has real focusable elements, close on Tab out of either end and continue focus as\n // if the menu sat right after the trigger. Unlike Popover, this doesn't also auto-focus the\n // first element on open, content here ranges from menus to live controls like ColorPicker's\n // hue slider, where grabbing focus on open would let a stray arrow-key press nudge a value the\n // user never interacted with. Auto-focus-on-open is still worth doing per-consumer (e.g.\n // SplitButton focuses its first enabled action), just not assumed generically here.\n function handleMenuKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n event.preventDefault();\n restoreFocusToTrigger();\n onOpenChangeRef.current(false);\n return;\n }\n if (event.key !== 'Tab') return;\n const focusables = tabbablesIn(menuContainerRef.current);\n if (focusables.length === 0) return;\n const active = document.activeElement;\n if (!event.shiftKey && active === focusables[focusables.length - 1]) {\n event.preventDefault();\n focusAfterTrigger();\n onOpenChangeRef.current(false);\n } else if (event.shiftKey && active === focusables[0]) {\n event.preventDefault();\n restoreFocusToTrigger();\n onOpenChangeRef.current(false);\n }\n }\n\n return (\n <div {...rest} className={cx(styles.floatingMenu, className, classNames?.root)} style={{ ...style, ...slotStyles?.root }}>\n <div\n className={cx(styles.floatingMenuContent, classNames?.trigger)}\n style={slotStyles?.trigger}\n ref={triggerRef}\n onClick={handleTriggerClick}\n >\n {children}\n </div>\n {isOpen && (\n <BodyEnd>\n <div\n ref={menuAnimRef}\n className={cx(styles.floatingMenuAnim, classNames?.menu)}\n style={{\n width: `${triggerWidth}px`,\n ...slotStyles?.menu,\n }}\n >\n <div className={cx(\n styles.floatingMenuContainerFlag,\n styles[`floatingMenuContainerFlagAlign${capitalize(align)}`],\n )} />\n <div\n ref={menuContainerRef}\n className={cx(\n styles.floatingMenuContainer,\n styles[`floatingMenuContainerAlign${capitalize(align)}`],\n classNames?.menuContainer,\n )}\n style={slotStyles?.menuContainer}\n onMouseUpCapture={handleContentMouseUp}\n onKeyDown={handleMenuKeyDown}\n >\n {content}\n </div>\n </div>\n </BodyEnd>\n )}\n </div>\n );\n}\n\nexport default FloatingMenu;\n"],"mappings":"0ZASA,SAAS,EAAW,EAAW,CAC7B,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,EAAI,EAAE,MAAM,CAAC,CAC9C,CAEA,SAAS,EAAa,CACpB,QAAQ,EAAM,KACd,WAAW,KACX,UAAU,KACV,SAAS,GACT,mBAAqB,CAAC,EACtB,wBAAwB,GACxB,YACA,QACA,aACA,OAAQ,EACR,GAAG,GACiB,CACpB,IAAM,EAAmB,EAAuB,IAAI,EAC9C,EAAc,EAAuB,IAAI,EACzC,EAAa,EAAuB,IAAI,EACxC,EAAkB,EAAO,CAAY,EACrC,CAAC,EAAc,GAAmB,EAAS,EAAE,EAE7C,EAAuB,EAAO,EAAK,EACzC,SAAS,GAAuB,CAC9B,EAAqB,QAAU,EACjC,CAEA,MAAgB,CAAE,EAAgB,QAAU,CAAc,CAAC,EAE3D,SAAS,GAAqB,CAC5B,GAAI,EAAQ,CACL,GAAuB,EAAa,EAAK,EAC9C,MACF,CACA,IAAM,EAAO,EAAW,SAAS,sBAAsB,EACvD,EAAgB,GAAM,OAAS,EAAE,EACjC,EAAa,EAAI,CACnB,CAEA,EAAoB,CAClB,SACA,aACA,UAAW,EACX,SAAU,EACV,cAAe,EAAO,oBACxB,CAAC,EAED,MAAgB,CACd,GAAI,CAAC,EAAQ,OAEb,SAAS,EAAU,EAAmB,CACpC,IAAM,EAAW,EAAiB,QAC5B,EAAc,EAAW,QAC/B,GAAI,CAAC,GAAY,CAAC,EAAa,OAE/B,IAAM,EAAS,EAAM,OACrB,GAAI,IAAgB,GAAU,EAAY,SAAS,CAAM,EAAG,OAE5D,IAAM,EAAoB,EAAqB,QAC/C,EAAqB,QAAU,IAG3B,EAFkB,GAA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EAAC,MAAD,CACE,IAAK,EACL,UAAW,EACT,EAAO,sBACP,EAAO,6BAA6B,EAAW,CAAK,KACpD,GAAY,aACd,EACA,MAAO,GAAY,cACnB,iBAAkB,EAClB,UAAW,WAEV,CACE,CAAA,CACF,GACE,CAAA,CAER,GAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"floatingMenu.module.mjs","names":[],"sources":["../../../../package/common/floatingMenu/floatingMenu.module.pcss"],"sourcesContent":[".floatingMenu {\n position: relative;\n\n &-content {\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n\n &-container {\n color: var(--text-color);\n font-family: var(--default-font);\n font-size: var(--default-font-size);\n box-shadow: var(--card-shadow);\n position: absolute;\n margin-top: 10px;\n background: var(--background-modal);\n padding: 8px;\n border-radius: calc(var(--default-border-radius) + 4px);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n &-align {\n &-left {\n left: 0px;\n }\n\n &-right {\n right: 0px;\n }\n\n &-center {\n left: 50%;\n transform: translateX(-50%);\n }\n }\n\n &-flag {\n box-shadow: var(--card-shadow);\n background: var(--background-modal);\n height: 10px;\n width: 10px;\n position: absolute;\n margin-top: 5px;\n transform: rotate(45deg);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 5px;\n }\n\n &-align-right {\n right: 8px;\n }\n\n &-align-left {\n left: 8px;\n }\n\n &-align-center {\n left: 50%;\n transform: translateX(-50%) rotate(45deg);\n }\n }\n }\n\n &-anim {\n transform: scale(0.7);\n opacity: 0.7;\n animation: showMenu 0.1s forwards;\n position: fixed;\n z-index: 1;\n }\n\n @keyframes showMenu {\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n}\n"],"mappings":""}
1
+ {"version":3,"file":"floatingMenu.module.mjs","names":[],"sources":["../../../../package/common/floatingMenu/floatingMenu.module.pcss"],"sourcesContent":[".floatingMenu {\n position: relative;\n\n &-content {\n display: flex;\n align-items: stretch;\n height: 100%;\n cursor: pointer;\n -webkit-tap-highlight-color: transparent;\n }\n\n &-container {\n color: var(--text-color);\n font-family: var(--default-font);\n font-size: var(--default-font-size);\n box-shadow: var(--card-shadow);\n position: absolute;\n margin-top: 10px;\n background: var(--background-modal);\n padding: 8px;\n border-radius: calc(var(--default-border-radius) + 4px);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 10px;\n }\n\n &-align {\n &-left {\n left: 0px;\n }\n\n &-right {\n right: 0px;\n }\n\n &-center {\n left: 50%;\n transform: translateX(-50%);\n }\n }\n\n &-flag {\n box-shadow: var(--card-shadow);\n background: var(--background-modal);\n height: 10px;\n width: 10px;\n position: absolute;\n margin-top: 5px;\n transform: rotate(45deg);\n\n .floatingMenu-anim-flip & {\n top: auto;\n bottom: 0;\n margin-top: 0;\n margin-bottom: 5px;\n }\n\n &-align-right {\n right: 8px;\n }\n\n &-align-left {\n left: 8px;\n }\n\n &-align-center {\n left: 50%;\n transform: translateX(-50%) rotate(45deg);\n }\n }\n }\n\n &-anim {\n transform: scale(0.7);\n opacity: 0.7;\n animation: showMenu 0.1s forwards;\n position: fixed;\n z-index: 1;\n }\n\n @keyframes showMenu {\n to {\n transform: scale(1);\n opacity: 1;\n }\n }\n}\n"],"mappings":""}
@@ -0,0 +1,2 @@
1
+ var e=[`a[href]`,`area[href]`,`button:not([disabled])`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`,`[contenteditable="true"]`].join(`,`);function t(t){return t?Array.from(t.querySelectorAll(e)):[]}function n({triggerRef:e,contentRef:n}){function r(){return t(e.current)[0]??e.current}function i(){r()?.focus()}function a(){let e=t(document.body).filter(e=>!n.current?.contains(e)),i=r(),a=i?e.indexOf(i):-1;a>=0&&e[a+1]?.focus()}return{firstTriggerFocusable:r,restoreFocusToTrigger:i,focusAfterTrigger:a}}export{t as tabbablesIn,n as useFocusBoundary};
2
+ //# sourceMappingURL=useFocusBoundary.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFocusBoundary.mjs","names":[],"sources":["../../../../package/common/hooks/useFocusBoundary.ts"],"sourcesContent":["import type { RefObject } from 'react';\n\nconst FOCUSABLE_SELECTOR = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n '[tabindex]:not([tabindex=\"-1\"])',\n '[contenteditable=\"true\"]',\n].join(',');\n\n/** Tabbable descendants of `root`, in DOM order. */\nexport function tabbablesIn(root: ParentNode | null): HTMLElement[] {\n if (!root) return [];\n return Array.from(root.querySelectorAll<HTMLElement>(FOCUSABLE_SELECTOR));\n}\n\nexport interface UseFocusBoundaryArgs {\n /** The trigger element focus returns to on Escape / Shift+Tab out of the content's top. */\n triggerRef: RefObject<HTMLElement | null>;\n /** The portaled content root — tabbables inside it define the Tab boundary. */\n contentRef: RefObject<HTMLElement | null>;\n}\n\n/**\n * Focus helpers for content portaled to the end of the DOM (e.g. via BodyEnd), where Tab can't\n * reach it in visual document order on its own. Shared by FloatingMenu and Popover, which both\n * need to hand focus back to the trigger on Escape / Shift+Tab out of the top, and continue\n * focus naturally past the trigger when Tab exits the bottom.\n */\nexport function useFocusBoundary({ triggerRef, contentRef }: UseFocusBoundaryArgs) {\n function firstTriggerFocusable(): HTMLElement | null {\n return tabbablesIn(triggerRef.current)[0] ?? triggerRef.current;\n }\n\n function restoreFocusToTrigger() {\n firstTriggerFocusable()?.focus();\n }\n\n // Move focus to the tabbable element that follows the trigger in the document, skipping the\n // portaled content — the \"natural next\" stop when Tab exits the bottom of the content.\n function focusAfterTrigger() {\n const all = tabbablesIn(document.body).filter((el) => !contentRef.current?.contains(el));\n const trig = firstTriggerFocusable();\n const idx = trig ? all.indexOf(trig) : -1;\n if (idx >= 0) all[idx + 1]?.focus();\n }\n\n return { firstTriggerFocusable, restoreFocusToTrigger, focusAfterTrigger };\n}\n"],"mappings":"AAEA,IAAM,EAAqB,CACzB,UACA,aACA,yBACA,wBACA,yBACA,2BACA,kCACA,0BACF,EAAE,KAAK,GAAG,EAGV,SAAgB,EAAY,EAAwC,CAElE,OADK,EACE,MAAM,KAAK,EAAK,iBAA8B,CAAkB,CAAC,EADtD,CAAC,CAErB,CAeA,SAAgB,EAAiB,CAAE,aAAY,cAAoC,CACjF,SAAS,GAA4C,CACnD,OAAO,EAAY,EAAW,OAAO,EAAE,IAAM,EAAW,OAC1D,CAEA,SAAS,GAAwB,CAC/B,EAAsB,GAAG,MAAM,CACjC,CAIA,SAAS,GAAoB,CAC3B,IAAM,EAAM,EAAY,SAAS,IAAI,EAAE,OAAQ,GAAO,CAAC,EAAW,SAAS,SAAS,CAAE,CAAC,EACjF,EAAO,EAAsB,EAC7B,EAAM,EAAO,EAAI,QAAQ,CAAI,EAAI,GACnC,GAAO,GAAG,EAAI,EAAM,IAAI,MAAM,CACpC,CAEA,MAAO,CAAE,wBAAuB,wBAAuB,mBAAkB,CAC3E"}
@@ -1,2 +1,2 @@
1
- import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../tooltip/tooltip.mjs";import n from"./input.module.mjs";import{InputType as r}from"./input.types.mjs";import ee,{useCallback as te,useEffect as i,useId as ne,useRef as a,useState as o}from"react";import s from"classnames";import{FontAwesomeIcon as c}from"@fortawesome/react-fontawesome";import{faEnvelope as re,faEye as ie,faEyeSlash as ae,faPen as oe,faPhone as se,faSearch as ce,faXmark as le}from"@fortawesome/free-solid-svg-icons";import{jsx as l,jsxs as u}from"react/jsx-runtime";function d(d){let{name:f=``,id:ue,label:p=``,errorMessage:m=``,isValid:de=!0,className:fe=``,style:pe,value:h=``,icon:me=null,onChange:he=()=>{},onFocus:g=null,onBlur:_=null,onMouseEnter:v=null,onMouseLeave:y=null,isUppercase:ge=!1,isRequired:_e=!1,tabIndex:ve=0,type:b=void 0,isRow:ye=!1,onIconClick:x=null,parse:S=null,formValidator:C=null,autoFocus:w=!1,suffix:T=null,upperRightLabel:E=null,labelInBorder:be=!1,showCancel:xe=!1,onClearClicked:Se,min:Ce=null,max:we=null,placeholder:D=``,useMatLabelStyle:O=!0,alwaysFloatLabel:Te=!1,autoComplete:Ee=null,onClick:De=()=>null,readOnly:k=!1,customInput:Oe,alwaysShowCancel:ke=!1,multiline:A=!1,rows:j,autoResize:M=!1,classNames:N,styles:P,disabled:F=!1,...Ae}=e(`Input`,d),[I,L]=o(!1),[R,z]=o(!1),[B,je]=o(!1),[,Me]=o(0),V=a(null),H=a(C),Ne=ne(),U=ue||f||Ne,W=te(()=>{let e=V.current;!e||!M||(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[M]);i(()=>{W()},[]),i(()=>{w&&V.current&&setTimeout(()=>{V.current?.focus()},1)},[w]),i(()=>{H.current=C;let e=H.current;if(!e)return;e.label=p??``,e.validate();let t=()=>Me(e=>e+1);return e.registerOnUpdateListener(t),()=>{e.removeOnUpdateListener(t)}},[C,p]);let Pe=()=>C?C.touched&&C.hasError():!de||!!m,G=()=>!!(_e||C&&C.validators.find(e=>e.validatorId===`required`)),Fe=e=>{z(!0),v&&v(e)},Ie=e=>{z(!1),y&&y(e)},Le=e=>{L(!0),g&&g(e)},Re=e=>{H.current&&(H.current.touched=!0),L(!1),_&&_(e)},ze=e=>{let t,n;typeof e==`string`?n=e:(t=e,n=e.target.value),S&&(n=S(n)),C&&C.set(n),he&&he(n,t),W()},Be=()=>{if(b!==`email`)return b===`password`&&B?`text`:b},K=b&&b!==r.Date&&b!==r.Iban&&b!==r.HasNoIcon,q=K&&!O&&(b===r.Email||b===r.Phone||b===r.Search),J={className:s(n.inputFieldIcon,{[n.inputFieldIconNotClickable]:!x,[n.inputFieldIconLeft]:q}),onClick:x??void 0},Y=me,Ve=Y?ee.cloneElement(Y,{className:s(n.inputFieldIcon,{[n.inputFieldIconNotClickable]:!x&&!Y.props.onClick},Y.props.className),onClick:x??Y.props.onClick}):null,He=!!me,Ue={className:s(n.inputFieldIcon,n.inputFieldIconPassword),onClick:()=>je(!B)},X=Pe(),Z=p;Z&&G()&&(Z=`${Z} *`);let We=G()?l(`span`,{className:n.requiredMark,children:`*`}):null,Ge=C?C.value:h,Q=I&&!k,$=O&&(Te||Q||Ge||b===r.Date);return u(`div`,{className:s(n.input,fe),style:pe,children:[u(`label`,{htmlFor:U,className:s(n.inputLabel,N?.label,{[n.inputLabelColumn]:!ye,[n.inputLabelInBorder]:be}),style:P?.label,children:[p&&!O?u(`span`,{className:n.inputLabelText,children:[p,We]}):null,E&&l(`div`,{className:s(n.inputUpperRightLabel,N?.upperRightLabel),style:P?.upperRightLabel,children:E}),u(`div`,{className:s(n.inputContainer,{[n.inputContainerMultiline]:A},N?.container),style:P?.container,onMouseEnter:Fe,onMouseLeave:Ie,children:[Ve,ee.cloneElement(Oe||l(A?`textarea`:`input`,{}),{...Ae,className:s(n.inputField,{[n.inputFieldUppercase]:ge,[n.inputFieldDate]:b===r.Date,[n.inputFieldDefault]:b!==r.Date,[n.inputFieldWithIcon]:K||He,[n.inputFieldWithIconLeft]:q,[n.inputFieldMultiline]:A,[n.inputFieldMultilineAutoResize]:A&&M,[n.inputFieldReadOnly]:k&&!F},N?.input),name:f,id:U,value:C?C.value:h,tabIndex:ve,ref:Oe?void 0:V,onChange:ze,onFocus:Le,onBlur:Re,placeholder:O?``:D,autoComplete:Ee,onClick:De,readOnly:k,disabled:F,...!A&&{type:Be(),min:Ce,max:we},...A&&j!==void 0&&{rows:j}}),T&&l(`div`,{className:s(n.inputFieldSuffix,N?.suffix),style:P?.suffix,children:T})]}),l(`fieldset`,{className:s(n.inputFieldset,N?.fieldset,{[n.inputContainerBorderFocused]:Q,[n.inputContainerBorderSearchFocused]:b===r.Search&&(Q||h),[n.inputContainerBorderInvalid]:X,[n.inputContainerBorderError]:X}),style:P?.fieldset,children:l(`legend`,{className:s(n.inputFieldsetLegend,{[n.inputFieldsetLegendActive]:$}),children:l(`span`,{children:Z})})}),O&&p&&u(`div`,{className:s(n.inputMatLabel,{[n.inputMatLabelFloating]:$,[n.inputMatLabelMultiline]:A&&!$}),children:[p,We]}),O&&D&&l(`div`,{className:s(n.inputPlaceholder,Q&&!Ge&&n.inputPlaceholderShown,A&&n.inputPlaceholderMultiline),children:D}),l(t,{variant:`error`,message:C?C.getCurrentErrorMessage():m||``,isVisible:X&&(I||R)})]}),b===r.Phone&&l(c,{icon:se,...J}),b===r.Email&&l(c,{icon:re,...J}),b===r.Edit&&l(c,{icon:oe,...J}),b===r.Search&&l(c,{icon:ce,...J}),b===r.Password&&l(c,{icon:B?ae:ie,...Ue}),(xe&&h&&(I||R)||ke)&&l(c,{icon:le,className:n.inputFieldIcon,onClick:Se??void 0,onMouseEnter:()=>z(!0),onMouseLeave:()=>z(!1)})]})}export{d as default};
1
+ import{useComponentDefaults as e}from"../configProvider/useComponentDefaults.mjs";import t from"../tooltip/tooltip.mjs";import n from"../animatedIcon/animatedIcon.mjs";import r from"./input.module.mjs";import{InputIconPosition as i,InputType as a}from"./input.types.mjs";import ee,{useCallback as te,useEffect as o,useId as ne,useRef as s,useState as c}from"react";import l from"classnames";import{FontAwesomeIcon as u}from"@fortawesome/react-fontawesome";import{faEnvelope as re,faEye as ie,faEyeSlash as ae,faPen as oe,faPhone as se,faSearch as ce,faXmark as d}from"@fortawesome/free-solid-svg-icons";import{jsx as f,jsxs as p}from"react/jsx-runtime";function m(m){let{name:h=``,id:le,label:g=``,errorMessage:ue=``,isValid:de=!0,className:fe=``,style:pe,value:_=``,icon:me=null,iconPosition:he,onChange:v=()=>{},onFocus:ge=null,onBlur:_e=null,onMouseEnter:ve=null,onMouseLeave:ye=null,isUppercase:be=!1,isRequired:xe=!1,tabIndex:Se=0,type:y=void 0,isRow:Ce=!1,onIconClick:b=null,parse:we=null,formValidator:x=null,autoFocus:S=!1,suffix:C=null,upperRightLabel:w=null,labelInBorder:Te=!1,showCancel:Ee=!1,onClearClicked:De,min:Oe=null,max:ke=null,placeholder:T=``,useMatLabelStyle:E=!0,alwaysFloatLabel:Ae=!1,autoComplete:je=null,onClick:Me=()=>null,readOnly:D=!1,customInput:O,alwaysShowCancel:Ne=!1,multiline:k=!1,rows:A,autoResize:j=!1,classNames:M,styles:N,disabled:P=!1,...F}=e(`Input`,m),[I,L]=c(!1),[Pe,R]=c(!1),[z,Fe]=c(!1),[,Ie]=c(0),B=s(null),V=s(x),Le=ne(),Re=le||h||Le,ze=te(()=>{let e=B.current;!e||!j||(e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`)},[j]);o(()=>{ze()},[]),o(()=>{S&&B.current&&setTimeout(()=>{B.current?.focus()},1)},[S]),o(()=>{V.current=x;let e=V.current;if(!e)return;e.label=g??``,e.validate();let t=()=>Ie(e=>e+1);return e.registerOnUpdateListener(t),()=>{e.removeOnUpdateListener(t)}},[x,g]);let Be=()=>x?x.touched&&x.hasError():!de||!!ue,Ve=()=>!!(xe||x&&x.validators.find(e=>e.validatorId===`required`)),He=e=>{R(!0),ve&&ve(e)},Ue=e=>{R(!1),ye&&ye(e)},We=e=>{L(!0),ge&&ge(e)},Ge=e=>{V.current&&(V.current.touched=!0),L(!1),_e&&_e(e)},Ke=e=>{let t,n;typeof e==`string`?n=e:(t=e,n=e.target.value),we&&(n=we(n)),x&&x.set(n),v&&v(n,t),ze()},qe=()=>{if(y!==a.Email)return y===a.Phone?`tel`:y===a.Search?`search`:y===`password`&&z?`text`:y},Je=()=>{if(y===a.Email)return`email`;if(y===a.Phone)return`tel`;if(y===a.Search)return`search`},H=y&&y!==a.Date&&y!==a.Iban&&y!==a.HasNoIcon,Ye=y===a.Search||y===a.Password,U=!!me,Xe=U&&!Ye,Ze=y===a.Email||y===a.Phone||y===a.Search,W=(he??(!E&&Ze?i.Left:i.Right))===i.Left,G={className:l(r.inputFieldIcon,{[r.inputFieldIconNotClickable]:!b,[r.inputFieldIconLeft]:W}),onClick:b??void 0},K=me,Qe=Xe&&K?ee.cloneElement(K,{className:l(r.inputFieldIcon,{[r.inputFieldIconNotClickable]:!b&&!K.props.onClick,[r.inputFieldIconLeft]:W},K.props.className),onClick:b??K.props.onClick}):null,$e=(H||U)&&W,et={className:l(r.inputFieldIcon,r.inputFieldIconPassword,{[r.inputFieldIconLeft]:W}),onClick:()=>Fe(!z)},q=Be(),J=g;J&&Ve()&&(J=`${J} *`);let tt=Ve()?f(`span`,{className:r.requiredMark,children:`*`}):null,Y=x?x.value:_,X=I&&!D,Z=E&&(Ae||X||Y||y===a.Date),Q=y===a.Search&&!!Y;function $(){x&&x.set(``),v?.(``),De?.()}return p(`div`,{className:l(r.input,{[r.inputIconLeft]:$e},fe),style:pe,children:[p(`label`,{htmlFor:Re,className:l(r.inputLabel,M?.label,{[r.inputLabelColumn]:!Ce,[r.inputLabelInBorder]:Te}),style:N?.label,children:[g&&!E?p(`span`,{className:r.inputLabelText,children:[g,tt]}):null,w&&f(`div`,{className:l(r.inputUpperRightLabel,M?.upperRightLabel),style:N?.upperRightLabel,children:w}),p(`div`,{className:l(r.inputContainer,{[r.inputContainerMultiline]:k},M?.container),style:N?.container,onMouseEnter:He,onMouseLeave:Ue,children:[Qe,ee.cloneElement(O||f(k?`textarea`:`input`,{}),{...F,className:l(r.inputField,{[r.inputFieldUppercase]:be,[r.inputFieldDate]:y===a.Date,[r.inputFieldDefault]:y!==a.Date,[r.inputFieldWithIcon]:H||U,[r.inputFieldWithIconLeft]:$e,[r.inputFieldMultiline]:k,[r.inputFieldMultilineAutoResize]:k&&j,[r.inputFieldReadOnly]:D&&!P},M?.input),name:h,id:Re,value:x?x.value:_,tabIndex:Se,ref:O?void 0:B,onChange:Ke,onFocus:We,onBlur:Ge,placeholder:E?``:T,autoComplete:je,onClick:Me,readOnly:D,disabled:P,...!k&&{type:qe(),inputMode:F.inputMode??Je(),min:Oe,max:ke},...k&&A!==void 0&&{rows:A}}),C&&f(`div`,{className:l(r.inputFieldSuffix,M?.suffix),style:N?.suffix,children:C})]}),f(`fieldset`,{className:l(r.inputFieldset,M?.fieldset,{[r.inputFieldsetNoNotch]:!g,[r.inputContainerBorderFocused]:X,[r.inputContainerBorderSearchFocused]:y===a.Search&&(X||_),[r.inputContainerBorderInvalid]:q,[r.inputContainerBorderError]:q}),style:N?.fieldset,children:f(`legend`,{className:l(r.inputFieldsetLegend,{[r.inputFieldsetLegendActive]:Z}),children:f(`span`,{children:J})})}),E&&g&&p(`div`,{className:l(r.inputMatLabel,{[r.inputMatLabelFloating]:Z,[r.inputMatLabelMultiline]:k&&!Z}),children:[g,tt]}),E&&T&&f(`div`,{className:l(r.inputPlaceholder,X&&!Y&&r.inputPlaceholderShown,k&&r.inputPlaceholderMultiline),children:T}),f(t,{variant:`error`,message:x?x.getCurrentErrorMessage():ue||``,isVisible:q&&(I||Pe)})]}),y===a.Phone&&!U&&f(u,{icon:se,...G}),y===a.Email&&!U&&f(u,{icon:re,...G}),y===a.Edit&&!U&&f(u,{icon:oe,...G}),y===a.Search&&f(n,{icon:Q?d:ce,className:l(r.inputFieldIcon,{[r.inputFieldIconNotClickable]:!Q,[r.inputFieldIconLeft]:W}),onClick:Q?$:void 0}),y===a.Password&&f(u,{icon:z?ae:ie,...et}),(Ee&&_&&(I||Pe)||Ne)&&y!==a.Search&&f(u,{icon:d,className:r.inputFieldIcon,onClick:$,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1)})]})}export{m as default};
2
2
  //# sourceMappingURL=input.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"input.mjs","names":[],"sources":["../../../../package/common/input/input.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef, useCallback, useId } from 'react';\nimport cx from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport {\n faPhone,\n faPen,\n faEnvelope,\n faSearch,\n faXmark,\n faEye as passwordHiddenIcon,\n faEyeSlash as passwordShownIcon,\n} from '@fortawesome/free-solid-svg-icons';\nimport Tooltip from 'components/common/tooltip';\nimport { useComponentDefaults } from 'components/common/configProvider';\nimport styles from './input.module.pcss';\nimport type { InputProps } from './input.types';\nimport { InputType } from './input.types';\n\nfunction Input(props: InputProps) {\n const {\n name = '',\n id,\n label = '',\n errorMessage = '',\n isValid = true,\n className = '',\n style,\n value = '',\n icon = null,\n onChange = () => {},\n onFocus: onFocusProp = null,\n onBlur: onBlurProp = null,\n onMouseEnter: onMouseEnterProp = null,\n onMouseLeave: onMouseLeaveProp = null,\n isUppercase = false,\n isRequired = false,\n tabIndex = 0,\n type = undefined,\n isRow = false,\n onIconClick = null,\n parse = null,\n formValidator = null,\n autoFocus = false,\n suffix = null,\n upperRightLabel = null,\n labelInBorder = false,\n showCancel = false,\n onClearClicked,\n min = null,\n max = null,\n placeholder = '',\n useMatLabelStyle = true,\n alwaysFloatLabel = false,\n autoComplete = null,\n onClick = () => null,\n readOnly = false,\n customInput,\n alwaysShowCancel = false,\n multiline = false,\n rows,\n autoResize = false,\n classNames,\n styles: slotStyles,\n disabled = false,\n ...rest\n } = useComponentDefaults('Input', props);\n const [isFocused, setIsFocused] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const [isPasswordShown, setIsPasswordShown] = useState(false);\n const [, forceUpdate] = useState(0);\n\n const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n const fvRef = useRef(formValidator);\n\n const generatedId = useId();\n const inputId = id || name || generatedId;\n\n const resizeTextarea = useCallback(() => {\n const el = inputRef.current;\n if (!el || !autoResize) return;\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n }, [autoResize]);\n\n useEffect(() => {\n resizeTextarea();\n }, []);\n\n useEffect(() => {\n if (autoFocus && inputRef.current) {\n setTimeout(() => { inputRef.current?.focus(); }, 1);\n }\n }, [autoFocus]);\n\n useEffect(() => {\n fvRef.current = formValidator;\n const fv = fvRef.current;\n if (!fv) return;\n fv.label = label ?? '';\n fv.validate();\n const listener = () => forceUpdate(n => n + 1);\n fv.registerOnUpdateListener(listener);\n return () => { fv.removeOnUpdateListener(listener); };\n }, [formValidator, label]);\n\n const hasError = (): boolean => {\n return formValidator\n ? (formValidator.touched && formValidator.hasError())\n : (!isValid || !!errorMessage);\n };\n\n const computedIsRequired = (): boolean => {\n return !!(isRequired || (formValidator && formValidator.validators.find(\n (v) => (v as { validatorId?: string }).validatorId === 'required'\n )));\n };\n\n const onMouseEnterHandler = (event: React.MouseEvent) => {\n setIsHovered(true);\n if (onMouseEnterProp) onMouseEnterProp(event);\n };\n\n const onMouseLeaveHandler = (event: React.MouseEvent) => {\n setIsHovered(false);\n if (onMouseLeaveProp) onMouseLeaveProp(event);\n };\n\n const onFocusHandler = (event: React.FocusEvent) => {\n setIsFocused(true);\n if (onFocusProp) onFocusProp(event);\n };\n\n const onBlurHandler = (event: React.FocusEvent) => {\n if (fvRef.current) fvRef.current.touched = true;\n setIsFocused(false);\n if (onBlurProp) onBlurProp(event);\n };\n\n const onChangeHandler = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | string): void => {\n let parsedEvent: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | undefined;\n let val: string;\n\n if (typeof event !== 'string') {\n parsedEvent = event;\n val = event.target.value;\n } else {\n val = event;\n }\n\n if (parse) val = parse(val);\n if (formValidator) formValidator.set(val);\n if (onChange) onChange(val, parsedEvent);\n resizeTextarea();\n };\n\n const getInputType = (): string | undefined => {\n if (type === 'email') return undefined;\n if (type === 'password' && isPasswordShown) return 'text';\n return type;\n };\n\n const hasIcon =\n type &&\n type !== InputType.Date &&\n type !== InputType.Iban &&\n type !== InputType.HasNoIcon;\n\n const hasIconLeft =\n hasIcon && !useMatLabelStyle &&\n (type === InputType.Email || type === InputType.Phone || type === InputType.Search);\n\n const iconProps = {\n className: cx(styles.inputFieldIcon, {\n [styles.inputFieldIconNotClickable]: !onIconClick,\n [styles.inputFieldIconLeft]: hasIconLeft,\n }),\n onClick: onIconClick ?? undefined,\n };\n\n const customIcon = icon as React.ReactElement<{ className?: string; onClick?: React.MouseEventHandler }> | null;\n const renderedIcon = customIcon\n ? React.cloneElement(customIcon, {\n className: cx(\n styles.inputFieldIcon,\n { [styles.inputFieldIconNotClickable]: !onIconClick && !customIcon.props.onClick },\n customIcon.props.className,\n ),\n onClick: onIconClick ?? customIcon.props.onClick,\n })\n : null;\n const hasCustomIcon = !!icon;\n\n const passwordIconProps = {\n className: cx(styles.inputFieldIcon, styles.inputFieldIconPassword),\n onClick: () => setIsPasswordShown(!isPasswordShown),\n };\n\n const hasErr = hasError();\n\n let editedLabel = label;\n if (editedLabel && computedIsRequired()) editedLabel = `${editedLabel} *`;\n const requiredMark = computedIsRequired() ? <span className={styles.requiredMark}>*</span> : null;\n\n const currVal = formValidator ? formValidator.value : value;\n // A readOnly field is focusable but not editable — don't let focus drive the\n // \"editing\" affordances (primary-color border, label floating up on focus).\n // The label still floats when there's a value, since that's value-driven.\n const showFocus = isFocused && !readOnly;\n const shouldFloatLabel = useMatLabelStyle && (alwaysFloatLabel || showFocus || currVal || type === InputType.Date);\n\n return (\n <div className={cx(styles.input, className)} style={style}>\n <label\n htmlFor={inputId}\n className={cx(styles.inputLabel, classNames?.label, {\n [styles.inputLabelColumn]: !isRow,\n [styles.inputLabelInBorder]: labelInBorder,\n })}\n style={slotStyles?.label}\n >\n {label && !useMatLabelStyle ? (\n <span className={styles.inputLabelText}>\n {label}\n {requiredMark}\n </span>\n ) : null}\n {upperRightLabel && (\n <div className={cx(styles.inputUpperRightLabel, classNames?.upperRightLabel)} style={slotStyles?.upperRightLabel}>\n {upperRightLabel}\n </div>\n )}\n <div\n className={cx(styles.inputContainer, { [styles.inputContainerMultiline]: multiline }, classNames?.container)}\n style={slotStyles?.container}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n >\n {renderedIcon}\n {React.cloneElement(customInput || (multiline ? <textarea /> : <input />), {\n ...rest,\n className: cx(\n styles.inputField,\n {\n [styles.inputFieldUppercase]: isUppercase,\n [styles.inputFieldDate]: type === InputType.Date,\n [styles.inputFieldDefault]: type !== InputType.Date,\n [styles.inputFieldWithIcon]: hasIcon || hasCustomIcon,\n [styles.inputFieldWithIconLeft]: hasIconLeft,\n [styles.inputFieldMultiline]: multiline,\n [styles.inputFieldMultilineAutoResize]: multiline && autoResize,\n [styles.inputFieldReadOnly]: readOnly && !disabled,\n },\n classNames?.input\n ),\n name,\n id: inputId,\n value: formValidator ? formValidator.value : value,\n tabIndex,\n ref: customInput ? undefined : inputRef,\n onChange: onChangeHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n placeholder: !useMatLabelStyle ? placeholder : '',\n autoComplete,\n onClick,\n readOnly,\n disabled,\n ...(!multiline && { type: getInputType(), min, max }),\n ...(multiline && rows !== undefined && { rows }),\n })}\n {suffix && <div className={cx(styles.inputFieldSuffix, classNames?.suffix)} style={slotStyles?.suffix}>{suffix}</div>}\n </div>\n <fieldset\n className={cx(styles.inputFieldset, classNames?.fieldset, {\n [styles.inputContainerBorderFocused]: showFocus,\n [styles.inputContainerBorderSearchFocused]:\n type === InputType.Search && (showFocus || value),\n [styles.inputContainerBorderInvalid]: hasErr,\n [styles.inputContainerBorderError]: hasErr,\n })}\n style={slotStyles?.fieldset}\n >\n <legend\n className={cx(styles.inputFieldsetLegend, {\n [styles.inputFieldsetLegendActive]: shouldFloatLabel,\n })}\n >\n <span>{editedLabel}</span>\n </legend>\n </fieldset>\n {useMatLabelStyle && label && (\n <div\n className={cx(styles.inputMatLabel, {\n [styles.inputMatLabelFloating]: shouldFloatLabel,\n [styles.inputMatLabelMultiline]: multiline && !shouldFloatLabel,\n })}\n >\n {label}\n {requiredMark}\n </div>\n )}\n {useMatLabelStyle && placeholder && (\n <div\n className={cx(\n styles.inputPlaceholder,\n showFocus && !currVal && styles.inputPlaceholderShown,\n multiline && styles.inputPlaceholderMultiline,\n )}\n >\n {placeholder}\n </div>\n )}\n <Tooltip\n variant=\"error\"\n message={formValidator ? formValidator.getCurrentErrorMessage() : (errorMessage || '')}\n isVisible={hasErr && (isFocused || isHovered)}\n />\n </label>\n\n {type === InputType.Phone && <FontAwesomeIcon icon={faPhone} {...iconProps} />}\n {type === InputType.Email && <FontAwesomeIcon icon={faEnvelope} {...iconProps} />}\n {type === InputType.Edit && <FontAwesomeIcon icon={faPen} {...iconProps} />}\n {type === InputType.Search && <FontAwesomeIcon icon={faSearch} {...iconProps} />}\n {type === InputType.Password && (\n <FontAwesomeIcon\n icon={isPasswordShown ? passwordShownIcon : passwordHiddenIcon}\n {...passwordIconProps}\n />\n )}\n\n {((showCancel && value && (isFocused || isHovered)) || alwaysShowCancel) && (\n <FontAwesomeIcon\n icon={faXmark}\n className={styles.inputFieldIcon}\n onClick={onClearClicked ?? undefined}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n />\n )}\n </div>\n );\n}\n\nexport default Input;\n"],"mappings":"ukBAkBA,SAAS,EAAM,EAAmB,CAChC,GAAM,CACN,OAAO,GACP,MACA,QAAQ,GACR,eAAe,GACf,WAAU,GACV,aAAY,GACZ,SACA,QAAQ,GACR,QAAO,KACP,gBAAiB,CAAC,EAClB,QAAS,EAAc,KACvB,OAAQ,EAAa,KACrB,aAAc,EAAmB,KACjC,aAAc,EAAmB,KACjC,eAAc,GACd,cAAa,GACb,YAAW,EACX,OAAO,IAAA,GACP,SAAQ,GACR,cAAc,KACd,QAAQ,KACR,gBAAgB,KAChB,YAAY,GACZ,SAAS,KACT,kBAAkB,KAClB,iBAAgB,GAChB,cAAa,GACb,kBACA,OAAM,KACN,OAAM,KACN,cAAc,GACd,mBAAmB,GACnB,oBAAmB,GACnB,gBAAe,KACf,eAAgB,KAChB,WAAW,GACX,eACA,oBAAmB,GACnB,YAAY,GACZ,OACA,aAAa,GACb,aACA,OAAQ,EACR,WAAW,GACX,GAAG,IACC,EAAqB,QAAS,CAAK,EACjC,CAAC,EAAW,GAAgB,EAAS,EAAK,EAC1C,CAAC,EAAW,GAAgB,EAAS,EAAK,EAC1C,CAAC,EAAiB,IAAsB,EAAS,EAAK,EACtD,EAAG,I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EA,GAET"}
1
+ {"version":3,"file":"input.mjs","names":[],"sources":["../../../../package/common/input/input.tsx"],"sourcesContent":["import React, { useState, useEffect, useRef, useCallback, useId } from 'react';\nimport cx from 'classnames';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport {\n faPhone,\n faPen,\n faEnvelope,\n faSearch,\n faXmark,\n faEye as passwordHiddenIcon,\n faEyeSlash as passwordShownIcon,\n} from '@fortawesome/free-solid-svg-icons';\nimport Tooltip from 'components/common/tooltip';\nimport AnimatedIcon from 'components/common/animatedIcon';\nimport { useComponentDefaults } from 'components/common/configProvider';\nimport styles from './input.module.pcss';\nimport type { InputProps } from './input.types';\nimport { InputType, InputIconPosition } from './input.types';\n\nfunction Input(props: InputProps) {\n const {\n name = '',\n id,\n label = '',\n errorMessage = '',\n isValid = true,\n className = '',\n style,\n value = '',\n icon = null,\n iconPosition,\n onChange = () => {},\n onFocus: onFocusProp = null,\n onBlur: onBlurProp = null,\n onMouseEnter: onMouseEnterProp = null,\n onMouseLeave: onMouseLeaveProp = null,\n isUppercase = false,\n isRequired = false,\n tabIndex = 0,\n type = undefined,\n isRow = false,\n onIconClick = null,\n parse = null,\n formValidator = null,\n autoFocus = false,\n suffix = null,\n upperRightLabel = null,\n labelInBorder = false,\n showCancel = false,\n onClearClicked,\n min = null,\n max = null,\n placeholder = '',\n useMatLabelStyle = true,\n alwaysFloatLabel = false,\n autoComplete = null,\n onClick = () => null,\n readOnly = false,\n customInput,\n alwaysShowCancel = false,\n multiline = false,\n rows,\n autoResize = false,\n classNames,\n styles: slotStyles,\n disabled = false,\n ...rest\n } = useComponentDefaults('Input', props);\n const [isFocused, setIsFocused] = useState(false);\n const [isHovered, setIsHovered] = useState(false);\n const [isPasswordShown, setIsPasswordShown] = useState(false);\n const [, forceUpdate] = useState(0);\n\n const inputRef = useRef<HTMLInputElement | HTMLTextAreaElement>(null);\n const fvRef = useRef(formValidator);\n\n const generatedId = useId();\n const inputId = id || name || generatedId;\n\n const resizeTextarea = useCallback(() => {\n const el = inputRef.current;\n if (!el || !autoResize) return;\n el.style.height = 'auto';\n el.style.height = `${el.scrollHeight}px`;\n }, [autoResize]);\n\n useEffect(() => {\n resizeTextarea();\n }, []);\n\n useEffect(() => {\n if (autoFocus && inputRef.current) {\n setTimeout(() => { inputRef.current?.focus(); }, 1);\n }\n }, [autoFocus]);\n\n useEffect(() => {\n fvRef.current = formValidator;\n const fv = fvRef.current;\n if (!fv) return;\n fv.label = label ?? '';\n fv.validate();\n const listener = () => forceUpdate(n => n + 1);\n fv.registerOnUpdateListener(listener);\n return () => { fv.removeOnUpdateListener(listener); };\n }, [formValidator, label]);\n\n const hasError = (): boolean => {\n return formValidator\n ? (formValidator.touched && formValidator.hasError())\n : (!isValid || !!errorMessage);\n };\n\n const computedIsRequired = (): boolean => {\n return !!(isRequired || (formValidator && formValidator.validators.find(\n (v) => (v as { validatorId?: string }).validatorId === 'required'\n )));\n };\n\n const onMouseEnterHandler = (event: React.MouseEvent) => {\n setIsHovered(true);\n if (onMouseEnterProp) onMouseEnterProp(event);\n };\n\n const onMouseLeaveHandler = (event: React.MouseEvent) => {\n setIsHovered(false);\n if (onMouseLeaveProp) onMouseLeaveProp(event);\n };\n\n const onFocusHandler = (event: React.FocusEvent) => {\n setIsFocused(true);\n if (onFocusProp) onFocusProp(event);\n };\n\n const onBlurHandler = (event: React.FocusEvent) => {\n if (fvRef.current) fvRef.current.touched = true;\n setIsFocused(false);\n if (onBlurProp) onBlurProp(event);\n };\n\n const onChangeHandler = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | string): void => {\n let parsedEvent: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement> | undefined;\n let val: string;\n\n if (typeof event !== 'string') {\n parsedEvent = event;\n val = event.target.value;\n } else {\n val = event;\n }\n\n if (parse) val = parse(val);\n if (formValidator) formValidator.set(val);\n if (onChange) onChange(val, parsedEvent);\n resizeTextarea();\n };\n\n const getInputType = (): string | undefined => {\n if (type === InputType.Email) return undefined;\n if (type === InputType.Phone) return 'tel';\n if (type === InputType.Search) return 'search';\n if (type === 'password' && isPasswordShown) return 'text';\n return type;\n };\n\n const getInputMode = (): React.HTMLAttributes<HTMLInputElement>['inputMode'] => {\n if (type === InputType.Email) return 'email';\n if (type === InputType.Phone) return 'tel';\n if (type === InputType.Search) return 'search';\n return undefined;\n };\n\n const hasIcon =\n type &&\n type !== InputType.Date &&\n type !== InputType.Iban &&\n type !== InputType.HasNoIcon;\n\n const isFunctionalIconType = type === InputType.Search || type === InputType.Password;\n const hasCustomIcon = !!icon;\n const customIconApplies = hasCustomIcon && !isFunctionalIconType;\n\n const defaultsLeftWithoutMatLabel = type === InputType.Email || type === InputType.Phone || type === InputType.Search;\n const resolvedIconPosition = iconPosition ?? (!useMatLabelStyle && defaultsLeftWithoutMatLabel ? InputIconPosition.Left : InputIconPosition.Right);\n const iconIsLeft = resolvedIconPosition === InputIconPosition.Left;\n\n const iconProps = {\n className: cx(styles.inputFieldIcon, {\n [styles.inputFieldIconNotClickable]: !onIconClick,\n [styles.inputFieldIconLeft]: iconIsLeft,\n }),\n onClick: onIconClick ?? undefined,\n };\n\n const customIcon = icon as React.ReactElement<{ className?: string; onClick?: React.MouseEventHandler }> | null;\n const renderedIcon = customIconApplies && customIcon\n ? React.cloneElement(customIcon, {\n className: cx(\n styles.inputFieldIcon,\n {\n [styles.inputFieldIconNotClickable]: !onIconClick && !customIcon.props.onClick,\n [styles.inputFieldIconLeft]: iconIsLeft,\n },\n customIcon.props.className,\n ),\n onClick: onIconClick ?? customIcon.props.onClick,\n })\n : null;\n\n const hasLeftIcon = (hasIcon || hasCustomIcon) && iconIsLeft;\n\n const passwordIconProps = {\n className: cx(styles.inputFieldIcon, styles.inputFieldIconPassword, { [styles.inputFieldIconLeft]: iconIsLeft }),\n onClick: () => setIsPasswordShown(!isPasswordShown),\n };\n\n const hasErr = hasError();\n\n let editedLabel = label;\n if (editedLabel && computedIsRequired()) editedLabel = `${editedLabel} *`;\n const requiredMark = computedIsRequired() ? <span className={styles.requiredMark}>*</span> : null;\n\n const currVal = formValidator ? formValidator.value : value;\n const showFocus = isFocused && !readOnly;\n const shouldFloatLabel = useMatLabelStyle && (alwaysFloatLabel || showFocus || currVal || type === InputType.Date);\n\n const isSearchCleared = type === InputType.Search && !!currVal;\n\n function handleClear() {\n if (formValidator) formValidator.set('');\n onChange?.('');\n onClearClicked?.();\n }\n\n return (\n <div className={cx(styles.input, { [styles.inputIconLeft]: hasLeftIcon }, className)} style={style}>\n <label\n htmlFor={inputId}\n className={cx(styles.inputLabel, classNames?.label, {\n [styles.inputLabelColumn]: !isRow,\n [styles.inputLabelInBorder]: labelInBorder,\n })}\n style={slotStyles?.label}\n >\n {label && !useMatLabelStyle ? (\n <span className={styles.inputLabelText}>\n {label}\n {requiredMark}\n </span>\n ) : null}\n {upperRightLabel && (\n <div className={cx(styles.inputUpperRightLabel, classNames?.upperRightLabel)} style={slotStyles?.upperRightLabel}>\n {upperRightLabel}\n </div>\n )}\n <div\n className={cx(styles.inputContainer, { [styles.inputContainerMultiline]: multiline }, classNames?.container)}\n style={slotStyles?.container}\n onMouseEnter={onMouseEnterHandler}\n onMouseLeave={onMouseLeaveHandler}\n >\n {renderedIcon}\n {React.cloneElement(customInput || (multiline ? <textarea /> : <input />), {\n ...rest,\n className: cx(\n styles.inputField,\n {\n [styles.inputFieldUppercase]: isUppercase,\n [styles.inputFieldDate]: type === InputType.Date,\n [styles.inputFieldDefault]: type !== InputType.Date,\n [styles.inputFieldWithIcon]: hasIcon || hasCustomIcon,\n [styles.inputFieldWithIconLeft]: hasLeftIcon,\n [styles.inputFieldMultiline]: multiline,\n [styles.inputFieldMultilineAutoResize]: multiline && autoResize,\n [styles.inputFieldReadOnly]: readOnly && !disabled,\n },\n classNames?.input\n ),\n name,\n id: inputId,\n value: formValidator ? formValidator.value : value,\n tabIndex,\n ref: customInput ? undefined : inputRef,\n onChange: onChangeHandler,\n onFocus: onFocusHandler,\n onBlur: onBlurHandler,\n placeholder: !useMatLabelStyle ? placeholder : '',\n autoComplete,\n onClick,\n readOnly,\n disabled,\n ...(!multiline && { type: getInputType(), inputMode: rest.inputMode ?? getInputMode(), min, max }),\n ...(multiline && rows !== undefined && { rows }),\n })}\n {suffix && <div className={cx(styles.inputFieldSuffix, classNames?.suffix)} style={slotStyles?.suffix}>{suffix}</div>}\n </div>\n <fieldset\n className={cx(styles.inputFieldset, classNames?.fieldset, {\n [styles.inputFieldsetNoNotch]: !label,\n [styles.inputContainerBorderFocused]: showFocus,\n [styles.inputContainerBorderSearchFocused]:\n type === InputType.Search && (showFocus || value),\n [styles.inputContainerBorderInvalid]: hasErr,\n [styles.inputContainerBorderError]: hasErr,\n })}\n style={slotStyles?.fieldset}\n >\n <legend\n className={cx(styles.inputFieldsetLegend, {\n [styles.inputFieldsetLegendActive]: shouldFloatLabel,\n })}\n >\n <span>{editedLabel}</span>\n </legend>\n </fieldset>\n {useMatLabelStyle && label && (\n <div\n className={cx(styles.inputMatLabel, {\n [styles.inputMatLabelFloating]: shouldFloatLabel,\n [styles.inputMatLabelMultiline]: multiline && !shouldFloatLabel,\n })}\n >\n {label}\n {requiredMark}\n </div>\n )}\n {useMatLabelStyle && placeholder && (\n <div\n className={cx(\n styles.inputPlaceholder,\n showFocus && !currVal && styles.inputPlaceholderShown,\n multiline && styles.inputPlaceholderMultiline,\n )}\n >\n {placeholder}\n </div>\n )}\n <Tooltip\n variant=\"error\"\n message={formValidator ? formValidator.getCurrentErrorMessage() : (errorMessage || '')}\n isVisible={hasErr && (isFocused || isHovered)}\n />\n </label>\n\n {type === InputType.Phone && !hasCustomIcon && <FontAwesomeIcon icon={faPhone} {...iconProps} />}\n {type === InputType.Email && !hasCustomIcon && <FontAwesomeIcon icon={faEnvelope} {...iconProps} />}\n {type === InputType.Edit && !hasCustomIcon && <FontAwesomeIcon icon={faPen} {...iconProps} />}\n {type === InputType.Search && (\n <AnimatedIcon\n icon={isSearchCleared ? faXmark : faSearch}\n className={cx(styles.inputFieldIcon, {\n [styles.inputFieldIconNotClickable]: !isSearchCleared,\n [styles.inputFieldIconLeft]: iconIsLeft,\n })}\n onClick={isSearchCleared ? handleClear : undefined}\n />\n )}\n {type === InputType.Password && (\n <FontAwesomeIcon\n icon={isPasswordShown ? passwordShownIcon : passwordHiddenIcon}\n {...passwordIconProps}\n />\n )}\n\n {((showCancel && value && (isFocused || isHovered)) || alwaysShowCancel) && type !== InputType.Search && (\n <FontAwesomeIcon\n icon={faXmark}\n className={styles.inputFieldIcon}\n onClick={handleClear}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n />\n )}\n </div>\n );\n}\n\nexport default Input;\n"],"mappings":"6oBAmBA,SAAS,EAAM,EAAmB,CAChC,GAAM,CACN,OAAO,GACP,MACA,QAAQ,GACR,gBAAe,GACf,WAAU,GACV,aAAY,GACZ,SACA,QAAQ,GACR,QAAO,KACP,gBACA,eAAiB,CAAC,EAClB,QAAS,GAAc,KACvB,OAAQ,GAAa,KACrB,aAAc,GAAmB,KACjC,aAAc,GAAmB,KACjC,eAAc,GACd,cAAa,GACb,YAAW,EACX,OAAO,IAAA,GACP,SAAQ,GACR,cAAc,KACd,SAAQ,KACR,gBAAgB,KAChB,YAAY,GACZ,SAAS,KACT,kBAAkB,KAClB,iBAAgB,GAChB,cAAa,GACb,kBACA,OAAM,KACN,OAAM,KACN,cAAc,GACd,mBAAmB,GACnB,oBAAmB,GACnB,gBAAe,KACf,eAAgB,KAChB,WAAW,GACX,cACA,oBAAmB,GACnB,YAAY,GACZ,OACA,aAAa,GACb,aACA,OAAQ,EACR,WAAW,GACX,GAAG,GACC,EAAqB,QAAS,CAAK,EACjC,CAAC,EAAW,GAAgB,EAAS,EAAK,EAC1C,CAAC,GAAW,GAAgB,EAAS,EAAK,EAC1C,CAAC,EAAiB,IAAsB,EAAS,EAAK,EACtD,EAAG,IAAe,EAAS,CAAC,EAE5B,EAAW,EAA+C,IAAI,EAC9D,EAAQ,E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AA,CACI,IAEN,IAAS,EAAU,OAAS,CAAC,GAAiB,EAAC,EAAD,CAAiB,KAAM,GAAS,GAAI,CAAY,CAAA,EAC9F,IAAS,EAAU,OAAS,CAAC,GAAiB,EAAC,EAAD,CAAiB,KAAM,GAAY,GAAI,CAAY,CAAA,EACjG,IAAS,EAAU,MAAQ,CAAC,GAAiB,EAAC,EAAD,CAAiB,KAAM,GAAO,GAAI,CAAY,CAAA,EAC3F,IAAS,EAAU,QAClB,EAAC,EAAD,CACE,KAAM,EAAkB,EAAU,GAClC,UAAW,EAAG,EAAO,eAAgB,EAClC,EAAO,4BAA6B,CAAC,GACrC,EAAO,oBAAqB,CAC/B,CAAC,EACD,QAAS,EAAkB,EAAc,IAAA,EAC1C,CAAA,EAEF,IAAS,EAAU,UAClB,EAAC,EAAD,CACE,KAAM,EAAkB,GAAoB,GAC5C,GAAI,EACL,CAAA,GAGA,IAAc,IAAU,GAAa,KAAe,KAAqB,IAAS,EAAU,QAC7F,EAAC,EAAD,CACE,KAAM,EACN,UAAW,EAAO,eAClB,QAAS,EACT,iBAAoB,EAAa,EAAI,EACrC,iBAAoB,EAAa,EAAK,CACvC,CAAA,CAEA,GAET"}
@@ -1,2 +1,2 @@
1
- var e={"required-mark":`required-mark_xGJdX`,requiredMark:`required-mark_xGJdX`,input:`input_VKNCE`,"input-placeholder":`input-placeholder_IZH-l`,inputPlaceholder:`input-placeholder_IZH-l`,"input-placeholder-shown":`input-placeholder-shown_mm35e`,inputPlaceholderShown:`input-placeholder-shown_mm35e`,fadeIn:`fadeIn_kmX3i`,"input-placeholder-multiline":`input-placeholder-multiline_tLHAl`,inputPlaceholderMultiline:`input-placeholder-multiline_tLHAl`,"input-matLabel":`input-matLabel_-05ey`,inputMatLabel:`input-matLabel_-05ey`,"input-matLabel-floating":`input-matLabel-floating_1P2YE`,inputMatLabelFloating:`input-matLabel-floating_1P2YE`,"input-matLabel-multiline":`input-matLabel-multiline_miIZJ`,inputMatLabelMultiline:`input-matLabel-multiline_miIZJ`,"input-fieldset":`input-fieldset_XCibg`,inputFieldset:`input-fieldset_XCibg`,"input-fieldset-legend":`input-fieldset-legend_X23zp`,inputFieldsetLegend:`input-fieldset-legend_X23zp`,"input-fieldset-legend-active":`input-fieldset-legend-active_t-9hu`,inputFieldsetLegendActive:`input-fieldset-legend-active_t-9hu`,"input-container":`input-container_M1RoG`,inputContainer:`input-container_M1RoG`,"input-container-multiline":`input-container-multiline_eLw7h`,inputContainerMultiline:`input-container-multiline_eLw7h`,"input-container-border":`input-container-border_l131I`,inputContainerBorder:`input-container-border_l131I`,"input-container-border-focused":`input-container-border-focused_ct6oY`,inputContainerBorderFocused:`input-container-border-focused_ct6oY`,"input-container-border-searchFocused":`input-container-border-searchFocused_lq088`,inputContainerBorderSearchFocused:`input-container-border-searchFocused_lq088`,"input-container-border-invalid":`input-container-border-invalid_Wdbq2`,inputContainerBorderInvalid:`input-container-border-invalid_Wdbq2`,"input-container-border-error":`input-container-border-error_gzfPG`,inputContainerBorderError:`input-container-border-error_gzfPG`,"input-label":`input-label_w1hMR`,inputLabel:`input-label_w1hMR`,"input-label-column":`input-label-column_qBFPC`,inputLabelColumn:`input-label-column_qBFPC`,"input-label-text":`input-label-text_-J5qQ`,inputLabelText:`input-label-text_-J5qQ`,"input-upper-right-label":`input-upper-right-label_I-WG3`,inputUpperRightLabel:`input-upper-right-label_I-WG3`,"input-field":`input-field_pmDvZ`,inputField:`input-field_pmDvZ`,"input-field-withIcon":`input-field-withIcon_VpfmK`,inputFieldWithIcon:`input-field-withIcon_VpfmK`,"input-field-withIcon-left":`input-field-withIcon-left_Io7lU`,inputFieldWithIconLeft:`input-field-withIcon-left_Io7lU`,"input-field-suffix":`input-field-suffix_NZpXp`,inputFieldSuffix:`input-field-suffix_NZpXp`,"input-field-date":`input-field-date_UHJEZ`,inputFieldDate:`input-field-date_UHJEZ`,"input-field-default":`input-field-default_TKipA`,inputFieldDefault:`input-field-default_TKipA`,"input-field-readOnly":`input-field-readOnly_Eut34`,inputFieldReadOnly:`input-field-readOnly_Eut34`,"input-field-uppercase":`input-field-uppercase_UV6f1`,inputFieldUppercase:`input-field-uppercase_UV6f1`,"input-field-multiline":`input-field-multiline_al3V1`,inputFieldMultiline:`input-field-multiline_al3V1`,"input-field-multiline-autoResize":`input-field-multiline-autoResize_nK33P`,inputFieldMultilineAutoResize:`input-field-multiline-autoResize_nK33P`,"input-field-icon":`input-field-icon_YyJIr`,inputFieldIcon:`input-field-icon_YyJIr`,"input-field-icon-left":`input-field-icon-left_m2XB1`,inputFieldIconLeft:`input-field-icon-left_m2XB1`,"input-field-icon-notClickable":`input-field-icon-notClickable_7j24I`,inputFieldIconNotClickable:`input-field-icon-notClickable_7j24I`,"input-error":`input-error_LIG23`,inputError:`input-error_LIG23`};export{e as default};
1
+ var e={"required-mark":`required-mark_xGJdX`,requiredMark:`required-mark_xGJdX`,input:`input_VKNCE`,"input-placeholder":`input-placeholder_IZH-l`,inputPlaceholder:`input-placeholder_IZH-l`,"input-placeholder-shown":`input-placeholder-shown_mm35e`,inputPlaceholderShown:`input-placeholder-shown_mm35e`,fadeIn:`fadeIn_kmX3i`,"input-placeholder-multiline":`input-placeholder-multiline_tLHAl`,inputPlaceholderMultiline:`input-placeholder-multiline_tLHAl`,"input-matLabel":`input-matLabel_-05ey`,inputMatLabel:`input-matLabel_-05ey`,"input-matLabel-floating":`input-matLabel-floating_1P2YE`,inputMatLabelFloating:`input-matLabel-floating_1P2YE`,"input-matLabel-multiline":`input-matLabel-multiline_miIZJ`,inputMatLabelMultiline:`input-matLabel-multiline_miIZJ`,"input-fieldset":`input-fieldset_XCibg`,inputFieldset:`input-fieldset_XCibg`,"input-fieldset-no-notch":`input-fieldset-no-notch_re-Fw`,inputFieldsetNoNotch:`input-fieldset-no-notch_re-Fw`,"input-fieldset-legend":`input-fieldset-legend_X23zp`,inputFieldsetLegend:`input-fieldset-legend_X23zp`,"input-fieldset-legend-active":`input-fieldset-legend-active_t-9hu`,inputFieldsetLegendActive:`input-fieldset-legend-active_t-9hu`,"input-iconLeft":`input-iconLeft_itIuo`,inputIconLeft:`input-iconLeft_itIuo`,"input-container":`input-container_M1RoG`,inputContainer:`input-container_M1RoG`,"input-container-multiline":`input-container-multiline_eLw7h`,inputContainerMultiline:`input-container-multiline_eLw7h`,"input-container-border":`input-container-border_l131I`,inputContainerBorder:`input-container-border_l131I`,"input-container-border-focused":`input-container-border-focused_ct6oY`,inputContainerBorderFocused:`input-container-border-focused_ct6oY`,"input-container-border-searchFocused":`input-container-border-searchFocused_lq088`,inputContainerBorderSearchFocused:`input-container-border-searchFocused_lq088`,"input-container-border-invalid":`input-container-border-invalid_Wdbq2`,inputContainerBorderInvalid:`input-container-border-invalid_Wdbq2`,"input-container-border-error":`input-container-border-error_gzfPG`,inputContainerBorderError:`input-container-border-error_gzfPG`,"input-label":`input-label_w1hMR`,inputLabel:`input-label_w1hMR`,"input-label-column":`input-label-column_qBFPC`,inputLabelColumn:`input-label-column_qBFPC`,"input-label-text":`input-label-text_-J5qQ`,inputLabelText:`input-label-text_-J5qQ`,"input-upper-right-label":`input-upper-right-label_I-WG3`,inputUpperRightLabel:`input-upper-right-label_I-WG3`,"input-field":`input-field_pmDvZ`,inputField:`input-field_pmDvZ`,"input-field-withIcon":`input-field-withIcon_VpfmK`,inputFieldWithIcon:`input-field-withIcon_VpfmK`,"input-field-withIcon-left":`input-field-withIcon-left_Io7lU`,inputFieldWithIconLeft:`input-field-withIcon-left_Io7lU`,"input-field-suffix":`input-field-suffix_NZpXp`,inputFieldSuffix:`input-field-suffix_NZpXp`,"input-field-date":`input-field-date_UHJEZ`,inputFieldDate:`input-field-date_UHJEZ`,"input-field-default":`input-field-default_TKipA`,inputFieldDefault:`input-field-default_TKipA`,"input-field-readOnly":`input-field-readOnly_Eut34`,inputFieldReadOnly:`input-field-readOnly_Eut34`,"input-field-uppercase":`input-field-uppercase_UV6f1`,inputFieldUppercase:`input-field-uppercase_UV6f1`,"input-field-multiline":`input-field-multiline_al3V1`,inputFieldMultiline:`input-field-multiline_al3V1`,"input-field-multiline-autoResize":`input-field-multiline-autoResize_nK33P`,inputFieldMultilineAutoResize:`input-field-multiline-autoResize_nK33P`,"input-field-icon":`input-field-icon_YyJIr`,inputFieldIcon:`input-field-icon_YyJIr`,"input-field-icon-left":`input-field-icon-left_m2XB1`,inputFieldIconLeft:`input-field-icon-left_m2XB1`,"input-field-icon-notClickable":`input-field-icon-notClickable_7j24I`,inputFieldIconNotClickable:`input-field-icon-notClickable_7j24I`,"input-error":`input-error_LIG23`,inputError:`input-error_LIG23`};export{e as default};
2
2
  //# sourceMappingURL=input.module.mjs.map