@pismo/marola 1.2.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Button-BAljjMv3.js → Button-cCziLrIy.js} +2 -2
- package/dist/{ClickAwayListener-DbEYZpyh.js → ClickAwayListener-CUayzVlD.js} +3 -3
- package/dist/Dialog.module-BtKUNFVu.js +13 -0
- package/dist/{Group-BKXO7GzU.js → Group-Cyc1W1kV.js} +1 -1
- package/dist/{Popup-Ck3XlWMq.js → Popup-C7AXLoP0.js} +5 -7
- package/dist/{Portal-oY3enyAm.js → Portal-CYV5TK_i.js} +2 -2
- package/dist/RadioButton.module-B4kmS66R.js +292 -0
- package/dist/SelectButton-k61YYjLu.js +58 -0
- package/dist/Tabs.module-DyJgAZt8.js +28 -0
- package/dist/{Toggle-Bkf8bKbA.js → Toggle-DEVeyo2f.js} +3 -3
- package/dist/assets/RadioButton.css +1 -1
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Tooltip.css +1 -1
- package/dist/clsx-OuTLNxxd.js +16 -0
- package/dist/{combineHooksSlotProps-C-zYvfnF.js → combineHooksSlotProps-BCXoX9Nx.js} +20 -21
- package/dist/components/Adornment/Adornment.d.ts +2 -3
- package/dist/components/Adornment/Adornment.js +1 -1
- package/dist/components/Adornment/Adornment.stories.d.ts +0 -1
- package/dist/components/Advice/Advice.d.ts +2 -3
- package/dist/components/Advice/Advice.js +1 -1
- package/dist/components/Advice/Advice.stories.d.ts +0 -1
- package/dist/components/Alert/Alert.d.ts +0 -1
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/Alert/Alert.stories.d.ts +0 -1
- package/dist/components/Autocomplete/Autocomplete.d.ts +1 -2
- package/dist/components/Autocomplete/Autocomplete.js +282 -298
- package/dist/components/Autocomplete/Autocomplete.stories.d.ts +0 -1
- package/dist/components/Avatar/Avatar.d.ts +0 -1
- package/dist/components/Avatar/Avatar.js +1 -1
- package/dist/components/Avatar/Avatar.stories.d.ts +0 -1
- package/dist/components/Badge/Badge.d.ts +0 -1
- package/dist/components/Badge/Badge.js +1 -1
- package/dist/components/Badge/Badge.stories.d.ts +1 -2
- package/dist/components/BankCard/BankCard.js +1 -1
- package/dist/components/BankCard/BankCard.stories.d.ts +0 -1
- package/dist/components/Button/Button.d.ts +2 -3
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Button.stories.d.ts +1 -2
- package/dist/components/Calendar/Calendar.js +1 -1
- package/dist/components/Calendar/Calendar.stories.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.d.ts +0 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/Checkbox.stories.d.ts +0 -1
- package/dist/components/Chip/Chip.d.ts +1 -2
- package/dist/components/Chip/Chip.js +4 -4
- package/dist/components/Chip/Chip.stories.d.ts +0 -1
- package/dist/components/ConfirmationDialog/ConfirmationDialog.d.ts +0 -1
- package/dist/components/ConfirmationDialog/ConfirmationDialog.stories.d.ts +1 -2
- package/dist/components/Description/Description.d.ts +0 -1
- package/dist/components/Description/Description.js +27 -42
- package/dist/components/Description/Description.stories.d.ts +0 -1
- package/dist/components/Dialog/Actions.d.ts +0 -1
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +0 -1
- package/dist/components/Dialog/Backdrop.js +2 -2
- package/dist/components/Dialog/CloseIconButton.js +2 -2
- package/dist/components/Dialog/Content.d.ts +0 -1
- package/dist/components/Dialog/Dialog.d.ts +5 -6
- package/dist/components/Dialog/Dialog.js +6 -6
- package/dist/components/Dialog/Dialog.stories.d.ts +0 -1
- package/dist/components/Dialog/DialogTitle.d.ts +1 -2
- package/dist/components/Dialog/DialogTitle.js +1 -1
- package/dist/components/EllipsisTooltip/EllipsisTooltip.d.ts +0 -1
- package/dist/components/EllipsisTooltip/EllipsisTooltip.js +1 -1
- package/dist/components/EllipsisTooltip/EllipsisTooltip.stories.d.ts +9 -5
- package/dist/components/Icon/Icon.d.ts +0 -1
- package/dist/components/Icon/Icon.stories.d.ts +1 -2
- package/dist/components/IconButton/Icon.stories.d.ts +0 -1
- package/dist/components/IconButton/IconButton.d.ts +1 -2
- package/dist/components/IconButton/IconButton.js +2 -2
- package/dist/components/Input/Input.d.ts +0 -1
- package/dist/components/Input/Input.js +259 -274
- package/dist/components/Input/Input.stories.d.ts +0 -1
- package/dist/components/InputSearch/InputSearch.d.ts +0 -1
- package/dist/components/InputSearch/InputSearch.js +1 -1
- package/dist/components/InputSearch/InputSearch.stories.d.ts +0 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.js +1 -1
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +0 -1
- package/dist/components/PageHeader/PageHeader.d.ts +1 -2
- package/dist/components/PageHeader/PageHeader.js +65 -80
- package/dist/components/PageHeader/PageHeader.stories.d.ts +0 -1
- package/dist/components/Pagination/Pagination.d.ts +0 -1
- package/dist/components/Pagination/Pagination.js +43 -58
- package/dist/components/Pagination/Pagination.stories.d.ts +1 -2
- package/dist/components/Popover/Popover.d.ts +0 -1
- package/dist/components/Popover/Popover.js +3 -3
- package/dist/components/Popover/Popover.stories.d.ts +1 -2
- package/dist/components/RadioButton/RadioButton.d.ts +7 -4
- package/dist/components/RadioButton/RadioButton.js +911 -33
- package/dist/components/RadioButton/RadioButton.stories.d.ts +7 -13
- package/dist/components/RadioButton/RadioOption.d.ts +13 -0
- package/dist/components/RadioButton/RadioOption.js +438 -0
- package/dist/components/ResultWithChips/ResultWithChips.d.ts +0 -1
- package/dist/components/ResultWithChips/ResultWithChips.js +1 -1
- package/dist/components/RowItem/RowItem.d.ts +2 -3
- package/dist/components/RowItem/RowItem.js +3 -3
- package/dist/components/RowItem/RowItem.stories.d.ts +0 -1
- package/dist/components/Select/Select.d.ts +0 -1
- package/dist/components/Select/Select.js +21 -21
- package/dist/components/Select/Select.stories.d.ts +1 -2
- package/dist/components/Select/SelectButton.d.ts +0 -1
- package/dist/components/Select/SelectButton.js +2 -2
- package/dist/components/Skeleton/Skeleton.js +1 -1
- package/dist/components/Skeleton/Skeleton.stories.d.ts +0 -1
- package/dist/components/Skeleton/SkeletonCircle.stories.d.ts +0 -1
- package/dist/components/Skeleton/SkeletonTable.stories.d.ts +0 -1
- package/dist/components/Snackbar/Snackbar.d.ts +0 -1
- package/dist/components/Snackbar/Snackbar.js +7 -8
- package/dist/components/Snackbar/Snackbar.stories.d.ts +1 -2
- package/dist/components/SortTooltip/SortTooltip.d.ts +0 -1
- package/dist/components/SortTooltip/SortTooltip.js +34 -51
- package/dist/components/Stepper/Stepper.d.ts +0 -1
- package/dist/components/Stepper/Stepper.js +19 -34
- package/dist/components/Stepper/Stepper.stories.d.ts +1 -2
- package/dist/components/StepperNavigator/StepperNavigator.js +1 -1
- package/dist/components/StepperNavigator/StepperNavigator.stories.d.ts +0 -1
- package/dist/components/Table/Table.d.ts +3 -4
- package/dist/components/Table/Table.js +1 -1
- package/dist/components/Table/Table.stories.d.ts +0 -1
- package/dist/components/Table/TableContext.d.ts +2 -3
- package/dist/components/Table/TableContext.js +4 -4
- package/dist/components/Table/_Table.TBody.stories.d.ts +1 -2
- package/dist/components/Table/_Table.THead.stories.d.ts +1 -2
- package/dist/components/Table/_Table.Td.stories.d.ts +1 -2
- package/dist/components/Table/_Table.Th.stories.d.ts +1 -2
- package/dist/components/Table/_Table.Tr.stories.d.ts +1 -2
- package/dist/components/Tabs/Tab.d.ts +1 -2
- package/dist/components/Tabs/Tab.js +5 -5
- package/dist/components/Tabs/Tab.stories.d.ts +1 -2
- package/dist/components/Tabs/TabPanel.d.ts +0 -1
- package/dist/components/Tabs/TabPanel.js +3 -3
- package/dist/components/Tabs/TabPanel.stories.d.ts +1 -2
- package/dist/components/Tabs/Tabs.d.ts +0 -1
- package/dist/components/Tabs/Tabs.js +5 -5
- package/dist/components/Tabs/Tabs.stories.d.ts +1 -2
- package/dist/components/Tag/Tag.d.ts +0 -1
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/Tag/Tag.stories.d.ts +1 -2
- package/dist/components/TextDisplay/TextDisplay.d.ts +1 -2
- package/dist/components/TextDisplay/TextDisplay.js +1 -1
- package/dist/components/TextDisplay/TextDisplay.stories.d.ts +0 -1
- package/dist/components/ToastCard/ToastCard.d.ts +0 -1
- package/dist/components/ToastCard/ToastCard.js +1 -1
- package/dist/components/ToastCard/ToastCard.stories.d.ts +0 -1
- package/dist/components/Toggle/Toggle.d.ts +0 -1
- package/dist/components/Toggle/Toggle.js +102 -117
- package/dist/components/Toggle/Toggle.stories.d.ts +0 -1
- package/dist/components/ToggleGroup/Group.d.ts +1 -2
- package/dist/components/ToggleGroup/Group.js +2 -2
- package/dist/components/ToggleGroup/Toggle.js +3 -3
- package/dist/components/ToggleGroup/ToggleGroup.js +2 -2
- package/dist/components/ToggleGroup/ToggleGroup.stories.d.ts +2 -3
- package/dist/components/Tooltip/Tooltip.d.ts +13 -9
- package/dist/components/Tooltip/Tooltip.js +146 -105
- package/dist/components/Tooltip/Tooltip.stories.d.ts +18 -10
- package/dist/components/Tooltip/Tooltip.test.d.ts +1 -0
- package/dist/components/TransactionRow/TransactionRow.d.ts +0 -1
- package/dist/components/TransactionRow/TransactionRow.stories.d.ts +0 -1
- package/dist/components/Typography/Typography.d.ts +0 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/Typography/Typography.stories.d.ts +0 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.d.ts +0 -1
- package/dist/contexts/SnackbarProvider/SnackbarProvider.js +5 -5
- package/dist/contexts/SnackbarProvider/SnackbarProvider.stories.d.ts +1 -2
- package/dist/{index-bQFToy-I.js → index-CATDT7fJ.js} +7927 -8368
- package/dist/main.js +2 -2
- package/dist/{ownerDocument-YGhwAnr1.js → ownerDocument-CAHSRRik.js} +1 -1
- package/dist/{useButton-DcihopJG.js → useButton-eF8MXAli.js} +1 -1
- package/dist/{useList-B9C55YB7.js → useList-CPY2roI7.js} +3 -4
- package/dist/{useSlotProps-C_I1kEHr.js → useSlotProps-DSnfx453.js} +123 -126
- package/dist/utils/inputNumberAsText.d.ts +0 -1
- package/dist/utils/inputNumberAsText.js +2 -4
- package/dist/utils/styleStrings.d.ts +0 -1
- package/package.json +2 -1
- package/dist/Dialog.module-CE1Q-5tJ.js +0 -28
- package/dist/SelectButton-DbiTJagF.js +0 -74
- package/dist/Tabs.module-CF9eCJzU.js +0 -28
- package/dist/clsx-DB4S2d7J.js +0 -22
|
@@ -1,16 +1,8 @@
|
|
|
1
1
|
import { StoryObj } from '@storybook/react';
|
|
2
|
-
|
|
2
|
+
import { RadioButtonProps } from './RadioButton';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component: ({ className, name, label,
|
|
6
|
-
className?: string | undefined;
|
|
7
|
-
name?: string | undefined;
|
|
8
|
-
label?: import('react').ReactNode;
|
|
9
|
-
checked?: boolean | undefined;
|
|
10
|
-
disabled?: boolean | undefined;
|
|
11
|
-
'data-testid'?: string | undefined;
|
|
12
|
-
onChange: (state: boolean) => void;
|
|
13
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
component: ({ className, name, label, disabled, defaultValue, checked, "data-testid": dataTestId, onChange, children, }: RadioButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
6
|
tags: string[];
|
|
15
7
|
parameters: {
|
|
16
8
|
layout: string;
|
|
@@ -19,6 +11,8 @@ declare const meta: {
|
|
|
19
11
|
export default meta;
|
|
20
12
|
type Story = StoryObj<typeof meta>;
|
|
21
13
|
export declare const Simple: Story;
|
|
22
|
-
export declare const
|
|
23
|
-
export declare const
|
|
24
|
-
export declare const
|
|
14
|
+
export declare const WithDisabledOption: Story;
|
|
15
|
+
export declare const WithOnChangeTrigger: Story;
|
|
16
|
+
export declare const WithDefaultValue: Story;
|
|
17
|
+
export declare const WithLegacyLabel: Story;
|
|
18
|
+
export declare const DisabledLegacy: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
type RadioOptionProps = {
|
|
3
|
+
/** Component label */
|
|
4
|
+
label?: React.ReactNode;
|
|
5
|
+
/** Component value */
|
|
6
|
+
value?: string | number | boolean;
|
|
7
|
+
/** Disabled state */
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/**Option testId */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const RadioOption: ({ label, value, disabled, "data-testid": dataTestId }: RadioOptionProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import { jsxs as A, jsx as k } from "react/jsx-runtime";
|
|
2
|
+
import { c as B } from "../../clsx-OuTLNxxd.js";
|
|
3
|
+
import "../Icon/Icon.js";
|
|
4
|
+
import { Typography as K } from "../Typography/Typography.js";
|
|
5
|
+
import * as a from "react";
|
|
6
|
+
import "../Input/Input.js";
|
|
7
|
+
import "../Avatar/Avatar.js";
|
|
8
|
+
import "../Button/Button.js";
|
|
9
|
+
import "../../Toggle-DEVeyo2f.js";
|
|
10
|
+
import "../Dialog/Dialog.js";
|
|
11
|
+
import "../IconButton/IconButton.js";
|
|
12
|
+
import "../InputSearch/InputSearch.js";
|
|
13
|
+
import "../Select/Select.js";
|
|
14
|
+
import "../Popover/Popover.js";
|
|
15
|
+
import { u as v, a as j, b as E, c as U, d as w, e as F, m as I, f as q, g as V, h as M, r as z, i as J, N as Q, s as N } from "../../RadioButton.module-B4kmS66R.js";
|
|
16
|
+
import "../Table/Table.js";
|
|
17
|
+
import "../Tabs/Tabs.js";
|
|
18
|
+
import "../../Group-Cyc1W1kV.js";
|
|
19
|
+
import "../../contexts/SnackbarProvider/SnackbarProvider.js";
|
|
20
|
+
import { P as s } from "../../useSlotProps-DSnfx453.js";
|
|
21
|
+
import { r as W } from "../../index-CATDT7fJ.js";
|
|
22
|
+
function X(r, e = !1) {
|
|
23
|
+
const [n, o] = a.useState(), [t, d] = a.useState(r);
|
|
24
|
+
return r && !t && (d(!0), n !== "starting" && !e && o("starting")), !r && t && n !== "ending" && o("ending"), !r && !t && n === "ending" && o(void 0), v(() => {
|
|
25
|
+
if (!r)
|
|
26
|
+
return;
|
|
27
|
+
e && o("starting");
|
|
28
|
+
const i = requestAnimationFrame(() => {
|
|
29
|
+
o(void 0);
|
|
30
|
+
});
|
|
31
|
+
return () => {
|
|
32
|
+
cancelAnimationFrame(i);
|
|
33
|
+
};
|
|
34
|
+
}, [r, e]), a.useMemo(() => ({
|
|
35
|
+
mounted: t,
|
|
36
|
+
setMounted: d,
|
|
37
|
+
transitionStatus: n
|
|
38
|
+
}), [t, n]);
|
|
39
|
+
}
|
|
40
|
+
function Y(r = {}) {
|
|
41
|
+
const {
|
|
42
|
+
label: e,
|
|
43
|
+
metadata: n
|
|
44
|
+
} = r, {
|
|
45
|
+
register: o,
|
|
46
|
+
unregister: t,
|
|
47
|
+
map: d,
|
|
48
|
+
elementsRef: i,
|
|
49
|
+
labelsRef: u
|
|
50
|
+
} = j(), [l, m] = a.useState(null), f = a.useRef(null), R = a.useCallback((c) => {
|
|
51
|
+
if (f.current = c, l !== null && (i.current[l] = c, u)) {
|
|
52
|
+
const h = e !== void 0;
|
|
53
|
+
u.current[l] = h ? e : (c == null ? void 0 : c.textContent) ?? null;
|
|
54
|
+
}
|
|
55
|
+
}, [l, i, u, e]);
|
|
56
|
+
return v(() => {
|
|
57
|
+
const c = f.current;
|
|
58
|
+
if (c)
|
|
59
|
+
return o(c, n), () => {
|
|
60
|
+
t(c);
|
|
61
|
+
};
|
|
62
|
+
}, [o, t, n]), v(() => {
|
|
63
|
+
var h;
|
|
64
|
+
const c = f.current ? (h = d.get(f.current)) == null ? void 0 : h.index : null;
|
|
65
|
+
c != null && m(c);
|
|
66
|
+
}, [d]), a.useMemo(() => ({
|
|
67
|
+
ref: R,
|
|
68
|
+
index: l ?? -1
|
|
69
|
+
}), [l, R]);
|
|
70
|
+
}
|
|
71
|
+
const Z = {
|
|
72
|
+
"data-starting-style": ""
|
|
73
|
+
}, $ = {
|
|
74
|
+
"data-ending-style": ""
|
|
75
|
+
}, ee = {
|
|
76
|
+
transitionStatus(r) {
|
|
77
|
+
return r === "starting" ? Z : r === "ending" ? $ : null;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function te(r, e = !1) {
|
|
81
|
+
const n = a.useRef(-1), o = a.useRef(-1), t = E(() => {
|
|
82
|
+
cancelAnimationFrame(n.current), clearTimeout(o.current);
|
|
83
|
+
});
|
|
84
|
+
return a.useEffect(() => t, [t]), E((d) => {
|
|
85
|
+
t();
|
|
86
|
+
const i = r.current;
|
|
87
|
+
i && (typeof i.getAnimations != "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED ? d() : n.current = requestAnimationFrame(() => {
|
|
88
|
+
function u() {
|
|
89
|
+
i && Promise.allSettled(i.getAnimations().map((l) => l.finished)).then(() => {
|
|
90
|
+
W.flushSync(d);
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
e ? o.current = window.setTimeout(u) : u();
|
|
94
|
+
}));
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
function ne(r) {
|
|
98
|
+
const {
|
|
99
|
+
open: e,
|
|
100
|
+
ref: n,
|
|
101
|
+
onComplete: o
|
|
102
|
+
} = r, t = U(e), d = E(o), i = te(n, e);
|
|
103
|
+
v(() => {
|
|
104
|
+
i(() => {
|
|
105
|
+
e === t.current && d();
|
|
106
|
+
});
|
|
107
|
+
}, [e, d, i, t]);
|
|
108
|
+
}
|
|
109
|
+
const oe = {
|
|
110
|
+
clip: "rect(0 0 0 0)",
|
|
111
|
+
overflow: "hidden",
|
|
112
|
+
whiteSpace: "nowrap",
|
|
113
|
+
position: "fixed",
|
|
114
|
+
top: 0,
|
|
115
|
+
left: 0,
|
|
116
|
+
border: 0,
|
|
117
|
+
padding: 0,
|
|
118
|
+
width: 1,
|
|
119
|
+
height: 1,
|
|
120
|
+
margin: -1
|
|
121
|
+
};
|
|
122
|
+
function re(r) {
|
|
123
|
+
const {
|
|
124
|
+
disabled: e,
|
|
125
|
+
readOnly: n,
|
|
126
|
+
value: o,
|
|
127
|
+
required: t
|
|
128
|
+
} = r, {
|
|
129
|
+
checkedValue: d,
|
|
130
|
+
setCheckedValue: i,
|
|
131
|
+
onValueChange: u,
|
|
132
|
+
touched: l,
|
|
133
|
+
setTouched: m,
|
|
134
|
+
fieldControlValidation: f
|
|
135
|
+
} = w(), {
|
|
136
|
+
setDirty: R,
|
|
137
|
+
validityData: c,
|
|
138
|
+
setTouched: h,
|
|
139
|
+
setFilled: b,
|
|
140
|
+
validationMode: x
|
|
141
|
+
} = F(), g = d === o, C = a.useRef(null);
|
|
142
|
+
v(() => {
|
|
143
|
+
var y;
|
|
144
|
+
(y = C.current) != null && y.checked && b(!0);
|
|
145
|
+
}, [b]);
|
|
146
|
+
const P = a.useCallback((y) => I(f ? f.getValidationProps(y) : y, {
|
|
147
|
+
role: "radio",
|
|
148
|
+
type: "button",
|
|
149
|
+
"aria-checked": g,
|
|
150
|
+
"aria-required": t || void 0,
|
|
151
|
+
"aria-disabled": e || void 0,
|
|
152
|
+
"aria-readonly": n || void 0,
|
|
153
|
+
disabled: e,
|
|
154
|
+
onKeyDown(p) {
|
|
155
|
+
p.key === "Enter" && p.preventDefault();
|
|
156
|
+
},
|
|
157
|
+
onClick(p) {
|
|
158
|
+
var O;
|
|
159
|
+
p.defaultPrevented || e || n || (p.preventDefault(), (O = C.current) == null || O.click());
|
|
160
|
+
},
|
|
161
|
+
onFocus(p) {
|
|
162
|
+
var O;
|
|
163
|
+
p.defaultPrevented || e || n || !l || ((O = C.current) == null || O.click(), m(!1));
|
|
164
|
+
}
|
|
165
|
+
}), [f, g, t, e, n, l, m]), T = a.useCallback((y) => I(y, {
|
|
166
|
+
type: "radio",
|
|
167
|
+
ref: C,
|
|
168
|
+
tabIndex: -1,
|
|
169
|
+
style: oe,
|
|
170
|
+
"aria-hidden": !0,
|
|
171
|
+
disabled: e,
|
|
172
|
+
checked: g,
|
|
173
|
+
required: t,
|
|
174
|
+
readOnly: n,
|
|
175
|
+
onChange(p) {
|
|
176
|
+
p.nativeEvent.defaultPrevented || e || n || o == null || (h(!0), R(o !== c.initialValue), i(o), b(!0), u == null || u(o, p.nativeEvent), x === "onChange" && (f == null || f.commitValidation(o)));
|
|
177
|
+
}
|
|
178
|
+
}), [e, g, t, n, o, h, R, c.initialValue, i, b, u, x, f]);
|
|
179
|
+
return a.useMemo(() => ({
|
|
180
|
+
checked: g,
|
|
181
|
+
getRootProps: P,
|
|
182
|
+
getInputProps: T
|
|
183
|
+
}), [g, P, T]);
|
|
184
|
+
}
|
|
185
|
+
const D = /* @__PURE__ */ a.createContext(void 0);
|
|
186
|
+
process.env.NODE_ENV !== "production" && (D.displayName = "RadioRootContext");
|
|
187
|
+
function se() {
|
|
188
|
+
const r = a.useContext(D);
|
|
189
|
+
if (r === void 0)
|
|
190
|
+
throw new Error("Base UI: RadioRootContext is missing. Radio parts must be placed within <Radio.Root>.");
|
|
191
|
+
return r;
|
|
192
|
+
}
|
|
193
|
+
function ie(r = {}) {
|
|
194
|
+
const {
|
|
195
|
+
highlightedIndex: e,
|
|
196
|
+
onHighlightedIndexChange: n
|
|
197
|
+
} = q(), {
|
|
198
|
+
ref: o,
|
|
199
|
+
index: t
|
|
200
|
+
} = Y(r), d = e === t, i = a.useCallback((u = {}) => I(u, {
|
|
201
|
+
tabIndex: d ? 0 : -1,
|
|
202
|
+
onFocus() {
|
|
203
|
+
n(t);
|
|
204
|
+
}
|
|
205
|
+
}), [d, t, n]);
|
|
206
|
+
return a.useMemo(() => ({
|
|
207
|
+
getItemProps: i,
|
|
208
|
+
ref: o,
|
|
209
|
+
index: t
|
|
210
|
+
}), [i, o, t]);
|
|
211
|
+
}
|
|
212
|
+
function _(r) {
|
|
213
|
+
const {
|
|
214
|
+
render: e,
|
|
215
|
+
className: n,
|
|
216
|
+
itemRef: o,
|
|
217
|
+
metadata: t,
|
|
218
|
+
...d
|
|
219
|
+
} = r, {
|
|
220
|
+
highlightedIndex: i
|
|
221
|
+
} = q(), {
|
|
222
|
+
getItemProps: u,
|
|
223
|
+
ref: l,
|
|
224
|
+
index: m
|
|
225
|
+
} = ie({
|
|
226
|
+
metadata: t
|
|
227
|
+
}), f = a.useMemo(() => ({
|
|
228
|
+
highlighted: m === i
|
|
229
|
+
}), [m, i]), R = V(o, l), {
|
|
230
|
+
renderElement: c
|
|
231
|
+
} = M({
|
|
232
|
+
propGetter: u,
|
|
233
|
+
ref: R,
|
|
234
|
+
render: e ?? "div",
|
|
235
|
+
state: f,
|
|
236
|
+
className: n,
|
|
237
|
+
extraProps: d
|
|
238
|
+
});
|
|
239
|
+
return c();
|
|
240
|
+
}
|
|
241
|
+
process.env.NODE_ENV !== "production" && (_.propTypes = {
|
|
242
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
243
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
244
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
245
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
246
|
+
/**
|
|
247
|
+
* @ignore
|
|
248
|
+
*/
|
|
249
|
+
children: s.node,
|
|
250
|
+
/**
|
|
251
|
+
* CSS class applied to the element, or a function that
|
|
252
|
+
* returns a class based on the component’s state.
|
|
253
|
+
*/
|
|
254
|
+
className: s.oneOfType([s.func, s.string]),
|
|
255
|
+
/**
|
|
256
|
+
* @ignore
|
|
257
|
+
*/
|
|
258
|
+
itemRef: z,
|
|
259
|
+
/**
|
|
260
|
+
* @ignore
|
|
261
|
+
*/
|
|
262
|
+
metadata: s.any,
|
|
263
|
+
/**
|
|
264
|
+
* Allows you to replace the component’s HTML element
|
|
265
|
+
* with a different tag, or compose it with another component.
|
|
266
|
+
*
|
|
267
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
268
|
+
*/
|
|
269
|
+
render: s.oneOfType([s.element, s.func])
|
|
270
|
+
});
|
|
271
|
+
const H = {
|
|
272
|
+
checked(r) {
|
|
273
|
+
return r ? {
|
|
274
|
+
"data-checked": ""
|
|
275
|
+
} : {
|
|
276
|
+
"data-unchecked": ""
|
|
277
|
+
};
|
|
278
|
+
},
|
|
279
|
+
...ee,
|
|
280
|
+
...J
|
|
281
|
+
}, G = /* @__PURE__ */ a.forwardRef(function(e, n) {
|
|
282
|
+
const {
|
|
283
|
+
render: o,
|
|
284
|
+
className: t,
|
|
285
|
+
disabled: d = !1,
|
|
286
|
+
readOnly: i = !1,
|
|
287
|
+
required: u = !1,
|
|
288
|
+
...l
|
|
289
|
+
} = e, {
|
|
290
|
+
disabled: m,
|
|
291
|
+
readOnly: f,
|
|
292
|
+
required: R,
|
|
293
|
+
setCheckedValue: c
|
|
294
|
+
} = w(), {
|
|
295
|
+
state: h,
|
|
296
|
+
disabled: b
|
|
297
|
+
} = F(), x = b || m || d, g = f || i, C = R || u, {
|
|
298
|
+
getRootProps: P,
|
|
299
|
+
getInputProps: T,
|
|
300
|
+
checked: y
|
|
301
|
+
} = re({
|
|
302
|
+
...e,
|
|
303
|
+
disabled: x,
|
|
304
|
+
readOnly: g
|
|
305
|
+
}), p = a.useMemo(() => ({
|
|
306
|
+
...h,
|
|
307
|
+
required: C,
|
|
308
|
+
disabled: x,
|
|
309
|
+
readOnly: g,
|
|
310
|
+
checked: y
|
|
311
|
+
}), [h, x, g, y, C]), O = a.useMemo(() => p, [p]), {
|
|
312
|
+
renderElement: S
|
|
313
|
+
} = M({
|
|
314
|
+
propGetter: P,
|
|
315
|
+
render: o ?? "button",
|
|
316
|
+
ref: n,
|
|
317
|
+
className: t,
|
|
318
|
+
state: p,
|
|
319
|
+
extraProps: l,
|
|
320
|
+
customStyleHookMapping: H
|
|
321
|
+
});
|
|
322
|
+
return /* @__PURE__ */ A(D.Provider, {
|
|
323
|
+
value: O,
|
|
324
|
+
children: [c === Q ? S() : /* @__PURE__ */ k(_, {
|
|
325
|
+
render: S()
|
|
326
|
+
}), /* @__PURE__ */ k("input", {
|
|
327
|
+
...T()
|
|
328
|
+
})]
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
process.env.NODE_ENV !== "production" && (G.propTypes = {
|
|
332
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
333
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
334
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
335
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
336
|
+
/**
|
|
337
|
+
* @ignore
|
|
338
|
+
*/
|
|
339
|
+
children: s.node,
|
|
340
|
+
/**
|
|
341
|
+
* CSS class applied to the element, or a function that
|
|
342
|
+
* returns a class based on the component’s state.
|
|
343
|
+
*/
|
|
344
|
+
className: s.oneOfType([s.func, s.string]),
|
|
345
|
+
/**
|
|
346
|
+
* Whether the component should ignore user interaction.
|
|
347
|
+
* @default false
|
|
348
|
+
*/
|
|
349
|
+
disabled: s.bool,
|
|
350
|
+
/**
|
|
351
|
+
* Whether the user should be unable to select the radio button.
|
|
352
|
+
* @default false
|
|
353
|
+
*/
|
|
354
|
+
readOnly: s.bool,
|
|
355
|
+
/**
|
|
356
|
+
* Allows you to replace the component’s HTML element
|
|
357
|
+
* with a different tag, or compose it with another component.
|
|
358
|
+
*
|
|
359
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
360
|
+
*/
|
|
361
|
+
render: s.oneOfType([s.element, s.func]),
|
|
362
|
+
/**
|
|
363
|
+
* Whether the user must choose a value before submitting a form.
|
|
364
|
+
* @default false
|
|
365
|
+
*/
|
|
366
|
+
required: s.bool,
|
|
367
|
+
/**
|
|
368
|
+
* The unique identifying value of the radio in a group.
|
|
369
|
+
*/
|
|
370
|
+
value: s.any.isRequired
|
|
371
|
+
});
|
|
372
|
+
const L = /* @__PURE__ */ a.forwardRef(function(e, n) {
|
|
373
|
+
const {
|
|
374
|
+
render: o,
|
|
375
|
+
className: t,
|
|
376
|
+
keepMounted: d = !1,
|
|
377
|
+
...i
|
|
378
|
+
} = e, u = se(), l = u.checked, {
|
|
379
|
+
transitionStatus: m,
|
|
380
|
+
setMounted: f
|
|
381
|
+
} = X(l), R = a.useMemo(() => ({
|
|
382
|
+
...u,
|
|
383
|
+
transitionStatus: m
|
|
384
|
+
}), [u, m]), c = a.useRef(null), h = V(n, c), {
|
|
385
|
+
renderElement: b
|
|
386
|
+
} = M({
|
|
387
|
+
render: o ?? "span",
|
|
388
|
+
ref: h,
|
|
389
|
+
className: t,
|
|
390
|
+
state: R,
|
|
391
|
+
extraProps: i,
|
|
392
|
+
customStyleHookMapping: H
|
|
393
|
+
});
|
|
394
|
+
return ne({
|
|
395
|
+
open: l,
|
|
396
|
+
ref: c,
|
|
397
|
+
onComplete() {
|
|
398
|
+
l || f(!1);
|
|
399
|
+
}
|
|
400
|
+
}), d || l ? b() : null;
|
|
401
|
+
});
|
|
402
|
+
process.env.NODE_ENV !== "production" && (L.propTypes = {
|
|
403
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
404
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
405
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
406
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
407
|
+
/**
|
|
408
|
+
* @ignore
|
|
409
|
+
*/
|
|
410
|
+
children: s.node,
|
|
411
|
+
/**
|
|
412
|
+
* CSS class applied to the element, or a function that
|
|
413
|
+
* returns a class based on the component’s state.
|
|
414
|
+
*/
|
|
415
|
+
className: s.oneOfType([s.func, s.string]),
|
|
416
|
+
/**
|
|
417
|
+
* Whether to keep the HTML element in the DOM when the radio button is inactive.
|
|
418
|
+
* @default false
|
|
419
|
+
*/
|
|
420
|
+
keepMounted: s.bool,
|
|
421
|
+
/**
|
|
422
|
+
* Allows you to replace the component’s HTML element
|
|
423
|
+
* with a different tag, or compose it with another component.
|
|
424
|
+
*
|
|
425
|
+
* Accepts a `ReactElement` or a function that returns the element to render.
|
|
426
|
+
*/
|
|
427
|
+
render: s.oneOfType([s.element, s.func])
|
|
428
|
+
});
|
|
429
|
+
const Te = ({ label: r, value: e, disabled: n, "data-testid": o }) => {
|
|
430
|
+
const t = B(N["radio-label"], n && N["radio-label__disabled"]);
|
|
431
|
+
return /* @__PURE__ */ A("label", { className: N.option, "data-testid": o, children: [
|
|
432
|
+
/* @__PURE__ */ k(G, { disabled: n, value: e, className: N.radio, children: /* @__PURE__ */ k(L, { className: N.indicator }) }),
|
|
433
|
+
/* @__PURE__ */ k(K, { color: "var(--colors-neutral-text-color-text)", className: t, variant: "base-lg", children: r })
|
|
434
|
+
] });
|
|
435
|
+
};
|
|
436
|
+
export {
|
|
437
|
+
Te as RadioOption
|
|
438
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { C as t } from "../../Toggle-
|
|
2
|
+
import { C as t } from "../../Toggle-DEVeyo2f.js";
|
|
3
3
|
import '../../assets/ResultWithChips.css';const r = "_container_hgp0p_1", o = "_label_hgp0p_17", a = {
|
|
4
4
|
container: r,
|
|
5
5
|
"chip-item-wrapper": "_chip-item-wrapper_hgp0p_8",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { RequireAllOrNone } from '../../types/helpers';
|
|
2
|
-
import { AdornmentProps } from '../../main';
|
|
3
1
|
import { KeyboardEvent, MouseEvent, ReactNode } from 'react';
|
|
4
|
-
|
|
2
|
+
import { AdornmentProps } from '../../main';
|
|
3
|
+
import { RequireAllOrNone } from '../../types/helpers';
|
|
5
4
|
export type RowItemBaseProps = {
|
|
6
5
|
/** Items to display as main content of the row */
|
|
7
6
|
children: ReactNode;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import "../../clsx-
|
|
3
|
+
import "../../clsx-OuTLNxxd.js";
|
|
4
4
|
import "../Adornment/Adornment.js";
|
|
5
5
|
import "../Icon/Icon.js";
|
|
6
6
|
import "../Typography/Typography.js";
|
|
7
7
|
import "../Input/Input.js";
|
|
8
8
|
import "../Avatar/Avatar.js";
|
|
9
9
|
import "../Button/Button.js";
|
|
10
|
-
import { R as h, R as j } from "../../Toggle-
|
|
10
|
+
import { R as h, R as j } from "../../Toggle-DEVeyo2f.js";
|
|
11
11
|
import "../Dialog/Dialog.js";
|
|
12
12
|
import "../IconButton/IconButton.js";
|
|
13
13
|
import "../InputSearch/InputSearch.js";
|
|
@@ -15,7 +15,7 @@ import "../Select/Select.js";
|
|
|
15
15
|
import "../Popover/Popover.js";
|
|
16
16
|
import "../Table/Table.js";
|
|
17
17
|
import "../Tabs/Tabs.js";
|
|
18
|
-
import "../../Group-
|
|
18
|
+
import "../../Group-Cyc1W1kV.js";
|
|
19
19
|
import "../../contexts/SnackbarProvider/SnackbarProvider.js";
|
|
20
20
|
export {
|
|
21
21
|
h as RowItem,
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as m, jsxs as Y } from "react/jsx-runtime";
|
|
2
2
|
import * as r from "react";
|
|
3
|
-
import { createContext as We,
|
|
4
|
-
import { c as K } from "../../clsx-
|
|
3
|
+
import { createContext as We, useId as Je, useContext as Ge } from "react";
|
|
4
|
+
import { c as K } from "../../clsx-OuTLNxxd.js";
|
|
5
5
|
import { Checkbox as Qe } from "../Checkbox/Checkbox.js";
|
|
6
6
|
import { Icon as Xe } from "../Icon/Icon.js";
|
|
7
7
|
import { Typography as _e } from "../Typography/Typography.js";
|
|
8
|
-
import { s as y, S as Ye } from "../../SelectButton-
|
|
9
|
-
import { g as we, a as Ie, u as ee, f as se, b as g,
|
|
10
|
-
import {
|
|
11
|
-
import { u as
|
|
12
|
-
import { u as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
8
|
+
import { s as y, S as Ye } from "../../SelectButton-k61YYjLu.js";
|
|
9
|
+
import { g as we, a as Ie, u as ee, f as se, b as g, _ as Ne, c as re, d as ke, e as Me, P as l } from "../../useSlotProps-DSnfx453.js";
|
|
10
|
+
import { P as Ze } from "../../Popup-C7AXLoP0.js";
|
|
11
|
+
import { u as et, c as ae, a as Se, L as Z } from "../../combineHooksSlotProps-BCXoX9Nx.js";
|
|
12
|
+
import { u as tt, a as ot, C as nt } from "../../useCompoundItem-B7Eo_qZk.js";
|
|
13
|
+
import { m as Re, h as lt, l as st, u as rt } from "../../useList-CPY2roI7.js";
|
|
14
|
+
import { u as Te } from "../../useId-BW-oWmul.js";
|
|
15
|
+
import { u as Le } from "../../useButton-eF8MXAli.js";
|
|
16
16
|
import { u as at } from "../../useEnhancedEffect-CJGo-L3B.js";
|
|
17
17
|
const it = {
|
|
18
18
|
border: 0,
|
|
@@ -40,15 +40,15 @@ function ct(n) {
|
|
|
40
40
|
getRootProps: p,
|
|
41
41
|
highlighted: f,
|
|
42
42
|
selected: d
|
|
43
|
-
} =
|
|
43
|
+
} = et({
|
|
44
44
|
item: o
|
|
45
45
|
}), {
|
|
46
46
|
getRootProps: _,
|
|
47
47
|
rootRef: k
|
|
48
|
-
} =
|
|
48
|
+
} = Le({
|
|
49
49
|
disabled: c,
|
|
50
50
|
focusableWhenDisabled: !0
|
|
51
|
-
}), h =
|
|
51
|
+
}), h = Te(u), S = r.useRef(null), R = r.useMemo(() => ({
|
|
52
52
|
disabled: c,
|
|
53
53
|
label: i,
|
|
54
54
|
value: o,
|
|
@@ -56,7 +56,7 @@ function ct(n) {
|
|
|
56
56
|
id: h
|
|
57
57
|
}), [c, i, o, h]), {
|
|
58
58
|
index: I
|
|
59
|
-
} =
|
|
59
|
+
} = tt(o, R), O = ee(s, S, k), x = (b) => (C) => {
|
|
60
60
|
var P;
|
|
61
61
|
(P = b.onKeyDown) == null || P.call(b, C), !C.defaultMuiPrevented && [" ", "Enter"].includes(C.key) && (C.defaultMuiPrevented = !0);
|
|
62
62
|
}, A = (b = {}) => ({
|
|
@@ -299,7 +299,7 @@ function ht(n) {
|
|
|
299
299
|
getSerializedValue: A = gt,
|
|
300
300
|
value: b,
|
|
301
301
|
componentName: C = "useSelect"
|
|
302
|
-
} = n, P = r.useRef(null), B = ee(i, P), V = r.useRef(null), D =
|
|
302
|
+
} = n, P = r.useRef(null), B = ee(i, P), V = r.useRef(null), D = Te(p);
|
|
303
303
|
let w;
|
|
304
304
|
b === void 0 && s === void 0 ? w = [] : s !== void 0 && (d ? w = s : w = s == null ? [] : [s]);
|
|
305
305
|
const H = r.useMemo(() => {
|
|
@@ -308,7 +308,7 @@ function ht(n) {
|
|
|
308
308
|
}, [b, d]), {
|
|
309
309
|
subitems: M,
|
|
310
310
|
contextValue: j
|
|
311
|
-
} =
|
|
311
|
+
} = ot(), T = r.useMemo(() => O != null ? new Map(O.map((e, t) => [e.value, {
|
|
312
312
|
value: e.value,
|
|
313
313
|
label: e.label,
|
|
314
314
|
disabled: e.disabled,
|
|
@@ -319,7 +319,7 @@ function ht(n) {
|
|
|
319
319
|
active: ce,
|
|
320
320
|
focusVisible: de,
|
|
321
321
|
rootRef: z
|
|
322
|
-
} =
|
|
322
|
+
} = Le({
|
|
323
323
|
disabled: u,
|
|
324
324
|
rootRef: B
|
|
325
325
|
}), U = r.useMemo(() => Array.from(T.keys()), [T]), N = r.useCallback((e) => {
|
|
@@ -525,7 +525,7 @@ function xt(n) {
|
|
|
525
525
|
registerItem: p,
|
|
526
526
|
totalSubitemCount: f
|
|
527
527
|
}), [p, s, f]);
|
|
528
|
-
return /* @__PURE__ */ m(
|
|
528
|
+
return /* @__PURE__ */ m(nt.Provider, {
|
|
529
529
|
value: _,
|
|
530
530
|
children: /* @__PURE__ */ m(Se.Provider, {
|
|
531
531
|
value: d,
|
|
@@ -672,7 +672,7 @@ const $e = /* @__PURE__ */ r.forwardRef(function(o, i) {
|
|
|
672
672
|
children: ""
|
|
673
673
|
}))
|
|
674
674
|
)
|
|
675
|
-
})), ce && /* @__PURE__ */ m(
|
|
675
|
+
})), ce && /* @__PURE__ */ m(Ze, g({
|
|
676
676
|
slots: {
|
|
677
677
|
root: ne
|
|
678
678
|
}
|
|
@@ -815,7 +815,7 @@ process.env.NODE_ENV !== "production" && ($e.propTypes = {
|
|
|
815
815
|
*/
|
|
816
816
|
value: l.any
|
|
817
817
|
});
|
|
818
|
-
const He = We({}), Rt = () =>
|
|
818
|
+
const He = We({}), Rt = () => Ge(He), _t = (n) => {
|
|
819
819
|
const { children: o, icon: i, className: c, ...s } = n, { multiple: u, selectedValue: p = [] } = Rt();
|
|
820
820
|
return /* @__PURE__ */ Y(
|
|
821
821
|
Ee,
|
|
@@ -862,7 +862,7 @@ const He = We({}), Rt = () => Je(He), _t = (n) => {
|
|
|
862
862
|
...B
|
|
863
863
|
} = n, V = (H, M) => {
|
|
864
864
|
H && (s == null || s(M, H));
|
|
865
|
-
}, D =
|
|
865
|
+
}, D = Je(), w = c || `select_${D}`;
|
|
866
866
|
return /* @__PURE__ */ Y(
|
|
867
867
|
"div",
|
|
868
868
|
{
|