@pismo/marola 0.0.1-alpha.6 → 0.0.1-alpha.8
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-W6tM-_IT.js → Button-B1umG8kJ.js} +2 -2
- package/dist/ClickAwayListener-BKznXF1d.js +106 -0
- package/dist/Portal-BcdMtRGF.js +73 -0
- package/dist/Tab-CRwnhsj5.js +254 -0
- package/dist/Tabs.module-yYcTJnj6.js +103 -0
- package/dist/assets/Input.css +1 -0
- package/dist/assets/InputSearch.css +1 -0
- package/dist/assets/PageHeader.css +1 -1
- package/dist/assets/Snackbar.css +1 -0
- package/dist/assets/Toggle.css +1 -0
- package/dist/assets/global.css +1 -1
- package/dist/components/Advice/Advice.d.ts +6 -3
- package/dist/components/Advice/Advice.js +15 -15
- package/dist/components/Button/Button.d.ts +8 -0
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Button/Button.stories.d.ts +60 -0
- package/dist/components/Button/Button.stories.js +40 -0
- package/dist/components/Dialog/CloseIconButton.js +9 -9
- package/dist/components/Dialog/Dialog.d.ts +3 -2
- package/dist/components/Dialog/Dialog.js +10 -9
- package/dist/components/Dialog/Dialog.stories.d.ts +343 -0
- package/dist/components/Dialog/Dialog.stories.js +59 -0
- package/dist/components/Icon/Icon.d.ts +15 -4
- package/dist/components/Icon/Icon.js +92 -6
- package/dist/components/IconButton/IconButton.js +1 -1
- 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/InputSearch/InputSearch.d.ts +11 -0
- package/dist/components/InputSearch/InputSearch.js +29 -0
- package/dist/components/InputSearch/InputSearch.stories.d.ts +22 -0
- package/dist/components/InputSearch/InputSearch.stories.js +36 -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.js +25 -25
- package/dist/components/PageHeader/PageHeader.stories.js +3 -3
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/Pagination/Pagination.js +10 -10
- package/dist/components/Snackbar/Snackbar.d.ts +13 -0
- package/dist/components/Snackbar/Snackbar.js +622 -0
- package/dist/components/SortTooltip/SortTooltip.d.ts +1 -1
- package/dist/components/SortTooltip/SortTooltip.js +8 -8
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Table/Table.js +15 -15
- package/dist/components/Tabs/Tab.js +6 -239
- package/dist/components/Tabs/TabPanel.js +18 -19
- package/dist/components/Tabs/Tabs.d.ts +2 -0
- package/dist/components/Tabs/Tabs.js +12 -8
- package/dist/components/Toggle/Toggle.d.ts +12 -0
- package/dist/components/Toggle/Toggle.js +251 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +22 -0
- package/dist/components/Toggle/Toggle.stories.js +27 -0
- package/dist/components/Tooltip/Tooltip.js +558 -655
- package/dist/components/Typography/Typography.d.ts +5 -5
- package/dist/components/Typography/Typography.stories.d.ts +13 -0
- package/dist/components/Typography/Typography.stories.js +15 -15
- package/dist/components/Typography/typography.test.js +5 -8
- package/dist/{Portal-P3fPvS3-.js → index-BNWbc5Kh.js} +5709 -5776
- package/dist/{index-D2P7y2mE.js → index-CqjC7P5Y.js} +4 -3
- package/dist/main.d.ts +17 -8
- package/dist/main.js +55 -28
- package/dist/useButton-Bc8IAgyk.js +106 -0
- package/dist/useIsFocusVisible-BH4IAdcw.js +69 -0
- package/dist/useTimeout-DxF9kiZL.js +36 -0
- package/package.json +5 -4
- package/dist/ListContext-Dj2Va7Iv.js +0 -18
- package/dist/Tabs.module-BA-PC7fA.js +0 -66
- package/dist/react-CGNQ6M5x.js +0 -117
- package/dist/useButton-JpyBo5M4.js +0 -187
- package/dist/useCompoundItem-CTYi5M_E.js +0 -41
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import '../../assets/Toggle.css';
|
|
2
|
+
import { jsxs as I, jsx as P } from "react/jsx-runtime";
|
|
3
|
+
import { c as O } from "../../clsx-DB4S2d7J.js";
|
|
4
|
+
import { a as k, _ as v } from "../../objectWithoutPropertiesLoose-D7Cp0Pg_.js";
|
|
5
|
+
import * as N from "react";
|
|
6
|
+
import { u as U, g as q, a as H, b as C, 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(c) {
|
|
10
|
+
const {
|
|
11
|
+
checked: o,
|
|
12
|
+
defaultChecked: i,
|
|
13
|
+
disabled: n,
|
|
14
|
+
onBlur: a,
|
|
15
|
+
onChange: d,
|
|
16
|
+
onFocus: g,
|
|
17
|
+
onFocusVisible: r,
|
|
18
|
+
readOnly: s,
|
|
19
|
+
required: V
|
|
20
|
+
} = c, [S, x] = D({
|
|
21
|
+
controlled: o,
|
|
22
|
+
default: !!i,
|
|
23
|
+
name: "Switch",
|
|
24
|
+
state: "checked"
|
|
25
|
+
}), B = (t) => (l) => {
|
|
26
|
+
var p;
|
|
27
|
+
l.nativeEvent.defaultPrevented || (x(l.target.checked), d == null || d(l), (p = t.onChange) == null || p.call(t, l));
|
|
28
|
+
}, {
|
|
29
|
+
isFocusVisibleRef: h,
|
|
30
|
+
onBlur: w,
|
|
31
|
+
onFocus: b,
|
|
32
|
+
ref: _
|
|
33
|
+
} = L(), [f, y] = N.useState(!1);
|
|
34
|
+
n && f && y(!1), N.useEffect(() => {
|
|
35
|
+
h.current = f;
|
|
36
|
+
}, [f, h]);
|
|
37
|
+
const m = N.useRef(null), R = (t) => (l) => {
|
|
38
|
+
var p;
|
|
39
|
+
m.current || (m.current = l.currentTarget), b(l), h.current === !0 && (y(!0), r == null || r(l)), g == null || g(l), (p = t.onFocus) == null || p.call(t, l);
|
|
40
|
+
}, T = (t) => (l) => {
|
|
41
|
+
var p;
|
|
42
|
+
w(l), h.current === !1 && y(!1), a == null || a(l), (p = t.onBlur) == null || p.call(t, l);
|
|
43
|
+
}, F = U(_, m);
|
|
44
|
+
return {
|
|
45
|
+
checked: S,
|
|
46
|
+
disabled: !!n,
|
|
47
|
+
focusVisible: f,
|
|
48
|
+
getInputProps: (t = {}) => k({
|
|
49
|
+
checked: o,
|
|
50
|
+
defaultChecked: i,
|
|
51
|
+
disabled: n,
|
|
52
|
+
readOnly: s,
|
|
53
|
+
ref: F,
|
|
54
|
+
required: V,
|
|
55
|
+
type: "checkbox",
|
|
56
|
+
role: "switch",
|
|
57
|
+
"aria-checked": o
|
|
58
|
+
}, t, {
|
|
59
|
+
onChange: B(t),
|
|
60
|
+
onFocus: R(t),
|
|
61
|
+
onBlur: T(t)
|
|
62
|
+
}),
|
|
63
|
+
inputRef: F,
|
|
64
|
+
readOnly: !!s
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
const $ = "Switch";
|
|
68
|
+
function z(c) {
|
|
69
|
+
return q($, c);
|
|
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 = (c) => {
|
|
73
|
+
const {
|
|
74
|
+
checked: o,
|
|
75
|
+
disabled: i,
|
|
76
|
+
focusVisible: n,
|
|
77
|
+
readOnly: a
|
|
78
|
+
} = c;
|
|
79
|
+
return M({
|
|
80
|
+
root: ["root", o && "checked", i && "disabled", n && "focusVisible", a && "readOnly"],
|
|
81
|
+
thumb: ["thumb"],
|
|
82
|
+
input: ["input"],
|
|
83
|
+
track: ["track"]
|
|
84
|
+
}, A(z));
|
|
85
|
+
}, E = /* @__PURE__ */ N.forwardRef(function(o, i) {
|
|
86
|
+
var n, a, d, g;
|
|
87
|
+
const {
|
|
88
|
+
slotProps: r = {},
|
|
89
|
+
slots: s = {}
|
|
90
|
+
} = o, V = v(o, G), {
|
|
91
|
+
getInputProps: S,
|
|
92
|
+
checked: x,
|
|
93
|
+
disabled: B,
|
|
94
|
+
focusVisible: h,
|
|
95
|
+
readOnly: w
|
|
96
|
+
} = W(o), b = k({}, o, {
|
|
97
|
+
checked: x,
|
|
98
|
+
disabled: B,
|
|
99
|
+
focusVisible: h,
|
|
100
|
+
readOnly: w
|
|
101
|
+
}), _ = J(b), f = (n = s.root) != null ? n : "span", y = C({
|
|
102
|
+
elementType: f,
|
|
103
|
+
externalSlotProps: r.root,
|
|
104
|
+
externalForwardedProps: V,
|
|
105
|
+
additionalProps: {
|
|
106
|
+
ref: i
|
|
107
|
+
},
|
|
108
|
+
ownerState: b,
|
|
109
|
+
className: _.root
|
|
110
|
+
}), m = (a = s.thumb) != null ? a : "span", R = C({
|
|
111
|
+
elementType: m,
|
|
112
|
+
externalSlotProps: r.thumb,
|
|
113
|
+
ownerState: b,
|
|
114
|
+
className: _.thumb
|
|
115
|
+
}), T = (d = s.input) != null ? d : "input", F = C({
|
|
116
|
+
elementType: T,
|
|
117
|
+
getSlotProps: S,
|
|
118
|
+
externalSlotProps: r.input,
|
|
119
|
+
ownerState: b,
|
|
120
|
+
className: _.input
|
|
121
|
+
}), j = s.track === null ? () => null : (g = s.track) != null ? g : "span", t = C({
|
|
122
|
+
elementType: j,
|
|
123
|
+
externalSlotProps: r.track,
|
|
124
|
+
ownerState: b,
|
|
125
|
+
className: _.track
|
|
126
|
+
});
|
|
127
|
+
return /* @__PURE__ */ I(f, k({}, y, {
|
|
128
|
+
children: [/* @__PURE__ */ P(j, k({}, t)), /* @__PURE__ */ P(m, k({}, R)), /* @__PURE__ */ P(T, k({}, 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_11c3l_1", Q = "_input_11c3l_12", X = "_thumb_11c3l_23", Y = "_track_11c3l_37", Z = "_toggle__label_11c3l_61", u = {
|
|
203
|
+
toggle: K,
|
|
204
|
+
"toggle__toggle-el-wrapper": "_toggle__toggle-el-wrapper_11c3l_8",
|
|
205
|
+
input: Q,
|
|
206
|
+
thumb: X,
|
|
207
|
+
track: Y,
|
|
208
|
+
"toggle--focus-visible": "_toggle--focus-visible_11c3l_47",
|
|
209
|
+
"toggle--checked": "_toggle--checked_11c3l_51",
|
|
210
|
+
toggle__label: Z,
|
|
211
|
+
"toggle--disabled": "_toggle--disabled_11c3l_66"
|
|
212
|
+
}, ne = ({
|
|
213
|
+
onChange: c,
|
|
214
|
+
label: o,
|
|
215
|
+
disabled: i,
|
|
216
|
+
classNameWrapper: n,
|
|
217
|
+
"data-testid": a,
|
|
218
|
+
classNameInput: d,
|
|
219
|
+
classNameLabel: g
|
|
220
|
+
}) => {
|
|
221
|
+
const r = (s) => {
|
|
222
|
+
c == null || c(s);
|
|
223
|
+
};
|
|
224
|
+
return /* @__PURE__ */ I("div", { className: O(u.toggle, n), "data-testid": a, children: [
|
|
225
|
+
/* @__PURE__ */ P(
|
|
226
|
+
E,
|
|
227
|
+
{
|
|
228
|
+
disabled: i,
|
|
229
|
+
onChange: r,
|
|
230
|
+
autoFocus: !0,
|
|
231
|
+
"aria-label": o,
|
|
232
|
+
slotProps: {
|
|
233
|
+
root: (s) => ({
|
|
234
|
+
className: O(u["toggle__toggle-el-wrapper"], {
|
|
235
|
+
[u["toggle--disabled"]]: s.disabled,
|
|
236
|
+
[u["toggle--focus-visible"]]: s.focusVisible,
|
|
237
|
+
[u["toggle--checked"]]: s.checked
|
|
238
|
+
})
|
|
239
|
+
}),
|
|
240
|
+
input: { className: O(u.input, d) },
|
|
241
|
+
thumb: { className: u.thumb },
|
|
242
|
+
track: { className: u.track }
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
),
|
|
246
|
+
o && /* @__PURE__ */ P("label", { className: O(u.toggle__label, g), children: o })
|
|
247
|
+
] });
|
|
248
|
+
};
|
|
249
|
+
export {
|
|
250
|
+
ne as Toggle
|
|
251
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ onChange, label, disabled, classNameWrapper, "data-testid": dataTestId, classNameInput, classNameLabel, }: import('react').InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
+
label?: string | undefined;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
'data-testid'?: string | undefined;
|
|
9
|
+
classNameWrapper?: string | undefined;
|
|
10
|
+
classNameInput?: string | undefined;
|
|
11
|
+
classNameLabel?: string | undefined;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
tags: string[];
|
|
14
|
+
parameters: {
|
|
15
|
+
layout: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Simple: Story;
|
|
21
|
+
export declare const WithLabel: Story;
|
|
22
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Toggle as e } from "./Toggle.js";
|
|
2
|
+
const a = {
|
|
3
|
+
title: "Components/Toggle",
|
|
4
|
+
component: e,
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "padded"
|
|
8
|
+
}
|
|
9
|
+
}, o = {
|
|
10
|
+
args: {}
|
|
11
|
+
}, l = {
|
|
12
|
+
name: "With label",
|
|
13
|
+
args: {
|
|
14
|
+
label: "Active"
|
|
15
|
+
}
|
|
16
|
+
}, s = {
|
|
17
|
+
args: {
|
|
18
|
+
label: "Active",
|
|
19
|
+
disabled: !0
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
s as Disabled,
|
|
24
|
+
o as Simple,
|
|
25
|
+
l as WithLabel,
|
|
26
|
+
a as default
|
|
27
|
+
};
|