@pismo/marola 1.0.0-beta.11 → 1.0.0-beta.13

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.
@@ -0,0 +1,181 @@
1
+ import './assets/Toggle2.css';
2
+ import { jsx as e, jsxs as q } from "react/jsx-runtime";
3
+ import { forwardRef as y } from "react";
4
+ import { c as s } from "./clsx-DB4S2d7J.js";
5
+ import { Icon as N } from "./components/Icon/Icon.js";
6
+ import { Typography as w } from "./components/Typography/Typography.js";
7
+ import "./components/Button/Button.js";
8
+ import { Adornment as C } from "./components/Adornment/Adornment.js";
9
+ import "./components/Dialog/Backdrop.js";
10
+ import "./components/IconButton/IconButton.js";
11
+ import "./components/Select/Select.js";
12
+ import "./components/Table/Table.js";
13
+ import "./components/Tabs/Tabs.js";
14
+ import { s as k } from "./Group-B3p31ftp.js";
15
+ import "./contexts/SnackbarProvider/SnackbarProvider.js";
16
+ import { Skeleton as f } from "./components/Skeleton/Skeleton.js";
17
+ import { B as x } from "./Button-DiLqcAJG.js";
18
+ const I = "_chip_1qd8i_61", P = "_chip__adornment_1qd8i_115", z = "_chip__remove_1qd8i_120", p = {
19
+ "u-typography-h1": "_u-typography-h1_1qd8i_1",
20
+ "u-typography-h2": "_u-typography-h2_1qd8i_8",
21
+ "u-typography-h3": "_u-typography-h3_1qd8i_15",
22
+ "u-typography-h4": "_u-typography-h4_1qd8i_22",
23
+ "u-typography-h5": "_u-typography-h5_1qd8i_29",
24
+ "u-typography-h6": "_u-typography-h6_1qd8i_36",
25
+ "u-typography-base": "_u-typography-base_1qd8i_43",
26
+ "u-typography-base--xxl": "_u-typography-base--xxl_1qd8i_49",
27
+ "u-typography-base--xl": "_u-typography-base--xl_1qd8i_53",
28
+ "u-typography-base--lg": "_u-typography-base--lg_1qd8i_57",
29
+ "u-typography-base--sm": "_u-typography-base--sm_1qd8i_61",
30
+ chip: I,
31
+ "u-typography-base--bold": "_u-typography-base--bold_1qd8i_65",
32
+ "u-typography-base--strikethrough": "_u-typography-base--strikethrough_1qd8i_68",
33
+ "u-typography-base--underlined": "_u-typography-base--underlined_1qd8i_71",
34
+ "u-typography-base--strikethrough-underlined": "_u-typography-base--strikethrough-underlined_1qd8i_74",
35
+ "chip--button": "_chip--button_1qd8i_90",
36
+ "chip--outlined": "_chip--outlined_1qd8i_103",
37
+ "chip--contained": "_chip--contained_1qd8i_109",
38
+ chip__adornment: P,
39
+ chip__remove: z,
40
+ "chip__remove--disabled": "_chip__remove--disabled_1qd8i_131",
41
+ "chip-loading": "_chip-loading_1qd8i_135"
42
+ }, S = y((i, c) => {
43
+ const { children: _, onClickContent: t, disabled: r, className: a, variant: n } = i;
44
+ let o = s(
45
+ p.chip,
46
+ { [p["chip--outlined"]]: n === "outlined" },
47
+ { [p["chip--contained"]]: n === "contained" },
48
+ a
49
+ );
50
+ return t ? (o += ` ${p["chip--button"]}`, /* @__PURE__ */ e(
51
+ x,
52
+ {
53
+ onClick: t,
54
+ disabled: r,
55
+ "data-testid": i["data-testid"],
56
+ ref: c,
57
+ className: o,
58
+ children: _
59
+ }
60
+ )) : /* @__PURE__ */ e("span", { "data-testid": i["data-testid"], ref: c, className: o, children: _ });
61
+ }), M = y((i, c) => {
62
+ const {
63
+ label: _,
64
+ className: t,
65
+ onClickContent: r,
66
+ leftAdornment: a,
67
+ loading: n = !1,
68
+ disabled: o = !1,
69
+ variant: u = "default",
70
+ onClickRemove: m
71
+ } = i;
72
+ if (n)
73
+ return /* @__PURE__ */ e(
74
+ f,
75
+ {
76
+ className: s(p["chip-loading"], i["className-skeleton"]),
77
+ "data-testid": i["data-testid-skeleton"]
78
+ }
79
+ );
80
+ const g = s(a == null ? void 0 : a.className, p.chip__adornment), b = a != null && a.customIcon ? { ...a, className: g } : { ...a, disabled: o, className: g };
81
+ return /* @__PURE__ */ q(
82
+ S,
83
+ {
84
+ ref: c,
85
+ "data-testid": i["data-testid"],
86
+ onClickContent: r,
87
+ disabled: o,
88
+ className: t,
89
+ variant: u,
90
+ children: [
91
+ a && /* @__PURE__ */ e(C, { ...b }),
92
+ _,
93
+ m && /* @__PURE__ */ e(
94
+ "span",
95
+ {
96
+ className: s(p.chip__remove, { [p["chip__remove--disabled"]]: o }),
97
+ role: "button",
98
+ tabIndex: o ? -1 : 0,
99
+ "aria-label": "remove",
100
+ onClick: (d) => {
101
+ d == null || d.stopPropagation(), d == null || d.nativeEvent.stopImmediatePropagation(), m();
102
+ },
103
+ "aria-disabled": o,
104
+ children: /* @__PURE__ */ e(N, { icon: "circle-xmark", size: "1.125rem", color: "rgba(var(--gray-95-rgb), 0.45)" })
105
+ }
106
+ )
107
+ ]
108
+ }
109
+ );
110
+ }), h = {
111
+ "row-item": "_row-item_8z1a0_1",
112
+ "row-item--clickable": "_row-item--clickable_8z1a0_13",
113
+ "row-item--disabled": "_row-item--disabled_8z1a0_19",
114
+ "row-item__content": "_row-item__content_8z1a0_22"
115
+ }, O = y((i, c) => {
116
+ const { children: _, leftAdornment: t, disabled: r, onClick: a, buttons: n, ariaLabel: o, className: u } = i, m = s(t == null ? void 0 : t.className, h["row-item__adornment"]), b = {
117
+ onClick: (l) => {
118
+ r || a && a(l);
119
+ },
120
+ tabIndex: 0,
121
+ "aria-label": o,
122
+ role: "button"
123
+ }, d = t != null && t.customIcon ? t : { size: "1rem", ...t };
124
+ return /* @__PURE__ */ q(
125
+ "div",
126
+ {
127
+ "data-testid": i["data-testid"],
128
+ className: s(
129
+ h["row-item"],
130
+ a && h["row-item--clickable"],
131
+ a && r && h["row-item--disabled"],
132
+ u
133
+ ),
134
+ ...!!a && b,
135
+ ref: c,
136
+ children: [
137
+ t && /* @__PURE__ */ e(C, { ...d, className: m, disabled: r }),
138
+ /* @__PURE__ */ e("span", { className: s(h["row-item__content"]), children: _ }),
139
+ n && /* @__PURE__ */ e(
140
+ "div",
141
+ {
142
+ onClick: (l) => {
143
+ l == null || l.stopPropagation(), l == null || l.nativeEvent.stopImmediatePropagation();
144
+ },
145
+ children: n
146
+ }
147
+ )
148
+ ]
149
+ }
150
+ );
151
+ }), Q = y((i, c) => {
152
+ const { text: _, isSelected: t = !1, value: r, onChange: a } = i;
153
+ return /* @__PURE__ */ q(
154
+ "label",
155
+ {
156
+ className: s([k.toggle__label], { [k["toggle__label--selected"]]: t }),
157
+ "data-testid": i["data-testid"],
158
+ children: [
159
+ /* @__PURE__ */ e(
160
+ "input",
161
+ {
162
+ className: s([k.toggle__input]),
163
+ type: "radio",
164
+ ref: c,
165
+ value: r.toString(),
166
+ onChange: () => a(r),
167
+ role: "radio",
168
+ checked: t,
169
+ "aria-checked": t
170
+ }
171
+ ),
172
+ /* @__PURE__ */ e(w, { bold: !0, children: _ })
173
+ ]
174
+ }
175
+ );
176
+ });
177
+ export {
178
+ M as C,
179
+ O as R,
180
+ Q as T
181
+ };
@@ -0,0 +1 @@
1
+ ._stepper-navigator_1ouny_1{display:flex;justify-content:space-between;padding:1rem 0}._stepper-navigator_1ouny_1>span{display:flex;gap:1rem}._cancel-button_1ouny_11{color:var(--accent-alert-light);background-color:transparent}._cancel-button_1ouny_11:hover:not(:disabled){color:rgba(var(--alert-dark-rgb),.75);background-color:var(--gray-5)}._previous-button_1ouny_20{color:var(--gray-75);background-color:transparent;border:solid 1px var(--gray-75)}._previous-button_1ouny_20:disabled{border-color:transparent}._previous-button_1ouny_20:hover:not(:disabled){color:rgba(var(--gray-75-rgb),.75);background-color:var(--gray-5);border-color:rgba(var(--gray-75),.75)}
@@ -1 +1 @@
1
- ._u-typography-h1_1qd8i_1{font-size:var(--heading-font-size-1);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-1);margin:0}._u-typography-h2_1qd8i_8{font-size:var(--heading-font-size-2);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-2);margin:0}._u-typography-h3_1qd8i_15{font-size:var(--heading-font-size-3);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-3);margin:0}._u-typography-h4_1qd8i_22{font-size:var(--heading-font-size-4);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-4);margin:0}._u-typography-h5_1qd8i_29{font-size:var(--heading-font-size-5);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-5);margin:0}._u-typography-h6_1qd8i_36{font-size:var(--heading-font-size-6);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-6);margin:0}._u-typography-base_1qd8i_43{margin:0;font-size:var(--base-font-size);font-weight:var(--base-weight);line-height:var(--base-line-height)}._u-typography-base--xxl_1qd8i_49{font-size:var(--base-font-size-xxl);line-height:var(--base-line-height-xxl)}._u-typography-base--xl_1qd8i_53{font-size:var(--base-font-size-xl);line-height:var(--base-line-height-xl)}._u-typography-base--lg_1qd8i_57{font-size:var(--base-font-size-lg);line-height:var(--base-line-height-lg)}._u-typography-base--sm_1qd8i_61,._chip_1qd8i_61{font-size:var(--base-font-size-sm);line-height:var(--base-line-height-sm)}._u-typography-base--bold_1qd8i_65,._chip_1qd8i_61{font-weight:var(--base-bold)}._u-typography-base--strikethrough_1qd8i_68{text-decoration:line-through}._u-typography-base--underlined_1qd8i_71{text-decoration:underline}._u-typography-base--strikethrough-underlined_1qd8i_74{text-decoration:underline line-through}._chip_1qd8i_61{display:flex;align-items:center;width:fit-content;padding:.375rem .5rem;background-color:var(--cream);border-width:1px;border-radius:calc(var(--border-radius-soft) * 4)}._chip_1qd8i_61:not(:disabled){color:rgb(var(--gray-95-rgb) .65)}._chip--button_1qd8i_90{cursor:pointer;border-color:transparent}._chip--button_1qd8i_90:disabled{cursor:initial}._chip--button_1qd8i_90:focus-visible{outline:none}._chip--button_1qd8i_90:focus{outline:2px solid var(--black-100)}._chip--outlined_1qd8i_103{padding:.3125rem .5rem;background-color:var(--white-100);border:1px solid var(--border);border-radius:calc(var(--border-radius-soft) * 4)}._chip--contained_1qd8i_109{padding:.3125rem .5rem;border:1px solid var(--border);border-color:var(--accent);border-radius:calc(var(--border-radius-soft) * 4)}._chip__adornment_1qd8i_115{display:flex;align-items:center;margin-right:.5rem}._chip__remove_1qd8i_120{display:flex;margin-left:.5rem}._chip__remove_1qd8i_120:focus-visible{outline:none}._chip__remove_1qd8i_120:focus:not(:disabled){border-radius:calc(var(--border-radius-soft) * 4);outline:2px solid var(--black-100)}._chip__remove--disabled_1qd8i_131{cursor:default}._chip-loading_1qd8i_135{display:inline-flex;width:6rem;height:2rem;border-radius:4rem}._row-item_ag6tb_1{display:flex;align-items:center;justify-content:space-between;padding:.5rem 1rem;border:1px solid var(--gray-10);border-radius:6px}._row-item_ag6tb_1:focus-visible{outline:none}._row-item_ag6tb_1:focus{outline:2px solid var(--black-100)}._row-item--clickable_ag6tb_15{cursor:pointer}._row-item__content_ag6tb_18{display:flex;flex-grow:1;align-items:center;justify-content:space-between;padding-right:1rem;padding-left:1rem;margin:0;text-align:center}._row-item__content_ag6tb_18:focus-visible{outline:none}._row-item__content_ag6tb_18:focus{outline:2px solid var(--black-100)}
1
+ ._u-typography-h1_1qd8i_1{font-size:var(--heading-font-size-1);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-1);margin:0}._u-typography-h2_1qd8i_8{font-size:var(--heading-font-size-2);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-2);margin:0}._u-typography-h3_1qd8i_15{font-size:var(--heading-font-size-3);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-3);margin:0}._u-typography-h4_1qd8i_22{font-size:var(--heading-font-size-4);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-4);margin:0}._u-typography-h5_1qd8i_29{font-size:var(--heading-font-size-5);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-5);margin:0}._u-typography-h6_1qd8i_36{font-size:var(--heading-font-size-6);font-weight:var(--heading-font-weight);line-height:var(--heading-line-height-6);margin:0}._u-typography-base_1qd8i_43{margin:0;font-size:var(--base-font-size);font-weight:var(--base-weight);line-height:var(--base-line-height)}._u-typography-base--xxl_1qd8i_49{font-size:var(--base-font-size-xxl);line-height:var(--base-line-height-xxl)}._u-typography-base--xl_1qd8i_53{font-size:var(--base-font-size-xl);line-height:var(--base-line-height-xl)}._u-typography-base--lg_1qd8i_57{font-size:var(--base-font-size-lg);line-height:var(--base-line-height-lg)}._u-typography-base--sm_1qd8i_61,._chip_1qd8i_61{font-size:var(--base-font-size-sm);line-height:var(--base-line-height-sm)}._u-typography-base--bold_1qd8i_65,._chip_1qd8i_61{font-weight:var(--base-bold)}._u-typography-base--strikethrough_1qd8i_68{text-decoration:line-through}._u-typography-base--underlined_1qd8i_71{text-decoration:underline}._u-typography-base--strikethrough-underlined_1qd8i_74{text-decoration:underline line-through}._chip_1qd8i_61{display:flex;align-items:center;width:fit-content;padding:.375rem .5rem;background-color:var(--cream);border-width:1px;border-radius:calc(var(--border-radius-soft) * 4)}._chip_1qd8i_61:not(:disabled){color:rgb(var(--gray-95-rgb) .65)}._chip--button_1qd8i_90{cursor:pointer;border-color:transparent}._chip--button_1qd8i_90:disabled{cursor:initial}._chip--button_1qd8i_90:focus-visible{outline:none}._chip--button_1qd8i_90:focus{outline:2px solid var(--black-100)}._chip--outlined_1qd8i_103{padding:.3125rem .5rem;background-color:var(--white-100);border:1px solid var(--border);border-radius:calc(var(--border-radius-soft) * 4)}._chip--contained_1qd8i_109{padding:.3125rem .5rem;border:1px solid var(--border);border-color:var(--accent);border-radius:calc(var(--border-radius-soft) * 4)}._chip__adornment_1qd8i_115{display:flex;align-items:center;margin-right:.5rem}._chip__remove_1qd8i_120{display:flex;margin-left:.5rem}._chip__remove_1qd8i_120:focus-visible{outline:none}._chip__remove_1qd8i_120:focus:not(:disabled){border-radius:calc(var(--border-radius-soft) * 4);outline:2px solid var(--black-100)}._chip__remove--disabled_1qd8i_131{cursor:default}._chip-loading_1qd8i_135{display:inline-flex;width:6rem;height:2rem;border-radius:4rem}._row-item_8z1a0_1{display:flex;align-items:center;justify-content:space-between;padding:.5rem 1rem;border:1px solid var(--gray-10);border-radius:6px;outline:none}._row-item_8z1a0_1:focus-visible{outline:none}._row-item--clickable_8z1a0_13{cursor:pointer}._row-item--clickable_8z1a0_13:focus{outline:2px solid var(--black-100)}._row-item--disabled_8z1a0_19{cursor:not-allowed}._row-item__content_8z1a0_22{display:flex;flex-grow:1;align-items:center;justify-content:space-between;padding-right:1rem;padding-left:1rem;margin:0;text-align:center}._row-item__content_8z1a0_22:focus-visible{outline:none}._row-item__content_8z1a0_22:focus{outline:2px solid var(--black-100)}
@@ -13,6 +13,7 @@ export type MarolaIconAdornment = AdornmentSlotProps & Partial<IconProps> & {
13
13
  disabled?: boolean;
14
14
  };
15
15
  export type CustomIconAdornment = AdornmentSlotProps & {
16
+ /** Render a complete custom icon outside of Marola icon system */
16
17
  customIcon: ReactNode;
17
18
  };
18
19
  export type AdornmentProps = Either<CustomIconAdornment, MarolaIconAdornment>;
@@ -0,0 +1,14 @@
1
+ import { StoryObj } from '@storybook/react';
2
+
3
+ declare const meta: {
4
+ title: string;
5
+ component: (props: import('./Adornment').AdornmentProps) => import("react/jsx-runtime").JSX.Element;
6
+ tags: string[];
7
+ parameters: {
8
+ layout: string;
9
+ };
10
+ };
11
+ export default meta;
12
+ type Story = StoryObj<typeof meta>;
13
+ export declare const WithMarolaIcon: Story;
14
+ export declare const WithCustomIcon: Story;
@@ -1,12 +1,14 @@
1
1
  import { InputHTMLAttributes, ReactNode, SyntheticEvent } from 'react';
2
2
 
3
- type AutocompleteProps<T> = InputHTMLAttributes<HTMLInputElement> & {
3
+ type AutocompleteProps<T> = Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange'> & {
4
4
  /** Label text */
5
5
  label?: string;
6
6
  /** Options array */
7
7
  options?: Array<T>;
8
8
  /** callback for new option selected */
9
9
  onChange?: (event: SyntheticEvent<Element, Event>, newValue: T) => void;
10
+ /** callback when characters are entered into the input box */
11
+ onInputChange?: (event: SyntheticEvent<Element, Event>, newValue: string) => void;
10
12
  /** Info message text */
11
13
  infoMessage?: string;
12
14
  /** Error message text */
@@ -46,5 +48,5 @@ type AutocompleteProps<T> = InputHTMLAttributes<HTMLInputElement> & {
46
48
  };
47
49
  export declare const Autocomplete: <T extends string | (object & {
48
50
  label: string;
49
- })>({ label, type, options, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, maxLength, onChange, classNameLabel, classNameInput, classNameErrorMessage, classNameInfoMessage, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, ...rest }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
51
+ })>({ label, type, options, infoMessage, errorMessage, leftIcon, rightIcon, id, disabled, maxLength, onChange, onInputChange, classNameLabel, classNameInput, classNameErrorMessage, classNameInfoMessage, "data-testid-label": testIdLabel, "data-testid-input": testIdInput, "data-testid-infoMessage": testIdInfoMessage, "data-testid-errorMessage": testIdErrorMessage, ...rest }: AutocompleteProps<T>) => import("react/jsx-runtime").JSX.Element;
50
52
  export {};