@vkzstudio/muza-ui 1.6.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/components/ArticleCard/ArticleCard.d.ts.map +1 -1
  2. package/dist/components/ArticleCard/ArticleCard.js +161 -170
  3. package/dist/components/CarouselSection/CarouselSection.examples.d.ts +1 -1
  4. package/dist/components/OfferCard/OfferCard.d.ts +45 -17
  5. package/dist/components/OfferCard/OfferCard.d.ts.map +1 -1
  6. package/dist/components/OfferCard/OfferCard.js +180 -266
  7. package/dist/components/OfferCard/OfferCard.stories.d.ts +5 -2
  8. package/dist/components/OfferCard/OfferCard.stories.d.ts.map +1 -1
  9. package/dist/components/PartnerCard/PartnerCard.d.ts +90 -26
  10. package/dist/components/PartnerCard/PartnerCard.d.ts.map +1 -1
  11. package/dist/components/PartnerCard/PartnerCard.js +323 -264
  12. package/dist/components/PartnerCard/PartnerCard.stories.d.ts +6 -0
  13. package/dist/components/PartnerCard/PartnerCard.stories.d.ts.map +1 -1
  14. package/dist/components/PriceTag/PriceTag.d.ts +37 -0
  15. package/dist/components/PriceTag/PriceTag.d.ts.map +1 -0
  16. package/dist/components/PriceTag/PriceTag.js +43 -0
  17. package/dist/components/PriceTag/PriceTag.stories.d.ts +8 -0
  18. package/dist/components/PriceTag/PriceTag.stories.d.ts.map +1 -0
  19. package/dist/components/PriceTag/index.d.ts +2 -0
  20. package/dist/components/PriceTag/index.d.ts.map +1 -0
  21. package/dist/components/PriceTag/index.js +5 -0
  22. package/dist/components/Tooltip/Tooltip.d.ts +18 -7
  23. package/dist/components/Tooltip/Tooltip.d.ts.map +1 -1
  24. package/dist/components/Tooltip/Tooltip.js +116 -68
  25. package/dist/components/Tooltip/Tooltip.stories.d.ts +1 -0
  26. package/dist/components/Tooltip/Tooltip.stories.d.ts.map +1 -1
  27. package/dist/components/VoucherCard/VoucherCard.d.ts +24 -1
  28. package/dist/components/VoucherCard/VoucherCard.d.ts.map +1 -1
  29. package/dist/components/VoucherCard/VoucherCard.js +68 -76
  30. package/dist/components/VoucherCard/VoucherCard.stories.d.ts +1 -0
  31. package/dist/components/VoucherCard/VoucherCard.stories.d.ts.map +1 -1
  32. package/dist/components/index.d.ts +1 -0
  33. package/dist/components/index.d.ts.map +1 -1
  34. package/dist/components/internal/CardCompactShell.d.ts +80 -0
  35. package/dist/components/internal/CardCompactShell.d.ts.map +1 -0
  36. package/dist/components/internal/CardCompactShell.js +148 -0
  37. package/dist/components/internal/CardImageSlot.d.ts +56 -0
  38. package/dist/components/internal/CardImageSlot.d.ts.map +1 -0
  39. package/dist/components/internal/CardImageSlot.js +85 -0
  40. package/dist/index.js +178 -175
  41. package/dist/muza-ui.css +1 -1
  42. package/dist/styles/token-sizes.css +16 -4
  43. package/dist/utils/cn.d.ts.map +1 -1
  44. package/dist/utils/cn.js +6 -3
  45. package/dist/utils/disabledLinkProps.d.ts +8 -1
  46. package/dist/utils/disabledLinkProps.d.ts.map +1 -1
  47. package/dist/utils/disabledLinkProps.js +0 -1
  48. package/package.json +2 -1
@@ -3,12 +3,18 @@ import { PartnerCard } from './PartnerCard';
3
3
  declare const meta: Meta<typeof PartnerCard>;
4
4
  export default meta;
5
5
  type Story = StoryObj<typeof PartnerCard>;
6
+ export declare const Compact: Story;
7
+ export declare const CompactPlaceholder: Story;
8
+ export declare const CompactPromoBand: Story;
9
+ export declare const CompactSkeleton: Story;
6
10
  export declare const Search: Story;
11
+ export declare const SearchPlaceholder: Story;
7
12
  export declare const SearchSkeleton: Story;
8
13
  export declare const Hero: Story;
9
14
  export declare const HeroSkeleton: Story;
10
15
  export declare const WithFavoriteControlled: Story;
11
16
  export declare const ListView: Story;
17
+ export declare const ListViewPlaceholder: Story;
12
18
  export declare const ListViewSkeleton: Story;
13
19
  export declare const AsChildLink: Story;
14
20
  //# sourceMappingURL=PartnerCard.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PartnerCard.stories.d.ts","sourceRoot":"","sources":["../../../src/components/PartnerCard/PartnerCard.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAW3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AA6O3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAqDlC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEzC,eAAO,MAAM,MAAM,EAAE,KA6BpB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,IAAI,EAAE,KAsClB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAgC1B,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KA0BpC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA8BtB,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAuBzB,CAAA"}
1
+ {"version":3,"file":"PartnerCard.stories.d.ts","sourceRoot":"","sources":["../../../src/components/PartnerCard/PartnerCard.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAkB3D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAsS3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,WAAW,CAyDlC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,WAAW,CAAC,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,KA2BrB,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,KA8ChC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAqC9B,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAoB7B,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KA6BpB,CAAA;AAED,eAAO,MAAM,iBAAiB,EAAE,KAqD/B,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,IAAI,EAAE,KAsClB,CAAA;AAED,eAAO,MAAM,YAAY,EAAE,KAgC1B,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KA0BpC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA8BtB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAqEjC,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAgB9B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAuBzB,CAAA"}
@@ -0,0 +1,37 @@
1
+ import * as React from 'react';
2
+ declare const priceTagVariants: (props?: ({
3
+ disabled?: boolean | null | undefined;
4
+ } & import('class-variance-authority/types').ClassProp) | undefined) => string;
5
+ /** Props for the PriceTag component. */
6
+ export interface PriceTagProps extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'children'> {
7
+ /**
8
+ * Formatted price to display, e.g. `"100 Kč"`. Formatting (currency symbol,
9
+ * decimal separator, locale) is the consumer's responsibility — the tag
10
+ * renders the string as-is.
11
+ */
12
+ children: React.ReactNode;
13
+ /**
14
+ * Dimmed state used when the offer the price belongs to is unavailable.
15
+ * Swaps the fill and text to the disabled color ramp.
16
+ *
17
+ * @default false
18
+ */
19
+ disabled?: boolean;
20
+ }
21
+ /**
22
+ * A pill displaying the price of an offer or product.
23
+ *
24
+ * Sizing is driven entirely by design tokens, so the tag shrinks from 32px to
25
+ * 28px tall below the `md` breakpoint without any prop changes.
26
+ *
27
+ * @example
28
+ * <PriceTag>100 Kč</PriceTag>
29
+ *
30
+ * @example
31
+ * // Inside an OfferCard, prefer the card's `price` prop over composing
32
+ * // the tag by hand:
33
+ * <OfferCard name="Offer" href="/offer" variant="search" price="100 Kč" />
34
+ */
35
+ declare const PriceTag: React.ForwardRefExoticComponent<PriceTagProps & React.RefAttributes<HTMLSpanElement>>;
36
+ export { PriceTag, priceTagVariants };
37
+ //# sourceMappingURL=PriceTag.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceTag.d.ts","sourceRoot":"","sources":["../../../src/components/PriceTag/PriceTag.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAK9B,QAAA,MAAM,gBAAgB;;8EAWrB,CAAA;AAED,wCAAwC;AACxC,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IAC/D;;;;OAIG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,QAAA,MAAM,QAAQ,uFAmBb,CAAA;AAGD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAA"}
@@ -0,0 +1,43 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import * as c from "react";
3
+ import { cva as o } from "class-variance-authority";
4
+ import { cn as s } from "../../utils/cn.js";
5
+ import { Typography as m } from "../Typography/Typography.js";
6
+ const n = o(
7
+ "inline-flex h-comp-price-tag-h w-fit shrink-0 items-center justify-center rounded-comp-price-tag-radius px-comp-price-tag-p-hor whitespace-nowrap",
8
+ {
9
+ variants: {
10
+ disabled: {
11
+ true: "bg-comp-price-tag-disabled-bg text-comp-price-tag-disabled-text",
12
+ false: "bg-comp-price-tag-default-bg text-comp-price-tag-default-text"
13
+ }
14
+ },
15
+ defaultVariants: { disabled: !1 }
16
+ }
17
+ ), d = c.forwardRef(
18
+ ({ className: a, disabled: t = !1, children: r, ...i }, p) => /* @__PURE__ */ e(
19
+ "span",
20
+ {
21
+ ref: p,
22
+ className: s(n({ disabled: t, className: a })),
23
+ ...i,
24
+ children: /* @__PURE__ */ e(
25
+ m,
26
+ {
27
+ component: "span",
28
+ variant: "body",
29
+ size: "sm",
30
+ weight: "medium",
31
+ fixY: !0,
32
+ className: "text-center",
33
+ children: r
34
+ }
35
+ )
36
+ }
37
+ )
38
+ );
39
+ d.displayName = "PriceTag";
40
+ export {
41
+ d as PriceTag,
42
+ n as priceTagVariants
43
+ };
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { PriceTag } from './PriceTag';
3
+ declare const meta: Meta<typeof PriceTag>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof PriceTag>;
6
+ export declare const Default: Story;
7
+ export declare const AllStates: Story;
8
+ //# sourceMappingURL=PriceTag.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceTag.stories.d.ts","sourceRoot":"","sources":["../../../src/components/PriceTag/PriceTag.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,QAAQ,CAkC/B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,QAAQ,CAAC,CAAA;AAEtC,eAAO,MAAM,OAAO,EAAE,KAUrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAgBvB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './PriceTag';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PriceTag/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA"}
@@ -0,0 +1,5 @@
1
+ import { PriceTag as e, priceTagVariants as i } from "./PriceTag.js";
2
+ export {
3
+ e as PriceTag,
4
+ i as priceTagVariants
5
+ };
@@ -23,15 +23,25 @@ export interface TooltipProps extends React.ComponentProps<typeof TooltipPrimiti
23
23
  /** Prevents the tooltip from staying open when hovering over the content. */
24
24
  disableHoverableContent?: boolean;
25
25
  /**
26
- * Opens the tooltip on click/tap instead of hover/focus and renders a close
27
- * button (on tablet/mobile) so it can be dismissed on touch devices. Use for
28
- * tap-triggered hints, e.g. a help icon beside an input label.
26
+ * How the tooltip opens.
27
+ *
28
+ * - `false` hover and focus only, the plain Radix behaviour. Note that
29
+ * Radix suppresses every open path for touch pointers, so a tooltip left
30
+ * on the default cannot be opened by tap at all.
31
+ * - `'touch'` — hover and focus for mouse and keyboard, but a touch
32
+ * interaction switches that tooltip into click mode: it toggles on tap and
33
+ * renders a close button. Detection is per interaction rather than per
34
+ * device, so a hybrid device (touchscreen laptop, iPad with a trackpad)
35
+ * hovers for the mouse and taps for the finger.
36
+ * - `true` — always a click disclosure, for mouse users too. Use for
37
+ * tap-triggered hints, e.g. a help icon beside an input label.
38
+ *
29
39
  * @default false
30
40
  */
31
- openOnClick?: boolean;
41
+ openOnClick?: boolean | 'touch';
32
42
  }
33
43
  declare const Tooltip: ({ openOnClick, open: openProp, defaultOpen, onOpenChange, children, ...props }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
34
- /** Props for the TooltipTrigger. Element that displays tooltip on hover/focus. Use `asChild` for custom elements. */
44
+ /** Props for the TooltipTrigger. Element that displays the tooltip on hover/focus, or on click/tap when the root opts in via `openOnClick`. Use `asChild` for custom elements. */
35
45
  export type TooltipTriggerProps = React.ComponentProps<typeof TooltipPrimitive.Trigger>;
36
46
  declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
37
47
  /** Props for the TooltipContent. Styled floating container with positioning and animations. */
@@ -45,8 +55,9 @@ export interface TooltipContentProps extends React.ComponentPropsWithoutRef<type
45
55
  /** Offset in pixels from the aligned edge. */
46
56
  alignOffset?: number;
47
57
  /**
48
- * Accessible label for the close button shown in click (`openOnClick`) mode.
49
- * Defaults to translation `tooltip.closeAriaLabel`.
58
+ * Accessible label for the close button shown in click mode
59
+ * (`openOnClick={true}`, or `openOnClick="touch"` after a touch
60
+ * interaction). Defaults to translation `tooltip.closeAriaLabel`.
50
61
  */
51
62
  closeAriaLabel?: string;
52
63
  /** Fires when the close button is clicked (click mode only). */
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAuB3D,+FAA+F;AAC/F,MAAM,WAAW,oBACf,SAAQ,KAAK,CAAC,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,QAAQ,CAAC;IACxE,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,4FAA4F;IAC5F,uBAAuB,CAAC,EAAE,OAAO,CAAA;CAClC;AAED,QAAA,MAAM,eAAe,GAAI,cAAc,oBAAoB,4CAE1D,CAAA;AAED,uEAAuE;AACvE,MAAM,WAAW,YACf,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC;IAC1D,4CAA4C;IAC5C,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,yCAAyC;IACzC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IACtC,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,6EAA6E;IAC7E,uBAAuB,CAAC,EAAE,OAAO,CAAA;IACjC;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB;AAED,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;AAED,QAAA,MAAM,cAAc,4FA0EnB,CAAA;AAGD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAA"}
@@ -1,91 +1,139 @@
1
- import { jsx as s, jsxs as v } from "react/jsx-runtime";
2
- import * as i from "react";
3
- import * as n from "@radix-ui/react-tooltip";
4
- import { useMuzaTranslationContext as y } from "../../translations/TranslationContext.js";
5
- import { cn as T } from "../../utils/cn.js";
6
- import { XClose as w } from "../Icons/CustomIcons.js";
7
- import { Typography as z } from "../Typography/Typography.js";
8
- const b = () => {
9
- }, u = i.createContext({
10
- openOnClick: !1,
1
+ import { jsx as u, jsxs as N } from "react/jsx-runtime";
2
+ import * as e from "react";
3
+ import * as g from "@radix-ui/react-tooltip";
4
+ import { useMuzaTranslationContext as D } from "../../translations/TranslationContext.js";
5
+ import { cn as w } from "../../utils/cn.js";
6
+ import { XClose as C } from "../Icons/CustomIcons.js";
7
+ import { Typography as j } from "../Typography/Typography.js";
8
+ const M = () => {
9
+ }, R = e.createContext({
10
+ clickMode: !1,
11
+ detectTouch: !1,
12
+ clickModeRef: { current: !1 },
11
13
  open: !1,
12
- setOpen: b
13
- }), M = ({ ...t }) => /* @__PURE__ */ s(n.Provider, { delayDuration: 100, ...t }), A = ({
14
- openOnClick: t = !1,
15
- open: r,
16
- defaultOpen: l,
14
+ setOpen: M,
15
+ onTouchDetected: M,
16
+ triggerRef: { current: null }
17
+ }), U = ({ ...r }) => /* @__PURE__ */ u(g.Provider, { delayDuration: 100, ...r }), V = ({
18
+ openOnClick: r = !1,
19
+ open: a,
20
+ defaultOpen: b,
17
21
  onOpenChange: o,
18
- children: e,
19
- ...d
22
+ children: c,
23
+ ...x
20
24
  }) => {
21
- const [p, c] = i.useState(
22
- l ?? !1
23
- ), a = r !== void 0, m = a ? r : p, f = i.useCallback(
24
- (x) => {
25
- a || c(x), o == null || o(x);
25
+ const [T, p] = e.useState(
26
+ b ?? !1
27
+ ), [s, n] = e.useState(!1), i = a !== void 0, l = i ? a : T, t = r === "touch", f = r === !0 || t && s, m = e.useRef(f);
28
+ m.current = f;
29
+ const h = e.useRef(null), d = e.useCallback(
30
+ (y) => {
31
+ i || p(y), o == null || o(y);
26
32
  },
27
- [a, o]
28
- ), g = i.useMemo(
29
- () => ({ openOnClick: t, open: m, setOpen: f }),
30
- [t, m, f]
33
+ [i, o]
34
+ ), v = e.useCallback(() => {
35
+ m.current = !0, n(!0);
36
+ }, []), k = e.useCallback(
37
+ (y) => {
38
+ m.current || d(y);
39
+ },
40
+ [d]
41
+ ), z = e.useMemo(
42
+ () => ({
43
+ clickMode: f,
44
+ detectTouch: t,
45
+ clickModeRef: m,
46
+ open: l,
47
+ setOpen: d,
48
+ onTouchDetected: v,
49
+ triggerRef: h
50
+ }),
51
+ [f, t, l, d, v]
31
52
  );
32
- return /* @__PURE__ */ s(u.Provider, { value: g, children: /* @__PURE__ */ s(
33
- n.Root,
53
+ return /* @__PURE__ */ u(R.Provider, { value: z, children: /* @__PURE__ */ u(
54
+ g.Root,
34
55
  {
35
- open: t ? m : r,
36
- defaultOpen: t ? void 0 : l,
37
- onOpenChange: t ? b : o,
38
- ...d,
39
- children: e
56
+ open: l,
57
+ onOpenChange: k,
58
+ ...x,
59
+ children: c
40
60
  }
41
61
  ) });
42
- }, N = i.forwardRef(({ onClick: t, ...r }, l) => {
43
- const { openOnClick: o, open: e, setOpen: d } = i.useContext(u);
44
- return /* @__PURE__ */ s(
45
- n.Trigger,
62
+ }, L = e.forwardRef(({ onClick: r, onPointerDown: a, ...b }, o) => {
63
+ const {
64
+ clickMode: c,
65
+ detectTouch: x,
66
+ clickModeRef: T,
67
+ open: p,
68
+ setOpen: s,
69
+ onTouchDetected: n,
70
+ triggerRef: i
71
+ } = e.useContext(R), l = e.useCallback(
72
+ (t) => {
73
+ i.current = t, typeof o == "function" ? o(t) : o && (o.current = t);
74
+ },
75
+ [o, i]
76
+ );
77
+ return /* @__PURE__ */ u(
78
+ g.Trigger,
46
79
  {
47
80
  ref: l,
48
- "aria-expanded": o ? e : void 0,
49
- onClick: (p) => {
50
- t == null || t(p), o && d(!e);
81
+ "aria-expanded": c ? p : void 0,
82
+ onPointerDown: (t) => {
83
+ a == null || a(t), x && t.pointerType === "touch" && n();
84
+ },
85
+ onClick: (t) => {
86
+ r == null || r(t), T.current && s(!p);
51
87
  },
52
- ...r
88
+ ...b
53
89
  }
54
90
  );
55
91
  });
56
- N.displayName = n.Trigger.displayName;
57
- const h = i.forwardRef(
58
- ({ className: t, children: r, sideOffset: l = 4, closeAriaLabel: o, onClose: e, ...d }, p) => {
59
- const { openOnClick: c, setOpen: a } = i.useContext(u), { translations: m } = y(), f = o ?? m.tooltip.closeAriaLabel;
60
- return /* @__PURE__ */ v(
61
- n.Content,
92
+ L.displayName = g.Trigger.displayName;
93
+ const O = e.forwardRef(
94
+ ({
95
+ className: r,
96
+ children: a,
97
+ sideOffset: b = 4,
98
+ closeAriaLabel: o,
99
+ onClose: c,
100
+ "aria-label": x,
101
+ ...T
102
+ }, p) => {
103
+ const { clickMode: s, setOpen: n, triggerRef: i } = e.useContext(R), { translations: l } = D(), t = o ?? l.tooltip.closeAriaLabel, f = x ?? (s && typeof a == "string" ? a : void 0);
104
+ return /* @__PURE__ */ N(
105
+ g.Content,
62
106
  {
63
107
  ref: p,
64
- sideOffset: l,
65
- className: T(
108
+ sideOffset: b,
109
+ "aria-label": f,
110
+ className: w(
66
111
  "relative z-50 origin-[--radix-tooltip-content-transform-origin] animate-in overflow-hidden rounded-comp-tooltip-radius bg-surface-brand-brand-tertiary py-comp-tooltip-p-ver text-text-brand-def fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
67
- // Desktop uses the left token on both sides; tablet/mobile reserves
68
- // extra right padding for the close button.
69
- c ? "pr-comp-tooltip-p-right pl-comp-tooltip-p-left lg:pr-comp-tooltip-p-left" : "px-comp-tooltip-p-left",
70
- t
112
+ // Click mode reserves extra right padding for the close button.
113
+ s ? "pr-comp-tooltip-p-right pl-comp-tooltip-p-left" : "px-comp-tooltip-p-left",
114
+ r
71
115
  ),
72
- ...d,
73
- ...c && {
74
- onEscapeKeyDown: () => a(!1),
75
- onPointerDownOutside: () => a(!1)
116
+ ...T,
117
+ ...s && {
118
+ onEscapeKeyDown: () => n(!1),
119
+ onPointerDownOutside: (m) => {
120
+ var d;
121
+ const h = m.detail.originalEvent.target;
122
+ h && ((d = i.current) != null && d.contains(h)) || n(!1);
123
+ }
76
124
  },
77
125
  children: [
78
- /* @__PURE__ */ s(z, { component: "span", variant: "body", weight: "regular", size: "sm", children: r }),
79
- c && /* @__PURE__ */ s(
126
+ /* @__PURE__ */ u(j, { component: "span", variant: "body", weight: "regular", size: "sm", children: a }),
127
+ s && /* @__PURE__ */ u(
80
128
  "button",
81
129
  {
82
130
  type: "button",
83
131
  onClick: () => {
84
- a(!1), e == null || e();
132
+ n(!1), c == null || c();
85
133
  },
86
- "aria-label": f,
87
- className: "absolute top-2xs right-2xs flex size-comp-button-w-xs cursor-pointer items-center justify-center rounded-full text-text-brand-def focus-visible-auto lg:hidden",
88
- children: /* @__PURE__ */ s(w, { className: "size-icon-xsmall" })
134
+ "aria-label": t,
135
+ className: "absolute top-2xs right-2xs flex size-comp-button-w-xs cursor-pointer items-center justify-center rounded-full text-text-brand-def focus-visible-auto",
136
+ children: /* @__PURE__ */ u(C, { className: "size-icon-xsmall" })
89
137
  }
90
138
  )
91
139
  ]
@@ -93,10 +141,10 @@ const h = i.forwardRef(
93
141
  );
94
142
  }
95
143
  );
96
- h.displayName = n.Content.displayName;
144
+ O.displayName = g.Content.displayName;
97
145
  export {
98
- A as Tooltip,
99
- h as TooltipContent,
100
- M as TooltipProvider,
101
- N as TooltipTrigger
146
+ V as Tooltip,
147
+ O as TooltipContent,
148
+ U as TooltipProvider,
149
+ L as TooltipTrigger
102
150
  };
@@ -5,6 +5,7 @@ export default meta;
5
5
  type Story = StoryObj<typeof Tooltip>;
6
6
  export declare const DefaultTooltipComponent: Story;
7
7
  export declare const OpenState: Story;
8
+ export declare const OpenOnTouch: Story;
8
9
  export declare const OpenOnClick: Story;
9
10
  export declare const PrefferedSideBottom: Story;
10
11
  //# sourceMappingURL=Tooltip.stories.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAK3D,OAAO,EACL,OAAO,EAIR,MAAM,WAAW,CAAA;AAElB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAmD9B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAA;AAErC,eAAO,MAAM,uBAAuB,EAAE,KAqBrC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAsBvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAkCzB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAsBjC,CAAA"}
1
+ {"version":3,"file":"Tooltip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAK3D,OAAO,EACL,OAAO,EAIR,MAAM,WAAW,CAAA;AAElB,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,OAAO,CAwD9B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,OAAO,CAAC,CAAA;AAErC,eAAO,MAAM,uBAAuB,EAAE,KAqBrC,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAsBvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAsBzB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAkCzB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,KAsBjC,CAAA"}
@@ -39,13 +39,36 @@ export interface VoucherCardBaseProps extends Omit<VariantProps<typeof voucherCa
39
39
  * custom React node such as a Next.js `<Image>` element. The wrapper
40
40
  * handles sizing, rounded corners, overflow, and the disabled dim; any
41
41
  * direct `<img>` child is auto-stretched to fill the wrapper.
42
+ *
43
+ * Omit it (or pass `undefined`) to render the placeholder instead — pair
44
+ * that with `placeholderIcon` and `placeholderColor`.
42
45
  */
43
- image: string | React.ReactNode;
46
+ image?: string | React.ReactNode;
44
47
  /**
45
48
  * Alt text for the built-in `<img>` (used when `image` is a string).
46
49
  * Defaults to `title`. Ignored when `image` is a custom React node.
47
50
  */
48
51
  imageAlt?: string;
52
+ /**
53
+ * Decorative icon rendered centred in the image area when `image` is
54
+ * absent. Sized by the card and coloured via `currentColor`, so pass a
55
+ * bare Solar icon element.
56
+ *
57
+ * @example
58
+ * <VoucherCard
59
+ * title="Voucher"
60
+ * description="Platnost do 8. 10. 2025"
61
+ * placeholderIcon={<MusicNoteBold />}
62
+ * placeholderColor="#e4329c"
63
+ * />
64
+ */
65
+ placeholderIcon?: React.ReactNode;
66
+ /**
67
+ * Any CSS color string driving the placeholder. The image area is filled
68
+ * with the color at 20% alpha and the icon takes the full color. Omit to
69
+ * fall back to the brand-tertiary tint with a tertiary-grey icon.
70
+ */
71
+ placeholderColor?: string;
49
72
  /**
50
73
  * Disabled visual state. Dims and desaturates the image, grays the title,
51
74
  * and switches the description line to `text-state-error-def`. The
@@ -1 +1 @@
1
- {"version":3,"file":"VoucherCard.d.ts","sourceRoot":"","sources":["../../../src/components/VoucherCard/VoucherCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;A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