@vkzstudio/muza-ui 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Accordion/Accordion.d.ts +52 -2
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +111 -76
- package/dist/components/ArticleCard/ArticleCard.d.ts +178 -0
- package/dist/components/ArticleCard/ArticleCard.d.ts.map +1 -0
- package/dist/components/ArticleCard/ArticleCard.js +542 -0
- package/dist/components/ArticleCard/ArticleCard.stories.d.ts +14 -0
- package/dist/components/ArticleCard/ArticleCard.stories.d.ts.map +1 -0
- package/dist/components/ArticleCard/index.d.ts +2 -0
- package/dist/components/ArticleCard/index.d.ts.map +1 -0
- package/dist/components/ButtonArrow/ButtonArrow.js +1 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +5 -5
- package/dist/components/Calendar/index.d.ts +1 -2
- package/dist/components/Calendar/index.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.d.ts +9 -0
- package/dist/components/Carousel/Carousel.d.ts.map +1 -1
- package/dist/components/Carousel/Carousel.js +135 -133
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts +34 -0
- package/dist/components/CarouselSection/CarouselSection.examples.d.ts.map +1 -0
- package/dist/components/CarouselSection/CarouselSection.stories.d.ts +8 -0
- package/dist/components/CarouselSection/CarouselSection.stories.d.ts.map +1 -0
- package/dist/components/CategoryCard/CategoryCard.d.ts +97 -0
- package/dist/components/CategoryCard/CategoryCard.d.ts.map +1 -0
- package/dist/components/CategoryCard/CategoryCard.js +152 -0
- package/dist/components/CategoryCard/CategoryCard.stories.d.ts +14 -0
- package/dist/components/CategoryCard/CategoryCard.stories.d.ts.map +1 -0
- package/dist/components/CategoryCard/index.d.ts +2 -0
- package/dist/components/CategoryCard/index.d.ts.map +1 -0
- package/dist/components/CategoryIcon/CategoryIcon.d.ts +45 -0
- package/dist/components/CategoryIcon/CategoryIcon.d.ts.map +1 -0
- package/dist/components/CategoryIcon/CategoryIcon.js +54 -0
- package/dist/components/CategoryIcon/CategoryIcon.stories.d.ts +10 -0
- package/dist/components/CategoryIcon/CategoryIcon.stories.d.ts.map +1 -0
- package/dist/components/CategoryIcon/index.d.ts +2 -0
- package/dist/components/CategoryIcon/index.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +5 -5
- package/dist/components/DotDivider/DotDivider.d.ts +35 -0
- package/dist/components/DotDivider/DotDivider.d.ts.map +1 -0
- package/dist/components/DotDivider/DotDivider.js +31 -0
- package/dist/components/DotDivider/DotDivider.stories.d.ts +10 -0
- package/dist/components/DotDivider/DotDivider.stories.d.ts.map +1 -0
- package/dist/components/DotDivider/index.d.ts +2 -0
- package/dist/components/DotDivider/index.d.ts.map +1 -0
- package/dist/components/HeartButton/HeartButton.d.ts +61 -0
- package/dist/components/HeartButton/HeartButton.d.ts.map +1 -0
- package/dist/components/HeartButton/HeartButton.js +88 -0
- package/dist/components/HeartButton/HeartButton.stories.d.ts +10 -0
- package/dist/components/HeartButton/HeartButton.stories.d.ts.map +1 -0
- package/dist/components/HeartButton/index.d.ts +2 -0
- package/dist/components/HeartButton/index.d.ts.map +1 -0
- package/dist/components/Icons/CustomBadges.d.ts +20 -0
- package/dist/components/Icons/CustomBadges.d.ts.map +1 -1
- package/dist/components/Icons/CustomBadges.js +176 -21
- package/dist/components/Icons/CustomIcons.d.ts +13 -0
- package/dist/components/Icons/CustomIcons.d.ts.map +1 -1
- package/dist/components/Icons/CustomIcons.js +50 -30
- package/dist/components/Icons/LogosAndBadges.stories.d.ts +2 -1
- package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.js +65 -55
- package/dist/components/LoginScreen/LoginScreen.d.ts +10 -1
- package/dist/components/LoginScreen/LoginScreen.d.ts.map +1 -1
- package/dist/components/LoginScreen/LoginScreen.js +23 -17
- package/dist/components/MultiSelect/MultiSelect.js +1 -1
- package/dist/components/OfferCard/OfferCard.d.ts +206 -0
- package/dist/components/OfferCard/OfferCard.d.ts.map +1 -0
- package/dist/components/OfferCard/OfferCard.js +423 -0
- package/dist/components/OfferCard/OfferCard.stories.d.ts +15 -0
- package/dist/components/OfferCard/OfferCard.stories.d.ts.map +1 -0
- package/dist/components/OfferCard/index.d.ts +2 -0
- package/dist/components/OfferCard/index.d.ts.map +1 -0
- package/dist/components/PartnerCard/PartnerCard.d.ts +234 -0
- package/dist/components/PartnerCard/PartnerCard.d.ts.map +1 -0
- package/dist/components/PartnerCard/PartnerCard.js +591 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts +14 -0
- package/dist/components/PartnerCard/PartnerCard.stories.d.ts.map +1 -0
- package/dist/components/PartnerCard/index.d.ts +2 -0
- package/dist/components/PartnerCard/index.d.ts.map +1 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.examples.d.ts +35 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.examples.d.ts.map +1 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.stories.d.ts +11 -0
- package/dist/components/PaymentMethodSelect/PaymentMethodSelect.stories.d.ts.map +1 -0
- package/dist/components/Rating/Rating.d.ts +62 -0
- package/dist/components/Rating/Rating.d.ts.map +1 -0
- package/dist/components/Rating/Rating.js +88 -0
- package/dist/components/Rating/Rating.stories.d.ts +12 -0
- package/dist/components/Rating/Rating.stories.d.ts.map +1 -0
- package/dist/components/Rating/index.d.ts +2 -0
- package/dist/components/Rating/index.d.ts.map +1 -0
- package/dist/components/RatingBlock/RatingBlock.d.ts +65 -0
- package/dist/components/RatingBlock/RatingBlock.d.ts.map +1 -0
- package/dist/components/RatingBlock/RatingBlock.js +92 -0
- package/dist/components/RatingBlock/RatingBlock.stories.d.ts +12 -0
- package/dist/components/RatingBlock/RatingBlock.stories.d.ts.map +1 -0
- package/dist/components/RatingBlock/index.d.ts +2 -0
- package/dist/components/RatingBlock/index.d.ts.map +1 -0
- package/dist/components/ResponsiveLayoutTable/ResponsiveLayoutTable.js +5 -5
- package/dist/components/SearchFilters/SearchFilters.d.ts +88 -0
- package/dist/components/SearchFilters/SearchFilters.d.ts.map +1 -0
- package/dist/components/SearchFilters/SearchFilters.js +176 -0
- package/dist/components/SearchFilters/SearchFilters.stories.d.ts +12 -0
- package/dist/components/SearchFilters/SearchFilters.stories.d.ts.map +1 -0
- package/dist/components/SearchFilters/index.d.ts +2 -0
- package/dist/components/SearchFilters/index.d.ts.map +1 -0
- package/dist/components/Tag/Tag.d.ts.map +1 -1
- package/dist/components/TransactionsListView/TransactionsListView.d.ts +152 -0
- package/dist/components/TransactionsListView/TransactionsListView.d.ts.map +1 -0
- package/dist/components/TransactionsListView/TransactionsListView.js +367 -0
- package/dist/components/TransactionsListView/TransactionsListView.stories.d.ts +12 -0
- package/dist/components/TransactionsListView/TransactionsListView.stories.d.ts.map +1 -0
- package/dist/components/TransactionsListView/index.d.ts +2 -0
- package/dist/components/TransactionsListView/index.d.ts.map +1 -0
- package/dist/components/VoucherCard/VoucherCard.d.ts +105 -0
- package/dist/components/VoucherCard/VoucherCard.d.ts.map +1 -0
- package/dist/components/VoucherCard/VoucherCard.js +167 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts +9 -0
- package/dist/components/VoucherCard/VoucherCard.stories.d.ts.map +1 -0
- package/dist/components/VoucherCard/index.d.ts +2 -0
- package/dist/components/VoucherCard/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +12 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index.js +405 -352
- package/dist/muza-ui.css +1 -1
- package/dist/styles/primitives.css +5 -0
- package/dist/styles/token-colors.css +105 -30
- package/dist/styles/token-sizes.css +24 -0
- package/dist/translations/index.d.ts +2 -1
- package/dist/translations/index.d.ts.map +1 -1
- package/dist/translations/locales/cs.d.ts.map +1 -1
- package/dist/translations/locales/cs.js +30 -2
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +26 -2
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +30 -2
- package/dist/translations/resolvePluralTemplate.d.ts +10 -0
- package/dist/translations/resolvePluralTemplate.d.ts.map +1 -0
- package/dist/translations/resolvePluralTemplate.js +20 -0
- package/dist/translations/types.d.ts +57 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +116 -24
- package/dist/utils/disabledLinkProps.d.ts +14 -0
- package/dist/utils/disabledLinkProps.d.ts.map +1 -0
- package/dist/utils/disabledLinkProps.js +9 -0
- package/dist/{components/Calendar/utils → utils}/formatDate.d.ts +1 -1
- package/dist/utils/formatDate.d.ts.map +1 -0
- package/dist/utils/formatDateRange.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/components/Calendar/utils/formatDate.d.ts.map +0 -1
- package/dist/components/Calendar/utils/formatDateRange.d.ts.map +0 -1
- /package/dist/{components/Calendar/utils → utils}/formatDate.js +0 -0
- /package/dist/{components/Calendar/utils → utils}/formatDateRange.d.ts +0 -0
- /package/dist/{components/Calendar/utils → utils}/formatDateRange.js +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the Rating component.
|
|
4
|
+
*/
|
|
5
|
+
export interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
6
|
+
/**
|
|
7
|
+
* Controlled rating value. Use with `onValueChange`.
|
|
8
|
+
*
|
|
9
|
+
* Fractional values are rounded for display:
|
|
10
|
+
* - Without `allowHalf` (default): standard half-up rounding — `< n - 0.5` is empty, `>= n - 0.5` is full.
|
|
11
|
+
* - With `allowHalf`: `< n - 0.75` is empty, `[n - 0.75, n - 0.25)` is half, `>= n - 0.25` is full.
|
|
12
|
+
*
|
|
13
|
+
* If you need a different rounding policy (e.g. always floor, always ceil, banker's rounding), pre-process the value yourself before passing it in.
|
|
14
|
+
*/
|
|
15
|
+
value?: number;
|
|
16
|
+
/** Initial rating value for uncontrolled usage. Follows the same rounding rules as `value`. @default 0 */
|
|
17
|
+
defaultValue?: number;
|
|
18
|
+
/** Fires when a star is selected via click or keyboard. Receives the new integer rating. Provide this to make the rating interactive. */
|
|
19
|
+
onValueChange?: (value: number) => void;
|
|
20
|
+
/** Total number of stars displayed. @default 5 */
|
|
21
|
+
count?: number;
|
|
22
|
+
/** When true, fractional `value` renders a half star at the `[n - 0.75, n - 0.25)` boundary (see `value` for the full rule). Does not affect click behavior — clicks always select whole stars. @default false */
|
|
23
|
+
allowHalf?: boolean;
|
|
24
|
+
/** Prevents interaction and applies disabled styling. @default false */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** Accessible label for the rating group. Defaults to `translations.rating.groupLabel`. */
|
|
27
|
+
'aria-label'?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Template for each star's aria-label. Use `{count}` as the placeholder for
|
|
30
|
+
* the star number (e.g. `'{count} stars'`). When omitted, the localized
|
|
31
|
+
* plural form from translations is used (`translations.rating.starLabel`).
|
|
32
|
+
*/
|
|
33
|
+
starAriaLabel?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A star-based rating component for displaying or capturing a numeric score.
|
|
37
|
+
*
|
|
38
|
+
* Renders a configurable number of stars filled according to a numeric value,
|
|
39
|
+
* with optional half-star rendering for fractional values. Has a dual role:
|
|
40
|
+
*
|
|
41
|
+
* - **Display mode** (no `onValueChange`): renders as `role="img"` with an
|
|
42
|
+
* aria-label describing the rating.
|
|
43
|
+
* - **Interactive mode** (with `onValueChange`): renders as `role="radiogroup"`
|
|
44
|
+
* with per-star `role="radio"` buttons, full keyboard support
|
|
45
|
+
* (Arrow keys, Home, End), and roving tabindex.
|
|
46
|
+
*
|
|
47
|
+
* Star aria-labels are pluralized via `useMuzaTranslationContext` and can be
|
|
48
|
+
* overridden with `starAriaLabel` / `aria-label`.
|
|
49
|
+
*
|
|
50
|
+
* @component
|
|
51
|
+
* @example
|
|
52
|
+
* // Read-only display
|
|
53
|
+
* <Rating value={4.5} allowHalf />
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Interactive (controlled)
|
|
57
|
+
* const [value, setValue] = useState(0)
|
|
58
|
+
* <Rating value={value} onValueChange={setValue} />
|
|
59
|
+
*/
|
|
60
|
+
declare const Rating: React.ForwardRefExoticComponent<RatingProps & React.RefAttributes<HTMLDivElement>>;
|
|
61
|
+
export { Rating };
|
|
62
|
+
//# sourceMappingURL=Rating.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rating.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/Rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAyB9B;;GAEG;AACH,MAAM,WAAW,WACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D;;;;;;;;OAQG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,0GAA0G;IAC1G,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,yIAAyI;IACzI,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACvC,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kNAAkN;IAClN,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,2FAA2F;IAC3F,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,QAAA,MAAM,MAAM,oFAoIX,CAAA;AAGD,OAAO,EAAE,MAAM,EAAE,CAAA"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { useMuzaTranslationContext as _ } from "../../translations/TranslationContext.js";
|
|
4
|
+
import { HalfStar as z } from "../Icons/CustomIcons.js";
|
|
5
|
+
import { resolvePluralTemplate as C } from "../../translations/resolvePluralTemplate.js";
|
|
6
|
+
import { cn as y } from "../../utils/cn.js";
|
|
7
|
+
import { StarBold as F } from "@solar-icons/react-perf";
|
|
8
|
+
const T = (l, m, p) => Array.from({ length: m }, (s, n) => {
|
|
9
|
+
const c = n + 1;
|
|
10
|
+
return p ? l >= c - 0.25 ? "full" : l >= c - 0.75 ? "half" : "empty" : l >= c - 0.5 ? "full" : "empty";
|
|
11
|
+
}), j = a.forwardRef(
|
|
12
|
+
({
|
|
13
|
+
className: l,
|
|
14
|
+
value: m,
|
|
15
|
+
defaultValue: p = 0,
|
|
16
|
+
onValueChange: s,
|
|
17
|
+
count: n = 5,
|
|
18
|
+
allowHalf: c = !1,
|
|
19
|
+
disabled: d = !1,
|
|
20
|
+
"aria-label": k,
|
|
21
|
+
starAriaLabel: I,
|
|
22
|
+
...R
|
|
23
|
+
}, A) => {
|
|
24
|
+
const { locale: D, translations: M } = _(), L = k ?? M.rating.groupLabel, [N, E] = a.useState(p), [S, u] = a.useState(null), b = m !== void 0, r = b ? m : N, i = !!s && !d, [B, g] = a.useState(
|
|
25
|
+
() => Math.max(0, Math.ceil(r) - 1)
|
|
26
|
+
);
|
|
27
|
+
a.useEffect(() => {
|
|
28
|
+
g(Math.max(0, Math.ceil(r) - 1));
|
|
29
|
+
}, [r]);
|
|
30
|
+
const h = a.useRef([]);
|
|
31
|
+
h.current.length = n;
|
|
32
|
+
const x = T(r, n, c), H = d ? x.map(() => "empty") : i && S !== null ? x.map((e, t) => t <= S ? "full" : "empty") : x, w = (e) => {
|
|
33
|
+
b || E(e), s == null || s(e);
|
|
34
|
+
};
|
|
35
|
+
return /* @__PURE__ */ f(
|
|
36
|
+
"div",
|
|
37
|
+
{
|
|
38
|
+
ref: A,
|
|
39
|
+
role: i ? "radiogroup" : "img",
|
|
40
|
+
"aria-label": L,
|
|
41
|
+
onKeyDown: i ? (e) => {
|
|
42
|
+
var o;
|
|
43
|
+
if (!i) return;
|
|
44
|
+
let t = null;
|
|
45
|
+
e.key === "ArrowRight" || e.key === "ArrowUp" ? t = Math.min(n, Math.ceil(r) + 1) : e.key === "ArrowLeft" || e.key === "ArrowDown" ? t = Math.max(1, Math.ceil(r) - 1) : e.key === "Home" ? t = 1 : e.key === "End" && (t = n), t !== null && (e.preventDefault(), w(t), g(t - 1), (o = h.current[t - 1]) == null || o.focus());
|
|
46
|
+
} : void 0,
|
|
47
|
+
className: y(
|
|
48
|
+
"inline-flex items-center [&_svg]:size-icon-xsmall",
|
|
49
|
+
l
|
|
50
|
+
),
|
|
51
|
+
...R,
|
|
52
|
+
children: H.map((e, t) => {
|
|
53
|
+
const o = t + 1, v = /* @__PURE__ */ f(e === "half" ? z : F, { className: y(e === "empty" ? "text-comp-rating-star-empty" : "text-comp-rating-star-default", "transition-colors") });
|
|
54
|
+
return i ? /* @__PURE__ */ f(
|
|
55
|
+
"button",
|
|
56
|
+
{
|
|
57
|
+
ref: (K) => {
|
|
58
|
+
h.current[t] = K;
|
|
59
|
+
},
|
|
60
|
+
type: "button",
|
|
61
|
+
role: "radio",
|
|
62
|
+
"aria-checked": Math.ceil(r) === o,
|
|
63
|
+
"aria-label": (I ?? C(
|
|
64
|
+
o,
|
|
65
|
+
D,
|
|
66
|
+
M.rating.starLabel
|
|
67
|
+
)).replace("{count}", String(o)),
|
|
68
|
+
disabled: d,
|
|
69
|
+
tabIndex: t === B ? 0 : -1,
|
|
70
|
+
onClick: () => w(o),
|
|
71
|
+
onMouseEnter: () => u(t),
|
|
72
|
+
onMouseLeave: () => u(null),
|
|
73
|
+
onFocus: () => u(t),
|
|
74
|
+
onBlur: () => u(null),
|
|
75
|
+
className: "cursor-pointer rounded-2xs px-3xs focus-visible-default disabled:cursor-not-allowed",
|
|
76
|
+
children: v
|
|
77
|
+
},
|
|
78
|
+
t
|
|
79
|
+
) : /* @__PURE__ */ f("span", { className: y(t > 0 && "ml-2xs"), children: v }, t);
|
|
80
|
+
})
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
);
|
|
85
|
+
j.displayName = "Rating";
|
|
86
|
+
export {
|
|
87
|
+
j as Rating
|
|
88
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Rating } from './Rating';
|
|
3
|
+
declare const meta: Meta<typeof Rating>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Rating>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const AllStates: Story;
|
|
8
|
+
export declare const Interactive: Story;
|
|
9
|
+
export declare const Uncontrolled: Story;
|
|
10
|
+
export declare const CustomCount: Story;
|
|
11
|
+
export declare const Rounding: Story;
|
|
12
|
+
//# sourceMappingURL=Rating.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Rating.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/Rating.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,MAAM,CAuD7B,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,MAAM,CAAC,CAAA;AAEpC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAsCvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KA4BzB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAa1B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAczB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0CtB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Rating/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the RatingBlock component.
|
|
4
|
+
*/
|
|
5
|
+
export interface RatingBlockProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
6
|
+
/** Average rating value (e.g. 4.9). Forwarded to the underlying `Rating`. */
|
|
7
|
+
value: number;
|
|
8
|
+
/**
|
|
9
|
+
* Number of reviews used for the caption text. Distinct from `Rating`'s
|
|
10
|
+
* `count` prop (which controls the number of stars). Negative values clamp
|
|
11
|
+
* to 0; non-integers are floored for display and plural selection.
|
|
12
|
+
*
|
|
13
|
+
* When `0`, the block renders the empty state: muted "0,0", all-empty stars,
|
|
14
|
+
* and the empty caption (`emptyText` or `t.ratingBlock.empty`).
|
|
15
|
+
*/
|
|
16
|
+
reviewsCount: number;
|
|
17
|
+
/** Number of stars rendered by the underlying `Rating`. @default 5 */
|
|
18
|
+
starCount?: number;
|
|
19
|
+
/** Forwarded to `Rating` — render a half star for fractional values. @default false */
|
|
20
|
+
allowHalf?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Custom formatter for the big numeric value. Takes precedence over
|
|
23
|
+
* `numberFormatOptions`. Defaults to
|
|
24
|
+
* `Intl.NumberFormat(locale, { minimumFractionDigits: 1, maximumFractionDigits: 1 })`.
|
|
25
|
+
*/
|
|
26
|
+
formatValue?: (value: number) => string;
|
|
27
|
+
/**
|
|
28
|
+
* Merged onto the default options `{ minimumFractionDigits: 1, maximumFractionDigits: 1 }`
|
|
29
|
+
* when constructing the locale number formatter. Ignored if `formatValue` is provided.
|
|
30
|
+
*/
|
|
31
|
+
numberFormatOptions?: Intl.NumberFormatOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Full override for the populated-state caption. Use `{count}` placeholder
|
|
34
|
+
* for the locale-formatted review count. When provided, bypasses pluralization.
|
|
35
|
+
*/
|
|
36
|
+
countText?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Full override for the empty-state caption. Use to add a contextual subject
|
|
39
|
+
* back in (e.g. `"Zatím nikdo nehodnotil partnera"`).
|
|
40
|
+
*/
|
|
41
|
+
emptyText?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Composes a rating-summary card pairing a big numeric value, the `Rating`
|
|
45
|
+
* stars, and a localized review-count caption inside a `Card variant="market"`
|
|
46
|
+
* surface.
|
|
47
|
+
*
|
|
48
|
+
* Drives the visual "empty" state (muted number, all-empty stars, empty
|
|
49
|
+
* caption) solely from `reviewsCount === 0` — a populated card with
|
|
50
|
+
* `value === 0` still renders the normal dark number and pluralized caption.
|
|
51
|
+
*
|
|
52
|
+
* Formats numbers and pluralizes captions via `Intl.NumberFormat` and
|
|
53
|
+
* `Intl.PluralRules` against the current `TranslationProvider` locale, so the
|
|
54
|
+
* caption agrees grammatically in Slavic locales (cs/sk) out of the box.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* <RatingBlock value={4.9} reviewsCount={11} allowHalf />
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* // Add contextual subject back into the empty text
|
|
61
|
+
* <RatingBlock value={0} reviewsCount={0} emptyText="Zatím nikdo nehodnotil partnera" />
|
|
62
|
+
*/
|
|
63
|
+
declare const RatingBlock: React.ForwardRefExoticComponent<RatingBlockProps & React.RefAttributes<HTMLDivElement>>;
|
|
64
|
+
export { RatingBlock };
|
|
65
|
+
//# sourceMappingURL=RatingBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RatingBlock.d.ts","sourceRoot":"","sources":["../../../src/components/RatingBlock/RatingBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAW9B;;GAEG;AACH,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D,6EAA6E;IAC7E,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAA;IACpB,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,uFAAuF;IACvF,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAA;IAC9C;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,WAAW,yFAwFhB,CAAA;AAGD,OAAO,EAAE,WAAW,EAAE,CAAA"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { useMuzaTranslationContext as b } from "../../translations/TranslationContext.js";
|
|
4
|
+
import { resolvePluralTemplate as M } from "../../translations/resolvePluralTemplate.js";
|
|
5
|
+
import { Card as B } from "../Card/Card.js";
|
|
6
|
+
import { cn as p } from "../../utils/cn.js";
|
|
7
|
+
import { Typography as u } from "../Typography/Typography.js";
|
|
8
|
+
import { Flex as C } from "../Flex/Flex.js";
|
|
9
|
+
import { Rating as z } from "../Rating/Rating.js";
|
|
10
|
+
const T = n.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
value: i,
|
|
13
|
+
reviewsCount: d,
|
|
14
|
+
starCount: f = 5,
|
|
15
|
+
allowHalf: x = !1,
|
|
16
|
+
formatValue: e,
|
|
17
|
+
numberFormatOptions: m,
|
|
18
|
+
countText: g,
|
|
19
|
+
emptyText: h,
|
|
20
|
+
className: k,
|
|
21
|
+
...y
|
|
22
|
+
}, v) => {
|
|
23
|
+
const { locale: t, translations: s } = b(), r = Math.max(0, Math.floor(d)), a = r === 0, l = n.useMemo(() => {
|
|
24
|
+
if (e) return e;
|
|
25
|
+
const N = new Intl.NumberFormat(t, {
|
|
26
|
+
minimumFractionDigits: 1,
|
|
27
|
+
maximumFractionDigits: 1,
|
|
28
|
+
...m
|
|
29
|
+
});
|
|
30
|
+
return (R) => N.format(R);
|
|
31
|
+
}, [e, t, m])(a ? 0 : i), w = n.useMemo(
|
|
32
|
+
() => new Intl.NumberFormat(t).format(r),
|
|
33
|
+
[t, r]
|
|
34
|
+
), F = a ? h ?? s.ratingBlock.empty : (g ?? M(
|
|
35
|
+
r,
|
|
36
|
+
t,
|
|
37
|
+
s.ratingBlock.users
|
|
38
|
+
)).replace("{count}", w);
|
|
39
|
+
return /* @__PURE__ */ c(
|
|
40
|
+
B,
|
|
41
|
+
{
|
|
42
|
+
ref: v,
|
|
43
|
+
variant: "market",
|
|
44
|
+
direction: "row",
|
|
45
|
+
align: "center",
|
|
46
|
+
gap: "xl",
|
|
47
|
+
className: p("w-full", k),
|
|
48
|
+
...y,
|
|
49
|
+
children: [
|
|
50
|
+
/* @__PURE__ */ o(
|
|
51
|
+
u,
|
|
52
|
+
{
|
|
53
|
+
component: "span",
|
|
54
|
+
variant: "title",
|
|
55
|
+
size: "3xl",
|
|
56
|
+
weight: "medium",
|
|
57
|
+
className: p("text-text-dark-primary-def", {
|
|
58
|
+
"text-text-dark-disabled": a
|
|
59
|
+
}),
|
|
60
|
+
children: l
|
|
61
|
+
}
|
|
62
|
+
),
|
|
63
|
+
/* @__PURE__ */ c(C, { direction: "column", align: "start", gap: "2xs", children: [
|
|
64
|
+
/* @__PURE__ */ o(
|
|
65
|
+
z,
|
|
66
|
+
{
|
|
67
|
+
value: a ? 0 : i,
|
|
68
|
+
count: f,
|
|
69
|
+
allowHalf: x,
|
|
70
|
+
"aria-label": l
|
|
71
|
+
}
|
|
72
|
+
),
|
|
73
|
+
/* @__PURE__ */ o(
|
|
74
|
+
u,
|
|
75
|
+
{
|
|
76
|
+
component: "span",
|
|
77
|
+
variant: "body",
|
|
78
|
+
size: "sm",
|
|
79
|
+
className: "text-text-dark-secondary",
|
|
80
|
+
children: F
|
|
81
|
+
}
|
|
82
|
+
)
|
|
83
|
+
] })
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
T.displayName = "RatingBlock";
|
|
90
|
+
export {
|
|
91
|
+
T as RatingBlock
|
|
92
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { RatingBlock } from './RatingBlock';
|
|
3
|
+
declare const meta: Meta<typeof RatingBlock>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof RatingBlock>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Empty: Story;
|
|
8
|
+
export declare const CustomCount: Story;
|
|
9
|
+
export declare const DifferentLocales: Story;
|
|
10
|
+
export declare const ConsumerOverride: Story;
|
|
11
|
+
export declare const PopulatedZero: Story;
|
|
12
|
+
//# sourceMappingURL=RatingBlock.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RatingBlock.stories.d.ts","sourceRoot":"","sources":["../../../src/components/RatingBlock/RatingBlock.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CA4ClC,CAAA;AAED,eAAe,IAAI,CAAA;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAWzC,eAAO,MAAM,OAAO,EAAE,KAerB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAcnB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAgBzB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KA2C9B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KA8B9B,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,KAc3B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RatingBlock/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { useBreakpoints as E } from "../../hooks/use-is-breakpoint.js";
|
|
4
|
-
import { Skeleton as H } from "../Skeleton/Skeleton.js";
|
|
5
4
|
import { cn as l } from "../../utils/cn.js";
|
|
6
|
-
import { typographyVariants as
|
|
5
|
+
import { typographyVariants as H, Typography as S } from "../Typography/Typography.js";
|
|
6
|
+
import { Skeleton as V } from "../Skeleton/Skeleton.js";
|
|
7
7
|
const J = ({
|
|
8
8
|
data: y,
|
|
9
9
|
layouts: n,
|
|
@@ -50,7 +50,7 @@ const J = ({
|
|
|
50
50
|
"th",
|
|
51
51
|
{
|
|
52
52
|
className: l(
|
|
53
|
-
|
|
53
|
+
H({
|
|
54
54
|
size: "sm",
|
|
55
55
|
uppercase: !0,
|
|
56
56
|
variant: "body",
|
|
@@ -100,8 +100,8 @@ const J = ({
|
|
|
100
100
|
i && "relative",
|
|
101
101
|
t.className
|
|
102
102
|
),
|
|
103
|
-
children: a ? t.skeleton ?? /* @__PURE__ */ r(
|
|
104
|
-
|
|
103
|
+
children: a ? t.skeleton ?? /* @__PURE__ */ r(V, { color: "light", className: "h-4 w-full" }) : t.render ? t.render(e, s, o) : /* @__PURE__ */ r(
|
|
104
|
+
S,
|
|
105
105
|
{
|
|
106
106
|
variant: "body",
|
|
107
107
|
size: "base",
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { ButtonProps } from '../Button';
|
|
2
|
+
import { CarouselOptions } from '../Carousel';
|
|
3
|
+
import { SearchbarProps } from '../Searchbar';
|
|
4
|
+
import { SkeletonProps } from '../Skeleton';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
/**
|
|
7
|
+
* Props for the SearchFilters component.
|
|
8
|
+
*
|
|
9
|
+
* A filter bar typically used at the top of a map / search results screen — a
|
|
10
|
+
* location searchbar on the left, an optional back button, and a horizontally
|
|
11
|
+
* scrollable list of filter chips (wrapped in a Carousel) on the right.
|
|
12
|
+
*
|
|
13
|
+
* Bring your own filter children — any combination of `Button`, `Toggle`,
|
|
14
|
+
* `Chip`, etc. works. Each child is rendered as a `CarouselItem` with
|
|
15
|
+
* natural width.
|
|
16
|
+
*/
|
|
17
|
+
export interface SearchFiltersProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
18
|
+
/**
|
|
19
|
+
* Props forwarded to the internal `Searchbar` (e.g. `placeholder`,
|
|
20
|
+
* `defaultValue`, `onChange`, `onSubmit`). When omitted, the searchbar
|
|
21
|
+
* row is not rendered.
|
|
22
|
+
*/
|
|
23
|
+
searchbarProps?: SearchbarProps;
|
|
24
|
+
/**
|
|
25
|
+
* Renders a leading back `Button` before the searchbar (for navigating to
|
|
26
|
+
* the previous screen). Pass the `Button` props to wire it up — at minimum
|
|
27
|
+
* an `onClick` and an `aria-label`. Defaults to `variant="tertiary"`,
|
|
28
|
+
* `size="icon"` and a left-arrow `icon`; any of these can be overridden.
|
|
29
|
+
* Omit entirely to hide the back slot. Hidden by default on desktop — pass
|
|
30
|
+
* `backVisibleOnDesktop` to override.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* <SearchFilters back={{ onClick: goBack, 'aria-label': 'Back' }} />
|
|
34
|
+
*/
|
|
35
|
+
back?: ButtonProps;
|
|
36
|
+
/**
|
|
37
|
+
* When true, keeps the `back` slot visible at `md` and above. Otherwise it
|
|
38
|
+
* is hidden from `md` up (matches the Figma spec where the back button only
|
|
39
|
+
* appears on tablet / mobile).
|
|
40
|
+
*
|
|
41
|
+
* @default false
|
|
42
|
+
*/
|
|
43
|
+
backVisibleOnDesktop?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Filter elements rendered inside the embedded carousel. Each child is
|
|
46
|
+
* placed in a `CarouselItem` with `basis-auto` so it keeps its natural
|
|
47
|
+
* width.
|
|
48
|
+
*/
|
|
49
|
+
children?: React.ReactNode;
|
|
50
|
+
/**
|
|
51
|
+
* Embla options forwarded to the internal `Carousel`'s `options` prop. The
|
|
52
|
+
* carousel is rendered with `align="start"` and the Carousel's own
|
|
53
|
+
* `skipSnaps: true`, so a longer drag crosses several chips before snapping;
|
|
54
|
+
* anything set here is merged over those and wins (e.g. pass `align` to
|
|
55
|
+
* change the alignment). Note that `dragFree` is intentionally not enabled —
|
|
56
|
+
* without it the carousel snaps the dragged track to the nearest item and
|
|
57
|
+
* the scroll-prev / scroll-next boundary detection stays consistent.
|
|
58
|
+
*/
|
|
59
|
+
carouselOpts?: CarouselOptions;
|
|
60
|
+
/**
|
|
61
|
+
* Toggles the scroll-prev / scroll-next arrow buttons overlaid on the
|
|
62
|
+
* filter list edges. Arrows are always hidden below `md` (where the
|
|
63
|
+
* filter strip stacks below the searchbar); on `md+` each button is also
|
|
64
|
+
* unmounted automatically once the carousel hits that boundary (see
|
|
65
|
+
* {@link CarouselNavButtonProps.hideWhenDisabled}).
|
|
66
|
+
*
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
showArrows?: boolean;
|
|
70
|
+
}
|
|
71
|
+
declare const SearchFilters: React.ForwardRefExoticComponent<SearchFiltersProps & React.RefAttributes<HTMLDivElement>>;
|
|
72
|
+
/** Props for the {@link SearchFiltersSkeleton} component. */
|
|
73
|
+
export type SearchFiltersSkeletonProps = {
|
|
74
|
+
/** Number of filter-chip placeholders rendered after the searchbar. @default 4 */
|
|
75
|
+
chips?: number;
|
|
76
|
+
} & SkeletonProps;
|
|
77
|
+
/**
|
|
78
|
+
* Loading placeholder matching the `SearchFilters` bar — a searchbar block,
|
|
79
|
+
* a desktop-only vertical divider, then a row of pill-shaped filter-chip
|
|
80
|
+
* blocks. Stacks on mobile and lays out inline from `md` up, mirroring the
|
|
81
|
+
* real component.
|
|
82
|
+
*/
|
|
83
|
+
declare const SearchFiltersSkeleton: {
|
|
84
|
+
({ className, color, chips, ...props }: SearchFiltersSkeletonProps): import("react/jsx-runtime").JSX.Element;
|
|
85
|
+
displayName: string;
|
|
86
|
+
};
|
|
87
|
+
export { SearchFilters, SearchFiltersSkeleton };
|
|
88
|
+
//# sourceMappingURL=SearchFilters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchFilters.d.ts","sourceRoot":"","sources":["../../../src/components/SearchFilters/SearchFilters.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAKL,KAAK,eAAe,EAErB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAAa,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7D,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAE1D;;;;;;;;;;GAUG;AACH,MAAM,WAAW,kBACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC;IAC9D;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,WAAW,CAAA;IAClB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,eAAe,CAAA;IAC9B;;;;;;;;OAQG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB;AAED,QAAA,MAAM,aAAa,2FA2HlB,CAAA;AAGD,6DAA6D;AAC7D,MAAM,MAAM,0BAA0B,GAAG;IACvC,kFAAkF;IAClF,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,aAAa,CAAA;AAEjB;;;;;GAKG;AACH,QAAA,MAAM,qBAAqB;4CAKxB,0BAA0B;;CA4B5B,CAAA;AAGD,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as N } from "react/jsx-runtime";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { Button as w } from "../Button/Button.js";
|
|
4
|
+
import { Searchbar as k } from "../Searchbar/Searchbar.js";
|
|
5
|
+
import { Carousel as y, CarouselContent as v, CarouselItem as S, CarouselPrevious as C, CarouselNext as F } from "../Carousel/Carousel.js";
|
|
6
|
+
import { Flex as m } from "../Flex/Flex.js";
|
|
7
|
+
import { cn as l } from "../../utils/cn.js";
|
|
8
|
+
import { ArrowLeftOutline as A } from "@solar-icons/react-perf";
|
|
9
|
+
import { Skeleton as f } from "../Skeleton/Skeleton.js";
|
|
10
|
+
const R = n.forwardRef(
|
|
11
|
+
({
|
|
12
|
+
className: t,
|
|
13
|
+
searchbarProps: r,
|
|
14
|
+
back: a,
|
|
15
|
+
backVisibleOnDesktop: i = !1,
|
|
16
|
+
children: c,
|
|
17
|
+
carouselOpts: d,
|
|
18
|
+
showArrows: u = !0,
|
|
19
|
+
...x
|
|
20
|
+
}, b) => {
|
|
21
|
+
const h = !!(r || a), p = n.Children.toArray(c).filter(n.isValidElement);
|
|
22
|
+
return /* @__PURE__ */ s(
|
|
23
|
+
m,
|
|
24
|
+
{
|
|
25
|
+
ref: b,
|
|
26
|
+
direction: "column",
|
|
27
|
+
"data-slot": "search-filters",
|
|
28
|
+
className: l(
|
|
29
|
+
"w-full bg-surface-base-secondary",
|
|
30
|
+
"md:flex-row md:items-center md:gap-2xl md:px-2xl md:py-xl",
|
|
31
|
+
t
|
|
32
|
+
),
|
|
33
|
+
...x,
|
|
34
|
+
children: [
|
|
35
|
+
h && /* @__PURE__ */ s(
|
|
36
|
+
m,
|
|
37
|
+
{
|
|
38
|
+
"data-slot": "search-filters-bar",
|
|
39
|
+
align: "center",
|
|
40
|
+
gap: "md",
|
|
41
|
+
padding: { px: "xl", py: "lg" },
|
|
42
|
+
className: l(
|
|
43
|
+
"border-b border-stroke-base-primary",
|
|
44
|
+
"md:border-b-0 md:p-0"
|
|
45
|
+
),
|
|
46
|
+
children: [
|
|
47
|
+
a && /* @__PURE__ */ e(
|
|
48
|
+
m,
|
|
49
|
+
{
|
|
50
|
+
"data-slot": "search-filters-back",
|
|
51
|
+
align: "center",
|
|
52
|
+
className: l("shrink-0", !i && "md:hidden"),
|
|
53
|
+
children: /* @__PURE__ */ e(
|
|
54
|
+
w,
|
|
55
|
+
{
|
|
56
|
+
variant: "tertiary",
|
|
57
|
+
size: "icon",
|
|
58
|
+
icon: /* @__PURE__ */ e(A, {}),
|
|
59
|
+
...a
|
|
60
|
+
}
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
r && /* @__PURE__ */ e("div", { className: "flex-1 md:w-[280px] md:flex-none", children: /* @__PURE__ */ e(k, { ...r }) })
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
),
|
|
68
|
+
h && /* @__PURE__ */ e(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
"aria-hidden": !0,
|
|
72
|
+
className: "hidden h-comp-button-h-sm w-px shrink-0 bg-stroke-base-primary md:block"
|
|
73
|
+
}
|
|
74
|
+
),
|
|
75
|
+
/* @__PURE__ */ e(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
"data-slot": "search-filters-list",
|
|
79
|
+
className: l(
|
|
80
|
+
// No horizontal padding here so the chip carousel runs full-bleed
|
|
81
|
+
// to the viewport edges; the leading/trailing chip insets live on
|
|
82
|
+
// the first/last CarouselItem so they survive Embla's scroll
|
|
83
|
+
// trimming and only show at the scroll extremes.
|
|
84
|
+
"relative min-w-0 py-lg",
|
|
85
|
+
// Mobile gets a bottom divider below the toggle row, matching the
|
|
86
|
+
// divider above between the searchbar and the toggles.
|
|
87
|
+
"border-b border-stroke-base-primary",
|
|
88
|
+
// Desktop: pull the right edge out past the bar's px-2xl so chips
|
|
89
|
+
// bleed to the viewport's right edge (left stays inset by the bar).
|
|
90
|
+
"md:-mr-2xl md:flex-1 md:border-b-0 md:p-0"
|
|
91
|
+
),
|
|
92
|
+
children: /* @__PURE__ */ s(y, { align: "start", options: d, className: "w-full", children: [
|
|
93
|
+
/* @__PURE__ */ e(v, { className: "!ml-0 items-center gap-xs", children: p.map((g, o) => /* @__PURE__ */ e(
|
|
94
|
+
S,
|
|
95
|
+
{
|
|
96
|
+
className: l(
|
|
97
|
+
"!basis-auto !pl-0",
|
|
98
|
+
// First/last chips carry the leading/trailing inset so the
|
|
99
|
+
// strip rests with padding at the scroll extremes while
|
|
100
|
+
// still bleeding to the edges mid-scroll. Mobile/tablet use
|
|
101
|
+
// the bar's xl inset; desktop uses the container's 2xl.
|
|
102
|
+
o === 0 && "!pl-xl md:!pl-0",
|
|
103
|
+
o === p.length - 1 && "pr-xl md:pr-2xl"
|
|
104
|
+
),
|
|
105
|
+
children: g
|
|
106
|
+
},
|
|
107
|
+
o
|
|
108
|
+
)) }),
|
|
109
|
+
u && /* @__PURE__ */ s(N, { children: [
|
|
110
|
+
/* @__PURE__ */ e(
|
|
111
|
+
C,
|
|
112
|
+
{
|
|
113
|
+
hideWhenDisabled: !0,
|
|
114
|
+
className: "hidden md:left-0 md:flex"
|
|
115
|
+
}
|
|
116
|
+
),
|
|
117
|
+
/* @__PURE__ */ e(
|
|
118
|
+
F,
|
|
119
|
+
{
|
|
120
|
+
hideWhenDisabled: !0,
|
|
121
|
+
className: "hidden md:right-2xl md:flex"
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] })
|
|
125
|
+
] })
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
]
|
|
129
|
+
}
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
R.displayName = "SearchFilters";
|
|
134
|
+
const j = ({
|
|
135
|
+
className: t,
|
|
136
|
+
color: r = "default",
|
|
137
|
+
chips: a = 4,
|
|
138
|
+
...i
|
|
139
|
+
}) => /* @__PURE__ */ s(
|
|
140
|
+
m,
|
|
141
|
+
{
|
|
142
|
+
direction: "column",
|
|
143
|
+
gap: "2xl",
|
|
144
|
+
className: l("w-full md:flex-row md:items-center", t),
|
|
145
|
+
...i,
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ e(
|
|
148
|
+
f,
|
|
149
|
+
{
|
|
150
|
+
color: r,
|
|
151
|
+
className: "h-comp-input-h-small w-full shrink-0 rounded-full md:w-[280px]"
|
|
152
|
+
}
|
|
153
|
+
),
|
|
154
|
+
/* @__PURE__ */ e(
|
|
155
|
+
"div",
|
|
156
|
+
{
|
|
157
|
+
"aria-hidden": !0,
|
|
158
|
+
className: "hidden h-comp-button-h-sm w-px shrink-0 bg-stroke-base-primary md:block"
|
|
159
|
+
}
|
|
160
|
+
),
|
|
161
|
+
/* @__PURE__ */ e(m, { gap: "xs", className: "min-w-0 flex-1 overflow-hidden", children: Array.from({ length: a }).map((c, d) => /* @__PURE__ */ e(
|
|
162
|
+
f,
|
|
163
|
+
{
|
|
164
|
+
color: r,
|
|
165
|
+
className: "h-comp-button-h-sm w-[96px] shrink-0 rounded-full"
|
|
166
|
+
},
|
|
167
|
+
d
|
|
168
|
+
)) })
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
j.displayName = "SearchFiltersSkeleton";
|
|
173
|
+
export {
|
|
174
|
+
R as SearchFilters,
|
|
175
|
+
j as SearchFiltersSkeleton
|
|
176
|
+
};
|