@marigold/components 0.4.0 → 0.5.0
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/CHANGELOG.md +18 -0
- package/dist/index.d.ts +55 -57
- package/dist/index.js +23 -37
- package/dist/index.mjs +23 -37
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @marigold/components
|
|
2
2
|
|
|
3
|
+
## 0.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#1784](https://github.com/marigold-ui/marigold/pull/1784) [`99af3b37`](https://github.com/marigold-ui/marigold/commit/99af3b37de24599138777ed90de0445571c3095e) Thanks [@ti10le](https://github.com/ti10le)! - refa(comp): use interface instead of type
|
|
8
|
+
|
|
9
|
+
* [#1727](https://github.com/marigold-ui/marigold/pull/1727) [`026300b1`](https://github.com/marigold-ui/marigold/commit/026300b1b539b57785c0eb0282a3d3fd763194bc) Thanks [@sebald](https://github.com/sebald)! - feat(components): <Text> add possibility to change font size via style props
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#1774](https://github.com/marigold-ui/marigold/pull/1774) [`93480b63`](https://github.com/marigold-ui/marigold/commit/93480b6333a4d6231db35dbf12de5726533ebfc8) Thanks [@ti10le](https://github.com/ti10le)! - feat(comp): remove label prop and add children + refa
|
|
14
|
+
|
|
15
|
+
* [#1775](https://github.com/marigold-ui/marigold/pull/1775) [`6da8eba2`](https://github.com/marigold-ui/marigold/commit/6da8eba28c518c75758180697e5f0f5e5989c1f4) Thanks [@ti10le](https://github.com/ti10le)! - feat(comp): Checkbox remove label prop and add children + refa
|
|
16
|
+
|
|
17
|
+
* Updated dependencies [[`5936de75`](https://github.com/marigold-ui/marigold/commit/5936de75e5a0134584438117c53c5edfe15c6c5d)]:
|
|
18
|
+
- @marigold/system@0.5.0
|
|
19
|
+
- @marigold/icons@0.4.1
|
|
20
|
+
|
|
3
21
|
## 0.4.0
|
|
4
22
|
|
|
5
23
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -44,9 +44,9 @@ interface AlertThemeExtension<Value> {
|
|
|
44
44
|
[key in AlertVariants]?: Value;
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
interface AlertProps extends ComponentProps<'div'> {
|
|
48
48
|
variant?: AlertVariants;
|
|
49
|
-
}
|
|
49
|
+
}
|
|
50
50
|
declare const Alert: React.FC<AlertProps>;
|
|
51
51
|
|
|
52
52
|
interface BadgeThemeExtension<Value> {
|
|
@@ -54,11 +54,11 @@ interface BadgeThemeExtension<Value> {
|
|
|
54
54
|
[key: string]: Value;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
|
|
57
|
+
interface BadgeProps extends ComponentProps<'div'> {
|
|
58
58
|
variant?: string;
|
|
59
59
|
bgColor?: string;
|
|
60
60
|
borderColor?: string;
|
|
61
|
-
}
|
|
61
|
+
}
|
|
62
62
|
declare const Badge: React.FC<BadgeProps>;
|
|
63
63
|
|
|
64
64
|
interface ButtonThemeExtension<Value> {
|
|
@@ -66,7 +66,8 @@ interface ButtonThemeExtension<Value> {
|
|
|
66
66
|
[key: string]: Value;
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
interface ButtonProps extends PolymorphicPropsWithRef<BoxOwnProps, 'button'> {
|
|
70
|
+
}
|
|
70
71
|
declare const Button: PolymorphicComponentWithRef<BoxOwnProps, 'button'>;
|
|
71
72
|
|
|
72
73
|
interface CardThemeExtension<Value> {
|
|
@@ -74,11 +75,11 @@ interface CardThemeExtension<Value> {
|
|
|
74
75
|
[key: string]: Value;
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
|
-
|
|
78
|
+
interface CardProps extends ComponentProps<'div'> {
|
|
78
79
|
title?: string;
|
|
79
80
|
width?: ResponsiveStyleValue<string>;
|
|
80
81
|
variant?: string;
|
|
81
|
-
}
|
|
82
|
+
}
|
|
82
83
|
declare const Card: React.FC<CardProps>;
|
|
83
84
|
|
|
84
85
|
declare type CheckboxIconProps = {
|
|
@@ -86,7 +87,6 @@ declare type CheckboxIconProps = {
|
|
|
86
87
|
checked?: boolean;
|
|
87
88
|
disabled?: boolean;
|
|
88
89
|
error?: boolean;
|
|
89
|
-
children?: never;
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
interface CheckboxThemeExtension<Value> {
|
|
@@ -95,14 +95,12 @@ interface CheckboxThemeExtension<Value> {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
declare type CheckboxInputProps = CheckboxIconProps & ToggleProps & ComponentProps<'input'>;
|
|
98
|
-
|
|
98
|
+
interface CheckboxProps extends CheckboxInputProps {
|
|
99
99
|
id: string;
|
|
100
|
-
label: string;
|
|
101
100
|
required?: boolean;
|
|
102
101
|
labelVariant?: string;
|
|
103
|
-
error?: boolean;
|
|
104
102
|
errorMessage?: string;
|
|
105
|
-
}
|
|
103
|
+
}
|
|
106
104
|
declare const Checkbox: React.FC<CheckboxProps>;
|
|
107
105
|
|
|
108
106
|
interface DividerThemeExtension<Value> {
|
|
@@ -110,9 +108,9 @@ interface DividerThemeExtension<Value> {
|
|
|
110
108
|
[key: string]: Value;
|
|
111
109
|
};
|
|
112
110
|
}
|
|
113
|
-
|
|
111
|
+
interface DividerProps extends SeparatorProps {
|
|
114
112
|
variant?: string;
|
|
115
|
-
}
|
|
113
|
+
}
|
|
116
114
|
declare const Divider: React.FC<DividerProps>;
|
|
117
115
|
|
|
118
116
|
interface ImageThemeExtension<Value> {
|
|
@@ -120,10 +118,10 @@ interface ImageThemeExtension<Value> {
|
|
|
120
118
|
[key: string]: Value;
|
|
121
119
|
};
|
|
122
120
|
}
|
|
123
|
-
|
|
121
|
+
interface ImageProps extends ComponentProps<'img'> {
|
|
124
122
|
variant?: string;
|
|
125
123
|
children?: never;
|
|
126
|
-
}
|
|
124
|
+
}
|
|
127
125
|
declare const Image: React.FC<ImageProps>;
|
|
128
126
|
|
|
129
127
|
interface InputThemeExtension<Value> {
|
|
@@ -131,9 +129,9 @@ interface InputThemeExtension<Value> {
|
|
|
131
129
|
[key: string]: Value;
|
|
132
130
|
};
|
|
133
131
|
}
|
|
134
|
-
|
|
132
|
+
interface InputProps extends ComponentProps<'input'> {
|
|
135
133
|
variant?: string;
|
|
136
|
-
}
|
|
134
|
+
}
|
|
137
135
|
declare const Input: React.FC<InputProps>;
|
|
138
136
|
|
|
139
137
|
interface LabelThemeExtension<Value> {
|
|
@@ -158,36 +156,39 @@ interface TextThemeExtension<Value> {
|
|
|
158
156
|
[key: string]: Value;
|
|
159
157
|
};
|
|
160
158
|
}
|
|
161
|
-
|
|
159
|
+
interface TextOwnProps extends BoxOwnProps {
|
|
162
160
|
align?: ResponsiveStyleValue<string>;
|
|
163
161
|
color?: ResponsiveStyleValue<string>;
|
|
164
162
|
cursor?: ResponsiveStyleValue<string>;
|
|
163
|
+
size?: ResponsiveStyleValue<keyof Theme$1['fontSizes'] | string>;
|
|
165
164
|
outline?: ResponsiveStyleValue<string>;
|
|
166
165
|
userSelect?: ResponsiveStyleValue<string>;
|
|
167
|
-
}
|
|
168
|
-
|
|
166
|
+
}
|
|
167
|
+
interface TextProps extends PolymorphicPropsWithRef<TextOwnProps, 'span'> {
|
|
168
|
+
}
|
|
169
169
|
declare const Text: PolymorphicComponentWithRef<TextOwnProps, 'span'>;
|
|
170
170
|
|
|
171
171
|
interface LinkThemeExtension<Value> {
|
|
172
172
|
link?: Value;
|
|
173
173
|
}
|
|
174
|
-
|
|
174
|
+
interface LinkOwnProps extends TextOwnProps {
|
|
175
175
|
disabled?: boolean;
|
|
176
|
-
}
|
|
177
|
-
|
|
176
|
+
}
|
|
177
|
+
interface LinkProps extends PolymorphicProps<LinkOwnProps, 'a'> {
|
|
178
|
+
}
|
|
178
179
|
declare const Link: PolymorphicComponent<LinkOwnProps, "a">;
|
|
179
180
|
|
|
180
181
|
interface MenuThemeExtension<Value> {
|
|
181
182
|
menu?: Value;
|
|
182
183
|
}
|
|
183
|
-
|
|
184
|
+
interface MenuProps {
|
|
184
185
|
variant?: string;
|
|
185
186
|
label?: string;
|
|
186
187
|
onClick: ComponentProps<typeof Button>['onClick'];
|
|
187
188
|
show?: boolean;
|
|
188
189
|
className?: string;
|
|
189
190
|
title?: string;
|
|
190
|
-
}
|
|
191
|
+
}
|
|
191
192
|
declare const Menu: React.FC<MenuProps>;
|
|
192
193
|
|
|
193
194
|
interface MenuItemThemeExtension<Value> {
|
|
@@ -195,9 +196,9 @@ interface MenuItemThemeExtension<Value> {
|
|
|
195
196
|
[key: string]: Value;
|
|
196
197
|
};
|
|
197
198
|
}
|
|
198
|
-
|
|
199
|
+
interface MenuItemProps extends ComponentProps<typeof Link> {
|
|
199
200
|
variant?: string;
|
|
200
|
-
}
|
|
201
|
+
}
|
|
201
202
|
declare const MenuItem: React.FC<MenuItemProps>;
|
|
202
203
|
|
|
203
204
|
interface MessageThemeExtension<Value> {
|
|
@@ -205,10 +206,10 @@ interface MessageThemeExtension<Value> {
|
|
|
205
206
|
[key: string]: Value;
|
|
206
207
|
};
|
|
207
208
|
}
|
|
208
|
-
|
|
209
|
+
interface MessageProps extends ComponentProps<'div'> {
|
|
209
210
|
messageTitle: string;
|
|
210
211
|
variant?: string;
|
|
211
|
-
}
|
|
212
|
+
}
|
|
212
213
|
declare const Message: React.FC<MessageProps>;
|
|
213
214
|
|
|
214
215
|
declare type RadioIconProps = {
|
|
@@ -216,7 +217,6 @@ declare type RadioIconProps = {
|
|
|
216
217
|
checked?: boolean;
|
|
217
218
|
disabled?: boolean;
|
|
218
219
|
error?: boolean;
|
|
219
|
-
children?: never;
|
|
220
220
|
};
|
|
221
221
|
|
|
222
222
|
interface RadioThemeExtension<Value> {
|
|
@@ -224,15 +224,14 @@ interface RadioThemeExtension<Value> {
|
|
|
224
224
|
[key: string]: Value;
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
interface RadioInputProps extends RadioIconProps, ComponentProps<'input'> {
|
|
228
|
+
}
|
|
229
|
+
interface RadioProps extends RadioInputProps {
|
|
229
230
|
id: string;
|
|
230
|
-
label: string;
|
|
231
231
|
required?: boolean;
|
|
232
232
|
labelVariant?: string;
|
|
233
|
-
error?: boolean;
|
|
234
233
|
errorMessage?: string;
|
|
235
|
-
}
|
|
234
|
+
}
|
|
236
235
|
declare const Radio: React.FC<RadioProps>;
|
|
237
236
|
|
|
238
237
|
interface SelectThemeExtension<Value> {
|
|
@@ -263,9 +262,9 @@ interface SliderThemeExtension<Value> {
|
|
|
263
262
|
[key: string]: Value;
|
|
264
263
|
};
|
|
265
264
|
}
|
|
266
|
-
|
|
265
|
+
interface SliderProps extends ComponentProps<'input'> {
|
|
267
266
|
variant?: string;
|
|
268
|
-
}
|
|
267
|
+
}
|
|
269
268
|
declare const Slider: React.FC<SliderProps>;
|
|
270
269
|
|
|
271
270
|
interface TextareaThemeExtension<Value> {
|
|
@@ -286,33 +285,33 @@ interface ValidationMessageThemeExtension<Value> {
|
|
|
286
285
|
[key: string]: Value;
|
|
287
286
|
};
|
|
288
287
|
}
|
|
289
|
-
|
|
288
|
+
interface ValidationMessageProps extends ComponentProps<'span'> {
|
|
290
289
|
variant?: string;
|
|
291
|
-
}
|
|
290
|
+
}
|
|
292
291
|
declare const ValidationMessage: React.FC<ValidationMessageProps>;
|
|
293
292
|
|
|
294
293
|
interface Theme extends Theme$1, RootThemeExtension<CSSObject>, AlertThemeExtension<CSSObject>, BadgeThemeExtension<CSSObject>, ButtonThemeExtension<CSSObject>, CardThemeExtension<CSSObject>, CheckboxThemeExtension<CSSObject>, DividerThemeExtension<CSSObject>, ImageThemeExtension<CSSObject>, InputThemeExtension<CSSObject>, LabelThemeExtension<CSSObject>, LinkThemeExtension<CSSObject>, MenuThemeExtension<CSSObject>, MenuItemThemeExtension<CSSObject>, MessageThemeExtension<CSSObject>, RadioThemeExtension<CSSObject>, SelectThemeExtension<CSSObject>, SliderThemeExtension<CSSObject>, TextThemeExtension<CSSObject>, TextareaThemeExtension<CSSObject>, ValidationMessageThemeExtension<CSSObject> {
|
|
295
294
|
}
|
|
296
295
|
|
|
297
|
-
|
|
296
|
+
interface ActionGroupProps extends ComponentProps<'div'> {
|
|
298
297
|
space?: ResponsiveStyleValue<string>;
|
|
299
298
|
verticalAlignment?: boolean;
|
|
300
|
-
}
|
|
299
|
+
}
|
|
301
300
|
declare const ActionGroup: React.FC<ActionGroupProps>;
|
|
302
301
|
|
|
303
302
|
declare type WidthValues = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
304
|
-
|
|
303
|
+
interface ColumnProps {
|
|
305
304
|
className?: string;
|
|
306
305
|
width?: WidthValues | WidthValues[];
|
|
307
|
-
}
|
|
306
|
+
}
|
|
308
307
|
declare const Column: React.FC<ColumnProps>;
|
|
309
308
|
|
|
310
|
-
|
|
309
|
+
interface ColumnsProps {
|
|
311
310
|
className?: string;
|
|
312
311
|
space?: ResponsiveStyleValue<string>;
|
|
313
312
|
horizontalAlign?: 'left' | 'right' | 'center';
|
|
314
313
|
verticalAlign?: 'top' | 'bottom' | 'center';
|
|
315
|
-
}
|
|
314
|
+
}
|
|
316
315
|
declare const Columns: React.FC<ColumnsProps>;
|
|
317
316
|
|
|
318
317
|
declare type ModalDialogProps = {
|
|
@@ -320,13 +319,14 @@ declare type ModalDialogProps = {
|
|
|
320
319
|
backdropVariant?: string;
|
|
321
320
|
} & OverlayProps & AriaDialogProps;
|
|
322
321
|
|
|
323
|
-
|
|
322
|
+
interface DialogProps extends ModalDialogProps, ComponentProps<'div'> {
|
|
324
323
|
backdropVariant?: string;
|
|
325
324
|
close: ComponentProps<typeof Button>['onClick'];
|
|
326
325
|
isOpen: boolean;
|
|
327
326
|
title?: string;
|
|
328
327
|
variant?: string;
|
|
329
|
-
|
|
328
|
+
role?: 'dialog' | 'alertdialog';
|
|
329
|
+
}
|
|
330
330
|
declare const Dialog: React.FC<DialogProps>;
|
|
331
331
|
declare const useDialogButtonProps: () => {
|
|
332
332
|
state: _react_stately_overlays.OverlayTriggerState;
|
|
@@ -343,22 +343,20 @@ declare type FieldProps = {
|
|
|
343
343
|
} & AriaTextFieldProps & ComponentProps<'input'>;
|
|
344
344
|
declare const Field: React.FC<FieldProps>;
|
|
345
345
|
|
|
346
|
-
|
|
346
|
+
interface InlineProps {
|
|
347
347
|
space?: ResponsiveStyleValue<string>;
|
|
348
348
|
align?: 'top' | 'center' | 'bottom';
|
|
349
|
-
}
|
|
349
|
+
}
|
|
350
350
|
declare const Inline: React.FC<InlineProps>;
|
|
351
351
|
|
|
352
|
-
|
|
352
|
+
interface StackProps {
|
|
353
353
|
space?: ResponsiveStyleValue<string>;
|
|
354
354
|
align?: 'left' | 'right' | 'center';
|
|
355
|
-
}
|
|
355
|
+
}
|
|
356
356
|
declare const Stack: React.FC<StackProps>;
|
|
357
357
|
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
title?: string;
|
|
361
|
-
};
|
|
358
|
+
interface ContainerProps extends ComponentProps<'div'> {
|
|
359
|
+
}
|
|
362
360
|
declare const Container: React.FC<ContainerProps>;
|
|
363
361
|
|
|
364
|
-
export { ActionGroup, ActionGroupProps, Alert, AlertProps, AlertThemeExtension, AlertVariants, Badge, BadgeProps, BadgeThemeExtension, Button, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Checkbox, CheckboxProps, CheckboxThemeExtension, Column, ColumnProps, Columns, Container, ContainerProps, Dialog, DialogProps, Divider, DividerProps, DividerThemeExtension, Field, FieldProps, Image, ImageProps, ImageThemeExtension, Inline, InlineProps, Input, InputProps, InputThemeExtension, Label, LabelBase, LabelBaseProps, LabelProps, LabelThemeExtension, Link, LinkOwnProps, LinkProps, LinkThemeExtension, MarigoldProvider, MarigoldProviderProps, Menu, MenuItem, MenuItemProps, MenuItemThemeExtension, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, Radio, RadioProps, RadioThemeExtension, RootThemeExtension, Select, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, Stack, StackProps, Text, TextOwnProps, TextProps, TextThemeExtension, Textarea, TextareaProps, TextareaThemeExtension, Theme, ValidationMessage, ValidationMessageProps, ValidationMessageThemeExtension, useDialogButtonProps };
|
|
362
|
+
export { ActionGroup, ActionGroupProps, Alert, AlertProps, AlertThemeExtension, AlertVariants, Badge, BadgeProps, BadgeThemeExtension, Button, ButtonProps, ButtonThemeExtension, Card, CardProps, CardThemeExtension, Checkbox, CheckboxProps, CheckboxThemeExtension, Column, ColumnProps, Columns, ColumnsProps, Container, ContainerProps, Dialog, DialogProps, Divider, DividerProps, DividerThemeExtension, Field, FieldProps, Image, ImageProps, ImageThemeExtension, Inline, InlineProps, Input, InputProps, InputThemeExtension, Label, LabelBase, LabelBaseProps, LabelProps, LabelThemeExtension, Link, LinkOwnProps, LinkProps, LinkThemeExtension, MarigoldProvider, MarigoldProviderProps, Menu, MenuItem, MenuItemProps, MenuItemThemeExtension, MenuProps, MenuThemeExtension, Message, MessageProps, MessageThemeExtension, Radio, RadioProps, RadioThemeExtension, RootThemeExtension, Select, SelectProps, SelectThemeExtension, Slider, SliderProps, SliderThemeExtension, Stack, StackProps, Text, TextOwnProps, TextProps, TextThemeExtension, Textarea, TextareaProps, TextareaThemeExtension, Theme, ValidationMessage, ValidationMessageProps, ValidationMessageThemeExtension, useDialogButtonProps };
|
package/dist/index.js
CHANGED
|
@@ -397,7 +397,7 @@ function useToggleState(props) {
|
|
|
397
397
|
// src/Checkbox/Checkbox.tsx
|
|
398
398
|
var import_icons3 = require("@marigold/icons");
|
|
399
399
|
|
|
400
|
-
// src/Checkbox/
|
|
400
|
+
// src/Checkbox/CheckboxIcon.tsx
|
|
401
401
|
var import_react9 = __toESM(require("react"));
|
|
402
402
|
var import_system2 = require("@marigold/system");
|
|
403
403
|
var CheckboxIcon = ({
|
|
@@ -503,15 +503,12 @@ var CheckboxInput = (_a) => {
|
|
|
503
503
|
const ref = import_react12.default.useRef(null);
|
|
504
504
|
const { inputProps } = (0, import_checkbox.useCheckbox)(props, state, ref);
|
|
505
505
|
const { focusProps } = (0, import_focus.useFocusRing)();
|
|
506
|
+
const _a2 = props, { children } = _a2, restProps = __objRest(_a2, ["children"]);
|
|
506
507
|
return /* @__PURE__ */ import_react12.default.createElement(import_system.Box, {
|
|
507
508
|
pr: "xsmall"
|
|
508
|
-
}, /* @__PURE__ */ import_react12.default.createElement(import_visually_hidden.VisuallyHidden, null, /* @__PURE__ */ import_react12.default.createElement(
|
|
509
|
-
as: "input",
|
|
510
|
-
type: "checkbox",
|
|
511
|
-
disabled: props.disabled
|
|
512
|
-
}, inputProps), focusProps), {
|
|
509
|
+
}, /* @__PURE__ */ import_react12.default.createElement(import_visually_hidden.VisuallyHidden, null, /* @__PURE__ */ import_react12.default.createElement("input", __spreadValues(__spreadProps(__spreadValues(__spreadValues({}, inputProps), focusProps), {
|
|
513
510
|
ref
|
|
514
|
-
}),
|
|
511
|
+
}), restProps))), /* @__PURE__ */ import_react12.default.createElement(CheckboxIcon, {
|
|
515
512
|
checked: props.checked,
|
|
516
513
|
variant: props.variant,
|
|
517
514
|
disabled: props.disabled,
|
|
@@ -520,16 +517,12 @@ var CheckboxInput = (_a) => {
|
|
|
520
517
|
};
|
|
521
518
|
var Checkbox = (_a) => {
|
|
522
519
|
var _b = _a, {
|
|
523
|
-
label,
|
|
524
520
|
required,
|
|
525
521
|
labelVariant = "inline",
|
|
526
|
-
error,
|
|
527
522
|
errorMessage
|
|
528
523
|
} = _b, props = __objRest(_b, [
|
|
529
|
-
"label",
|
|
530
524
|
"required",
|
|
531
525
|
"labelVariant",
|
|
532
|
-
"error",
|
|
533
526
|
"errorMessage"
|
|
534
527
|
]);
|
|
535
528
|
return /* @__PURE__ */ import_react12.default.createElement(import_react12.default.Fragment, null, /* @__PURE__ */ import_react12.default.createElement(import_system.Box, {
|
|
@@ -543,8 +536,8 @@ var Checkbox = (_a) => {
|
|
|
543
536
|
color: props.disabled ? "disabled" : "text"
|
|
544
537
|
}, /* @__PURE__ */ import_react12.default.createElement(import_system.Box, __spreadValues({
|
|
545
538
|
as: CheckboxInput,
|
|
546
|
-
error
|
|
547
|
-
}, props)),
|
|
539
|
+
error: props.error
|
|
540
|
+
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */ import_react12.default.createElement(ValidationMessage, null, /* @__PURE__ */ import_react12.default.createElement(import_icons3.Exclamation, {
|
|
548
541
|
size: 16
|
|
549
542
|
}), errorMessage));
|
|
550
543
|
};
|
|
@@ -636,28 +629,34 @@ var Text = (0, import_react15.forwardRef)((_a, ref) => {
|
|
|
636
629
|
as = "span",
|
|
637
630
|
variant = "body",
|
|
638
631
|
children,
|
|
639
|
-
className,
|
|
640
632
|
align,
|
|
641
633
|
color,
|
|
642
634
|
cursor,
|
|
635
|
+
size,
|
|
643
636
|
outline,
|
|
644
637
|
userSelect
|
|
645
638
|
} = _b, props = __objRest(_b, [
|
|
646
639
|
"as",
|
|
647
640
|
"variant",
|
|
648
641
|
"children",
|
|
649
|
-
"className",
|
|
650
642
|
"align",
|
|
651
643
|
"color",
|
|
652
644
|
"cursor",
|
|
645
|
+
"size",
|
|
653
646
|
"outline",
|
|
654
647
|
"userSelect"
|
|
655
648
|
]);
|
|
656
649
|
return /* @__PURE__ */ import_react15.default.createElement(import_system.Box, __spreadProps(__spreadValues({}, props), {
|
|
657
650
|
as,
|
|
658
651
|
variant: `text.${variant}`,
|
|
659
|
-
css: {
|
|
660
|
-
|
|
652
|
+
css: {
|
|
653
|
+
textAlign: align,
|
|
654
|
+
fontSize: size,
|
|
655
|
+
color,
|
|
656
|
+
cursor,
|
|
657
|
+
outline,
|
|
658
|
+
userSelect
|
|
659
|
+
},
|
|
661
660
|
ref
|
|
662
661
|
}), children);
|
|
663
662
|
});
|
|
@@ -921,16 +920,13 @@ var import_react23 = __toESM(require("react"));
|
|
|
921
920
|
var MenuItem = (_a) => {
|
|
922
921
|
var _b = _a, {
|
|
923
922
|
variant = "default",
|
|
924
|
-
className,
|
|
925
923
|
children
|
|
926
924
|
} = _b, props = __objRest(_b, [
|
|
927
925
|
"variant",
|
|
928
|
-
"className",
|
|
929
926
|
"children"
|
|
930
927
|
]);
|
|
931
928
|
return /* @__PURE__ */ import_react23.default.createElement(import_system.Box, {
|
|
932
|
-
variant: `menuItem.${variant}
|
|
933
|
-
className
|
|
929
|
+
variant: `menuItem.${variant}`
|
|
934
930
|
}, /* @__PURE__ */ import_react23.default.createElement(Link, __spreadValues({
|
|
935
931
|
variant: "menuItemLink"
|
|
936
932
|
}, props), children));
|
|
@@ -1038,12 +1034,13 @@ var RadioIcon = ({
|
|
|
1038
1034
|
var RadioInput = (_a) => {
|
|
1039
1035
|
var _b = _a, { error } = _b, props = __objRest(_b, ["error"]);
|
|
1040
1036
|
const { focusProps } = (0, import_focus3.useFocusRing)();
|
|
1037
|
+
const _a2 = props, { children } = _a2, restProps = __objRest(_a2, ["children"]);
|
|
1041
1038
|
return /* @__PURE__ */ import_react27.default.createElement(import_system.Box, {
|
|
1042
1039
|
pr: "xsmall"
|
|
1043
1040
|
}, /* @__PURE__ */ import_react27.default.createElement(import_visually_hidden3.VisuallyHidden, null, /* @__PURE__ */ import_react27.default.createElement("input", __spreadValues(__spreadValues({
|
|
1044
1041
|
type: "radio",
|
|
1045
1042
|
disabled: props.disabled
|
|
1046
|
-
}, focusProps),
|
|
1043
|
+
}, focusProps), restProps))), /* @__PURE__ */ import_react27.default.createElement(RadioIcon, {
|
|
1047
1044
|
variant: props.variant,
|
|
1048
1045
|
disabled: props.disabled,
|
|
1049
1046
|
checked: props.checked,
|
|
@@ -1052,16 +1049,12 @@ var RadioInput = (_a) => {
|
|
|
1052
1049
|
};
|
|
1053
1050
|
var Radio = (_a) => {
|
|
1054
1051
|
var _b = _a, {
|
|
1055
|
-
label,
|
|
1056
1052
|
required,
|
|
1057
1053
|
labelVariant = "inline",
|
|
1058
|
-
error,
|
|
1059
1054
|
errorMessage
|
|
1060
1055
|
} = _b, props = __objRest(_b, [
|
|
1061
|
-
"label",
|
|
1062
1056
|
"required",
|
|
1063
1057
|
"labelVariant",
|
|
1064
|
-
"error",
|
|
1065
1058
|
"errorMessage"
|
|
1066
1059
|
]);
|
|
1067
1060
|
return /* @__PURE__ */ import_react27.default.createElement(import_react27.default.Fragment, null, /* @__PURE__ */ import_react27.default.createElement(import_system.Box, {
|
|
@@ -1072,8 +1065,8 @@ var Radio = (_a) => {
|
|
|
1072
1065
|
css: props.disabled ? { color: "disabled", ":hover": { cursor: "not-allowed" } } : { color: "text", ":hover": { cursor: "pointer" } }
|
|
1073
1066
|
}, /* @__PURE__ */ import_react27.default.createElement(import_system.Box, __spreadValues({
|
|
1074
1067
|
as: RadioInput,
|
|
1075
|
-
error
|
|
1076
|
-
}, props)),
|
|
1068
|
+
error: props.error
|
|
1069
|
+
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */ import_react27.default.createElement(ValidationMessage, null, /* @__PURE__ */ import_react27.default.createElement(import_icons7.Exclamation, {
|
|
1077
1070
|
size: 16
|
|
1078
1071
|
}), errorMessage));
|
|
1079
1072
|
};
|
|
@@ -1081,19 +1074,12 @@ var Radio = (_a) => {
|
|
|
1081
1074
|
// src/Slider/Slider.tsx
|
|
1082
1075
|
var import_react28 = __toESM(require("react"));
|
|
1083
1076
|
var Slider = (_a) => {
|
|
1084
|
-
var _b = _a, {
|
|
1085
|
-
variant = "",
|
|
1086
|
-
className
|
|
1087
|
-
} = _b, props = __objRest(_b, [
|
|
1088
|
-
"variant",
|
|
1089
|
-
"className"
|
|
1090
|
-
]);
|
|
1077
|
+
var _b = _a, { variant = "" } = _b, props = __objRest(_b, ["variant"]);
|
|
1091
1078
|
return /* @__PURE__ */ import_react28.default.createElement(import_system.Box, __spreadValues({
|
|
1092
1079
|
as: "input",
|
|
1093
1080
|
type: "range",
|
|
1094
1081
|
css: { verticalAlign: "middle" },
|
|
1095
|
-
variant: `slider.${variant}
|
|
1096
|
-
className
|
|
1082
|
+
variant: `slider.${variant}`
|
|
1097
1083
|
}, props));
|
|
1098
1084
|
};
|
|
1099
1085
|
|
package/dist/index.mjs
CHANGED
|
@@ -330,7 +330,7 @@ function useToggleState(props) {
|
|
|
330
330
|
// src/Checkbox/Checkbox.tsx
|
|
331
331
|
import { Exclamation as Exclamation2 } from "@marigold/icons";
|
|
332
332
|
|
|
333
|
-
// src/Checkbox/
|
|
333
|
+
// src/Checkbox/CheckboxIcon.tsx
|
|
334
334
|
import React8 from "react";
|
|
335
335
|
import { conditional, SVG } from "@marigold/system";
|
|
336
336
|
var CheckboxIcon = ({
|
|
@@ -436,15 +436,12 @@ var CheckboxInput = (_a) => {
|
|
|
436
436
|
const ref = React11.useRef(null);
|
|
437
437
|
const { inputProps } = useCheckbox(props, state, ref);
|
|
438
438
|
const { focusProps } = useFocusRing();
|
|
439
|
+
const _a2 = props, { children } = _a2, restProps = __objRest(_a2, ["children"]);
|
|
439
440
|
return /* @__PURE__ */ React11.createElement(Box, {
|
|
440
441
|
pr: "xsmall"
|
|
441
|
-
}, /* @__PURE__ */ React11.createElement(VisuallyHidden, null, /* @__PURE__ */ React11.createElement(
|
|
442
|
-
as: "input",
|
|
443
|
-
type: "checkbox",
|
|
444
|
-
disabled: props.disabled
|
|
445
|
-
}, inputProps), focusProps), {
|
|
442
|
+
}, /* @__PURE__ */ React11.createElement(VisuallyHidden, null, /* @__PURE__ */ React11.createElement("input", __spreadValues(__spreadProps(__spreadValues(__spreadValues({}, inputProps), focusProps), {
|
|
446
443
|
ref
|
|
447
|
-
}),
|
|
444
|
+
}), restProps))), /* @__PURE__ */ React11.createElement(CheckboxIcon, {
|
|
448
445
|
checked: props.checked,
|
|
449
446
|
variant: props.variant,
|
|
450
447
|
disabled: props.disabled,
|
|
@@ -453,16 +450,12 @@ var CheckboxInput = (_a) => {
|
|
|
453
450
|
};
|
|
454
451
|
var Checkbox = (_a) => {
|
|
455
452
|
var _b = _a, {
|
|
456
|
-
label,
|
|
457
453
|
required,
|
|
458
454
|
labelVariant = "inline",
|
|
459
|
-
error,
|
|
460
455
|
errorMessage
|
|
461
456
|
} = _b, props = __objRest(_b, [
|
|
462
|
-
"label",
|
|
463
457
|
"required",
|
|
464
458
|
"labelVariant",
|
|
465
|
-
"error",
|
|
466
459
|
"errorMessage"
|
|
467
460
|
]);
|
|
468
461
|
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Box, {
|
|
@@ -476,8 +469,8 @@ var Checkbox = (_a) => {
|
|
|
476
469
|
color: props.disabled ? "disabled" : "text"
|
|
477
470
|
}, /* @__PURE__ */ React11.createElement(Box, __spreadValues({
|
|
478
471
|
as: CheckboxInput,
|
|
479
|
-
error
|
|
480
|
-
}, props)),
|
|
472
|
+
error: props.error
|
|
473
|
+
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */ React11.createElement(ValidationMessage, null, /* @__PURE__ */ React11.createElement(Exclamation2, {
|
|
481
474
|
size: 16
|
|
482
475
|
}), errorMessage));
|
|
483
476
|
};
|
|
@@ -569,28 +562,34 @@ var Text = forwardRef2((_a, ref) => {
|
|
|
569
562
|
as = "span",
|
|
570
563
|
variant = "body",
|
|
571
564
|
children,
|
|
572
|
-
className,
|
|
573
565
|
align,
|
|
574
566
|
color,
|
|
575
567
|
cursor,
|
|
568
|
+
size,
|
|
576
569
|
outline,
|
|
577
570
|
userSelect
|
|
578
571
|
} = _b, props = __objRest(_b, [
|
|
579
572
|
"as",
|
|
580
573
|
"variant",
|
|
581
574
|
"children",
|
|
582
|
-
"className",
|
|
583
575
|
"align",
|
|
584
576
|
"color",
|
|
585
577
|
"cursor",
|
|
578
|
+
"size",
|
|
586
579
|
"outline",
|
|
587
580
|
"userSelect"
|
|
588
581
|
]);
|
|
589
582
|
return /* @__PURE__ */ React14.createElement(Box, __spreadProps(__spreadValues({}, props), {
|
|
590
583
|
as,
|
|
591
584
|
variant: `text.${variant}`,
|
|
592
|
-
css: {
|
|
593
|
-
|
|
585
|
+
css: {
|
|
586
|
+
textAlign: align,
|
|
587
|
+
fontSize: size,
|
|
588
|
+
color,
|
|
589
|
+
cursor,
|
|
590
|
+
outline,
|
|
591
|
+
userSelect
|
|
592
|
+
},
|
|
594
593
|
ref
|
|
595
594
|
}), children);
|
|
596
595
|
});
|
|
@@ -858,16 +857,13 @@ import React22 from "react";
|
|
|
858
857
|
var MenuItem = (_a) => {
|
|
859
858
|
var _b = _a, {
|
|
860
859
|
variant = "default",
|
|
861
|
-
className,
|
|
862
860
|
children
|
|
863
861
|
} = _b, props = __objRest(_b, [
|
|
864
862
|
"variant",
|
|
865
|
-
"className",
|
|
866
863
|
"children"
|
|
867
864
|
]);
|
|
868
865
|
return /* @__PURE__ */ React22.createElement(Box, {
|
|
869
|
-
variant: `menuItem.${variant}
|
|
870
|
-
className
|
|
866
|
+
variant: `menuItem.${variant}`
|
|
871
867
|
}, /* @__PURE__ */ React22.createElement(Link, __spreadValues({
|
|
872
868
|
variant: "menuItemLink"
|
|
873
869
|
}, props), children));
|
|
@@ -980,12 +976,13 @@ var RadioIcon = ({
|
|
|
980
976
|
var RadioInput = (_a) => {
|
|
981
977
|
var _b = _a, { error } = _b, props = __objRest(_b, ["error"]);
|
|
982
978
|
const { focusProps } = useFocusRing2();
|
|
979
|
+
const _a2 = props, { children } = _a2, restProps = __objRest(_a2, ["children"]);
|
|
983
980
|
return /* @__PURE__ */ React26.createElement(Box, {
|
|
984
981
|
pr: "xsmall"
|
|
985
982
|
}, /* @__PURE__ */ React26.createElement(VisuallyHidden3, null, /* @__PURE__ */ React26.createElement("input", __spreadValues(__spreadValues({
|
|
986
983
|
type: "radio",
|
|
987
984
|
disabled: props.disabled
|
|
988
|
-
}, focusProps),
|
|
985
|
+
}, focusProps), restProps))), /* @__PURE__ */ React26.createElement(RadioIcon, {
|
|
989
986
|
variant: props.variant,
|
|
990
987
|
disabled: props.disabled,
|
|
991
988
|
checked: props.checked,
|
|
@@ -994,16 +991,12 @@ var RadioInput = (_a) => {
|
|
|
994
991
|
};
|
|
995
992
|
var Radio = (_a) => {
|
|
996
993
|
var _b = _a, {
|
|
997
|
-
label,
|
|
998
994
|
required,
|
|
999
995
|
labelVariant = "inline",
|
|
1000
|
-
error,
|
|
1001
996
|
errorMessage
|
|
1002
997
|
} = _b, props = __objRest(_b, [
|
|
1003
|
-
"label",
|
|
1004
998
|
"required",
|
|
1005
999
|
"labelVariant",
|
|
1006
|
-
"error",
|
|
1007
1000
|
"errorMessage"
|
|
1008
1001
|
]);
|
|
1009
1002
|
return /* @__PURE__ */ React26.createElement(React26.Fragment, null, /* @__PURE__ */ React26.createElement(Box, {
|
|
@@ -1014,8 +1007,8 @@ var Radio = (_a) => {
|
|
|
1014
1007
|
css: props.disabled ? { color: "disabled", ":hover": { cursor: "not-allowed" } } : { color: "text", ":hover": { cursor: "pointer" } }
|
|
1015
1008
|
}, /* @__PURE__ */ React26.createElement(Box, __spreadValues({
|
|
1016
1009
|
as: RadioInput,
|
|
1017
|
-
error
|
|
1018
|
-
}, props)),
|
|
1010
|
+
error: props.error
|
|
1011
|
+
}, props)), props.children), props.error && errorMessage && /* @__PURE__ */ React26.createElement(ValidationMessage, null, /* @__PURE__ */ React26.createElement(Exclamation5, {
|
|
1019
1012
|
size: 16
|
|
1020
1013
|
}), errorMessage));
|
|
1021
1014
|
};
|
|
@@ -1023,19 +1016,12 @@ var Radio = (_a) => {
|
|
|
1023
1016
|
// src/Slider/Slider.tsx
|
|
1024
1017
|
import React27 from "react";
|
|
1025
1018
|
var Slider = (_a) => {
|
|
1026
|
-
var _b = _a, {
|
|
1027
|
-
variant = "",
|
|
1028
|
-
className
|
|
1029
|
-
} = _b, props = __objRest(_b, [
|
|
1030
|
-
"variant",
|
|
1031
|
-
"className"
|
|
1032
|
-
]);
|
|
1019
|
+
var _b = _a, { variant = "" } = _b, props = __objRest(_b, ["variant"]);
|
|
1033
1020
|
return /* @__PURE__ */ React27.createElement(Box, __spreadValues({
|
|
1034
1021
|
as: "input",
|
|
1035
1022
|
type: "range",
|
|
1036
1023
|
css: { verticalAlign: "middle" },
|
|
1037
|
-
variant: `slider.${variant}
|
|
1038
|
-
className
|
|
1024
|
+
variant: `slider.${variant}`
|
|
1039
1025
|
}, props));
|
|
1040
1026
|
};
|
|
1041
1027
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marigold/components",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Components for the Marigold Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
],
|
|
20
20
|
"repository": {
|
|
21
21
|
"type": "git",
|
|
22
|
-
"url": "github
|
|
22
|
+
"url": "https://github.com/marigold-ui/marigold",
|
|
23
23
|
"directory": "packages/components"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@marigold/icons": "0.4.
|
|
27
|
-
"@marigold/system": "0.
|
|
26
|
+
"@marigold/icons": "0.4.1",
|
|
27
|
+
"@marigold/system": "0.5.0",
|
|
28
28
|
"@marigold/types": "0.4.0",
|
|
29
29
|
"@react-aria/button": "^3.3.3",
|
|
30
30
|
"@react-aria/checkbox": "^3.2.3",
|