@vkzstudio/muza-ui 1.0.46 → 1.0.48
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 +112 -18
- package/dist/components/Accordion/Accordion.d.ts.map +1 -1
- package/dist/components/Accordion/Accordion.js +219 -113
- package/dist/components/Accordion/Accordion.stories.d.ts +3 -0
- package/dist/components/Accordion/Accordion.stories.d.ts.map +1 -1
- package/dist/components/Alert/Alert.js +4 -4
- package/dist/components/ButtonArrow/ButtonArrow.stories.d.ts.map +1 -1
- package/dist/components/CardCheckboxAmount/CardCheckboxAmount.d.ts +111 -0
- package/dist/components/CardCheckboxAmount/CardCheckboxAmount.d.ts.map +1 -0
- package/dist/components/CardCheckboxAmount/CardCheckboxAmount.js +115 -0
- package/dist/components/CardCheckboxAmount/CardCheckboxAmount.stories.d.ts +13 -0
- package/dist/components/CardCheckboxAmount/CardCheckboxAmount.stories.d.ts.map +1 -0
- package/dist/components/CardCheckboxAmount/index.d.ts +2 -0
- package/dist/components/CardCheckboxAmount/index.d.ts.map +1 -0
- package/dist/components/Chip/Chip.d.ts.map +1 -1
- package/dist/components/Chip/Chip.js +6 -2
- package/dist/components/Chip/Chip.stories.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +10 -2
- package/dist/components/DatePicker/DatePicker.stories.d.ts.map +1 -1
- package/dist/components/DatePickerButton/DatePickerButton.d.ts +97 -0
- package/dist/components/DatePickerButton/DatePickerButton.d.ts.map +1 -0
- package/dist/components/DatePickerButton/DatePickerButton.js +329 -0
- package/dist/components/DatePickerButton/DatePickerButton.stories.d.ts +15 -0
- package/dist/components/DatePickerButton/DatePickerButton.stories.d.ts.map +1 -0
- package/dist/components/DatePickerButton/index.d.ts +2 -0
- package/dist/components/DatePickerButton/index.d.ts.map +1 -0
- package/dist/components/Dialog/Dialog.js +1 -1
- package/dist/components/Icons/CustomLogos.d.ts +18 -2
- package/dist/components/Icons/CustomLogos.d.ts.map +1 -1
- package/dist/components/Icons/CustomLogos.js +103 -97
- package/dist/components/Icons/LogosAndBadges.stories.d.ts +1 -0
- package/dist/components/Icons/LogosAndBadges.stories.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts +26 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -1
- package/dist/components/LanguageSwitcher/LanguageSwitcher.js +86 -44
- package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts +1 -0
- package/dist/components/LanguageSwitcher/LanguageSwitcher.stories.d.ts.map +1 -1
- package/dist/components/Popover/Popover.d.ts +8 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +7 -6
- package/dist/components/SegmentedControl/SegmentedControl.stories.d.ts.map +1 -1
- package/dist/components/SegmentedIconControl/SegmentedIconControl.stories.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.d.ts.map +1 -1
- package/dist/components/TextEditor/TextEditor.js +12 -9
- package/dist/components/TextEditor/TextEditor.stories.d.ts.map +1 -1
- package/dist/components/Toggle/Toggle.stories.d.ts.map +1 -1
- package/dist/components/ToggleCheckButton/ToggleCheckButton.stories.d.ts.map +1 -1
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts.map +1 -1
- package/dist/components/Typography/Typography.d.ts +10 -1
- package/dist/components/Typography/Typography.d.ts.map +1 -1
- package/dist/components/Typography/Typography.js +82 -67
- package/dist/components/Typography/Typography.stories.d.ts +1 -0
- package/dist/components/Typography/Typography.stories.d.ts.map +1 -1
- package/dist/components/TypographyLink/TypographyLink.d.ts +72 -0
- package/dist/components/TypographyLink/TypographyLink.d.ts.map +1 -0
- package/dist/components/TypographyLink/TypographyLink.js +103 -0
- package/dist/components/TypographyLink/TypographyLink.stories.d.ts +12 -0
- package/dist/components/TypographyLink/TypographyLink.stories.d.ts.map +1 -0
- package/dist/components/TypographyLink/index.d.ts +2 -0
- package/dist/components/TypographyLink/index.d.ts.map +1 -0
- package/dist/components/UniversalFooter/UniversalFooter.d.ts +198 -0
- package/dist/components/UniversalFooter/UniversalFooter.d.ts.map +1 -0
- package/dist/components/UniversalFooter/UniversalFooter.js +401 -0
- package/dist/components/UniversalFooter/UniversalFooter.stories.d.ts +19 -0
- package/dist/components/UniversalFooter/UniversalFooter.stories.d.ts.map +1 -0
- package/dist/components/UniversalFooter/index.d.ts +2 -0
- package/dist/components/UniversalFooter/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/globals.css +0 -1
- package/dist/index.js +353 -322
- package/dist/muza-ui.css +1 -1
- package/dist/styles/primitives.css +2 -0
- package/dist/styles/token-colors.css +51 -43
- package/dist/styles/token-sizes.css +52 -4
- package/dist/translations/index.d.ts +1 -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 +6 -1
- package/dist/translations/locales/en.d.ts.map +1 -1
- package/dist/translations/locales/en.js +6 -1
- package/dist/translations/locales/sk.d.ts.map +1 -1
- package/dist/translations/locales/sk.js +6 -1
- package/dist/translations/types.d.ts +12 -0
- package/dist/translations/types.d.ts.map +1 -1
- package/dist/utils/cn.d.ts.map +1 -1
- package/dist/utils/cn.js +17 -9
- package/llms-full.md +38 -35
- package/llms.txt +10 -9
- package/package.json +171 -169
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { CheckboxProps } from '../Checkbox';
|
|
2
|
+
import { StepperProps } from '../Stepper';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
/** Props for the {@link CardCheckboxAmount} component. */
|
|
5
|
+
export interface CardCheckboxAmountProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onChange' | 'title' | 'defaultChecked'> {
|
|
6
|
+
/** Primary label rendered next to the checkbox. */
|
|
7
|
+
title: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Secondary line rendered below the title in muted color. Constrained to
|
|
10
|
+
* `string` because the underlying Checkbox's `secondaryLabel` is a string.
|
|
11
|
+
*/
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Controlled checked state of the underlying checkbox. */
|
|
14
|
+
checked?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Initial checked state for uncontrolled usage.
|
|
17
|
+
* @default false
|
|
18
|
+
*/
|
|
19
|
+
defaultChecked?: boolean;
|
|
20
|
+
/** Fires when the user toggles the checkbox. */
|
|
21
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
22
|
+
/** Controlled amount value of the embedded stepper (only visible while checked). */
|
|
23
|
+
amount?: number;
|
|
24
|
+
/**
|
|
25
|
+
* Initial amount for uncontrolled usage.
|
|
26
|
+
* @default 1
|
|
27
|
+
*/
|
|
28
|
+
defaultAmount?: number;
|
|
29
|
+
/** Fires when the user increments/decrements the amount. */
|
|
30
|
+
onAmountChange?: (amount: number) => void;
|
|
31
|
+
/**
|
|
32
|
+
* Minimum allowed amount; the decrement button is disabled at this value.
|
|
33
|
+
* @default 1
|
|
34
|
+
*/
|
|
35
|
+
min?: number;
|
|
36
|
+
/** Maximum allowed amount; the increment button is disabled at this value. */
|
|
37
|
+
max?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Marks the card as unavailable: disables the checkbox, hides the stepper,
|
|
40
|
+
* mutes the content, and shows {@link unavailableMessage}. The internal
|
|
41
|
+
* `checked` / `amount` state is preserved while unavailable — flipping the
|
|
42
|
+
* flag back to `false` restores the previous selection.
|
|
43
|
+
* @default false
|
|
44
|
+
*/
|
|
45
|
+
unavailable?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Message displayed when {@link unavailable} is true.
|
|
48
|
+
* @default translations.cardCheckboxAmount.unavailableMessage
|
|
49
|
+
*/
|
|
50
|
+
unavailableMessage?: React.ReactNode;
|
|
51
|
+
/**
|
|
52
|
+
* Helper message displayed below the stepper once the amount reaches `max`.
|
|
53
|
+
* @default translations.cardCheckboxAmount.maxAmountMessage
|
|
54
|
+
*/
|
|
55
|
+
maxAmountMessage?: React.ReactNode;
|
|
56
|
+
/** Custom ID for the underlying checkbox input. Auto-generated if omitted. */
|
|
57
|
+
id?: string;
|
|
58
|
+
/** Name attribute forwarded to the underlying checkbox for form submission. */
|
|
59
|
+
name?: string;
|
|
60
|
+
/** Value attribute forwarded to the underlying checkbox for form submission. */
|
|
61
|
+
value?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Accessible label for the stepper's increment button.
|
|
64
|
+
* @default translations.stepper.incrementAriaLabel
|
|
65
|
+
*/
|
|
66
|
+
incrementAriaLabel?: StepperProps['incrementAriaLabel'];
|
|
67
|
+
/**
|
|
68
|
+
* Accessible label for the stepper's decrement button.
|
|
69
|
+
* @default translations.stepper.decrementAriaLabel
|
|
70
|
+
*/
|
|
71
|
+
decrementAriaLabel?: StepperProps['decrementAriaLabel'];
|
|
72
|
+
/** Escape hatch for advanced Checkbox wiring (`required`, `error`, etc.). */
|
|
73
|
+
checkboxProps?: Omit<CheckboxProps, 'checked' | 'defaultChecked' | 'onCheckedChange' | 'disabled' | 'label' | 'secondaryLabel' | 'id' | 'name' | 'value'>;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Selectable card that combines a checkbox with a quantity stepper for picking
|
|
77
|
+
* a single item and the amount of it (e.g. choosing a credit/voucher).
|
|
78
|
+
*
|
|
79
|
+
* Composed from `Card` (checkout variant), `Checkbox`, and `Stepper`. Toggling
|
|
80
|
+
* the checkbox reveals the stepper, which is bounded by `min` / `max`. Once
|
|
81
|
+
* `amount` reaches `max`, a helper message appears below the stepper. Marking
|
|
82
|
+
* the card `unavailable` disables interaction and surfaces a red explanatory
|
|
83
|
+
* message instead of the stepper. Supports both controlled and uncontrolled
|
|
84
|
+
* usage of the checked + amount state.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* // Uncontrolled
|
|
88
|
+
* <CardCheckboxAmount
|
|
89
|
+
* title="Kredit v hodnotě 500 Kč"
|
|
90
|
+
* description="500 Kč (-10%)"
|
|
91
|
+
* max={10}
|
|
92
|
+
* />
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* // Controlled — parent owns both checked and amount
|
|
96
|
+
* const [checked, setChecked] = useState(false)
|
|
97
|
+
* const [amount, setAmount] = useState(1)
|
|
98
|
+
*
|
|
99
|
+
* <CardCheckboxAmount
|
|
100
|
+
* title="Kredit v hodnotě 500 Kč"
|
|
101
|
+
* description="500 Kč (-10%)"
|
|
102
|
+
* checked={checked}
|
|
103
|
+
* onCheckedChange={setChecked}
|
|
104
|
+
* amount={amount}
|
|
105
|
+
* onAmountChange={setAmount}
|
|
106
|
+
* max={10}
|
|
107
|
+
* />
|
|
108
|
+
*/
|
|
109
|
+
declare const CardCheckboxAmount: React.ForwardRefExoticComponent<CardCheckboxAmountProps & React.RefAttributes<HTMLElement>>;
|
|
110
|
+
export { CardCheckboxAmount };
|
|
111
|
+
//# sourceMappingURL=CardCheckboxAmount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardCheckboxAmount.d.ts","sourceRoot":"","sources":["../../../src/components/CardCheckboxAmount/CardCheckboxAmount.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,YAAY,CAAA;AAGvD,0DAA0D;AAC1D,MAAM,WAAW,uBACf,SAAQ,IAAI,CACV,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,UAAU,GAAG,OAAO,GAAG,gBAAgB,CACxC;IACD,mDAAmD;IACnD,KAAK,EAAE,KAAK,CAAC,SAAS,CAAA;IACtB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,OAAO,CAAA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
|
1
|
+
import { jsxs as v, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as i from "react";
|
|
3
|
+
import { useMuzaTranslations as O } from "../../translations/TranslationContext.js";
|
|
4
|
+
import { Card as Q } from "../Card/Card.js";
|
|
5
|
+
import { Checkbox as V } from "../Checkbox/Checkbox.js";
|
|
6
|
+
import { Stepper as W } from "../Stepper/Stepper.js";
|
|
7
|
+
import { cn as X } from "../../utils/cn.js";
|
|
8
|
+
import { Typography as y } from "../Typography/Typography.js";
|
|
9
|
+
const Y = i.forwardRef(
|
|
10
|
+
({
|
|
11
|
+
className: C,
|
|
12
|
+
title: M,
|
|
13
|
+
description: A,
|
|
14
|
+
checked: m,
|
|
15
|
+
defaultChecked: N,
|
|
16
|
+
onCheckedChange: n,
|
|
17
|
+
amount: c,
|
|
18
|
+
defaultAmount: b = 1,
|
|
19
|
+
onAmountChange: o,
|
|
20
|
+
min: D = 1,
|
|
21
|
+
max: d,
|
|
22
|
+
unavailable: a = !1,
|
|
23
|
+
unavailableMessage: S,
|
|
24
|
+
maxAmountMessage: k,
|
|
25
|
+
id: z,
|
|
26
|
+
name: K,
|
|
27
|
+
value: j,
|
|
28
|
+
incrementAriaLabel: I,
|
|
29
|
+
decrementAriaLabel: R,
|
|
30
|
+
checkboxProps: t,
|
|
31
|
+
...T
|
|
32
|
+
}, B) => {
|
|
33
|
+
const f = O(), p = m !== void 0, [E, L] = i.useState(
|
|
34
|
+
N ?? !1
|
|
35
|
+
), l = p ? m : E, u = c !== void 0, [U, q] = i.useState(b), x = u ? c : U, w = (e) => {
|
|
36
|
+
const s = e === !0;
|
|
37
|
+
p || L(s), n == null || n(s);
|
|
38
|
+
}, F = (e) => {
|
|
39
|
+
u || q(e), o == null || o(e);
|
|
40
|
+
}, G = (e) => {
|
|
41
|
+
var s;
|
|
42
|
+
(s = t == null ? void 0 : t.onKeyDown) == null || s.call(t, e), !(e.defaultPrevented || a) && e.key === "Enter" && (e.preventDefault(), w(!l));
|
|
43
|
+
}, H = l && !a, J = d !== void 0 && x >= d, h = S ?? f.cardCheckboxAmount.unavailableMessage, g = k ?? f.cardCheckboxAmount.maxAmountMessage;
|
|
44
|
+
return /* @__PURE__ */ v(
|
|
45
|
+
Q,
|
|
46
|
+
{
|
|
47
|
+
ref: B,
|
|
48
|
+
variant: "checkout",
|
|
49
|
+
direction: "column",
|
|
50
|
+
className: X(
|
|
51
|
+
"items-start gap-md md:flex-row md:items-center md:gap-lg",
|
|
52
|
+
a && "border-stroke-base-disabled",
|
|
53
|
+
C
|
|
54
|
+
),
|
|
55
|
+
...T,
|
|
56
|
+
children: [
|
|
57
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ r(
|
|
58
|
+
V,
|
|
59
|
+
{
|
|
60
|
+
...t,
|
|
61
|
+
id: z,
|
|
62
|
+
name: K,
|
|
63
|
+
value: j,
|
|
64
|
+
checked: l,
|
|
65
|
+
onCheckedChange: w,
|
|
66
|
+
onKeyDown: G,
|
|
67
|
+
disabled: a,
|
|
68
|
+
label: M,
|
|
69
|
+
secondaryLabel: A
|
|
70
|
+
}
|
|
71
|
+
) }),
|
|
72
|
+
a && h && /* @__PURE__ */ r(
|
|
73
|
+
y,
|
|
74
|
+
{
|
|
75
|
+
variant: "body",
|
|
76
|
+
size: "base",
|
|
77
|
+
weight: "regular",
|
|
78
|
+
component: "span",
|
|
79
|
+
className: "pl-2-5-xl text-text-state-error-def md:pl-0 md:text-right md:whitespace-nowrap",
|
|
80
|
+
children: h
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
H && /* @__PURE__ */ v("div", { className: "flex flex-col items-start gap-2xs pl-2-5-xl md:items-end md:pl-0", children: [
|
|
84
|
+
/* @__PURE__ */ r(
|
|
85
|
+
W,
|
|
86
|
+
{
|
|
87
|
+
value: x,
|
|
88
|
+
onChange: F,
|
|
89
|
+
min: D,
|
|
90
|
+
max: d,
|
|
91
|
+
incrementAriaLabel: I,
|
|
92
|
+
decrementAriaLabel: R
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
J && g && /* @__PURE__ */ r(
|
|
96
|
+
y,
|
|
97
|
+
{
|
|
98
|
+
variant: "body",
|
|
99
|
+
size: "sm",
|
|
100
|
+
weight: "regular",
|
|
101
|
+
component: "span",
|
|
102
|
+
className: "text-text-dark-secondary md:text-right md:whitespace-nowrap",
|
|
103
|
+
children: g
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] })
|
|
107
|
+
]
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
);
|
|
112
|
+
Y.displayName = "CardCheckboxAmount";
|
|
113
|
+
export {
|
|
114
|
+
Y as CardCheckboxAmount
|
|
115
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { CardCheckboxAmount } from './CardCheckboxAmount';
|
|
3
|
+
declare const meta: Meta<typeof CardCheckboxAmount>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof CardCheckboxAmount>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Selected: Story;
|
|
8
|
+
export declare const MaxAmount: Story;
|
|
9
|
+
export declare const Unavailable: Story;
|
|
10
|
+
export declare const CustomMessages: Story;
|
|
11
|
+
export declare const Controlled: Story;
|
|
12
|
+
export declare const AllStates: Story;
|
|
13
|
+
//# sourceMappingURL=CardCheckboxAmount.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CardCheckboxAmount.stories.d.ts","sourceRoot":"","sources":["../../../src/components/CardCheckboxAmount/CardCheckboxAmount.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,kBAAkB,CA2DzC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEhD,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KActB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAcvB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAYzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAgB5B,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KA0BxB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAoCvB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CardCheckboxAmount/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,QAAA,MAAM,YAAY;;;
|
|
1
|
+
{"version":3,"file":"Chip.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAO9B,QAAA,MAAM,YAAY;;;8EA8CjB,CAAA;AAED;;;GAGG;AACH,MAAM,WAAW,SACf,SAAQ,IAAI,CACV,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAC7C,UAAU,GAAG,UAAU,CACxB;IACD;;OAEG;IACH,OAAO,EAAE,OAAO,CAAA;IAChB;;OAEG;IACH,eAAe,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,QAAA,MAAM,IAAI,qFA6CT,CAAA;AAGD,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -27,7 +27,11 @@ const v = m(
|
|
|
27
27
|
"[&>svg]:text-icon-dark-secondary-def",
|
|
28
28
|
"hover:text-text-brand-hover",
|
|
29
29
|
"hover:bg-surface-brand-brand-tertiary",
|
|
30
|
-
|
|
30
|
+
// `[&:hover>svg]:` compiles to the flat selector
|
|
31
|
+
// `.x:hover > svg` instead of nested CSS, so
|
|
32
|
+
// storybook-addon-pseudo-states can rewrite the :hover
|
|
33
|
+
// and force the colour under .pseudo-hover.
|
|
34
|
+
"[&:hover>svg]:text-icon-brand-hover"
|
|
31
35
|
]
|
|
32
36
|
},
|
|
33
37
|
disabled: {
|
|
@@ -37,7 +41,7 @@ const v = m(
|
|
|
37
41
|
"[&>svg]:text-icon-dark-tertiary",
|
|
38
42
|
"hover:bg-transparent",
|
|
39
43
|
"hover:text-text-dark-disabled",
|
|
40
|
-
"hover
|
|
44
|
+
"[&:hover>svg]:text-icon-dark-tertiary"
|
|
41
45
|
],
|
|
42
46
|
false: ""
|
|
43
47
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAqC3B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"Chip.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Chip/Chip.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7B,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,IAAI,CAqC3B,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAA;AAElC,eAAO,MAAM,OAAO,EAAE,KAiBrB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAmDvB,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,KAmDvB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAA2C,MAAM,OAAO,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAIjD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,aAAa,CAAA;AAGpB,OAAO,EAGL,KAAK,mBAAmB,EAEzB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,KAAK,OAAO,EAAgB,MAAM,sBAAsB,CAAA;AAGjE;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAC;IACzC,qEAAqE;IACrE,cAAc,EAAE,MAAM,CAAA;IACtB,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAA;IACtB,kDAAkD;IAClD,KAAK,EAAE,MAAM,CAAA;IACb,6DAA6D;IAC7D,eAAe,EAAE,MAAM,CAAA;CACxB,CAAC,CAAA;AAEF;;;;;;;;;GASG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,4EAA4E;IAC5E,aAAa,CAAC,EAAE,QAAQ,GAAG,KA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S,KAAK,IAAI,CAAA;IAChD,0EAA0E;IAC1E,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,MAAM,CAAA;CAC5C,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,qCAAqC;IACrC,IAAI,EAAE,QAAQ,CAAA;IACd,4CAA4C;IAC5C,KAAK,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IACxB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IAC/B,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,KAAK,IAAI,CAAA;IAC3C,oEAAoE;IACpE,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,MAAM,CAAA;CACvC,CAAA;AAED,eAAO,MAAM,UAAU,8GAmQtB,CAAA"}
|
|
@@ -110,7 +110,15 @@ const vt = et(
|
|
|
110
110
|
t && (v.current = e ?? i), s === void 0 && M(t), d == null || d(t);
|
|
111
111
|
},
|
|
112
112
|
children: [
|
|
113
|
-
|
|
113
|
+
S ? (
|
|
114
|
+
// The caller owns the full trigger structure — including its own
|
|
115
|
+
// `<PopoverTrigger>` (typically via `asChild`) and any siblings
|
|
116
|
+
// (e.g. a clear button next to the trigger). DatePicker does not
|
|
117
|
+
// wrap the returned element, so the caller can place the
|
|
118
|
+
// `<PopoverTrigger>` precisely where it wants without nesting
|
|
119
|
+
// interactive elements inside another button.
|
|
120
|
+
S()
|
|
121
|
+
) : /* @__PURE__ */ n(
|
|
114
122
|
nt,
|
|
115
123
|
{
|
|
116
124
|
className: l(
|
|
@@ -118,7 +126,7 @@ const vt = et(
|
|
|
118
126
|
o == null ? void 0 : o.popoverTrigger
|
|
119
127
|
),
|
|
120
128
|
disabled: R,
|
|
121
|
-
children:
|
|
129
|
+
children: /* @__PURE__ */ n(
|
|
122
130
|
st,
|
|
123
131
|
{
|
|
124
132
|
ref: N,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;
|
|
1
|
+
{"version":3,"file":"DatePicker.stories.d.ts","sourceRoot":"","sources":["../../../src/components/DatePicker/DatePicker.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAK3D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAKzC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CA2KjC,CAAA;AAED,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAA;AAExC,eAAO,MAAM,iBAAiB,EAAE,KAoC/B,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAsB9B,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAuBxC,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KA0B7B,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAwBtB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,KAwBnB,CAAA;AAED,eAAO,MAAM,0BAA0B,EAAE,KAyBxC,CAAA;AAED,eAAO,MAAM,2BAA2B,EAAE,KAmCzC,CAAA;AAED,eAAO,MAAM,qCAAqC,EAAE,KAkDnD,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAyB1C,CAAA;AAED,eAAO,MAAM,4BAA4B,EAAE,KAyB1C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KA0BtB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,KAkClC,CAAA;AAED,eAAO,MAAM,8BAA8B,EAAE,KAiC5C,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,KAkC9B,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAoCzB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAqCzB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,KA6CxB,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import { DatePickerProps, DatePickerRangeProps, DatePickerSingleProps } from '../DatePicker';
|
|
3
|
+
/**
|
|
4
|
+
* Variant styles for the DatePickerButton trigger element.
|
|
5
|
+
*
|
|
6
|
+
* Mirrors Input's size + state tokens so the trigger drops in alongside other
|
|
7
|
+
* inline form controls (e.g. next to a Searchbar) without visual mismatch.
|
|
8
|
+
*/
|
|
9
|
+
export declare const datePickerButtonVariants: (props?: ({
|
|
10
|
+
variant?: "default" | "iconOnly" | null | undefined;
|
|
11
|
+
size?: "xs" | "sm" | "lg" | "base" | null | undefined;
|
|
12
|
+
error?: boolean | null | undefined;
|
|
13
|
+
disabled?: boolean | null | undefined;
|
|
14
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
15
|
+
/** Visual style of the DatePickerButton trigger. */
|
|
16
|
+
export type DatePickerButtonVariant = NonNullable<VariantProps<typeof datePickerButtonVariants>['variant']>;
|
|
17
|
+
/** Size token of the DatePickerButton trigger; matches Input sizes. */
|
|
18
|
+
export type DatePickerButtonSize = NonNullable<VariantProps<typeof datePickerButtonVariants>['size']>;
|
|
19
|
+
/**
|
|
20
|
+
* Subset of {@link DatePickerProps} relevant to the button-style trigger.
|
|
21
|
+
* Input-only props (`label`, `hint`, `placeholder`, etc.) and trigger
|
|
22
|
+
* overrides are excluded — DatePickerButton renders its own trigger.
|
|
23
|
+
*/
|
|
24
|
+
type SharedDatePickerProps = Omit<DatePickerProps, 'label' | 'hint' | 'placeholder' | 'renderCustomTrigger' | 'classNames' | 'error' | keyof DatePickerSingleProps | keyof DatePickerRangeProps>;
|
|
25
|
+
type SharedButtonProps = {
|
|
26
|
+
/**
|
|
27
|
+
* Visual style of the trigger.
|
|
28
|
+
* - `'default'` — shows the date and a clear (X) button when a value is set;
|
|
29
|
+
* collapses to the round icon button when empty.
|
|
30
|
+
* - `'iconOnly'` — always the round icon button; shows a small dot indicator
|
|
31
|
+
* in the top-right corner when a value is set.
|
|
32
|
+
*
|
|
33
|
+
* @default 'default'
|
|
34
|
+
* @example
|
|
35
|
+
* <DatePickerButton mode="single" variant="default" />
|
|
36
|
+
* <DatePickerButton mode="range" variant="iconOnly" aria-label="Filter" />
|
|
37
|
+
*/
|
|
38
|
+
variant?: DatePickerButtonVariant;
|
|
39
|
+
/**
|
|
40
|
+
* Size of the trigger button. Matches Input's `size` tokens so the trigger
|
|
41
|
+
* lines up with adjacent inputs.
|
|
42
|
+
*
|
|
43
|
+
* @default 'base'
|
|
44
|
+
*/
|
|
45
|
+
size?: DatePickerButtonSize;
|
|
46
|
+
/** Applies error border styling. @default false */
|
|
47
|
+
error?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* Hides the clear (X) icon in `variant='default'`, even when a value is set.
|
|
50
|
+
* Use when the date is required and cannot be cleared from the trigger.
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
hideClearButton?: boolean;
|
|
55
|
+
/** Accessible label for the trigger. Required for `variant='iconOnly'`. */
|
|
56
|
+
'aria-label'?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Accessible label for the clear (X) button. Defaults to the
|
|
59
|
+
* `datePicker.clearDateAriaLabel` translation.
|
|
60
|
+
*/
|
|
61
|
+
clearAriaLabel?: string;
|
|
62
|
+
/** Class applied to the visible trigger wrapper. */
|
|
63
|
+
className?: string;
|
|
64
|
+
};
|
|
65
|
+
/** Props for `DatePickerButton` in `mode='single'`. */
|
|
66
|
+
export type DatePickerButtonSingleProps = SharedDatePickerProps & SharedButtonProps & DatePickerSingleProps;
|
|
67
|
+
/** Props for `DatePickerButton` in `mode='range'`. */
|
|
68
|
+
export type DatePickerButtonRangeProps = SharedDatePickerProps & SharedButtonProps & DatePickerRangeProps;
|
|
69
|
+
/** Props for the DatePickerButton component. */
|
|
70
|
+
export type DatePickerButtonProps = DatePickerButtonSingleProps | DatePickerButtonRangeProps;
|
|
71
|
+
/**
|
|
72
|
+
* DatePickerButton renders a button-style trigger that opens the same
|
|
73
|
+
* calendar dropdown as {@link DatePicker}. Functionality and logic — value
|
|
74
|
+
* handling, range selection, presets, immediateCommit, allowOneDayRange,
|
|
75
|
+
* required, reset behavior — are unified with DatePicker via composition.
|
|
76
|
+
*
|
|
77
|
+
* The implementation dispatches to a mode-specific internal component so
|
|
78
|
+
* each branch carries concrete `Date` / `DateRange` types throughout — no
|
|
79
|
+
* runtime type assertions are needed inside the impls.
|
|
80
|
+
*
|
|
81
|
+
* The trigger and clear (X) controls are real, independently-focusable
|
|
82
|
+
* `<button>` elements. They sit as siblings under a `<PopoverAnchor>` so the
|
|
83
|
+
* calendar aligns to the visible pill without any nested-interactive HTML.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* <DatePickerButton mode="single" aria-label="Pick date" />
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* <DatePickerButton
|
|
90
|
+
* mode="range"
|
|
91
|
+
* variant="iconOnly"
|
|
92
|
+
* aria-label="Filter by date"
|
|
93
|
+
* />
|
|
94
|
+
*/
|
|
95
|
+
export declare const DatePickerButton: import('react').ForwardRefExoticComponent<DatePickerButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
|
|
96
|
+
export {};
|
|
97
|
+
//# sourceMappingURL=DatePickerButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DatePickerButton.d.ts","sourceRoot":"","sources":["../../../src/components/DatePickerButton/DatePickerButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,YAAY,EAAO,MAAM,0BAA0B,CAAA;AAKjE,O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