@pismo/marola 0.0.1-alpha.5 → 0.0.1-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -2
- package/dist/{Button-D--uN90N.js → Button-B1umG8kJ.js} +3 -3
- package/dist/ClickAwayListener-BKznXF1d.js +106 -0
- package/dist/Dialog.module-CGVM5V_D.js +15 -0
- package/dist/Portal-BcdMtRGF.js +73 -0
- package/dist/{Tabs.module-BKlNuSPH.js → Tabs.module-BA-PC7fA.js} +13 -13
- package/dist/_commonjsHelpers-CT_km90n.js +30 -0
- package/dist/assets/Advice.css +1 -0
- package/dist/assets/Button.css +1 -1
- package/dist/assets/Checkbox.css +1 -0
- package/dist/assets/Dialog.css +1 -1
- package/dist/assets/IconButton.css +1 -1
- package/dist/assets/Input.css +1 -0
- package/dist/assets/Pagination.css +1 -1
- package/dist/assets/Skeleton.css +1 -0
- package/dist/assets/Snackbar.css +1 -0
- package/dist/assets/SortTooltip.css +1 -0
- package/dist/assets/Stepper.css +1 -0
- package/dist/assets/Table.css +1 -0
- package/dist/assets/Tabs.css +1 -1
- package/dist/assets/Toggle.css +1 -0
- package/dist/assets/Tooltip.css +1 -0
- package/dist/assets/Typography.css +1 -1
- package/dist/assets/{main.css → global.css} +1 -1
- package/dist/components/Advice/Advice.d.ts +16 -0
- package/dist/components/Advice/Advice.js +25 -0
- package/dist/components/Button/Button.d.ts +9 -1
- package/dist/components/Button/Button.js +54 -38
- package/dist/components/Button/Button.stories.d.ts +60 -0
- package/dist/components/Button/Button.stories.js +40 -0
- package/dist/components/Checkbox/Checkbox.d.ts +17 -0
- package/dist/components/Checkbox/Checkbox.js +48 -0
- package/dist/components/Dialog/Actions.js +1 -1
- package/dist/components/Dialog/Backdrop.d.ts +1 -1
- package/dist/components/Dialog/Backdrop.js +1 -1
- package/dist/components/Dialog/CloseIconButton.js +12 -124
- package/dist/components/Dialog/Dialog.d.ts +3 -2
- package/dist/components/Dialog/Dialog.js +418 -20072
- package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
- package/dist/components/Dialog/Dialog.stories.js +59 -0
- package/dist/components/Dialog/Title.js +1 -1
- package/dist/components/Icon/Icon.d.ts +18 -0
- package/dist/components/Icon/Icon.js +95 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/IconButton/IconButton.js +54 -65
- package/dist/components/Input/Input.d.ts +44 -0
- package/dist/components/Input/Input.js +497 -0
- package/dist/components/Input/Input.stories.d.ts +43 -0
- package/dist/components/Input/Input.stories.js +106 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.d.ts +2 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.d.ts +14 -0
- package/dist/components/LoadingSpinner/LoadingSpinner.stories.js +38 -0
- package/dist/components/PageHeader/PageHeader.d.ts +25 -15
- package/dist/components/PageHeader/PageHeader.js +32 -50
- package/dist/components/PageHeader/PageHeader.stories.d.ts +43 -0
- package/dist/components/PageHeader/PageHeader.stories.js +49 -0
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.js +47 -47
- package/dist/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/components/Skeleton/Skeleton.js +26 -0
- package/dist/components/Snackbar/Snackbar.d.ts +13 -0
- package/dist/components/Snackbar/Snackbar.js +622 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +26 -0
- package/dist/components/SortTooltip/SortTooltip.js +67 -1
- package/dist/components/Stepper/Stepper.d.ts +16 -0
- package/dist/components/Stepper/Stepper.js +33 -0
- package/dist/components/Table/Table.d.ts +39 -0
- package/dist/components/Table/Table.js +122 -1
- package/dist/components/Table/TableContext.d.ts +19 -0
- package/dist/components/Table/TableContext.js +21 -1
- package/dist/components/Tabs/Tab.d.ts +1 -1
- package/dist/components/Tabs/Tab.js +5 -5
- package/dist/components/Tabs/TabPanel.d.ts +1 -1
- package/dist/components/Tabs/TabPanel.js +4 -4
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/Tabs/Tabs.js +3 -3
- package/dist/components/Toggle/Toggle.d.ts +14 -0
- package/dist/components/Toggle/Toggle.js +256 -0
- package/dist/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/components/Tooltip/Tooltip.js +1366 -1
- package/dist/components/Typography/Typography.d.ts +14 -5
- package/dist/components/Typography/Typography.js +76 -59
- package/dist/components/Typography/Typography.stories.d.ts +31 -0
- package/dist/components/Typography/Typography.stories.js +30 -0
- package/dist/components/Typography/typography.test.d.ts +1 -0
- package/dist/components/Typography/typography.test.js +11357 -0
- package/dist/index-BNWbc5Kh.js +19628 -0
- package/dist/{index-BvA1HyDs.js → index-CqjC7P5Y.js} +91 -95
- package/dist/magic-string.es-O_8lTkE3.js +738 -0
- package/dist/main.d.ts +16 -7
- package/dist/main.js +50 -28
- package/dist/objectWithoutPropertiesLoose-D7Cp0Pg_.js +26 -0
- package/dist/test-utils/assertStyles.d.ts +1 -0
- package/dist/test-utils/assertStyles.js +11 -0
- package/dist/types/helpers.d.ts +8 -0
- package/dist/useButton-Bc8IAgyk.js +106 -0
- package/dist/{useCompoundItem-wTwXbURC.js → useCompoundItem-CTYi5M_E.js} +1 -1
- package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
- package/dist/useTimeout-DxF9kiZL.js +36 -0
- package/dist/utils/styleStrings.d.ts +6 -0
- package/dist/utils/styleStrings.js +10 -0
- package/dist/utils/styleStrings.test.d.ts +1 -0
- package/dist/utils/styleStrings.test.js +41 -0
- package/dist/vi.Y_w82WR8-Df0JUamG.js +9860 -0
- package/package.json +30 -9
- package/dist/Dialog.module-BKWFakxu.js +0 -15
- package/dist/objectWithoutPropertiesLoose-ClNcje2_.js +0 -22
- package/dist/useButton-abQpo0za.js +0 -187
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import '../../assets/Toggle.css';
|
|
2
|
+
import { jsxs as I, jsx as O } from "react/jsx-runtime";
|
|
3
|
+
import { c as N } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { a as y, _ as v } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
5
|
+
import * as S from "react";
|
|
6
|
+
import { u as U, g as q, a as H, b as V, P as e, c as M, d as A } from "../../index-CqjC7P5Y.js";
|
|
7
|
+
import { u as D } from "../../useControlled-CCMYYdCM.js";
|
|
8
|
+
import { u as L } from "../../useIsFocusVisible-BH4IAdcw.js";
|
|
9
|
+
function W(l) {
|
|
10
|
+
const {
|
|
11
|
+
checked: o,
|
|
12
|
+
defaultChecked: d,
|
|
13
|
+
disabled: c,
|
|
14
|
+
onBlur: r,
|
|
15
|
+
onChange: p,
|
|
16
|
+
onFocus: g,
|
|
17
|
+
onFocusVisible: a,
|
|
18
|
+
readOnly: n,
|
|
19
|
+
required: P
|
|
20
|
+
} = l, [u, x] = D({
|
|
21
|
+
controlled: o,
|
|
22
|
+
default: !!d,
|
|
23
|
+
name: "Switch",
|
|
24
|
+
state: "checked"
|
|
25
|
+
}), B = (t) => (s) => {
|
|
26
|
+
var h;
|
|
27
|
+
s.nativeEvent.defaultPrevented || (x(s.target.checked), p == null || p(s), (h = t.onChange) == null || h.call(t, s));
|
|
28
|
+
}, {
|
|
29
|
+
isFocusVisibleRef: m,
|
|
30
|
+
onBlur: w,
|
|
31
|
+
onFocus: f,
|
|
32
|
+
ref: _
|
|
33
|
+
} = L(), [b, T] = S.useState(!1);
|
|
34
|
+
c && b && T(!1), S.useEffect(() => {
|
|
35
|
+
m.current = b;
|
|
36
|
+
}, [b, m]);
|
|
37
|
+
const k = S.useRef(null), R = (t) => (s) => {
|
|
38
|
+
var h;
|
|
39
|
+
k.current || (k.current = s.currentTarget), f(s), m.current === !0 && (T(!0), a == null || a(s)), g == null || g(s), (h = t.onFocus) == null || h.call(t, s);
|
|
40
|
+
}, C = (t) => (s) => {
|
|
41
|
+
var h;
|
|
42
|
+
w(s), m.current === !1 && T(!1), r == null || r(s), (h = t.onBlur) == null || h.call(t, s);
|
|
43
|
+
}, F = U(_, k);
|
|
44
|
+
return {
|
|
45
|
+
checked: u,
|
|
46
|
+
disabled: !!c,
|
|
47
|
+
focusVisible: b,
|
|
48
|
+
getInputProps: (t = {}) => y({
|
|
49
|
+
checked: o,
|
|
50
|
+
defaultChecked: d,
|
|
51
|
+
disabled: c,
|
|
52
|
+
readOnly: n,
|
|
53
|
+
ref: F,
|
|
54
|
+
required: P,
|
|
55
|
+
type: "checkbox",
|
|
56
|
+
role: "switch",
|
|
57
|
+
"aria-checked": o
|
|
58
|
+
}, t, {
|
|
59
|
+
onChange: B(t),
|
|
60
|
+
onFocus: R(t),
|
|
61
|
+
onBlur: C(t)
|
|
62
|
+
}),
|
|
63
|
+
inputRef: F,
|
|
64
|
+
readOnly: !!n
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const $ = "Switch";
|
|
68
|
+
function z(l) {
|
|
69
|
+
return q($, l);
|
|
70
|
+
}
|
|
71
|
+
H($, ["root", "input", "track", "thumb", "checked", "disabled", "focusVisible", "readOnly"]);
|
|
72
|
+
const G = ["checked", "defaultChecked", "disabled", "onBlur", "onChange", "onFocus", "onFocusVisible", "readOnly", "required", "slotProps", "slots"], J = (l) => {
|
|
73
|
+
const {
|
|
74
|
+
checked: o,
|
|
75
|
+
disabled: d,
|
|
76
|
+
focusVisible: c,
|
|
77
|
+
readOnly: r
|
|
78
|
+
} = l;
|
|
79
|
+
return M({
|
|
80
|
+
root: ["root", o && "checked", d && "disabled", c && "focusVisible", r && "readOnly"],
|
|
81
|
+
thumb: ["thumb"],
|
|
82
|
+
input: ["input"],
|
|
83
|
+
track: ["track"]
|
|
84
|
+
}, A(z));
|
|
85
|
+
}, E = /* @__PURE__ */ S.forwardRef(function(o, d) {
|
|
86
|
+
var c, r, p, g;
|
|
87
|
+
const {
|
|
88
|
+
slotProps: a = {},
|
|
89
|
+
slots: n = {}
|
|
90
|
+
} = o, P = v(o, G), {
|
|
91
|
+
getInputProps: u,
|
|
92
|
+
checked: x,
|
|
93
|
+
disabled: B,
|
|
94
|
+
focusVisible: m,
|
|
95
|
+
readOnly: w
|
|
96
|
+
} = W(o), f = y({}, o, {
|
|
97
|
+
checked: x,
|
|
98
|
+
disabled: B,
|
|
99
|
+
focusVisible: m,
|
|
100
|
+
readOnly: w
|
|
101
|
+
}), _ = J(f), b = (c = n.root) != null ? c : "span", T = V({
|
|
102
|
+
elementType: b,
|
|
103
|
+
externalSlotProps: a.root,
|
|
104
|
+
externalForwardedProps: P,
|
|
105
|
+
additionalProps: {
|
|
106
|
+
ref: d
|
|
107
|
+
},
|
|
108
|
+
ownerState: f,
|
|
109
|
+
className: _.root
|
|
110
|
+
}), k = (r = n.thumb) != null ? r : "span", R = V({
|
|
111
|
+
elementType: k,
|
|
112
|
+
externalSlotProps: a.thumb,
|
|
113
|
+
ownerState: f,
|
|
114
|
+
className: _.thumb
|
|
115
|
+
}), C = (p = n.input) != null ? p : "input", F = V({
|
|
116
|
+
elementType: C,
|
|
117
|
+
getSlotProps: u,
|
|
118
|
+
externalSlotProps: a.input,
|
|
119
|
+
ownerState: f,
|
|
120
|
+
className: _.input
|
|
121
|
+
}), j = n.track === null ? () => null : (g = n.track) != null ? g : "span", t = V({
|
|
122
|
+
elementType: j,
|
|
123
|
+
externalSlotProps: a.track,
|
|
124
|
+
ownerState: f,
|
|
125
|
+
className: _.track
|
|
126
|
+
});
|
|
127
|
+
return /* @__PURE__ */ I(b, y({}, T, {
|
|
128
|
+
children: [/* @__PURE__ */ O(j, y({}, t)), /* @__PURE__ */ O(k, y({}, R)), /* @__PURE__ */ O(C, y({}, F))]
|
|
129
|
+
}));
|
|
130
|
+
});
|
|
131
|
+
process.env.NODE_ENV !== "production" && (E.propTypes = {
|
|
132
|
+
// ┌────────────────────────────── Warning ──────────────────────────────┐
|
|
133
|
+
// │ These PropTypes are generated from the TypeScript type definitions. │
|
|
134
|
+
// │ To update them, edit the TypeScript types and run `pnpm proptypes`. │
|
|
135
|
+
// └─────────────────────────────────────────────────────────────────────┘
|
|
136
|
+
/**
|
|
137
|
+
* If `true`, the component is checked.
|
|
138
|
+
*/
|
|
139
|
+
checked: e.bool,
|
|
140
|
+
/**
|
|
141
|
+
* Class name applied to the root element.
|
|
142
|
+
*/
|
|
143
|
+
className: e.string,
|
|
144
|
+
/**
|
|
145
|
+
* The default checked state. Use when the component is not controlled.
|
|
146
|
+
*/
|
|
147
|
+
defaultChecked: e.bool,
|
|
148
|
+
/**
|
|
149
|
+
* If `true`, the component is disabled.
|
|
150
|
+
*/
|
|
151
|
+
disabled: e.bool,
|
|
152
|
+
/**
|
|
153
|
+
* @ignore
|
|
154
|
+
*/
|
|
155
|
+
onBlur: e.func,
|
|
156
|
+
/**
|
|
157
|
+
* Callback fired when the state is changed.
|
|
158
|
+
*
|
|
159
|
+
* @param {React.ChangeEvent<HTMLInputElement>} event The event source of the callback.
|
|
160
|
+
* You can pull out the new value by accessing `event.target.value` (string).
|
|
161
|
+
* You can pull out the new checked state by accessing `event.target.checked` (boolean).
|
|
162
|
+
*/
|
|
163
|
+
onChange: e.func,
|
|
164
|
+
/**
|
|
165
|
+
* @ignore
|
|
166
|
+
*/
|
|
167
|
+
onFocus: e.func,
|
|
168
|
+
/**
|
|
169
|
+
* @ignore
|
|
170
|
+
*/
|
|
171
|
+
onFocusVisible: e.func,
|
|
172
|
+
/**
|
|
173
|
+
* If `true`, the component is read only.
|
|
174
|
+
*/
|
|
175
|
+
readOnly: e.bool,
|
|
176
|
+
/**
|
|
177
|
+
* If `true`, the `input` element is required.
|
|
178
|
+
*/
|
|
179
|
+
required: e.bool,
|
|
180
|
+
/**
|
|
181
|
+
* The props used for each slot inside the Switch.
|
|
182
|
+
* @default {}
|
|
183
|
+
*/
|
|
184
|
+
slotProps: e.shape({
|
|
185
|
+
input: e.oneOfType([e.func, e.object]),
|
|
186
|
+
root: e.oneOfType([e.func, e.object]),
|
|
187
|
+
thumb: e.oneOfType([e.func, e.object]),
|
|
188
|
+
track: e.oneOfType([e.func, e.object])
|
|
189
|
+
}),
|
|
190
|
+
/**
|
|
191
|
+
* The components used for each slot inside the Switch.
|
|
192
|
+
* Either a string to use a HTML element or a component.
|
|
193
|
+
* @default {}
|
|
194
|
+
*/
|
|
195
|
+
slots: e.shape({
|
|
196
|
+
input: e.elementType,
|
|
197
|
+
root: e.elementType,
|
|
198
|
+
thumb: e.elementType,
|
|
199
|
+
track: e.oneOfType([e.elementType, e.oneOf([null])])
|
|
200
|
+
})
|
|
201
|
+
});
|
|
202
|
+
const K = "_toggle_r6ihm_1", Q = "_input_r6ihm_15", X = "_thumb_r6ihm_26", Y = "_track_r6ihm_40", Z = "_toggle__label_r6ihm_64", i = {
|
|
203
|
+
toggle: K,
|
|
204
|
+
"toggle__toggle-el-wrapper": "_toggle__toggle-el-wrapper_r6ihm_11",
|
|
205
|
+
input: Q,
|
|
206
|
+
thumb: X,
|
|
207
|
+
track: Y,
|
|
208
|
+
"toggle--focus-visible": "_toggle--focus-visible_r6ihm_50",
|
|
209
|
+
"toggle--checked": "_toggle--checked_r6ihm_54",
|
|
210
|
+
toggle__label: Z,
|
|
211
|
+
"toggle--disabled": "_toggle--disabled_r6ihm_69"
|
|
212
|
+
}, ne = ({
|
|
213
|
+
onChange: l,
|
|
214
|
+
label: o,
|
|
215
|
+
disabled: d,
|
|
216
|
+
checked: c = !1,
|
|
217
|
+
autoFocus: r,
|
|
218
|
+
classNameWrapper: p,
|
|
219
|
+
classNameLabel: g,
|
|
220
|
+
classNameInput: a,
|
|
221
|
+
"data-testid": n
|
|
222
|
+
}) => {
|
|
223
|
+
const P = (u) => {
|
|
224
|
+
l == null || l(u);
|
|
225
|
+
};
|
|
226
|
+
return /* @__PURE__ */ I("div", { className: N(i.toggle, p), "data-testid": n, children: [
|
|
227
|
+
/* @__PURE__ */ O(
|
|
228
|
+
E,
|
|
229
|
+
{
|
|
230
|
+
disabled: d,
|
|
231
|
+
checked: c,
|
|
232
|
+
autoFocus: r,
|
|
233
|
+
onChange: P,
|
|
234
|
+
"aria-label": o,
|
|
235
|
+
slotProps: {
|
|
236
|
+
root: (u) => ({
|
|
237
|
+
className: N(i["toggle__toggle-el-wrapper"], {
|
|
238
|
+
[i["toggle--disabled"]]: u.disabled,
|
|
239
|
+
[i["toggle--focus-visible"]]: u.focusVisible,
|
|
240
|
+
[i["toggle--checked"]]: u.checked
|
|
241
|
+
})
|
|
242
|
+
}),
|
|
243
|
+
input: {
|
|
244
|
+
className: N(i.input, a)
|
|
245
|
+
},
|
|
246
|
+
thumb: { className: i.thumb },
|
|
247
|
+
track: { className: i.track }
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
),
|
|
251
|
+
o && /* @__PURE__ */ O("label", { className: N(i.toggle__label, g), children: o })
|
|
252
|
+
] });
|
|
253
|
+
};
|
|
254
|
+
export {
|
|
255
|
+
ne as Toggle
|
|
256
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PopupPlacement } from '@mui/base';
|
|
2
|
+
|
|
3
|
+
type TooltipProps = {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
show?: boolean;
|
|
6
|
+
anchorRef?: HTMLElement | null | undefined;
|
|
7
|
+
disableHoverListener?: boolean;
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
theme?: 'white' | 'black';
|
|
10
|
+
padding?: 'small' | 'normal';
|
|
11
|
+
position?: PopupPlacement;
|
|
12
|
+
arialRole?: React.AriaRole;
|
|
13
|
+
className?: string;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const Tooltip: ({ children, show, anchorRef, onClose, arialRole, position, theme, padding, className, disableHoverListener, ...rest }: TooltipProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { Tooltip };
|