@handijitcom/ui 3.3.1 → 3.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +247 -0
- package/build/chat.css +1 -1
- package/build/components/AppShell/Nav.cjs +1 -1
- package/build/components/AppShell/Nav.cjs.map +1 -1
- package/build/components/AppShell/Nav.d.cts +8 -1
- package/build/components/AppShell/Nav.d.ts +8 -1
- package/build/components/AppShell/Nav.js +127 -112
- package/build/components/AppShell/Nav.js.map +1 -1
- package/build/components/AppShell/style.css +1 -1
- package/build/components/AppliedFilters/index.cjs +2 -0
- package/build/components/AppliedFilters/index.cjs.map +1 -0
- package/build/components/AppliedFilters/index.d.cts +33 -0
- package/build/components/AppliedFilters/index.d.ts +33 -0
- package/build/components/AppliedFilters/index.js +85 -0
- package/build/components/AppliedFilters/index.js.map +1 -0
- package/build/components/AppliedFilters/style.css +1 -0
- package/build/components/BrandLockup/index.cjs +2 -0
- package/build/components/BrandLockup/index.cjs.map +1 -0
- package/build/components/BrandLockup/index.d.cts +29 -0
- package/build/components/BrandLockup/index.d.ts +29 -0
- package/build/components/BrandLockup/index.js +41 -0
- package/build/components/BrandLockup/index.js.map +1 -0
- package/build/components/BrandLockup/style.css +1 -0
- package/build/components/Carousel/index.cjs +1 -1
- package/build/components/Carousel/index.cjs.map +1 -1
- package/build/components/Carousel/index.d.cts +9 -0
- package/build/components/Carousel/index.d.ts +9 -0
- package/build/components/Carousel/index.js +65 -60
- package/build/components/Carousel/index.js.map +1 -1
- package/build/components/Carousel/style.css +1 -1
- package/build/components/CodeText/CodeTextCopy.cjs +2 -0
- package/build/components/CodeText/CodeTextCopy.cjs.map +1 -0
- package/build/components/CodeText/CodeTextCopy.d.cts +11 -0
- package/build/components/CodeText/CodeTextCopy.d.ts +11 -0
- package/build/components/CodeText/CodeTextCopy.js +41 -0
- package/build/components/CodeText/CodeTextCopy.js.map +1 -0
- package/build/components/CodeText/index.cjs +2 -0
- package/build/components/CodeText/index.cjs.map +1 -0
- package/build/components/CodeText/index.d.cts +26 -0
- package/build/components/CodeText/index.d.ts +26 -0
- package/build/components/CodeText/index.js +39 -0
- package/build/components/CodeText/index.js.map +1 -0
- package/build/components/CodeText/style.css +1 -0
- package/build/components/Combobox/index.cjs +1 -1
- package/build/components/Combobox/index.cjs.map +1 -1
- package/build/components/Combobox/index.js +147 -146
- package/build/components/Combobox/index.js.map +1 -1
- package/build/components/Combobox/style.css +1 -1
- package/build/components/CompareTray/index.cjs +2 -0
- package/build/components/CompareTray/index.cjs.map +1 -0
- package/build/components/CompareTray/index.d.cts +44 -0
- package/build/components/CompareTray/index.d.ts +44 -0
- package/build/components/CompareTray/index.js +94 -0
- package/build/components/CompareTray/index.js.map +1 -0
- package/build/components/CompareTray/style.css +1 -0
- package/build/components/DataTable/index.cjs +1 -1
- package/build/components/DataTable/index.cjs.map +1 -1
- package/build/components/DataTable/index.d.cts +12 -0
- package/build/components/DataTable/index.d.ts +12 -0
- package/build/components/DataTable/index.js +120 -122
- package/build/components/DataTable/index.js.map +1 -1
- package/build/components/DataTable/style.css +1 -1
- package/build/components/Eyebrow/style.css +1 -1
- package/build/components/FacetSection/index.cjs +2 -0
- package/build/components/FacetSection/index.cjs.map +1 -0
- package/build/components/FacetSection/index.d.cts +75 -0
- package/build/components/FacetSection/index.d.ts +75 -0
- package/build/components/FacetSection/index.js +199 -0
- package/build/components/FacetSection/index.js.map +1 -0
- package/build/components/FacetSection/style.css +1 -0
- package/build/components/FacetSidebar/index.cjs +2 -0
- package/build/components/FacetSidebar/index.cjs.map +1 -0
- package/build/components/FacetSidebar/index.d.cts +35 -0
- package/build/components/FacetSidebar/index.d.ts +35 -0
- package/build/components/FacetSidebar/index.js +110 -0
- package/build/components/FacetSidebar/index.js.map +1 -0
- package/build/components/FacetSidebar/style.css +1 -0
- package/build/components/FilterToolbar/index.cjs +2 -0
- package/build/components/FilterToolbar/index.cjs.map +1 -0
- package/build/components/FilterToolbar/index.d.cts +55 -0
- package/build/components/FilterToolbar/index.d.ts +55 -0
- package/build/components/FilterToolbar/index.js +149 -0
- package/build/components/FilterToolbar/index.js.map +1 -0
- package/build/components/FilterToolbar/style.css +1 -0
- package/build/components/Gallery/index.cjs +1 -1
- package/build/components/Gallery/index.cjs.map +1 -1
- package/build/components/Gallery/index.d.cts +8 -1
- package/build/components/Gallery/index.d.ts +8 -1
- package/build/components/Gallery/index.js +146 -138
- package/build/components/Gallery/index.js.map +1 -1
- package/build/components/Gallery/style.css +1 -1
- package/build/components/MegaMenu/index.cjs +2 -0
- package/build/components/MegaMenu/index.cjs.map +1 -0
- package/build/components/MegaMenu/index.d.cts +67 -0
- package/build/components/MegaMenu/index.d.ts +67 -0
- package/build/components/MegaMenu/index.js +220 -0
- package/build/components/MegaMenu/index.js.map +1 -0
- package/build/components/MegaMenu/style.css +1 -0
- package/build/components/MoneyInput/index.cjs +1 -1
- package/build/components/MoneyInput/index.cjs.map +1 -1
- package/build/components/MoneyInput/index.js +10 -10
- package/build/components/MoneyInput/index.js.map +1 -1
- package/build/components/NotificationCenter/style.css +1 -1
- package/build/components/PageHeader/style.css +1 -1
- package/build/components/Popover/style.css +1 -1
- package/build/components/ProductCarousel/index.cjs +2 -0
- package/build/components/ProductCarousel/index.cjs.map +1 -0
- package/build/components/ProductCarousel/index.d.cts +35 -0
- package/build/components/ProductCarousel/index.d.ts +35 -0
- package/build/components/ProductCarousel/index.js +86 -0
- package/build/components/ProductCarousel/index.js.map +1 -0
- package/build/components/ProductCarousel/style.css +1 -0
- package/build/components/Radio/index.cjs +1 -1
- package/build/components/Radio/index.cjs.map +1 -1
- package/build/components/Radio/index.js +10 -10
- package/build/components/Radio/index.js.map +1 -1
- package/build/components/SectionHeader/index.cjs +1 -1
- package/build/components/SectionHeader/index.cjs.map +1 -1
- package/build/components/SectionHeader/index.js +4 -4
- package/build/components/SectionHeader/index.js.map +1 -1
- package/build/components/SectionHeader/style.css +1 -1
- package/build/components/SegmentedControl/index.cjs +1 -1
- package/build/components/SegmentedControl/index.cjs.map +1 -1
- package/build/components/SegmentedControl/index.js +23 -23
- package/build/components/SegmentedControl/index.js.map +1 -1
- package/build/components/Select/index.cjs +1 -1
- package/build/components/Select/index.cjs.map +1 -1
- package/build/components/Select/index.js +37 -37
- package/build/components/Select/index.js.map +1 -1
- package/build/components/Select/style.css +1 -1
- package/build/components/Skeleton/index.cjs +1 -1
- package/build/components/Skeleton/index.cjs.map +1 -1
- package/build/components/Skeleton/index.js +16 -16
- package/build/components/Skeleton/index.js.map +1 -1
- package/build/components/SortableList/index.cjs +2 -0
- package/build/components/SortableList/index.cjs.map +1 -0
- package/build/components/SortableList/index.d.cts +37 -0
- package/build/components/SortableList/index.d.ts +37 -0
- package/build/components/SortableList/index.js +159 -0
- package/build/components/SortableList/index.js.map +1 -0
- package/build/components/SortableList/style.css +1 -0
- package/build/components/Steps/index.cjs +1 -1
- package/build/components/Steps/index.cjs.map +1 -1
- package/build/components/Steps/index.d.cts +6 -0
- package/build/components/Steps/index.d.ts +6 -0
- package/build/components/Steps/index.js +37 -35
- package/build/components/Steps/index.js.map +1 -1
- package/build/components/Steps/style.css +1 -1
- package/build/components/StickyActionBar/index.cjs +2 -0
- package/build/components/StickyActionBar/index.cjs.map +1 -0
- package/build/components/StickyActionBar/index.d.cts +29 -0
- package/build/components/StickyActionBar/index.d.ts +29 -0
- package/build/components/StickyActionBar/index.js +57 -0
- package/build/components/StickyActionBar/index.js.map +1 -0
- package/build/components/StickyActionBar/style.css +1 -0
- package/build/components/Table/index.cjs +1 -1
- package/build/components/Table/index.cjs.map +1 -1
- package/build/components/Table/index.d.cts +6 -0
- package/build/components/Table/index.d.ts +6 -0
- package/build/components/Table/index.js +34 -32
- package/build/components/Table/index.js.map +1 -1
- package/build/components/Table/style.css +1 -1
- package/build/helpers/carousel.helper.cjs +2 -0
- package/build/helpers/carousel.helper.cjs.map +1 -0
- package/build/helpers/carousel.helper.d.cts +11 -0
- package/build/helpers/carousel.helper.d.ts +11 -0
- package/build/helpers/carousel.helper.js +10 -0
- package/build/helpers/carousel.helper.js.map +1 -0
- package/build/helpers/facet.helper.cjs +2 -0
- package/build/helpers/facet.helper.cjs.map +1 -0
- package/build/helpers/facet.helper.d.cts +6 -0
- package/build/helpers/facet.helper.d.ts +6 -0
- package/build/helpers/facet.helper.js +5 -0
- package/build/helpers/facet.helper.js.map +1 -0
- package/build/helpers/focus.helper.cjs +1 -1
- package/build/helpers/focus.helper.cjs.map +1 -1
- package/build/helpers/focus.helper.d.cts +2 -0
- package/build/helpers/focus.helper.d.ts +2 -0
- package/build/helpers/focus.helper.js +1 -0
- package/build/helpers/focus.helper.js.map +1 -1
- package/build/helpers/sortable.helper.cjs +2 -0
- package/build/helpers/sortable.helper.cjs.map +1 -0
- package/build/helpers/sortable.helper.d.cts +19 -0
- package/build/helpers/sortable.helper.d.ts +19 -0
- package/build/helpers/sortable.helper.js +20 -0
- package/build/helpers/sortable.helper.js.map +1 -0
- package/build/helpers/sticky-bar.helper.cjs +2 -0
- package/build/helpers/sticky-bar.helper.cjs.map +1 -0
- package/build/helpers/sticky-bar.helper.d.cts +6 -0
- package/build/helpers/sticky-bar.helper.d.ts +6 -0
- package/build/helpers/sticky-bar.helper.js +8 -0
- package/build/helpers/sticky-bar.helper.js.map +1 -0
- package/build/hooks/useRemovalFocus.cjs +2 -0
- package/build/hooks/useRemovalFocus.cjs.map +1 -0
- package/build/hooks/useRemovalFocus.d.cts +13 -0
- package/build/hooks/useRemovalFocus.d.ts +13 -0
- package/build/hooks/useRemovalFocus.js +21 -0
- package/build/hooks/useRemovalFocus.js.map +1 -0
- package/build/index.cjs +1 -1
- package/build/index.d.cts +13 -2
- package/build/index.d.ts +13 -2
- package/build/index.js +115 -93
- package/build/index.js.map +1 -1
- package/build/scss/_mixins.scss +3 -1
- package/build/styles.css +38 -14
- package/build/types/sortable.type.d.cts +12 -0
- package/build/types/sortable.type.d.ts +12 -0
- package/build/types/theme.type.d.cts +95 -0
- package/build/types/theme.type.d.ts +95 -0
- package/build/types/types/theme.type.d.cts +95 -0
- package/build/types/types/theme.type.d.ts +95 -0
- package/package.json +111 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer ui{.ui-menu-jtqmU{position:relative}@media (max-width: 1024px){.ui-menu-jtqmU{display:none}}.ui-menu__bar-UfVrS{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hd-space-1);margin:0;padding:0;list-style:none}.ui-menu__entry-HlGup{flex-shrink:0}.ui-top-3IV6E{display:flex;align-items:center;gap:var(--hd-space-2);min-height:40px;padding:var(--hd-space-2) var(--hd-space-3);border:none;border-radius:var(--hd-radius-sm);background:none;color:var(--hd-text);font-family:var(--hd-font-body);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-medium);text-decoration:none;white-space:nowrap;cursor:pointer;background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-top-3IV6E:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-top-3IV6E:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-top-3IV6E{transition:none}.ui-top-3IV6E:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-top-3IV6E:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-top--active-Dyxdn{color:var(--hd-primary-text);font-weight:var(--hd-font-weight-semibold);box-shadow:inset 0 -2px 0 var(--hd-primary)}.ui-top--open-tZfGv{background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-top__icon-pJ4qx{display:inline-flex;font-size:16px;color:var(--hd-text-2)}.ui-top__chevron-Q78lv{font-size:14px;color:var(--hd-text-2);transition:rotate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-top--open-tZfGv .ui-top__chevron-Q78lv{rotate:180deg}@media (prefers-reduced-motion: reduce){.ui-top__chevron-Q78lv{transition:none}}.ui-panel-5tVKC{position:absolute;inset-inline:0;top:calc(100% + var(--hd-space-1));z-index:var(--hd-z-dropdown);display:grid;grid-template-columns:1fr auto;gap:var(--hd-space-4) var(--hd-space-6);padding:var(--hd-space-5) var(--hd-space-6);border:1px solid var(--hd-border);border-radius:var(--hd-radius-md);background-color:var(--hd-bg-overlay);box-shadow:var(--hd-shadow-3);animation:var(--ui-anim-fade-in-down) var(--hd-duration-fast) var(--hd-ease-enter)}@media (prefers-reduced-motion: reduce){.ui-panel-5tVKC{animation:none}}.ui-panel-5tVKC[hidden]{display:none}.ui-panel__columns-FIEC2{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:var(--hd-space-5) var(--hd-space-6);min-width:0}.ui-panel__feature-UpJps{width:280px;min-width:0}.ui-panel__all-P8gKX{grid-column:1/-1;justify-self:start;border-radius:var(--hd-radius-xs);color:var(--hd-primary-text);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-semibold);text-decoration:none}.ui-panel__all-P8gKX:hover{text-decoration:underline}.ui-panel__all-P8gKX:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, 2px)}.ui-column-XjUAF{display:flex;flex-direction:column;gap:var(--hd-space-2);min-width:0}.ui-column__title-vUwA-{font-family:var(--ui-overline-font, 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);margin:0}.ui-column__link-hbfhD{color:inherit;text-decoration:none;border-radius:var(--hd-radius-xs)}.ui-column__link-hbfhD:hover{color:var(--hd-primary-text)}.ui-column__link-hbfhD:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, 2px)}.ui-column__list-2Lfk1{display:flex;flex-direction:column;gap:2px;margin:0 calc(-1 * var(--hd-space-2));padding:0;list-style:none}.ui-link-rgH63{display:flex;align-items:center;gap:var(--hd-space-3);padding:var(--hd-space-2);border-radius:var(--hd-radius-sm);color:var(--hd-text);font-size:var(--hd-type-small-size);text-decoration:none;background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-link-rgH63:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-link-rgH63:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-link-rgH63{transition:none}.ui-link-rgH63:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-link-rgH63:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-link__media-GGkAB{display:inline-flex;flex-shrink:0;align-items:center;justify-content:center;width:20px;color:var(--hd-text-2);font-size:16px}.ui-link__media--image-IGyD8{width:40px;height:40px;overflow:hidden;border-radius:var(--hd-radius-sm);background-color:var(--hd-bg-raised)}.ui-link__media--image-IGyD8>img{width:100%;height:100%;object-fit:cover}.ui-link__text-DdDSW{display:flex;flex-direction:column;min-width:0}.ui-link__label-477IK{overflow-wrap:anywhere}.ui-link__description--aYQy{font-size:var(--hd-type-caption-size);color:var(--hd-text-2)}.ui-drawer-OlUga{display:flex;flex-direction:column;margin:0;padding:0;list-style:none}.ui-drawer-OlUga>li{border-block-end:1px solid var(--hd-border)}.ui-drawer__section-mhWRx{display:flex;flex-direction:column;gap:var(--hd-space-4)}.ui-drawer__link--rbtx{display:flex;align-items:center;min-height:44px;padding-inline:var(--hd-space-4);color:var(--hd-text);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-semibold);text-decoration:none;background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-drawer__link--rbtx:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-drawer__link--rbtx:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-drawer__link--rbtx{transition:none}.ui-drawer__link--rbtx:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-drawer__link--rbtx:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-drawer__link--rbtx[aria-current=page]{color:var(--hd-primary-text)}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("react/jsx-runtime"),t=require("react"),s=require("../../helpers/component.helper.cjs"),c=require("../ScaledInput/index.cjs"),i=t.forwardRef(({minorDigits:e,currency:n,...o},u)=>r.jsx(c.default,{ref:u,...o,scaleDigits:e,minFractionDigits:e,suffix:n})),a=t.memo(s.named(i,"MoneyInput"));exports.default=a;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/MoneyInput/index.tsx"],"sourcesContent":["import { forwardRef, memo, type ReactNode } from 'react';\n\nimport { named } from '../../helpers/component.helper';\nimport ScaledInput, { type ScaledInputProps } from '../ScaledInput';\n\ntype Props = Omit<\n ScaledInputProps,\n 'scaleDigits' | 'maxFractionDigits' | 'minFractionDigits' | 'suffix'\n> & {\n /**\n * The minor-unit digits of the currency — the scale of the amount (TRY, USD, EUR 2; JPY 0;\n * `HAS-G` 3). The currency table belongs to the caller.\n */\n minorDigits: number;\n /** The currency code or sign after the amount (\"TL\", \"USD\"). */\n currency?: ReactNode;\n};\n\n/**\n * Money field (2.4): takes and gives the amount in the currency's minor unit (`Kurus`) —\n * `123450` with `minorDigits={2}` reads \"1.234,50\". Every minor digit is shown at rest.\n */\nconst MoneyInput = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n ({ minorDigits, currency, ...rest }, ref) => (\n <ScaledInput\n ref={ref}\n {...rest}\n scaleDigits={minorDigits}\n minFractionDigits={minorDigits}\n suffix={currency}\n />\n ),\n);\n\nexport default /*#__PURE__*/ memo(\n /*#__PURE__*/ named(MoneyInput, 'MoneyInput'),\n) as typeof MoneyInput;\n"],"names":["MoneyInput","forwardRef","minorDigits","currency","rest","ref","jsx","ScaledInput","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/MoneyInput/index.tsx"],"sourcesContent":["import { forwardRef, memo, type ReactNode } from 'react';\n\nimport { named } from '../../helpers/component.helper';\nimport ScaledInput, { type ScaledInputProps } from '../ScaledInput';\n\ntype Props = Omit<\n ScaledInputProps,\n 'scaleDigits' | 'maxFractionDigits' | 'minFractionDigits' | 'suffix'\n> & {\n /**\n * The minor-unit digits of the currency — the scale of the amount (TRY, USD, EUR 2; JPY 0;\n * `HAS-G` 3). The currency table belongs to the caller.\n */\n minorDigits: number;\n /** The currency code or sign after the amount (\"TL\", \"USD\"). */\n currency?: ReactNode;\n};\n\n/**\n * Money field (2.4): takes and gives the amount in the currency's minor unit (`Kurus`) —\n * `123450` with `minorDigits={2}` reads \"1.234,50\". Every minor digit is shown at rest.\n */\nconst MoneyInput = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n ({ minorDigits, currency, ...rest }, ref) => (\n <ScaledInput\n ref={ref}\n {...rest}\n scaleDigits={minorDigits}\n minFractionDigits={minorDigits}\n suffix={currency}\n />\n ),\n);\n\nexport default /*#__PURE__*/ memo(\n /*#__PURE__*/ named(MoneyInput, 'MoneyInput'),\n) as typeof MoneyInput;\n"],"names":["MoneyInput","forwardRef","minorDigits","currency","rest","ref","jsx","ScaledInput","memo","named"],"mappings":"0PAsBMA,EAA2BC,EAAAA,WAC/B,CAAC,CAAE,YAAAC,EAAa,SAAAC,EAAU,GAAGC,CAAA,EAAQC,IACnCC,EAAAA,IAACC,EAAAA,QAAA,CACC,IAAAF,EACC,GAAGD,EACJ,YAAaF,EACb,kBAAmBA,EACnB,OAAQC,CAAA,CAAA,CAGd,EAEAH,EAA6BQ,EAAAA,KACbC,EAAAA,MAAMT,EAAY,YAAY,CAC9C"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { named as
|
|
4
|
-
import
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { memo as e, forwardRef as f } from "react";
|
|
3
|
+
import { named as p } from "../../helpers/component.helper.js";
|
|
4
|
+
import i from "../ScaledInput/index.js";
|
|
5
5
|
const a = /* @__PURE__ */ f(
|
|
6
|
-
({ minorDigits: o, currency: t, ...m },
|
|
7
|
-
|
|
6
|
+
({ minorDigits: o, currency: t, ...m }, n) => /* @__PURE__ */ r(
|
|
7
|
+
i,
|
|
8
8
|
{
|
|
9
|
-
ref:
|
|
9
|
+
ref: n,
|
|
10
10
|
...m,
|
|
11
11
|
scaleDigits: o,
|
|
12
12
|
minFractionDigits: o,
|
|
13
13
|
suffix: t
|
|
14
14
|
}
|
|
15
15
|
)
|
|
16
|
-
),
|
|
17
|
-
/* @__PURE__ */
|
|
16
|
+
), I = /* @__PURE__ */ e(
|
|
17
|
+
/* @__PURE__ */ p(a, "MoneyInput")
|
|
18
18
|
);
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
I as default
|
|
21
21
|
};
|
|
22
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/MoneyInput/index.tsx"],"sourcesContent":["import { forwardRef, memo, type ReactNode } from 'react';\n\nimport { named } from '../../helpers/component.helper';\nimport ScaledInput, { type ScaledInputProps } from '../ScaledInput';\n\ntype Props = Omit<\n ScaledInputProps,\n 'scaleDigits' | 'maxFractionDigits' | 'minFractionDigits' | 'suffix'\n> & {\n /**\n * The minor-unit digits of the currency — the scale of the amount (TRY, USD, EUR 2; JPY 0;\n * `HAS-G` 3). The currency table belongs to the caller.\n */\n minorDigits: number;\n /** The currency code or sign after the amount (\"TL\", \"USD\"). */\n currency?: ReactNode;\n};\n\n/**\n * Money field (2.4): takes and gives the amount in the currency's minor unit (`Kurus`) —\n * `123450` with `minorDigits={2}` reads \"1.234,50\". Every minor digit is shown at rest.\n */\nconst MoneyInput = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n ({ minorDigits, currency, ...rest }, ref) => (\n <ScaledInput\n ref={ref}\n {...rest}\n scaleDigits={minorDigits}\n minFractionDigits={minorDigits}\n suffix={currency}\n />\n ),\n);\n\nexport default /*#__PURE__*/ memo(\n /*#__PURE__*/ named(MoneyInput, 'MoneyInput'),\n) as typeof MoneyInput;\n"],"names":["MoneyInput","forwardRef","minorDigits","currency","rest","ref","jsx","ScaledInput","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/MoneyInput/index.tsx"],"sourcesContent":["import { forwardRef, memo, type ReactNode } from 'react';\n\nimport { named } from '../../helpers/component.helper';\nimport ScaledInput, { type ScaledInputProps } from '../ScaledInput';\n\ntype Props = Omit<\n ScaledInputProps,\n 'scaleDigits' | 'maxFractionDigits' | 'minFractionDigits' | 'suffix'\n> & {\n /**\n * The minor-unit digits of the currency — the scale of the amount (TRY, USD, EUR 2; JPY 0;\n * `HAS-G` 3). The currency table belongs to the caller.\n */\n minorDigits: number;\n /** The currency code or sign after the amount (\"TL\", \"USD\"). */\n currency?: ReactNode;\n};\n\n/**\n * Money field (2.4): takes and gives the amount in the currency's minor unit (`Kurus`) —\n * `123450` with `minorDigits={2}` reads \"1.234,50\". Every minor digit is shown at rest.\n */\nconst MoneyInput = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n ({ minorDigits, currency, ...rest }, ref) => (\n <ScaledInput\n ref={ref}\n {...rest}\n scaleDigits={minorDigits}\n minFractionDigits={minorDigits}\n suffix={currency}\n />\n ),\n);\n\nexport default /*#__PURE__*/ memo(\n /*#__PURE__*/ named(MoneyInput, 'MoneyInput'),\n) as typeof MoneyInput;\n"],"names":["MoneyInput","forwardRef","minorDigits","currency","rest","ref","jsx","ScaledInput","MoneyInput$1","memo","named"],"mappings":";;;;AAsBA,MAAMA,IAA2B,gBAAAC;AAAA,EAC/B,CAAC,EAAE,aAAAC,GAAa,UAAAC,GAAU,GAAGC,EAAA,GAAQC,MACnC,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,KAAAF;AAAA,MACC,GAAGD;AAAA,MACJ,aAAaF;AAAA,MACb,mBAAmBA;AAAA,MACnB,QAAQC;AAAA,IAAA;AAAA,EAAA;AAGd,GAEAK,IAA6B,gBAAAC;AAAA,EACb,gBAAAC,EAAMV,GAAY,YAAY;AAC9C;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer ui{.ui-panel-5SyKG{width:min(360px,100vw - var(--hd-space-6))}.ui-srOnly-RIBgB{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-bell-eoWEW{position:relative;display:inline-flex}.ui-badge-f-M5o{position:absolute;inset-block-start:-6px;inset-inline-end:-8px;min-width:16px;height:16px;padding-inline:4px;border-radius:var(--hd-radius-pill);background-color:var(--hd-primary);color:var(--hd-on-primary);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);line-height:16px;text-align:center;font-variant-numeric:tabular-nums;box-sizing:border-box}@media (forced-colors: active){.ui-badge-f-M5o{border:1px solid CanvasText}}.ui-header-XVQsI{display:flex;align-items:center;gap:var(--hd-space-2);justify-content:space-between;padding-block-end:var(--hd-space-2);border-bottom:1px solid var(--hd-border)}.ui-heading-coSaJ{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text);margin:0}.ui-list-qhaa9{position:relative;max-height:min(420px,60dvh);overflow-y:auto;margin-inline:calc(-1 * var(--hd-space-3));padding-inline:var(--hd-space-3);scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-list-qhaa9::-webkit-scrollbar{width:8px;height:8px}.ui-list-qhaa9::-webkit-scrollbar-track{background:transparent}.ui-list-qhaa9::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-list-qhaa9::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-day-q8cob{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);margin:0;padding-block:var(--hd-space-3) var(--hd-space-1)}.ui-items-Cy4JF{margin:0;padding:0;list-style:none}.ui-item-Gx5xM{display:flex;align-items:flex-start;gap:var(--hd-space-1);border-radius:var(--hd-radius-sm)}.ui-item__main-YzJ2w{display:flex;align-items:flex-start;gap:var(--hd-space-2);flex:1;min-width:0;padding:var(--hd-space-2);border-radius:var(--hd-radius-sm);color:var(--hd-text);text-align:start}.ui-item__main--button-0gQh7{border:none;background:none;font:inherit;cursor:pointer;background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-item__main--button-0gQh7:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-item__main--button-0gQh7:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-item__main--button-0gQh7{transition:none}.ui-item__main--button-0gQh7:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-item__main--button-0gQh7:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-item--unread-LYQ9H .ui-title-vMVcE{font-weight:var(--hd-font-weight-semibold)}.ui-item--unread-LYQ9H .ui-title-vMVcE:before{content:"";display:inline-block;width:8px;height:8px;margin-inline-end:var(--hd-space-2);border-radius:var(--hd-radius-pill);background-color:var(--hd-primary);vertical-align:middle}@media (forced-colors: active){.ui-item--unread-LYQ9H .ui-title-vMVcE:before{background-color:CanvasText}}.ui-icon-xOfOg{display:inline-flex;flex-shrink:0;padding-block-start:2px;color:var(--hd-text-2);font-size:18px}.ui-body-xDRoI{display:flex;flex-direction:column;gap:var(--hd-space-1);min-width:0}.ui-title-vMVcE{font-size:var(--hd-type-small-size);line-height:var(--hd-type-h4-line-height)}.ui-description-SuXFu{font-size:var(--hd-type-small-size);line-height:var(--hd-type-body-line-height);color:var(--hd-text-2)}.ui-time-k0R6i{font-size:var(--hd-type-caption-size);color:var(--hd-text-3)}.ui-empty-WTfI4{display:flex;flex-direction:column;gap:var(--hd-space-2);align-items:center;margin:0;padding:var(--hd-space-6) var(--hd-space-3);text-align:center;font-size:var(--hd-type-small-size);line-height:var(--hd-type-body-line-height);color:var(--hd-text-2)}.ui-empty__icon-03css{font-size:24px;color:var(--hd-text-3)}}
|
|
1
|
+
@layer ui{.ui-panel-5SyKG{width:min(360px,100vw - var(--hd-space-6))}.ui-srOnly-RIBgB{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.ui-bell-eoWEW{position:relative;display:inline-flex}.ui-badge-f-M5o{position:absolute;inset-block-start:-6px;inset-inline-end:-8px;min-width:16px;height:16px;padding-inline:4px;border-radius:var(--hd-radius-pill);background-color:var(--hd-primary);color:var(--hd-on-primary);font-size:var(--hd-type-caption-size);font-weight:var(--hd-font-weight-semibold);line-height:16px;text-align:center;font-variant-numeric:tabular-nums;box-sizing:border-box}@media (forced-colors: active){.ui-badge-f-M5o{border:1px solid CanvasText}}.ui-header-XVQsI{display:flex;align-items:center;gap:var(--hd-space-2);justify-content:space-between;padding-block-end:var(--hd-space-2);border-bottom:1px solid var(--hd-border)}.ui-heading-coSaJ{font-family:var(--hd-font-body);font-size:var(--hd-type-body-size);font-weight:var(--hd-font-weight-semibold);line-height:var(--hd-type-h4-line-height);letter-spacing:normal;color:var(--hd-text);margin:0}.ui-list-qhaa9{position:relative;max-height:min(420px,60dvh);overflow-y:auto;margin-inline:calc(-1 * var(--hd-space-3));padding-inline:var(--hd-space-3);scrollbar-width:thin;scrollbar-color:var(--hd-border-strong) transparent}.ui-list-qhaa9::-webkit-scrollbar{width:8px;height:8px}.ui-list-qhaa9::-webkit-scrollbar-track{background:transparent}.ui-list-qhaa9::-webkit-scrollbar-thumb{background-color:var(--hd-border-strong);border-radius:var(--hd-radius-pill);border:2px solid transparent;background-clip:content-box}.ui-list-qhaa9::-webkit-scrollbar-thumb:hover{background-color:var(--hd-text-3)}.ui-day-q8cob{font-family:var(--ui-overline-font, 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);margin:0;padding-block:var(--hd-space-3) var(--hd-space-1)}.ui-items-Cy4JF{margin:0;padding:0;list-style:none}.ui-item-Gx5xM{display:flex;align-items:flex-start;gap:var(--hd-space-1);border-radius:var(--hd-radius-sm)}.ui-item__main-YzJ2w{display:flex;align-items:flex-start;gap:var(--hd-space-2);flex:1;min-width:0;padding:var(--hd-space-2);border-radius:var(--hd-radius-sm);color:var(--hd-text);text-align:start}.ui-item__main--button-0gQh7{border:none;background:none;font:inherit;cursor:pointer;background-color:transparent;transition:background-color var(--hd-duration-fast) var(--hd-ease-standard),translate var(--hd-duration-fast) var(--hd-ease-standard)}.ui-item__main--button-0gQh7:hover:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 8%,transparent)}.ui-item__main--button-0gQh7:active:not(:disabled):not([aria-disabled=true]){background-color:color-mix(in srgb,var(--hd-text) 14%,transparent);translate:0 1px}@media (prefers-reduced-motion: reduce){.ui-item__main--button-0gQh7{transition:none}.ui-item__main--button-0gQh7:active:not(:disabled):not([aria-disabled=true]){translate:none}}.ui-item__main--button-0gQh7:focus-visible{outline:var(--ui-ring-width, 2px) solid var(--ui-ring-color, var(--hd-focus));outline-offset:var(--ui-ring-offset, -2px)}.ui-item--unread-LYQ9H .ui-title-vMVcE{font-weight:var(--hd-font-weight-semibold)}.ui-item--unread-LYQ9H .ui-title-vMVcE:before{content:"";display:inline-block;width:8px;height:8px;margin-inline-end:var(--hd-space-2);border-radius:var(--hd-radius-pill);background-color:var(--hd-primary);vertical-align:middle}@media (forced-colors: active){.ui-item--unread-LYQ9H .ui-title-vMVcE:before{background-color:CanvasText}}.ui-icon-xOfOg{display:inline-flex;flex-shrink:0;padding-block-start:2px;color:var(--hd-text-2);font-size:18px}.ui-body-xDRoI{display:flex;flex-direction:column;gap:var(--hd-space-1);min-width:0}.ui-title-vMVcE{font-size:var(--hd-type-small-size);line-height:var(--hd-type-h4-line-height)}.ui-description-SuXFu{font-size:var(--hd-type-small-size);line-height:var(--hd-type-body-line-height);color:var(--hd-text-2)}.ui-time-k0R6i{font-size:var(--hd-type-caption-size);color:var(--hd-text-3)}.ui-empty-WTfI4{display:flex;flex-direction:column;gap:var(--hd-space-2);align-items:center;margin:0;padding:var(--hd-space-6) var(--hd-space-3);text-align:center;font-size:var(--hd-type-small-size);line-height:var(--hd-type-body-line-height);color:var(--hd-text-2)}.ui-empty__icon-03css{font-size:24px;color:var(--hd-text-3)}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@layer ui{.ui-header-yJwus{display:flex;flex-direction:column;gap:var(--hd-space-4)}@media (max-width: 640px){.ui-header-yJwus{gap:var(--hd-space-3)}}.ui-header__top-UK4si{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hd-space-5);flex-wrap:wrap}.ui-header__breadcrumb-A2j0i{align-self:flex-start;max-inline-size:100%;min-inline-size:0}.ui-header__text-HIo8U{display:flex;flex-direction:column;gap:var(--hd-space-2);min-width:0;flex:1 1 auto}.ui-header__eyebrow-dZ9Zc{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__eyebrow--as-written-3DVyK{letter-spacing:normal;text-transform:none}.ui-header__titleRow-KgDZj{display:flex;align-items:baseline;gap:var(--hd-space-3);flex-wrap:wrap}.ui-header__title-s1giF{font-family:var(--hd-font-display);font-size:var(--hd-type-h2-size);font-weight:var(--hd-type-h2-weight);font-stretch:var(--hd-type-h2-stretch);line-height:var(--hd-type-h2-line-height);letter-spacing:var(--hd-type-h2-letter-spacing);color:var(--hd-text);text-wrap:balance;margin:0}.ui-header__meta-UxuaD{font-family:var(--hd-font-body);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-medium);color:var(--hd-text-2);font-variant-numeric:tabular-nums;white-space:nowrap}.ui-header__description-NXbbC{font-size:var(--hd-type-body-size);line-height:var(--hd-type-body-line-height);color:var(--hd-text-2);margin:0;max-width:68ch}.ui-header__actions-aShpt{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hd-space-2);flex-shrink:0}@media (max-width: 640px){.ui-header__actions-aShpt{width:100%}.ui-header__actions-aShpt>*{flex:1 1 auto}}}
|
|
1
|
+
@layer ui{.ui-header-yJwus{display:flex;flex-direction:column;gap:var(--hd-space-4)}@media (max-width: 640px){.ui-header-yJwus{gap:var(--hd-space-3)}}.ui-header__top-UK4si{display:flex;align-items:flex-end;justify-content:space-between;gap:var(--hd-space-5);flex-wrap:wrap}.ui-header__breadcrumb-A2j0i{align-self:flex-start;max-inline-size:100%;min-inline-size:0}.ui-header__text-HIo8U{display:flex;flex-direction:column;gap:var(--hd-space-2);min-width:0;flex:1 1 auto}.ui-header__eyebrow-dZ9Zc{font-family:var(--ui-overline-font, 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__eyebrow--as-written-3DVyK{letter-spacing:normal;text-transform:none}.ui-header__titleRow-KgDZj{display:flex;align-items:baseline;gap:var(--hd-space-3);flex-wrap:wrap}.ui-header__title-s1giF{font-family:var(--hd-font-display);font-size:var(--hd-type-h2-size);font-weight:var(--hd-type-h2-weight);font-stretch:var(--hd-type-h2-stretch);line-height:var(--hd-type-h2-line-height);letter-spacing:var(--hd-type-h2-letter-spacing);color:var(--hd-text);text-wrap:balance;margin:0}.ui-header__meta-UxuaD{font-family:var(--hd-font-body);font-size:var(--hd-type-small-size);font-weight:var(--hd-font-weight-medium);color:var(--hd-text-2);font-variant-numeric:tabular-nums;white-space:nowrap}.ui-header__description-NXbbC{font-size:var(--hd-type-body-size);line-height:var(--hd-type-body-line-height);color:var(--hd-text-2);margin:0;max-width:68ch}.ui-header__actions-aShpt{display:flex;flex-wrap:wrap;align-items:center;gap:var(--hd-space-2);flex-shrink:0}@media (max-width: 640px){.ui-header__actions-aShpt{width:100%}.ui-header__actions-aShpt>*{flex:1 1 auto}}}
|
|
@@ -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}}@media print{.ui-popover-VxgiK{display:none}}}
|
|
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-VxgiK>*{max-width:100%}.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}}}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("react/jsx-runtime"),C=require("react"),k=require("react-bootstrap-icons"),w=require("../../enums/ui-size.enum.cjs"),O=require("../../enums/ui-variant.enum.cjs"),R=require("../../helpers/class-name.helper.cjs"),T=require("../../helpers/component.helper.cjs"),D=require("../../helpers/focus.helper.cjs"),a=require("../../helpers/label.helper.cjs"),F=require("../../theme/context.cjs"),z=require("../Button/index.cjs"),B=require("../Carousel/index.cjs"),I=require("../SectionHeader/index.cjs"),d={default:{"rail":"ui-rail-JVo-Z","rail__item":"ui-rail__item-et-c-"}},M={base:1.5,sm:2.5,md:3,lg:4,xl:5},q={ArrowLeft:-1,ArrowRight:1},N=({title:o,description:E,overline:S,as:y="h2",seeAllHref:l,seeAllLinkProps:A,children:L,itemsPerView:g=M,labels:e,className:j,testId:v})=>{const{labels:c}=F.useUi(),r=c==null?void 0:c.productCarousel,m=C.Children.toArray(L);if(m.length===0)return null;const p=t=>{var x;const u=t.target,s=u.closest(`.${d.default.rail__item}`);if(!(s!=null&&s.parentElement)||u.matches("input, textarea, select"))return;const i=[...s.parentElement.children],_=i.indexOf(s),h=t.key==="Home"?0:t.key==="End"?i.length-1:t.key in q?_+q[t.key]*(document.dir==="rtl"?-1:1):-1,f=(x=i[h])==null?void 0:x.querySelector(D.FOCUSABLE_SELECTOR);!f||h===_||(t.preventDefault(),f.focus())};return n.jsx("div",{className:R.cx(d.default.rail,j),onKeyDown:p,"data-testid":v,children:n.jsx(B.default,{label:o,previousLabel:a.resolveFormatter("ProductCarousel.labels.previous",(e==null?void 0:e.previous)??(r==null?void 0:r.previous),o),nextLabel:a.resolveFormatter("ProductCarousel.labels.next",(e==null?void 0:e.next)??(r==null?void 0:r.next),o),itemsPerView:g,header:n.jsx(I.default,{title:o,description:E,overline:S,as:y,size:"sm",action:l&&n.jsx(z.default,{variant:O.default.GHOST,size:w.default.SMALL,href:l,linkProps:A,endIcon:n.jsx(k.ArrowRight,{"aria-hidden":!0}),children:a.resolveLabel("ProductCarousel.labels.seeAll",e==null?void 0:e.seeAll,r==null?void 0:r.seeAll)})}),children:m.map((t,u)=>n.jsx("div",{className:d.default.rail__item,children:t},u))})})},U=C.memo(T.named(N,"ProductCarousel"));exports.default=U;
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/ProductCarousel/index.tsx"],"sourcesContent":["'use client';\n\nimport { Children, type KeyboardEvent, memo, type ReactNode } from 'react';\n\nimport { ArrowRight } from 'react-bootstrap-icons';\n\nimport UISize from '../../enums/ui-size.enum';\nimport UIVariant from '../../enums/ui-variant.enum';\nimport type { CarouselItemsPerView } from '../../helpers/carousel.helper';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { FOCUSABLE_SELECTOR } from '../../helpers/focus.helper';\nimport { resolveFormatter, resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport type { UiLinkExtraProps } from '../../types/link.type';\nimport type { Formatter } from '../../types/theme.type';\nimport Button from '../Button';\nimport Carousel from '../Carousel';\nimport SectionHeader from '../SectionHeader';\n\nimport styles from './index.module.scss';\n\nexport type ProductCarouselLabels = {\n previous: Formatter<[title: string]>;\n next: Formatter<[title: string]>;\n seeAll: string;\n};\n\ntype Props = {\n /** The rail's heading (\"Çok satanlar\"); also its name and the arrows' context. */\n title: string;\n description?: string;\n overline?: string;\n /** The heading level; `h2` by default. */\n as?: 'h2' | 'h3';\n /** The catalogue page this rail is a preview of: the \"see all\" link. */\n seeAllHref?: string;\n seeAllLinkProps?: UiLinkExtraProps;\n /** The cards, one per child. */\n children: ReactNode;\n /** Cards side by side per width; `{ base: 1.5, sm: 2.5, md: 3, lg: 4, xl: 5 }` by default. */\n itemsPerView?: CarouselItemsPerView;\n labels?: Partial<ProductCarouselLabels>;\n className?: string;\n testId?: string;\n};\n\nconst DEFAULT_PER_VIEW: CarouselItemsPerView = { base: 1.5, sm: 2.5, md: 3, lg: 4, xl: 5 };\n\nconst STEP: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 };\n\n/**\n * A showcase rail (3.4) — \"best sellers\", \"on sale\" — on `Carousel`: a section heading with \"see\n * all\", arrows that page the rail, snap, responsive card counts, and ←/→ (Home/End) moving focus\n * from card to card. Draws nothing without cards.\n */\nconst ProductCarousel = ({\n title,\n description,\n overline,\n as = 'h2',\n seeAllHref,\n seeAllLinkProps,\n children,\n itemsPerView = DEFAULT_PER_VIEW,\n labels: labelProps,\n className,\n testId,\n}: Props) => {\n const { labels: config } = useUi();\n const text = config?.productCarousel;\n const cards = Children.toArray(children);\n\n if (cards.length === 0) return null;\n\n /* Arrows between cards: the focus moves to the next card's first control (its link). */\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n const item = target.closest<HTMLElement>(`.${styles.rail__item}`);\n if (!item?.parentElement || target.matches('input, textarea, select')) return;\n\n const items = [...item.parentElement.children] as HTMLElement[];\n const index = items.indexOf(item);\n const next =\n event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? items.length - 1\n : event.key in STEP\n ? index + STEP[event.key] * (document.dir === 'rtl' ? -1 : 1)\n : -1;\n const focusable = items[next]?.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n if (!focusable || next === index) return;\n\n event.preventDefault();\n focusable.focus();\n };\n\n return (\n // The keys bubble up from the cards' own links; the wrapper only listens.\n <div className={cx(styles.rail, className)} onKeyDown={handleKeyDown} data-testid={testId}>\n <Carousel\n label={title}\n previousLabel={resolveFormatter(\n 'ProductCarousel.labels.previous',\n labelProps?.previous ?? text?.previous,\n title,\n )}\n nextLabel={resolveFormatter(\n 'ProductCarousel.labels.next',\n labelProps?.next ?? text?.next,\n title,\n )}\n itemsPerView={itemsPerView}\n header={\n <SectionHeader\n title={title}\n description={description}\n overline={overline}\n as={as}\n size=\"sm\"\n action={\n seeAllHref && (\n <Button\n variant={UIVariant.GHOST}\n size={UISize.SMALL}\n href={seeAllHref}\n linkProps={seeAllLinkProps}\n endIcon={<ArrowRight aria-hidden />}\n >\n {resolveLabel('ProductCarousel.labels.seeAll', labelProps?.seeAll, text?.seeAll)}\n </Button>\n )\n }\n />\n }\n >\n {cards.map((card, index) => (\n <div key={index} className={styles.rail__item}>\n {card}\n </div>\n ))}\n </Carousel>\n </div>\n );\n};\n\nexport default /*#__PURE__*/ memo(\n /*#__PURE__*/ named(ProductCarousel, 'ProductCarousel'),\n) as typeof ProductCarousel;\n"],"names":["DEFAULT_PER_VIEW","STEP","ProductCarousel","title","description","overline","as","seeAllHref","seeAllLinkProps","children","itemsPerView","labelProps","className","testId","config","useUi","text","cards","Children","handleKeyDown","event","target","item","styles","items","index","next","focusable","_a","FOCUSABLE_SELECTOR","jsx","cx","Carousel","resolveFormatter","SectionHeader","Button","UIVariant","UISize","ArrowRight","resolveLabel","card","memo","named"],"mappings":"0pBA8CMA,EAAyC,CAAE,KAAM,IAAK,GAAI,IAAK,GAAI,EAAG,GAAI,EAAG,GAAI,CAAA,EAEjFC,EAA+B,CAAE,UAAW,GAAI,WAAY,CAAA,EAO5DC,EAAkB,CAAC,CACvB,MAAAC,EACA,YAAAC,EACA,SAAAC,EACA,GAAAC,EAAK,KACL,WAAAC,EACA,gBAAAC,EACA,SAAAC,EACA,aAAAC,EAAeV,EACf,OAAQW,EACR,UAAAC,EACA,OAAAC,CACF,IAAa,CACX,KAAM,CAAE,OAAQC,CAAA,EAAWC,QAAA,EACrBC,EAAOF,GAAA,YAAAA,EAAQ,gBACfG,EAAQC,EAAAA,SAAS,QAAQT,CAAQ,EAEvC,GAAIQ,EAAM,SAAW,EAAG,OAAO,KAG/B,MAAME,EAAiBC,GAAyC,OAC9D,MAAMC,EAASD,EAAM,OACfE,EAAOD,EAAO,QAAqB,IAAIE,EAAAA,QAAO,UAAU,EAAE,EAChE,GAAI,EAACD,GAAA,MAAAA,EAAM,gBAAiBD,EAAO,QAAQ,yBAAyB,EAAG,OAEvE,MAAMG,EAAQ,CAAC,GAAGF,EAAK,cAAc,QAAQ,EACvCG,EAAQD,EAAM,QAAQF,CAAI,EAC1BI,EACJN,EAAM,MAAQ,OACV,EACAA,EAAM,MAAQ,MACZI,EAAM,OAAS,EACfJ,EAAM,OAAOnB,EACXwB,EAAQxB,EAAKmB,EAAM,GAAG,GAAK,SAAS,MAAQ,MAAQ,GAAK,GACzD,GACJO,GAAYC,EAAAJ,EAAME,CAAI,IAAV,YAAAE,EAAa,cAA2BC,EAAAA,oBACtD,CAACF,GAAaD,IAASD,IAE3BL,EAAM,eAAA,EACNO,EAAU,MAAA,EACZ,EAEA,OAEEG,EAAAA,IAAC,MAAA,CAAI,UAAWC,EAAAA,GAAGR,EAAAA,QAAO,KAAMX,CAAS,EAAG,UAAWO,EAAe,cAAaN,EACjF,SAAAiB,EAAAA,IAACE,EAAAA,QAAA,CACC,MAAO7B,EACP,cAAe8B,EAAAA,iBACb,mCACAtB,GAAA,YAAAA,EAAY,YAAYK,GAAA,YAAAA,EAAM,UAC9Bb,CAAA,EAEF,UAAW8B,EAAAA,iBACT,+BACAtB,GAAA,YAAAA,EAAY,QAAQK,GAAA,YAAAA,EAAM,MAC1Bb,CAAA,EAEF,aAAAO,EACA,OACEoB,EAAAA,IAACI,EAAAA,QAAA,CACC,MAAA/B,EACA,YAAAC,EACA,SAAAC,EACA,GAAAC,EACA,KAAK,KACL,OACEC,GACEuB,EAAAA,IAACK,EAAAA,QAAA,CACC,QAASC,EAAAA,QAAU,MACnB,KAAMC,EAAAA,QAAO,MACb,KAAM9B,EACN,UAAWC,EACX,QAASsB,EAAAA,IAACQ,EAAAA,WAAA,CAAW,cAAW,EAAA,CAAC,EAEhC,SAAAC,EAAAA,aAAa,gCAAiC5B,GAAA,YAAAA,EAAY,OAAQK,GAAA,YAAAA,EAAM,MAAM,CAAA,CAAA,CACjF,CAAA,EAMP,SAAAC,EAAM,IAAI,CAACuB,EAAMf,IAChBK,EAAAA,IAAC,MAAA,CAAgB,UAAWP,EAAAA,QAAO,WAChC,SAAAiB,CAAA,EADOf,CAEV,CACD,CAAA,CAAA,CACH,CACF,CAEJ,EAEAA,EAA6BgB,EAAAA,KACbC,EAAAA,MAAMxC,EAAiB,iBAAiB,CACxD"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CarouselItemsPerView } from '../../helpers/carousel.helper.cjs';
|
|
3
|
+
import { UiLinkExtraProps } from '../../types/link.type.cjs';
|
|
4
|
+
import { Formatter } from '../../types/theme.type.cjs';
|
|
5
|
+
export type ProductCarouselLabels = {
|
|
6
|
+
previous: Formatter<[title: string]>;
|
|
7
|
+
next: Formatter<[title: string]>;
|
|
8
|
+
seeAll: string;
|
|
9
|
+
};
|
|
10
|
+
type Props = {
|
|
11
|
+
/** The rail's heading ("Çok satanlar"); also its name and the arrows' context. */
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
overline?: string;
|
|
15
|
+
/** The heading level; `h2` by default. */
|
|
16
|
+
as?: 'h2' | 'h3';
|
|
17
|
+
/** The catalogue page this rail is a preview of: the "see all" link. */
|
|
18
|
+
seeAllHref?: string;
|
|
19
|
+
seeAllLinkProps?: UiLinkExtraProps;
|
|
20
|
+
/** The cards, one per child. */
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** Cards side by side per width; `{ base: 1.5, sm: 2.5, md: 3, lg: 4, xl: 5 }` by default. */
|
|
23
|
+
itemsPerView?: CarouselItemsPerView;
|
|
24
|
+
labels?: Partial<ProductCarouselLabels>;
|
|
25
|
+
className?: string;
|
|
26
|
+
testId?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A showcase rail (3.4) — "best sellers", "on sale" — on `Carousel`: a section heading with "see
|
|
30
|
+
* all", arrows that page the rail, snap, responsive card counts, and ←/→ (Home/End) moving focus
|
|
31
|
+
* from card to card. Draws nothing without cards.
|
|
32
|
+
*/
|
|
33
|
+
declare const ProductCarousel: ({ title, description, overline, as, seeAllHref, seeAllLinkProps, children, itemsPerView, labels: labelProps, className, testId, }: Props) => import("react").JSX.Element | null;
|
|
34
|
+
declare const _default: typeof ProductCarousel;
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CarouselItemsPerView } from '../../helpers/carousel.helper.js';
|
|
3
|
+
import { UiLinkExtraProps } from '../../types/link.type.js';
|
|
4
|
+
import { Formatter } from '../../types/theme.type.js';
|
|
5
|
+
export type ProductCarouselLabels = {
|
|
6
|
+
previous: Formatter<[title: string]>;
|
|
7
|
+
next: Formatter<[title: string]>;
|
|
8
|
+
seeAll: string;
|
|
9
|
+
};
|
|
10
|
+
type Props = {
|
|
11
|
+
/** The rail's heading ("Çok satanlar"); also its name and the arrows' context. */
|
|
12
|
+
title: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
overline?: string;
|
|
15
|
+
/** The heading level; `h2` by default. */
|
|
16
|
+
as?: 'h2' | 'h3';
|
|
17
|
+
/** The catalogue page this rail is a preview of: the "see all" link. */
|
|
18
|
+
seeAllHref?: string;
|
|
19
|
+
seeAllLinkProps?: UiLinkExtraProps;
|
|
20
|
+
/** The cards, one per child. */
|
|
21
|
+
children: ReactNode;
|
|
22
|
+
/** Cards side by side per width; `{ base: 1.5, sm: 2.5, md: 3, lg: 4, xl: 5 }` by default. */
|
|
23
|
+
itemsPerView?: CarouselItemsPerView;
|
|
24
|
+
labels?: Partial<ProductCarouselLabels>;
|
|
25
|
+
className?: string;
|
|
26
|
+
testId?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A showcase rail (3.4) — "best sellers", "on sale" — on `Carousel`: a section heading with "see
|
|
30
|
+
* all", arrows that page the rail, snap, responsive card counts, and ←/→ (Home/End) moving focus
|
|
31
|
+
* from card to card. Draws nothing without cards.
|
|
32
|
+
*/
|
|
33
|
+
declare const ProductCarousel: ({ title, description, overline, as, seeAllHref, seeAllLinkProps, children, itemsPerView, labels: labelProps, className, testId, }: Props) => import("react").JSX.Element | null;
|
|
34
|
+
declare const _default: typeof ProductCarousel;
|
|
35
|
+
export default _default;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
import { memo as w, Children as U } from "react";
|
|
4
|
+
import { ArrowRight as D } from "react-bootstrap-icons";
|
|
5
|
+
import I from "../../enums/ui-size.enum.js";
|
|
6
|
+
import O from "../../enums/ui-variant.enum.js";
|
|
7
|
+
import { cx as R } from "../../helpers/class-name.helper.js";
|
|
8
|
+
import { named as T } from "../../helpers/component.helper.js";
|
|
9
|
+
import { FOCUSABLE_SELECTOR as z } from "../../helpers/focus.helper.js";
|
|
10
|
+
import { resolveLabel as F, resolveFormatter as C } from "../../helpers/label.helper.js";
|
|
11
|
+
import { useUi as B } from "../../theme/context.js";
|
|
12
|
+
import H from "../Button/index.js";
|
|
13
|
+
import K from "../Carousel/index.js";
|
|
14
|
+
import N from "../SectionHeader/index.js";
|
|
15
|
+
const a = {"rail":"ui-rail-JVo-Z","rail__item":"ui-rail__item-et-c-"};
|
|
16
|
+
const V = { base: 1.5, sm: 2.5, md: 3, lg: 4, xl: 5 }, E = { ArrowLeft: -1, ArrowRight: 1 }, j = ({
|
|
17
|
+
title: i,
|
|
18
|
+
description: y,
|
|
19
|
+
overline: A,
|
|
20
|
+
as: L = "h2",
|
|
21
|
+
seeAllHref: u,
|
|
22
|
+
seeAllLinkProps: x,
|
|
23
|
+
children: S,
|
|
24
|
+
itemsPerView: _ = V,
|
|
25
|
+
labels: r,
|
|
26
|
+
className: g,
|
|
27
|
+
testId: k
|
|
28
|
+
}) => {
|
|
29
|
+
const { labels: s } = B(), e = s == null ? void 0 : s.productCarousel, d = U.toArray(S);
|
|
30
|
+
if (d.length === 0) return null;
|
|
31
|
+
const v = (o) => {
|
|
32
|
+
var p;
|
|
33
|
+
const m = o.target, n = m.closest(`.${a.rail__item}`);
|
|
34
|
+
if (!(n != null && n.parentElement) || m.matches("input, textarea, select")) return;
|
|
35
|
+
const c = [...n.parentElement.children], l = c.indexOf(n), f = o.key === "Home" ? 0 : o.key === "End" ? c.length - 1 : o.key in E ? l + E[o.key] * (document.dir === "rtl" ? -1 : 1) : -1, h = (p = c[f]) == null ? void 0 : p.querySelector(z);
|
|
36
|
+
!h || f === l || (o.preventDefault(), h.focus());
|
|
37
|
+
};
|
|
38
|
+
return (
|
|
39
|
+
// The keys bubble up from the cards' own links; the wrapper only listens.
|
|
40
|
+
/* @__PURE__ */ t("div", { className: R(a.rail, g), onKeyDown: v, "data-testid": k, children: /* @__PURE__ */ t(
|
|
41
|
+
K,
|
|
42
|
+
{
|
|
43
|
+
label: i,
|
|
44
|
+
previousLabel: C(
|
|
45
|
+
"ProductCarousel.labels.previous",
|
|
46
|
+
(r == null ? void 0 : r.previous) ?? (e == null ? void 0 : e.previous),
|
|
47
|
+
i
|
|
48
|
+
),
|
|
49
|
+
nextLabel: C(
|
|
50
|
+
"ProductCarousel.labels.next",
|
|
51
|
+
(r == null ? void 0 : r.next) ?? (e == null ? void 0 : e.next),
|
|
52
|
+
i
|
|
53
|
+
),
|
|
54
|
+
itemsPerView: _,
|
|
55
|
+
header: /* @__PURE__ */ t(
|
|
56
|
+
N,
|
|
57
|
+
{
|
|
58
|
+
title: i,
|
|
59
|
+
description: y,
|
|
60
|
+
overline: A,
|
|
61
|
+
as: L,
|
|
62
|
+
size: "sm",
|
|
63
|
+
action: u && /* @__PURE__ */ t(
|
|
64
|
+
H,
|
|
65
|
+
{
|
|
66
|
+
variant: O.GHOST,
|
|
67
|
+
size: I.SMALL,
|
|
68
|
+
href: u,
|
|
69
|
+
linkProps: x,
|
|
70
|
+
endIcon: /* @__PURE__ */ t(D, { "aria-hidden": !0 }),
|
|
71
|
+
children: F("ProductCarousel.labels.seeAll", r == null ? void 0 : r.seeAll, e == null ? void 0 : e.seeAll)
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
),
|
|
76
|
+
children: d.map((o, m) => /* @__PURE__ */ t("div", { className: a.rail__item, children: o }, m))
|
|
77
|
+
}
|
|
78
|
+
) })
|
|
79
|
+
);
|
|
80
|
+
}, or = /* @__PURE__ */ w(
|
|
81
|
+
/* @__PURE__ */ T(j, "ProductCarousel")
|
|
82
|
+
);
|
|
83
|
+
export {
|
|
84
|
+
or as default
|
|
85
|
+
};
|
|
86
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/ProductCarousel/index.tsx"],"sourcesContent":["'use client';\n\nimport { Children, type KeyboardEvent, memo, type ReactNode } from 'react';\n\nimport { ArrowRight } from 'react-bootstrap-icons';\n\nimport UISize from '../../enums/ui-size.enum';\nimport UIVariant from '../../enums/ui-variant.enum';\nimport type { CarouselItemsPerView } from '../../helpers/carousel.helper';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\nimport { FOCUSABLE_SELECTOR } from '../../helpers/focus.helper';\nimport { resolveFormatter, resolveLabel } from '../../helpers/label.helper';\nimport { useUi } from '../../theme/context';\nimport type { UiLinkExtraProps } from '../../types/link.type';\nimport type { Formatter } from '../../types/theme.type';\nimport Button from '../Button';\nimport Carousel from '../Carousel';\nimport SectionHeader from '../SectionHeader';\n\nimport styles from './index.module.scss';\n\nexport type ProductCarouselLabels = {\n previous: Formatter<[title: string]>;\n next: Formatter<[title: string]>;\n seeAll: string;\n};\n\ntype Props = {\n /** The rail's heading (\"Çok satanlar\"); also its name and the arrows' context. */\n title: string;\n description?: string;\n overline?: string;\n /** The heading level; `h2` by default. */\n as?: 'h2' | 'h3';\n /** The catalogue page this rail is a preview of: the \"see all\" link. */\n seeAllHref?: string;\n seeAllLinkProps?: UiLinkExtraProps;\n /** The cards, one per child. */\n children: ReactNode;\n /** Cards side by side per width; `{ base: 1.5, sm: 2.5, md: 3, lg: 4, xl: 5 }` by default. */\n itemsPerView?: CarouselItemsPerView;\n labels?: Partial<ProductCarouselLabels>;\n className?: string;\n testId?: string;\n};\n\nconst DEFAULT_PER_VIEW: CarouselItemsPerView = { base: 1.5, sm: 2.5, md: 3, lg: 4, xl: 5 };\n\nconst STEP: Record<string, number> = { ArrowLeft: -1, ArrowRight: 1 };\n\n/**\n * A showcase rail (3.4) — \"best sellers\", \"on sale\" — on `Carousel`: a section heading with \"see\n * all\", arrows that page the rail, snap, responsive card counts, and ←/→ (Home/End) moving focus\n * from card to card. Draws nothing without cards.\n */\nconst ProductCarousel = ({\n title,\n description,\n overline,\n as = 'h2',\n seeAllHref,\n seeAllLinkProps,\n children,\n itemsPerView = DEFAULT_PER_VIEW,\n labels: labelProps,\n className,\n testId,\n}: Props) => {\n const { labels: config } = useUi();\n const text = config?.productCarousel;\n const cards = Children.toArray(children);\n\n if (cards.length === 0) return null;\n\n /* Arrows between cards: the focus moves to the next card's first control (its link). */\n const handleKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n const item = target.closest<HTMLElement>(`.${styles.rail__item}`);\n if (!item?.parentElement || target.matches('input, textarea, select')) return;\n\n const items = [...item.parentElement.children] as HTMLElement[];\n const index = items.indexOf(item);\n const next =\n event.key === 'Home'\n ? 0\n : event.key === 'End'\n ? items.length - 1\n : event.key in STEP\n ? index + STEP[event.key] * (document.dir === 'rtl' ? -1 : 1)\n : -1;\n const focusable = items[next]?.querySelector<HTMLElement>(FOCUSABLE_SELECTOR);\n if (!focusable || next === index) return;\n\n event.preventDefault();\n focusable.focus();\n };\n\n return (\n // The keys bubble up from the cards' own links; the wrapper only listens.\n <div className={cx(styles.rail, className)} onKeyDown={handleKeyDown} data-testid={testId}>\n <Carousel\n label={title}\n previousLabel={resolveFormatter(\n 'ProductCarousel.labels.previous',\n labelProps?.previous ?? text?.previous,\n title,\n )}\n nextLabel={resolveFormatter(\n 'ProductCarousel.labels.next',\n labelProps?.next ?? text?.next,\n title,\n )}\n itemsPerView={itemsPerView}\n header={\n <SectionHeader\n title={title}\n description={description}\n overline={overline}\n as={as}\n size=\"sm\"\n action={\n seeAllHref && (\n <Button\n variant={UIVariant.GHOST}\n size={UISize.SMALL}\n href={seeAllHref}\n linkProps={seeAllLinkProps}\n endIcon={<ArrowRight aria-hidden />}\n >\n {resolveLabel('ProductCarousel.labels.seeAll', labelProps?.seeAll, text?.seeAll)}\n </Button>\n )\n }\n />\n }\n >\n {cards.map((card, index) => (\n <div key={index} className={styles.rail__item}>\n {card}\n </div>\n ))}\n </Carousel>\n </div>\n );\n};\n\nexport default /*#__PURE__*/ memo(\n /*#__PURE__*/ named(ProductCarousel, 'ProductCarousel'),\n) as typeof ProductCarousel;\n"],"names":["DEFAULT_PER_VIEW","STEP","ProductCarousel","title","description","overline","as","seeAllHref","seeAllLinkProps","children","itemsPerView","labelProps","className","testId","config","useUi","text","cards","Children","handleKeyDown","event","target","item","styles","items","index","next","focusable","_a","FOCUSABLE_SELECTOR","jsx","cx","Carousel","resolveFormatter","SectionHeader","Button","UIVariant","UISize","ArrowRight","resolveLabel","card","memo","named"],"mappings":";;;;;;;;;;;;;;;AA8CA,MAAMA,IAAyC,EAAE,MAAM,KAAK,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAA,GAEjFC,IAA+B,EAAE,WAAW,IAAI,YAAY,EAAA,GAO5DC,IAAkB,CAAC;AAAA,EACvB,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AAAA,EACA,IAAAC,IAAK;AAAA,EACL,YAAAC;AAAA,EACA,iBAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC,IAAeV;AAAA,EACf,QAAQW;AAAA,EACR,WAAAC;AAAA,EACA,QAAAC;AACF,MAAa;AACX,QAAM,EAAE,QAAQC,EAAA,IAAWC,EAAA,GACrBC,IAAOF,KAAA,gBAAAA,EAAQ,iBACfG,IAAQC,EAAS,QAAQT,CAAQ;AAEvC,MAAIQ,EAAM,WAAW,EAAG,QAAO;AAG/B,QAAME,IAAgB,CAACC,MAAyC;;AAC9D,UAAMC,IAASD,EAAM,QACfE,IAAOD,EAAO,QAAqB,IAAIE,EAAO,UAAU,EAAE;AAChE,QAAI,EAACD,KAAA,QAAAA,EAAM,kBAAiBD,EAAO,QAAQ,yBAAyB,EAAG;AAEvE,UAAMG,IAAQ,CAAC,GAAGF,EAAK,cAAc,QAAQ,GACvCG,IAAQD,EAAM,QAAQF,CAAI,GAC1BI,IACJN,EAAM,QAAQ,SACV,IACAA,EAAM,QAAQ,QACZI,EAAM,SAAS,IACfJ,EAAM,OAAOnB,IACXwB,IAAQxB,EAAKmB,EAAM,GAAG,KAAK,SAAS,QAAQ,QAAQ,KAAK,KACzD,IACJO,KAAYC,IAAAJ,EAAME,CAAI,MAAV,gBAAAE,EAAa,cAA2BC;AAC1D,IAAI,CAACF,KAAaD,MAASD,MAE3BL,EAAM,eAAA,GACNO,EAAU,MAAA;AAAA,EACZ;AAEA;AAAA;AAAA,IAEE,gBAAAG,EAAC,OAAA,EAAI,WAAWC,EAAGR,EAAO,MAAMX,CAAS,GAAG,WAAWO,GAAe,eAAaN,GACjF,UAAA,gBAAAiB;AAAA,MAACE;AAAA,MAAA;AAAA,QACC,OAAO7B;AAAA,QACP,eAAe8B;AAAA,UACb;AAAA,WACAtB,KAAA,gBAAAA,EAAY,cAAYK,KAAA,gBAAAA,EAAM;AAAA,UAC9Bb;AAAA,QAAA;AAAA,QAEF,WAAW8B;AAAA,UACT;AAAA,WACAtB,KAAA,gBAAAA,EAAY,UAAQK,KAAA,gBAAAA,EAAM;AAAA,UAC1Bb;AAAA,QAAA;AAAA,QAEF,cAAAO;AAAA,QACA,QACE,gBAAAoB;AAAA,UAACI;AAAA,UAAA;AAAA,YACC,OAAA/B;AAAA,YACA,aAAAC;AAAA,YACA,UAAAC;AAAA,YACA,IAAAC;AAAA,YACA,MAAK;AAAA,YACL,QACEC,KACE,gBAAAuB;AAAA,cAACK;AAAA,cAAA;AAAA,gBACC,SAASC,EAAU;AAAA,gBACnB,MAAMC,EAAO;AAAA,gBACb,MAAM9B;AAAA,gBACN,WAAWC;AAAA,gBACX,SAAS,gBAAAsB,EAACQ,GAAA,EAAW,eAAW,GAAA,CAAC;AAAA,gBAEhC,UAAAC,EAAa,iCAAiC5B,KAAA,gBAAAA,EAAY,QAAQK,KAAA,gBAAAA,EAAM,MAAM;AAAA,cAAA;AAAA,YAAA;AAAA,UACjF;AAAA,QAAA;AAAA,QAMP,UAAAC,EAAM,IAAI,CAACuB,GAAMf,MAChB,gBAAAK,EAAC,OAAA,EAAgB,WAAWP,EAAO,YAChC,UAAAiB,EAAA,GADOf,CAEV,CACD;AAAA,MAAA;AAAA,IAAA,EACH,CACF;AAAA;AAEJ,GAEAA,KAA6B,gBAAAgB;AAAA,EACb,gBAAAC,EAAMxC,GAAiB,iBAAiB;AACxD;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@layer ui{.ui-rail-JVo-Z{min-width:0}.ui-rail__item-et-c-{display:flex;min-width:0}.ui-rail__item-et-c->*{flex:1;min-width:0}}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),t=require("react"),N=require("react-bootstrap-icons"),u=require("@handijitcom/utils"),_=require("../../helpers/aria.helper.cjs"),y=require("../../helpers/class-name.helper.cjs"),
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),t=require("react"),N=require("react-bootstrap-icons"),u=require("@handijitcom/utils"),_=require("../../helpers/aria.helper.cjs"),y=require("../../helpers/class-name.helper.cjs"),R=require("../../helpers/component.helper.cjs"),a={default:{"radio":"ui-radio-KoZak","radio__input":"ui-radio__input-gVMgh","radio__body":"ui-radio__body-oZWg6","radio__label":"ui-radio__label-d-5ce","radio__hint":"ui-radio__hint-baVbs","radio__error":"ui-radio__error-vguvt","radio__count":"ui-radio__count-OtkUM"}},$=t.forwardRef(({label:m,hint:d,error:s,count:r,className:b,id:p,testId:f,"aria-describedby":x,"aria-invalid":h,...j},q)=>{const I=t.useId(),i=p??I,l=`${i}-label`,n=`${i}-hint`,o=`${i}-error`,c=`${i}-count`;return e.jsxs("label",{className:y.cx(a.default.radio,b),"data-testid":f,children:[e.jsx("input",{ref:q,type:"radio",id:i,className:a.default.radio__input,"aria-labelledby":_.idList(l,u.isDefined(r)&&c),"aria-describedby":_.idList(s&&o,d&&n,x),"aria-invalid":s?!0:h,...j}),e.jsxs("span",{className:a.default.radio__body,children:[e.jsx("span",{id:l,className:a.default.radio__label,children:m}),d&&e.jsx("span",{id:n,className:a.default.radio__hint,children:d}),s&&e.jsxs("span",{id:o,className:a.default.radio__error,role:"alert",children:[e.jsx(N.ExclamationCircleFill,{"aria-hidden":!0}),s]})]}),u.isDefined(r)&&e.jsx("span",{id:c,className:a.default.radio__count,children:r})]})}),v=t.memo(R.named($,"Radio"));exports.default=v;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type InputHTMLAttributes, memo, type ReactNode, useId } from 'react';\n\nimport { ExclamationCircleFill } from 'react-bootstrap-icons';\n\nimport { isDefined } from '@handijitcom/utils';\n\nimport { idList } from '../../helpers/aria.helper';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n label: ReactNode;\n /** Etiketin altındaki açıklama; `aria-describedby` ile bağlanır. */\n hint?: string;\n /**\n * The error under the label (2.2): the radio is marked invalid (`aria-invalid`) and the message\n * is linked with `aria-describedby`. The error of a whole group belongs on the group (its\n * `radiogroup` element with `aria-invalid`, or a `Field` around it), not on every radio.\n */\n error?: string;\n /** Sağda gösterilen sonuç adedi (filtre listelerinde). */\n count?: number;\n testId?: string;\n};\n\n/** Radyo düğmesi. */\nconst Radio = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n (\n {\n label,\n hint,\n error,\n count,\n className,\n id,\n testId,\n 'aria-describedby': describedBy,\n 'aria-invalid': isInvalid,\n ...rest\n },\n ref,\n ) => {\n /* ⚠ İpucu ADA değil AÇIKLAMAYA bağlanır — gerekçe `Switch`te yazılı. */\n const generatedId = useId();\n const baseId = id ?? generatedId;\n const labelId = `${baseId}-label`;\n const hintId = `${baseId}-hint`;\n const errorId = `${baseId}-error`;\n const countId = `${baseId}-count`;\n\n return (\n <label className={cx(styles.radio, className)} data-testid={testId}>\n <input\n ref={ref}\n type=\"radio\"\n id={baseId}\n className={styles.radio__input}\n /*\n * Sayaç ADIN İÇİNDE KALIR (\"Disk Balata, 128\"): filtre listesinde kaç sonuç olduğu\n * seçimin bir parçası.\n */\n aria-labelledby={idList(labelId, isDefined(count) && countId)}\n /* 2.2: the links are MERGED; a passed `aria-describedby` no longer drops the hint. */\n aria-describedby={idList(error && errorId, hint && hintId, describedBy)}\n aria-invalid={error ? true : isInvalid}\n {...rest}\n />\n <span className={styles.radio__body}>\n <span id={labelId} className={styles.radio__label}>\n {label}\n </span>\n {hint && (\n <span id={hintId} className={styles.radio__hint}>\n {hint}\n </span>\n )}\n {error && (\n <span id={errorId} className={styles.radio__error} role=\"alert\">\n <ExclamationCircleFill aria-hidden />\n {error}\n </span>\n )}\n </span>\n {isDefined(count) && (\n <span id={countId} className={styles.radio__count}>\n {count}\n </span>\n )}\n </label>\n );\n },\n);\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(Radio, 'Radio')) as typeof Radio;\n"],"names":["Radio","forwardRef","label","hint","error","count","className","id","testId","describedBy","isInvalid","rest","ref","generatedId","useId","baseId","labelId","hintId","errorId","countId","jsxs","cx","styles","jsx","idList","isDefined","ExclamationCircleFill","
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type InputHTMLAttributes, memo, type ReactNode, useId } from 'react';\n\nimport { ExclamationCircleFill } from 'react-bootstrap-icons';\n\nimport { isDefined } from '@handijitcom/utils';\n\nimport { idList } from '../../helpers/aria.helper';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n label: ReactNode;\n /** Etiketin altındaki açıklama; `aria-describedby` ile bağlanır. */\n hint?: string;\n /**\n * The error under the label (2.2): the radio is marked invalid (`aria-invalid`) and the message\n * is linked with `aria-describedby`. The error of a whole group belongs on the group (its\n * `radiogroup` element with `aria-invalid`, or a `Field` around it), not on every radio.\n */\n error?: string;\n /** Sağda gösterilen sonuç adedi (filtre listelerinde). */\n count?: number;\n testId?: string;\n};\n\n/** Radyo düğmesi. */\nconst Radio = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n (\n {\n label,\n hint,\n error,\n count,\n className,\n id,\n testId,\n 'aria-describedby': describedBy,\n 'aria-invalid': isInvalid,\n ...rest\n },\n ref,\n ) => {\n /* ⚠ İpucu ADA değil AÇIKLAMAYA bağlanır — gerekçe `Switch`te yazılı. */\n const generatedId = useId();\n const baseId = id ?? generatedId;\n const labelId = `${baseId}-label`;\n const hintId = `${baseId}-hint`;\n const errorId = `${baseId}-error`;\n const countId = `${baseId}-count`;\n\n return (\n <label className={cx(styles.radio, className)} data-testid={testId}>\n <input\n ref={ref}\n type=\"radio\"\n id={baseId}\n className={styles.radio__input}\n /*\n * Sayaç ADIN İÇİNDE KALIR (\"Disk Balata, 128\"): filtre listesinde kaç sonuç olduğu\n * seçimin bir parçası.\n */\n aria-labelledby={idList(labelId, isDefined(count) && countId)}\n /* 2.2: the links are MERGED; a passed `aria-describedby` no longer drops the hint. */\n aria-describedby={idList(error && errorId, hint && hintId, describedBy)}\n aria-invalid={error ? true : isInvalid}\n {...rest}\n />\n <span className={styles.radio__body}>\n <span id={labelId} className={styles.radio__label}>\n {label}\n </span>\n {hint && (\n <span id={hintId} className={styles.radio__hint}>\n {hint}\n </span>\n )}\n {error && (\n <span id={errorId} className={styles.radio__error} role=\"alert\">\n <ExclamationCircleFill aria-hidden />\n {error}\n </span>\n )}\n </span>\n {isDefined(count) && (\n <span id={countId} className={styles.radio__count}>\n {count}\n </span>\n )}\n </label>\n );\n },\n);\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(Radio, 'Radio')) as typeof Radio;\n"],"names":["Radio","forwardRef","label","hint","error","count","className","id","testId","describedBy","isInvalid","rest","ref","generatedId","useId","baseId","labelId","hintId","errorId","countId","jsxs","cx","styles","jsx","idList","isDefined","ExclamationCircleFill","memo","named"],"mappings":"qaA6BMA,EAAsBC,EAAAA,WAC1B,CACE,CACE,MAAAC,EACA,KAAAC,EACA,MAAAC,EACA,MAAAC,EACA,UAAAC,EACA,GAAAC,EACA,OAAAC,EACA,mBAAoBC,EACpB,eAAgBC,EAChB,GAAGC,CAAA,EAELC,IACG,CAEH,MAAMC,EAAcC,EAAAA,MAAA,EACdC,EAASR,GAAMM,EACfG,EAAU,GAAGD,CAAM,SACnBE,EAAS,GAAGF,CAAM,QAClBG,EAAU,GAAGH,CAAM,SACnBI,EAAU,GAAGJ,CAAM,SAEzB,OACEK,OAAC,SAAM,UAAWC,EAAAA,GAAGC,EAAAA,QAAO,MAAOhB,CAAS,EAAG,cAAaE,EAC1D,SAAA,CAAAe,EAAAA,IAAC,QAAA,CACC,IAAAX,EACA,KAAK,QACL,GAAIG,EACJ,UAAWO,EAAAA,QAAO,aAKlB,kBAAiBE,EAAAA,OAAOR,EAASS,EAAAA,UAAUpB,CAAK,GAAKc,CAAO,EAE5D,mBAAkBK,EAAAA,OAAOpB,GAASc,EAASf,GAAQc,EAAQR,CAAW,EACtE,eAAcL,EAAQ,GAAOM,EAC5B,GAAGC,CAAA,CAAA,EAENS,EAAAA,KAAC,OAAA,CAAK,UAAWE,EAAAA,QAAO,YACtB,SAAA,CAAAC,MAAC,QAAK,GAAIP,EAAS,UAAWM,EAAAA,QAAO,aAClC,SAAApB,EACH,EACCC,SACE,OAAA,CAAK,GAAIc,EAAQ,UAAWK,UAAO,YACjC,SAAAnB,CAAA,CACH,EAEDC,UACE,OAAA,CAAK,GAAIc,EAAS,UAAWI,EAAAA,QAAO,aAAc,KAAK,QACtD,SAAA,CAAAC,EAAAA,IAACG,EAAAA,sBAAA,CAAsB,cAAW,EAAA,CAAC,EAClCtB,CAAA,CAAA,CACH,CAAA,EAEJ,EACCqB,EAAAA,UAAUpB,CAAK,GACdkB,EAAAA,IAAC,OAAA,CAAK,GAAIJ,EAAS,UAAWG,EAAAA,QAAO,aAClC,SAAAjB,CAAA,CACH,CAAA,EAEJ,CAEJ,CACF,EAEAL,EAA6B2B,OAAmBC,EAAAA,MAAM5B,EAAO,OAAO,CAAC"}
|
|
@@ -10,8 +10,8 @@ const a = {"radio":"ui-radio-KoZak","radio__input":"ui-radio__input-gVMgh","radi
|
|
|
10
10
|
const C = /* @__PURE__ */ R(
|
|
11
11
|
({
|
|
12
12
|
label: b,
|
|
13
|
-
hint:
|
|
14
|
-
error:
|
|
13
|
+
hint: e,
|
|
14
|
+
error: d,
|
|
15
15
|
count: o,
|
|
16
16
|
className: f,
|
|
17
17
|
id: _,
|
|
@@ -19,28 +19,28 @@ const C = /* @__PURE__ */ R(
|
|
|
19
19
|
"aria-describedby": h,
|
|
20
20
|
"aria-invalid": I,
|
|
21
21
|
...N
|
|
22
|
-
},
|
|
23
|
-
const
|
|
22
|
+
}, y) => {
|
|
23
|
+
const x = j(), i = _ ?? x, l = `${i}-label`, t = `${i}-hint`, n = `${i}-error`, c = `${i}-count`;
|
|
24
24
|
return /* @__PURE__ */ s("label", { className: g(a.radio, f), "data-testid": u, children: [
|
|
25
25
|
/* @__PURE__ */ r(
|
|
26
26
|
"input",
|
|
27
27
|
{
|
|
28
|
-
ref:
|
|
28
|
+
ref: y,
|
|
29
29
|
type: "radio",
|
|
30
30
|
id: i,
|
|
31
31
|
className: a.radio__input,
|
|
32
32
|
"aria-labelledby": p(l, m(o) && c),
|
|
33
|
-
"aria-describedby": p(
|
|
34
|
-
"aria-invalid":
|
|
33
|
+
"aria-describedby": p(d && n, e && t, h),
|
|
34
|
+
"aria-invalid": d ? !0 : I,
|
|
35
35
|
...N
|
|
36
36
|
}
|
|
37
37
|
),
|
|
38
38
|
/* @__PURE__ */ s("span", { className: a.radio__body, children: [
|
|
39
39
|
/* @__PURE__ */ r("span", { id: l, className: a.radio__label, children: b }),
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
e && /* @__PURE__ */ r("span", { id: t, className: a.radio__hint, children: e }),
|
|
41
|
+
d && /* @__PURE__ */ s("span", { id: n, className: a.radio__error, role: "alert", children: [
|
|
42
42
|
/* @__PURE__ */ r(v, { "aria-hidden": !0 }),
|
|
43
|
-
|
|
43
|
+
d
|
|
44
44
|
] })
|
|
45
45
|
] }),
|
|
46
46
|
m(o) && /* @__PURE__ */ r("span", { id: c, className: a.radio__count, children: o })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type InputHTMLAttributes, memo, type ReactNode, useId } from 'react';\n\nimport { ExclamationCircleFill } from 'react-bootstrap-icons';\n\nimport { isDefined } from '@handijitcom/utils';\n\nimport { idList } from '../../helpers/aria.helper';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n label: ReactNode;\n /** Etiketin altındaki açıklama; `aria-describedby` ile bağlanır. */\n hint?: string;\n /**\n * The error under the label (2.2): the radio is marked invalid (`aria-invalid`) and the message\n * is linked with `aria-describedby`. The error of a whole group belongs on the group (its\n * `radiogroup` element with `aria-invalid`, or a `Field` around it), not on every radio.\n */\n error?: string;\n /** Sağda gösterilen sonuç adedi (filtre listelerinde). */\n count?: number;\n testId?: string;\n};\n\n/** Radyo düğmesi. */\nconst Radio = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n (\n {\n label,\n hint,\n error,\n count,\n className,\n id,\n testId,\n 'aria-describedby': describedBy,\n 'aria-invalid': isInvalid,\n ...rest\n },\n ref,\n ) => {\n /* ⚠ İpucu ADA değil AÇIKLAMAYA bağlanır — gerekçe `Switch`te yazılı. */\n const generatedId = useId();\n const baseId = id ?? generatedId;\n const labelId = `${baseId}-label`;\n const hintId = `${baseId}-hint`;\n const errorId = `${baseId}-error`;\n const countId = `${baseId}-count`;\n\n return (\n <label className={cx(styles.radio, className)} data-testid={testId}>\n <input\n ref={ref}\n type=\"radio\"\n id={baseId}\n className={styles.radio__input}\n /*\n * Sayaç ADIN İÇİNDE KALIR (\"Disk Balata, 128\"): filtre listesinde kaç sonuç olduğu\n * seçimin bir parçası.\n */\n aria-labelledby={idList(labelId, isDefined(count) && countId)}\n /* 2.2: the links are MERGED; a passed `aria-describedby` no longer drops the hint. */\n aria-describedby={idList(error && errorId, hint && hintId, describedBy)}\n aria-invalid={error ? true : isInvalid}\n {...rest}\n />\n <span className={styles.radio__body}>\n <span id={labelId} className={styles.radio__label}>\n {label}\n </span>\n {hint && (\n <span id={hintId} className={styles.radio__hint}>\n {hint}\n </span>\n )}\n {error && (\n <span id={errorId} className={styles.radio__error} role=\"alert\">\n <ExclamationCircleFill aria-hidden />\n {error}\n </span>\n )}\n </span>\n {isDefined(count) && (\n <span id={countId} className={styles.radio__count}>\n {count}\n </span>\n )}\n </label>\n );\n },\n);\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(Radio, 'Radio')) as typeof Radio;\n"],"names":["Radio","forwardRef","label","hint","error","count","className","id","testId","describedBy","isInvalid","rest","ref","generatedId","useId","baseId","labelId","hintId","errorId","countId","jsxs","cx","styles","jsx","idList","isDefined","ExclamationCircleFill","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["'use client';\n\nimport { forwardRef, type InputHTMLAttributes, memo, type ReactNode, useId } from 'react';\n\nimport { ExclamationCircleFill } from 'react-bootstrap-icons';\n\nimport { isDefined } from '@handijitcom/utils';\n\nimport { idList } from '../../helpers/aria.helper';\nimport { cx } from '../../helpers/class-name.helper';\nimport { named } from '../../helpers/component.helper';\n\nimport styles from './index.module.scss';\n\ntype Props = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'> & {\n label: ReactNode;\n /** Etiketin altındaki açıklama; `aria-describedby` ile bağlanır. */\n hint?: string;\n /**\n * The error under the label (2.2): the radio is marked invalid (`aria-invalid`) and the message\n * is linked with `aria-describedby`. The error of a whole group belongs on the group (its\n * `radiogroup` element with `aria-invalid`, or a `Field` around it), not on every radio.\n */\n error?: string;\n /** Sağda gösterilen sonuç adedi (filtre listelerinde). */\n count?: number;\n testId?: string;\n};\n\n/** Radyo düğmesi. */\nconst Radio = /*#__PURE__*/ forwardRef<HTMLInputElement, Props>(\n (\n {\n label,\n hint,\n error,\n count,\n className,\n id,\n testId,\n 'aria-describedby': describedBy,\n 'aria-invalid': isInvalid,\n ...rest\n },\n ref,\n ) => {\n /* ⚠ İpucu ADA değil AÇIKLAMAYA bağlanır — gerekçe `Switch`te yazılı. */\n const generatedId = useId();\n const baseId = id ?? generatedId;\n const labelId = `${baseId}-label`;\n const hintId = `${baseId}-hint`;\n const errorId = `${baseId}-error`;\n const countId = `${baseId}-count`;\n\n return (\n <label className={cx(styles.radio, className)} data-testid={testId}>\n <input\n ref={ref}\n type=\"radio\"\n id={baseId}\n className={styles.radio__input}\n /*\n * Sayaç ADIN İÇİNDE KALIR (\"Disk Balata, 128\"): filtre listesinde kaç sonuç olduğu\n * seçimin bir parçası.\n */\n aria-labelledby={idList(labelId, isDefined(count) && countId)}\n /* 2.2: the links are MERGED; a passed `aria-describedby` no longer drops the hint. */\n aria-describedby={idList(error && errorId, hint && hintId, describedBy)}\n aria-invalid={error ? true : isInvalid}\n {...rest}\n />\n <span className={styles.radio__body}>\n <span id={labelId} className={styles.radio__label}>\n {label}\n </span>\n {hint && (\n <span id={hintId} className={styles.radio__hint}>\n {hint}\n </span>\n )}\n {error && (\n <span id={errorId} className={styles.radio__error} role=\"alert\">\n <ExclamationCircleFill aria-hidden />\n {error}\n </span>\n )}\n </span>\n {isDefined(count) && (\n <span id={countId} className={styles.radio__count}>\n {count}\n </span>\n )}\n </label>\n );\n },\n);\n\nexport default /*#__PURE__*/ memo(/*#__PURE__*/ named(Radio, 'Radio')) as typeof Radio;\n"],"names":["Radio","forwardRef","label","hint","error","count","className","id","testId","describedBy","isInvalid","rest","ref","generatedId","useId","baseId","labelId","hintId","errorId","countId","jsxs","cx","styles","jsx","idList","isDefined","ExclamationCircleFill","Radio$1","memo","named"],"mappings":";;;;;;;;;AA6BA,MAAMA,IAAsB,gBAAAC;AAAA,EAC1B,CACE;AAAA,IACE,OAAAC;AAAA,IACA,MAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,IAAAC;AAAA,IACA,QAAAC;AAAA,IACA,oBAAoBC;AAAA,IACpB,gBAAgBC;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AAEH,UAAMC,IAAcC,EAAA,GACdC,IAASR,KAAMM,GACfG,IAAU,GAAGD,CAAM,UACnBE,IAAS,GAAGF,CAAM,SAClBG,IAAU,GAAGH,CAAM,UACnBI,IAAU,GAAGJ,CAAM;AAEzB,WACE,gBAAAK,EAAC,WAAM,WAAWC,EAAGC,EAAO,OAAOhB,CAAS,GAAG,eAAaE,GAC1D,UAAA;AAAA,MAAA,gBAAAe;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,KAAAX;AAAA,UACA,MAAK;AAAA,UACL,IAAIG;AAAA,UACJ,WAAWO,EAAO;AAAA,UAKlB,mBAAiBE,EAAOR,GAASS,EAAUpB,CAAK,KAAKc,CAAO;AAAA,UAE5D,oBAAkBK,EAAOpB,KAASc,GAASf,KAAQc,GAAQR,CAAW;AAAA,UACtE,gBAAcL,IAAQ,KAAOM;AAAA,UAC5B,GAAGC;AAAA,QAAA;AAAA,MAAA;AAAA,MAEN,gBAAAS,EAAC,QAAA,EAAK,WAAWE,EAAO,aACtB,UAAA;AAAA,QAAA,gBAAAC,EAAC,UAAK,IAAIP,GAAS,WAAWM,EAAO,cAClC,UAAApB,GACH;AAAA,QACCC,uBACE,QAAA,EAAK,IAAIc,GAAQ,WAAWK,EAAO,aACjC,UAAAnB,EAAA,CACH;AAAA,QAEDC,uBACE,QAAA,EAAK,IAAIc,GAAS,WAAWI,EAAO,cAAc,MAAK,SACtD,UAAA;AAAA,UAAA,gBAAAC,EAACG,GAAA,EAAsB,eAAW,GAAA,CAAC;AAAA,UAClCtB;AAAA,QAAA,EAAA,CACH;AAAA,MAAA,GAEJ;AAAA,MACCqB,EAAUpB,CAAK,KACd,gBAAAkB,EAAC,QAAA,EAAK,IAAIJ,GAAS,WAAWG,EAAO,cAClC,UAAAjB,EAAA,CACH;AAAA,IAAA,GAEJ;AAAA,EAEJ;AACF,GAEAsB,IAA6B,gBAAAC,EAAmB,gBAAAC,EAAM7B,GAAO,OAAO,CAAC;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),o=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"}},_=({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=o.memo(_);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 /** 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"
|
|
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"],"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,EAGFL,SAAkCA,CAAa"}
|
|
@@ -3,10 +3,10 @@ import { memo as _ } from "react";
|
|
|
3
3
|
import { cx as i } from "../../helpers/class-name.helper.js";
|
|
4
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
5
|
const p = ({
|
|
6
|
-
title:
|
|
6
|
+
title: c,
|
|
7
7
|
description: r,
|
|
8
8
|
overline: s,
|
|
9
|
-
isOverlineUppercase:
|
|
9
|
+
isOverlineUppercase: m = !0,
|
|
10
10
|
action: d,
|
|
11
11
|
as: h = "h2",
|
|
12
12
|
size: l = "md",
|
|
@@ -19,12 +19,12 @@ const p = ({
|
|
|
19
19
|
{
|
|
20
20
|
className: i(
|
|
21
21
|
e.header__overline,
|
|
22
|
-
!
|
|
22
|
+
!m && e["header__overline--as-written"]
|
|
23
23
|
),
|
|
24
24
|
children: s
|
|
25
25
|
}
|
|
26
26
|
),
|
|
27
|
-
/* @__PURE__ */ a(h, { className: e.header__title, children:
|
|
27
|
+
/* @__PURE__ */ a(h, { className: e.header__title, children: c }),
|
|
28
28
|
r && /* @__PURE__ */ a("p", { className: e.header__description, children: r })
|
|
29
29
|
] }),
|
|
30
30
|
d && /* @__PURE__ */ a("div", { className: e.header__action, children: d })
|
|
@@ -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 /** 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","
|
|
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","SectionHeader$1"],"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__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
|
+
@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(--ui-overline-font, 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 d=require("react/jsx-runtime"),_=require("react"),v=require("../../helpers/class-name.helper.cjs"),A=require("../../helpers/component.helper.cjs"),a={default:{"segmented":"ui-segmented-qo2Bw","segmented--sm":"ui-segmented--sm-7tUry","segmented--md":"ui-segmented--md-PiSqt","segmented__item":"ui-segmented__item-mqRNZ","segmented__item--selected":"ui-segmented__item--selected-r7CLj","segmented--readOnly":"ui-segmented--readOnly-V0PUH","segmented__icon":"ui-segmented__icon-C9CT-","segmented__label":"ui-segmented__label-NVXBv"}},p=({options:s,value:u,onChange:i,label:h,isIconOnly:c,size:x="md",isDisabled:o,isReadOnly:l,id:y,required:
|
|
1
|
+
"use client";"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const d=require("react/jsx-runtime"),_=require("react"),v=require("../../helpers/class-name.helper.cjs"),A=require("../../helpers/component.helper.cjs"),a={default:{"segmented":"ui-segmented-qo2Bw","segmented--sm":"ui-segmented--sm-7tUry","segmented--md":"ui-segmented--md-PiSqt","segmented__item":"ui-segmented__item-mqRNZ","segmented__item--selected":"ui-segmented__item--selected-r7CLj","segmented--readOnly":"ui-segmented--readOnly-V0PUH","segmented__icon":"ui-segmented__icon-C9CT-","segmented__label":"ui-segmented__label-NVXBv"}},p=({options:s,value:u,onChange:i,label:h,isIconOnly:c,size:x="md",isDisabled:o,isReadOnly:l,id:y,required:S,"aria-describedby":q,"aria-invalid":w,className:j,testId:k})=>{const m=_.useRef(null),D=e=>{var b,g;const r=e.key==="ArrowRight"||e.key==="ArrowDown"?1:e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:0;if(r===0||(e.preventDefault(),l||o))return;const t=s.filter(n=>!n.isDisabled);if(t.length===0)return;const N=t.findIndex(n=>n.value===u),f=t[(N+r+t.length)%t.length];i(f.value),(g=(b=m.current)==null?void 0:b.querySelector(`[data-value="${f.value}"]`))==null||g.focus({preventScroll:!0})};return d.jsx("div",{ref:m,id:y,role:"radiogroup","aria-label":h,"aria-describedby":q,"aria-invalid":w||void 0,"aria-required":S||void 0,"aria-readonly":l||void 0,className:v.cx(a.default.segmented,a.default[`segmented--${x}`],l&&a.default["segmented--readOnly"],j),"data-testid":k,onKeyDown:D,children:s.map(e=>{const r=e.value===u;return d.jsxs("button",{type:"button",role:"radio","aria-checked":r,"aria-label":c?e.label:void 0,"data-value":e.value,disabled:o||e.isDisabled,tabIndex:r?0:-1,className:v.cx(a.default.segmented__item,r&&a.default["segmented__item--selected"]),onClick:()=>!r&&!l&&i(e.value),children:[e.icon&&d.jsx("span",{className:a.default.segmented__icon,"aria-hidden":!0,children:e.icon}),!c&&d.jsx("span",{className:a.default.segmented__label,children:e.label})]},e.value)})})},C=_.memo(A.named(p,"SegmentedControl"));exports.default=C;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|