@jsenv/navi 0.15.2 → 0.15.4
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/README.md +110 -0
- package/dist/jsenv_navi.js +710 -179
- package/dist/jsenv_navi.js.map +80 -21
- package/package.json +2 -2
package/dist/jsenv_navi.js
CHANGED
|
@@ -4736,6 +4736,7 @@ const hasWidthHeight = (context) => {
|
|
|
4736
4736
|
);
|
|
4737
4737
|
};
|
|
4738
4738
|
const DIMENSION_PROPS = {
|
|
4739
|
+
boxSizing: PASS_THROUGH,
|
|
4739
4740
|
width: PASS_THROUGH,
|
|
4740
4741
|
minWidth: PASS_THROUGH,
|
|
4741
4742
|
maxWidth: PASS_THROUGH,
|
|
@@ -4946,6 +4947,7 @@ const TYPO_PROPS = {
|
|
|
4946
4947
|
pre: applyToCssPropWhenTruthy("whiteSpace", "pre", "normal"),
|
|
4947
4948
|
preWrap: applyToCssPropWhenTruthy("whiteSpace", "pre-wrap", "normal"),
|
|
4948
4949
|
preLine: applyToCssPropWhenTruthy("whiteSpace", "pre-line", "normal"),
|
|
4950
|
+
userSelect: PASS_THROUGH,
|
|
4949
4951
|
};
|
|
4950
4952
|
const VISUAL_PROPS = {
|
|
4951
4953
|
outline: PASS_THROUGH,
|
|
@@ -5008,7 +5010,11 @@ const CONTENT_PROPS = {
|
|
|
5008
5010
|
}
|
|
5009
5011
|
return { alignItems: value };
|
|
5010
5012
|
}
|
|
5011
|
-
|
|
5013
|
+
|
|
5014
|
+
return {
|
|
5015
|
+
verticalAlign:
|
|
5016
|
+
{ center: "middle", start: "top", end: "bottom" }[value] || value,
|
|
5017
|
+
};
|
|
5012
5018
|
},
|
|
5013
5019
|
spacing: (value, { boxFlow }) => {
|
|
5014
5020
|
if (
|
|
@@ -13642,7 +13648,7 @@ const installCustomConstraintValidation = (
|
|
|
13642
13648
|
}
|
|
13643
13649
|
}
|
|
13644
13650
|
|
|
13645
|
-
if (failedConstraintInfo) {
|
|
13651
|
+
if (failedConstraintInfo && !failedConstraintInfo.silent) {
|
|
13646
13652
|
if (!hasTitleAttribute) {
|
|
13647
13653
|
// when a constraint is failing browser displays that constraint message if the element has no title attribute.
|
|
13648
13654
|
// We want to do the same with our message (overriding the browser in the process to get better messages)
|
|
@@ -14831,6 +14837,14 @@ const Icon = ({
|
|
|
14831
14837
|
const ariaProps = decorative ? {
|
|
14832
14838
|
"aria-hidden": "true"
|
|
14833
14839
|
} : {};
|
|
14840
|
+
if (typeof children === "string") {
|
|
14841
|
+
return jsx(Text, {
|
|
14842
|
+
...props,
|
|
14843
|
+
...ariaProps,
|
|
14844
|
+
"data-icon-text": "",
|
|
14845
|
+
children: children
|
|
14846
|
+
});
|
|
14847
|
+
}
|
|
14834
14848
|
if (box) {
|
|
14835
14849
|
return jsx(Box, {
|
|
14836
14850
|
square: true,
|
|
@@ -15675,6 +15689,7 @@ const useUIStateController = (
|
|
|
15675
15689
|
fallbackState = "",
|
|
15676
15690
|
getStateFromProp = (prop) => prop,
|
|
15677
15691
|
getPropFromState = (state) => state,
|
|
15692
|
+
getStateFromParent,
|
|
15678
15693
|
} = {},
|
|
15679
15694
|
) => {
|
|
15680
15695
|
const parentUIStateController = useContext(ParentUIStateControllerContext);
|
|
@@ -15701,6 +15716,9 @@ const useUIStateController = (
|
|
|
15701
15716
|
// (I think this should likely move earlier to win over the hasUIStateProp when it's undefined)
|
|
15702
15717
|
return getStateFromProp(navState);
|
|
15703
15718
|
}
|
|
15719
|
+
if (parentUIStateController && getStateFromParent) {
|
|
15720
|
+
return getStateFromParent(parentUIStateController);
|
|
15721
|
+
}
|
|
15704
15722
|
return getStateFromProp(fallbackState);
|
|
15705
15723
|
});
|
|
15706
15724
|
|
|
@@ -15927,7 +15945,7 @@ const useUIGroupStateController = (
|
|
|
15927
15945
|
throw new TypeError("aggregateChildStates must be a function");
|
|
15928
15946
|
}
|
|
15929
15947
|
const parentUIStateController = useContext(ParentUIStateControllerContext);
|
|
15930
|
-
const { onUIStateChange, name } = props;
|
|
15948
|
+
const { onUIStateChange, name, value } = props;
|
|
15931
15949
|
const childUIStateControllerArrayRef = useRef([]);
|
|
15932
15950
|
const childUIStateControllerArray = childUIStateControllerArrayRef.current;
|
|
15933
15951
|
const uiStateControllerRef = useRef();
|
|
@@ -15977,6 +15995,7 @@ const useUIGroupStateController = (
|
|
|
15977
15995
|
if (existingUIStateController) {
|
|
15978
15996
|
existingUIStateController.name = name;
|
|
15979
15997
|
existingUIStateController.onUIStateChange = onUIStateChange;
|
|
15998
|
+
existingUIStateController.value = value;
|
|
15980
15999
|
return existingUIStateController;
|
|
15981
16000
|
}
|
|
15982
16001
|
|
|
@@ -15990,6 +16009,7 @@ const useUIGroupStateController = (
|
|
|
15990
16009
|
const uiStateController = {
|
|
15991
16010
|
componentType,
|
|
15992
16011
|
name,
|
|
16012
|
+
value,
|
|
15993
16013
|
onUIStateChange,
|
|
15994
16014
|
uiState: emptyState,
|
|
15995
16015
|
setUIState: (newUIState, e) => {
|
|
@@ -16231,6 +16251,11 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
16231
16251
|
}
|
|
16232
16252
|
}
|
|
16233
16253
|
|
|
16254
|
+
&[data-reveal-on-interaction] {
|
|
16255
|
+
--x-button-background-color: transparent;
|
|
16256
|
+
--x-button-border-color: transparent;
|
|
16257
|
+
}
|
|
16258
|
+
|
|
16234
16259
|
/* Hover */
|
|
16235
16260
|
&[data-hover] {
|
|
16236
16261
|
--x-button-border-color: var(--button-border-color-hover);
|
|
@@ -16379,7 +16404,8 @@ const ButtonBasic = props => {
|
|
|
16379
16404
|
autoFocus,
|
|
16380
16405
|
// visual
|
|
16381
16406
|
icon,
|
|
16382
|
-
|
|
16407
|
+
revealOnInteraction = icon,
|
|
16408
|
+
discrete = icon && !revealOnInteraction,
|
|
16383
16409
|
children,
|
|
16384
16410
|
...rest
|
|
16385
16411
|
} = props;
|
|
@@ -16402,11 +16428,11 @@ const ButtonBasic = props => {
|
|
|
16402
16428
|
const renderButtonContentMemoized = useCallback(renderButtonContent, [children]);
|
|
16403
16429
|
return jsxs(Box, {
|
|
16404
16430
|
"data-readonly-silent": innerLoading ? "" : undefined,
|
|
16405
|
-
"data-nohover": icon ? "" : undefined,
|
|
16406
16431
|
...remainingProps,
|
|
16407
16432
|
as: "button",
|
|
16408
16433
|
ref: ref,
|
|
16409
16434
|
"data-icon": icon ? "" : undefined,
|
|
16435
|
+
"data-reveal-on-interaction": revealOnInteraction ? "" : undefined,
|
|
16410
16436
|
"data-discrete": discrete ? "" : undefined,
|
|
16411
16437
|
"data-callout-arrow-x": "center",
|
|
16412
16438
|
"aria-busy": innerLoading
|
|
@@ -17757,7 +17783,11 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17757
17783
|
white
|
|
17758
17784
|
);
|
|
17759
17785
|
--border-color-readonly-checked: #d3d3d3;
|
|
17760
|
-
--background-color-readonly-checked:
|
|
17786
|
+
--background-color-readonly-checked: color-mix(
|
|
17787
|
+
in srgb,
|
|
17788
|
+
var(--background-color-checked) 30%,
|
|
17789
|
+
grey
|
|
17790
|
+
);
|
|
17761
17791
|
--checkmark-color-readonly: #eeeeee;
|
|
17762
17792
|
/* Disabled */
|
|
17763
17793
|
--border-color-disabled: var(--border-color-readonly);
|
|
@@ -17835,7 +17865,6 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17835
17865
|
.navi_checkbox {
|
|
17836
17866
|
--x-background-color: var(--background-color);
|
|
17837
17867
|
--x-border-color: var(--border-color);
|
|
17838
|
-
--x-color: var(--color);
|
|
17839
17868
|
--x-checkmark-color: var(--checkmark-color);
|
|
17840
17869
|
--x-cursor: var(--cursor);
|
|
17841
17870
|
|
|
@@ -18072,21 +18101,18 @@ const CheckboxStyleCSSVars = {
|
|
|
18072
18101
|
"accentColor": "--accent-color",
|
|
18073
18102
|
":hover": {
|
|
18074
18103
|
backgroundColor: "--background-color-hover",
|
|
18075
|
-
borderColor: "--border-color-hover"
|
|
18076
|
-
color: "--color-hover"
|
|
18104
|
+
borderColor: "--border-color-hover"
|
|
18077
18105
|
},
|
|
18078
18106
|
":active": {
|
|
18079
18107
|
borderColor: "--border-color-active"
|
|
18080
18108
|
},
|
|
18081
18109
|
":read-only": {
|
|
18082
18110
|
backgroundColor: "--background-color-readonly",
|
|
18083
|
-
borderColor: "--border-color-readonly"
|
|
18084
|
-
color: "--color-readonly"
|
|
18111
|
+
borderColor: "--border-color-readonly"
|
|
18085
18112
|
},
|
|
18086
18113
|
":disabled": {
|
|
18087
18114
|
backgroundColor: "--background-color-disabled",
|
|
18088
|
-
borderColor: "--border-color-disabled"
|
|
18089
|
-
color: "--color-disabled"
|
|
18115
|
+
borderColor: "--border-color-disabled"
|
|
18090
18116
|
}
|
|
18091
18117
|
};
|
|
18092
18118
|
const CheckboxToggleStyleCSSVars = {
|
|
@@ -18467,33 +18493,35 @@ forwardRef((props, ref) => {
|
|
|
18467
18493
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
18468
18494
|
@layer navi {
|
|
18469
18495
|
.navi_radio {
|
|
18496
|
+
--margin: 3px 3px 0 5px;
|
|
18470
18497
|
--outline-offset: 1px;
|
|
18471
18498
|
--outline-width: 2px;
|
|
18472
|
-
--width:
|
|
18473
|
-
--height:
|
|
18499
|
+
--width: 0.815em;
|
|
18500
|
+
--height: 0.815em;
|
|
18474
18501
|
|
|
18475
18502
|
--outline-color: var(--navi-focus-outline-color);
|
|
18476
18503
|
--loader-color: var(--navi-loader-color);
|
|
18477
18504
|
--border-color: light-dark(#767676, #8e8e93);
|
|
18478
18505
|
--background-color: white;
|
|
18479
|
-
--color: light-dark(#4476ff, #3b82f6);
|
|
18480
|
-
--radiomark-color: var(--color);
|
|
18481
|
-
--border-color-checked: var(--color);
|
|
18506
|
+
--accent-color: light-dark(#4476ff, #3b82f6);
|
|
18507
|
+
--radiomark-color: var(--accent-color);
|
|
18508
|
+
--border-color-checked: var(--accent-color);
|
|
18509
|
+
--cursor: pointer;
|
|
18482
18510
|
|
|
18483
|
-
--color-mix-light:
|
|
18484
|
-
--color-mix-dark:
|
|
18511
|
+
--color-mix-light: black;
|
|
18512
|
+
--color-mix-dark: white;
|
|
18485
18513
|
--color-mix: var(--color-mix-light);
|
|
18486
18514
|
|
|
18487
18515
|
/* Hover */
|
|
18488
18516
|
--border-color-hover: color-mix(in srgb, var(--border-color) 60%, black);
|
|
18489
18517
|
--border-color-hover-checked: color-mix(
|
|
18490
18518
|
in srgb,
|
|
18491
|
-
var(--color) 80%,
|
|
18519
|
+
var(--border-color-checked) 80%,
|
|
18492
18520
|
var(--color-mix)
|
|
18493
18521
|
);
|
|
18494
18522
|
--radiomark-color-hover: color-mix(
|
|
18495
18523
|
in srgb,
|
|
18496
|
-
var(--color) 80%,
|
|
18524
|
+
var(--radiomark-color) 80%,
|
|
18497
18525
|
var(--color-mix)
|
|
18498
18526
|
);
|
|
18499
18527
|
/* Readonly */
|
|
@@ -18503,30 +18531,52 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18503
18531
|
white
|
|
18504
18532
|
);
|
|
18505
18533
|
--background-color-readonly: var(--background-color);
|
|
18506
|
-
--radiomark-color-readonly:
|
|
18507
|
-
|
|
18508
|
-
|
|
18534
|
+
--radiomark-color-readonly: color-mix(
|
|
18535
|
+
in srgb,
|
|
18536
|
+
var(--radiomark-color) 30%,
|
|
18537
|
+
grey
|
|
18538
|
+
);
|
|
18539
|
+
--border-color-readonly-checked: color-mix(
|
|
18540
|
+
in srgb,
|
|
18541
|
+
var(--radiomark-color) 30%,
|
|
18542
|
+
transparent
|
|
18543
|
+
);
|
|
18544
|
+
--background-color-readonly-checked: var(--border-color-readonly-checked);
|
|
18509
18545
|
/* Disabled */
|
|
18510
18546
|
--border-color-disabled: var(--border-color-readonly);
|
|
18511
18547
|
--background-color-disabled: rgba(248, 248, 248, 0.7);
|
|
18512
18548
|
--radiomark-color-disabled: #d3d3d3;
|
|
18513
18549
|
--border-color-checked-disabled: #d3d3d3;
|
|
18514
18550
|
--background-color-disabled-checked: var(--background-color);
|
|
18551
|
+
|
|
18552
|
+
/* Button specific */
|
|
18553
|
+
--button-border-width: 1px;
|
|
18554
|
+
--button-border-color: transparent;
|
|
18555
|
+
--button-background-color: transparent;
|
|
18556
|
+
--button-border-color-hover: color-mix(
|
|
18557
|
+
in srgb,
|
|
18558
|
+
var(--button-border-color) 70%,
|
|
18559
|
+
black
|
|
18560
|
+
);
|
|
18561
|
+
--button-background-color-hover: color-mix(
|
|
18562
|
+
in srgb,
|
|
18563
|
+
var(--button-border-color) 95%,
|
|
18564
|
+
black
|
|
18565
|
+
);
|
|
18566
|
+
--button-border-color-checked: var(--accent-color);
|
|
18567
|
+
--button-background-color-checked: transparent;
|
|
18568
|
+
--button-border-color-readonly: #eeeeee;
|
|
18569
|
+
--button-background-color-readonly: #d3d3d3;
|
|
18570
|
+
--button-border-color-disabled: var(--border-color-readonly);
|
|
18571
|
+
--button-background-color-disabled: var(--background-color-readonly);
|
|
18515
18572
|
}
|
|
18516
18573
|
|
|
18517
|
-
|
|
18574
|
+
&[data-dark] {
|
|
18518
18575
|
--color-mix: var(--color-mix-dark);
|
|
18519
18576
|
}
|
|
18520
18577
|
}
|
|
18521
18578
|
|
|
18522
18579
|
.navi_radio {
|
|
18523
|
-
position: relative;
|
|
18524
|
-
display: inline-flex;
|
|
18525
|
-
box-sizing: content-box;
|
|
18526
|
-
margin-top: 3px;
|
|
18527
|
-
margin-right: 3px;
|
|
18528
|
-
margin-left: 5px;
|
|
18529
|
-
|
|
18530
18580
|
--x-outline-offset: var(--outline-offset);
|
|
18531
18581
|
--x-outline-width: var(--outline-width);
|
|
18532
18582
|
--x-border-width: var(--border-width);
|
|
@@ -18535,102 +18585,201 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18535
18585
|
--x-outline-color: var(--outline-color);
|
|
18536
18586
|
--x-background-color: var(--background-color);
|
|
18537
18587
|
--x-border-color: var(--border-color);
|
|
18538
|
-
--x-color: var(--color);
|
|
18539
18588
|
--x-radiomark-color: var(--radiomark-color);
|
|
18540
|
-
|
|
18541
|
-
|
|
18542
|
-
position:
|
|
18543
|
-
inset: 0;
|
|
18544
|
-
margin: 0;
|
|
18545
|
-
padding: 0;
|
|
18546
|
-
opacity: 0;
|
|
18547
|
-
cursor: inherit;
|
|
18548
|
-
}
|
|
18549
|
-
.navi_radio .navi_radio_field {
|
|
18589
|
+
--x-cursor: var(--cursor);
|
|
18590
|
+
|
|
18591
|
+
position: relative;
|
|
18550
18592
|
display: inline-flex;
|
|
18551
|
-
box-sizing:
|
|
18552
|
-
|
|
18553
|
-
height: var(--x-height);
|
|
18554
|
-
align-items: center;
|
|
18555
|
-
justify-content: center;
|
|
18556
|
-
border-radius: 50%;
|
|
18557
|
-
outline-width: var(--x-outline-width);
|
|
18558
|
-
outline-style: none;
|
|
18559
|
-
outline-color: var(--x-outline-color);
|
|
18560
|
-
outline-offset: var(--x-outline-offset);
|
|
18561
|
-
}
|
|
18562
|
-
.navi_radio_field svg {
|
|
18563
|
-
overflow: visible;
|
|
18564
|
-
}
|
|
18565
|
-
.navi_radio_border {
|
|
18566
|
-
fill: var(--x-background-color);
|
|
18567
|
-
stroke: var(--x-border-color);
|
|
18568
|
-
}
|
|
18569
|
-
.navi_radio_marker {
|
|
18570
|
-
width: 100%;
|
|
18571
|
-
height: 100%;
|
|
18572
|
-
opacity: 0;
|
|
18573
|
-
fill: var(--x-radiomark-color);
|
|
18574
|
-
transform: scale(0.3);
|
|
18575
|
-
transform-origin: center;
|
|
18576
|
-
pointer-events: none;
|
|
18577
|
-
}
|
|
18578
|
-
.navi_radio_dashed_border {
|
|
18579
|
-
display: none;
|
|
18580
|
-
}
|
|
18581
|
-
.navi_radio[data-transition] .navi_radio_marker {
|
|
18582
|
-
transition: all 0.15s ease;
|
|
18583
|
-
}
|
|
18584
|
-
.navi_radio[data-transition] .navi_radio_dashed_border {
|
|
18585
|
-
transition: all 0.15s ease;
|
|
18586
|
-
}
|
|
18587
|
-
.navi_radio[data-transition] .navi_radio_border {
|
|
18588
|
-
transition: all 0.15s ease;
|
|
18589
|
-
}
|
|
18593
|
+
box-sizing: content-box;
|
|
18594
|
+
margin: var(--margin);
|
|
18590
18595
|
|
|
18591
|
-
|
|
18592
|
-
|
|
18593
|
-
|
|
18594
|
-
|
|
18595
|
-
|
|
18596
|
-
|
|
18597
|
-
|
|
18598
|
-
|
|
18599
|
-
|
|
18600
|
-
|
|
18601
|
-
|
|
18602
|
-
|
|
18603
|
-
|
|
18604
|
-
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
|
|
18608
|
-
|
|
18609
|
-
|
|
18610
|
-
|
|
18611
|
-
|
|
18612
|
-
|
|
18613
|
-
|
|
18614
|
-
|
|
18615
|
-
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
|
|
18620
|
-
|
|
18621
|
-
|
|
18622
|
-
|
|
18623
|
-
|
|
18624
|
-
|
|
18625
|
-
|
|
18626
|
-
|
|
18627
|
-
|
|
18628
|
-
|
|
18629
|
-
|
|
18630
|
-
|
|
18631
|
-
|
|
18632
|
-
|
|
18633
|
-
|
|
18596
|
+
.navi_native_field {
|
|
18597
|
+
position: absolute;
|
|
18598
|
+
inset: 0;
|
|
18599
|
+
margin: 0;
|
|
18600
|
+
padding: 0;
|
|
18601
|
+
border: none;
|
|
18602
|
+
border-radius: inherit;
|
|
18603
|
+
opacity: 0;
|
|
18604
|
+
appearance: none; /* This allows border-radius to have an effect */
|
|
18605
|
+
cursor: var(--x-cursor);
|
|
18606
|
+
}
|
|
18607
|
+
|
|
18608
|
+
/* Focus */
|
|
18609
|
+
&[data-focus-visible] {
|
|
18610
|
+
z-index: 1;
|
|
18611
|
+
.navi_radio_field {
|
|
18612
|
+
outline-style: solid;
|
|
18613
|
+
}
|
|
18614
|
+
}
|
|
18615
|
+
/* Hover */
|
|
18616
|
+
&[data-hover] {
|
|
18617
|
+
--x-border-color: var(--border-color-hover);
|
|
18618
|
+
--x-radiomark-color: var(--radiomark-color-hover);
|
|
18619
|
+
}
|
|
18620
|
+
/* Checked */
|
|
18621
|
+
&[data-checked] {
|
|
18622
|
+
--x-border-color: var(--border-color-checked);
|
|
18623
|
+
|
|
18624
|
+
&[data-hover] {
|
|
18625
|
+
--x-border-color: var(--border-color-hover-checked);
|
|
18626
|
+
}
|
|
18627
|
+
}
|
|
18628
|
+
/* Readonly */
|
|
18629
|
+
&[data-readonly] {
|
|
18630
|
+
--x-cursor: default;
|
|
18631
|
+
--x-background-color: var(--background-color-readonly);
|
|
18632
|
+
--x-border-color: var(--border-color-readonly);
|
|
18633
|
+
--x-radiomark-color: var(--radiomark-color-readonly);
|
|
18634
|
+
|
|
18635
|
+
.navi_radio_dashed_border {
|
|
18636
|
+
display: none;
|
|
18637
|
+
}
|
|
18638
|
+
|
|
18639
|
+
&[data-checked] {
|
|
18640
|
+
--x-background-color: var(--background-color-readonly-checked);
|
|
18641
|
+
--x-border-color: var(--border-color-readonly-checked);
|
|
18642
|
+
--x-radiomark-color: var(--radiomark-color-readonly);
|
|
18643
|
+
}
|
|
18644
|
+
}
|
|
18645
|
+
/* Disabled */
|
|
18646
|
+
&[data-disabled] {
|
|
18647
|
+
--x-cursor: default;
|
|
18648
|
+
--x-background-color: var(--background-color-disabled);
|
|
18649
|
+
--x-border-color: var(--border-color-disabled);
|
|
18650
|
+
--x-radiomark-color: var(--radiomark-color-disabled);
|
|
18651
|
+
|
|
18652
|
+
&[data-checked] {
|
|
18653
|
+
--x-border-color: var(--border-color-disabled);
|
|
18654
|
+
--x-radiomark-color: var(--radiomark-color-disabled);
|
|
18655
|
+
}
|
|
18656
|
+
}
|
|
18657
|
+
|
|
18658
|
+
.navi_radio_field {
|
|
18659
|
+
box-sizing: border-box;
|
|
18660
|
+
width: var(--x-width);
|
|
18661
|
+
height: var(--x-height);
|
|
18662
|
+
outline-width: var(--x-outline-width);
|
|
18663
|
+
outline-style: none;
|
|
18664
|
+
outline-color: var(--x-outline-color);
|
|
18665
|
+
outline-offset: var(--x-outline-offset);
|
|
18666
|
+
pointer-events: none;
|
|
18667
|
+
}
|
|
18668
|
+
|
|
18669
|
+
/* Radio appearance */
|
|
18670
|
+
&[data-appearance="radio"] {
|
|
18671
|
+
.navi_radio_field {
|
|
18672
|
+
display: inline-flex;
|
|
18673
|
+
align-items: center;
|
|
18674
|
+
justify-content: center;
|
|
18675
|
+
border-radius: 50%;
|
|
18676
|
+
|
|
18677
|
+
svg {
|
|
18678
|
+
overflow: visible;
|
|
18679
|
+
}
|
|
18680
|
+
|
|
18681
|
+
.navi_radio_border {
|
|
18682
|
+
fill: var(--x-background-color);
|
|
18683
|
+
stroke: var(--x-border-color);
|
|
18684
|
+
}
|
|
18685
|
+
.navi_radio_dashed_border {
|
|
18686
|
+
display: none;
|
|
18687
|
+
}
|
|
18688
|
+
.navi_radio_marker {
|
|
18689
|
+
width: 100%;
|
|
18690
|
+
height: 100%;
|
|
18691
|
+
opacity: 0;
|
|
18692
|
+
fill: var(--x-radiomark-color);
|
|
18693
|
+
transform: scale(0.3);
|
|
18694
|
+
transform-origin: center;
|
|
18695
|
+
pointer-events: none;
|
|
18696
|
+
}
|
|
18697
|
+
}
|
|
18698
|
+
|
|
18699
|
+
&[data-transition] {
|
|
18700
|
+
.navi_radio_border {
|
|
18701
|
+
transition: all 0.15s ease;
|
|
18702
|
+
}
|
|
18703
|
+
.navi_radio_dashed_border {
|
|
18704
|
+
transition: all 0.15s ease;
|
|
18705
|
+
}
|
|
18706
|
+
.navi_radio_marker {
|
|
18707
|
+
transition: all 0.15s ease;
|
|
18708
|
+
}
|
|
18709
|
+
}
|
|
18710
|
+
|
|
18711
|
+
&[data-checked] {
|
|
18712
|
+
.navi_radio_marker {
|
|
18713
|
+
opacity: 1;
|
|
18714
|
+
transform: scale(1);
|
|
18715
|
+
}
|
|
18716
|
+
}
|
|
18717
|
+
}
|
|
18718
|
+
|
|
18719
|
+
/* Icon appearance */
|
|
18720
|
+
&[data-appearance="icon"] {
|
|
18721
|
+
--width: auto;
|
|
18722
|
+
--height: auto;
|
|
18723
|
+
--outline-offset: 2px;
|
|
18724
|
+
--outline-width: 2px;
|
|
18725
|
+
}
|
|
18726
|
+
|
|
18727
|
+
/* Button appearance */
|
|
18728
|
+
&[data-appearance="button"] {
|
|
18729
|
+
--margin: 0;
|
|
18730
|
+
--outline-offset: 0px;
|
|
18731
|
+
--width: auto;
|
|
18732
|
+
--height: auto;
|
|
18733
|
+
--padding: 2px;
|
|
18734
|
+
--border-color: var(--button-border-color);
|
|
18735
|
+
--border-color-hover: var(--button-border-color-hover);
|
|
18736
|
+
--background-color: var(--button-background-color);
|
|
18737
|
+
--background-color-hover: var(--button-background-color-hover);
|
|
18738
|
+
--background-color-readonly: var(--button-background-color-readonly);
|
|
18739
|
+
--background-color-disabled: var(--button-background-color-disabled);
|
|
18740
|
+
--border-color-checked: var(--button-border-color);
|
|
18741
|
+
--background-color-checked: var(--button-background-color);
|
|
18742
|
+
|
|
18743
|
+
.navi_radio_field {
|
|
18744
|
+
display: inline-flex;
|
|
18745
|
+
box-sizing: border-box;
|
|
18746
|
+
padding-top: var(--padding-top, var(--padding-y, var(--padding)));
|
|
18747
|
+
padding-right: var(--padding-right, var(--padding-x, var(--padding)));
|
|
18748
|
+
padding-bottom: var(--padding-bottom, var(--padding-y, var(--padding)));
|
|
18749
|
+
padding-left: var(--padding-left, var(--padding-x, var(--padding)));
|
|
18750
|
+
align-items: center;
|
|
18751
|
+
justify-content: center;
|
|
18752
|
+
background-color: var(--x-background-color);
|
|
18753
|
+
border-width: var(--button-border-width);
|
|
18754
|
+
border-style: solid;
|
|
18755
|
+
border-color: var(--x-border-color);
|
|
18756
|
+
border-radius: var(--button-border-radius);
|
|
18757
|
+
|
|
18758
|
+
.navi_icon,
|
|
18759
|
+
img {
|
|
18760
|
+
border-radius: inherit;
|
|
18761
|
+
}
|
|
18762
|
+
}
|
|
18763
|
+
|
|
18764
|
+
&[data-hover] {
|
|
18765
|
+
--x-background-color: var(--button-background-color-hover);
|
|
18766
|
+
--x-border-color: var(--button-border-color-hover);
|
|
18767
|
+
}
|
|
18768
|
+
&[data-checked] {
|
|
18769
|
+
--x-border-color: var(--button-border-color-checked);
|
|
18770
|
+
--x-background-color: var(--button-background-color-checked);
|
|
18771
|
+
|
|
18772
|
+
.navi_radio_field {
|
|
18773
|
+
box-shadow:
|
|
18774
|
+
inset 0 2px 4px rgba(0, 0, 0, 0.15),
|
|
18775
|
+
inset 0 0 0 1px var(--button-border-color-checked);
|
|
18776
|
+
}
|
|
18777
|
+
}
|
|
18778
|
+
&[data-disabled] {
|
|
18779
|
+
--x-border-color: var(--button-border-color-disabled);
|
|
18780
|
+
--x-background-color: var(--button-background-color-disabled);
|
|
18781
|
+
}
|
|
18782
|
+
}
|
|
18634
18783
|
}
|
|
18635
18784
|
`;
|
|
18636
18785
|
const InputRadio = props => {
|
|
@@ -18641,7 +18790,13 @@ const InputRadio = props => {
|
|
|
18641
18790
|
statePropName: "checked",
|
|
18642
18791
|
fallbackState: false,
|
|
18643
18792
|
getStateFromProp: checked => checked ? value : undefined,
|
|
18644
|
-
getPropFromState: Boolean
|
|
18793
|
+
getPropFromState: Boolean,
|
|
18794
|
+
getStateFromParent: parentUIStateController => {
|
|
18795
|
+
if (parentUIStateController.componentType === "radio_list") {
|
|
18796
|
+
return parentUIStateController.value === props.value;
|
|
18797
|
+
}
|
|
18798
|
+
return undefined;
|
|
18799
|
+
}
|
|
18645
18800
|
});
|
|
18646
18801
|
const uiState = useUIState(uiStateController);
|
|
18647
18802
|
const radio = renderActionableComponent(props, {
|
|
@@ -18657,29 +18812,48 @@ const InputRadio = props => {
|
|
|
18657
18812
|
});
|
|
18658
18813
|
};
|
|
18659
18814
|
const RadioStyleCSSVars = {
|
|
18815
|
+
"width": "--width",
|
|
18816
|
+
"height": "--height",
|
|
18817
|
+
"borderRadius": "--border-radius",
|
|
18660
18818
|
"outlineWidth": "--outline-width",
|
|
18661
18819
|
"borderWidth": "--border-width",
|
|
18662
|
-
"borderRadius": "--border-radius",
|
|
18663
18820
|
"backgroundColor": "--background-color",
|
|
18664
18821
|
"borderColor": "--border-color",
|
|
18665
|
-
"
|
|
18822
|
+
"accentColor": "--accent-color",
|
|
18666
18823
|
":hover": {
|
|
18667
18824
|
backgroundColor: "--background-color-hover",
|
|
18668
|
-
borderColor: "--border-color-hover"
|
|
18669
|
-
color: "--color-hover"
|
|
18825
|
+
borderColor: "--border-color-hover"
|
|
18670
18826
|
},
|
|
18671
18827
|
":active": {
|
|
18672
18828
|
borderColor: "--border-color-active"
|
|
18673
18829
|
},
|
|
18674
18830
|
":read-only": {
|
|
18675
18831
|
backgroundColor: "--background-color-readonly",
|
|
18676
|
-
borderColor: "--border-color-readonly"
|
|
18677
|
-
color: "--color-readonly"
|
|
18832
|
+
borderColor: "--border-color-readonly"
|
|
18678
18833
|
},
|
|
18679
18834
|
":disabled": {
|
|
18680
18835
|
backgroundColor: "--background-color-disabled",
|
|
18681
|
-
borderColor: "--border-color-disabled"
|
|
18682
|
-
|
|
18836
|
+
borderColor: "--border-color-disabled"
|
|
18837
|
+
}
|
|
18838
|
+
};
|
|
18839
|
+
const RadioButtonStyleCSSVars = {
|
|
18840
|
+
...RadioStyleCSSVars,
|
|
18841
|
+
"padding": "--padding",
|
|
18842
|
+
"borderRadius": "--button-border-radius",
|
|
18843
|
+
"borderWidth": "--button-border-width",
|
|
18844
|
+
"borderColor": "--button-border-color",
|
|
18845
|
+
"backgroundColor": "--button-background-color",
|
|
18846
|
+
":hover": {
|
|
18847
|
+
backgroundColor: "--button-background-color-hover",
|
|
18848
|
+
borderColor: "--button-border-color-hover"
|
|
18849
|
+
},
|
|
18850
|
+
":read-only": {
|
|
18851
|
+
backgroundColor: "--button-background-color-readonly",
|
|
18852
|
+
borderColor: "--button-border-color-readonly"
|
|
18853
|
+
},
|
|
18854
|
+
":disabled": {
|
|
18855
|
+
backgroundColor: "--button-background-color-disabled",
|
|
18856
|
+
borderColor: "--button-border-color-disabled"
|
|
18683
18857
|
}
|
|
18684
18858
|
};
|
|
18685
18859
|
const RadioPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":checked", ":-navi-loading"];
|
|
@@ -18708,6 +18882,8 @@ const InputRadioBasic = props => {
|
|
|
18708
18882
|
autoFocus,
|
|
18709
18883
|
onClick,
|
|
18710
18884
|
onInput,
|
|
18885
|
+
icon,
|
|
18886
|
+
appearance = icon ? "icon" : "radio",
|
|
18711
18887
|
color,
|
|
18712
18888
|
...rest
|
|
18713
18889
|
} = props;
|
|
@@ -18784,9 +18960,10 @@ const InputRadioBasic = props => {
|
|
|
18784
18960
|
}
|
|
18785
18961
|
});
|
|
18786
18962
|
const renderRadioMemoized = useCallback(renderRadio, [innerName, checked, innerRequired]);
|
|
18963
|
+
const boxRef = useRef();
|
|
18787
18964
|
useLayoutEffect(() => {
|
|
18788
|
-
const naviRadio =
|
|
18789
|
-
const luminance = resolveColorLuminance("var(--color)", naviRadio);
|
|
18965
|
+
const naviRadio = boxRef.current;
|
|
18966
|
+
const luminance = resolveColorLuminance("var(--accent-color)", naviRadio);
|
|
18790
18967
|
if (luminance < 0.3) {
|
|
18791
18968
|
naviRadio.setAttribute("data-dark", "");
|
|
18792
18969
|
} else {
|
|
@@ -18796,10 +18973,11 @@ const InputRadioBasic = props => {
|
|
|
18796
18973
|
return jsxs(Box, {
|
|
18797
18974
|
as: "span",
|
|
18798
18975
|
...remainingProps,
|
|
18799
|
-
ref:
|
|
18976
|
+
ref: boxRef,
|
|
18977
|
+
"data-appearance": appearance,
|
|
18800
18978
|
baseClassName: "navi_radio",
|
|
18801
18979
|
pseudoStateSelector: ".navi_native_field",
|
|
18802
|
-
styleCSSVars: RadioStyleCSSVars,
|
|
18980
|
+
styleCSSVars: appearance === "button" ? RadioButtonStyleCSSVars : RadioStyleCSSVars,
|
|
18803
18981
|
pseudoClasses: RadioPseudoClasses,
|
|
18804
18982
|
pseudoElements: RadioPseudoElements,
|
|
18805
18983
|
basePseudoState: {
|
|
@@ -18816,7 +18994,7 @@ const InputRadioBasic = props => {
|
|
|
18816
18994
|
color: "var(--loader-color)"
|
|
18817
18995
|
}), renderRadioMemoized, jsx("span", {
|
|
18818
18996
|
className: "navi_radio_field",
|
|
18819
|
-
children: jsxs("svg", {
|
|
18997
|
+
children: appearance === "radio" ? jsxs("svg", {
|
|
18820
18998
|
viewBox: "0 0 12 12",
|
|
18821
18999
|
"aria-hidden": "true",
|
|
18822
19000
|
preserveAspectRatio: "xMidYMid meet",
|
|
@@ -18840,7 +19018,7 @@ const InputRadioBasic = props => {
|
|
|
18840
19018
|
cy: "6",
|
|
18841
19019
|
r: "3.5"
|
|
18842
19020
|
})]
|
|
18843
|
-
})
|
|
19021
|
+
}) : icon
|
|
18844
19022
|
})]
|
|
18845
19023
|
});
|
|
18846
19024
|
};
|
|
@@ -20115,15 +20293,8 @@ const FormWithAction = props => {
|
|
|
20115
20293
|
// form.dispatchEvent(customEvent);
|
|
20116
20294
|
// };
|
|
20117
20295
|
|
|
20118
|
-
installImportMetaCss(import.meta);import.meta.css = /* css
|
|
20119
|
-
|
|
20120
|
-
.navi_radio_list {
|
|
20121
|
-
display: flex;
|
|
20122
|
-
flex-direction: column;
|
|
20123
|
-
}
|
|
20124
|
-
}
|
|
20125
|
-
`;
|
|
20126
|
-
const RadioList = forwardRef((props, ref) => {
|
|
20296
|
+
installImportMetaCss(import.meta);import.meta.css = /* css */``;
|
|
20297
|
+
const RadioList = props => {
|
|
20127
20298
|
const uiStateController = useUIGroupStateController(props, "radio_list", {
|
|
20128
20299
|
childComponentType: "radio",
|
|
20129
20300
|
aggregateChildStates: childUIStateControllers => {
|
|
@@ -20138,7 +20309,10 @@ const RadioList = forwardRef((props, ref) => {
|
|
|
20138
20309
|
}
|
|
20139
20310
|
});
|
|
20140
20311
|
const uiState = useUIState(uiStateController);
|
|
20141
|
-
const radioList = renderActionableComponent(props,
|
|
20312
|
+
const radioList = renderActionableComponent(props, {
|
|
20313
|
+
Basic: RadioListBasic,
|
|
20314
|
+
WithAction: RadioListWithAction
|
|
20315
|
+
});
|
|
20142
20316
|
return jsx(UIStateControllerContext.Provider, {
|
|
20143
20317
|
value: uiStateController,
|
|
20144
20318
|
children: jsx(UIStateContext.Provider, {
|
|
@@ -20146,9 +20320,9 @@ const RadioList = forwardRef((props, ref) => {
|
|
|
20146
20320
|
children: radioList
|
|
20147
20321
|
})
|
|
20148
20322
|
});
|
|
20149
|
-
}
|
|
20323
|
+
};
|
|
20150
20324
|
const Radio = InputRadio;
|
|
20151
|
-
const RadioListBasic =
|
|
20325
|
+
const RadioListBasic = props => {
|
|
20152
20326
|
const contextReadOnly = useContext(ReadOnlyContext);
|
|
20153
20327
|
const contextDisabled = useContext(DisabledContext);
|
|
20154
20328
|
const contextLoading = useContext(LoadingContext);
|
|
@@ -20162,19 +20336,15 @@ const RadioListBasic = forwardRef((props, ref) => {
|
|
|
20162
20336
|
required,
|
|
20163
20337
|
...rest
|
|
20164
20338
|
} = props;
|
|
20165
|
-
const innerRef = useRef();
|
|
20166
|
-
useImperativeHandle(ref, () => innerRef.current);
|
|
20167
20339
|
const innerLoading = loading || contextLoading;
|
|
20168
20340
|
const innerReadOnly = readOnly || contextReadOnly || innerLoading || uiStateController.readOnly;
|
|
20169
20341
|
const innerDisabled = disabled || contextDisabled;
|
|
20170
|
-
return jsx(
|
|
20342
|
+
return jsx(Box, {
|
|
20171
20343
|
"data-action": rest["data-action"],
|
|
20344
|
+
row: true,
|
|
20172
20345
|
...rest,
|
|
20173
|
-
|
|
20174
|
-
|
|
20175
|
-
"data-radio-list": true
|
|
20176
|
-
// eslint-disable-next-line react/no-unknown-property
|
|
20177
|
-
,
|
|
20346
|
+
baseClassName: "navi_radio_list",
|
|
20347
|
+
"data-radio-list": true,
|
|
20178
20348
|
onresetuistate: e => {
|
|
20179
20349
|
uiStateController.resetUIState(e);
|
|
20180
20350
|
},
|
|
@@ -20198,8 +20368,8 @@ const RadioListBasic = forwardRef((props, ref) => {
|
|
|
20198
20368
|
})
|
|
20199
20369
|
})
|
|
20200
20370
|
});
|
|
20201
|
-
}
|
|
20202
|
-
|
|
20371
|
+
};
|
|
20372
|
+
const RadioListWithAction = props => {
|
|
20203
20373
|
const uiStateController = useContext(UIStateControllerContext);
|
|
20204
20374
|
const uiState = useContext(UIStateContext);
|
|
20205
20375
|
const {
|
|
@@ -20216,7 +20386,6 @@ forwardRef((props, ref) => {
|
|
|
20216
20386
|
...rest
|
|
20217
20387
|
} = props;
|
|
20218
20388
|
const innerRef = useRef();
|
|
20219
|
-
useImperativeHandle(ref, () => innerRef.current);
|
|
20220
20389
|
const [boundAction] = useActionBoundToOneParam(action, uiState);
|
|
20221
20390
|
const {
|
|
20222
20391
|
loading: actionLoading
|
|
@@ -20257,7 +20426,8 @@ forwardRef((props, ref) => {
|
|
|
20257
20426
|
const radioListContainer = innerRef.current;
|
|
20258
20427
|
requestAction(radioListContainer, boundAction, {
|
|
20259
20428
|
event: e,
|
|
20260
|
-
requester: radio
|
|
20429
|
+
requester: radio,
|
|
20430
|
+
actionOrigin: "action_prop"
|
|
20261
20431
|
});
|
|
20262
20432
|
},
|
|
20263
20433
|
loading: loading || actionLoading,
|
|
@@ -20266,7 +20436,7 @@ forwardRef((props, ref) => {
|
|
|
20266
20436
|
children: children
|
|
20267
20437
|
})
|
|
20268
20438
|
});
|
|
20269
|
-
}
|
|
20439
|
+
};
|
|
20270
20440
|
|
|
20271
20441
|
const useRefArray = (items, keyFromItem) => {
|
|
20272
20442
|
const refMapRef = useRef(new Map());
|
|
@@ -22965,10 +23135,10 @@ const initMoveStickyFrontierViaPointer = (pointerdownEvent, {
|
|
|
22965
23135
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
22966
23136
|
.navi_table_ui {
|
|
22967
23137
|
position: fixed;
|
|
22968
|
-
z-index: ${Z_INDEX_TABLE_UI};
|
|
22969
|
-
overflow: hidden; /* Ensure UI elements cannot impact scrollbars of the document */
|
|
22970
23138
|
inset: 0;
|
|
23139
|
+
z-index: ${Z_INDEX_TABLE_UI};
|
|
22971
23140
|
pointer-events: none; /* UI elements must use pointer-events: auto if they need to be interactive */
|
|
23141
|
+
overflow: hidden; /* Ensure UI elements cannot impact scrollbars of the document */
|
|
22972
23142
|
/* background: rgba(0, 255, 0, 0.2); */
|
|
22973
23143
|
}
|
|
22974
23144
|
`;
|
|
@@ -23609,16 +23779,17 @@ const TableCell = forwardRef((props, ref) => {
|
|
|
23609
23779
|
});
|
|
23610
23780
|
const RowNumberCol = ({
|
|
23611
23781
|
width = 50,
|
|
23612
|
-
minWidth = 30,
|
|
23613
|
-
maxWidth = 100,
|
|
23782
|
+
// minWidth = 30,
|
|
23783
|
+
// maxWidth = 100,
|
|
23614
23784
|
immovable = true,
|
|
23615
23785
|
...rest
|
|
23616
23786
|
}) => {
|
|
23617
23787
|
return jsx(Col, {
|
|
23618
23788
|
id: "row_number",
|
|
23619
|
-
width: width
|
|
23620
|
-
|
|
23621
|
-
|
|
23789
|
+
width: width
|
|
23790
|
+
// minWidth={minWidth}
|
|
23791
|
+
// maxWidth={maxWidth}
|
|
23792
|
+
,
|
|
23622
23793
|
immovable: immovable,
|
|
23623
23794
|
...rest
|
|
23624
23795
|
});
|
|
@@ -23789,8 +23960,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
23789
23960
|
position: absolute;
|
|
23790
23961
|
width: 1px;
|
|
23791
23962
|
height: 1px;
|
|
23792
|
-
padding: 0;
|
|
23793
23963
|
margin: -1px;
|
|
23964
|
+
padding: 0;
|
|
23794
23965
|
overflow: hidden;
|
|
23795
23966
|
clip: rect(0, 0, 0, 0);
|
|
23796
23967
|
white-space: nowrap;
|
|
@@ -23806,8 +23977,8 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
23806
23977
|
position: absolute;
|
|
23807
23978
|
width: 1px;
|
|
23808
23979
|
height: 1px;
|
|
23809
|
-
padding: 0;
|
|
23810
23980
|
margin: -1px;
|
|
23981
|
+
padding: 0;
|
|
23811
23982
|
overflow: hidden;
|
|
23812
23983
|
clip: rect(0, 0, 0, 0);
|
|
23813
23984
|
white-space: nowrap;
|
|
@@ -23859,6 +24030,118 @@ const KeyboardShortcutAriaElement = ({
|
|
|
23859
24030
|
});
|
|
23860
24031
|
};
|
|
23861
24032
|
|
|
24033
|
+
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
24034
|
+
@layer navi {
|
|
24035
|
+
.navi_clipboard_container {
|
|
24036
|
+
--height: 1.5em;
|
|
24037
|
+
--notif-spacing: 0.5em;
|
|
24038
|
+
}
|
|
24039
|
+
}
|
|
24040
|
+
|
|
24041
|
+
.navi_clipboard_container {
|
|
24042
|
+
position: relative;
|
|
24043
|
+
display: inline-flex;
|
|
24044
|
+
height: var(--height);
|
|
24045
|
+
align-items: center;
|
|
24046
|
+
|
|
24047
|
+
.navi_copied_notif {
|
|
24048
|
+
position: absolute;
|
|
24049
|
+
top: calc(-1 * var(--notif-spacing));
|
|
24050
|
+
right: 0;
|
|
24051
|
+
padding: 0.2em 0.5em;
|
|
24052
|
+
color: white;
|
|
24053
|
+
font-size: 80%;
|
|
24054
|
+
white-space: nowrap;
|
|
24055
|
+
background: black;
|
|
24056
|
+
border-radius: 3px;
|
|
24057
|
+
transform: translateY(-100%);
|
|
24058
|
+
}
|
|
24059
|
+
}
|
|
24060
|
+
`;
|
|
24061
|
+
const ButtonCopyToClipboard = ({
|
|
24062
|
+
children,
|
|
24063
|
+
...props
|
|
24064
|
+
}) => {
|
|
24065
|
+
const [copied, setCopied] = useState(false);
|
|
24066
|
+
const renderedRef = useRef();
|
|
24067
|
+
useEffect(() => {
|
|
24068
|
+
renderedRef.current = true;
|
|
24069
|
+
return () => {
|
|
24070
|
+
renderedRef.current = false;
|
|
24071
|
+
};
|
|
24072
|
+
}, []);
|
|
24073
|
+
return jsxs(Box, {
|
|
24074
|
+
class: "navi_clipboard_container",
|
|
24075
|
+
...props,
|
|
24076
|
+
children: [jsx(Box, {
|
|
24077
|
+
className: "navi_copied_notif",
|
|
24078
|
+
"aria-hidden": copied ? "false" : "true",
|
|
24079
|
+
opacity: copied ? 1 : 0,
|
|
24080
|
+
children: "Copi\xE9 !"
|
|
24081
|
+
}), jsx(Button, {
|
|
24082
|
+
className: "navi_copy_button",
|
|
24083
|
+
row: true,
|
|
24084
|
+
icon: true,
|
|
24085
|
+
revealOnInteraction: true,
|
|
24086
|
+
square: true,
|
|
24087
|
+
alignY: "center",
|
|
24088
|
+
expandY: true,
|
|
24089
|
+
borderRadius: "xs",
|
|
24090
|
+
action: async () => {
|
|
24091
|
+
await addToClipboard(children);
|
|
24092
|
+
setTimeout(() => {
|
|
24093
|
+
if (!renderedRef.current) {
|
|
24094
|
+
// do not call setState on unmounted component
|
|
24095
|
+
return;
|
|
24096
|
+
}
|
|
24097
|
+
setCopied(false);
|
|
24098
|
+
}, 1500);
|
|
24099
|
+
setCopied(true);
|
|
24100
|
+
},
|
|
24101
|
+
children: copied ? jsx(Icon, {
|
|
24102
|
+
color: "green",
|
|
24103
|
+
children: jsx(CopiedIcon, {})
|
|
24104
|
+
}) : jsx(Icon, {
|
|
24105
|
+
children: jsx(CopyIcon, {})
|
|
24106
|
+
})
|
|
24107
|
+
})]
|
|
24108
|
+
});
|
|
24109
|
+
};
|
|
24110
|
+
const addToClipboard = async text => {
|
|
24111
|
+
const type = "text/plain";
|
|
24112
|
+
const clipboardItemData = {
|
|
24113
|
+
[type]: text
|
|
24114
|
+
};
|
|
24115
|
+
const clipboardItem = new ClipboardItem(clipboardItemData);
|
|
24116
|
+
await window.navigator.clipboard.write([clipboardItem]);
|
|
24117
|
+
};
|
|
24118
|
+
const CopyIcon = () => jsxs("svg", {
|
|
24119
|
+
viewBox: "0 0 16 16",
|
|
24120
|
+
children: [jsx("path", {
|
|
24121
|
+
d: "M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"
|
|
24122
|
+
}), jsx("path", {
|
|
24123
|
+
d: "M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"
|
|
24124
|
+
})]
|
|
24125
|
+
});
|
|
24126
|
+
const CopiedIcon = () => jsx("svg", {
|
|
24127
|
+
viewBox: "0 0 16 16",
|
|
24128
|
+
children: jsx("path", {
|
|
24129
|
+
fill: "currentColor",
|
|
24130
|
+
d: "M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"
|
|
24131
|
+
})
|
|
24132
|
+
});
|
|
24133
|
+
|
|
24134
|
+
const Address = ({
|
|
24135
|
+
children,
|
|
24136
|
+
...props
|
|
24137
|
+
}) => {
|
|
24138
|
+
return jsx(Text, {
|
|
24139
|
+
as: "address",
|
|
24140
|
+
...props,
|
|
24141
|
+
children: children
|
|
24142
|
+
});
|
|
24143
|
+
};
|
|
24144
|
+
|
|
23862
24145
|
const CSS_VAR_NAME = "--x-color-contrasting";
|
|
23863
24146
|
|
|
23864
24147
|
const useContrastingColor = (ref, backgroundElementSelector) => {
|
|
@@ -24114,7 +24397,255 @@ const Caption = ({
|
|
|
24114
24397
|
});
|
|
24115
24398
|
};
|
|
24116
24399
|
|
|
24400
|
+
/**
|
|
24401
|
+
* Example of how you'd use this:
|
|
24402
|
+
* <code-block data-language="HTML" data-escaped="true">
|
|
24403
|
+
* <h1>Your HTML here. Any HTML should be escaped</h1>
|
|
24404
|
+
* </code-block>
|
|
24405
|
+
*
|
|
24406
|
+
* https://github.com/TheWebTech/hs-code-block-web-component/tree/main
|
|
24407
|
+
*/
|
|
24408
|
+
|
|
24409
|
+
const CodeBlock = ({
|
|
24410
|
+
language,
|
|
24411
|
+
escaped = false,
|
|
24412
|
+
children,
|
|
24413
|
+
...props
|
|
24414
|
+
}) => {
|
|
24415
|
+
return jsx("code-block", {
|
|
24416
|
+
"data-language": language,
|
|
24417
|
+
"data-escaped": escaped ? "" : null,
|
|
24418
|
+
...props,
|
|
24419
|
+
children: children
|
|
24420
|
+
});
|
|
24421
|
+
};
|
|
24422
|
+
(() => {
|
|
24423
|
+
const css = /* css */`
|
|
24424
|
+
*[aria-hidden="true"] {
|
|
24425
|
+
display: none;
|
|
24426
|
+
}
|
|
24427
|
+
|
|
24428
|
+
.clipboard_container {
|
|
24429
|
+
display: flex;
|
|
24430
|
+
padding: 8px;
|
|
24431
|
+
align-items: center;
|
|
24432
|
+
gap: 5px;
|
|
24433
|
+
}
|
|
24434
|
+
|
|
24435
|
+
#copied_notif {
|
|
24436
|
+
padding: 0.2em 0.5em;
|
|
24437
|
+
color: white;
|
|
24438
|
+
font-size: 80%;
|
|
24439
|
+
background: black;
|
|
24440
|
+
border-radius: 3px;
|
|
24441
|
+
}
|
|
24442
|
+
|
|
24443
|
+
button {
|
|
24444
|
+
width: 32px;
|
|
24445
|
+
height: 32px;
|
|
24446
|
+
background: none;
|
|
24447
|
+
background-color: rgb(246, 248, 250);
|
|
24448
|
+
border: none;
|
|
24449
|
+
border-width: 1px;
|
|
24450
|
+
border-style: solid;
|
|
24451
|
+
border-color: rgb(209, 217, 224);
|
|
24452
|
+
border-radius: 6px;
|
|
24453
|
+
cursor: pointer;
|
|
24454
|
+
}
|
|
24455
|
+
|
|
24456
|
+
button:hover {
|
|
24457
|
+
background-color: rgb(239, 242, 245);
|
|
24458
|
+
}
|
|
24459
|
+
`;
|
|
24460
|
+
const html = /* html */`<style>
|
|
24461
|
+
${css}
|
|
24462
|
+
</style>
|
|
24463
|
+
<div class="clipboard_container">
|
|
24464
|
+
<div id="copied_notif" aria-hidden="true">Copied !</div>
|
|
24465
|
+
<button id="copy_button">
|
|
24466
|
+
<svg
|
|
24467
|
+
id="copy_icon"
|
|
24468
|
+
aria-hidden="true"
|
|
24469
|
+
viewBox="0 0 16 16"
|
|
24470
|
+
width="16"
|
|
24471
|
+
height="16"
|
|
24472
|
+
>
|
|
24473
|
+
<path
|
|
24474
|
+
d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z"
|
|
24475
|
+
></path>
|
|
24476
|
+
<path
|
|
24477
|
+
d="M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z"
|
|
24478
|
+
></path>
|
|
24479
|
+
</svg>
|
|
24480
|
+
<svg
|
|
24481
|
+
id="copied_icon"
|
|
24482
|
+
aria-hidden="true"
|
|
24483
|
+
viewBox="0 0 16 16"
|
|
24484
|
+
width="16"
|
|
24485
|
+
height="16"
|
|
24486
|
+
>
|
|
24487
|
+
<path
|
|
24488
|
+
d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"
|
|
24489
|
+
></path>
|
|
24490
|
+
</svg>
|
|
24491
|
+
</button>
|
|
24492
|
+
</div>`;
|
|
24493
|
+
class ClipboardCopy extends HTMLElement {
|
|
24494
|
+
constructor() {
|
|
24495
|
+
super();
|
|
24496
|
+
const root = this.attachShadow({
|
|
24497
|
+
mode: "open"
|
|
24498
|
+
});
|
|
24499
|
+
root.innerHTML = html;
|
|
24500
|
+
}
|
|
24501
|
+
connectedCallback() {
|
|
24502
|
+
const valueToCopy = this.getAttribute("value");
|
|
24503
|
+
const shadowRoot = this.shadowRoot;
|
|
24504
|
+
const button = shadowRoot.querySelector("button");
|
|
24505
|
+
const copyIcon = shadowRoot.querySelector("#copy_icon");
|
|
24506
|
+
const copiedIcon = shadowRoot.querySelector("#copied_icon");
|
|
24507
|
+
const copiedNotif = shadowRoot.querySelector("#copied_notif");
|
|
24508
|
+
copyIcon.removeAttribute("aria-hidden");
|
|
24509
|
+
const copy = async () => {
|
|
24510
|
+
await addToClipboard(valueToCopy);
|
|
24511
|
+
copiedNotif.removeAttribute("aria-hidden");
|
|
24512
|
+
copyIcon.setAttribute("aria-hidden", "true");
|
|
24513
|
+
copiedIcon.setAttribute("aria-hidden", "false");
|
|
24514
|
+
setTimeout(() => {
|
|
24515
|
+
copiedNotif.setAttribute("aria-hidden", "true");
|
|
24516
|
+
copyIcon.setAttribute("aria-hidden", "false");
|
|
24517
|
+
copiedIcon.setAttribute("aria-hidden", "true");
|
|
24518
|
+
}, 1500);
|
|
24519
|
+
};
|
|
24520
|
+
button.onclick = () => {
|
|
24521
|
+
copy();
|
|
24522
|
+
};
|
|
24523
|
+
}
|
|
24524
|
+
}
|
|
24525
|
+
customElements.define("clipboard-copy", ClipboardCopy);
|
|
24526
|
+
const addToClipboard = async text => {
|
|
24527
|
+
const type = "text/plain";
|
|
24528
|
+
const clipboardItemData = {
|
|
24529
|
+
[type]: text
|
|
24530
|
+
};
|
|
24531
|
+
const clipboardItem = new ClipboardItem(clipboardItemData);
|
|
24532
|
+
await window.navigator.clipboard.write([clipboardItem]);
|
|
24533
|
+
};
|
|
24534
|
+
})();
|
|
24535
|
+
(() => {
|
|
24536
|
+
/*
|
|
24537
|
+
:host {
|
|
24538
|
+
display: block;
|
|
24539
|
+
}
|
|
24540
|
+
:host code[class*="language-"], :host pre[class*="language-"]{
|
|
24541
|
+
margin-top: 0;
|
|
24542
|
+
}
|
|
24543
|
+
*/
|
|
24544
|
+
|
|
24545
|
+
const css = /* css */`
|
|
24546
|
+
#code_block {
|
|
24547
|
+
position: relative;
|
|
24548
|
+
}
|
|
24549
|
+
|
|
24550
|
+
#pre {
|
|
24551
|
+
margin-top: 16px;
|
|
24552
|
+
margin-right: 0;
|
|
24553
|
+
margin-bottom: 16px;
|
|
24554
|
+
margin-left: 0;
|
|
24555
|
+
padding: 16px;
|
|
24556
|
+
font-size: 86%;
|
|
24557
|
+
background: #333;
|
|
24558
|
+
}
|
|
24559
|
+
`;
|
|
24560
|
+
const html = /* html */`<style>
|
|
24561
|
+
${css}
|
|
24562
|
+
</style>
|
|
24563
|
+
<div id="code_block">
|
|
24564
|
+
<pre id="pre"><code></code></pre>
|
|
24565
|
+
<div
|
|
24566
|
+
id="clipboard_copy_container"
|
|
24567
|
+
style="position: absolute; right: 0; top: 0"
|
|
24568
|
+
>
|
|
24569
|
+
<clipboard-copy></clipboard-copy>
|
|
24570
|
+
</div>
|
|
24571
|
+
</div>
|
|
24572
|
+
`;
|
|
24573
|
+
let loadPromise;
|
|
24574
|
+
const loadPrism = () => {
|
|
24575
|
+
if (loadPromise) {
|
|
24576
|
+
return loadPromise;
|
|
24577
|
+
}
|
|
24578
|
+
// https://prismjs.com/#basic-usage
|
|
24579
|
+
const scriptLoadPromise = new Promise((resolve, reject) => {
|
|
24580
|
+
window.Prism = window.Prism || {};
|
|
24581
|
+
window.Prism.manual = true;
|
|
24582
|
+
const script = document.createElement("script");
|
|
24583
|
+
script.src = "https://cdn.jsdelivr.net/npm/prismjs";
|
|
24584
|
+
script.onload = () => {
|
|
24585
|
+
resolve(window.Prism);
|
|
24586
|
+
};
|
|
24587
|
+
script.onerror = error => {
|
|
24588
|
+
reject(error);
|
|
24589
|
+
};
|
|
24590
|
+
document.head.appendChild(script);
|
|
24591
|
+
});
|
|
24592
|
+
const cssInjectionPromise = (async () => {
|
|
24593
|
+
const prismCssUrl = "https://cdn.jsdelivr.net/npm/prismjs/themes/prism-tomorrow.css?inline";
|
|
24594
|
+
const response = await window.fetch(prismCssUrl, {
|
|
24595
|
+
method: "GET"
|
|
24596
|
+
});
|
|
24597
|
+
const cssText = await response.text();
|
|
24598
|
+
const cssStylesheet = new CSSStyleSheet({
|
|
24599
|
+
baseUrl: prismCssUrl
|
|
24600
|
+
});
|
|
24601
|
+
cssStylesheet.replaceSync(cssText);
|
|
24602
|
+
return cssStylesheet;
|
|
24603
|
+
})();
|
|
24604
|
+
loadPromise = Promise.all([scriptLoadPromise, cssInjectionPromise]);
|
|
24605
|
+
return loadPromise;
|
|
24606
|
+
};
|
|
24607
|
+
class CodeBlock extends HTMLElement {
|
|
24608
|
+
constructor() {
|
|
24609
|
+
super();
|
|
24610
|
+
const root = this.attachShadow({
|
|
24611
|
+
mode: "open"
|
|
24612
|
+
});
|
|
24613
|
+
root.innerHTML = html;
|
|
24614
|
+
loadPrism();
|
|
24615
|
+
}
|
|
24616
|
+
async connectedCallback() {
|
|
24617
|
+
const shadowRoot = this.shadowRoot;
|
|
24618
|
+
const language = this.getAttribute("lang").toLowerCase();
|
|
24619
|
+
const isEscaped = this.hasAttribute("data-escaped");
|
|
24620
|
+
const addCopyButton = this.hasAttribute("data-copy-button");
|
|
24621
|
+
let code = this.innerHTML.trimStart();
|
|
24622
|
+
this.innerHTML = "";
|
|
24623
|
+
const codeNode = shadowRoot.querySelector("code");
|
|
24624
|
+
codeNode.className = `language-${language}`;
|
|
24625
|
+
codeNode.textContent = isEscaped ? unescapeHTML(code) : code;
|
|
24626
|
+
if (addCopyButton) {
|
|
24627
|
+
const clipboardCopy = shadowRoot.querySelector("clipboard-copy");
|
|
24628
|
+
clipboardCopy.setAttribute("value", isEscaped ? unescapeHTML(code) : code);
|
|
24629
|
+
}
|
|
24630
|
+
const [Prism, prismCssStyleSheet] = await loadPrism();
|
|
24631
|
+
shadowRoot.adoptedStyleSheets.push(prismCssStyleSheet);
|
|
24632
|
+
Prism.highlightAllUnder(shadowRoot);
|
|
24633
|
+
}
|
|
24634
|
+
}
|
|
24635
|
+
customElements.define("code-block", CodeBlock);
|
|
24636
|
+
const escape = document.createElement("textarea");
|
|
24637
|
+
function unescapeHTML(html) {
|
|
24638
|
+
escape.innerHTML = html;
|
|
24639
|
+
return escape.textContent;
|
|
24640
|
+
}
|
|
24641
|
+
})();
|
|
24642
|
+
|
|
24117
24643
|
const Code = props => {
|
|
24644
|
+
if (props.language) {
|
|
24645
|
+
return jsx(CodeBlock, {
|
|
24646
|
+
...props
|
|
24647
|
+
});
|
|
24648
|
+
}
|
|
24118
24649
|
if (props.box) {
|
|
24119
24650
|
return jsx(CodeBox, {
|
|
24120
24651
|
...props
|
|
@@ -24164,12 +24695,12 @@ const Svg = props => {
|
|
|
24164
24695
|
|
|
24165
24696
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
24166
24697
|
.svg_mask_content * {
|
|
24698
|
+
color: black !important;
|
|
24699
|
+
opacity: 1 !important;
|
|
24167
24700
|
fill: black !important;
|
|
24168
|
-
stroke: black !important;
|
|
24169
24701
|
fill-opacity: 1 !important;
|
|
24702
|
+
stroke: black !important;
|
|
24170
24703
|
stroke-opacity: 1 !important;
|
|
24171
|
-
color: black !important;
|
|
24172
|
-
opacity: 1 !important;
|
|
24173
24704
|
}
|
|
24174
24705
|
`;
|
|
24175
24706
|
const SVGMaskOverlay = ({
|
|
@@ -24921,5 +25452,5 @@ const UserSvg = () => jsx("svg", {
|
|
|
24921
25452
|
})
|
|
24922
25453
|
});
|
|
24923
25454
|
|
|
24924
|
-
export { ActionRenderer, ActiveKeyboardShortcuts, BadgeCount, Box, Button, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, compareTwoJsValues, createAction, createAvailableConstraint, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus, useActiveRouteInfo, useCalloutClose, useCellsAndColumns, useConstraintValidityState, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
|
|
25455
|
+
export { ActionRenderer, ActiveKeyboardShortcuts, Address, BadgeCount, Box, Button, ButtonCopyToClipboard, Caption, CheckSvg, Checkbox, CheckboxList, Code, Col, Colgroup, ConstructionSvg, Details, DialogLayout, Editable, ErrorBoundaryContext, ExclamationSvg, EyeClosedSvg, EyeSvg, Form, HeartSvg, HomeSvg, Icon, Image, Input, Label, Link, LinkAnchorSvg, LinkBlankTargetSvg, MessageBox, Paragraph, Radio, RadioList, Route, RouteLink, Routes, RowNumberCol, RowNumberTableCell, SINGLE_SPACE_CONSTRAINT, SVGMaskOverlay, SearchSvg, Select, SelectionContext, Separator, SettingsSvg, StarSvg, SummaryMarker, Svg, Tab, TabList, Table, TableCell, Tbody, Text, Thead, Title, Tr, UITransition, UserSvg, ViewportLayout, actionIntegratedVia, addCustomMessage, compareTwoJsValues, createAction, createAvailableConstraint, createRequestCanceller, createSelectionKeyboardShortcuts, enableDebugActions, enableDebugOnDocumentLoading, forwardActionRequested, installCustomConstraintValidation, isCellSelected, isColumnSelected, isRowSelected, localStorageSignal, navBack, navForward, navTo, openCallout, rawUrlPart, reload, removeCustomMessage, requestAction, rerunActions, resource, setBaseUrl, setupRoutes, stateSignal, stopLoad, stringifyTableSelectionValue, updateActions, useActionData, useActionStatus, useActiveRouteInfo, useCalloutClose, useCellsAndColumns, useConstraintValidityState, useDependenciesDiff, useDocumentResource, useDocumentState, useDocumentUrl, useEditionController, useFocusGroup, useKeyboardShortcuts, useNavState$1 as useNavState, useRouteStatus, useRunOnMount, useSelectableElement, useSelectionController, useSignalSync, useStateArray, useTitleLevel, useUrlSearchParam, valueInLocalStorage };
|
|
24925
25456
|
//# sourceMappingURL=jsenv_navi.js.map
|