@handijitcom/ui 3.2.0 → 3.3.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 (135) hide show
  1. package/README.md +111 -4
  2. package/build/components/Accordion/index.cjs +1 -1
  3. package/build/components/AppShell/Nav.cjs +1 -1
  4. package/build/components/AppShell/Nav.js +1 -1
  5. package/build/components/AppShell/context.js +2 -2
  6. package/build/components/AppShell/index.cjs +1 -1
  7. package/build/components/AppShell/index.cjs.map +1 -1
  8. package/build/components/AppShell/index.js +62 -55
  9. package/build/components/AppShell/index.js.map +1 -1
  10. package/build/components/AppShell/style.css +1 -1
  11. package/build/components/BottomSheet/index.cjs +1 -1
  12. package/build/components/BottomSheet/style.css +1 -1
  13. package/build/components/Breadcrumb/index.cjs +1 -1
  14. package/build/components/Breadcrumb/index.cjs.map +1 -1
  15. package/build/components/Breadcrumb/index.d.cts +11 -1
  16. package/build/components/Breadcrumb/index.d.ts +11 -1
  17. package/build/components/Breadcrumb/index.js +70 -22
  18. package/build/components/Breadcrumb/index.js.map +1 -1
  19. package/build/components/Breadcrumb/style.css +1 -1
  20. package/build/components/BulkPasteInput/index.cjs +1 -1
  21. package/build/components/Button/index.cjs +1 -1
  22. package/build/components/Carousel/index.cjs +1 -1
  23. package/build/components/ChipGroup/index.cjs +1 -1
  24. package/build/components/Combobox/index.cjs +1 -1
  25. package/build/components/CommandPalette/index.cjs +1 -1
  26. package/build/components/ConfirmDialog/index.cjs +1 -1
  27. package/build/components/DataTable/index.cjs +1 -1
  28. package/build/components/DataTable/index.cjs.map +1 -1
  29. package/build/components/DataTable/index.js +68 -67
  30. package/build/components/DataTable/index.js.map +1 -1
  31. package/build/components/DataTable/style.css +1 -1
  32. package/build/components/DataTableColumnMenu/index.cjs +1 -1
  33. package/build/components/DateField/index.js +1 -1
  34. package/build/components/Directory/index.js +1 -1
  35. package/build/components/Drawer/index.cjs +1 -1
  36. package/build/components/Drawer/style.css +1 -1
  37. package/build/components/Eyebrow/index.cjs +1 -1
  38. package/build/components/Eyebrow/index.cjs.map +1 -1
  39. package/build/components/Eyebrow/index.d.cts +6 -1
  40. package/build/components/Eyebrow/index.d.ts +6 -1
  41. package/build/components/Eyebrow/index.js +25 -6
  42. package/build/components/Eyebrow/index.js.map +1 -1
  43. package/build/components/Eyebrow/style.css +1 -1
  44. package/build/components/FileUpload/index.cjs +1 -1
  45. package/build/components/FilterBar/index.js +1 -1
  46. package/build/components/Gallery/index.cjs +1 -1
  47. package/build/components/Gallery/index.cjs.map +1 -1
  48. package/build/components/Gallery/index.js +28 -28
  49. package/build/components/Gallery/index.js.map +1 -1
  50. package/build/components/Gallery/style.css +1 -1
  51. package/build/components/Modal/index.cjs +1 -1
  52. package/build/components/Modal/style.css +1 -1
  53. package/build/components/MoneyInput/index.cjs +1 -1
  54. package/build/components/NotificationCenter/index.cjs +1 -1
  55. package/build/components/PageHeader/index.cjs +1 -1
  56. package/build/components/PageHeader/index.cjs.map +1 -1
  57. package/build/components/PageHeader/index.d.cts +5 -0
  58. package/build/components/PageHeader/index.d.ts +5 -0
  59. package/build/components/PageHeader/index.js +38 -28
  60. package/build/components/PageHeader/index.js.map +1 -1
  61. package/build/components/PageHeader/style.css +1 -1
  62. package/build/components/Pagination/index.cjs +1 -1
  63. package/build/components/Panel/index.js +1 -1
  64. package/build/components/PasswordInput/index.cjs +1 -1
  65. package/build/components/PercentInput/index.cjs +1 -1
  66. package/build/components/Popover/style.css +1 -1
  67. package/build/components/Price/index.cjs +1 -1
  68. package/build/components/Price/index.cjs.map +1 -1
  69. package/build/components/Price/index.d.cts +8 -0
  70. package/build/components/Price/index.d.ts +8 -0
  71. package/build/components/Price/index.js +44 -35
  72. package/build/components/Price/index.js.map +1 -1
  73. package/build/components/Price/style.css +1 -1
  74. package/build/components/PromptDialog/index.cjs +1 -1
  75. package/build/components/QuantityInput/index.cjs +1 -1
  76. package/build/components/RateInput/index.cjs +1 -1
  77. package/build/components/ScaledInput/index.cjs +1 -1
  78. package/build/components/SectionHeader/index.cjs +1 -1
  79. package/build/components/SectionHeader/index.cjs.map +1 -1
  80. package/build/components/SectionHeader/index.d.cts +2 -0
  81. package/build/components/SectionHeader/index.d.ts +2 -0
  82. package/build/components/SectionHeader/index.js +25 -15
  83. package/build/components/SectionHeader/index.js.map +1 -1
  84. package/build/components/SectionHeader/style.css +1 -1
  85. package/build/components/Select/index.cjs +1 -1
  86. package/build/components/Switch/index.js +4 -4
  87. package/build/components/Table/style.css +1 -1
  88. package/build/components/Tabs/index.cjs +1 -1
  89. package/build/components/Tabs/index.cjs.map +1 -1
  90. package/build/components/Tabs/index.js +120 -80
  91. package/build/components/Tabs/index.js.map +1 -1
  92. package/build/components/Tabs/style.css +1 -1
  93. package/build/components/Toast/index.cjs +1 -1
  94. package/build/components/Toast/style.css +1 -1
  95. package/build/components/ToastPortal/index.cjs +1 -1
  96. package/build/components/TotalsList/index.cjs +2 -0
  97. package/build/components/TotalsList/index.cjs.map +1 -0
  98. package/build/components/TotalsList/index.d.cts +26 -0
  99. package/build/components/TotalsList/index.d.ts +26 -0
  100. package/build/components/TotalsList/index.js +22 -0
  101. package/build/components/TotalsList/index.js.map +1 -0
  102. package/build/components/TotalsList/style.css +1 -0
  103. package/build/components/TreeSelect/index.cjs +1 -1
  104. package/build/components/UserMenu/index.cjs +1 -1
  105. package/build/constants/breakpoint.constants.cjs +1 -1
  106. package/build/constants/breakpoint.constants.cjs.map +1 -1
  107. package/build/constants/breakpoint.constants.d.cts +2 -0
  108. package/build/constants/breakpoint.constants.d.ts +2 -0
  109. package/build/constants/breakpoint.constants.js +5 -4
  110. package/build/constants/breakpoint.constants.js.map +1 -1
  111. package/build/helpers/scroll.helper.cjs +1 -1
  112. package/build/helpers/scroll.helper.cjs.map +1 -1
  113. package/build/helpers/scroll.helper.d.cts +6 -0
  114. package/build/helpers/scroll.helper.d.ts +6 -0
  115. package/build/helpers/scroll.helper.js +10 -5
  116. package/build/helpers/scroll.helper.js.map +1 -1
  117. package/build/hooks/usePrinting.cjs +2 -0
  118. package/build/hooks/usePrinting.cjs.map +1 -0
  119. package/build/hooks/usePrinting.d.cts +8 -0
  120. package/build/hooks/usePrinting.d.ts +8 -0
  121. package/build/hooks/usePrinting.js +18 -0
  122. package/build/hooks/usePrinting.js.map +1 -0
  123. package/build/index.cjs +1 -1
  124. package/build/index.d.cts +2 -1
  125. package/build/index.d.ts +2 -1
  126. package/build/index.js +88 -86
  127. package/build/index.js.map +1 -1
  128. package/build/scss/_mixins.scss +8 -0
  129. package/build/styles.css +18 -16
  130. package/build/theme/context.js +2 -2
  131. package/build/types/theme.type.d.cts +5 -0
  132. package/build/types/theme.type.d.ts +5 -0
  133. package/build/types/types/theme.type.d.cts +5 -0
  134. package/build/types/types/theme.type.d.ts +5 -0
  135. package/package.json +11 -1
@@ -1,4 +1,4 @@
1
- import { jsxs as d, jsx as a } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as d } from "react/jsx-runtime";
2
2
  import { memo as c } from "react";
3
3
  import { cx as m } from "../../helpers/class-name.helper.js";
4
4
  import { named as _ } from "../../helpers/component.helper.js";
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),i=require("react"),o=require("react-bootstrap-icons"),w=require("../../helpers/component.helper.cjs"),a=require("../../helpers/label.helper.cjs"),x=require("../../theme/context.cjs"),h=require("../IconButton/index.cjs"),f=require("../Input/index.cjs"),r={default:{"password":"ui-password-viMea","password__field":"ui-password__field-WI1h1","password__toggle":"ui-password__toggle-O6R2a"}},q=({className:n,showLabel:l,hideLabel:d,...u})=>{const{labels:e}=x.useUi(),[t,c]=i.useState(!1),p=t?a.resolveLabel("PasswordInput.hideLabel",d,e==null?void 0:e.passwordHide):a.resolveLabel("PasswordInput.showLabel",l,e==null?void 0:e.passwordShow);return s.jsxs("span",{className:r.default.password,children:[s.jsx(f.default,{...u,className:`${r.default.password__field} ${n??""}`.trim(),type:t?"text":"password"}),s.jsx(h.default,{className:r.default.password__toggle,icon:t?s.jsx(o.EyeSlashFill,{"aria-hidden":!0}):s.jsx(o.EyeFill,{"aria-hidden":!0}),label:p,variant:"ghost",size:"sm",onClick:()=>c(m=>!m)})]})},_=i.memo(w.named(q,"PasswordInput"));exports.default=_;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),a=require("react"),r=require("react-bootstrap-icons"),_=require("../../helpers/component.helper.cjs"),n=require("../../helpers/label.helper.cjs"),w=require("../../theme/context.cjs"),x=require("../IconButton/index.cjs"),h=require("../Input/index.cjs"),o={default:{"password":"ui-password-viMea","password__field":"ui-password__field-WI1h1","password__toggle":"ui-password__toggle-O6R2a"}},f=({className:i,showLabel:l,hideLabel:u,...d})=>{const{labels:e}=w.useUi(),[t,c]=a.useState(!1),p=t?n.resolveLabel("PasswordInput.hideLabel",u,e==null?void 0:e.passwordHide):n.resolveLabel("PasswordInput.showLabel",l,e==null?void 0:e.passwordShow);return s.jsxs("span",{className:o.default.password,children:[s.jsx(h.default,{...d,className:`${o.default.password__field} ${i??""}`.trim(),type:t?"text":"password"}),s.jsx(x.default,{className:o.default.password__toggle,icon:t?s.jsx(r.EyeSlashFill,{"aria-hidden":!0}):s.jsx(r.EyeFill,{"aria-hidden":!0}),label:p,variant:"ghost",size:"sm",onClick:()=>c(m=>!m)})]})},q=a.memo(_.named(f,"PasswordInput"));exports.default=q;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),e=require("react"),o=require("../../constants/scale.constants.cjs"),c=require("../../helpers/component.helper.cjs"),u=require("../ScaledInput/index.cjs"),i=e.forwardRef(({prefix:t="%",...n},r)=>s.jsx(u.default,{ref:r,...n,prefix:t,scaleDigits:o.PCT2_DIGITS})),a=e.memo(c.named(i,"PercentInput"));exports.default=a;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),e=require("react"),s=require("../../constants/scale.constants.cjs"),c=require("../../helpers/component.helper.cjs"),u=require("../ScaledInput/index.cjs"),i=e.forwardRef(({prefix:t="%",...n},r)=>o.jsx(u.default,{ref:r,...n,prefix:t,scaleDigits:s.PCT2_DIGITS})),a=e.memo(c.named(i,"PercentInput"));exports.default=a;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- @layer ui{.ui-popover-VxgiK{z-index:var(--hd-z-popover);min-width:200px;max-width:min(360px,100vw - var(--hd-space-6));padding:var(--hd-space-3);border-radius:var(--hd-radius-md);background-color:var(--hd-bg-overlay);border:1px solid var(--hd-border);box-shadow:var(--hd-shadow-2);color:var(--hd-text);font-size:var(--hd-type-small-size);line-height:var(--hd-type-body-line-height);text-align:start}.ui-popover--top-OUYwo{animation:var(--ui-anim-fade-in-up) var(--hd-duration-fast) var(--hd-ease-standard)}.ui-popover--bottom-Q1K4X{animation:var(--ui-anim-fade-in-down) var(--hd-duration-fast) var(--hd-ease-standard)}.ui-popover--left-9Rsjx,.ui-popover--right-0TJeo{animation:var(--ui-anim-fade-in) var(--hd-duration-fast) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-popover-VxgiK{animation:none}}@media (forced-colors: active){.ui-popover-VxgiK{border-color:CanvasText}}}
1
+ @layer ui{.ui-popover-VxgiK{z-index:var(--hd-z-popover);min-width:200px;max-width:min(360px,100vw - var(--hd-space-6));padding:var(--hd-space-3);border-radius:var(--hd-radius-md);background-color:var(--hd-bg-overlay);border:1px solid var(--hd-border);box-shadow:var(--hd-shadow-2);color:var(--hd-text);font-size:var(--hd-type-small-size);line-height:var(--hd-type-body-line-height);text-align:start}.ui-popover--top-OUYwo{animation:var(--ui-anim-fade-in-up) var(--hd-duration-fast) var(--hd-ease-standard)}.ui-popover--bottom-Q1K4X{animation:var(--ui-anim-fade-in-down) var(--hd-duration-fast) var(--hd-ease-standard)}.ui-popover--left-9Rsjx,.ui-popover--right-0TJeo{animation:var(--ui-anim-fade-in) var(--hd-duration-fast) var(--hd-ease-standard)}@media (prefers-reduced-motion: reduce){.ui-popover-VxgiK{animation:none}}@media (forced-colors: active){.ui-popover-VxgiK{border-color:CanvasText}}@media print{.ui-popover-VxgiK{display:none}}}
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),x=require("react"),N=require("../../helpers/class-name.helper.cjs"),h=require("../../helpers/label.helper.cjs"),j=require("../../theme/context.cjs"),r={default:{"price":"ui-price-Oc5Nr","price__current":"ui-price__current-2Xup2","price__currency":"ui-price__currency-32NLN","price__list":"ui-price__list-MlQgT","price__discount":"ui-price__discount-5Yc6W","price--sm":"ui-price--sm-Hd8Oe","price--md":"ui-price--md-JMxlK","price--lg":"ui-price--lg-TFqIF","price--xl":"ui-price--xl-EJBYq"}},y=({value:a,currency:o,listValue:n,discountPercent:t,formatDiscount:d=e=>`%${e}`,isFormatted:m,size:p="md",className:_,testId:f})=>{const{labels:e}=j.useUi(),i=h.resolveLabel("Price.currency",o,e==null?void 0:e.currency),u=c=>{if(!m||!(e!=null&&e.locale)||!/\d/.test(c))return c;const l=Number(c.replace(/[^\d.,-]/g,"").replace(/\.(?=\d{3}\b)/g,"").replace(",","."));if(!Number.isFinite(l))return c;try{return new Intl.NumberFormat(e.locale).format(l)}catch{return c}};return s.jsxs("span",{className:N.cx(r.default.price,r.default[`price--${p}`],_),"data-testid":f,children:[s.jsxs("span",{className:r.default.price__current,children:[u(a),s.jsx("span",{className:r.default.price__currency,children:i})]}),n&&s.jsxs("s",{className:r.default.price__list,children:[u(n),s.jsx("span",{className:r.default.price__currency,children:i})]}),t!==void 0&&t>0&&s.jsx("span",{className:r.default.price__discount,children:d(t)})]})},b=x.memo(y);exports.default=b;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),b=require("react"),d=require("../../helpers/class-name.helper.cjs"),q=require("../../helpers/label.helper.cjs"),v=require("../../theme/context.cjs"),t={default:{"price":"ui-price-Oc5Nr","price__current":"ui-price__current-2Xup2","price__currency":"ui-price__currency-32NLN","price__currency--prefix":"ui-price__currency--prefix-dlva8","price__list":"ui-price__list-MlQgT","price__discount":"ui-price__discount-5Yc6W","price--sm":"ui-price--sm-Hd8Oe","price--md":"ui-price--md-JMxlK","price--lg":"ui-price--lg-TFqIF","price--xl":"ui-price--xl-EJBYq"}},F="₺",I=/^[-\u2212]/,S=({value:m,currency:f,currencyPosition:p,listValue:u,discountPercent:n,formatDiscount:x=r=>`%${r}`,isFormatted:_,size:h="md",className:N,testId:j})=>{const{labels:r}=v.useUi(),i=q.resolveLabel("Price.currency",f,r==null?void 0:r.currency),g=(p??(i===F?"prefix":"suffix"))==="prefix",y=c=>{if(!_||!(r!=null&&r.locale)||!/\d/.test(c))return c;const s=Number(c.replace(/[^\d.,-]/g,"").replace(/\.(?=\d{3}\b)/g,"").replace(",","."));if(!Number.isFinite(s))return c;try{return new Intl.NumberFormat(r.locale).format(s)}catch{return c}},l=c=>{var o;const s=y(c);if(!g)return e.jsxs(e.Fragment,{children:[s,e.jsx("span",{className:t.default.price__currency,children:i})]});const a=((o=I.exec(s))==null?void 0:o[0])??"";return e.jsxs(e.Fragment,{children:[a,e.jsx("span",{className:d.cx(t.default.price__currency,t.default["price__currency--prefix"]),children:i}),s.slice(a.length)]})};return e.jsxs("span",{className:d.cx(t.default.price,t.default[`price--${h}`],N),"data-testid":j,children:[e.jsx("span",{className:t.default.price__current,children:l(m)}),u&&e.jsx("s",{className:t.default.price__list,children:l(u)}),n!==void 0&&n>0&&e.jsx("span",{className:t.default.price__discount,children:x(n)})]})},G=b.memo(S);exports.default=G;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/Price/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, memo } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n /** BİÇİMLENMİŞ tutar: \"1.299,90\". */\n value: string;\n /** Para birimi simgesi ya da kodu. */\n currency?: string;\n /** Değeri `Intl.NumberFormat` ile biçimlendirir. */\n isFormatted?: boolean;\n /** Üstü çizili liste fiyatı; indirim varsa verilir (biçimlenmiş). */\n listValue?: string;\n /** İndirim oranı (tam sayı yüzde). */\n discountPercent?: number;\n /** İndirim rozetinin metnini üretir (\"%20\", \"-20%\"). */\n formatDiscount?: (percent: number) => string;\n size?: 'sm' | 'md' | 'lg' | 'xl';\n className?: string;\n testId?: string;\n};\n\n/** Tutar gösterimi. */\nconst Price: FC<Props> = ({\n value,\n currency,\n listValue,\n discountPercent,\n formatDiscount = percent => `%${percent}`,\n isFormatted,\n size = 'md',\n className,\n testId,\n}) => {\n const { labels } = useUi();\n const symbol = resolveLabel('Price.currency', currency, labels?.currency);\n\n /* BICIMLENDIRME OPSIYONEL ve yerel ayara BAGLI. */\n const format = (raw: string): string => {\n if (!isFormatted || !labels?.locale) return raw;\n\n /* RAKAM ICERMEYEN deger biciMLENDIRILMEZ. */\n if (!/\\d/.test(raw)) return raw;\n\n const numeric = Number(\n raw\n .replace(/[^\\d.,-]/g, '')\n .replace(/\\.(?=\\d{3}\\b)/g, '')\n .replace(',', '.'),\n );\n if (!Number.isFinite(numeric)) return raw;\n\n try {\n return new Intl.NumberFormat(labels.locale).format(numeric);\n } catch {\n return raw;\n }\n };\n\n return (\n <span className={cx(styles.price, styles[`price--${size}`], className)} data-testid={testId}>\n <span className={styles.price__current}>\n {format(value)}\n <span className={styles.price__currency}>{symbol}</span>\n </span>\n\n {listValue && (\n <s className={styles.price__list}>\n {format(listValue)}\n <span className={styles.price__currency}>{symbol}</span>\n </s>\n )}\n\n {/* `isDefined` DEGIL acik karsilastirma: handy-utils'in koruyucusu\n `Exclude<any, …>` donuyor ve TypeScript'te daraltma uretmiyor. */}\n {discountPercent !== undefined && discountPercent > 0 && (\n <span className={styles.price__discount}>{formatDiscount(discountPercent)}</span>\n )}\n </span>\n );\n};\n\nexport default /*#__PURE__*/ memo(Price) as typeof Price;\n"],"names":["Price","value","currency","listValue","discountPercent","formatDiscount","percent","isFormatted","size","className","testId","labels","useUi","symbol","resolveLabel","format","raw","numeric","jsxs","cx","styles","jsx","index"],"mappings":"wVA4BMA,EAAmB,CAAC,CACxB,MAAAC,EACA,SAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,eAAAC,EAAiBC,GAAW,IAAIA,CAAO,GACvC,YAAAC,EACA,KAAAC,EAAO,KACP,UAAAC,EACA,OAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAA,EAAWC,QAAA,EACbC,EAASC,EAAAA,aAAa,iBAAkBZ,EAAUS,GAAA,YAAAA,EAAQ,QAAQ,EAGlEI,EAAUC,GAAwB,CAItC,GAHI,CAACT,GAAe,EAACI,GAAA,MAAAA,EAAQ,SAGzB,CAAC,KAAK,KAAKK,CAAG,EAAG,OAAOA,EAE5B,MAAMC,EAAU,OACdD,EACG,QAAQ,YAAa,EAAE,EACvB,QAAQ,iBAAkB,EAAE,EAC5B,QAAQ,IAAK,GAAG,CAAA,EAErB,GAAI,CAAC,OAAO,SAASC,CAAO,EAAG,OAAOD,EAEtC,GAAI,CACF,OAAO,IAAI,KAAK,aAAaL,EAAO,MAAM,EAAE,OAAOM,CAAO,CAC5D,MAAQ,CACN,OAAOD,CACT,CACF,EAEA,OACEE,EAAAA,KAAC,OAAA,CAAK,UAAWC,EAAAA,GAAGC,EAAAA,QAAO,MAAOA,EAAAA,QAAO,UAAUZ,CAAI,EAAE,EAAGC,CAAS,EAAG,cAAaC,EACnF,SAAA,CAAAQ,EAAAA,KAAC,OAAA,CAAK,UAAWE,EAAAA,QAAO,eACrB,SAAA,CAAAL,EAAOd,CAAK,EACboB,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAAA,QAAO,gBAAkB,SAAAP,CAAA,CAAO,CAAA,EACnD,EAECV,GACCe,EAAAA,KAAC,IAAA,CAAE,UAAWE,EAAAA,QAAO,YAClB,SAAA,CAAAL,EAAOZ,CAAS,EACjBkB,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAAA,QAAO,gBAAkB,SAAAP,CAAA,CAAO,CAAA,EACnD,EAKDT,IAAoB,QAAaA,EAAkB,GAClDiB,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAAA,QAAO,gBAAkB,SAAAf,EAAeD,CAAe,CAAA,CAAE,CAAA,EAE9E,CAEJ,EAEAkB,SAAkCtB,CAAK"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/Price/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, memo, type ReactNode } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\n\nimport styles from './index.module.scss';\n\n/** `prefix`: \"₺2.649,57\". `suffix`: \"2.649,57₺\". */\nexport type PriceCurrencyPosition = 'prefix' | 'suffix';\n\ntype Props = {\n /** BİÇİMLENMİŞ tutar: \"1.299,90\". */\n value: string;\n /** Para birimi simgesi ya da kodu. */\n currency?: string;\n /**\n * Where the symbol sits. Default: `prefix` for \"₺\" — the ecosystem's lira format, as\n * `@handijitcom/tr` `formatLira` writes it (\"₺2.649,57\", \"-₺0,05\", no space) — and `suffix` for any\n * other symbol or code (\"2.649,57 TL\" style, as before 3.2.1).\n */\n currencyPosition?: PriceCurrencyPosition;\n /** Değeri `Intl.NumberFormat` ile biçimlendirir. */\n isFormatted?: boolean;\n /** Üstü çizili liste fiyatı; indirim varsa verilir (biçimlenmiş). */\n listValue?: string;\n /** İndirim oranı (tam sayı yüzde). */\n discountPercent?: number;\n /** İndirim rozetinin metnini üretir (\"%20\", \"-20%\"). */\n formatDiscount?: (percent: number) => string;\n size?: 'sm' | 'md' | 'lg' | 'xl';\n className?: string;\n testId?: string;\n};\n\n/** The lira sign: written before the amount by default (3.2.1). */\nconst LIRA_SIGN = '₺';\n/* A leading minus (ASCII or U+2212) stays in front of a prefixed symbol: \"-₺0,05\". */\nconst SIGN = /^[-\\u2212]/;\n\n/** Tutar gösterimi. */\nconst Price: FC<Props> = ({\n value,\n currency,\n currencyPosition,\n listValue,\n discountPercent,\n formatDiscount = percent => `%${percent}`,\n isFormatted,\n size = 'md',\n className,\n testId,\n}) => {\n const { labels } = useUi();\n const symbol = resolveLabel('Price.currency', currency, labels?.currency);\n const isPrefix = (currencyPosition ?? (symbol === LIRA_SIGN ? 'prefix' : 'suffix')) === 'prefix';\n\n /* BICIMLENDIRME OPSIYONEL ve yerel ayara BAGLI. */\n const format = (raw: string): string => {\n if (!isFormatted || !labels?.locale) return raw;\n\n /* RAKAM ICERMEYEN deger biciMLENDIRILMEZ. */\n if (!/\\d/.test(raw)) return raw;\n\n const numeric = Number(\n raw\n .replace(/[^\\d.,-]/g, '')\n .replace(/\\.(?=\\d{3}\\b)/g, '')\n .replace(',', '.'),\n );\n if (!Number.isFinite(numeric)) return raw;\n\n try {\n return new Intl.NumberFormat(labels.locale).format(numeric);\n } catch {\n return raw;\n }\n };\n\n const amount = (raw: string): ReactNode => {\n const text = format(raw);\n if (!isPrefix) {\n return (\n <>\n {text}\n <span className={styles.price__currency}>{symbol}</span>\n </>\n );\n }\n\n const sign = SIGN.exec(text)?.[0] ?? '';\n return (\n <>\n {sign}\n <span className={cx(styles.price__currency, styles['price__currency--prefix'])}>\n {symbol}\n </span>\n {text.slice(sign.length)}\n </>\n );\n };\n\n return (\n <span className={cx(styles.price, styles[`price--${size}`], className)} data-testid={testId}>\n <span className={styles.price__current}>{amount(value)}</span>\n\n {listValue && <s className={styles.price__list}>{amount(listValue)}</s>}\n\n {/* `isDefined` DEGIL acik karsilastirma: handy-utils'in koruyucusu\n `Exclude<any, …>` donuyor ve TypeScript'te daraltma uretmiyor. */}\n {discountPercent !== undefined && discountPercent > 0 && (\n <span className={styles.price__discount}>{formatDiscount(discountPercent)}</span>\n )}\n </span>\n );\n};\n\nexport default /*#__PURE__*/ memo(Price) as typeof Price;\n"],"names":["LIRA_SIGN","SIGN","Price","value","currency","currencyPosition","listValue","discountPercent","formatDiscount","percent","isFormatted","size","className","testId","labels","useUi","symbol","resolveLabel","isPrefix","format","raw","numeric","amount","text","jsxs","Fragment","jsx","styles","sign","_a","cx","index"],"mappings":"wVAqCMA,EAAY,IAEZC,EAAO,aAGPC,EAAmB,CAAC,CACxB,MAAAC,EACA,SAAAC,EACA,iBAAAC,EACA,UAAAC,EACA,gBAAAC,EACA,eAAAC,EAAiBC,GAAW,IAAIA,CAAO,GACvC,YAAAC,EACA,KAAAC,EAAO,KACP,UAAAC,EACA,OAAAC,CACF,IAAM,CACJ,KAAM,CAAE,OAAAC,CAAA,EAAWC,QAAA,EACbC,EAASC,EAAAA,aAAa,iBAAkBb,EAAUU,GAAA,YAAAA,EAAQ,QAAQ,EAClEI,GAAYb,IAAqBW,IAAWhB,EAAY,SAAW,aAAe,SAGlFmB,EAAUC,GAAwB,CAItC,GAHI,CAACV,GAAe,EAACI,GAAA,MAAAA,EAAQ,SAGzB,CAAC,KAAK,KAAKM,CAAG,EAAG,OAAOA,EAE5B,MAAMC,EAAU,OACdD,EACG,QAAQ,YAAa,EAAE,EACvB,QAAQ,iBAAkB,EAAE,EAC5B,QAAQ,IAAK,GAAG,CAAA,EAErB,GAAI,CAAC,OAAO,SAASC,CAAO,EAAG,OAAOD,EAEtC,GAAI,CACF,OAAO,IAAI,KAAK,aAAaN,EAAO,MAAM,EAAE,OAAOO,CAAO,CAC5D,MAAQ,CACN,OAAOD,CACT,CACF,EAEME,EAAUF,GAA2B,OACzC,MAAMG,EAAOJ,EAAOC,CAAG,EACvB,GAAI,CAACF,EACH,OACEM,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAF,EACDG,EAAAA,IAAC,OAAA,CAAK,UAAWC,EAAAA,QAAO,gBAAkB,SAAAX,CAAA,CAAO,CAAA,EACnD,EAIJ,MAAMY,IAAOC,EAAA5B,EAAK,KAAKsB,CAAI,IAAd,YAAAM,EAAkB,KAAM,GACrC,OACEL,EAAAA,KAAAC,WAAA,CACG,SAAA,CAAAG,EACDF,EAAAA,IAAC,OAAA,CAAK,UAAWI,EAAAA,GAAGH,EAAAA,QAAO,gBAAiBA,EAAAA,QAAO,yBAAyB,CAAC,EAC1E,SAAAX,CAAA,CACH,EACCO,EAAK,MAAMK,EAAK,MAAM,CAAA,EACzB,CAEJ,EAEA,OACEJ,EAAAA,KAAC,OAAA,CAAK,UAAWM,EAAAA,GAAGH,EAAAA,QAAO,MAAOA,EAAAA,QAAO,UAAUhB,CAAI,EAAE,EAAGC,CAAS,EAAG,cAAaC,EACnF,SAAA,CAAAa,MAAC,QAAK,UAAWC,EAAAA,QAAO,eAAiB,SAAAL,EAAOnB,CAAK,EAAE,EAEtDG,SAAc,IAAA,CAAE,UAAWqB,EAAAA,QAAO,YAAc,SAAAL,EAAOhB,CAAS,EAAE,EAIlEC,IAAoB,QAAaA,EAAkB,GAClDmB,EAAAA,IAAC,OAAA,CAAK,UAAWC,EAAAA,QAAO,gBAAkB,SAAAnB,EAAeD,CAAe,CAAA,CAAE,CAAA,EAE9E,CAEJ,EAEAwB,SAAkC7B,CAAK"}
@@ -1,9 +1,17 @@
1
1
  import { FC } from 'react';
2
+ /** `prefix`: "₺2.649,57". `suffix`: "2.649,57₺". */
3
+ export type PriceCurrencyPosition = 'prefix' | 'suffix';
2
4
  type Props = {
3
5
  /** BİÇİMLENMİŞ tutar: "1.299,90". */
4
6
  value: string;
5
7
  /** Para birimi simgesi ya da kodu. */
6
8
  currency?: string;
9
+ /**
10
+ * Where the symbol sits. Default: `prefix` for "₺" — the ecosystem's lira format, as
11
+ * `@handijitcom/tr` `formatLira` writes it ("₺2.649,57", "-₺0,05", no space) — and `suffix` for any
12
+ * other symbol or code ("2.649,57 TL" style, as before 3.2.1).
13
+ */
14
+ currencyPosition?: PriceCurrencyPosition;
7
15
  /** Değeri `Intl.NumberFormat` ile biçimlendirir. */
8
16
  isFormatted?: boolean;
9
17
  /** Üstü çizili liste fiyatı; indirim varsa verilir (biçimlenmiş). */
@@ -1,9 +1,17 @@
1
1
  import { FC } from 'react';
2
+ /** `prefix`: "₺2.649,57". `suffix`: "2.649,57₺". */
3
+ export type PriceCurrencyPosition = 'prefix' | 'suffix';
2
4
  type Props = {
3
5
  /** BİÇİMLENMİŞ tutar: "1.299,90". */
4
6
  value: string;
5
7
  /** Para birimi simgesi ya da kodu. */
6
8
  currency?: string;
9
+ /**
10
+ * Where the symbol sits. Default: `prefix` for "₺" — the ecosystem's lira format, as
11
+ * `@handijitcom/tr` `formatLira` writes it ("₺2.649,57", "-₺0,05", no space) — and `suffix` for any
12
+ * other symbol or code ("2.649,57 TL" style, as before 3.2.1).
13
+ */
14
+ currencyPosition?: PriceCurrencyPosition;
7
15
  /** Değeri `Intl.NumberFormat` ile biçimlendirir. */
8
16
  isFormatted?: boolean;
9
17
  /** Üstü çizili liste fiyatı; indirim varsa verilir (biçimlenmiş). */
@@ -1,46 +1,55 @@
1
1
  "use client";
2
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
3
- import { memo as h } from "react";
4
- import { cx as y } from "../../helpers/class-name.helper.js";
5
- import { resolveLabel as x } from "../../helpers/label.helper.js";
6
- import { useUi as b } from "../../theme/context.js";
7
- const e = {"price":"ui-price-Oc5Nr","price__current":"ui-price__current-2Xup2","price__currency":"ui-price__currency-32NLN","price__list":"ui-price__list-MlQgT","price__discount":"ui-price__discount-5Yc6W","price--sm":"ui-price--sm-Hd8Oe","price--md":"ui-price--md-JMxlK","price--lg":"ui-price--lg-TFqIF","price--xl":"ui-price--xl-EJBYq"};
8
- const g = ({
9
- value: p,
10
- currency: l,
11
- listValue: n,
12
- discountPercent: s,
13
- formatDiscount: u = (r) => `%${r}`,
14
- isFormatted: d,
15
- size: f = "md",
16
- className: _,
17
- testId: N
2
+ import { jsxs as o, jsx as t, Fragment as u } from "react/jsx-runtime";
3
+ import { memo as j } from "react";
4
+ import { cx as f } from "../../helpers/class-name.helper.js";
5
+ import { resolveLabel as v } from "../../helpers/label.helper.js";
6
+ import { useUi as G } from "../../theme/context.js";
7
+ const c = {"price":"ui-price-Oc5Nr","price__current":"ui-price__current-2Xup2","price__currency":"ui-price__currency-32NLN","price__currency--prefix":"ui-price__currency--prefix-dlva8","price__list":"ui-price__list-MlQgT","price__discount":"ui-price__discount-5Yc6W","price--sm":"ui-price--sm-Hd8Oe","price--md":"ui-price--md-JMxlK","price--lg":"ui-price--lg-TFqIF","price--xl":"ui-price--xl-EJBYq"};
8
+ const L = "₺", S = /^[-\u2212]/, $ = ({
9
+ value: d,
10
+ currency: _,
11
+ currencyPosition: x,
12
+ listValue: m,
13
+ discountPercent: i,
14
+ formatDiscount: N = (r) => `%${r}`,
15
+ isFormatted: h,
16
+ size: y = "md",
17
+ className: g,
18
+ testId: I
18
19
  }) => {
19
- const { labels: r } = b(), m = x("Price.currency", l, r == null ? void 0 : r.currency), o = (c) => {
20
- if (!d || !(r != null && r.locale) || !/\d/.test(c)) return c;
21
- const a = Number(
22
- c.replace(/[^\d.,-]/g, "").replace(/\.(?=\d{3}\b)/g, "").replace(",", ".")
20
+ const { labels: r } = G(), s = v("Price.currency", _, r == null ? void 0 : r.currency), b = (x ?? (s === L ? "prefix" : "suffix")) === "prefix", F = (e) => {
21
+ if (!h || !(r != null && r.locale) || !/\d/.test(e)) return e;
22
+ const n = Number(
23
+ e.replace(/[^\d.,-]/g, "").replace(/\.(?=\d{3}\b)/g, "").replace(",", ".")
23
24
  );
24
- if (!Number.isFinite(a)) return c;
25
+ if (!Number.isFinite(n)) return e;
25
26
  try {
26
- return new Intl.NumberFormat(r.locale).format(a);
27
+ return new Intl.NumberFormat(r.locale).format(n);
27
28
  } catch {
28
- return c;
29
+ return e;
29
30
  }
31
+ }, p = (e) => {
32
+ var l;
33
+ const n = F(e);
34
+ if (!b)
35
+ return /* @__PURE__ */ o(u, { children: [
36
+ n,
37
+ /* @__PURE__ */ t("span", { className: c.price__currency, children: s })
38
+ ] });
39
+ const a = ((l = S.exec(n)) == null ? void 0 : l[0]) ?? "";
40
+ return /* @__PURE__ */ o(u, { children: [
41
+ a,
42
+ /* @__PURE__ */ t("span", { className: f(c.price__currency, c["price__currency--prefix"]), children: s }),
43
+ n.slice(a.length)
44
+ ] });
30
45
  };
31
- return /* @__PURE__ */ i("span", { className: y(e.price, e[`price--${f}`], _), "data-testid": N, children: [
32
- /* @__PURE__ */ i("span", { className: e.price__current, children: [
33
- o(p),
34
- /* @__PURE__ */ t("span", { className: e.price__currency, children: m })
35
- ] }),
36
- n && /* @__PURE__ */ i("s", { className: e.price__list, children: [
37
- o(n),
38
- /* @__PURE__ */ t("span", { className: e.price__currency, children: m })
39
- ] }),
40
- s !== void 0 && s > 0 && /* @__PURE__ */ t("span", { className: e.price__discount, children: u(s) })
46
+ return /* @__PURE__ */ o("span", { className: f(c.price, c[`price--${y}`], g), "data-testid": I, children: [
47
+ /* @__PURE__ */ t("span", { className: c.price__current, children: p(d) }),
48
+ m && /* @__PURE__ */ t("s", { className: c.price__list, children: p(m) }),
49
+ i !== void 0 && i > 0 && /* @__PURE__ */ t("span", { className: c.price__discount, children: N(i) })
41
50
  ] });
42
- }, U = /* @__PURE__ */ h(g);
51
+ }, z = /* @__PURE__ */ j($);
43
52
  export {
44
- U as default
53
+ z as default
45
54
  };
46
55
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Price/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, memo } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n /** BİÇİMLENMİŞ tutar: \"1.299,90\". */\n value: string;\n /** Para birimi simgesi ya da kodu. */\n currency?: string;\n /** Değeri `Intl.NumberFormat` ile biçimlendirir. */\n isFormatted?: boolean;\n /** Üstü çizili liste fiyatı; indirim varsa verilir (biçimlenmiş). */\n listValue?: string;\n /** İndirim oranı (tam sayı yüzde). */\n discountPercent?: number;\n /** İndirim rozetinin metnini üretir (\"%20\", \"-20%\"). */\n formatDiscount?: (percent: number) => string;\n size?: 'sm' | 'md' | 'lg' | 'xl';\n className?: string;\n testId?: string;\n};\n\n/** Tutar gösterimi. */\nconst Price: FC<Props> = ({\n value,\n currency,\n listValue,\n discountPercent,\n formatDiscount = percent => `%${percent}`,\n isFormatted,\n size = 'md',\n className,\n testId,\n}) => {\n const { labels } = useUi();\n const symbol = resolveLabel('Price.currency', currency, labels?.currency);\n\n /* BICIMLENDIRME OPSIYONEL ve yerel ayara BAGLI. */\n const format = (raw: string): string => {\n if (!isFormatted || !labels?.locale) return raw;\n\n /* RAKAM ICERMEYEN deger biciMLENDIRILMEZ. */\n if (!/\\d/.test(raw)) return raw;\n\n const numeric = Number(\n raw\n .replace(/[^\\d.,-]/g, '')\n .replace(/\\.(?=\\d{3}\\b)/g, '')\n .replace(',', '.'),\n );\n if (!Number.isFinite(numeric)) return raw;\n\n try {\n return new Intl.NumberFormat(labels.locale).format(numeric);\n } catch {\n return raw;\n }\n };\n\n return (\n <span className={cx(styles.price, styles[`price--${size}`], className)} data-testid={testId}>\n <span className={styles.price__current}>\n {format(value)}\n <span className={styles.price__currency}>{symbol}</span>\n </span>\n\n {listValue && (\n <s className={styles.price__list}>\n {format(listValue)}\n <span className={styles.price__currency}>{symbol}</span>\n </s>\n )}\n\n {/* `isDefined` DEGIL acik karsilastirma: handy-utils'in koruyucusu\n `Exclude<any, …>` donuyor ve TypeScript'te daraltma uretmiyor. */}\n {discountPercent !== undefined && discountPercent > 0 && (\n <span className={styles.price__discount}>{formatDiscount(discountPercent)}</span>\n )}\n </span>\n );\n};\n\nexport default /*#__PURE__*/ memo(Price) as typeof Price;\n"],"names":["Price","value","currency","listValue","discountPercent","formatDiscount","percent","isFormatted","size","className","testId","labels","useUi","symbol","resolveLabel","format","raw","numeric","jsxs","cx","styles","jsx","index"],"mappings":";;;;;;;AA4BA,MAAMA,IAAmB,CAAC;AAAA,EACxB,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC,IAAiB,CAAAC,MAAW,IAAIA,CAAO;AAAA,EACvC,aAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,QAAAC;AACF,MAAM;AACJ,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAASC,EAAa,kBAAkBZ,GAAUS,KAAA,gBAAAA,EAAQ,QAAQ,GAGlEI,IAAS,CAACC,MAAwB;AAItC,QAHI,CAACT,KAAe,EAACI,KAAA,QAAAA,EAAQ,WAGzB,CAAC,KAAK,KAAKK,CAAG,EAAG,QAAOA;AAE5B,UAAMC,IAAU;AAAA,MACdD,EACG,QAAQ,aAAa,EAAE,EACvB,QAAQ,kBAAkB,EAAE,EAC5B,QAAQ,KAAK,GAAG;AAAA,IAAA;AAErB,QAAI,CAAC,OAAO,SAASC,CAAO,EAAG,QAAOD;AAEtC,QAAI;AACF,aAAO,IAAI,KAAK,aAAaL,EAAO,MAAM,EAAE,OAAOM,CAAO;AAAA,IAC5D,QAAQ;AACN,aAAOD;AAAA,IACT;AAAA,EACF;AAEA,SACE,gBAAAE,EAAC,QAAA,EAAK,WAAWC,EAAGC,EAAO,OAAOA,EAAO,UAAUZ,CAAI,EAAE,GAAGC,CAAS,GAAG,eAAaC,GACnF,UAAA;AAAA,IAAA,gBAAAQ,EAAC,QAAA,EAAK,WAAWE,EAAO,gBACrB,UAAA;AAAA,MAAAL,EAAOd,CAAK;AAAA,MACb,gBAAAoB,EAAC,QAAA,EAAK,WAAWD,EAAO,iBAAkB,UAAAP,EAAA,CAAO;AAAA,IAAA,GACnD;AAAA,IAECV,KACC,gBAAAe,EAAC,KAAA,EAAE,WAAWE,EAAO,aAClB,UAAA;AAAA,MAAAL,EAAOZ,CAAS;AAAA,MACjB,gBAAAkB,EAAC,QAAA,EAAK,WAAWD,EAAO,iBAAkB,UAAAP,EAAA,CAAO;AAAA,IAAA,GACnD;AAAA,IAKDT,MAAoB,UAAaA,IAAkB,KAClD,gBAAAiB,EAAC,QAAA,EAAK,WAAWD,EAAO,iBAAkB,UAAAf,EAAeD,CAAe,EAAA,CAAE;AAAA,EAAA,GAE9E;AAEJ,GAEAkB,sBAAkCtB,CAAK;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Price/index.tsx"],"sourcesContent":["'use client';\n\nimport { type FC, memo, type ReactNode } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\nimport { resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\n\nimport styles from './index.module.scss';\n\n/** `prefix`: \"₺2.649,57\". `suffix`: \"2.649,57₺\". */\nexport type PriceCurrencyPosition = 'prefix' | 'suffix';\n\ntype Props = {\n /** BİÇİMLENMİŞ tutar: \"1.299,90\". */\n value: string;\n /** Para birimi simgesi ya da kodu. */\n currency?: string;\n /**\n * Where the symbol sits. Default: `prefix` for \"₺\" — the ecosystem's lira format, as\n * `@handijitcom/tr` `formatLira` writes it (\"₺2.649,57\", \"-₺0,05\", no space) — and `suffix` for any\n * other symbol or code (\"2.649,57 TL\" style, as before 3.2.1).\n */\n currencyPosition?: PriceCurrencyPosition;\n /** Değeri `Intl.NumberFormat` ile biçimlendirir. */\n isFormatted?: boolean;\n /** Üstü çizili liste fiyatı; indirim varsa verilir (biçimlenmiş). */\n listValue?: string;\n /** İndirim oranı (tam sayı yüzde). */\n discountPercent?: number;\n /** İndirim rozetinin metnini üretir (\"%20\", \"-20%\"). */\n formatDiscount?: (percent: number) => string;\n size?: 'sm' | 'md' | 'lg' | 'xl';\n className?: string;\n testId?: string;\n};\n\n/** The lira sign: written before the amount by default (3.2.1). */\nconst LIRA_SIGN = '₺';\n/* A leading minus (ASCII or U+2212) stays in front of a prefixed symbol: \"-₺0,05\". */\nconst SIGN = /^[-\\u2212]/;\n\n/** Tutar gösterimi. */\nconst Price: FC<Props> = ({\n value,\n currency,\n currencyPosition,\n listValue,\n discountPercent,\n formatDiscount = percent => `%${percent}`,\n isFormatted,\n size = 'md',\n className,\n testId,\n}) => {\n const { labels } = useUi();\n const symbol = resolveLabel('Price.currency', currency, labels?.currency);\n const isPrefix = (currencyPosition ?? (symbol === LIRA_SIGN ? 'prefix' : 'suffix')) === 'prefix';\n\n /* BICIMLENDIRME OPSIYONEL ve yerel ayara BAGLI. */\n const format = (raw: string): string => {\n if (!isFormatted || !labels?.locale) return raw;\n\n /* RAKAM ICERMEYEN deger biciMLENDIRILMEZ. */\n if (!/\\d/.test(raw)) return raw;\n\n const numeric = Number(\n raw\n .replace(/[^\\d.,-]/g, '')\n .replace(/\\.(?=\\d{3}\\b)/g, '')\n .replace(',', '.'),\n );\n if (!Number.isFinite(numeric)) return raw;\n\n try {\n return new Intl.NumberFormat(labels.locale).format(numeric);\n } catch {\n return raw;\n }\n };\n\n const amount = (raw: string): ReactNode => {\n const text = format(raw);\n if (!isPrefix) {\n return (\n <>\n {text}\n <span className={styles.price__currency}>{symbol}</span>\n </>\n );\n }\n\n const sign = SIGN.exec(text)?.[0] ?? '';\n return (\n <>\n {sign}\n <span className={cx(styles.price__currency, styles['price__currency--prefix'])}>\n {symbol}\n </span>\n {text.slice(sign.length)}\n </>\n );\n };\n\n return (\n <span className={cx(styles.price, styles[`price--${size}`], className)} data-testid={testId}>\n <span className={styles.price__current}>{amount(value)}</span>\n\n {listValue && <s className={styles.price__list}>{amount(listValue)}</s>}\n\n {/* `isDefined` DEGIL acik karsilastirma: handy-utils'in koruyucusu\n `Exclude<any, …>` donuyor ve TypeScript'te daraltma uretmiyor. */}\n {discountPercent !== undefined && discountPercent > 0 && (\n <span className={styles.price__discount}>{formatDiscount(discountPercent)}</span>\n )}\n </span>\n );\n};\n\nexport default /*#__PURE__*/ memo(Price) as typeof Price;\n"],"names":["LIRA_SIGN","SIGN","Price","value","currency","currencyPosition","listValue","discountPercent","formatDiscount","percent","isFormatted","size","className","testId","labels","useUi","symbol","resolveLabel","isPrefix","format","raw","numeric","amount","text","jsxs","Fragment","jsx","styles","sign","_a","cx","index"],"mappings":";;;;;;;AAqCA,MAAMA,IAAY,KAEZC,IAAO,cAGPC,IAAmB,CAAC;AAAA,EACxB,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,gBAAAC,IAAiB,CAAAC,MAAW,IAAIA,CAAO;AAAA,EACvC,aAAAC;AAAA,EACA,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,QAAAC;AACF,MAAM;AACJ,QAAM,EAAE,QAAAC,EAAA,IAAWC,EAAA,GACbC,IAASC,EAAa,kBAAkBb,GAAUU,KAAA,gBAAAA,EAAQ,QAAQ,GAClEI,KAAYb,MAAqBW,MAAWhB,IAAY,WAAW,eAAe,UAGlFmB,IAAS,CAACC,MAAwB;AAItC,QAHI,CAACV,KAAe,EAACI,KAAA,QAAAA,EAAQ,WAGzB,CAAC,KAAK,KAAKM,CAAG,EAAG,QAAOA;AAE5B,UAAMC,IAAU;AAAA,MACdD,EACG,QAAQ,aAAa,EAAE,EACvB,QAAQ,kBAAkB,EAAE,EAC5B,QAAQ,KAAK,GAAG;AAAA,IAAA;AAErB,QAAI,CAAC,OAAO,SAASC,CAAO,EAAG,QAAOD;AAEtC,QAAI;AACF,aAAO,IAAI,KAAK,aAAaN,EAAO,MAAM,EAAE,OAAOO,CAAO;AAAA,IAC5D,QAAQ;AACN,aAAOD;AAAA,IACT;AAAA,EACF,GAEME,IAAS,CAACF,MAA2B;;AACzC,UAAMG,IAAOJ,EAAOC,CAAG;AACvB,QAAI,CAACF;AACH,aACE,gBAAAM,EAAAC,GAAA,EACG,UAAA;AAAA,QAAAF;AAAA,QACD,gBAAAG,EAAC,QAAA,EAAK,WAAWC,EAAO,iBAAkB,UAAAX,EAAA,CAAO;AAAA,MAAA,GACnD;AAIJ,UAAMY,MAAOC,IAAA5B,EAAK,KAAKsB,CAAI,MAAd,gBAAAM,EAAkB,OAAM;AACrC,WACE,gBAAAL,EAAAC,GAAA,EACG,UAAA;AAAA,MAAAG;AAAA,MACD,gBAAAF,EAAC,QAAA,EAAK,WAAWI,EAAGH,EAAO,iBAAiBA,EAAO,yBAAyB,CAAC,GAC1E,UAAAX,EAAA,CACH;AAAA,MACCO,EAAK,MAAMK,EAAK,MAAM;AAAA,IAAA,GACzB;AAAA,EAEJ;AAEA,SACE,gBAAAJ,EAAC,QAAA,EAAK,WAAWM,EAAGH,EAAO,OAAOA,EAAO,UAAUhB,CAAI,EAAE,GAAGC,CAAS,GAAG,eAAaC,GACnF,UAAA;AAAA,IAAA,gBAAAa,EAAC,UAAK,WAAWC,EAAO,gBAAiB,UAAAL,EAAOnB,CAAK,GAAE;AAAA,IAEtDG,uBAAc,KAAA,EAAE,WAAWqB,EAAO,aAAc,UAAAL,EAAOhB,CAAS,GAAE;AAAA,IAIlEC,MAAoB,UAAaA,IAAkB,KAClD,gBAAAmB,EAAC,QAAA,EAAK,WAAWC,EAAO,iBAAkB,UAAAnB,EAAeD,CAAe,EAAA,CAAE;AAAA,EAAA,GAE9E;AAEJ,GAEAwB,sBAAkC7B,CAAK;"}
@@ -1 +1 @@
1
- @layer ui{.ui-price-Oc5Nr{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:var(--hd-space-2)}.ui-price__current-2Xup2{font-family:var(--hd-font-display);font-size:var(--hd-type-h4-size);font-weight:var(--hd-font-weight-bold);font-variant-numeric:tabular-nums;letter-spacing:var(--hd-type-h2-letter-spacing);white-space:nowrap;color:var(--hd-text)}.ui-price__currency-32NLN{font-size:.75em;font-weight:var(--hd-font-weight-semibold);margin-inline-start:2px}.ui-price__list-MlQgT{font-size:var(--hd-type-small-size);color:var(--hd-text-3);font-variant-numeric:tabular-nums;text-decoration-thickness:1px}.ui-price__discount-5Yc6W{font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-bold);color:var(--hd-danger-on-solid);background-color:var(--hd-danger-solid);border-radius:var(--hd-radius-xs);padding:2px var(--hd-space-1);line-height:1}.ui-price--sm-Hd8Oe .ui-price__current-2Xup2{font-size:var(--hd-type-body-size)}.ui-price--md-JMxlK .ui-price__current-2Xup2{font-size:var(--hd-type-h4-size)}.ui-price--lg-TFqIF .ui-price__current-2Xup2,.ui-price--xl-EJBYq .ui-price__current-2Xup2{font-size:var(--hd-type-h2-size)}}
1
+ @layer ui{.ui-price-Oc5Nr{display:inline-flex;align-items:baseline;flex-wrap:wrap;gap:var(--hd-space-2)}.ui-price__current-2Xup2{font-family:var(--hd-font-display);font-size:var(--hd-type-h4-size);font-weight:var(--hd-font-weight-bold);font-variant-numeric:tabular-nums;letter-spacing:var(--hd-type-h2-letter-spacing);white-space:nowrap;color:var(--hd-text)}.ui-price__currency-32NLN{font-size:.75em;font-weight:var(--hd-font-weight-semibold);margin-inline-start:2px}.ui-price__currency--prefix-dlva8{margin-inline:0}.ui-price__list-MlQgT{font-size:var(--hd-type-small-size);color:var(--hd-text-3);font-variant-numeric:tabular-nums;text-decoration-thickness:1px}.ui-price__discount-5Yc6W{font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-bold);color:var(--hd-danger-on-solid);background-color:var(--hd-danger-solid);border-radius:var(--hd-radius-xs);padding:2px var(--hd-space-1);line-height:1}.ui-price--sm-Hd8Oe .ui-price__current-2Xup2{font-size:var(--hd-type-body-size)}.ui-price--md-JMxlK .ui-price__current-2Xup2{font-size:var(--hd-type-h4-size)}.ui-price--lg-TFqIF .ui-price__current-2Xup2,.ui-price--xl-EJBYq .ui-price__current-2Xup2{font-size:var(--hd-type-h2-size)}}
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),r=require("react"),h=require("../../helpers/label.helper.cjs"),p=require("../../theme/context.cjs"),D=require("../../enums/ui-size.enum.cjs"),S=require("../../enums/ui-variant.enum.cjs"),y=require("../Button/index.cjs"),w=require("../Field/index.cjs"),A=require("../Input/index.cjs"),N=require("../Modal/index.cjs"),Y=require("../Textarea/index.cjs"),k={default:{"form":"ui-form-zpZn4"}},F=({isOpen:s,onClose:u,onSubmit:I,title:M,label:_,submitLabel:L,cancelLabel:P,closeLabel:R,description:$,hint:z,placeholder:d,defaultValue:a="",isRequired:m,requiredLabel:E,inputMode:f="text",maxLength:x,rows:B=4})=>{const{labels:e}=p.useUi(),b=r.useId(),[o,c]=r.useState(a),[i,q]=r.useState(!1),g=r.useRef(!1);r.useEffect(()=>{s&&!g.current&&c(a),g.current=s},[s,a]);const j=o.trim(),v=!!m&&j==="",C=n=>f==="multiline"?t.jsx(Y.default,{...n,value:o,onChange:l=>c(l.target.value),placeholder:d,maxLength:x,rows:B}):t.jsx(A.default,{...n,type:f==="number"?"number":"text",value:o,onChange:l=>c(l.target.value),placeholder:d,maxLength:x}),U=async()=>{if(!(v||i)){q(!0);try{await I(j),u()}catch{}finally{q(!1)}}};return t.jsx(N.default,{isOpen:s,onClose:u,title:M,closeLabel:R??(e==null?void 0:e.close),description:$,size:"sm",isDismissable:!i,footer:t.jsxs(t.Fragment,{children:[t.jsx(y.default,{variant:S.default.SECONDARY,size:D.default.MEDIUM,onClick:u,disabled:i,children:h.resolveLabel("PromptDialog.cancelLabel",P,e==null?void 0:e.cancel)}),t.jsx(y.default,{type:"submit",form:b,variant:S.default.PRIMARY,size:D.default.MEDIUM,disabled:v,isLoading:i,children:h.resolveLabel("PromptDialog.submitLabel",L,e==null?void 0:e.submit)})]}),children:t.jsx("form",{id:b,className:k.default.form,onSubmit:n=>{n.preventDefault(),U()},children:t.jsx(w.default,{label:_,hint:z,isRequired:m,requiredLabel:E,children:C})})})},T=r.memo(F);exports.default=T;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("react/jsx-runtime"),n=require("react"),v=require("../../helpers/label.helper.cjs"),w=require("../../theme/context.cjs"),h=require("../../enums/ui-size.enum.cjs"),D=require("../../enums/ui-variant.enum.cjs"),S=require("../Button/index.cjs"),A=require("../Field/index.cjs"),F=require("../Input/index.cjs"),N=require("../Modal/index.cjs"),T=require("../Textarea/index.cjs"),Y={default:{"form":"ui-form-zpZn4"}},k=({isOpen:s,onClose:o,onSubmit:p,title:y,label:I,submitLabel:M,cancelLabel:L,closeLabel:P,description:R,hint:z,placeholder:d,defaultValue:u="",isRequired:m,requiredLabel:B,inputMode:f="text",maxLength:x,rows:E=4})=>{const{labels:e}=w.useUi(),_=n.useId(),[a,c]=n.useState(u),[r,b]=n.useState(!1),q=n.useRef(!1);n.useEffect(()=>{s&&!q.current&&c(u),q.current=s},[s,u]);const g=a.trim(),j=!!m&&g==="",C=i=>f==="multiline"?t.jsx(T.default,{...i,value:a,onChange:l=>c(l.target.value),placeholder:d,maxLength:x,rows:E}):t.jsx(F.default,{...i,type:f==="number"?"number":"text",value:a,onChange:l=>c(l.target.value),placeholder:d,maxLength:x}),U=async()=>{if(!(j||r)){b(!0);try{await p(g),o()}catch{}finally{b(!1)}}};return t.jsx(N.default,{isOpen:s,onClose:o,title:y,closeLabel:P??(e==null?void 0:e.close),description:R,size:"sm",isDismissable:!r,footer:t.jsxs(t.Fragment,{children:[t.jsx(S.default,{variant:D.default.SECONDARY,size:h.default.MEDIUM,onClick:o,disabled:r,children:v.resolveLabel("PromptDialog.cancelLabel",L,e==null?void 0:e.cancel)}),t.jsx(S.default,{type:"submit",form:_,variant:D.default.PRIMARY,size:h.default.MEDIUM,disabled:j,isLoading:r,children:v.resolveLabel("PromptDialog.submitLabel",M,e==null?void 0:e.submit)})]}),children:t.jsx("form",{id:_,className:Y.default.form,onSubmit:i=>{i.preventDefault(),U()},children:t.jsx(A.default,{label:I,hint:z,isRequired:m,requiredLabel:B,children:C})})})},G=n.memo(k);exports.default=G;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("react/jsx-runtime"),t=require("react"),e=require("../../constants/scale.constants.cjs"),o=require("../../helpers/component.helper.cjs"),a=require("../ScaledInput/index.cjs"),c=t.forwardRef(({unitDigits:n,unit:i,...r},s)=>u.jsx(a.default,{ref:s,...r,scaleDigits:e.QTY4_DIGITS,maxFractionDigits:Math.min(n,e.QTY4_DIGITS),suffix:i})),l=t.memo(o.named(c,"QuantityInput"));exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),t=require("react"),e=require("../../constants/scale.constants.cjs"),u=require("../../helpers/component.helper.cjs"),a=require("../ScaledInput/index.cjs"),c=t.forwardRef(({unitDigits:n,unit:i,...s},o)=>r.jsx(a.default,{ref:o,...s,scaleDigits:e.QTY4_DIGITS,maxFractionDigits:Math.min(n,e.QTY4_DIGITS),suffix:i})),l=t.memo(u.named(c,"QuantityInput"));exports.default=l;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),t=require("react"),e=require("../../constants/scale.constants.cjs"),i=require("../../helpers/component.helper.cjs"),o=require("../ScaledInput/index.cjs"),u=t.forwardRef((n,r)=>s.jsx(o.default,{ref:r,...n,scaleDigits:e.RATE6_DIGITS,minFractionDigits:e.RATE_MIN_SHOWN_DIGITS})),c=t.memo(i.named(u,"RateInput"));exports.default=c;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),t=require("react"),e=require("../../constants/scale.constants.cjs"),s=require("../../helpers/component.helper.cjs"),i=require("../ScaledInput/index.cjs"),c=t.forwardRef((n,o)=>r.jsx(i.default,{ref:o,...n,scaleDigits:e.RATE6_DIGITS,minFractionDigits:e.RATE_MIN_SHOWN_DIGITS})),u=t.memo(s.named(c,"RateInput"));exports.default=u;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("react/jsx-runtime"),r=require("react"),A=require("../../helpers/class-name.helper.cjs"),U=require("../../helpers/component.helper.cjs"),G=require("../../helpers/ref.helper.cjs"),s=require("../../helpers/scaled-number.helper.cjs"),O=require("../Input/index.cjs"),P={default:{"scaled":"ui-scaled-5yp41"}},V=r.forwardRef(({value:c,onChange:S,scaleDigits:n,maxFractionDigits:x=n,minFractionDigits:b=0,min:f=0,max:E=Number.MAX_SAFE_INTEGER,className:I,onFocus:i,onBlur:d,onKeyDown:o,"aria-invalid":N,...h},v)=>{const[t,m]=r.useState(null),[l,_]=r.useState(!1),q=r.useRef(null),M=r.useCallback(e=>{q.current=e,G.assignRef(v,e)},[v]);r.useEffect(()=>{var e;l&&((e=q.current)==null||e.select())},[l]);const T=(e,u)=>e===null||!Number.isSafeInteger(e)?"":s.formatScaledValue(e,{scaleDigits:n,minFractionDigits:b,isGrouped:u}),p=t!==null&&t.value===c,j=p?t.text:T(c,!l),C=!l&&p&&t.value===null&&t.text!=="",g=e=>s.readScaledText(e,{scaleDigits:n,maxFractionDigits:x,min:f,max:E}),R=()=>{if(p){if(t.value!==null&&t.value<f){S(f),m(null);return}(t.value!==null||t.text==="")&&m(null)}};return k.jsx(O.default,{ref:M,...h,className:A.cx(P.default.scaled,I),value:j,inputMode:x>0?"decimal":"numeric",autoComplete:"off","aria-invalid":C||N,onChange:e=>{const u=s.cleanScaledText(e.target.value),a=g(u);a!==s.REFUSED&&(m({text:u,value:a}),a!==c&&S(a))},onFocus:e=>{_(!0),i==null||i(e)},onBlur:e=>{_(!1),R(),d==null||d(e)},onKeyDown:e=>{e.key==="Enter"&&R(),o==null||o(e)}})}),X=r.memo(U.named(V,"ScaledInput"));exports.default=X;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const k=require("react/jsx-runtime"),r=require("react"),A=require("../../helpers/class-name.helper.cjs"),U=require("../../helpers/component.helper.cjs"),G=require("../../helpers/ref.helper.cjs"),s=require("../../helpers/scaled-number.helper.cjs"),O=require("../Input/index.cjs"),P={default:{"scaled":"ui-scaled-5yp41"}},V=r.forwardRef(({value:n,onChange:S,scaleDigits:c,maxFractionDigits:_=c,minFractionDigits:b=0,min:f=0,max:E=Number.MAX_SAFE_INTEGER,className:I,onFocus:i,onBlur:d,onKeyDown:o,"aria-invalid":N,...h},x)=>{const[t,m]=r.useState(null),[u,v]=r.useState(!1),q=r.useRef(null),M=r.useCallback(e=>{q.current=e,G.assignRef(x,e)},[x]);r.useEffect(()=>{var e;u&&((e=q.current)==null||e.select())},[u]);const T=(e,l)=>e===null||!Number.isSafeInteger(e)?"":s.formatScaledValue(e,{scaleDigits:c,minFractionDigits:b,isGrouped:l}),p=t!==null&&t.value===n,j=p?t.text:T(n,!u),C=!u&&p&&t.value===null&&t.text!=="",g=e=>s.readScaledText(e,{scaleDigits:c,maxFractionDigits:_,min:f,max:E}),R=()=>{if(p){if(t.value!==null&&t.value<f){S(f),m(null);return}(t.value!==null||t.text==="")&&m(null)}};return k.jsx(O.default,{ref:M,...h,className:A.cx(P.default.scaled,I),value:j,inputMode:_>0?"decimal":"numeric",autoComplete:"off","aria-invalid":C||N,onChange:e=>{const l=s.cleanScaledText(e.target.value),a=g(l);a!==s.REFUSED&&(m({text:l,value:a}),a!==n&&S(a))},onFocus:e=>{v(!0),i==null||i(e)},onBlur:e=>{v(!1),R(),d==null||d(e)},onKeyDown:e=>{e.key==="Enter"&&R(),o==null||o(e)}})}),X=r.memo(U.named(V,"ScaledInput"));exports.default=X;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),n=require("react"),h=require("../../helpers/class-name.helper.cjs"),e={default:{"header":"ui-header-a08Jh","header__text":"ui-header__text-ArJkA","header__overline":"ui-header__overline-X5Epo","header__title":"ui-header__title-nQQQJ","header__description":"ui-header__description-08oCr","header__action":"ui-header__action-xsxQF","header--sm":"ui-header--sm-mIJWZ","header--lg":"ui-header--lg-QBLIz"}},o=({title:r,description:s,overline:d,action:t,as:l="h2",size:c="md",className:i,testId:u})=>a.jsxs("header",{className:h.cx(e.default.header,e.default[`header--${c}`],i),"data-testid":u,children:[a.jsxs("div",{className:e.default.header__text,children:[d&&a.jsx("span",{className:e.default.header__overline,children:d}),a.jsx(l,{className:e.default.header__title,children:r}),s&&a.jsx("p",{className:e.default.header__description,children:s})]}),t&&a.jsx("div",{className:e.default.header__action,children:t})]}),_=n.memo(o);exports.default=_;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),_=require("react"),r=require("../../helpers/class-name.helper.cjs"),e={default:{"header":"ui-header-a08Jh","header__text":"ui-header__text-ArJkA","header__overline":"ui-header__overline-X5Epo","header__overline--as-written":"ui-header__overline--as-written-gc4XJ","header__title":"ui-header__title-nQQQJ","header__description":"ui-header__description-08oCr","header__action":"ui-header__action-xsxQF","header--sm":"ui-header--sm-mIJWZ","header--lg":"ui-header--lg-QBLIz"}},o=({title:l,description:s,overline:d,isOverlineUppercase:c=!0,action:t,as:i="h2",size:u="md",className:n,testId:h})=>a.jsxs("header",{className:r.cx(e.default.header,e.default[`header--${u}`],n),"data-testid":h,children:[a.jsxs("div",{className:e.default.header__text,children:[d&&a.jsx("span",{className:r.cx(e.default.header__overline,!c&&e.default["header__overline--as-written"]),children:d}),a.jsx(i,{className:e.default.header__title,children:l}),s&&a.jsx("p",{className:e.default.header__description,children:s})]}),t&&a.jsx("div",{className:e.default.header__action,children:t})]}),m=_.memo(o);exports.default=m;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../../src/components/SectionHeader/index.tsx"],"sourcesContent":["import { type FC, memo, type ReactNode } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n title: string;\n description?: string;\n /** Üstte gösterilen küçük büyük-harf etiket. */\n overline?: string;\n /** Sağda gösterilen eylem (\"Tümünü gör\"). */\n action?: ReactNode;\n as?: 'h1' | 'h2' | 'h3';\n size?: 'sm' | 'md' | 'lg';\n className?: string;\n testId?: string;\n};\n\n/** Bölüm başlığı. */\nconst SectionHeader: FC<Props> = ({\n title,\n description,\n overline,\n action,\n as: Heading = 'h2',\n size = 'md',\n className,\n testId,\n}) => (\n <header className={cx(styles.header, styles[`header--${size}`], className)} data-testid={testId}>\n <div className={styles.header__text}>\n {overline && <span className={styles.header__overline}>{overline}</span>}\n <Heading className={styles.header__title}>{title}</Heading>\n {description && <p className={styles.header__description}>{description}</p>}\n </div>\n\n {action && <div className={styles.header__action}>{action}</div>}\n </header>\n);\n\nexport default /*#__PURE__*/ memo(SectionHeader) as typeof SectionHeader;\n"],"names":["SectionHeader","title","description","overline","action","Heading","size","className","testId","jsxs","cx","styles","jsx","index"],"mappings":"0PAoBMA,EAA2B,CAAC,CAChC,MAAAC,EACA,YAAAC,EACA,SAAAC,EACA,OAAAC,EACA,GAAIC,EAAU,KACd,KAAAC,EAAO,KACP,UAAAC,EACA,OAAAC,CACF,IACEC,EAAAA,KAAC,SAAA,CAAO,UAAWC,EAAAA,GAAGC,EAAAA,QAAO,OAAQA,EAAAA,QAAO,WAAWL,CAAI,EAAE,EAAGC,CAAS,EAAG,cAAaC,EACvF,SAAA,CAAAC,EAAAA,KAAC,MAAA,CAAI,UAAWE,EAAAA,QAAO,aACpB,SAAA,CAAAR,GAAYS,EAAAA,IAAC,OAAA,CAAK,UAAWD,EAAAA,QAAO,iBAAmB,SAAAR,EAAS,EACjES,EAAAA,IAACP,EAAA,CAAQ,UAAWM,EAAAA,QAAO,cAAgB,SAAAV,EAAM,EAChDC,GAAeU,EAAAA,IAAC,IAAA,CAAE,UAAWD,EAAAA,QAAO,oBAAsB,SAAAT,CAAA,CAAY,CAAA,EACzE,EAECE,GAAUQ,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,eAAiB,SAAAP,CAAA,CAAO,CAAA,EAC5D,EAGFS,SAAkCb,CAAa"}
1
+ {"version":3,"file":"index.cjs","sources":["../../../src/components/SectionHeader/index.tsx"],"sourcesContent":["import { type FC, memo, type ReactNode } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n title: string;\n description?: string;\n /** Üstte gösterilen küçük büyük-harf etiket. */\n overline?: string;\n /** The overline in capitals by CSS (default); `false` keeps a brand or proper name as written (3.2.1). */\n isOverlineUppercase?: boolean;\n /** Sağda gösterilen eylem (\"Tümünü gör\"). */\n action?: ReactNode;\n as?: 'h1' | 'h2' | 'h3';\n size?: 'sm' | 'md' | 'lg';\n className?: string;\n testId?: string;\n};\n\n/** Bölüm başlığı. */\nconst SectionHeader: FC<Props> = ({\n title,\n description,\n overline,\n isOverlineUppercase = true,\n action,\n as: Heading = 'h2',\n size = 'md',\n className,\n testId,\n}) => (\n <header className={cx(styles.header, styles[`header--${size}`], className)} data-testid={testId}>\n <div className={styles.header__text}>\n {overline && (\n <span\n className={cx(\n styles.header__overline,\n !isOverlineUppercase && styles['header__overline--as-written'],\n )}\n >\n {overline}\n </span>\n )}\n <Heading className={styles.header__title}>{title}</Heading>\n {description && <p className={styles.header__description}>{description}</p>}\n </div>\n\n {action && <div className={styles.header__action}>{action}</div>}\n </header>\n);\n\nexport default /*#__PURE__*/ memo(SectionHeader) as typeof SectionHeader;\n"],"names":["SectionHeader","title","description","overline","isOverlineUppercase","action","Heading","size","className","testId","jsxs","cx","styles","jsx","index"],"mappings":"0PAsBMA,EAA2B,CAAC,CAChC,MAAAC,EACA,YAAAC,EACA,SAAAC,EACA,oBAAAC,EAAsB,GACtB,OAAAC,EACA,GAAIC,EAAU,KACd,KAAAC,EAAO,KACP,UAAAC,EACA,OAAAC,CACF,IACEC,EAAAA,KAAC,SAAA,CAAO,UAAWC,EAAAA,GAAGC,EAAAA,QAAO,OAAQA,EAAAA,QAAO,WAAWL,CAAI,EAAE,EAAGC,CAAS,EAAG,cAAaC,EACvF,SAAA,CAAAC,EAAAA,KAAC,MAAA,CAAI,UAAWE,EAAAA,QAAO,aACpB,SAAA,CAAAT,GACCU,EAAAA,IAAC,OAAA,CACC,UAAWF,EAAAA,GACTC,EAAAA,QAAO,iBACP,CAACR,GAAuBQ,EAAAA,QAAO,8BAA8B,CAAA,EAG9D,SAAAT,CAAA,CAAA,EAGLU,EAAAA,IAACP,EAAA,CAAQ,UAAWM,EAAAA,QAAO,cAAgB,SAAAX,EAAM,EAChDC,GAAeW,EAAAA,IAAC,IAAA,CAAE,UAAWD,EAAAA,QAAO,oBAAsB,SAAAV,CAAA,CAAY,CAAA,EACzE,EAECG,GAAUQ,EAAAA,IAAC,MAAA,CAAI,UAAWD,EAAAA,QAAO,eAAiB,SAAAP,CAAA,CAAO,CAAA,EAC5D,EAGFS,SAAkCd,CAAa"}
@@ -4,6 +4,8 @@ type Props = {
4
4
  description?: string;
5
5
  /** Üstte gösterilen küçük büyük-harf etiket. */
6
6
  overline?: string;
7
+ /** The overline in capitals by CSS (default); `false` keeps a brand or proper name as written (3.2.1). */
8
+ isOverlineUppercase?: boolean;
7
9
  /** Sağda gösterilen eylem ("Tümünü gör"). */
8
10
  action?: ReactNode;
9
11
  as?: 'h1' | 'h2' | 'h3';
@@ -4,6 +4,8 @@ type Props = {
4
4
  description?: string;
5
5
  /** Üstte gösterilen küçük büyük-harf etiket. */
6
6
  overline?: string;
7
+ /** The overline in capitals by CSS (default); `false` keeps a brand or proper name as written (3.2.1). */
8
+ isOverlineUppercase?: boolean;
7
9
  /** Sağda gösterilen eylem ("Tümünü gör"). */
8
10
  action?: ReactNode;
9
11
  as?: 'h1' | 'h2' | 'h3';
@@ -1,24 +1,34 @@
1
- import { jsxs as m, jsx as a } from "react/jsx-runtime";
2
- import { memo as o } from "react";
3
- import { cx as n } from "../../helpers/class-name.helper.js";
4
- const e = {"header":"ui-header-a08Jh","header__text":"ui-header__text-ArJkA","header__overline":"ui-header__overline-X5Epo","header__title":"ui-header__title-nQQQJ","header__description":"ui-header__description-08oCr","header__action":"ui-header__action-xsxQF","header--sm":"ui-header--sm-mIJWZ","header--lg":"ui-header--lg-QBLIz"};
5
- const _ = ({
6
- title: t,
1
+ import { jsxs as t, jsx as a } from "react/jsx-runtime";
2
+ import { memo as _ } from "react";
3
+ import { cx as i } from "../../helpers/class-name.helper.js";
4
+ const e = {"header":"ui-header-a08Jh","header__text":"ui-header__text-ArJkA","header__overline":"ui-header__overline-X5Epo","header__overline--as-written":"ui-header__overline--as-written-gc4XJ","header__title":"ui-header__title-nQQQJ","header__description":"ui-header__description-08oCr","header__action":"ui-header__action-xsxQF","header--sm":"ui-header--sm-mIJWZ","header--lg":"ui-header--lg-QBLIz"};
5
+ const p = ({
6
+ title: m,
7
7
  description: r,
8
8
  overline: s,
9
+ isOverlineUppercase: c = !0,
9
10
  action: d,
10
- as: c = "h2",
11
- size: i = "md",
12
- className: h,
13
- testId: l
14
- }) => /* @__PURE__ */ m("header", { className: n(e.header, e[`header--${i}`], h), "data-testid": l, children: [
15
- /* @__PURE__ */ m("div", { className: e.header__text, children: [
16
- s && /* @__PURE__ */ a("span", { className: e.header__overline, children: s }),
17
- /* @__PURE__ */ a(c, { className: e.header__title, children: t }),
11
+ as: h = "h2",
12
+ size: l = "md",
13
+ className: o,
14
+ testId: n
15
+ }) => /* @__PURE__ */ t("header", { className: i(e.header, e[`header--${l}`], o), "data-testid": n, children: [
16
+ /* @__PURE__ */ t("div", { className: e.header__text, children: [
17
+ s && /* @__PURE__ */ a(
18
+ "span",
19
+ {
20
+ className: i(
21
+ e.header__overline,
22
+ !c && e["header__overline--as-written"]
23
+ ),
24
+ children: s
25
+ }
26
+ ),
27
+ /* @__PURE__ */ a(h, { className: e.header__title, children: m }),
18
28
  r && /* @__PURE__ */ a("p", { className: e.header__description, children: r })
19
29
  ] }),
20
30
  d && /* @__PURE__ */ a("div", { className: e.header__action, children: d })
21
- ] }), j = /* @__PURE__ */ o(_);
31
+ ] }), j = /* @__PURE__ */ _(p);
22
32
  export {
23
33
  j as default
24
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/SectionHeader/index.tsx"],"sourcesContent":["import { type FC, memo, type ReactNode } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n title: string;\n description?: string;\n /** Üstte gösterilen küçük büyük-harf etiket. */\n overline?: string;\n /** Sağda gösterilen eylem (\"Tümünü gör\"). */\n action?: ReactNode;\n as?: 'h1' | 'h2' | 'h3';\n size?: 'sm' | 'md' | 'lg';\n className?: string;\n testId?: string;\n};\n\n/** Bölüm başlığı. */\nconst SectionHeader: FC<Props> = ({\n title,\n description,\n overline,\n action,\n as: Heading = 'h2',\n size = 'md',\n className,\n testId,\n}) => (\n <header className={cx(styles.header, styles[`header--${size}`], className)} data-testid={testId}>\n <div className={styles.header__text}>\n {overline && <span className={styles.header__overline}>{overline}</span>}\n <Heading className={styles.header__title}>{title}</Heading>\n {description && <p className={styles.header__description}>{description}</p>}\n </div>\n\n {action && <div className={styles.header__action}>{action}</div>}\n </header>\n);\n\nexport default /*#__PURE__*/ memo(SectionHeader) as typeof SectionHeader;\n"],"names":["SectionHeader","title","description","overline","action","Heading","size","className","testId","jsxs","cx","styles","jsx","index"],"mappings":";;;;AAoBA,MAAMA,IAA2B,CAAC;AAAA,EAChC,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,QAAAC;AAAA,EACA,IAAIC,IAAU;AAAA,EACd,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,QAAAC;AACF,MACE,gBAAAC,EAAC,UAAA,EAAO,WAAWC,EAAGC,EAAO,QAAQA,EAAO,WAAWL,CAAI,EAAE,GAAGC,CAAS,GAAG,eAAaC,GACvF,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWE,EAAO,cACpB,UAAA;AAAA,IAAAR,KAAY,gBAAAS,EAAC,QAAA,EAAK,WAAWD,EAAO,kBAAmB,UAAAR,GAAS;AAAA,IACjE,gBAAAS,EAACP,GAAA,EAAQ,WAAWM,EAAO,eAAgB,UAAAV,GAAM;AAAA,IAChDC,KAAe,gBAAAU,EAAC,KAAA,EAAE,WAAWD,EAAO,qBAAsB,UAAAT,EAAA,CAAY;AAAA,EAAA,GACzE;AAAA,EAECE,KAAU,gBAAAQ,EAAC,OAAA,EAAI,WAAWD,EAAO,gBAAiB,UAAAP,EAAA,CAAO;AAAA,GAC5D,GAGFS,sBAAkCb,CAAa;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/SectionHeader/index.tsx"],"sourcesContent":["import { type FC, memo, type ReactNode } from 'react';\n\nimport { cx } from '../../helpers/class-name.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = {\n title: string;\n description?: string;\n /** Üstte gösterilen küçük büyük-harf etiket. */\n overline?: string;\n /** The overline in capitals by CSS (default); `false` keeps a brand or proper name as written (3.2.1). */\n isOverlineUppercase?: boolean;\n /** Sağda gösterilen eylem (\"Tümünü gör\"). */\n action?: ReactNode;\n as?: 'h1' | 'h2' | 'h3';\n size?: 'sm' | 'md' | 'lg';\n className?: string;\n testId?: string;\n};\n\n/** Bölüm başlığı. */\nconst SectionHeader: FC<Props> = ({\n title,\n description,\n overline,\n isOverlineUppercase = true,\n action,\n as: Heading = 'h2',\n size = 'md',\n className,\n testId,\n}) => (\n <header className={cx(styles.header, styles[`header--${size}`], className)} data-testid={testId}>\n <div className={styles.header__text}>\n {overline && (\n <span\n className={cx(\n styles.header__overline,\n !isOverlineUppercase && styles['header__overline--as-written'],\n )}\n >\n {overline}\n </span>\n )}\n <Heading className={styles.header__title}>{title}</Heading>\n {description && <p className={styles.header__description}>{description}</p>}\n </div>\n\n {action && <div className={styles.header__action}>{action}</div>}\n </header>\n);\n\nexport default /*#__PURE__*/ memo(SectionHeader) as typeof SectionHeader;\n"],"names":["SectionHeader","title","description","overline","isOverlineUppercase","action","Heading","size","className","testId","jsxs","cx","styles","jsx","index"],"mappings":";;;;AAsBA,MAAMA,IAA2B,CAAC;AAAA,EAChC,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,qBAAAC,IAAsB;AAAA,EACtB,QAAAC;AAAA,EACA,IAAIC,IAAU;AAAA,EACd,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,QAAAC;AACF,MACE,gBAAAC,EAAC,UAAA,EAAO,WAAWC,EAAGC,EAAO,QAAQA,EAAO,WAAWL,CAAI,EAAE,GAAGC,CAAS,GAAG,eAAaC,GACvF,UAAA;AAAA,EAAA,gBAAAC,EAAC,OAAA,EAAI,WAAWE,EAAO,cACpB,UAAA;AAAA,IAAAT,KACC,gBAAAU;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWF;AAAA,UACTC,EAAO;AAAA,UACP,CAACR,KAAuBQ,EAAO,8BAA8B;AAAA,QAAA;AAAA,QAG9D,UAAAT;AAAA,MAAA;AAAA,IAAA;AAAA,IAGL,gBAAAU,EAACP,GAAA,EAAQ,WAAWM,EAAO,eAAgB,UAAAX,GAAM;AAAA,IAChDC,KAAe,gBAAAW,EAAC,KAAA,EAAE,WAAWD,EAAO,qBAAsB,UAAAV,EAAA,CAAY;AAAA,EAAA,GACzE;AAAA,EAECG,KAAU,gBAAAQ,EAAC,OAAA,EAAI,WAAWD,EAAO,gBAAiB,UAAAP,EAAA,CAAO;AAAA,GAC5D,GAGFS,sBAAkCd,CAAa;"}
@@ -1 +1 @@
1
- @layer ui{.ui-header-a08Jh{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hd-space-4);flex-wrap:wrap}.ui-header__text-ArJkA{display:flex;flex-direction:column;gap:var(--hd-space-1);min-width:0}.ui-header__overline-X5Epo{font-family:var(--hd-font-body);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);letter-spacing:.045em;text-transform:uppercase;color:var(--hd-text-2)}.ui-header__title-nQQQJ{font-family:var(--hd-font-display);font-size:var(--hd-type-h3-size);font-weight:var(--hd-type-h3-weight);font-stretch:var(--hd-type-h3-stretch);line-height:var(--hd-type-h3-line-height);letter-spacing:var(--hd-type-h3-letter-spacing);color:var(--hd-text);margin:0}.ui-header__description-08oCr{font-size:var(--hd-type-small-size);color:var(--hd-text-2);line-height:var(--hd-type-body-line-height);max-width:68ch;margin:0}.ui-header__action-xsxQF{flex-shrink:0}.ui-header--sm-mIJWZ .ui-header__title-nQQQJ{font-size:var(--hd-type-h4-size)}.ui-header--lg-QBLIz .ui-header__title-nQQQJ{font-size:var(--hd-type-h2-size)}}
1
+ @layer ui{.ui-header-a08Jh{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hd-space-4);flex-wrap:wrap}.ui-header__text-ArJkA{display:flex;flex-direction:column;gap:var(--hd-space-1);min-width:0}.ui-header__overline-X5Epo{font-family:var(--hd-font-body);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);letter-spacing:.045em;text-transform:uppercase;color:var(--hd-text-2)}.ui-header__overline--as-written-gc4XJ{letter-spacing:normal;text-transform:none}.ui-header__title-nQQQJ{font-family:var(--hd-font-display);font-size:var(--hd-type-h3-size);font-weight:var(--hd-type-h3-weight);font-stretch:var(--hd-type-h3-stretch);line-height:var(--hd-type-h3-line-height);letter-spacing:var(--hd-type-h3-letter-spacing);color:var(--hd-text);margin:0}.ui-header__description-08oCr{font-size:var(--hd-type-small-size);color:var(--hd-text-2);line-height:var(--hd-type-body-line-height);max-width:68ch;margin:0}.ui-header__action-xsxQF{flex-shrink:0}.ui-header--sm-mIJWZ .ui-header__title-nQQQJ{font-size:var(--hd-type-h4-size)}.ui-header--lg-QBLIz .ui-header__title-nQQQJ{font-size:var(--hd-type-h2-size)}}
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),n=require("react"),ae=require("react-dom"),U=require("react-bootstrap-icons"),se=require("../../hooks/useListboxNavigation.cjs"),oe=require("../../hooks/usePortalSurface.cjs"),ie=require("../../hooks/usePositioning.cjs"),le=require("../../constants/breakpoint.constants.cjs"),v=require("../../helpers/class-name.helper.cjs"),ce=require("../../helpers/component.helper.cjs"),de=require("../../helpers/ref.helper.cjs"),ue=require("../../helpers/label.helper.cjs"),fe=require("../../theme/context.cjs"),pe=require("../BottomSheet/index.cjs"),t={default:{"select":"ui-select-tiiPL","trigger":"ui-trigger-rHQJz","trigger--empty":"ui-trigger--empty-cuinb","trigger--open":"ui-trigger--open-1nsvu","trigger--invalid":"ui-trigger--invalid-NtP0W","trigger--readOnly":"ui-trigger--readOnly-E6YX-","trigger--sm":"ui-trigger--sm-Xnu1C","trigger__icon":"ui-trigger__icon-apCcx","trigger__srName":"ui-trigger__srName-XLCxt","trigger__value":"ui-trigger__value-ioH7K","trigger__chevron":"ui-trigger__chevron-FtsIZ","trigger__chevron--open":"ui-trigger__chevron--open-1P2P-","panel":"ui-panel-rGOOd","list":"ui-list-SOKf8","list--sheet":"ui-list--sheet-BIjCb","option":"ui-option-ZDPef","option--active":"ui-option--active-R4lLF","option--selected":"ui-option--selected-glQMj","option--disabled":"ui-option--disabled-h4rdd","option__label":"ui-option__label-SsoYB","option__check":"ui-option__check-8CPSG"}},ge=({options:l,value:E,onChange:O,onBlur:R,label:q,placeholder:W,closeLabel:F,icon:C,size:H="md",align:Q="start",isDisabled:N,isReadOnly:p,id:Y,className:z,testId:G,required:J,"aria-describedby":V,"aria-invalid":D},$)=>{const{labels:u}=fe.useUi(),X=ue.resolveLabel("Select.placeholder",W,u==null?void 0:u.selectPlaceholder),Z=n.useId(),d=Y??Z,k=`${d}-listbox`,j=e=>`${d}-option-${e}`,w=n.useRef(null),x=n.useRef(null),g=n.useRef(null),ee=n.useCallback(e=>{x.current=e,de.assignRef($,e)},[$]),[a,M]=n.useState(null),y=ie.default(x,g,{side:"bottom",align:Q,isOpen:a==="popover"}),b=oe.default(a==="popover",x,g),o=a!==null,_=l.findIndex(e=>e.value===E),h=_>=0?l[_]:null,f=n.useCallback(()=>M(null),[]),S=n.useCallback(()=>{N||p||l.length===0||M(window.matchMedia(le.SHEET_MEDIA_QUERY).matches?"sheet":"popover")},[N,p,l.length]),L=e=>{e.isDisabled||(O(e.value),f())},P=n.useRef(!1);n.useEffect(()=>{var e;P.current&&!o&&((e=x.current)==null||e.focus()),P.current=o},[o]),n.useEffect(()=>{if(a!=="popover")return;const e=r=>{var c,K;const i=r.target;(c=w.current)!=null&&c.contains(i)||(K=g.current)!=null&&K.contains(i)||f()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[a,f]);const{activeIndex:m,setActiveIndex:te,listRef:I,handleKeyDown:re}=se.default({count:l.length,isOpen:o,initialIndex:_>=0?_:0,onSelect:e=>{const r=l[e];r&&L(r)},onClose:f});n.useEffect(()=>{var e;a==="sheet"&&((e=I.current)==null||e.focus({preventScroll:!0}))},[a,I]);const T=n.useRef(a);T.current=a;const ne=e=>{var i,c;if(!R||T.current==="sheet")return;const r=e.relatedTarget;r instanceof Node&&((i=w.current)!=null&&i.contains(r)||(c=g.current)!=null&&c.contains(r))||R(e)},A=e=>{if(!o){["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),S());return}re(e)},B=e=>s.jsx("ul",{ref:I,id:k,role:"listbox","aria-label":q,"aria-activedescendant":e&&l[m]?j(m):void 0,tabIndex:e?0:-1,className:v.cx(t.default.list,e&&t.default["list--sheet"]),onKeyDown:e?A:void 0,children:l.map((r,i)=>{const c=r.value===E;return s.jsxs("li",{id:j(i),role:"option","data-index":i,"aria-selected":c,"aria-disabled":r.isDisabled,className:v.cx(t.default.option,i===m&&t.default["option--active"],c&&t.default["option--selected"],r.isDisabled&&t.default["option--disabled"]),onMouseEnter:()=>te(i),onClick:()=>L(r),children:[s.jsx("span",{className:t.default.option__label,children:r.label}),c&&s.jsx(U.CheckLg,{"aria-hidden":!0,className:t.default.option__check})]},r.value)})});return s.jsxs("span",{ref:w,className:v.cx(t.default.select,z),"data-testid":G,onBlur:ne,children:[s.jsxs("button",{ref:ee,id:d,type:"button",role:"combobox",className:v.cx(t.default.trigger,t.default[`trigger--${H}`],!h&&t.default["trigger--empty"],o&&t.default["trigger--open"],D&&t.default["trigger--invalid"],p&&t.default["trigger--readOnly"]),disabled:N,"aria-haspopup":"listbox","aria-expanded":o,"aria-controls":o?k:void 0,"aria-activedescendant":a==="popover"&&l[m]?j(m):void 0,"aria-labelledby":h?`${d}-name ${d}-value`:`${d}-name`,"aria-describedby":V,"aria-invalid":D,"aria-required":J||void 0,"aria-readonly":p||void 0,onClick:()=>o?f():S(),onKeyDown:A,children:[C&&s.jsx("span",{className:t.default.trigger__icon,"aria-hidden":!0,children:C}),s.jsx("span",{id:`${d}-name`,className:t.default.trigger__srName,children:q}),s.jsx("span",{id:`${d}-value`,className:t.default.trigger__value,children:(h==null?void 0:h.label)??X}),!p&&s.jsx(U.CaretDownFill,{"aria-hidden":!0,className:v.cx(t.default.trigger__chevron,o&&t.default["trigger__chevron--open"])})]}),a==="popover"&&b.container&&ae.createPortal(s.jsx("div",{ref:g,className:t.default.panel,...b.attributes,style:{...y.style,...b.style,minWidth:y.anchorWidth||void 0,visibility:y.isPositioned?void 0:"hidden"},children:B(!1)}),b.container),a==="sheet"&&s.jsx(pe.default,{title:q,closeLabel:F??(u==null?void 0:u.close),onClose:f,children:B(!0)})]})},he=n.forwardRef(ge),me=n.memo(ce.named(he,"Select"));exports.default=me;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("react/jsx-runtime"),n=require("react"),ae=require("react-dom"),U=require("react-bootstrap-icons"),se=require("../../hooks/useListboxNavigation.cjs"),oe=require("../../hooks/usePortalSurface.cjs"),ie=require("../../hooks/usePositioning.cjs"),le=require("../../constants/breakpoint.constants.cjs"),v=require("../../helpers/class-name.helper.cjs"),ce=require("../../helpers/component.helper.cjs"),de=require("../../helpers/ref.helper.cjs"),ue=require("../../helpers/label.helper.cjs"),fe=require("../../theme/context.cjs"),pe=require("../BottomSheet/index.cjs"),t={default:{"select":"ui-select-tiiPL","trigger":"ui-trigger-rHQJz","trigger--empty":"ui-trigger--empty-cuinb","trigger--open":"ui-trigger--open-1nsvu","trigger--invalid":"ui-trigger--invalid-NtP0W","trigger--readOnly":"ui-trigger--readOnly-E6YX-","trigger--sm":"ui-trigger--sm-Xnu1C","trigger__icon":"ui-trigger__icon-apCcx","trigger__srName":"ui-trigger__srName-XLCxt","trigger__value":"ui-trigger__value-ioH7K","trigger__chevron":"ui-trigger__chevron-FtsIZ","trigger__chevron--open":"ui-trigger__chevron--open-1P2P-","panel":"ui-panel-rGOOd","list":"ui-list-SOKf8","list--sheet":"ui-list--sheet-BIjCb","option":"ui-option-ZDPef","option--active":"ui-option--active-R4lLF","option--selected":"ui-option--selected-glQMj","option--disabled":"ui-option--disabled-h4rdd","option__label":"ui-option__label-SsoYB","option__check":"ui-option__check-8CPSG"}},ge=({options:l,value:E,onChange:O,onBlur:R,label:q,placeholder:W,closeLabel:F,icon:C,size:H="md",align:Q="start",isDisabled:N,isReadOnly:p,id:Y,className:z,testId:G,required:J,"aria-describedby":V,"aria-invalid":D},k)=>{const{labels:u}=fe.useUi(),X=ue.resolveLabel("Select.placeholder",W,u==null?void 0:u.selectPlaceholder),Z=n.useId(),d=Y??Z,S=`${d}-listbox`,j=e=>`${d}-option-${e}`,w=n.useRef(null),x=n.useRef(null),g=n.useRef(null),ee=n.useCallback(e=>{x.current=e,de.assignRef(k,e)},[k]),[a,$]=n.useState(null),y=ie.default(x,g,{side:"bottom",align:Q,isOpen:a==="popover"}),b=oe.default(a==="popover",x,g),o=a!==null,_=l.findIndex(e=>e.value===E),h=_>=0?l[_]:null,f=n.useCallback(()=>$(null),[]),M=n.useCallback(()=>{N||p||l.length===0||$(window.matchMedia(le.SHEET_MEDIA_QUERY).matches?"sheet":"popover")},[N,p,l.length]),L=e=>{e.isDisabled||(O(e.value),f())},P=n.useRef(!1);n.useEffect(()=>{var e;P.current&&!o&&((e=x.current)==null||e.focus()),P.current=o},[o]),n.useEffect(()=>{if(a!=="popover")return;const e=r=>{var c,K;const i=r.target;(c=w.current)!=null&&c.contains(i)||(K=g.current)!=null&&K.contains(i)||f()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[a,f]);const{activeIndex:m,setActiveIndex:te,listRef:I,handleKeyDown:re}=se.default({count:l.length,isOpen:o,initialIndex:_>=0?_:0,onSelect:e=>{const r=l[e];r&&L(r)},onClose:f});n.useEffect(()=>{var e;a==="sheet"&&((e=I.current)==null||e.focus({preventScroll:!0}))},[a,I]);const T=n.useRef(a);T.current=a;const ne=e=>{var i,c;if(!R||T.current==="sheet")return;const r=e.relatedTarget;r instanceof Node&&((i=w.current)!=null&&i.contains(r)||(c=g.current)!=null&&c.contains(r))||R(e)},A=e=>{if(!o){["ArrowDown","ArrowUp","Enter"," "].includes(e.key)&&(e.preventDefault(),M());return}re(e)},B=e=>s.jsx("ul",{ref:I,id:S,role:"listbox","aria-label":q,"aria-activedescendant":e&&l[m]?j(m):void 0,tabIndex:e?0:-1,className:v.cx(t.default.list,e&&t.default["list--sheet"]),onKeyDown:e?A:void 0,children:l.map((r,i)=>{const c=r.value===E;return s.jsxs("li",{id:j(i),role:"option","data-index":i,"aria-selected":c,"aria-disabled":r.isDisabled,className:v.cx(t.default.option,i===m&&t.default["option--active"],c&&t.default["option--selected"],r.isDisabled&&t.default["option--disabled"]),onMouseEnter:()=>te(i),onClick:()=>L(r),children:[s.jsx("span",{className:t.default.option__label,children:r.label}),c&&s.jsx(U.CheckLg,{"aria-hidden":!0,className:t.default.option__check})]},r.value)})});return s.jsxs("span",{ref:w,className:v.cx(t.default.select,z),"data-testid":G,onBlur:ne,children:[s.jsxs("button",{ref:ee,id:d,type:"button",role:"combobox",className:v.cx(t.default.trigger,t.default[`trigger--${H}`],!h&&t.default["trigger--empty"],o&&t.default["trigger--open"],D&&t.default["trigger--invalid"],p&&t.default["trigger--readOnly"]),disabled:N,"aria-haspopup":"listbox","aria-expanded":o,"aria-controls":o?S:void 0,"aria-activedescendant":a==="popover"&&l[m]?j(m):void 0,"aria-labelledby":h?`${d}-name ${d}-value`:`${d}-name`,"aria-describedby":V,"aria-invalid":D,"aria-required":J||void 0,"aria-readonly":p||void 0,onClick:()=>o?f():M(),onKeyDown:A,children:[C&&s.jsx("span",{className:t.default.trigger__icon,"aria-hidden":!0,children:C}),s.jsx("span",{id:`${d}-name`,className:t.default.trigger__srName,children:q}),s.jsx("span",{id:`${d}-value`,className:t.default.trigger__value,children:(h==null?void 0:h.label)??X}),!p&&s.jsx(U.CaretDownFill,{"aria-hidden":!0,className:v.cx(t.default.trigger__chevron,o&&t.default["trigger__chevron--open"])})]}),a==="popover"&&b.container&&ae.createPortal(s.jsx("div",{ref:g,className:t.default.panel,...b.attributes,style:{...y.style,...b.style,minWidth:y.anchorWidth||void 0,visibility:y.isPositioned?void 0:"hidden"},children:B(!1)}),b.container),a==="sheet"&&s.jsx(pe.default,{title:q,closeLabel:F??(u==null?void 0:u.close),onClose:f,children:B(!0)})]})},he=n.forwardRef(ge),me=n.memo(ce.named(he,"Select"));exports.default=me;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,12 +1,12 @@
1
1
  "use client";
2
2
  import { jsxs as r, jsx as i } from "react/jsx-runtime";
3
- import { memo as x, forwardRef as N, useId as I } from "react";
3
+ import { forwardRef as x, useId as N, memo as I } from "react";
4
4
  import { ExclamationCircleFill as y } from "react-bootstrap-icons";
5
5
  import { idList as $ } from "../../helpers/aria.helper.js";
6
6
  import { cx as j } from "../../helpers/class-name.helper.js";
7
7
  import { named as k } from "../../helpers/component.helper.js";
8
8
  const a = {"switch":"ui-switch-KLH29","switch__input":"ui-switch__input-Q2UQ4","switch--labelFirst":"ui-switch--labelFirst-Grirk","switch__label":"ui-switch__label-gPZuO","switch__hint":"ui-switch__hint-NRuzC","switch__track":"ui-switch__track-3417m","switch__thumb":"ui-switch__thumb-1LHta","switch__text":"ui-switch__text-32uMY","switch__error":"ui-switch__error-wAjE1"};
9
- const v = N(
9
+ const v = x(
10
10
  ({
11
11
  label: n,
12
12
  hint: t,
@@ -19,7 +19,7 @@ const v = N(
19
19
  "aria-invalid": _,
20
20
  ...w
21
21
  }, f) => {
22
- const u = I(), s = h ?? u, c = `${s}-label`, l = `${s}-hint`, d = `${s}-error`;
22
+ const u = N(), s = h ?? u, c = `${s}-label`, l = `${s}-hint`, d = `${s}-error`;
23
23
  return /* @__PURE__ */ r(
24
24
  "label",
25
25
  {
@@ -53,7 +53,7 @@ const v = N(
53
53
  }
54
54
  );
55
55
  }
56
- ), q = /* @__PURE__ */ x(/* @__PURE__ */ k(v, "Switch"));
56
+ ), q = /* @__PURE__ */ I(/* @__PURE__ */ k(v, "Switch"));
57
57
  export {
58
58
  q as default
59
59
  };
@@ -1 +1 @@
1
- @layer ui{.ui-scroller-EtDmS{position:relative;overflow:auto;min-width:0;align-self:stretch;scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-scroller-EtDmS::-webkit-scrollbar{width:8px;height:8px}.ui-scroller-EtDmS::-webkit-scrollbar-track{background:transparent}.ui-scroller-EtDmS::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-scroller-EtDmS::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-scroller--frame-84zz6{border:1px solid var(--hd-border);border-radius:var(--hd-radius-md);background-color:var(--hd-bg-surface)}.ui-table-uCv4q{width:100%;border-collapse:collapse;font-size:var(--hd-type-small-size)}.ui-table-uCv4q th,.ui-table-uCv4q td{text-align:start;border-bottom:1px solid var(--hd-border)}.ui-table-uCv4q tbody tr:last-child>*{border-bottom:none}.ui-table--compact-4KCVl th,.ui-table--compact-4KCVl td{padding:var(--hd-space-2) var(--hd-space-3)}.ui-table--regular-hsA3- th,.ui-table--regular-hsA3- td{padding:var(--hd-space-3)}.ui-table--spacious-BBUX- th,.ui-table--spacious-BBUX- td{padding:var(--hd-space-3) var(--hd-space-4)}.ui-table--sticky-head-FO2L4 thead th{position:sticky;top:0;z-index:var(--hd-z-raised);background-color:var(--hd-bg-raised);font-family:var(--hd-font-body);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);text-transform:uppercase;letter-spacing:.045em;color:var(--hd-text-2);white-space:nowrap}.ui-table--row-hover--MAoe tbody tr:hover>td{background-color:var(--hd-bg-raised)}}
1
+ @layer ui{.ui-scroller-EtDmS{position:relative;overflow:auto;min-width:0;align-self:stretch;scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-scroller-EtDmS::-webkit-scrollbar{width:8px;height:8px}.ui-scroller-EtDmS::-webkit-scrollbar-track{background:transparent}.ui-scroller-EtDmS::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-scroller-EtDmS::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-scroller--frame-84zz6{border:1px solid var(--hd-border);border-radius:var(--hd-radius-md);background-color:var(--hd-bg-surface)}.ui-table-uCv4q{width:100%;border-collapse:collapse;font-size:var(--hd-type-small-size)}.ui-table-uCv4q th,.ui-table-uCv4q td{text-align:start;border-bottom:1px solid var(--hd-border)}.ui-table-uCv4q tbody tr:last-child>*{border-bottom:none}.ui-table--compact-4KCVl th,.ui-table--compact-4KCVl td{padding:var(--hd-space-2) var(--hd-space-3)}.ui-table--regular-hsA3- th,.ui-table--regular-hsA3- td{padding:var(--hd-space-3)}.ui-table--spacious-BBUX- th,.ui-table--spacious-BBUX- td{padding:var(--hd-space-3) var(--hd-space-4)}.ui-table--sticky-head-FO2L4 thead th{position:sticky;top:0;z-index:var(--hd-z-raised);background-color:var(--hd-bg-raised);font-family:var(--hd-font-body);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);text-transform:uppercase;letter-spacing:.045em;color:var(--hd-text-2);white-space:nowrap}.ui-table--row-hover--MAoe tbody tr:hover>td{background-color:var(--hd-bg-raised)}@media print{.ui-scroller-EtDmS{overflow:visible}.ui-table--sticky-head-FO2L4 thead th{position:static}.ui-table-uCv4q thead{display:table-header-group}.ui-table-uCv4q tr{break-inside:avoid}}}
@@ -1,2 +1,2 @@
1
- "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),n=require("react"),I=require("@handijitcom/utils"),R=require("../../helpers/class-name.helper.cjs"),K=require("../../helpers/scroll.helper.cjs"),a={default:{"tabs":"ui-tabs-l4dFE","tabs__list":"ui-tabs__list-HJvR8","tabs__tab":"ui-tabs__tab-7gDW7","tabs__tab--active":"ui-tabs__tab--active-riqNp","tabs__count":"ui-tabs__count-8JX8s","tabs__panel":"ui-tabs__panel-CPklY"}},T=({items:t,defaultTabId:w,activeId:_,onChange:i,ariaLabel:S,isManualActivation:u,className:g,testId:v})=>{var D;const d=n.useId(),[E,P]=n.useState(w??((D=t[0])==null?void 0:D.id)),h=I.isDefined(_),p=h?_:E,s=t.findIndex(e=>e.id===p),[f,y]=n.useState(s<0?0:s),$=n.useRef(null),l=t[s]??t[0],b=f>=0&&f<t.length?f:Math.max(s,0);n.useEffect(()=>{y(s<0?0:s)},[s]);const j=n.useRef(!1);n.useEffect(()=>{var e;if(!j.current){j.current=!0;return}K.scrollIntoViewIfPossible((e=$.current)==null?void 0:e.querySelector('[aria-selected="true"]'),{block:"nearest",inline:"nearest"})},[p]);const x=e=>{h||P(e),i==null||i(e)},F=e=>{var k;if(u&&(e.key==="Enter"||e.key===" ")){e.preventDefault();const N=t[b];N&&x(N.id);return}const r=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;if(r===0)return;e.preventDefault();const c=((u?b:s)+r+t.length)%t.length;y(c),u||x(t[c].id),(k=document.getElementById(`${d}-tab-${t[c].id}`))==null||k.focus()};if(t.length===0)return null;const q=I.isDefined(l==null?void 0:l.content);return o.jsxs("div",{className:R.cx(a.default.tabs,g),"data-testid":v,children:[o.jsx("div",{ref:$,className:a.default.tabs__list,role:"tablist","aria-label":S,onKeyDown:F,children:t.map(e=>{var c;const r=e.id===l.id;return o.jsxs("button",{id:`${d}-tab-${e.id}`,type:"button",role:"tab","aria-selected":r,"aria-controls":r&&q?`${d}-panel-${e.id}`:void 0,tabIndex:(u?((c=t[b])==null?void 0:c.id)===e.id:r)?0:-1,className:R.cx(a.default.tabs__tab,r&&a.default["tabs__tab--active"]),onClick:()=>x(e.id),children:[e.label,I.isDefined(e.count)&&o.jsx("span",{className:a.default.tabs__count,children:e.count})]},e.id)})}),q&&o.jsx("div",{id:`${d}-panel-${l.id}`,role:"tabpanel","aria-labelledby":`${d}-tab-${l.id}`,className:a.default.tabs__panel,tabIndex:0,children:l.content})]})},B=n.memo(T);exports.default=B;
1
+ "use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("react/jsx-runtime"),c=require("react"),v=require("@handijitcom/utils"),k=require("react-bootstrap-icons"),E=require("../../helpers/class-name.helper.cjs"),K=require("../../helpers/scroll.helper.cjs"),M=require("../IconButton/index.cjs"),a={default:{"tabs":"ui-tabs-l4dFE","tabs__bar":"ui-tabs__bar-acfKk","tabs__list":"ui-tabs__list-HJvR8","tabs__scroll":"ui-tabs__scroll-FW47o","tabs__scroll--start":"ui-tabs__scroll--start-dso-7","tabs__scroll--end":"ui-tabs__scroll--end-dudGA","tabs__scrollIcon":"ui-tabs__scrollIcon-7Jw46","tabs__tab":"ui-tabs__tab-7gDW7","tabs__tab--active":"ui-tabs__tab--active-riqNp","tabs__count":"ui-tabs__count-8JX8s","tabs__panel":"ui-tabs__panel-CPklY"}},P=24,T=({items:n,defaultTabId:w,activeId:j,onChange:x,ariaLabel:L,isManualActivation:f,className:B,testId:m})=>{var R;const o=c.useId(),[z,F]=c.useState(w??((R=n[0])==null?void 0:R.id)),$=v.isDefined(j),N=$?j:z,d=n.findIndex(e=>e.id===N),[h,q]=c.useState(d<0?0:d),b=c.useRef(null),r=n[d]??n[0],I=h>=0&&h<n.length?h:Math.max(d,0);c.useEffect(()=>{q(d<0?0:d)},[d]),c.useEffect(()=>{const e=b.current;K.scrollIntoInlineView(e,e==null?void 0:e.querySelector('[aria-selected="true"]'),P)},[N]);const[_,O]=c.useState({start:!1,end:!1});c.useEffect(()=>{const e=b.current;if(!e)return;const t=()=>{const u=Math.abs(e.scrollLeft),i=u>1,S=u+e.clientWidth<e.scrollWidth-1;O(y=>y.start===i&&y.end===S?y:{start:i,end:S})};t(),e.addEventListener("scroll",t,{passive:!0});const s=typeof ResizeObserver>"u"?null:new ResizeObserver(t);return s==null||s.observe(e),()=>{e.removeEventListener("scroll",t),s==null||s.disconnect()}},[n]);const W=e=>{const t=b.current;if(!t)return;const s=getComputedStyle(t).direction==="rtl";t.scrollLeft+=e*(s?-1:1)*Math.round(t.clientWidth*2/3)},p=e=>{$||F(e),x==null||x(e)},C=e=>{var u;if(f&&(e.key==="Enter"||e.key===" ")){e.preventDefault();const i=n[I];i&&p(i.id);return}const t=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;if(t===0)return;e.preventDefault();const s=((f?I:d)+t+n.length)%n.length;q(s),f||p(n[s].id),(u=document.getElementById(`${o}-tab-${n[s].id}`))==null||u.focus()};if(n.length===0)return null;const D=v.isDefined(r==null?void 0:r.content),g=e=>l.jsx(M.default,{icon:e<0?l.jsx(k.ChevronLeft,{"aria-hidden":!0,className:a.default.tabs__scrollIcon}):l.jsx(k.ChevronRight,{"aria-hidden":!0,className:a.default.tabs__scrollIcon}),label:"",size:"sm",variant:"secondary",shape:"round",tabIndex:-1,"aria-hidden":!0,className:E.cx(a.default.tabs__scroll,a.default[`tabs__scroll--${e<0?"start":"end"}`]),onClick:()=>W(e)});return l.jsxs("div",{className:E.cx(a.default.tabs,B),"data-testid":m,children:[l.jsxs("div",{className:a.default.tabs__bar,"data-fade-start":_.start?"":void 0,"data-fade-end":_.end?"":void 0,children:[l.jsx("div",{ref:b,className:a.default.tabs__list,role:"tablist","aria-label":L,onKeyDown:C,children:n.map(e=>{var s;const t=e.id===r.id;return l.jsxs("button",{id:`${o}-tab-${e.id}`,type:"button",role:"tab","aria-selected":t,"aria-controls":t&&D?`${o}-panel-${e.id}`:void 0,tabIndex:(f?((s=n[I])==null?void 0:s.id)===e.id:t)?0:-1,className:E.cx(a.default.tabs__tab,t&&a.default["tabs__tab--active"]),onClick:()=>p(e.id),children:[e.label,v.isDefined(e.count)&&l.jsx("span",{className:a.default.tabs__count,children:e.count})]},e.id)})}),_.start&&g(-1),_.end&&g(1)]}),D&&l.jsx("div",{id:`${o}-panel-${r.id}`,role:"tabpanel","aria-labelledby":`${o}-tab-${r.id}`,className:a.default.tabs__panel,tabIndex:0,children:r.content})]})},A=c.memo(T);exports.default=A;
2
2
  //# sourceMappingURL=index.cjs.map