@jsenv/navi 0.14.33 → 0.15.1
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 -230
- 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,33 @@ 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;
|
|
17855
|
+
appearance: none; /* This allows border-radius to have an effect */
|
|
17745
17856
|
cursor: inherit;
|
|
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);
|
|
17873
|
+
cursor: var(--x-cursor);
|
|
17762
17874
|
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
17875
|
}
|
|
17772
17876
|
|
|
17773
17877
|
/* Focus */
|
|
17774
17878
|
&[data-focus-visible] {
|
|
17879
|
+
z-index: 1;
|
|
17775
17880
|
.navi_checkbox_field {
|
|
17776
17881
|
outline-style: solid;
|
|
17777
17882
|
}
|
|
@@ -17790,20 +17895,13 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17790
17895
|
&[data-checked] {
|
|
17791
17896
|
--x-background-color: var(--background-color-checked);
|
|
17792
17897
|
--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
17898
|
}
|
|
17802
17899
|
/* Readonly */
|
|
17803
17900
|
&[data-readonly],
|
|
17804
17901
|
&[data-readonly][data-hover] {
|
|
17805
17902
|
--x-border-color: var(--border-color-readonly);
|
|
17806
17903
|
--x-background-color: var(--background-color-readonly);
|
|
17904
|
+
--x-cursor: default;
|
|
17807
17905
|
|
|
17808
17906
|
&[data-checked] {
|
|
17809
17907
|
--x-border-color: var(--border-color-readonly-checked);
|
|
@@ -17811,11 +17909,11 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17811
17909
|
--x-checkmark-color: var(--checkmark-color-readonly);
|
|
17812
17910
|
}
|
|
17813
17911
|
}
|
|
17814
|
-
|
|
17815
17912
|
/* Disabled */
|
|
17816
17913
|
&[data-disabled] {
|
|
17817
17914
|
--x-border-color: var(--border-color-disabled);
|
|
17818
17915
|
--x-background-color: var(--background-color-disabled);
|
|
17916
|
+
--x-cursor: default;
|
|
17819
17917
|
|
|
17820
17918
|
&[data-checked] {
|
|
17821
17919
|
--x-border-color: var(--border-color-disabled-checked);
|
|
@@ -17824,52 +17922,34 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17824
17922
|
}
|
|
17825
17923
|
}
|
|
17826
17924
|
|
|
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
|
-
);
|
|
17925
|
+
/* Checkbox appearance */
|
|
17926
|
+
&[data-appearance="checkbox"] {
|
|
17927
|
+
.navi_checkbox_marker {
|
|
17928
|
+
width: 100%;
|
|
17929
|
+
height: 100%;
|
|
17930
|
+
opacity: 0;
|
|
17931
|
+
stroke: var(--x-checkmark-color);
|
|
17932
|
+
transform: scale(0.5);
|
|
17933
|
+
}
|
|
17870
17934
|
|
|
17871
|
-
|
|
17935
|
+
&[data-checked] {
|
|
17936
|
+
.navi_checkbox_marker {
|
|
17937
|
+
opacity: 1;
|
|
17938
|
+
transform: scale(1);
|
|
17939
|
+
transition-property: opacity, transform;
|
|
17940
|
+
transition-duration: 0.15s;
|
|
17941
|
+
transition-timing-function: ease;
|
|
17942
|
+
}
|
|
17943
|
+
}
|
|
17944
|
+
}
|
|
17872
17945
|
|
|
17946
|
+
/* Toggle appearance */
|
|
17947
|
+
&[data-appearance="toggle"] {
|
|
17948
|
+
--margin: var(--toggle-margin);
|
|
17949
|
+
--padding: var(--toggle-padding);
|
|
17950
|
+
--width: var(--toggle-width);
|
|
17951
|
+
--height: unset;
|
|
17952
|
+
--border-radius: var(--toggle-border-radius);
|
|
17873
17953
|
--background-color: var(--toggle-background-color);
|
|
17874
17954
|
--background-color-hover: var(--toggle-background-color-hover);
|
|
17875
17955
|
--background-color-readonly: var(--toggle-background-color-readonly);
|
|
@@ -17885,34 +17965,21 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17885
17965
|
--toggle-background-color-disabled-checked
|
|
17886
17966
|
);
|
|
17887
17967
|
|
|
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
17968
|
.navi_checkbox_field {
|
|
17899
17969
|
position: relative;
|
|
17900
17970
|
box-sizing: border-box;
|
|
17901
|
-
width: var(--
|
|
17902
|
-
height:
|
|
17903
|
-
padding: var(--
|
|
17971
|
+
width: var(--width);
|
|
17972
|
+
height: var(--height);
|
|
17973
|
+
padding: var(--padding);
|
|
17904
17974
|
background-color: var(--x-background-color);
|
|
17905
17975
|
border-color: transparent;
|
|
17906
|
-
border-radius: inherit;
|
|
17907
17976
|
user-select: none;
|
|
17908
17977
|
|
|
17909
|
-
.
|
|
17910
|
-
/* position: absolute; */
|
|
17978
|
+
.navi_checkbox_toggle {
|
|
17911
17979
|
width: var(--toggle-thumb-size);
|
|
17912
17980
|
height: var(--toggle-thumb-size);
|
|
17913
17981
|
border-radius: var(--toggle-thumb-border-radius);
|
|
17914
|
-
|
|
17915
|
-
opacity: 1;
|
|
17982
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
|
|
17916
17983
|
fill: var(--toggle-thumb-color);
|
|
17917
17984
|
transform: translateX(0);
|
|
17918
17985
|
transition: transform 0.2s ease;
|
|
@@ -17920,7 +17987,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17920
17987
|
}
|
|
17921
17988
|
|
|
17922
17989
|
&[data-checked] {
|
|
17923
|
-
.
|
|
17990
|
+
.navi_checkbox_toggle {
|
|
17924
17991
|
/* We remove padding 3 times */
|
|
17925
17992
|
/* - twice to get real width (box-sizing: border-box) */
|
|
17926
17993
|
/* - one more to apply right padding to the translation */
|
|
@@ -17935,6 +18002,41 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17935
18002
|
}
|
|
17936
18003
|
}
|
|
17937
18004
|
}
|
|
18005
|
+
|
|
18006
|
+
&[data-appearance="icon"] {
|
|
18007
|
+
--margin: 0;
|
|
18008
|
+
--outline-offset: 0px;
|
|
18009
|
+
--width: auto;
|
|
18010
|
+
--height: auto;
|
|
18011
|
+
|
|
18012
|
+
.navi_checkbox_field {
|
|
18013
|
+
background: none;
|
|
18014
|
+
border: none;
|
|
18015
|
+
}
|
|
18016
|
+
}
|
|
18017
|
+
|
|
18018
|
+
&[data-appearance="button"] {
|
|
18019
|
+
--margin: 0;
|
|
18020
|
+
--outline-offset: 0px;
|
|
18021
|
+
--width: auto;
|
|
18022
|
+
--height: auto;
|
|
18023
|
+
--padding: 4px;
|
|
18024
|
+
--border-color: var(--button-border-color);
|
|
18025
|
+
--border-color-hover: var(--button-border-color-hover);
|
|
18026
|
+
--background-color: var(--button-background-color);
|
|
18027
|
+
--background-color-hover: var(--button-background-color-hover);
|
|
18028
|
+
--background-color-readonly: var(--button-background-color-readonly);
|
|
18029
|
+
--background-color-disabled: var(--button-background-color-disabled);
|
|
18030
|
+
--border-color-checked: var(--button-border-color);
|
|
18031
|
+
--background-color-checked: var(--button-background-color);
|
|
18032
|
+
|
|
18033
|
+
.navi_checkbox_field {
|
|
18034
|
+
padding-top: var(--padding-top, var(--padding-y, var(--padding)));
|
|
18035
|
+
padding-right: var(--padding-right, var(--padding-x, var(--padding)));
|
|
18036
|
+
padding-bottom: var(--padding-bottom, var(--padding-y, var(--padding)));
|
|
18037
|
+
padding-left: var(--padding-left, var(--padding-x, var(--padding)));
|
|
18038
|
+
}
|
|
18039
|
+
}
|
|
17938
18040
|
}
|
|
17939
18041
|
`;
|
|
17940
18042
|
const InputCheckbox = props => {
|
|
@@ -17962,14 +18064,13 @@ const InputCheckbox = props => {
|
|
|
17962
18064
|
});
|
|
17963
18065
|
};
|
|
17964
18066
|
const CheckboxStyleCSSVars = {
|
|
17965
|
-
"width": "--
|
|
17966
|
-
"height": "--
|
|
18067
|
+
"width": "--width",
|
|
18068
|
+
"height": "--height",
|
|
17967
18069
|
"outlineWidth": "--outline-width",
|
|
17968
18070
|
"borderWidth": "--border-width",
|
|
17969
|
-
"borderRadius": "--border-radius",
|
|
17970
18071
|
"backgroundColor": "--background-color",
|
|
17971
18072
|
"borderColor": "--border-color",
|
|
17972
|
-
"
|
|
18073
|
+
"accentColor": "--accent-color",
|
|
17973
18074
|
":hover": {
|
|
17974
18075
|
backgroundColor: "--background-color-hover",
|
|
17975
18076
|
borderColor: "--border-color-hover",
|
|
@@ -17989,6 +18090,22 @@ const CheckboxStyleCSSVars = {
|
|
|
17989
18090
|
color: "--color-disabled"
|
|
17990
18091
|
}
|
|
17991
18092
|
};
|
|
18093
|
+
const CheckboxToggleStyleCSSVars = {
|
|
18094
|
+
...CheckboxStyleCSSVars,
|
|
18095
|
+
width: "--toggle-width",
|
|
18096
|
+
height: "--toggle-height",
|
|
18097
|
+
borderRadius: "--border-radius"
|
|
18098
|
+
};
|
|
18099
|
+
const CheckboxButtonStyleCSSVars = {
|
|
18100
|
+
...CheckboxStyleCSSVars,
|
|
18101
|
+
paddingTop: "--padding-top",
|
|
18102
|
+
paddingRight: "--padding-right",
|
|
18103
|
+
paddingBottom: "--padding-bottom",
|
|
18104
|
+
paddingLeft: "--padding-left",
|
|
18105
|
+
paddingX: "--padding-x",
|
|
18106
|
+
paddingY: "--padding-y",
|
|
18107
|
+
padding: "--padding"
|
|
18108
|
+
};
|
|
17992
18109
|
const CheckboxPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":checked", ":-navi-loading"];
|
|
17993
18110
|
const CheckboxPseudoElements = ["::-navi-loader", "::-navi-checkmark"];
|
|
17994
18111
|
const InputCheckboxBasic = props => {
|
|
@@ -18017,8 +18134,10 @@ const InputCheckboxBasic = props => {
|
|
|
18017
18134
|
autoFocus,
|
|
18018
18135
|
onClick,
|
|
18019
18136
|
onInput,
|
|
18020
|
-
|
|
18021
|
-
|
|
18137
|
+
accentColor,
|
|
18138
|
+
icon,
|
|
18139
|
+
appearance = icon ? "icon" : "checkbox",
|
|
18140
|
+
// "checkbox", "toggle", "icon", "button"
|
|
18022
18141
|
...rest
|
|
18023
18142
|
} = props;
|
|
18024
18143
|
const defaultRef = useRef();
|
|
@@ -18066,25 +18185,26 @@ const InputCheckboxBasic = props => {
|
|
|
18066
18185
|
}
|
|
18067
18186
|
});
|
|
18068
18187
|
const renderCheckboxMemoized = useCallback(renderCheckbox, [id, innerName, checked, innerRequired]);
|
|
18188
|
+
const boxRef = useRef();
|
|
18069
18189
|
useLayoutEffect(() => {
|
|
18070
|
-
const naviCheckbox =
|
|
18190
|
+
const naviCheckbox = boxRef.current;
|
|
18071
18191
|
const lightColor = "var(--checkmark-color-light)";
|
|
18072
18192
|
const darkColor = "var(--checkmark-color-dark)";
|
|
18073
|
-
const colorPicked = pickLightOrDark("var(--color)", lightColor, darkColor, naviCheckbox);
|
|
18193
|
+
const colorPicked = pickLightOrDark("var(--accent-color)", lightColor, darkColor, naviCheckbox);
|
|
18074
18194
|
if (colorPicked === lightColor) {
|
|
18075
18195
|
naviCheckbox.removeAttribute("data-dark");
|
|
18076
18196
|
} else {
|
|
18077
18197
|
naviCheckbox.setAttribute("data-dark", "");
|
|
18078
18198
|
}
|
|
18079
|
-
}, [
|
|
18199
|
+
}, [accentColor]);
|
|
18080
18200
|
return jsxs(Box, {
|
|
18081
18201
|
as: "span",
|
|
18082
18202
|
...remainingProps,
|
|
18083
|
-
ref:
|
|
18084
|
-
"data-
|
|
18203
|
+
ref: boxRef,
|
|
18204
|
+
"data-appearance": appearance,
|
|
18085
18205
|
baseClassName: "navi_checkbox",
|
|
18086
18206
|
pseudoStateSelector: ".navi_native_field",
|
|
18087
|
-
styleCSSVars: CheckboxStyleCSSVars,
|
|
18207
|
+
styleCSSVars: appearance === "toggle" ? CheckboxToggleStyleCSSVars : appearance === "button" ? CheckboxButtonStyleCSSVars : CheckboxStyleCSSVars,
|
|
18088
18208
|
pseudoClasses: CheckboxPseudoClasses,
|
|
18089
18209
|
pseudoElements: CheckboxPseudoElements,
|
|
18090
18210
|
basePseudoState: {
|
|
@@ -18092,7 +18212,7 @@ const InputCheckboxBasic = props => {
|
|
|
18092
18212
|
":disabled": innerDisabled,
|
|
18093
18213
|
":-navi-loading": innerLoading
|
|
18094
18214
|
},
|
|
18095
|
-
|
|
18215
|
+
accentColor: accentColor,
|
|
18096
18216
|
hasChildFunction: true,
|
|
18097
18217
|
preventInitialTransition: true,
|
|
18098
18218
|
children: [jsx(LoaderBackground, {
|
|
@@ -18102,11 +18222,15 @@ const InputCheckboxBasic = props => {
|
|
|
18102
18222
|
targetSelector: ".navi_checkbox_field"
|
|
18103
18223
|
}), renderCheckboxMemoized, jsx("div", {
|
|
18104
18224
|
className: "navi_checkbox_field",
|
|
18105
|
-
children:
|
|
18225
|
+
children: icon ? jsx("div", {
|
|
18226
|
+
className: "navi_checkbox_icon",
|
|
18227
|
+
"aria-hidden": "true",
|
|
18228
|
+
children: Array.isArray(icon) ? icon[checked ? 1 : 0] : icon
|
|
18229
|
+
}) : appearance === "toggle" ? jsx(Box, {
|
|
18230
|
+
className: "navi_checkbox_toggle",
|
|
18106
18231
|
as: "svg",
|
|
18107
18232
|
viewBox: "0 0 12 12",
|
|
18108
18233
|
"aria-hidden": "true",
|
|
18109
|
-
className: "navi_checkbox_marker",
|
|
18110
18234
|
preventInitialTransition: true,
|
|
18111
18235
|
children: jsx("circle", {
|
|
18112
18236
|
cx: "6",
|
|
@@ -18114,10 +18238,10 @@ const InputCheckboxBasic = props => {
|
|
|
18114
18238
|
r: "5"
|
|
18115
18239
|
})
|
|
18116
18240
|
}) : jsx(Box, {
|
|
18241
|
+
className: "navi_checkbox_marker",
|
|
18117
18242
|
as: "svg",
|
|
18118
18243
|
viewBox: "0 0 12 12",
|
|
18119
18244
|
"aria-hidden": "true",
|
|
18120
|
-
className: "navi_checkbox_marker",
|
|
18121
18245
|
preventInitialTransition: true,
|
|
18122
18246
|
children: jsx("path", {
|
|
18123
18247
|
d: "M10.5 2L4.5 9L1.5 5.5",
|
|
@@ -18146,9 +18270,10 @@ const InputCheckboxWithAction = props => {
|
|
|
18146
18270
|
const defaultRef = useRef();
|
|
18147
18271
|
const ref = props.ref || defaultRef;
|
|
18148
18272
|
const [actionBoundToUIState] = useActionBoundToOneParam(action, uiState);
|
|
18273
|
+
const actionStatus = useActionStatus(actionBoundToUIState);
|
|
18149
18274
|
const {
|
|
18150
18275
|
loading: actionLoading
|
|
18151
|
-
} =
|
|
18276
|
+
} = actionStatus;
|
|
18152
18277
|
const executeAction = useExecuteAction(ref, {
|
|
18153
18278
|
errorEffect: actionErrorEffect
|
|
18154
18279
|
});
|
|
@@ -18738,17 +18863,17 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18738
18863
|
|
|
18739
18864
|
--outline-color: var(--navi-focus-outline-color);
|
|
18740
18865
|
--loader-color: var(--navi-loader-color);
|
|
18741
|
-
--color: rgb(24, 117, 255);
|
|
18866
|
+
--accent-color: rgb(24, 117, 255);
|
|
18742
18867
|
|
|
18743
|
-
--border-color:
|
|
18868
|
+
--border-color: rgb(150, 150, 150);
|
|
18744
18869
|
--track-border-color: color-mix(
|
|
18745
18870
|
in srgb,
|
|
18746
18871
|
var(--border-color) 35%,
|
|
18747
18872
|
transparent
|
|
18748
18873
|
);
|
|
18749
18874
|
--background-color: #efefef;
|
|
18750
|
-
--fill-color: var(--color);
|
|
18751
|
-
--thumb-color: var(--
|
|
18875
|
+
--fill-color: var(--accent-color);
|
|
18876
|
+
--thumb-color: var(--accent-color);
|
|
18752
18877
|
/* Hover */
|
|
18753
18878
|
--border-color-hover: color-mix(in srgb, var(--border-color) 75%, black);
|
|
18754
18879
|
--track-border-color-hover: color-mix(
|
|
@@ -18757,7 +18882,6 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18757
18882
|
black
|
|
18758
18883
|
);
|
|
18759
18884
|
--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
18885
|
--fill-color-hover: color-mix(in srgb, var(--fill-color) 80%, black);
|
|
18762
18886
|
--thumb-color-hover: color-mix(in srgb, var(--thumb-color) 80%, black);
|
|
18763
18887
|
/* Active */
|
|
@@ -18780,6 +18904,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18780
18904
|
var(--border-color) 30%,
|
|
18781
18905
|
white
|
|
18782
18906
|
);
|
|
18907
|
+
--track-border-color-readonly: var(--border-color);
|
|
18783
18908
|
--background-color-readonly: var(--background-color);
|
|
18784
18909
|
--fill-color-readonly: color-mix(in srgb, var(--fill-color) 30%, grey);
|
|
18785
18910
|
--thumb-color-readonly: var(--fill-color-readonly);
|
|
@@ -18886,14 +19011,14 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18886
19011
|
}
|
|
18887
19012
|
|
|
18888
19013
|
/* Hover */
|
|
18889
|
-
|
|
19014
|
+
&[data-hover] {
|
|
18890
19015
|
--x-border-color: var(--border-color-hover);
|
|
18891
19016
|
--x-track-border-color: var(--track-border-color-hover);
|
|
18892
19017
|
--x-fill-color: var(--fill-color-hover);
|
|
18893
19018
|
--x-thumb-color: var(--thumb-color-hover);
|
|
18894
19019
|
}
|
|
18895
19020
|
/* Active */
|
|
18896
|
-
|
|
19021
|
+
&[data-active] {
|
|
18897
19022
|
--x-border-color: var(--border-color-active);
|
|
18898
19023
|
--x-track-border-color: var(--track-border-color-active);
|
|
18899
19024
|
--x-background-color: var(--background-color-active);
|
|
@@ -18907,6 +19032,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18907
19032
|
/* Readonly */
|
|
18908
19033
|
&[data-readonly] {
|
|
18909
19034
|
--x-background-color: var(--background-color-readonly);
|
|
19035
|
+
--x-track-border-color: var(--track-border-color-readonly);
|
|
18910
19036
|
--x-border-color: var(--border-color-readonly);
|
|
18911
19037
|
--x-fill-color: var(--fill-color-readonly);
|
|
18912
19038
|
--x-thumb-color: var(--thumb-color-readonly);
|
|
@@ -18926,7 +19052,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18926
19052
|
/* Disabled */
|
|
18927
19053
|
.navi_input_range[data-disabled] {
|
|
18928
19054
|
--x-background-color: var(--background-color-disabled);
|
|
18929
|
-
--x-color: var(--color-disabled);
|
|
19055
|
+
--x-accent-color: var(--accent-color-disabled);
|
|
18930
19056
|
}
|
|
18931
19057
|
/* Callout (info, warning, error) */
|
|
18932
19058
|
.navi_input_range[data-callout] {
|
|
@@ -18953,7 +19079,7 @@ const InputStyleCSSVars$1 = {
|
|
|
18953
19079
|
"borderRadius": "--border-radius",
|
|
18954
19080
|
"borderColor": "--border-color",
|
|
18955
19081
|
"backgroundColor": "--background-color",
|
|
18956
|
-
"
|
|
19082
|
+
"accentColor": "--accent-color",
|
|
18957
19083
|
":hover": {
|
|
18958
19084
|
borderColor: "--border-color-hover",
|
|
18959
19085
|
backgroundColor: "--background-color-hover",
|