@jsenv/navi 0.26.12 → 0.26.14
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/jsenv_navi.js +288 -239
- package/dist/jsenv_navi.js.map +21 -17
- package/dist/jsenv_navi_side_effects.js +6 -0
- package/dist/jsenv_navi_side_effects.js.map +2 -2
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -8199,6 +8199,19 @@ installImportMetaCssBuild(import.meta);/**
|
|
|
8199
8199
|
* style can only be determined once the node is available.
|
|
8200
8200
|
*/
|
|
8201
8201
|
import.meta.css = [/* css */`
|
|
8202
|
+
@layer navi {
|
|
8203
|
+
/*
|
|
8204
|
+
When using square/circle/aspectRatio prop we expect box to respect the aspect ratio.
|
|
8205
|
+
But within flex containers or stuff like that the min-width/min-height auto
|
|
8206
|
+
will prevent the item from shrinking to respect aspect-ratio
|
|
8207
|
+
We put that in a layer navi + a specific attribute so that it's very easy to override this
|
|
8208
|
+
*/
|
|
8209
|
+
[navi-aspect-ratio] {
|
|
8210
|
+
min-width: 0;
|
|
8211
|
+
min-height: 0;
|
|
8212
|
+
}
|
|
8213
|
+
}
|
|
8214
|
+
|
|
8202
8215
|
[navi-box-flow="inline"] {
|
|
8203
8216
|
display: inline;
|
|
8204
8217
|
}
|
|
@@ -8694,12 +8707,14 @@ const Box = props => {
|
|
|
8694
8707
|
// Flatten nested arrays (e.g., from .map()) to treat each element as individual child
|
|
8695
8708
|
innerChildren = applySeparatorOnChildren(innerChildren, separator);
|
|
8696
8709
|
}
|
|
8710
|
+
const aspectRatio = rest.square || rest.circle ? "1/1" : rest.aspectRatio;
|
|
8697
8711
|
return jsx(TagName, {
|
|
8698
8712
|
ref: ref,
|
|
8699
8713
|
className: innerClassName,
|
|
8700
8714
|
"navi-box-flow": boxFlowIsDefault ? undefined : boxFlow,
|
|
8701
8715
|
"navi-box-flow-row": row ? "" : undefined,
|
|
8702
8716
|
"navi-box-flow-column": column ? "" : undefined,
|
|
8717
|
+
"navi-aspect-ratio": aspectRatio ? aspectRatio : undefined,
|
|
8703
8718
|
"data-visual-selector": visualSelector,
|
|
8704
8719
|
...selfForwardedProps,
|
|
8705
8720
|
children: jsx(BoxFlowContext.Provider, {
|
|
@@ -22562,11 +22577,6 @@ installImportMetaCssBuild(import.meta);const css$x = /* css */`
|
|
|
22562
22577
|
--button-border-radius: 2px;
|
|
22563
22578
|
--button-outline-width: 1px;
|
|
22564
22579
|
--button-border-width: 1px;
|
|
22565
|
-
/* Global padding defaults — override these to change all button paddings. */
|
|
22566
|
-
/* Use --button-padding, --button-padding-x, --button-padding-y for per-button overrides. */
|
|
22567
|
-
--button-padding-x-default: 6px;
|
|
22568
|
-
--button-padding-y-default: 1px;
|
|
22569
|
-
/* default */
|
|
22570
22580
|
|
|
22571
22581
|
--button-outline-color: var(--navi-focus-outline-color);
|
|
22572
22582
|
--button-loader-color: var(--navi-loader-color);
|
|
@@ -24858,23 +24868,24 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
24858
24868
|
|
|
24859
24869
|
position: relative;
|
|
24860
24870
|
display: inline-flex;
|
|
24861
|
-
box-sizing:
|
|
24871
|
+
box-sizing: border-box;
|
|
24872
|
+
width: var(--width);
|
|
24873
|
+
height: var(--height);
|
|
24862
24874
|
margin: var(--margin);
|
|
24863
|
-
|
|
24864
|
-
|
|
24865
|
-
|
|
24866
|
-
|
|
24867
|
-
|
|
24868
|
-
|
|
24869
|
-
|
|
24870
|
-
|
|
24871
|
-
|
|
24875
|
+
background-color: var(--x-background-color);
|
|
24876
|
+
border-width: var(--border-width);
|
|
24877
|
+
border-style: solid;
|
|
24878
|
+
border-color: var(--x-border-color);
|
|
24879
|
+
border-radius: var(--border-radius);
|
|
24880
|
+
outline-width: var(--outline-width);
|
|
24881
|
+
outline-style: none;
|
|
24882
|
+
outline-color: var(--outline-color);
|
|
24883
|
+
outline-offset: var(--outline-offset);
|
|
24872
24884
|
|
|
24873
24885
|
.navi_native_field {
|
|
24874
24886
|
position: absolute;
|
|
24875
24887
|
inset: 0;
|
|
24876
24888
|
margin: 0;
|
|
24877
|
-
padding: 0;
|
|
24878
24889
|
border: none;
|
|
24879
24890
|
border-radius: inherit;
|
|
24880
24891
|
opacity: 0;
|
|
@@ -24882,29 +24893,19 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
24882
24893
|
cursor: var(--x-cursor);
|
|
24883
24894
|
}
|
|
24884
24895
|
|
|
24885
|
-
.
|
|
24886
|
-
|
|
24887
|
-
|
|
24888
|
-
|
|
24889
|
-
|
|
24890
|
-
|
|
24891
|
-
border-width: var(--border-width);
|
|
24892
|
-
border-style: solid;
|
|
24893
|
-
border-color: var(--x-border-color);
|
|
24894
|
-
border-radius: var(--border-radius);
|
|
24895
|
-
outline-width: var(--outline-width);
|
|
24896
|
-
outline-style: none;
|
|
24897
|
-
outline-color: var(--outline-color);
|
|
24898
|
-
outline-offset: var(--outline-offset);
|
|
24896
|
+
.navi_checkbox_accent_probe {
|
|
24897
|
+
position: absolute;
|
|
24898
|
+
width: 0;
|
|
24899
|
+
height: 0;
|
|
24900
|
+
background-color: var(--accent-color);
|
|
24901
|
+
visibility: hidden;
|
|
24899
24902
|
pointer-events: none;
|
|
24900
24903
|
}
|
|
24901
24904
|
|
|
24902
24905
|
/* Focus */
|
|
24903
24906
|
&[data-focus-visible] {
|
|
24904
24907
|
z-index: 1;
|
|
24905
|
-
|
|
24906
|
-
outline-style: solid;
|
|
24907
|
-
}
|
|
24908
|
+
outline-style: solid;
|
|
24908
24909
|
}
|
|
24909
24910
|
/* Hover */
|
|
24910
24911
|
&[data-hover] {
|
|
@@ -24986,7 +24987,6 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
24986
24987
|
/* Toggle appearance */
|
|
24987
24988
|
&[data-appearance="toggle"] {
|
|
24988
24989
|
--margin: var(--toggle-margin);
|
|
24989
|
-
--padding: var(--toggle-padding);
|
|
24990
24990
|
--width: var(--toggle-width);
|
|
24991
24991
|
--height: unset;
|
|
24992
24992
|
--border-radius: var(--toggle-border-radius);
|
|
@@ -25005,25 +25005,19 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
25005
25005
|
--toggle-background-color-disabled-checked
|
|
25006
25006
|
);
|
|
25007
25007
|
|
|
25008
|
-
|
|
25009
|
-
|
|
25010
|
-
|
|
25011
|
-
|
|
25012
|
-
height: var(--height);
|
|
25013
|
-
padding: var(--padding);
|
|
25014
|
-
background-color: var(--x-background-color);
|
|
25015
|
-
border-color: transparent;
|
|
25016
|
-
user-select: none;
|
|
25008
|
+
position: relative;
|
|
25009
|
+
background-color: var(--x-background-color);
|
|
25010
|
+
border-color: transparent;
|
|
25011
|
+
user-select: none;
|
|
25017
25012
|
|
|
25018
|
-
|
|
25019
|
-
|
|
25020
|
-
|
|
25021
|
-
|
|
25022
|
-
|
|
25023
|
-
|
|
25024
|
-
|
|
25025
|
-
|
|
25026
|
-
}
|
|
25013
|
+
.navi_checkbox_toggle {
|
|
25014
|
+
width: var(--toggle-thumb-size);
|
|
25015
|
+
height: var(--toggle-thumb-size);
|
|
25016
|
+
border-radius: var(--toggle-thumb-border-radius);
|
|
25017
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
25018
|
+
fill: var(--toggle-thumb-color);
|
|
25019
|
+
transform: translateX(0);
|
|
25020
|
+
transition: transform 0.2s ease;
|
|
25027
25021
|
}
|
|
25028
25022
|
|
|
25029
25023
|
&[data-checked] {
|
|
@@ -25049,22 +25043,17 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
25049
25043
|
|
|
25050
25044
|
&[data-appearance="icon"] {
|
|
25051
25045
|
--margin: 0;
|
|
25052
|
-
--outline-offset: 0px;
|
|
25053
25046
|
--width: auto;
|
|
25054
25047
|
--height: auto;
|
|
25055
25048
|
|
|
25056
|
-
|
|
25057
|
-
|
|
25058
|
-
border: none;
|
|
25059
|
-
}
|
|
25049
|
+
background: none;
|
|
25050
|
+
border: none;
|
|
25060
25051
|
}
|
|
25061
25052
|
|
|
25062
25053
|
&[data-appearance="button"] {
|
|
25063
25054
|
--margin: 0;
|
|
25064
|
-
--outline-offset: 0px;
|
|
25065
25055
|
--width: auto;
|
|
25066
25056
|
--height: auto;
|
|
25067
|
-
--padding: 4px;
|
|
25068
25057
|
--border-color: var(--button-border-color);
|
|
25069
25058
|
--border-color-hover: var(--button-border-color-hover);
|
|
25070
25059
|
--background-color: var(--button-background-color);
|
|
@@ -25074,12 +25063,36 @@ installImportMetaCssBuild(import.meta);const css$p = /* css */`
|
|
|
25074
25063
|
--border-color-checked: var(--button-border-color);
|
|
25075
25064
|
--background-color-checked: var(--button-background-color);
|
|
25076
25065
|
|
|
25077
|
-
|
|
25078
|
-
|
|
25079
|
-
|
|
25080
|
-
|
|
25081
|
-
|
|
25082
|
-
|
|
25066
|
+
padding-top: var(
|
|
25067
|
+
--button-padding-top,
|
|
25068
|
+
var(
|
|
25069
|
+
--button-padding-y,
|
|
25070
|
+
var(--button-padding, var(--button-padding-y-default))
|
|
25071
|
+
)
|
|
25072
|
+
);
|
|
25073
|
+
padding-right: var(
|
|
25074
|
+
--button-padding-right,
|
|
25075
|
+
var(
|
|
25076
|
+
--button-padding-x,
|
|
25077
|
+
var(--button-padding, var(--button-padding-x-default))
|
|
25078
|
+
)
|
|
25079
|
+
);
|
|
25080
|
+
padding-bottom: var(
|
|
25081
|
+
--button-padding-bottom,
|
|
25082
|
+
var(
|
|
25083
|
+
--button-padding-y,
|
|
25084
|
+
var(--button-padding, var(--button-padding-y-default))
|
|
25085
|
+
)
|
|
25086
|
+
);
|
|
25087
|
+
padding-left: var(
|
|
25088
|
+
--button-padding-left,
|
|
25089
|
+
var(
|
|
25090
|
+
--button-padding-x,
|
|
25091
|
+
var(--button-padding, var(--button-padding-x-default))
|
|
25092
|
+
)
|
|
25093
|
+
);
|
|
25094
|
+
align-items: center;
|
|
25095
|
+
justify-content: center;
|
|
25083
25096
|
}
|
|
25084
25097
|
}
|
|
25085
25098
|
`;
|
|
@@ -25173,33 +25186,74 @@ const InputCheckboxUI = props => {
|
|
|
25173
25186
|
uiStateController.setUIState(checkboxIsChecked, e);
|
|
25174
25187
|
onInput?.(e);
|
|
25175
25188
|
});
|
|
25176
|
-
const renderCheckbox = checkboxProps =>
|
|
25177
|
-
|
|
25178
|
-
|
|
25179
|
-
|
|
25180
|
-
|
|
25181
|
-
|
|
25182
|
-
|
|
25183
|
-
|
|
25184
|
-
|
|
25185
|
-
|
|
25186
|
-
|
|
25187
|
-
|
|
25188
|
-
|
|
25189
|
-
|
|
25190
|
-
|
|
25191
|
-
|
|
25192
|
-
|
|
25193
|
-
|
|
25194
|
-
|
|
25195
|
-
|
|
25189
|
+
const renderCheckbox = checkboxProps => {
|
|
25190
|
+
return jsx(Box, {
|
|
25191
|
+
...checkboxProps,
|
|
25192
|
+
id: id,
|
|
25193
|
+
as: "input",
|
|
25194
|
+
ref: ref,
|
|
25195
|
+
type: "checkbox",
|
|
25196
|
+
name: innerName,
|
|
25197
|
+
checked: checked,
|
|
25198
|
+
required: innerRequired,
|
|
25199
|
+
baseClassName: "navi_native_field",
|
|
25200
|
+
"data-callout-arrow-x": "center",
|
|
25201
|
+
onClick: innerOnClick,
|
|
25202
|
+
onInput: innerOnInput,
|
|
25203
|
+
onresetuistate: e => {
|
|
25204
|
+
uiStateController.resetUIState(e);
|
|
25205
|
+
},
|
|
25206
|
+
onsetuistate: e => {
|
|
25207
|
+
uiStateController.setUIState(e.detail.value, e);
|
|
25208
|
+
}
|
|
25209
|
+
});
|
|
25210
|
+
};
|
|
25196
25211
|
const renderCheckboxMemoized = useCallback(renderCheckbox, [id, innerName, checked, innerRequired]);
|
|
25197
25212
|
const boxRef = useRef();
|
|
25198
25213
|
useAccentColorAttributes(boxRef, accentColor, {
|
|
25199
25214
|
elementSelector: ".navi_checkbox_accent_probe"
|
|
25200
25215
|
});
|
|
25216
|
+
let visualVnode;
|
|
25217
|
+
if (icon) {
|
|
25218
|
+
visualVnode = jsx("div", {
|
|
25219
|
+
className: "navi_checkbox_icon",
|
|
25220
|
+
"aria-hidden": "true",
|
|
25221
|
+
children: Array.isArray(icon) ? icon[checked ? 1 : 0] : icon
|
|
25222
|
+
});
|
|
25223
|
+
} else if (appearance === "toggle") {
|
|
25224
|
+
visualVnode = jsx(Box, {
|
|
25225
|
+
className: "navi_checkbox_toggle",
|
|
25226
|
+
as: "svg",
|
|
25227
|
+
viewBox: "0 0 12 12",
|
|
25228
|
+
"aria-hidden": "true",
|
|
25229
|
+
preventInitialTransition: true,
|
|
25230
|
+
children: jsx("circle", {
|
|
25231
|
+
cx: "6",
|
|
25232
|
+
cy: "6",
|
|
25233
|
+
r: "5"
|
|
25234
|
+
})
|
|
25235
|
+
});
|
|
25236
|
+
} else {
|
|
25237
|
+
visualVnode = jsx(Box, {
|
|
25238
|
+
className: "navi_checkbox_marker",
|
|
25239
|
+
as: "svg",
|
|
25240
|
+
viewBox: "0 0 12 12",
|
|
25241
|
+
"aria-hidden": "true",
|
|
25242
|
+
preventInitialTransition: true,
|
|
25243
|
+
children: jsx("path", {
|
|
25244
|
+
d: "M10.5 2L4.5 9L1.5 5.5",
|
|
25245
|
+
fill: "none",
|
|
25246
|
+
strokeWidth: "2"
|
|
25247
|
+
})
|
|
25248
|
+
});
|
|
25249
|
+
}
|
|
25201
25250
|
return jsxs(Box, {
|
|
25202
|
-
as: "span"
|
|
25251
|
+
as: "span"
|
|
25252
|
+
// Checkbox displayed as button are usually squarish
|
|
25253
|
+
// (passsing any custom width/height would auto disable aspectRatio forced by the square prop)
|
|
25254
|
+
,
|
|
25255
|
+
|
|
25256
|
+
square: appearance === "button" ? true : undefined,
|
|
25203
25257
|
...remainingProps,
|
|
25204
25258
|
autoFocus: undefined // See use_auto_focus.js
|
|
25205
25259
|
,
|
|
@@ -25228,36 +25282,7 @@ const InputCheckboxUI = props => {
|
|
|
25228
25282
|
inset: -1,
|
|
25229
25283
|
color: "var(--loader-color)",
|
|
25230
25284
|
targetSelector: ".navi_checkbox_field"
|
|
25231
|
-
}),
|
|
25232
|
-
className: "navi_checkbox_field",
|
|
25233
|
-
children: icon ? jsx("div", {
|
|
25234
|
-
className: "navi_checkbox_icon",
|
|
25235
|
-
"aria-hidden": "true",
|
|
25236
|
-
children: Array.isArray(icon) ? icon[checked ? 1 : 0] : icon
|
|
25237
|
-
}) : appearance === "toggle" ? jsx(Box, {
|
|
25238
|
-
className: "navi_checkbox_toggle",
|
|
25239
|
-
as: "svg",
|
|
25240
|
-
viewBox: "0 0 12 12",
|
|
25241
|
-
"aria-hidden": "true",
|
|
25242
|
-
preventInitialTransition: true,
|
|
25243
|
-
children: jsx("circle", {
|
|
25244
|
-
cx: "6",
|
|
25245
|
-
cy: "6",
|
|
25246
|
-
r: "5"
|
|
25247
|
-
})
|
|
25248
|
-
}) : jsx(Box, {
|
|
25249
|
-
className: "navi_checkbox_marker",
|
|
25250
|
-
as: "svg",
|
|
25251
|
-
viewBox: "0 0 12 12",
|
|
25252
|
-
"aria-hidden": "true",
|
|
25253
|
-
preventInitialTransition: true,
|
|
25254
|
-
children: jsx("path", {
|
|
25255
|
-
d: "M10.5 2L4.5 9L1.5 5.5",
|
|
25256
|
-
fill: "none",
|
|
25257
|
-
strokeWidth: "2"
|
|
25258
|
-
})
|
|
25259
|
-
})
|
|
25260
|
-
})]
|
|
25285
|
+
}), visualVnode, renderCheckboxMemoized]
|
|
25261
25286
|
});
|
|
25262
25287
|
};
|
|
25263
25288
|
const CheckboxStyleCSSVars = {
|
|
@@ -25288,17 +25313,18 @@ const CheckboxToggleStyleCSSVars = {
|
|
|
25288
25313
|
...CheckboxStyleCSSVars,
|
|
25289
25314
|
width: "--toggle-width",
|
|
25290
25315
|
height: "--toggle-height",
|
|
25291
|
-
borderRadius: "--border-radius"
|
|
25316
|
+
borderRadius: "--border-radius",
|
|
25317
|
+
padding: "--toggle-padding"
|
|
25292
25318
|
};
|
|
25293
25319
|
const CheckboxButtonStyleCSSVars = {
|
|
25294
25320
|
...CheckboxStyleCSSVars,
|
|
25295
|
-
|
|
25296
|
-
|
|
25297
|
-
|
|
25298
|
-
|
|
25299
|
-
|
|
25300
|
-
|
|
25301
|
-
|
|
25321
|
+
padding: "--button-padding",
|
|
25322
|
+
paddingX: "--button-padding-x",
|
|
25323
|
+
paddingY: "--button-padding-y",
|
|
25324
|
+
paddingTop: "--button-padding-top",
|
|
25325
|
+
paddingRight: "--button-padding-right",
|
|
25326
|
+
paddingBottom: "--button-padding-bottom",
|
|
25327
|
+
paddingLeft: "--button-padding-left"
|
|
25302
25328
|
};
|
|
25303
25329
|
const CheckboxPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":checked", ":-navi-loading"];
|
|
25304
25330
|
const CheckboxPseudoElements = ["::-navi-loader", "::-navi-checkmark"];
|
|
@@ -25604,8 +25630,14 @@ installImportMetaCssBuild(import.meta);const css$o = /* css */`
|
|
|
25604
25630
|
|
|
25605
25631
|
position: relative;
|
|
25606
25632
|
display: inline-flex;
|
|
25607
|
-
box-sizing:
|
|
25633
|
+
box-sizing: border-box;
|
|
25634
|
+
width: var(--x-width);
|
|
25635
|
+
height: var(--x-height);
|
|
25608
25636
|
margin: var(--margin);
|
|
25637
|
+
outline-width: var(--x-outline-width);
|
|
25638
|
+
outline-style: none;
|
|
25639
|
+
outline-color: var(--x-outline-color);
|
|
25640
|
+
outline-offset: var(--x-outline-offset);
|
|
25609
25641
|
|
|
25610
25642
|
.navi_radio_accent_probe {
|
|
25611
25643
|
position: absolute;
|
|
@@ -25631,9 +25663,7 @@ installImportMetaCssBuild(import.meta);const css$o = /* css */`
|
|
|
25631
25663
|
/* Focus */
|
|
25632
25664
|
&[data-focus-visible] {
|
|
25633
25665
|
z-index: 1;
|
|
25634
|
-
|
|
25635
|
-
outline-style: solid;
|
|
25636
|
-
}
|
|
25666
|
+
outline-style: solid;
|
|
25637
25667
|
}
|
|
25638
25668
|
/* Hover */
|
|
25639
25669
|
&[data-hover] {
|
|
@@ -25658,7 +25688,6 @@ installImportMetaCssBuild(import.meta);const css$o = /* css */`
|
|
|
25658
25688
|
.navi_radio_dashed_border {
|
|
25659
25689
|
display: none;
|
|
25660
25690
|
}
|
|
25661
|
-
|
|
25662
25691
|
&[data-checked] {
|
|
25663
25692
|
--x-background-color: var(--background-color-readonly-checked);
|
|
25664
25693
|
--x-border-color: var(--border-color-readonly-checked);
|
|
@@ -25689,45 +25718,32 @@ installImportMetaCssBuild(import.meta);const css$o = /* css */`
|
|
|
25689
25718
|
}
|
|
25690
25719
|
}
|
|
25691
25720
|
|
|
25692
|
-
.navi_radio_field {
|
|
25693
|
-
box-sizing: border-box;
|
|
25694
|
-
width: var(--x-width);
|
|
25695
|
-
height: var(--x-height);
|
|
25696
|
-
outline-width: var(--x-outline-width);
|
|
25697
|
-
outline-style: none;
|
|
25698
|
-
outline-color: var(--x-outline-color);
|
|
25699
|
-
outline-offset: var(--x-outline-offset);
|
|
25700
|
-
pointer-events: none;
|
|
25701
|
-
}
|
|
25702
|
-
|
|
25703
25721
|
/* Radio appearance */
|
|
25704
25722
|
&[data-appearance="radio"] {
|
|
25705
|
-
|
|
25706
|
-
|
|
25707
|
-
|
|
25708
|
-
|
|
25709
|
-
border-radius: 50%;
|
|
25723
|
+
display: inline-flex;
|
|
25724
|
+
align-items: center;
|
|
25725
|
+
justify-content: center;
|
|
25726
|
+
border-radius: 50%;
|
|
25710
25727
|
|
|
25711
|
-
|
|
25712
|
-
|
|
25713
|
-
|
|
25728
|
+
svg {
|
|
25729
|
+
overflow: visible;
|
|
25730
|
+
}
|
|
25714
25731
|
|
|
25715
|
-
|
|
25716
|
-
|
|
25717
|
-
|
|
25718
|
-
|
|
25719
|
-
|
|
25720
|
-
|
|
25721
|
-
|
|
25722
|
-
|
|
25723
|
-
|
|
25724
|
-
|
|
25725
|
-
|
|
25726
|
-
|
|
25727
|
-
|
|
25728
|
-
|
|
25729
|
-
|
|
25730
|
-
}
|
|
25732
|
+
.navi_radio_border {
|
|
25733
|
+
fill: var(--x-background-color);
|
|
25734
|
+
stroke: var(--x-border-color);
|
|
25735
|
+
}
|
|
25736
|
+
.navi_radio_dashed_border {
|
|
25737
|
+
display: none;
|
|
25738
|
+
}
|
|
25739
|
+
.navi_radio_marker {
|
|
25740
|
+
width: 100%;
|
|
25741
|
+
height: 100%;
|
|
25742
|
+
opacity: 0;
|
|
25743
|
+
fill: var(--x-radiomark-color);
|
|
25744
|
+
transform: scale(0.3);
|
|
25745
|
+
transform-origin: center;
|
|
25746
|
+
pointer-events: none;
|
|
25731
25747
|
}
|
|
25732
25748
|
|
|
25733
25749
|
&[data-transition] {
|
|
@@ -25764,7 +25780,6 @@ installImportMetaCssBuild(import.meta);const css$o = /* css */`
|
|
|
25764
25780
|
--outline-offset: 0px;
|
|
25765
25781
|
--width: auto;
|
|
25766
25782
|
--height: auto;
|
|
25767
|
-
--padding: 2px;
|
|
25768
25783
|
--border-color: var(--button-border-color);
|
|
25769
25784
|
--border-color-hover: var(--button-border-color-hover);
|
|
25770
25785
|
--background-color: var(--button-background-color);
|
|
@@ -25774,25 +25789,45 @@ installImportMetaCssBuild(import.meta);const css$o = /* css */`
|
|
|
25774
25789
|
--border-color-checked: var(--button-border-color);
|
|
25775
25790
|
--background-color-checked: var(--button-background-color);
|
|
25776
25791
|
|
|
25777
|
-
|
|
25778
|
-
|
|
25779
|
-
|
|
25780
|
-
|
|
25781
|
-
|
|
25782
|
-
|
|
25783
|
-
|
|
25784
|
-
|
|
25785
|
-
|
|
25786
|
-
|
|
25787
|
-
|
|
25788
|
-
|
|
25789
|
-
|
|
25790
|
-
|
|
25792
|
+
padding-top: var(
|
|
25793
|
+
--button-padding-top,
|
|
25794
|
+
var(
|
|
25795
|
+
--button-padding-y,
|
|
25796
|
+
var(--button-padding, var(--button-padding-y-default))
|
|
25797
|
+
)
|
|
25798
|
+
);
|
|
25799
|
+
padding-right: var(
|
|
25800
|
+
--button-padding-right,
|
|
25801
|
+
var(
|
|
25802
|
+
--button-padding-x,
|
|
25803
|
+
var(--button-padding, var(--button-padding-x-default))
|
|
25804
|
+
)
|
|
25805
|
+
);
|
|
25806
|
+
padding-bottom: var(
|
|
25807
|
+
--button-padding-bottom,
|
|
25808
|
+
var(
|
|
25809
|
+
--button-padding-y,
|
|
25810
|
+
var(--button-padding, var(--button-padding-y-default))
|
|
25811
|
+
)
|
|
25812
|
+
);
|
|
25813
|
+
padding-left: var(
|
|
25814
|
+
--button-padding-left,
|
|
25815
|
+
var(
|
|
25816
|
+
--button-padding-x,
|
|
25817
|
+
var(--button-padding, var(--button-padding-x-default))
|
|
25818
|
+
)
|
|
25819
|
+
);
|
|
25820
|
+
align-items: center;
|
|
25821
|
+
justify-content: center;
|
|
25822
|
+
background-color: var(--x-background-color);
|
|
25823
|
+
border-width: var(--button-border-width);
|
|
25824
|
+
border-style: solid;
|
|
25825
|
+
border-color: var(--x-border-color);
|
|
25826
|
+
border-radius: var(--button-border-radius);
|
|
25791
25827
|
|
|
25792
|
-
|
|
25793
|
-
|
|
25794
|
-
|
|
25795
|
-
}
|
|
25828
|
+
.navi_icon,
|
|
25829
|
+
img {
|
|
25830
|
+
border-radius: inherit;
|
|
25796
25831
|
}
|
|
25797
25832
|
|
|
25798
25833
|
&[data-hover] {
|
|
@@ -25803,11 +25838,9 @@ installImportMetaCssBuild(import.meta);const css$o = /* css */`
|
|
|
25803
25838
|
--x-border-color: var(--button-border-color-checked);
|
|
25804
25839
|
--x-background-color: var(--button-background-color-checked);
|
|
25805
25840
|
|
|
25806
|
-
|
|
25807
|
-
|
|
25808
|
-
|
|
25809
|
-
inset 0 0 0 1px var(--button-border-color-checked);
|
|
25810
|
-
}
|
|
25841
|
+
box-shadow:
|
|
25842
|
+
inset 0 2px 4px rgba(0, 0, 0, 0.15),
|
|
25843
|
+
inset 0 0 0 1px var(--button-border-color-checked);
|
|
25811
25844
|
}
|
|
25812
25845
|
&[data-disabled] {
|
|
25813
25846
|
--x-border-color: var(--button-border-color-disabled);
|
|
@@ -25934,33 +25967,70 @@ const InputRadioUI = props => {
|
|
|
25934
25967
|
}
|
|
25935
25968
|
onClick?.(e);
|
|
25936
25969
|
});
|
|
25937
|
-
const renderRadio = radioProps =>
|
|
25938
|
-
|
|
25939
|
-
|
|
25940
|
-
|
|
25941
|
-
|
|
25942
|
-
|
|
25943
|
-
|
|
25944
|
-
|
|
25945
|
-
|
|
25946
|
-
|
|
25947
|
-
|
|
25948
|
-
|
|
25949
|
-
|
|
25950
|
-
|
|
25951
|
-
|
|
25952
|
-
|
|
25953
|
-
|
|
25954
|
-
|
|
25955
|
-
|
|
25956
|
-
|
|
25970
|
+
const renderRadio = radioProps => {
|
|
25971
|
+
return jsx(Box, {
|
|
25972
|
+
...radioProps,
|
|
25973
|
+
as: "input",
|
|
25974
|
+
ref: ref,
|
|
25975
|
+
type: "radio",
|
|
25976
|
+
name: innerName,
|
|
25977
|
+
checked: checked,
|
|
25978
|
+
disabled: innerDisabled,
|
|
25979
|
+
required: innerRequired,
|
|
25980
|
+
baseClassName: "navi_native_field",
|
|
25981
|
+
"data-callout-arrow-x": "center",
|
|
25982
|
+
onClick: innerOnClick,
|
|
25983
|
+
onInput: innerOnInput,
|
|
25984
|
+
onresetuistate: e => {
|
|
25985
|
+
uiStateController.resetUIState(e);
|
|
25986
|
+
},
|
|
25987
|
+
onsetuistate: e => {
|
|
25988
|
+
uiStateController.setUIState(e.detail.value, e);
|
|
25989
|
+
}
|
|
25990
|
+
});
|
|
25991
|
+
};
|
|
25957
25992
|
const renderRadioMemoized = useCallback(renderRadio, [innerName, checked, innerRequired]);
|
|
25958
25993
|
const boxRef = useRef();
|
|
25959
25994
|
useAccentColorAttributes(boxRef, remainingProps.accentColor, {
|
|
25960
25995
|
elementSelector: ".navi_radio_accent_probe"
|
|
25961
25996
|
});
|
|
25997
|
+
let visualVNode;
|
|
25998
|
+
if (appearance === "radio") {
|
|
25999
|
+
visualVNode = jsxs("svg", {
|
|
26000
|
+
viewBox: "0 0 12 12",
|
|
26001
|
+
"aria-hidden": "true",
|
|
26002
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
26003
|
+
children: [jsx("circle", {
|
|
26004
|
+
className: "navi_radio_border",
|
|
26005
|
+
cx: "6",
|
|
26006
|
+
cy: "6",
|
|
26007
|
+
r: "5.5",
|
|
26008
|
+
strokeWidth: "1"
|
|
26009
|
+
}), jsx("circle", {
|
|
26010
|
+
className: "navi_radio_dashed_border",
|
|
26011
|
+
cx: "6",
|
|
26012
|
+
cy: "6",
|
|
26013
|
+
r: "5.5",
|
|
26014
|
+
strokeWidth: "1",
|
|
26015
|
+
strokeDasharray: "2.16 2.16",
|
|
26016
|
+
strokeDashoffset: "0"
|
|
26017
|
+
}), jsx("circle", {
|
|
26018
|
+
className: "navi_radio_marker",
|
|
26019
|
+
cx: "6",
|
|
26020
|
+
cy: "6",
|
|
26021
|
+
r: "3.5"
|
|
26022
|
+
})]
|
|
26023
|
+
});
|
|
26024
|
+
} else {
|
|
26025
|
+
visualVNode = icon;
|
|
26026
|
+
}
|
|
25962
26027
|
return jsxs(Box, {
|
|
25963
|
-
as: "span"
|
|
26028
|
+
as: "span"
|
|
26029
|
+
// Radio displayed as button are usually squarish
|
|
26030
|
+
// (passsing any custom width/height would auto disable aspectRatio forced by the square prop)
|
|
26031
|
+
,
|
|
26032
|
+
|
|
26033
|
+
square: appearance === "button" ? true : undefined,
|
|
25964
26034
|
...remainingProps,
|
|
25965
26035
|
autoFocus: undefined // See use_auto_focus.js
|
|
25966
26036
|
,
|
|
@@ -25988,35 +26058,8 @@ const InputRadioUI = props => {
|
|
|
25988
26058
|
inset: -1,
|
|
25989
26059
|
targetSelector: ".navi_radio_field",
|
|
25990
26060
|
color: "var(--loader-color)",
|
|
25991
|
-
borderRadius: "50%"
|
|
25992
|
-
}),
|
|
25993
|
-
className: "navi_radio_field",
|
|
25994
|
-
children: appearance === "radio" ? jsxs("svg", {
|
|
25995
|
-
viewBox: "0 0 12 12",
|
|
25996
|
-
"aria-hidden": "true",
|
|
25997
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
25998
|
-
children: [jsx("circle", {
|
|
25999
|
-
className: "navi_radio_border",
|
|
26000
|
-
cx: "6",
|
|
26001
|
-
cy: "6",
|
|
26002
|
-
r: "5.5",
|
|
26003
|
-
strokeWidth: "1"
|
|
26004
|
-
}), jsx("circle", {
|
|
26005
|
-
className: "navi_radio_dashed_border",
|
|
26006
|
-
cx: "6",
|
|
26007
|
-
cy: "6",
|
|
26008
|
-
r: "5.5",
|
|
26009
|
-
strokeWidth: "1",
|
|
26010
|
-
strokeDasharray: "2.16 2.16",
|
|
26011
|
-
strokeDashoffset: "0"
|
|
26012
|
-
}), jsx("circle", {
|
|
26013
|
-
className: "navi_radio_marker",
|
|
26014
|
-
cx: "6",
|
|
26015
|
-
cy: "6",
|
|
26016
|
-
r: "3.5"
|
|
26017
|
-
})]
|
|
26018
|
-
}) : icon
|
|
26019
|
-
})]
|
|
26061
|
+
borderRadius: appearance === "radio" ? "50%" : "inherit"
|
|
26062
|
+
}), visualVNode, renderRadioMemoized]
|
|
26020
26063
|
});
|
|
26021
26064
|
};
|
|
26022
26065
|
const RadioStyleCSSVars = {
|
|
@@ -26046,7 +26089,13 @@ const RadioStyleCSSVars = {
|
|
|
26046
26089
|
};
|
|
26047
26090
|
const RadioButtonStyleCSSVars = {
|
|
26048
26091
|
...RadioStyleCSSVars,
|
|
26049
|
-
"padding": "--padding",
|
|
26092
|
+
"padding": "--button-padding",
|
|
26093
|
+
"paddingX": "--button-padding-x",
|
|
26094
|
+
"paddingY": "--button-padding-y",
|
|
26095
|
+
"paddingTop": "--button-padding-top",
|
|
26096
|
+
"paddingRight": "--button-padding-right",
|
|
26097
|
+
"paddingBottom": "--button-padding-bottom",
|
|
26098
|
+
"paddingLeft": "--button-padding-left",
|
|
26050
26099
|
"borderRadius": "--button-border-radius",
|
|
26051
26100
|
"borderWidth": "--button-border-width",
|
|
26052
26101
|
"borderColor": "--button-border-color",
|