@wix/site-ui 1.108.0 → 1.110.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/dist/8027.js +4 -0
- package/dist/Checkbox/index.css +47 -55
- package/dist/Checkbox/index.d.ts +16 -1
- package/dist/Checkbox/index.js +25 -6
- package/dist/CheckboxField/index.css +93 -0
- package/dist/CheckboxField/index.d.ts +468 -0
- package/dist/CheckboxField/index.js +69 -0
- package/dist/CheckboxGroup/index.js +1 -6
- package/dist/CheckboxGroupField/index.css +60 -0
- package/dist/CheckboxGroupField/index.d.ts +37 -0
- package/dist/CheckboxGroupField/index.js +55 -0
- package/dist/Field/index.css +90 -1
- package/dist/Field/index.d.ts +14 -3
- package/dist/Field/index.js +36 -5
- package/dist/RadioField/index.d.ts +13 -3
- package/dist/index.d.ts +85 -10
- package/dist/index.js +2 -0
- package/package.json +2 -2
- package/dist/CheckboxGroup/index.css +0 -9
package/dist/8027.js
ADDED
package/dist/Checkbox/index.css
CHANGED
|
@@ -1,94 +1,86 @@
|
|
|
1
1
|
.root-OrOWpu {
|
|
2
|
+
--checkbox-size: 14px;
|
|
3
|
+
--checkbox-border-color: color-mix(in srgb,
|
|
4
|
+
var(--wst-system-line-1-color, black) 60%,
|
|
5
|
+
transparent);
|
|
6
|
+
--checkbox-icon-color: var(--wst-links-and-actions-color, #116dff);
|
|
2
7
|
box-sizing: border-box;
|
|
3
8
|
cursor: pointer;
|
|
4
|
-
font: var(--wst-paragraph-2-font);
|
|
5
|
-
color: var(--wst-paragraph-2-color, #000);
|
|
6
|
-
--indicator-bg: var(--wst-primary-background-color, #fff);
|
|
7
|
-
--indicator-border: color-mix(in srgb,
|
|
8
|
-
var(--wst-system-line-1-color, #000) 60%,
|
|
9
|
-
transparent);
|
|
10
9
|
align-items: center;
|
|
11
|
-
|
|
12
|
-
transition: color .2s linear;
|
|
10
|
+
transition: background-color .2s linear, border-color .2s linear, color .2s linear;
|
|
13
11
|
display: inline-flex;
|
|
12
|
+
position: relative;
|
|
14
13
|
}
|
|
15
14
|
|
|
16
15
|
.root-OrOWpu:hover, .root-OrOWpu:focus-within {
|
|
17
|
-
--
|
|
18
|
-
outline: none;
|
|
16
|
+
--checkbox-border-color: var(--wst-system-line-1-color, black);
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
.root-OrOWpu
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
.root-OrOWpu[data-checked]:hover {
|
|
27
|
-
--indicator-bg: color-mix(in srgb,
|
|
28
|
-
var(--wst-links-and-actions-color, #116dff) 85%,
|
|
29
|
-
#000);
|
|
30
|
-
--indicator-border: color-mix(in srgb,
|
|
31
|
-
var(--wst-links-and-actions-color, #116dff) 85%,
|
|
32
|
-
#000);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.root-OrOWpu[data-disabled] {
|
|
36
|
-
cursor: default;
|
|
37
|
-
pointer-events: none;
|
|
38
|
-
color: var(--wst-system-disabled-color, #939393);
|
|
39
|
-
--indicator-bg: var(--wst-primary-background-color, #fff);
|
|
40
|
-
--indicator-border: color-mix(in srgb,
|
|
41
|
-
var(--wst-system-disabled-color, #939393) 60%,
|
|
42
|
-
transparent);
|
|
19
|
+
.root-OrOWpu:focus-visible {
|
|
20
|
+
z-index: 1;
|
|
21
|
+
box-shadow: var(--wst-primary-background-color, white) 0 0 0 1px,
|
|
22
|
+
var(--wst-links-and-actions-color, #116dff) 0 0 0 3px;
|
|
23
|
+
outline: none;
|
|
43
24
|
}
|
|
44
25
|
|
|
45
26
|
.root-OrOWpu[data-invalid]:not([data-checked]) {
|
|
46
|
-
--
|
|
27
|
+
--checkbox-border-color: var(--wst-system-error-color, #df3131);
|
|
47
28
|
}
|
|
48
29
|
|
|
49
|
-
.root-OrOWpu[data-invalid]
|
|
50
|
-
--
|
|
30
|
+
.root-OrOWpu[data-invalid][data-checked] {
|
|
31
|
+
--checkbox-icon-color: var(--wst-system-error-color, #df3131);
|
|
32
|
+
--checkbox-border-color: color-mix(in srgb,
|
|
51
33
|
var(--wst-system-error-color, #df3131) 70%,
|
|
52
34
|
transparent);
|
|
53
35
|
}
|
|
54
36
|
|
|
55
|
-
.root-OrOWpu[data-
|
|
56
|
-
--
|
|
57
|
-
|
|
37
|
+
.root-OrOWpu[data-disabled] {
|
|
38
|
+
--checkbox-border-color: color-mix(in srgb,
|
|
39
|
+
var(--wst-system-disabled-color, #939393) 60%,
|
|
40
|
+
transparent);
|
|
41
|
+
--checkbox-icon-color: var(--wst-system-disabled-color, #939393);
|
|
42
|
+
cursor: default;
|
|
43
|
+
pointer-events: none;
|
|
58
44
|
}
|
|
59
45
|
|
|
60
46
|
.indicator-g_8JYy {
|
|
61
47
|
box-sizing: content-box;
|
|
62
|
-
width: var(--checkbox-size,
|
|
63
|
-
height: var(--checkbox-size,
|
|
64
|
-
border: var(--wst-system-line-1-width, 1px) solid var(--
|
|
65
|
-
background-color: var(--
|
|
66
|
-
|
|
48
|
+
width: var(--checkbox-size, 14px);
|
|
49
|
+
height: var(--checkbox-size, 14px);
|
|
50
|
+
border: var(--wst-system-line-1-width, 1px) solid var(--checkbox-border-color);
|
|
51
|
+
background-color: var(--wst-primary-background-color, white);
|
|
52
|
+
color: #0000;
|
|
53
|
+
border-radius: 4px;
|
|
67
54
|
flex-shrink: 0;
|
|
68
55
|
justify-content: center;
|
|
69
56
|
align-items: center;
|
|
70
|
-
transition: background-color .2s linear, border-color .2s linear;
|
|
57
|
+
transition: background-color .2s linear, border-color .2s linear, color .2s linear;
|
|
71
58
|
display: inline-flex;
|
|
59
|
+
position: relative;
|
|
72
60
|
}
|
|
73
61
|
|
|
74
|
-
.indicator-g_8JYy
|
|
75
|
-
|
|
76
|
-
|
|
62
|
+
.indicator-g_8JYy svg {
|
|
63
|
+
width: calc(var(--checkbox-size, 14px) * .72);
|
|
64
|
+
height: auto;
|
|
65
|
+
position: absolute;
|
|
66
|
+
top: 50%;
|
|
67
|
+
left: 50%;
|
|
68
|
+
transform: translate(-50%, -50%);
|
|
77
69
|
}
|
|
78
70
|
|
|
79
|
-
.
|
|
80
|
-
fill:
|
|
71
|
+
.indicator-g_8JYy path {
|
|
72
|
+
fill: currentColor;
|
|
81
73
|
}
|
|
82
74
|
|
|
83
|
-
.
|
|
84
|
-
|
|
75
|
+
.indicatorIcon-6oqHA9 {
|
|
76
|
+
opacity: 0;
|
|
85
77
|
}
|
|
86
78
|
|
|
87
|
-
.root-OrOWpu[data-
|
|
88
|
-
|
|
79
|
+
.root-OrOWpu[data-checked] .indicator-g_8JYy, .root-OrOWpu[data-indeterminate] .indicator-g_8JYy {
|
|
80
|
+
color: var(--checkbox-icon-color);
|
|
89
81
|
}
|
|
90
82
|
|
|
91
|
-
.root-OrOWpu[data-
|
|
92
|
-
|
|
83
|
+
.root-OrOWpu[data-checked]:not([data-indeterminate]) .checkmarkIcon-MX0Ccp, .root-OrOWpu[data-indeterminate] .indeterminateIcon-_b18QI {
|
|
84
|
+
opacity: 1;
|
|
93
85
|
}
|
|
94
86
|
|
package/dist/Checkbox/index.d.ts
CHANGED
|
@@ -80,6 +80,13 @@ export declare const Checkbox: {
|
|
|
80
80
|
} & React_2.RefAttributes<HTMLSpanElement>>;
|
|
81
81
|
};
|
|
82
82
|
|
|
83
|
+
export declare namespace Checkbox_2 {
|
|
84
|
+
export {
|
|
85
|
+
CheckboxRoot as Root,
|
|
86
|
+
CheckboxIndicator as Indicator
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
83
90
|
/**
|
|
84
91
|
* Indicates whether the checkbox is ticked.
|
|
85
92
|
* Renders a `<span>` element.
|
|
@@ -227,7 +234,7 @@ export declare interface CheckboxRootState extends FieldRootState {
|
|
|
227
234
|
|
|
228
235
|
export declare const CheckboxSize: {
|
|
229
236
|
readonly small: 12;
|
|
230
|
-
readonly medium:
|
|
237
|
+
readonly medium: 14;
|
|
231
238
|
readonly large: 20;
|
|
232
239
|
};
|
|
233
240
|
|
|
@@ -415,6 +422,10 @@ declare interface ReasonToEventMap {
|
|
|
415
422
|
[REASONS.windowResize]: UIEvent;
|
|
416
423
|
}
|
|
417
424
|
|
|
425
|
+
export declare type RootProps = WithStringClassName<React_2.ComponentPropsWithoutRef<typeof Checkbox_2.Root>> & {
|
|
426
|
+
size?: number;
|
|
427
|
+
};
|
|
428
|
+
|
|
418
429
|
declare const scrub: "scrub";
|
|
419
430
|
|
|
420
431
|
declare const siblingOpen: "sibling-open";
|
|
@@ -442,4 +453,8 @@ declare type WithBaseUIEvent<T> = { [K in keyof T]: WithPreventBaseUIHandler<T[K
|
|
|
442
453
|
|
|
443
454
|
declare type WithPreventBaseUIHandler<T> = T extends ((event: infer E) => any) ? E extends React_2.SyntheticEvent<Element, Event> ? (event: BaseUIEvent<E>) => ReturnType<T> : T : T extends undefined ? undefined : T;
|
|
444
455
|
|
|
456
|
+
declare type WithStringClassName<P> = Omit<P, 'className'> & {
|
|
457
|
+
className?: string;
|
|
458
|
+
};
|
|
459
|
+
|
|
445
460
|
export { }
|
package/dist/Checkbox/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { CheckboxChecked, CheckboxIndeterminate } from "@wix/wix-ui-icons-common/system";
|
|
2
3
|
import clsx from "clsx";
|
|
3
4
|
import { CheckboxRoot_CheckboxRoot, useCheckboxRootContext, useStateAttributesMapping } from "../3248.js";
|
|
4
5
|
import { useOpenChangeComplete, transitionStatusMapping, useTransitionStatus } from "../880.js";
|
|
@@ -44,27 +45,45 @@ const CheckboxIndicator_CheckboxIndicator = /*#__PURE__*/ __rspack_external_reac
|
|
|
44
45
|
if ("production" !== process.env.NODE_ENV) CheckboxIndicator_CheckboxIndicator.displayName = "CheckboxIndicator";
|
|
45
46
|
const Checkbox_module = {
|
|
46
47
|
root: "root-OrOWpu",
|
|
47
|
-
indicator: "indicator-g_8JYy"
|
|
48
|
+
indicator: "indicator-g_8JYy",
|
|
49
|
+
indicatorIcon: "indicatorIcon-6oqHA9",
|
|
50
|
+
checkmarkIcon: "checkmarkIcon-MX0Ccp",
|
|
51
|
+
indeterminateIcon: "indeterminateIcon-_b18QI"
|
|
48
52
|
};
|
|
49
53
|
const CheckboxSize = {
|
|
50
54
|
small: 12,
|
|
51
|
-
medium:
|
|
55
|
+
medium: 14,
|
|
52
56
|
large: 20
|
|
53
57
|
};
|
|
54
58
|
const Root = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, size = CheckboxSize.medium, style, ...props }, ref)=>/*#__PURE__*/ jsx(CheckboxRoot_CheckboxRoot, {
|
|
55
59
|
ref: ref,
|
|
56
|
-
className: clsx(Checkbox_module.root, className),
|
|
60
|
+
className: clsx(Checkbox_module.root, className, 'has-custom-focus'),
|
|
57
61
|
style: {
|
|
58
62
|
'--checkbox-size': `${size}px`,
|
|
59
63
|
...style
|
|
60
64
|
},
|
|
61
65
|
...props
|
|
62
66
|
}));
|
|
63
|
-
|
|
67
|
+
Root.displayName = 'Checkbox.Root';
|
|
68
|
+
const Indicator = /*#__PURE__*/ __rspack_external_react.forwardRef(({ className, children, ...props }, ref)=>/*#__PURE__*/ jsx(CheckboxIndicator_CheckboxIndicator, {
|
|
64
69
|
ref: ref,
|
|
70
|
+
keepMounted: true,
|
|
65
71
|
className: clsx(Checkbox_module.indicator, className),
|
|
66
|
-
...props
|
|
72
|
+
...props,
|
|
73
|
+
children: children ?? /*#__PURE__*/ jsxs(Fragment, {
|
|
74
|
+
children: [
|
|
75
|
+
/*#__PURE__*/ jsx(CheckboxChecked, {
|
|
76
|
+
"aria-hidden": "true",
|
|
77
|
+
className: clsx(Checkbox_module.indicatorIcon, Checkbox_module.checkmarkIcon)
|
|
78
|
+
}),
|
|
79
|
+
/*#__PURE__*/ jsx(CheckboxIndeterminate, {
|
|
80
|
+
"aria-hidden": "true",
|
|
81
|
+
className: clsx(Checkbox_module.indicatorIcon, Checkbox_module.indeterminateIcon)
|
|
82
|
+
})
|
|
83
|
+
]
|
|
84
|
+
})
|
|
67
85
|
}));
|
|
86
|
+
Indicator.displayName = 'Checkbox.Indicator';
|
|
68
87
|
const Checkbox = {
|
|
69
88
|
Root: Root,
|
|
70
89
|
Indicator: Indicator
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
.option-o8pAcb {
|
|
2
|
+
width: var(--checkbox-option-width, auto);
|
|
3
|
+
gap: 8px;
|
|
4
|
+
max-width: 100%;
|
|
5
|
+
display: inline-block;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.option-o8pAcb[data-variant="box"], .option-o8pAcb[data-has-error-message] {
|
|
9
|
+
width: var(--checkbox-option-width, 100%);
|
|
10
|
+
display: flex;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.root-tqmYsF {
|
|
14
|
+
--checkbox-box-border-color: color-mix(in srgb,
|
|
15
|
+
var(--wst-system-line-1-color, black) 60%,
|
|
16
|
+
transparent);
|
|
17
|
+
max-width: 100%;
|
|
18
|
+
color: var(--wst-paragraph-2-color, black);
|
|
19
|
+
font: var(--wst-paragraph-2-font, normal normal 400 16px / 24px Madefor,
|
|
20
|
+
"Helvetica Neue",
|
|
21
|
+
Arial,
|
|
22
|
+
sans-serif);
|
|
23
|
+
user-select: none;
|
|
24
|
+
gap: 12px;
|
|
25
|
+
line-height: 24px;
|
|
26
|
+
text-decoration: none;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.root-tqmYsF[data-vertical-alignment="top"] {
|
|
30
|
+
align-items: flex-start;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.root-tqmYsF[data-vertical-alignment="top"] .indicator-_WzHbq {
|
|
34
|
+
margin-top: calc((
|
|
35
|
+
24px - var(--checkbox-size, 14px) - 2 *
|
|
36
|
+
var(--wst-system-line-1-width, 1px)
|
|
37
|
+
) /
|
|
38
|
+
2);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.root-tqmYsF[data-variant="box"] {
|
|
42
|
+
width: var(--checkbox-option-width, 100%);
|
|
43
|
+
border: var(--wst-system-line-1-width, 1px) solid
|
|
44
|
+
var(--checkbox-box-border-color);
|
|
45
|
+
background-color: var(--wst-primary-background-color, white);
|
|
46
|
+
border-radius: 4px;
|
|
47
|
+
padding: 15px 16px;
|
|
48
|
+
display: flex;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.root-tqmYsF[data-variant="box"]:hover, .root-tqmYsF[data-variant="box"]:focus-within {
|
|
52
|
+
--checkbox-box-border-color: var(--wst-system-line-1-color, black);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.root-tqmYsF[data-variant="box"][data-checked]:not([data-disabled]) {
|
|
56
|
+
--checkbox-box-border-color: var(--wst-links-and-actions-color, #116dff);
|
|
57
|
+
background-color: color-mix(in srgb,
|
|
58
|
+
var(--wst-links-and-actions-color, #116dff) 10%,
|
|
59
|
+
transparent);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.root-tqmYsF[data-variant="box"][data-invalid]:not([data-checked]) {
|
|
63
|
+
--checkbox-box-border-color: var(--wst-system-error-color, #df3131);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.root-tqmYsF[data-variant="box"][data-disabled] {
|
|
67
|
+
--checkbox-box-border-color: var(--wst-system-disabled-color, #939393);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.root-tqmYsF[data-disabled] {
|
|
71
|
+
color: var(--wst-system-disabled-color, #939393);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.optionContent-inaJL9 {
|
|
75
|
+
flex: auto;
|
|
76
|
+
align-items: center;
|
|
77
|
+
min-width: 0;
|
|
78
|
+
display: flex;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.optionLabel-fJWxkM {
|
|
82
|
+
overflow-wrap: anywhere;
|
|
83
|
+
flex: auto;
|
|
84
|
+
min-width: 0;
|
|
85
|
+
display: block;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.optionSuffix-AJytXe {
|
|
89
|
+
white-space: nowrap;
|
|
90
|
+
flex: none;
|
|
91
|
+
margin-inline-start: 5px;
|
|
92
|
+
}
|
|
93
|
+
|