@jsenv/navi 0.14.33 → 0.15.2
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 +356 -231
- package/dist/jsenv_navi.js.map +37 -38
- package/package.json +1 -1
package/dist/jsenv_navi.js
CHANGED
|
@@ -4887,6 +4887,7 @@ const POSITION_PROPS = {
|
|
|
4887
4887
|
bottom: PASS_THROUGH,
|
|
4888
4888
|
right: PASS_THROUGH,
|
|
4889
4889
|
|
|
4890
|
+
transform: PASS_THROUGH,
|
|
4890
4891
|
translateX: (value) => {
|
|
4891
4892
|
return { transform: `translateX(${value})` };
|
|
4892
4893
|
},
|
|
@@ -4973,6 +4974,7 @@ const VISUAL_PROPS = {
|
|
|
4973
4974
|
overflow: PASS_THROUGH,
|
|
4974
4975
|
overflowX: PASS_THROUGH,
|
|
4975
4976
|
overflowY: PASS_THROUGH,
|
|
4977
|
+
accentColor: PASS_THROUGH,
|
|
4976
4978
|
};
|
|
4977
4979
|
const CONTENT_PROPS = {
|
|
4978
4980
|
align: applyOnTwoProps("alignX", "alignY"),
|
|
@@ -5067,6 +5069,7 @@ const getVisualChildStylePropStrategy = (name) => {
|
|
|
5067
5069
|
};
|
|
5068
5070
|
|
|
5069
5071
|
const isStyleProp = (name) => STYLE_PROP_NAME_SET.has(name);
|
|
5072
|
+
const isCSSVar = (name) => name.startsWith("--");
|
|
5070
5073
|
|
|
5071
5074
|
const getStylePropGroup = (name) => {
|
|
5072
5075
|
if (FLOW_PROP_NAME_SET.has(name)) {
|
|
@@ -5322,11 +5325,52 @@ const PSEUDO_CLASSES = {
|
|
|
5322
5325
|
":hover": {
|
|
5323
5326
|
attribute: "data-hover",
|
|
5324
5327
|
setup: (el, callback) => {
|
|
5325
|
-
|
|
5326
|
-
|
|
5328
|
+
let onmouseenter = () => {
|
|
5329
|
+
callback();
|
|
5330
|
+
};
|
|
5331
|
+
let onmouseleave = () => {
|
|
5332
|
+
callback();
|
|
5333
|
+
};
|
|
5334
|
+
|
|
5335
|
+
if (el.tagName === "LABEL") {
|
|
5336
|
+
// input.matches(":hover") is true when hovering the label
|
|
5337
|
+
// so when label is hovered/not hovered we need to recheck the input too
|
|
5338
|
+
const recheckInput = () => {
|
|
5339
|
+
if (el.htmlFor) {
|
|
5340
|
+
const input = document.getElementById(el.htmlFor);
|
|
5341
|
+
if (!input) {
|
|
5342
|
+
// cannot find the input for this label in the DOM
|
|
5343
|
+
return;
|
|
5344
|
+
}
|
|
5345
|
+
input.dispatchEvent(
|
|
5346
|
+
new CustomEvent(NAVI_CHECK_PSEUDO_STATE_CUSTOM_EVENT),
|
|
5347
|
+
);
|
|
5348
|
+
return;
|
|
5349
|
+
}
|
|
5350
|
+
const input = el.querySelector("input, textarea, select");
|
|
5351
|
+
if (!input) {
|
|
5352
|
+
// label does not contain an input
|
|
5353
|
+
return;
|
|
5354
|
+
}
|
|
5355
|
+
input.dispatchEvent(
|
|
5356
|
+
new CustomEvent(NAVI_CHECK_PSEUDO_STATE_CUSTOM_EVENT),
|
|
5357
|
+
);
|
|
5358
|
+
};
|
|
5359
|
+
onmouseenter = () => {
|
|
5360
|
+
callback();
|
|
5361
|
+
recheckInput();
|
|
5362
|
+
};
|
|
5363
|
+
onmouseleave = () => {
|
|
5364
|
+
callback();
|
|
5365
|
+
recheckInput();
|
|
5366
|
+
};
|
|
5367
|
+
}
|
|
5368
|
+
|
|
5369
|
+
el.addEventListener("mouseenter", onmouseenter);
|
|
5370
|
+
el.addEventListener("mouseleave", onmouseleave);
|
|
5327
5371
|
return () => {
|
|
5328
|
-
el.removeEventListener("mouseenter",
|
|
5329
|
-
el.removeEventListener("mouseleave",
|
|
5372
|
+
el.removeEventListener("mouseenter", onmouseenter);
|
|
5373
|
+
el.removeEventListener("mouseleave", onmouseleave);
|
|
5330
5374
|
};
|
|
5331
5375
|
},
|
|
5332
5376
|
test: (el) => el.matches(":hover"),
|
|
@@ -5528,6 +5572,7 @@ const PSEUDO_CLASSES = {
|
|
|
5528
5572
|
};
|
|
5529
5573
|
|
|
5530
5574
|
const NAVI_PSEUDO_STATE_CUSTOM_EVENT = "navi_pseudo_state";
|
|
5575
|
+
const NAVI_CHECK_PSEUDO_STATE_CUSTOM_EVENT = "navi_check_pseudo_state";
|
|
5531
5576
|
const dispatchNaviPseudoStateEvent = (element, value, oldValue) => {
|
|
5532
5577
|
if (!element) {
|
|
5533
5578
|
return;
|
|
@@ -5632,6 +5677,9 @@ const initPseudoStyles = (
|
|
|
5632
5677
|
state = event.detail.pseudoState;
|
|
5633
5678
|
onStateChange(state, oldState);
|
|
5634
5679
|
});
|
|
5680
|
+
element.addEventListener(NAVI_CHECK_PSEUDO_STATE_CUSTOM_EVENT, () => {
|
|
5681
|
+
checkPseudoClasses();
|
|
5682
|
+
});
|
|
5635
5683
|
|
|
5636
5684
|
for (const pseudoClass of pseudoClasses) {
|
|
5637
5685
|
const pseudoClassDefinition = PSEUDO_CLASSES[pseudoClass];
|
|
@@ -5651,7 +5699,7 @@ const initPseudoStyles = (
|
|
|
5651
5699
|
// just in case + catch use forcing them in chrome devtools
|
|
5652
5700
|
const interval = setInterval(() => {
|
|
5653
5701
|
checkPseudoClasses();
|
|
5654
|
-
},
|
|
5702
|
+
}, 1_000);
|
|
5655
5703
|
addTeardown(() => {
|
|
5656
5704
|
clearInterval(interval);
|
|
5657
5705
|
});
|
|
@@ -5825,7 +5873,6 @@ const Box = props => {
|
|
|
5825
5873
|
// for demo purposes it's possible to control pseudo state from props
|
|
5826
5874
|
pseudoClasses = PSEUDO_CLASSES_DEFAULT,
|
|
5827
5875
|
pseudoElements = PSEUDO_ELEMENTS_DEFAULT,
|
|
5828
|
-
pseudoStyle,
|
|
5829
5876
|
// visualSelector convey the following:
|
|
5830
5877
|
// The box itself is visually "invisible", one of its descendant is responsible for visual representation
|
|
5831
5878
|
// - Some styles will be used on the box itself (for instance margins)
|
|
@@ -5946,7 +5993,7 @@ const Box = props => {
|
|
|
5946
5993
|
let boxPseudoNamedStyles = PSEUDO_NAMED_STYLES_DEFAULT;
|
|
5947
5994
|
const shouldForwardAllToChild = visualSelector && pseudoStateSelector;
|
|
5948
5995
|
const addStyle = (value, name, styleContext, stylesTarget, context) => {
|
|
5949
|
-
styleDeps.push(value); // impact box style -> add to deps
|
|
5996
|
+
styleDeps.push(name, value); // impact box style -> add to deps
|
|
5950
5997
|
const cssVar = styleContext.styleCSSVars[name];
|
|
5951
5998
|
const mergedValue = prepareStyleValue(stylesTarget[name], value, name, styleContext, context);
|
|
5952
5999
|
if (cssVar) {
|
|
@@ -5973,37 +6020,79 @@ const Box = props => {
|
|
|
5973
6020
|
}
|
|
5974
6021
|
return true;
|
|
5975
6022
|
};
|
|
6023
|
+
|
|
6024
|
+
// By default ":hover", ":active" are not tracked.
|
|
6025
|
+
// But if code explicitely do something like:
|
|
6026
|
+
// style={{ ":hover": { backgroundColor: "red" } }}
|
|
6027
|
+
// then we'll track ":hover" state changes even for basic elements like <div>
|
|
6028
|
+
const pseudoClassesFromStyleSet = new Set();
|
|
6029
|
+
boxPseudoNamedStyles = {};
|
|
5976
6030
|
const assignStyle = (value, name, styleContext, boxStylesTarget, styleOrigin) => {
|
|
6031
|
+
const isPseudoElement = name.startsWith("::");
|
|
6032
|
+
const isPseudoClass = name.startsWith(":");
|
|
6033
|
+
if (isPseudoElement || isPseudoClass) {
|
|
6034
|
+
styleDeps.push(name);
|
|
6035
|
+
pseudoClassesFromStyleSet.add(name);
|
|
6036
|
+
const pseudoStyleContext = {
|
|
6037
|
+
...styleContext,
|
|
6038
|
+
styleCSSVars: {
|
|
6039
|
+
...styleCSSVars,
|
|
6040
|
+
...styleCSSVars[name]
|
|
6041
|
+
},
|
|
6042
|
+
pseudoName: name
|
|
6043
|
+
};
|
|
6044
|
+
const pseudoStyleKeys = Object.keys(value);
|
|
6045
|
+
if (isPseudoElement) {
|
|
6046
|
+
const pseudoElementStyles = {};
|
|
6047
|
+
for (const key of pseudoStyleKeys) {
|
|
6048
|
+
assignStyle(value[key], key, pseudoStyleContext, pseudoElementStyles, "pseudo_style");
|
|
6049
|
+
}
|
|
6050
|
+
boxPseudoNamedStyles[name] = pseudoElementStyles;
|
|
6051
|
+
return;
|
|
6052
|
+
}
|
|
6053
|
+
const pseudoClassStyles = {};
|
|
6054
|
+
for (const key of pseudoStyleKeys) {
|
|
6055
|
+
assignStyle(value[key], key, pseudoStyleContext, pseudoClassStyles, "pseudo_style");
|
|
6056
|
+
boxPseudoNamedStyles[name] = pseudoClassStyles;
|
|
6057
|
+
}
|
|
6058
|
+
return;
|
|
6059
|
+
}
|
|
5977
6060
|
const context = styleOrigin === "base_style" ? "js" : "css";
|
|
5978
6061
|
const isCss = styleOrigin === "base_style" || styleOrigin === "style";
|
|
5979
6062
|
if (isCss) {
|
|
5980
6063
|
addStyle(value, name, styleContext, boxStylesTarget, context);
|
|
5981
6064
|
return;
|
|
5982
6065
|
}
|
|
6066
|
+
if (isCSSVar(name)) {
|
|
6067
|
+
addStyle(value, name, styleContext, boxStylesTarget, context);
|
|
6068
|
+
return;
|
|
6069
|
+
}
|
|
5983
6070
|
const isPseudoStyle = styleOrigin === "pseudo_style";
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
//
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
6071
|
+
if (isStyleProp(name)) {
|
|
6072
|
+
// it's a style prop, we need first to check if we have css var to handle them
|
|
6073
|
+
// otherwise we decide to put it either on self or child
|
|
6074
|
+
const visualChildPropStrategy = visualSelector && getVisualChildStylePropStrategy(name);
|
|
6075
|
+
const getStyle = getHowToHandleStyleProp(name);
|
|
6076
|
+
if (
|
|
6077
|
+
// prop name === css style name
|
|
6078
|
+
!getStyle) {
|
|
6079
|
+
const needForwarding = addStyleMaybeForwarding(value, name, styleContext, boxStylesTarget, context, visualChildPropStrategy);
|
|
6080
|
+
if (needForwarding) {
|
|
6081
|
+
if (isPseudoStyle) ; else {
|
|
6082
|
+
childForwardedProps[name] = value;
|
|
6083
|
+
}
|
|
5994
6084
|
}
|
|
5995
|
-
|
|
6085
|
+
return;
|
|
6086
|
+
}
|
|
6087
|
+
const cssValues = getStyle(value, styleContext);
|
|
6088
|
+
if (!cssValues) {
|
|
6089
|
+
return;
|
|
6090
|
+
}
|
|
6091
|
+
let needForwarding = false;
|
|
6092
|
+
for (const styleName of Object.keys(cssValues)) {
|
|
6093
|
+
const cssValue = cssValues[styleName];
|
|
6094
|
+
needForwarding = addStyleMaybeForwarding(cssValue, styleName, styleContext, boxStylesTarget, context, visualChildPropStrategy);
|
|
5996
6095
|
}
|
|
5997
|
-
return;
|
|
5998
|
-
}
|
|
5999
|
-
// it's a style prop, we need first to check if we have css var to handle them
|
|
6000
|
-
// otherwise we decide to put it either on self or child
|
|
6001
|
-
const visualChildPropStrategy = visualSelector && getVisualChildStylePropStrategy(name);
|
|
6002
|
-
const getStyle = getHowToHandleStyleProp(name);
|
|
6003
|
-
if (
|
|
6004
|
-
// prop name === css style name
|
|
6005
|
-
!getStyle) {
|
|
6006
|
-
const needForwarding = addStyleMaybeForwarding(value, name, styleContext, boxStylesTarget, context, visualChildPropStrategy);
|
|
6007
6096
|
if (needForwarding) {
|
|
6008
6097
|
if (isPseudoStyle) ; else {
|
|
6009
6098
|
childForwardedProps[name] = value;
|
|
@@ -6011,20 +6100,18 @@ const Box = props => {
|
|
|
6011
6100
|
}
|
|
6012
6101
|
return;
|
|
6013
6102
|
}
|
|
6014
|
-
|
|
6015
|
-
if (
|
|
6016
|
-
return;
|
|
6017
|
-
}
|
|
6018
|
-
let needForwarding = false;
|
|
6019
|
-
for (const styleName of Object.keys(cssValues)) {
|
|
6020
|
-
const cssValue = cssValues[styleName];
|
|
6021
|
-
needForwarding = addStyleMaybeForwarding(cssValue, styleName, styleContext, boxStylesTarget, context, visualChildPropStrategy);
|
|
6022
|
-
}
|
|
6023
|
-
if (needForwarding) {
|
|
6103
|
+
// not a style prop what do we do with it?
|
|
6104
|
+
if (shouldForwardAllToChild) {
|
|
6024
6105
|
if (isPseudoStyle) ; else {
|
|
6025
6106
|
childForwardedProps[name] = value;
|
|
6026
6107
|
}
|
|
6108
|
+
} else {
|
|
6109
|
+
if (isPseudoStyle) {
|
|
6110
|
+
console.warn(`unsupported pseudo style key "${name}"`);
|
|
6111
|
+
}
|
|
6112
|
+
selfForwardedProps[name] = value;
|
|
6027
6113
|
}
|
|
6114
|
+
return;
|
|
6028
6115
|
};
|
|
6029
6116
|
if (baseStyle) {
|
|
6030
6117
|
for (const key of baseStyle) {
|
|
@@ -6042,52 +6129,6 @@ const Box = props => {
|
|
|
6042
6129
|
const propValue = rest[propName];
|
|
6043
6130
|
assignStyle(propValue, propName, styleContext, boxStyles, "prop");
|
|
6044
6131
|
}
|
|
6045
|
-
if (pseudoStyle) {
|
|
6046
|
-
const assignPseudoStyle = (propValue, propName, pseudoStyleContext, pseudoStylesTarget) => {
|
|
6047
|
-
assignStyle(propValue, propName, pseudoStyleContext, pseudoStylesTarget, "pseudo_style");
|
|
6048
|
-
};
|
|
6049
|
-
const pseudoStyleKeys = Object.keys(pseudoStyle);
|
|
6050
|
-
if (pseudoStyleKeys.length) {
|
|
6051
|
-
boxPseudoNamedStyles = {};
|
|
6052
|
-
for (const key of pseudoStyleKeys) {
|
|
6053
|
-
const pseudoStyleContext = {
|
|
6054
|
-
...styleContext,
|
|
6055
|
-
styleCSSVars: {
|
|
6056
|
-
...styleCSSVars,
|
|
6057
|
-
...styleCSSVars[key]
|
|
6058
|
-
},
|
|
6059
|
-
pseudoName: key
|
|
6060
|
-
};
|
|
6061
|
-
|
|
6062
|
-
// pseudo class
|
|
6063
|
-
if (key.startsWith(":")) {
|
|
6064
|
-
styleDeps.push(key);
|
|
6065
|
-
const pseudoClassStyles = {};
|
|
6066
|
-
const pseudoClassStyle = pseudoStyle[key];
|
|
6067
|
-
for (const pseudoClassStyleKey of Object.keys(pseudoClassStyle)) {
|
|
6068
|
-
const pseudoClassStyleValue = pseudoClassStyle[pseudoClassStyleKey];
|
|
6069
|
-
assignPseudoStyle(pseudoClassStyleValue, pseudoClassStyleKey, pseudoStyleContext, pseudoClassStyles);
|
|
6070
|
-
}
|
|
6071
|
-
boxPseudoNamedStyles[key] = pseudoClassStyles;
|
|
6072
|
-
continue;
|
|
6073
|
-
}
|
|
6074
|
-
// pseudo element
|
|
6075
|
-
if (key.startsWith("::")) {
|
|
6076
|
-
styleDeps.push(key);
|
|
6077
|
-
const pseudoElementStyles = {};
|
|
6078
|
-
const pseudoElementStyle = pseudoStyle[key];
|
|
6079
|
-
for (const pseudoElementStyleKey of Object.keys(pseudoElementStyle)) {
|
|
6080
|
-
const pseudoElementStyleValue = pseudoElementStyle[pseudoElementStyleKey];
|
|
6081
|
-
assignPseudoStyle(pseudoElementStyleValue, pseudoElementStyleKey, pseudoStyleContext, pseudoElementStyles);
|
|
6082
|
-
}
|
|
6083
|
-
boxPseudoNamedStyles[key] = pseudoElementStyles;
|
|
6084
|
-
continue;
|
|
6085
|
-
}
|
|
6086
|
-
console.warn(`unsupported pseudo style key "${key}"`);
|
|
6087
|
-
}
|
|
6088
|
-
}
|
|
6089
|
-
childForwardedProps.pseudoStyle = pseudoStyle;
|
|
6090
|
-
}
|
|
6091
6132
|
if (typeof style === "string") {
|
|
6092
6133
|
const styleObject = normalizeStyles(style, "css");
|
|
6093
6134
|
for (const styleName of Object.keys(styleObject)) {
|
|
@@ -6105,21 +6146,15 @@ const Box = props => {
|
|
|
6105
6146
|
applyStyle(boxEl, boxStyles, state, boxPseudoNamedStyles, preventInitialTransition);
|
|
6106
6147
|
}, styleDeps);
|
|
6107
6148
|
const finalStyleDeps = [pseudoStateSelector, innerPseudoState, updateStyle];
|
|
6108
|
-
// By default ":hover", ":active" are not tracked.
|
|
6109
|
-
// But is code explicitely do something like:
|
|
6110
|
-
// pseudoStyle={{ ":hover": { backgroundColor: "red" } }}
|
|
6111
|
-
// then we'll track ":hover" state changes even for basic elements like <div>
|
|
6112
6149
|
let innerPseudoClasses;
|
|
6113
|
-
if (
|
|
6150
|
+
if (pseudoClassesFromStyleSet.size) {
|
|
6114
6151
|
innerPseudoClasses = [...pseudoClasses];
|
|
6115
6152
|
if (pseudoClasses !== PSEUDO_CLASSES_DEFAULT) {
|
|
6116
6153
|
finalStyleDeps.push(...pseudoClasses);
|
|
6117
6154
|
}
|
|
6118
|
-
for (const key of
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
finalStyleDeps.push(key);
|
|
6122
|
-
}
|
|
6155
|
+
for (const key of pseudoClassesFromStyleSet) {
|
|
6156
|
+
innerPseudoClasses.push(key);
|
|
6157
|
+
finalStyleDeps.push(key);
|
|
6123
6158
|
}
|
|
6124
6159
|
} else {
|
|
6125
6160
|
innerPseudoClasses = pseudoClasses;
|
|
@@ -15737,8 +15772,9 @@ const useUIStateController = (
|
|
|
15737
15772
|
if (hasStateProp) {
|
|
15738
15773
|
uiStateController.hasStateProp = true;
|
|
15739
15774
|
const currentState = uiStateController.state;
|
|
15740
|
-
|
|
15741
|
-
|
|
15775
|
+
const stateFromProp = getStateFromProp(state);
|
|
15776
|
+
if (stateFromProp !== currentState) {
|
|
15777
|
+
uiStateController.state = stateFromProp;
|
|
15742
15778
|
uiStateController.setUIState(
|
|
15743
15779
|
uiStateController.getPropFromState(state),
|
|
15744
15780
|
new CustomEvent("state_prop"),
|
|
@@ -16063,6 +16099,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16063
16099
|
--button-outline-width: 1px;
|
|
16064
16100
|
--button-border-width: 1px;
|
|
16065
16101
|
--button-border-radius: 2px;
|
|
16102
|
+
--button-padding-x: 6px;
|
|
16103
|
+
--button-padding-y: 1px;
|
|
16066
16104
|
/* default */
|
|
16067
16105
|
--button-outline-color: var(--navi-focus-outline-color);
|
|
16068
16106
|
--button-loader-color: var(--navi-loader-color);
|
|
@@ -16117,10 +16155,11 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16117
16155
|
--x-button-border-radius: var(--button-border-radius);
|
|
16118
16156
|
--x-button-border-width: var(--button-border-width);
|
|
16119
16157
|
--x-button-outer-width: calc(
|
|
16120
|
-
var(--button-
|
|
16158
|
+
var(--x-button-border-width) + var(--x-button-outline-width)
|
|
16121
16159
|
);
|
|
16122
16160
|
--x-button-outline-color: var(--button-outline-color);
|
|
16123
16161
|
--x-button-border-color: var(--button-border-color);
|
|
16162
|
+
--x-button-background: var(--button-background);
|
|
16124
16163
|
--x-button-background-color: var(--button-background-color);
|
|
16125
16164
|
--x-button-color: var(--button-color);
|
|
16126
16165
|
--x-button-cursor: var(--button-cursor);
|
|
@@ -16149,24 +16188,29 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16149
16188
|
height: 100%;
|
|
16150
16189
|
padding-top: var(
|
|
16151
16190
|
--button-padding-top,
|
|
16152
|
-
var(--button-padding-y, var(--button-padding
|
|
16191
|
+
var(--button-padding-y, var(--button-padding))
|
|
16153
16192
|
);
|
|
16154
16193
|
padding-right: var(
|
|
16155
16194
|
--button-padding-right,
|
|
16156
|
-
var(--button-padding-x, var(--button-padding
|
|
16195
|
+
var(--button-padding-x, var(--button-padding))
|
|
16157
16196
|
);
|
|
16158
16197
|
padding-bottom: var(
|
|
16159
16198
|
--button-padding-bottom,
|
|
16160
|
-
var(--button-padding-y, var(--button-padding
|
|
16199
|
+
var(--button-padding-y, var(--button-padding))
|
|
16161
16200
|
);
|
|
16162
16201
|
padding-left: var(
|
|
16163
16202
|
--button-padding-left,
|
|
16164
|
-
var(--button-padding-x, var(--button-padding
|
|
16203
|
+
var(--button-padding-x, var(--button-padding))
|
|
16165
16204
|
);
|
|
16166
16205
|
align-items: inherit;
|
|
16167
16206
|
justify-content: inherit;
|
|
16168
16207
|
color: var(--x-button-color);
|
|
16169
|
-
background
|
|
16208
|
+
background: var(--x-button-background);
|
|
16209
|
+
background-color: var(
|
|
16210
|
+
--x-button-background-color,
|
|
16211
|
+
var(--x-button-background)
|
|
16212
|
+
);
|
|
16213
|
+
|
|
16170
16214
|
border-width: var(--x-button-outer-width);
|
|
16171
16215
|
border-style: solid;
|
|
16172
16216
|
border-color: transparent;
|
|
@@ -16290,12 +16334,17 @@ const ButtonStyleCSSVars = {
|
|
|
16290
16334
|
"outlineWidth": "--button-outline-width",
|
|
16291
16335
|
"borderWidth": "--button-border-width",
|
|
16292
16336
|
"borderRadius": "--button-border-radius",
|
|
16337
|
+
"border": "--button-border",
|
|
16338
|
+
"padding": "--button-padding",
|
|
16339
|
+
"paddingX": "--button-padding-x",
|
|
16340
|
+
"paddingY": "--button-padding-y",
|
|
16293
16341
|
"paddingTop": "--button-padding-top",
|
|
16294
16342
|
"paddingRight": "--button-padding-right",
|
|
16295
16343
|
"paddingBottom": "--button-padding-bottom",
|
|
16296
16344
|
"paddingLeft": "--button-padding-left",
|
|
16297
|
-
"backgroundColor": "--button-background-color",
|
|
16298
16345
|
"borderColor": "--button-border-color",
|
|
16346
|
+
"background": "--button-background",
|
|
16347
|
+
"backgroundColor": "--button-background-color",
|
|
16299
16348
|
"color": "--button-color",
|
|
16300
16349
|
":hover": {
|
|
16301
16350
|
backgroundColor: "--button-background-color-hover",
|
|
@@ -16631,7 +16680,7 @@ const MessageBox = ({
|
|
|
16631
16680
|
border: "none",
|
|
16632
16681
|
alignX: "center",
|
|
16633
16682
|
alignY: "center",
|
|
16634
|
-
|
|
16683
|
+
style: {
|
|
16635
16684
|
":hover": {
|
|
16636
16685
|
backgroundColor: "rgba(0, 0, 0, 0.1)"
|
|
16637
16686
|
}
|
|
@@ -16810,6 +16859,10 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16810
16859
|
&[data-focus-visible] {
|
|
16811
16860
|
opacity: 1;
|
|
16812
16861
|
}
|
|
16862
|
+
|
|
16863
|
+
.navi_icon {
|
|
16864
|
+
vertical-align: top;
|
|
16865
|
+
}
|
|
16813
16866
|
}
|
|
16814
16867
|
}
|
|
16815
16868
|
|
|
@@ -17660,22 +17713,25 @@ const Label = props => {
|
|
|
17660
17713
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
17661
17714
|
@layer navi {
|
|
17662
17715
|
.navi_checkbox {
|
|
17716
|
+
--margin: 3px 3px 3px 4px;
|
|
17663
17717
|
--outline-offset: 1px;
|
|
17664
17718
|
--outline-width: 2px;
|
|
17665
17719
|
--border-width: 1px;
|
|
17666
17720
|
--border-radius: 2px;
|
|
17667
|
-
--width:
|
|
17668
|
-
--height:
|
|
17721
|
+
--width: 0.815em;
|
|
17722
|
+
--height: 0.815em;
|
|
17669
17723
|
|
|
17670
17724
|
--outline-color: var(--navi-focus-outline-color);
|
|
17671
17725
|
--loader-color: var(--navi-loader-color);
|
|
17672
17726
|
--border-color: light-dark(#767676, #8e8e93);
|
|
17673
17727
|
--background-color: white;
|
|
17674
|
-
--
|
|
17675
|
-
--
|
|
17728
|
+
--accent-color: light-dark(#4476ff, #3b82f6);
|
|
17729
|
+
--background-color-checked: var(--accent-color);
|
|
17730
|
+
--border-color-checked: var(--accent-color);
|
|
17676
17731
|
--checkmark-color-light: white;
|
|
17677
17732
|
--checkmark-color-dark: rgb(55, 55, 55);
|
|
17678
17733
|
--checkmark-color: var(--checkmark-color-light);
|
|
17734
|
+
--cursor: pointer;
|
|
17679
17735
|
|
|
17680
17736
|
--color-mix-light: black;
|
|
17681
17737
|
--color-mix-dark: white;
|
|
@@ -17710,30 +17766,83 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17710
17766
|
--border-color-disabled-checked: #d3d3d3;
|
|
17711
17767
|
--background-color-disabled-checked: #d3d3d3;
|
|
17712
17768
|
|
|
17769
|
+
/* Toggle specific */
|
|
17770
|
+
--toggle-margin: 2px;
|
|
17771
|
+
--toggle-width: 2.5em;
|
|
17772
|
+
--toggle-thumb-size: 1.2em;
|
|
17773
|
+
/* Padding uses px and not em otherwise it can be resolved to a float which does not play well */
|
|
17774
|
+
/* With the translation calc in some configurations. In the end 2px is nice in all sizes and can still be configured for exceptions */
|
|
17775
|
+
--toggle-padding: 2px;
|
|
17776
|
+
--toggle-border-radius: calc(
|
|
17777
|
+
var(--toggle-thumb-size) / 2 + calc(var(--toggle-padding) * 2)
|
|
17778
|
+
);
|
|
17779
|
+
--toggle-thumb-border-radius: 50%;
|
|
17780
|
+
--toggle-background-color: light-dark(#767676, #8e8e93);
|
|
17781
|
+
--toggle-background-color-checked: var(--accent-color);
|
|
17782
|
+
--toggle-background-color-hover: color-mix(
|
|
17783
|
+
in srgb,
|
|
17784
|
+
var(--toggle-background-color) 60%,
|
|
17785
|
+
white
|
|
17786
|
+
);
|
|
17787
|
+
--toggle-background-color-readonly: color-mix(
|
|
17788
|
+
in srgb,
|
|
17789
|
+
var(--toggle-background-color) 40%,
|
|
17790
|
+
transparent
|
|
17791
|
+
);
|
|
17792
|
+
--toggle-background-color-disabled: color-mix(
|
|
17793
|
+
in srgb,
|
|
17794
|
+
var(--toggle-background-color) 15%,
|
|
17795
|
+
#d3d3d3
|
|
17796
|
+
);
|
|
17797
|
+
--toggle-background-color-hover-checked: color-mix(
|
|
17798
|
+
in srgb,
|
|
17799
|
+
var(--toggle-background-color-checked) 90%,
|
|
17800
|
+
black
|
|
17801
|
+
);
|
|
17802
|
+
--toggle-background-color-readonly-checked: color-mix(
|
|
17803
|
+
in srgb,
|
|
17804
|
+
var(--toggle-background-color-checked) 40%,
|
|
17805
|
+
transparent
|
|
17806
|
+
);
|
|
17807
|
+
--toggle-background-color-disabled-checked: color-mix(
|
|
17808
|
+
in srgb,
|
|
17809
|
+
var(--toggle-background-color-checked) 15%,
|
|
17810
|
+
#d3d3d3
|
|
17811
|
+
);
|
|
17812
|
+
--toggle-thumb-color: white;
|
|
17813
|
+
|
|
17814
|
+
/* Button specific */
|
|
17815
|
+
--button-border-color: light-dark(#767676, #8e8e93);
|
|
17816
|
+
--button-background-color: light-dark(#f3f4f6, #2d3748);
|
|
17817
|
+
--button-border-color-hover: color-mix(
|
|
17818
|
+
in srgb,
|
|
17819
|
+
var(--button-border-color) 70%,
|
|
17820
|
+
black
|
|
17821
|
+
);
|
|
17822
|
+
--button-background-color-hover: color-mix(
|
|
17823
|
+
in srgb,
|
|
17824
|
+
var(--button-background-color) 95%,
|
|
17825
|
+
black
|
|
17826
|
+
);
|
|
17827
|
+
|
|
17713
17828
|
&[data-dark] {
|
|
17714
17829
|
--color-mix: var(--color-mix-dark);
|
|
17715
|
-
--checkmark-color: var(--
|
|
17830
|
+
--checkmark-color: var(--checkmark-color-dark);
|
|
17716
17831
|
}
|
|
17717
17832
|
}
|
|
17718
17833
|
}
|
|
17719
17834
|
|
|
17720
17835
|
.navi_checkbox {
|
|
17721
|
-
--x-border-radius: var(--border-radius);
|
|
17722
|
-
--x-outline-offset: var(--outline-offset);
|
|
17723
|
-
--x-outline-width: var(--outline-width);
|
|
17724
|
-
--x-border-width: var(--border-width);
|
|
17725
|
-
--x-width: var(--width);
|
|
17726
|
-
--x-height: var(--height);
|
|
17727
|
-
--x-outline-color: var(--outline-color);
|
|
17728
17836
|
--x-background-color: var(--background-color);
|
|
17729
17837
|
--x-border-color: var(--border-color);
|
|
17730
17838
|
--x-color: var(--color);
|
|
17731
17839
|
--x-checkmark-color: var(--checkmark-color);
|
|
17840
|
+
--x-cursor: var(--cursor);
|
|
17732
17841
|
|
|
17733
17842
|
position: relative;
|
|
17734
17843
|
display: inline-flex;
|
|
17735
17844
|
box-sizing: content-box;
|
|
17736
|
-
margin:
|
|
17845
|
+
margin: var(--margin);
|
|
17737
17846
|
|
|
17738
17847
|
.navi_native_field {
|
|
17739
17848
|
position: absolute;
|
|
@@ -17741,37 +17850,32 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17741
17850
|
margin: 0;
|
|
17742
17851
|
padding: 0;
|
|
17743
17852
|
border: none;
|
|
17853
|
+
border-radius: inherit;
|
|
17744
17854
|
opacity: 0;
|
|
17745
|
-
|
|
17855
|
+
appearance: none; /* This allows border-radius to have an effect */
|
|
17856
|
+
cursor: var(--x-cursor);
|
|
17746
17857
|
}
|
|
17747
17858
|
|
|
17748
17859
|
.navi_checkbox_field {
|
|
17749
17860
|
display: inline-flex;
|
|
17750
17861
|
box-sizing: border-box;
|
|
17751
|
-
width: var(--
|
|
17752
|
-
height: var(--
|
|
17862
|
+
width: var(--width);
|
|
17863
|
+
height: var(--height);
|
|
17753
17864
|
background-color: var(--x-background-color);
|
|
17754
|
-
border-width: var(--
|
|
17865
|
+
border-width: var(--border-width);
|
|
17755
17866
|
border-style: solid;
|
|
17756
17867
|
border-color: var(--x-border-color);
|
|
17757
|
-
border-radius: var(--
|
|
17758
|
-
outline-width: var(--
|
|
17868
|
+
border-radius: var(--border-radius);
|
|
17869
|
+
outline-width: var(--outline-width);
|
|
17759
17870
|
outline-style: none;
|
|
17760
|
-
outline-color: var(--
|
|
17761
|
-
outline-offset: var(--
|
|
17871
|
+
outline-color: var(--outline-color);
|
|
17872
|
+
outline-offset: var(--outline-offset);
|
|
17762
17873
|
pointer-events: none;
|
|
17763
|
-
|
|
17764
|
-
.navi_checkbox_marker {
|
|
17765
|
-
width: 100%;
|
|
17766
|
-
height: 100%;
|
|
17767
|
-
opacity: 0;
|
|
17768
|
-
stroke: var(--x-checkmark-color);
|
|
17769
|
-
transform: scale(0.5);
|
|
17770
|
-
}
|
|
17771
17874
|
}
|
|
17772
17875
|
|
|
17773
17876
|
/* Focus */
|
|
17774
17877
|
&[data-focus-visible] {
|
|
17878
|
+
z-index: 1;
|
|
17775
17879
|
.navi_checkbox_field {
|
|
17776
17880
|
outline-style: solid;
|
|
17777
17881
|
}
|
|
@@ -17790,20 +17894,13 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17790
17894
|
&[data-checked] {
|
|
17791
17895
|
--x-background-color: var(--background-color-checked);
|
|
17792
17896
|
--x-border-color: var(--border-color-checked);
|
|
17793
|
-
|
|
17794
|
-
.navi_checkbox_marker {
|
|
17795
|
-
opacity: 1;
|
|
17796
|
-
transform: scale(1);
|
|
17797
|
-
transition-property: opacity, transform;
|
|
17798
|
-
transition-duration: 0.15s;
|
|
17799
|
-
transition-timing-function: ease;
|
|
17800
|
-
}
|
|
17801
17897
|
}
|
|
17802
17898
|
/* Readonly */
|
|
17803
17899
|
&[data-readonly],
|
|
17804
17900
|
&[data-readonly][data-hover] {
|
|
17805
17901
|
--x-border-color: var(--border-color-readonly);
|
|
17806
17902
|
--x-background-color: var(--background-color-readonly);
|
|
17903
|
+
--x-cursor: default;
|
|
17807
17904
|
|
|
17808
17905
|
&[data-checked] {
|
|
17809
17906
|
--x-border-color: var(--border-color-readonly-checked);
|
|
@@ -17811,11 +17908,11 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17811
17908
|
--x-checkmark-color: var(--checkmark-color-readonly);
|
|
17812
17909
|
}
|
|
17813
17910
|
}
|
|
17814
|
-
|
|
17815
17911
|
/* Disabled */
|
|
17816
17912
|
&[data-disabled] {
|
|
17817
17913
|
--x-border-color: var(--border-color-disabled);
|
|
17818
17914
|
--x-background-color: var(--background-color-disabled);
|
|
17915
|
+
--x-cursor: default;
|
|
17819
17916
|
|
|
17820
17917
|
&[data-checked] {
|
|
17821
17918
|
--x-border-color: var(--border-color-disabled-checked);
|
|
@@ -17824,52 +17921,34 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17824
17921
|
}
|
|
17825
17922
|
}
|
|
17826
17923
|
|
|
17827
|
-
/*
|
|
17828
|
-
&[data-
|
|
17829
|
-
|
|
17830
|
-
|
|
17831
|
-
|
|
17832
|
-
|
|
17833
|
-
|
|
17834
|
-
|
|
17835
|
-
|
|
17836
|
-
--toggle-background-color-checked: var(
|
|
17837
|
-
--color,
|
|
17838
|
-
light-dark(#4476ff, #3b82f6)
|
|
17839
|
-
);
|
|
17840
|
-
--toggle-background-color-hover: color-mix(
|
|
17841
|
-
in srgb,
|
|
17842
|
-
var(--toggle-background-color) 60%,
|
|
17843
|
-
white
|
|
17844
|
-
);
|
|
17845
|
-
--toggle-background-color-readonly: color-mix(
|
|
17846
|
-
in srgb,
|
|
17847
|
-
var(--toggle-background-color) 40%,
|
|
17848
|
-
transparent
|
|
17849
|
-
);
|
|
17850
|
-
--toggle-background-color-disabled: color-mix(
|
|
17851
|
-
in srgb,
|
|
17852
|
-
var(--toggle-background-color) 15%,
|
|
17853
|
-
#d3d3d3
|
|
17854
|
-
);
|
|
17855
|
-
--toggle-background-color-hover-checked: color-mix(
|
|
17856
|
-
in srgb,
|
|
17857
|
-
var(--toggle-background-color-checked) 90%,
|
|
17858
|
-
black
|
|
17859
|
-
);
|
|
17860
|
-
--toggle-background-color-readonly-checked: color-mix(
|
|
17861
|
-
in srgb,
|
|
17862
|
-
var(--toggle-background-color-checked) 40%,
|
|
17863
|
-
transparent
|
|
17864
|
-
);
|
|
17865
|
-
--toggle-background-color-disabled-checked: color-mix(
|
|
17866
|
-
in srgb,
|
|
17867
|
-
var(--toggle-background-color-checked) 15%,
|
|
17868
|
-
#d3d3d3
|
|
17869
|
-
);
|
|
17924
|
+
/* Checkbox appearance */
|
|
17925
|
+
&[data-appearance="checkbox"] {
|
|
17926
|
+
.navi_checkbox_marker {
|
|
17927
|
+
width: 100%;
|
|
17928
|
+
height: 100%;
|
|
17929
|
+
opacity: 0;
|
|
17930
|
+
stroke: var(--x-checkmark-color);
|
|
17931
|
+
transform: scale(0.5);
|
|
17932
|
+
}
|
|
17870
17933
|
|
|
17871
|
-
|
|
17934
|
+
&[data-checked] {
|
|
17935
|
+
.navi_checkbox_marker {
|
|
17936
|
+
opacity: 1;
|
|
17937
|
+
transform: scale(1);
|
|
17938
|
+
transition-property: opacity, transform;
|
|
17939
|
+
transition-duration: 0.15s;
|
|
17940
|
+
transition-timing-function: ease;
|
|
17941
|
+
}
|
|
17942
|
+
}
|
|
17943
|
+
}
|
|
17872
17944
|
|
|
17945
|
+
/* Toggle appearance */
|
|
17946
|
+
&[data-appearance="toggle"] {
|
|
17947
|
+
--margin: var(--toggle-margin);
|
|
17948
|
+
--padding: var(--toggle-padding);
|
|
17949
|
+
--width: var(--toggle-width);
|
|
17950
|
+
--height: unset;
|
|
17951
|
+
--border-radius: var(--toggle-border-radius);
|
|
17873
17952
|
--background-color: var(--toggle-background-color);
|
|
17874
17953
|
--background-color-hover: var(--toggle-background-color-hover);
|
|
17875
17954
|
--background-color-readonly: var(--toggle-background-color-readonly);
|
|
@@ -17885,34 +17964,21 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17885
17964
|
--toggle-background-color-disabled-checked
|
|
17886
17965
|
);
|
|
17887
17966
|
|
|
17888
|
-
margin: 2px;
|
|
17889
|
-
border-radius: calc(
|
|
17890
|
-
var(--toggle-thumb-size) / 2 + calc(var(--toggle-padding) * 2)
|
|
17891
|
-
);
|
|
17892
|
-
|
|
17893
|
-
.navi_native_field {
|
|
17894
|
-
border-radius: inherit;
|
|
17895
|
-
appearance: none; /* This allows border-radius to have an effect */
|
|
17896
|
-
}
|
|
17897
|
-
|
|
17898
17967
|
.navi_checkbox_field {
|
|
17899
17968
|
position: relative;
|
|
17900
17969
|
box-sizing: border-box;
|
|
17901
|
-
width: var(--
|
|
17902
|
-
height:
|
|
17903
|
-
padding: var(--
|
|
17970
|
+
width: var(--width);
|
|
17971
|
+
height: var(--height);
|
|
17972
|
+
padding: var(--padding);
|
|
17904
17973
|
background-color: var(--x-background-color);
|
|
17905
17974
|
border-color: transparent;
|
|
17906
|
-
border-radius: inherit;
|
|
17907
17975
|
user-select: none;
|
|
17908
17976
|
|
|
17909
|
-
.
|
|
17910
|
-
/* position: absolute; */
|
|
17977
|
+
.navi_checkbox_toggle {
|
|
17911
17978
|
width: var(--toggle-thumb-size);
|
|
17912
17979
|
height: var(--toggle-thumb-size);
|
|
17913
17980
|
border-radius: var(--toggle-thumb-border-radius);
|
|
17914
|
-
|
|
17915
|
-
opacity: 1;
|
|
17981
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
17916
17982
|
fill: var(--toggle-thumb-color);
|
|
17917
17983
|
transform: translateX(0);
|
|
17918
17984
|
transition: transform 0.2s ease;
|
|
@@ -17920,7 +17986,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17920
17986
|
}
|
|
17921
17987
|
|
|
17922
17988
|
&[data-checked] {
|
|
17923
|
-
.
|
|
17989
|
+
.navi_checkbox_toggle {
|
|
17924
17990
|
/* We remove padding 3 times */
|
|
17925
17991
|
/* - twice to get real width (box-sizing: border-box) */
|
|
17926
17992
|
/* - one more to apply right padding to the translation */
|
|
@@ -17935,6 +18001,41 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17935
18001
|
}
|
|
17936
18002
|
}
|
|
17937
18003
|
}
|
|
18004
|
+
|
|
18005
|
+
&[data-appearance="icon"] {
|
|
18006
|
+
--margin: 0;
|
|
18007
|
+
--outline-offset: 0px;
|
|
18008
|
+
--width: auto;
|
|
18009
|
+
--height: auto;
|
|
18010
|
+
|
|
18011
|
+
.navi_checkbox_field {
|
|
18012
|
+
background: none;
|
|
18013
|
+
border: none;
|
|
18014
|
+
}
|
|
18015
|
+
}
|
|
18016
|
+
|
|
18017
|
+
&[data-appearance="button"] {
|
|
18018
|
+
--margin: 0;
|
|
18019
|
+
--outline-offset: 0px;
|
|
18020
|
+
--width: auto;
|
|
18021
|
+
--height: auto;
|
|
18022
|
+
--padding: 4px;
|
|
18023
|
+
--border-color: var(--button-border-color);
|
|
18024
|
+
--border-color-hover: var(--button-border-color-hover);
|
|
18025
|
+
--background-color: var(--button-background-color);
|
|
18026
|
+
--background-color-hover: var(--button-background-color-hover);
|
|
18027
|
+
--background-color-readonly: var(--button-background-color-readonly);
|
|
18028
|
+
--background-color-disabled: var(--button-background-color-disabled);
|
|
18029
|
+
--border-color-checked: var(--button-border-color);
|
|
18030
|
+
--background-color-checked: var(--button-background-color);
|
|
18031
|
+
|
|
18032
|
+
.navi_checkbox_field {
|
|
18033
|
+
padding-top: var(--padding-top, var(--padding-y, var(--padding)));
|
|
18034
|
+
padding-right: var(--padding-right, var(--padding-x, var(--padding)));
|
|
18035
|
+
padding-bottom: var(--padding-bottom, var(--padding-y, var(--padding)));
|
|
18036
|
+
padding-left: var(--padding-left, var(--padding-x, var(--padding)));
|
|
18037
|
+
}
|
|
18038
|
+
}
|
|
17938
18039
|
}
|
|
17939
18040
|
`;
|
|
17940
18041
|
const InputCheckbox = props => {
|
|
@@ -17962,14 +18063,13 @@ const InputCheckbox = props => {
|
|
|
17962
18063
|
});
|
|
17963
18064
|
};
|
|
17964
18065
|
const CheckboxStyleCSSVars = {
|
|
17965
|
-
"width": "--
|
|
17966
|
-
"height": "--
|
|
18066
|
+
"width": "--width",
|
|
18067
|
+
"height": "--height",
|
|
17967
18068
|
"outlineWidth": "--outline-width",
|
|
17968
18069
|
"borderWidth": "--border-width",
|
|
17969
|
-
"borderRadius": "--border-radius",
|
|
17970
18070
|
"backgroundColor": "--background-color",
|
|
17971
18071
|
"borderColor": "--border-color",
|
|
17972
|
-
"
|
|
18072
|
+
"accentColor": "--accent-color",
|
|
17973
18073
|
":hover": {
|
|
17974
18074
|
backgroundColor: "--background-color-hover",
|
|
17975
18075
|
borderColor: "--border-color-hover",
|
|
@@ -17989,6 +18089,22 @@ const CheckboxStyleCSSVars = {
|
|
|
17989
18089
|
color: "--color-disabled"
|
|
17990
18090
|
}
|
|
17991
18091
|
};
|
|
18092
|
+
const CheckboxToggleStyleCSSVars = {
|
|
18093
|
+
...CheckboxStyleCSSVars,
|
|
18094
|
+
width: "--toggle-width",
|
|
18095
|
+
height: "--toggle-height",
|
|
18096
|
+
borderRadius: "--border-radius"
|
|
18097
|
+
};
|
|
18098
|
+
const CheckboxButtonStyleCSSVars = {
|
|
18099
|
+
...CheckboxStyleCSSVars,
|
|
18100
|
+
paddingTop: "--padding-top",
|
|
18101
|
+
paddingRight: "--padding-right",
|
|
18102
|
+
paddingBottom: "--padding-bottom",
|
|
18103
|
+
paddingLeft: "--padding-left",
|
|
18104
|
+
paddingX: "--padding-x",
|
|
18105
|
+
paddingY: "--padding-y",
|
|
18106
|
+
padding: "--padding"
|
|
18107
|
+
};
|
|
17992
18108
|
const CheckboxPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":checked", ":-navi-loading"];
|
|
17993
18109
|
const CheckboxPseudoElements = ["::-navi-loader", "::-navi-checkmark"];
|
|
17994
18110
|
const InputCheckboxBasic = props => {
|
|
@@ -18017,8 +18133,10 @@ const InputCheckboxBasic = props => {
|
|
|
18017
18133
|
autoFocus,
|
|
18018
18134
|
onClick,
|
|
18019
18135
|
onInput,
|
|
18020
|
-
|
|
18021
|
-
|
|
18136
|
+
accentColor,
|
|
18137
|
+
icon,
|
|
18138
|
+
appearance = icon ? "icon" : "checkbox",
|
|
18139
|
+
// "checkbox", "toggle", "icon", "button"
|
|
18022
18140
|
...rest
|
|
18023
18141
|
} = props;
|
|
18024
18142
|
const defaultRef = useRef();
|
|
@@ -18066,25 +18184,26 @@ const InputCheckboxBasic = props => {
|
|
|
18066
18184
|
}
|
|
18067
18185
|
});
|
|
18068
18186
|
const renderCheckboxMemoized = useCallback(renderCheckbox, [id, innerName, checked, innerRequired]);
|
|
18187
|
+
const boxRef = useRef();
|
|
18069
18188
|
useLayoutEffect(() => {
|
|
18070
|
-
const naviCheckbox =
|
|
18189
|
+
const naviCheckbox = boxRef.current;
|
|
18071
18190
|
const lightColor = "var(--checkmark-color-light)";
|
|
18072
18191
|
const darkColor = "var(--checkmark-color-dark)";
|
|
18073
|
-
const colorPicked = pickLightOrDark("var(--color)", lightColor, darkColor, naviCheckbox);
|
|
18192
|
+
const colorPicked = pickLightOrDark("var(--accent-color)", lightColor, darkColor, naviCheckbox);
|
|
18074
18193
|
if (colorPicked === lightColor) {
|
|
18075
18194
|
naviCheckbox.removeAttribute("data-dark");
|
|
18076
18195
|
} else {
|
|
18077
18196
|
naviCheckbox.setAttribute("data-dark", "");
|
|
18078
18197
|
}
|
|
18079
|
-
}, [
|
|
18198
|
+
}, [accentColor]);
|
|
18080
18199
|
return jsxs(Box, {
|
|
18081
18200
|
as: "span",
|
|
18082
18201
|
...remainingProps,
|
|
18083
|
-
ref:
|
|
18084
|
-
"data-
|
|
18202
|
+
ref: boxRef,
|
|
18203
|
+
"data-appearance": appearance,
|
|
18085
18204
|
baseClassName: "navi_checkbox",
|
|
18086
18205
|
pseudoStateSelector: ".navi_native_field",
|
|
18087
|
-
styleCSSVars: CheckboxStyleCSSVars,
|
|
18206
|
+
styleCSSVars: appearance === "toggle" ? CheckboxToggleStyleCSSVars : appearance === "button" ? CheckboxButtonStyleCSSVars : CheckboxStyleCSSVars,
|
|
18088
18207
|
pseudoClasses: CheckboxPseudoClasses,
|
|
18089
18208
|
pseudoElements: CheckboxPseudoElements,
|
|
18090
18209
|
basePseudoState: {
|
|
@@ -18092,7 +18211,7 @@ const InputCheckboxBasic = props => {
|
|
|
18092
18211
|
":disabled": innerDisabled,
|
|
18093
18212
|
":-navi-loading": innerLoading
|
|
18094
18213
|
},
|
|
18095
|
-
|
|
18214
|
+
accentColor: accentColor,
|
|
18096
18215
|
hasChildFunction: true,
|
|
18097
18216
|
preventInitialTransition: true,
|
|
18098
18217
|
children: [jsx(LoaderBackground, {
|
|
@@ -18102,11 +18221,15 @@ const InputCheckboxBasic = props => {
|
|
|
18102
18221
|
targetSelector: ".navi_checkbox_field"
|
|
18103
18222
|
}), renderCheckboxMemoized, jsx("div", {
|
|
18104
18223
|
className: "navi_checkbox_field",
|
|
18105
|
-
children:
|
|
18224
|
+
children: icon ? jsx("div", {
|
|
18225
|
+
className: "navi_checkbox_icon",
|
|
18226
|
+
"aria-hidden": "true",
|
|
18227
|
+
children: Array.isArray(icon) ? icon[checked ? 1 : 0] : icon
|
|
18228
|
+
}) : appearance === "toggle" ? jsx(Box, {
|
|
18229
|
+
className: "navi_checkbox_toggle",
|
|
18106
18230
|
as: "svg",
|
|
18107
18231
|
viewBox: "0 0 12 12",
|
|
18108
18232
|
"aria-hidden": "true",
|
|
18109
|
-
className: "navi_checkbox_marker",
|
|
18110
18233
|
preventInitialTransition: true,
|
|
18111
18234
|
children: jsx("circle", {
|
|
18112
18235
|
cx: "6",
|
|
@@ -18114,10 +18237,10 @@ const InputCheckboxBasic = props => {
|
|
|
18114
18237
|
r: "5"
|
|
18115
18238
|
})
|
|
18116
18239
|
}) : jsx(Box, {
|
|
18240
|
+
className: "navi_checkbox_marker",
|
|
18117
18241
|
as: "svg",
|
|
18118
18242
|
viewBox: "0 0 12 12",
|
|
18119
18243
|
"aria-hidden": "true",
|
|
18120
|
-
className: "navi_checkbox_marker",
|
|
18121
18244
|
preventInitialTransition: true,
|
|
18122
18245
|
children: jsx("path", {
|
|
18123
18246
|
d: "M10.5 2L4.5 9L1.5 5.5",
|
|
@@ -18146,9 +18269,10 @@ const InputCheckboxWithAction = props => {
|
|
|
18146
18269
|
const defaultRef = useRef();
|
|
18147
18270
|
const ref = props.ref || defaultRef;
|
|
18148
18271
|
const [actionBoundToUIState] = useActionBoundToOneParam(action, uiState);
|
|
18272
|
+
const actionStatus = useActionStatus(actionBoundToUIState);
|
|
18149
18273
|
const {
|
|
18150
18274
|
loading: actionLoading
|
|
18151
|
-
} =
|
|
18275
|
+
} = actionStatus;
|
|
18152
18276
|
const executeAction = useExecuteAction(ref, {
|
|
18153
18277
|
errorEffect: actionErrorEffect
|
|
18154
18278
|
});
|
|
@@ -18738,17 +18862,17 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18738
18862
|
|
|
18739
18863
|
--outline-color: var(--navi-focus-outline-color);
|
|
18740
18864
|
--loader-color: var(--navi-loader-color);
|
|
18741
|
-
--color: rgb(24, 117, 255);
|
|
18865
|
+
--accent-color: rgb(24, 117, 255);
|
|
18742
18866
|
|
|
18743
|
-
--border-color:
|
|
18867
|
+
--border-color: rgb(150, 150, 150);
|
|
18744
18868
|
--track-border-color: color-mix(
|
|
18745
18869
|
in srgb,
|
|
18746
18870
|
var(--border-color) 35%,
|
|
18747
18871
|
transparent
|
|
18748
18872
|
);
|
|
18749
18873
|
--background-color: #efefef;
|
|
18750
|
-
--fill-color: var(--color);
|
|
18751
|
-
--thumb-color: var(--
|
|
18874
|
+
--fill-color: var(--accent-color);
|
|
18875
|
+
--thumb-color: var(--accent-color);
|
|
18752
18876
|
/* Hover */
|
|
18753
18877
|
--border-color-hover: color-mix(in srgb, var(--border-color) 75%, black);
|
|
18754
18878
|
--track-border-color-hover: color-mix(
|
|
@@ -18757,7 +18881,6 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18757
18881
|
black
|
|
18758
18882
|
);
|
|
18759
18883
|
--track-color-hover: color-mix(in srgb, var(--fill-color) 95%, black);
|
|
18760
|
-
--color-hover: color-mix(in srgb, var(--rail-color) 95%, black);
|
|
18761
18884
|
--fill-color-hover: color-mix(in srgb, var(--fill-color) 80%, black);
|
|
18762
18885
|
--thumb-color-hover: color-mix(in srgb, var(--thumb-color) 80%, black);
|
|
18763
18886
|
/* Active */
|
|
@@ -18780,6 +18903,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18780
18903
|
var(--border-color) 30%,
|
|
18781
18904
|
white
|
|
18782
18905
|
);
|
|
18906
|
+
--track-border-color-readonly: var(--border-color);
|
|
18783
18907
|
--background-color-readonly: var(--background-color);
|
|
18784
18908
|
--fill-color-readonly: color-mix(in srgb, var(--fill-color) 30%, grey);
|
|
18785
18909
|
--thumb-color-readonly: var(--fill-color-readonly);
|
|
@@ -18886,14 +19010,14 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18886
19010
|
}
|
|
18887
19011
|
|
|
18888
19012
|
/* Hover */
|
|
18889
|
-
|
|
19013
|
+
&[data-hover] {
|
|
18890
19014
|
--x-border-color: var(--border-color-hover);
|
|
18891
19015
|
--x-track-border-color: var(--track-border-color-hover);
|
|
18892
19016
|
--x-fill-color: var(--fill-color-hover);
|
|
18893
19017
|
--x-thumb-color: var(--thumb-color-hover);
|
|
18894
19018
|
}
|
|
18895
19019
|
/* Active */
|
|
18896
|
-
|
|
19020
|
+
&[data-active] {
|
|
18897
19021
|
--x-border-color: var(--border-color-active);
|
|
18898
19022
|
--x-track-border-color: var(--track-border-color-active);
|
|
18899
19023
|
--x-background-color: var(--background-color-active);
|
|
@@ -18907,6 +19031,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18907
19031
|
/* Readonly */
|
|
18908
19032
|
&[data-readonly] {
|
|
18909
19033
|
--x-background-color: var(--background-color-readonly);
|
|
19034
|
+
--x-track-border-color: var(--track-border-color-readonly);
|
|
18910
19035
|
--x-border-color: var(--border-color-readonly);
|
|
18911
19036
|
--x-fill-color: var(--fill-color-readonly);
|
|
18912
19037
|
--x-thumb-color: var(--thumb-color-readonly);
|
|
@@ -18926,7 +19051,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18926
19051
|
/* Disabled */
|
|
18927
19052
|
.navi_input_range[data-disabled] {
|
|
18928
19053
|
--x-background-color: var(--background-color-disabled);
|
|
18929
|
-
--x-color: var(--color-disabled);
|
|
19054
|
+
--x-accent-color: var(--accent-color-disabled);
|
|
18930
19055
|
}
|
|
18931
19056
|
/* Callout (info, warning, error) */
|
|
18932
19057
|
.navi_input_range[data-callout] {
|
|
@@ -18953,7 +19078,7 @@ const InputStyleCSSVars$1 = {
|
|
|
18953
19078
|
"borderRadius": "--border-radius",
|
|
18954
19079
|
"borderColor": "--border-color",
|
|
18955
19080
|
"backgroundColor": "--background-color",
|
|
18956
|
-
"
|
|
19081
|
+
"accentColor": "--accent-color",
|
|
18957
19082
|
":hover": {
|
|
18958
19083
|
borderColor: "--border-color-hover",
|
|
18959
19084
|
backgroundColor: "--background-color-hover",
|