@jsenv/navi 0.15.1 → 0.15.3
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 +693 -169
- package/dist/jsenv_navi.js.map +72 -13
- package/package.json +1 -1
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
|
|
|
@@ -17853,7 +17882,7 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17853
17882
|
border-radius: inherit;
|
|
17854
17883
|
opacity: 0;
|
|
17855
17884
|
appearance: none; /* This allows border-radius to have an effect */
|
|
17856
|
-
cursor:
|
|
17885
|
+
cursor: var(--x-cursor);
|
|
17857
17886
|
}
|
|
17858
17887
|
|
|
17859
17888
|
.navi_checkbox_field {
|
|
@@ -17870,7 +17899,6 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
17870
17899
|
outline-style: none;
|
|
17871
17900
|
outline-color: var(--outline-color);
|
|
17872
17901
|
outline-offset: var(--outline-offset);
|
|
17873
|
-
cursor: var(--x-cursor);
|
|
17874
17902
|
pointer-events: none;
|
|
17875
17903
|
}
|
|
17876
17904
|
|
|
@@ -18073,21 +18101,18 @@ const CheckboxStyleCSSVars = {
|
|
|
18073
18101
|
"accentColor": "--accent-color",
|
|
18074
18102
|
":hover": {
|
|
18075
18103
|
backgroundColor: "--background-color-hover",
|
|
18076
|
-
borderColor: "--border-color-hover"
|
|
18077
|
-
color: "--color-hover"
|
|
18104
|
+
borderColor: "--border-color-hover"
|
|
18078
18105
|
},
|
|
18079
18106
|
":active": {
|
|
18080
18107
|
borderColor: "--border-color-active"
|
|
18081
18108
|
},
|
|
18082
18109
|
":read-only": {
|
|
18083
18110
|
backgroundColor: "--background-color-readonly",
|
|
18084
|
-
borderColor: "--border-color-readonly"
|
|
18085
|
-
color: "--color-readonly"
|
|
18111
|
+
borderColor: "--border-color-readonly"
|
|
18086
18112
|
},
|
|
18087
18113
|
":disabled": {
|
|
18088
18114
|
backgroundColor: "--background-color-disabled",
|
|
18089
|
-
borderColor: "--border-color-disabled"
|
|
18090
|
-
color: "--color-disabled"
|
|
18115
|
+
borderColor: "--border-color-disabled"
|
|
18091
18116
|
}
|
|
18092
18117
|
};
|
|
18093
18118
|
const CheckboxToggleStyleCSSVars = {
|
|
@@ -18468,33 +18493,35 @@ forwardRef((props, ref) => {
|
|
|
18468
18493
|
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
18469
18494
|
@layer navi {
|
|
18470
18495
|
.navi_radio {
|
|
18496
|
+
--margin: 3px 3px 0 5px;
|
|
18471
18497
|
--outline-offset: 1px;
|
|
18472
18498
|
--outline-width: 2px;
|
|
18473
|
-
--width:
|
|
18474
|
-
--height:
|
|
18499
|
+
--width: 0.815em;
|
|
18500
|
+
--height: 0.815em;
|
|
18475
18501
|
|
|
18476
18502
|
--outline-color: var(--navi-focus-outline-color);
|
|
18477
18503
|
--loader-color: var(--navi-loader-color);
|
|
18478
18504
|
--border-color: light-dark(#767676, #8e8e93);
|
|
18479
18505
|
--background-color: white;
|
|
18480
|
-
--color: light-dark(#4476ff, #3b82f6);
|
|
18481
|
-
--radiomark-color: var(--color);
|
|
18482
|
-
--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;
|
|
18483
18510
|
|
|
18484
|
-
--color-mix-light:
|
|
18485
|
-
--color-mix-dark:
|
|
18511
|
+
--color-mix-light: black;
|
|
18512
|
+
--color-mix-dark: white;
|
|
18486
18513
|
--color-mix: var(--color-mix-light);
|
|
18487
18514
|
|
|
18488
18515
|
/* Hover */
|
|
18489
18516
|
--border-color-hover: color-mix(in srgb, var(--border-color) 60%, black);
|
|
18490
18517
|
--border-color-hover-checked: color-mix(
|
|
18491
18518
|
in srgb,
|
|
18492
|
-
var(--color) 80%,
|
|
18519
|
+
var(--border-color-checked) 80%,
|
|
18493
18520
|
var(--color-mix)
|
|
18494
18521
|
);
|
|
18495
18522
|
--radiomark-color-hover: color-mix(
|
|
18496
18523
|
in srgb,
|
|
18497
|
-
var(--color) 80%,
|
|
18524
|
+
var(--radiomark-color) 80%,
|
|
18498
18525
|
var(--color-mix)
|
|
18499
18526
|
);
|
|
18500
18527
|
/* Readonly */
|
|
@@ -18504,30 +18531,52 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18504
18531
|
white
|
|
18505
18532
|
);
|
|
18506
18533
|
--background-color-readonly: var(--background-color);
|
|
18507
|
-
--radiomark-color-readonly:
|
|
18508
|
-
|
|
18509
|
-
|
|
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);
|
|
18510
18545
|
/* Disabled */
|
|
18511
18546
|
--border-color-disabled: var(--border-color-readonly);
|
|
18512
18547
|
--background-color-disabled: rgba(248, 248, 248, 0.7);
|
|
18513
18548
|
--radiomark-color-disabled: #d3d3d3;
|
|
18514
18549
|
--border-color-checked-disabled: #d3d3d3;
|
|
18515
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);
|
|
18516
18572
|
}
|
|
18517
18573
|
|
|
18518
|
-
|
|
18574
|
+
&[data-dark] {
|
|
18519
18575
|
--color-mix: var(--color-mix-dark);
|
|
18520
18576
|
}
|
|
18521
18577
|
}
|
|
18522
18578
|
|
|
18523
18579
|
.navi_radio {
|
|
18524
|
-
position: relative;
|
|
18525
|
-
display: inline-flex;
|
|
18526
|
-
box-sizing: content-box;
|
|
18527
|
-
margin-top: 3px;
|
|
18528
|
-
margin-right: 3px;
|
|
18529
|
-
margin-left: 5px;
|
|
18530
|
-
|
|
18531
18580
|
--x-outline-offset: var(--outline-offset);
|
|
18532
18581
|
--x-outline-width: var(--outline-width);
|
|
18533
18582
|
--x-border-width: var(--border-width);
|
|
@@ -18536,102 +18585,196 @@ installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
|
18536
18585
|
--x-outline-color: var(--outline-color);
|
|
18537
18586
|
--x-background-color: var(--background-color);
|
|
18538
18587
|
--x-border-color: var(--border-color);
|
|
18539
|
-
--x-color: var(--color);
|
|
18540
18588
|
--x-radiomark-color: var(--radiomark-color);
|
|
18541
|
-
|
|
18542
|
-
|
|
18543
|
-
position:
|
|
18544
|
-
inset: 0;
|
|
18545
|
-
margin: 0;
|
|
18546
|
-
padding: 0;
|
|
18547
|
-
opacity: 0;
|
|
18548
|
-
cursor: inherit;
|
|
18549
|
-
}
|
|
18550
|
-
.navi_radio .navi_radio_field {
|
|
18589
|
+
--x-cursor: var(--cursor);
|
|
18590
|
+
|
|
18591
|
+
position: relative;
|
|
18551
18592
|
display: inline-flex;
|
|
18552
|
-
box-sizing:
|
|
18553
|
-
|
|
18554
|
-
height: var(--x-height);
|
|
18555
|
-
align-items: center;
|
|
18556
|
-
justify-content: center;
|
|
18557
|
-
border-radius: 50%;
|
|
18558
|
-
outline-width: var(--x-outline-width);
|
|
18559
|
-
outline-style: none;
|
|
18560
|
-
outline-color: var(--x-outline-color);
|
|
18561
|
-
outline-offset: var(--x-outline-offset);
|
|
18562
|
-
}
|
|
18563
|
-
.navi_radio_field svg {
|
|
18564
|
-
overflow: visible;
|
|
18565
|
-
}
|
|
18566
|
-
.navi_radio_border {
|
|
18567
|
-
fill: var(--x-background-color);
|
|
18568
|
-
stroke: var(--x-border-color);
|
|
18569
|
-
}
|
|
18570
|
-
.navi_radio_marker {
|
|
18571
|
-
width: 100%;
|
|
18572
|
-
height: 100%;
|
|
18573
|
-
opacity: 0;
|
|
18574
|
-
fill: var(--x-radiomark-color);
|
|
18575
|
-
transform: scale(0.3);
|
|
18576
|
-
transform-origin: center;
|
|
18577
|
-
pointer-events: none;
|
|
18578
|
-
}
|
|
18579
|
-
.navi_radio_dashed_border {
|
|
18580
|
-
display: none;
|
|
18581
|
-
}
|
|
18582
|
-
.navi_radio[data-transition] .navi_radio_marker {
|
|
18583
|
-
transition: all 0.15s ease;
|
|
18584
|
-
}
|
|
18585
|
-
.navi_radio[data-transition] .navi_radio_dashed_border {
|
|
18586
|
-
transition: all 0.15s ease;
|
|
18587
|
-
}
|
|
18588
|
-
.navi_radio[data-transition] .navi_radio_border {
|
|
18589
|
-
transition: all 0.15s ease;
|
|
18590
|
-
}
|
|
18593
|
+
box-sizing: content-box;
|
|
18594
|
+
margin: var(--margin);
|
|
18591
18595
|
|
|
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
|
-
|
|
18634
|
-
|
|
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
|
+
|
|
18759
|
+
&[data-hover] {
|
|
18760
|
+
--x-background-color: var(--button-background-color-hover);
|
|
18761
|
+
--x-border-color: var(--button-border-color-hover);
|
|
18762
|
+
}
|
|
18763
|
+
&[data-checked] {
|
|
18764
|
+
--x-border-color: var(--button-border-color-checked);
|
|
18765
|
+
--x-background-color: var(--button-background-color-checked);
|
|
18766
|
+
|
|
18767
|
+
.navi_radio_field {
|
|
18768
|
+
box-shadow:
|
|
18769
|
+
inset 0 2px 4px rgba(0, 0, 0, 0.15),
|
|
18770
|
+
inset 0 0 0 1px var(--button-border-color-checked);
|
|
18771
|
+
}
|
|
18772
|
+
}
|
|
18773
|
+
&[data-disabled] {
|
|
18774
|
+
--x-border-color: var(--button-border-color-disabled);
|
|
18775
|
+
--x-background-color: var(--button-background-color-disabled);
|
|
18776
|
+
}
|
|
18777
|
+
}
|
|
18635
18778
|
}
|
|
18636
18779
|
`;
|
|
18637
18780
|
const InputRadio = props => {
|
|
@@ -18642,7 +18785,13 @@ const InputRadio = props => {
|
|
|
18642
18785
|
statePropName: "checked",
|
|
18643
18786
|
fallbackState: false,
|
|
18644
18787
|
getStateFromProp: checked => checked ? value : undefined,
|
|
18645
|
-
getPropFromState: Boolean
|
|
18788
|
+
getPropFromState: Boolean,
|
|
18789
|
+
getStateFromParent: parentUIStateController => {
|
|
18790
|
+
if (parentUIStateController.componentType === "radio_list") {
|
|
18791
|
+
return parentUIStateController.value === props.value;
|
|
18792
|
+
}
|
|
18793
|
+
return undefined;
|
|
18794
|
+
}
|
|
18646
18795
|
});
|
|
18647
18796
|
const uiState = useUIState(uiStateController);
|
|
18648
18797
|
const radio = renderActionableComponent(props, {
|
|
@@ -18658,29 +18807,48 @@ const InputRadio = props => {
|
|
|
18658
18807
|
});
|
|
18659
18808
|
};
|
|
18660
18809
|
const RadioStyleCSSVars = {
|
|
18810
|
+
"width": "--width",
|
|
18811
|
+
"height": "--height",
|
|
18812
|
+
"borderRadius": "--border-radius",
|
|
18661
18813
|
"outlineWidth": "--outline-width",
|
|
18662
18814
|
"borderWidth": "--border-width",
|
|
18663
|
-
"borderRadius": "--border-radius",
|
|
18664
18815
|
"backgroundColor": "--background-color",
|
|
18665
18816
|
"borderColor": "--border-color",
|
|
18666
|
-
"
|
|
18817
|
+
"accentColor": "--accent-color",
|
|
18667
18818
|
":hover": {
|
|
18668
18819
|
backgroundColor: "--background-color-hover",
|
|
18669
|
-
borderColor: "--border-color-hover"
|
|
18670
|
-
color: "--color-hover"
|
|
18820
|
+
borderColor: "--border-color-hover"
|
|
18671
18821
|
},
|
|
18672
18822
|
":active": {
|
|
18673
18823
|
borderColor: "--border-color-active"
|
|
18674
18824
|
},
|
|
18675
18825
|
":read-only": {
|
|
18676
18826
|
backgroundColor: "--background-color-readonly",
|
|
18677
|
-
borderColor: "--border-color-readonly"
|
|
18678
|
-
color: "--color-readonly"
|
|
18827
|
+
borderColor: "--border-color-readonly"
|
|
18679
18828
|
},
|
|
18680
18829
|
":disabled": {
|
|
18681
18830
|
backgroundColor: "--background-color-disabled",
|
|
18682
|
-
borderColor: "--border-color-disabled"
|
|
18683
|
-
|
|
18831
|
+
borderColor: "--border-color-disabled"
|
|
18832
|
+
}
|
|
18833
|
+
};
|
|
18834
|
+
const RadioButtonStyleCSSVars = {
|
|
18835
|
+
...RadioStyleCSSVars,
|
|
18836
|
+
"padding": "--padding",
|
|
18837
|
+
"borderRadius": "--button-border-radius",
|
|
18838
|
+
"borderWidth": "--button-border-width",
|
|
18839
|
+
"borderColor": "--button-border-color",
|
|
18840
|
+
"backgroundColor": "--button-background-color",
|
|
18841
|
+
":hover": {
|
|
18842
|
+
backgroundColor: "--button-background-color-hover",
|
|
18843
|
+
borderColor: "--button-border-color-hover"
|
|
18844
|
+
},
|
|
18845
|
+
":read-only": {
|
|
18846
|
+
backgroundColor: "--button-background-color-readonly",
|
|
18847
|
+
borderColor: "--button-border-color-readonly"
|
|
18848
|
+
},
|
|
18849
|
+
":disabled": {
|
|
18850
|
+
backgroundColor: "--button-background-color-disabled",
|
|
18851
|
+
borderColor: "--button-border-color-disabled"
|
|
18684
18852
|
}
|
|
18685
18853
|
};
|
|
18686
18854
|
const RadioPseudoClasses = [":hover", ":active", ":focus", ":focus-visible", ":read-only", ":disabled", ":checked", ":-navi-loading"];
|
|
@@ -18709,6 +18877,8 @@ const InputRadioBasic = props => {
|
|
|
18709
18877
|
autoFocus,
|
|
18710
18878
|
onClick,
|
|
18711
18879
|
onInput,
|
|
18880
|
+
icon,
|
|
18881
|
+
appearance = icon ? "icon" : "radio",
|
|
18712
18882
|
color,
|
|
18713
18883
|
...rest
|
|
18714
18884
|
} = props;
|
|
@@ -18785,9 +18955,10 @@ const InputRadioBasic = props => {
|
|
|
18785
18955
|
}
|
|
18786
18956
|
});
|
|
18787
18957
|
const renderRadioMemoized = useCallback(renderRadio, [innerName, checked, innerRequired]);
|
|
18958
|
+
const boxRef = useRef();
|
|
18788
18959
|
useLayoutEffect(() => {
|
|
18789
|
-
const naviRadio =
|
|
18790
|
-
const luminance = resolveColorLuminance("var(--color)", naviRadio);
|
|
18960
|
+
const naviRadio = boxRef.current;
|
|
18961
|
+
const luminance = resolveColorLuminance("var(--accent-color)", naviRadio);
|
|
18791
18962
|
if (luminance < 0.3) {
|
|
18792
18963
|
naviRadio.setAttribute("data-dark", "");
|
|
18793
18964
|
} else {
|
|
@@ -18797,10 +18968,11 @@ const InputRadioBasic = props => {
|
|
|
18797
18968
|
return jsxs(Box, {
|
|
18798
18969
|
as: "span",
|
|
18799
18970
|
...remainingProps,
|
|
18800
|
-
ref:
|
|
18971
|
+
ref: boxRef,
|
|
18972
|
+
"data-appearance": appearance,
|
|
18801
18973
|
baseClassName: "navi_radio",
|
|
18802
18974
|
pseudoStateSelector: ".navi_native_field",
|
|
18803
|
-
styleCSSVars: RadioStyleCSSVars,
|
|
18975
|
+
styleCSSVars: appearance === "button" ? RadioButtonStyleCSSVars : RadioStyleCSSVars,
|
|
18804
18976
|
pseudoClasses: RadioPseudoClasses,
|
|
18805
18977
|
pseudoElements: RadioPseudoElements,
|
|
18806
18978
|
basePseudoState: {
|
|
@@ -18817,7 +18989,7 @@ const InputRadioBasic = props => {
|
|
|
18817
18989
|
color: "var(--loader-color)"
|
|
18818
18990
|
}), renderRadioMemoized, jsx("span", {
|
|
18819
18991
|
className: "navi_radio_field",
|
|
18820
|
-
children: jsxs("svg", {
|
|
18992
|
+
children: appearance === "radio" ? jsxs("svg", {
|
|
18821
18993
|
viewBox: "0 0 12 12",
|
|
18822
18994
|
"aria-hidden": "true",
|
|
18823
18995
|
preserveAspectRatio: "xMidYMid meet",
|
|
@@ -18841,7 +19013,7 @@ const InputRadioBasic = props => {
|
|
|
18841
19013
|
cy: "6",
|
|
18842
19014
|
r: "3.5"
|
|
18843
19015
|
})]
|
|
18844
|
-
})
|
|
19016
|
+
}) : icon
|
|
18845
19017
|
})]
|
|
18846
19018
|
});
|
|
18847
19019
|
};
|
|
@@ -20116,15 +20288,8 @@ const FormWithAction = props => {
|
|
|
20116
20288
|
// form.dispatchEvent(customEvent);
|
|
20117
20289
|
// };
|
|
20118
20290
|
|
|
20119
|
-
installImportMetaCss(import.meta);import.meta.css = /* css
|
|
20120
|
-
|
|
20121
|
-
.navi_radio_list {
|
|
20122
|
-
display: flex;
|
|
20123
|
-
flex-direction: column;
|
|
20124
|
-
}
|
|
20125
|
-
}
|
|
20126
|
-
`;
|
|
20127
|
-
const RadioList = forwardRef((props, ref) => {
|
|
20291
|
+
installImportMetaCss(import.meta);import.meta.css = /* css */``;
|
|
20292
|
+
const RadioList = props => {
|
|
20128
20293
|
const uiStateController = useUIGroupStateController(props, "radio_list", {
|
|
20129
20294
|
childComponentType: "radio",
|
|
20130
20295
|
aggregateChildStates: childUIStateControllers => {
|
|
@@ -20139,7 +20304,10 @@ const RadioList = forwardRef((props, ref) => {
|
|
|
20139
20304
|
}
|
|
20140
20305
|
});
|
|
20141
20306
|
const uiState = useUIState(uiStateController);
|
|
20142
|
-
const radioList = renderActionableComponent(props,
|
|
20307
|
+
const radioList = renderActionableComponent(props, {
|
|
20308
|
+
Basic: RadioListBasic,
|
|
20309
|
+
WithAction: RadioListWithAction
|
|
20310
|
+
});
|
|
20143
20311
|
return jsx(UIStateControllerContext.Provider, {
|
|
20144
20312
|
value: uiStateController,
|
|
20145
20313
|
children: jsx(UIStateContext.Provider, {
|
|
@@ -20147,9 +20315,9 @@ const RadioList = forwardRef((props, ref) => {
|
|
|
20147
20315
|
children: radioList
|
|
20148
20316
|
})
|
|
20149
20317
|
});
|
|
20150
|
-
}
|
|
20318
|
+
};
|
|
20151
20319
|
const Radio = InputRadio;
|
|
20152
|
-
const RadioListBasic =
|
|
20320
|
+
const RadioListBasic = props => {
|
|
20153
20321
|
const contextReadOnly = useContext(ReadOnlyContext);
|
|
20154
20322
|
const contextDisabled = useContext(DisabledContext);
|
|
20155
20323
|
const contextLoading = useContext(LoadingContext);
|
|
@@ -20163,19 +20331,15 @@ const RadioListBasic = forwardRef((props, ref) => {
|
|
|
20163
20331
|
required,
|
|
20164
20332
|
...rest
|
|
20165
20333
|
} = props;
|
|
20166
|
-
const innerRef = useRef();
|
|
20167
|
-
useImperativeHandle(ref, () => innerRef.current);
|
|
20168
20334
|
const innerLoading = loading || contextLoading;
|
|
20169
20335
|
const innerReadOnly = readOnly || contextReadOnly || innerLoading || uiStateController.readOnly;
|
|
20170
20336
|
const innerDisabled = disabled || contextDisabled;
|
|
20171
|
-
return jsx(
|
|
20337
|
+
return jsx(Box, {
|
|
20172
20338
|
"data-action": rest["data-action"],
|
|
20339
|
+
row: true,
|
|
20173
20340
|
...rest,
|
|
20174
|
-
|
|
20175
|
-
|
|
20176
|
-
"data-radio-list": true
|
|
20177
|
-
// eslint-disable-next-line react/no-unknown-property
|
|
20178
|
-
,
|
|
20341
|
+
baseClassName: "navi_radio_list",
|
|
20342
|
+
"data-radio-list": true,
|
|
20179
20343
|
onresetuistate: e => {
|
|
20180
20344
|
uiStateController.resetUIState(e);
|
|
20181
20345
|
},
|
|
@@ -20199,8 +20363,8 @@ const RadioListBasic = forwardRef((props, ref) => {
|
|
|
20199
20363
|
})
|
|
20200
20364
|
})
|
|
20201
20365
|
});
|
|
20202
|
-
}
|
|
20203
|
-
|
|
20366
|
+
};
|
|
20367
|
+
const RadioListWithAction = props => {
|
|
20204
20368
|
const uiStateController = useContext(UIStateControllerContext);
|
|
20205
20369
|
const uiState = useContext(UIStateContext);
|
|
20206
20370
|
const {
|
|
@@ -20217,7 +20381,6 @@ forwardRef((props, ref) => {
|
|
|
20217
20381
|
...rest
|
|
20218
20382
|
} = props;
|
|
20219
20383
|
const innerRef = useRef();
|
|
20220
|
-
useImperativeHandle(ref, () => innerRef.current);
|
|
20221
20384
|
const [boundAction] = useActionBoundToOneParam(action, uiState);
|
|
20222
20385
|
const {
|
|
20223
20386
|
loading: actionLoading
|
|
@@ -20258,7 +20421,8 @@ forwardRef((props, ref) => {
|
|
|
20258
20421
|
const radioListContainer = innerRef.current;
|
|
20259
20422
|
requestAction(radioListContainer, boundAction, {
|
|
20260
20423
|
event: e,
|
|
20261
|
-
requester: radio
|
|
20424
|
+
requester: radio,
|
|
20425
|
+
actionOrigin: "action_prop"
|
|
20262
20426
|
});
|
|
20263
20427
|
},
|
|
20264
20428
|
loading: loading || actionLoading,
|
|
@@ -20267,7 +20431,7 @@ forwardRef((props, ref) => {
|
|
|
20267
20431
|
children: children
|
|
20268
20432
|
})
|
|
20269
20433
|
});
|
|
20270
|
-
}
|
|
20434
|
+
};
|
|
20271
20435
|
|
|
20272
20436
|
const useRefArray = (items, keyFromItem) => {
|
|
20273
20437
|
const refMapRef = useRef(new Map());
|
|
@@ -23860,6 +24024,118 @@ const KeyboardShortcutAriaElement = ({
|
|
|
23860
24024
|
});
|
|
23861
24025
|
};
|
|
23862
24026
|
|
|
24027
|
+
installImportMetaCss(import.meta);import.meta.css = /* css */`
|
|
24028
|
+
@layer navi {
|
|
24029
|
+
.navi_clipboard_container {
|
|
24030
|
+
--height: 1.5em;
|
|
24031
|
+
--notif-spacing: 0.5em;
|
|
24032
|
+
}
|
|
24033
|
+
}
|
|
24034
|
+
|
|
24035
|
+
.navi_clipboard_container {
|
|
24036
|
+
position: relative;
|
|
24037
|
+
display: inline-flex;
|
|
24038
|
+
height: var(--height);
|
|
24039
|
+
align-items: center;
|
|
24040
|
+
|
|
24041
|
+
.navi_copied_notif {
|
|
24042
|
+
position: absolute;
|
|
24043
|
+
top: calc(-1 * var(--notif-spacing));
|
|
24044
|
+
right: 0;
|
|
24045
|
+
padding: 0.2em 0.5em;
|
|
24046
|
+
color: white;
|
|
24047
|
+
font-size: 80%;
|
|
24048
|
+
white-space: nowrap;
|
|
24049
|
+
background: black;
|
|
24050
|
+
border-radius: 3px;
|
|
24051
|
+
transform: translateY(-100%);
|
|
24052
|
+
}
|
|
24053
|
+
}
|
|
24054
|
+
`;
|
|
24055
|
+
const ButtonCopyToClipboard = ({
|
|
24056
|
+
children,
|
|
24057
|
+
...props
|
|
24058
|
+
}) => {
|
|
24059
|
+
const [copied, setCopied] = useState(false);
|
|
24060
|
+
const renderedRef = useRef();
|
|
24061
|
+
useEffect(() => {
|
|
24062
|
+
renderedRef.current = true;
|
|
24063
|
+
return () => {
|
|
24064
|
+
renderedRef.current = false;
|
|
24065
|
+
};
|
|
24066
|
+
}, []);
|
|
24067
|
+
return jsxs(Box, {
|
|
24068
|
+
class: "navi_clipboard_container",
|
|
24069
|
+
...props,
|
|
24070
|
+
children: [jsx(Box, {
|
|
24071
|
+
className: "navi_copied_notif",
|
|
24072
|
+
"aria-hidden": copied ? "false" : "true",
|
|
24073
|
+
opacity: copied ? 1 : 0,
|
|
24074
|
+
children: "Copi\xE9 !"
|
|
24075
|
+
}), jsx(Button, {
|
|
24076
|
+
className: "navi_copy_button",
|
|
24077
|
+
row: true,
|
|
24078
|
+
icon: true,
|
|
24079
|
+
revealOnInteraction: true,
|
|
24080
|
+
square: true,
|
|
24081
|
+
alignY: "center",
|
|
24082
|
+
expandY: true,
|
|
24083
|
+
borderRadius: "xs",
|
|
24084
|
+
action: async () => {
|
|
24085
|
+
await addToClipboard(children);
|
|
24086
|
+
setTimeout(() => {
|
|
24087
|
+
if (!renderedRef.current) {
|
|
24088
|
+
// do not call setState on unmounted component
|
|
24089
|
+
return;
|
|
24090
|
+
}
|
|
24091
|
+
setCopied(false);
|
|
24092
|
+
}, 1500);
|
|
24093
|
+
setCopied(true);
|
|
24094
|
+
},
|
|
24095
|
+
children: copied ? jsx(Icon, {
|
|
24096
|
+
color: "green",
|
|
24097
|
+
children: jsx(CopiedIcon, {})
|
|
24098
|
+
}) : jsx(Icon, {
|
|
24099
|
+
children: jsx(CopyIcon, {})
|
|
24100
|
+
})
|
|
24101
|
+
})]
|
|
24102
|
+
});
|
|
24103
|
+
};
|
|
24104
|
+
const addToClipboard = async text => {
|
|
24105
|
+
const type = "text/plain";
|
|
24106
|
+
const clipboardItemData = {
|
|
24107
|
+
[type]: text
|
|
24108
|
+
};
|
|
24109
|
+
const clipboardItem = new ClipboardItem(clipboardItemData);
|
|
24110
|
+
await window.navigator.clipboard.write([clipboardItem]);
|
|
24111
|
+
};
|
|
24112
|
+
const CopyIcon = () => jsxs("svg", {
|
|
24113
|
+
viewBox: "0 0 16 16",
|
|
24114
|
+
children: [jsx("path", {
|
|
24115
|
+
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"
|
|
24116
|
+
}), jsx("path", {
|
|
24117
|
+
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"
|
|
24118
|
+
})]
|
|
24119
|
+
});
|
|
24120
|
+
const CopiedIcon = () => jsx("svg", {
|
|
24121
|
+
viewBox: "0 0 16 16",
|
|
24122
|
+
children: jsx("path", {
|
|
24123
|
+
fill: "currentColor",
|
|
24124
|
+
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"
|
|
24125
|
+
})
|
|
24126
|
+
});
|
|
24127
|
+
|
|
24128
|
+
const Address = ({
|
|
24129
|
+
children,
|
|
24130
|
+
...props
|
|
24131
|
+
}) => {
|
|
24132
|
+
return jsx(Text, {
|
|
24133
|
+
as: "address",
|
|
24134
|
+
...props,
|
|
24135
|
+
children: children
|
|
24136
|
+
});
|
|
24137
|
+
};
|
|
24138
|
+
|
|
23863
24139
|
const CSS_VAR_NAME = "--x-color-contrasting";
|
|
23864
24140
|
|
|
23865
24141
|
const useContrastingColor = (ref, backgroundElementSelector) => {
|
|
@@ -24115,7 +24391,255 @@ const Caption = ({
|
|
|
24115
24391
|
});
|
|
24116
24392
|
};
|
|
24117
24393
|
|
|
24394
|
+
/**
|
|
24395
|
+
* Example of how you'd use this:
|
|
24396
|
+
* <code-block data-language="HTML" data-escaped="true">
|
|
24397
|
+
* <h1>Your HTML here. Any HTML should be escaped</h1>
|
|
24398
|
+
* </code-block>
|
|
24399
|
+
*
|
|
24400
|
+
* https://github.com/TheWebTech/hs-code-block-web-component/tree/main
|
|
24401
|
+
*/
|
|
24402
|
+
|
|
24403
|
+
const CodeBlock = ({
|
|
24404
|
+
language,
|
|
24405
|
+
escaped = false,
|
|
24406
|
+
children,
|
|
24407
|
+
...props
|
|
24408
|
+
}) => {
|
|
24409
|
+
return jsx("code-block", {
|
|
24410
|
+
"data-language": language,
|
|
24411
|
+
"data-escaped": escaped ? "" : null,
|
|
24412
|
+
...props,
|
|
24413
|
+
children: children
|
|
24414
|
+
});
|
|
24415
|
+
};
|
|
24416
|
+
(() => {
|
|
24417
|
+
const css = /* css */`
|
|
24418
|
+
*[aria-hidden="true"] {
|
|
24419
|
+
display: none;
|
|
24420
|
+
}
|
|
24421
|
+
|
|
24422
|
+
.clipboard_container {
|
|
24423
|
+
display: flex;
|
|
24424
|
+
padding: 8px;
|
|
24425
|
+
align-items: center;
|
|
24426
|
+
gap: 5px;
|
|
24427
|
+
}
|
|
24428
|
+
|
|
24429
|
+
#copied_notif {
|
|
24430
|
+
padding: 0.2em 0.5em;
|
|
24431
|
+
color: white;
|
|
24432
|
+
font-size: 80%;
|
|
24433
|
+
background: black;
|
|
24434
|
+
border-radius: 3px;
|
|
24435
|
+
}
|
|
24436
|
+
|
|
24437
|
+
button {
|
|
24438
|
+
width: 32px;
|
|
24439
|
+
height: 32px;
|
|
24440
|
+
background: none;
|
|
24441
|
+
background-color: rgb(246, 248, 250);
|
|
24442
|
+
border: none;
|
|
24443
|
+
border-width: 1px;
|
|
24444
|
+
border-style: solid;
|
|
24445
|
+
border-color: rgb(209, 217, 224);
|
|
24446
|
+
border-radius: 6px;
|
|
24447
|
+
cursor: pointer;
|
|
24448
|
+
}
|
|
24449
|
+
|
|
24450
|
+
button:hover {
|
|
24451
|
+
background-color: rgb(239, 242, 245);
|
|
24452
|
+
}
|
|
24453
|
+
`;
|
|
24454
|
+
const html = /* html */`<style>
|
|
24455
|
+
${css}
|
|
24456
|
+
</style>
|
|
24457
|
+
<div class="clipboard_container">
|
|
24458
|
+
<div id="copied_notif" aria-hidden="true">Copied !</div>
|
|
24459
|
+
<button id="copy_button">
|
|
24460
|
+
<svg
|
|
24461
|
+
id="copy_icon"
|
|
24462
|
+
aria-hidden="true"
|
|
24463
|
+
viewBox="0 0 16 16"
|
|
24464
|
+
width="16"
|
|
24465
|
+
height="16"
|
|
24466
|
+
>
|
|
24467
|
+
<path
|
|
24468
|
+
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"
|
|
24469
|
+
></path>
|
|
24470
|
+
<path
|
|
24471
|
+
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"
|
|
24472
|
+
></path>
|
|
24473
|
+
</svg>
|
|
24474
|
+
<svg
|
|
24475
|
+
id="copied_icon"
|
|
24476
|
+
aria-hidden="true"
|
|
24477
|
+
viewBox="0 0 16 16"
|
|
24478
|
+
width="16"
|
|
24479
|
+
height="16"
|
|
24480
|
+
>
|
|
24481
|
+
<path
|
|
24482
|
+
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"
|
|
24483
|
+
></path>
|
|
24484
|
+
</svg>
|
|
24485
|
+
</button>
|
|
24486
|
+
</div>`;
|
|
24487
|
+
class ClipboardCopy extends HTMLElement {
|
|
24488
|
+
constructor() {
|
|
24489
|
+
super();
|
|
24490
|
+
const root = this.attachShadow({
|
|
24491
|
+
mode: "open"
|
|
24492
|
+
});
|
|
24493
|
+
root.innerHTML = html;
|
|
24494
|
+
}
|
|
24495
|
+
connectedCallback() {
|
|
24496
|
+
const valueToCopy = this.getAttribute("value");
|
|
24497
|
+
const shadowRoot = this.shadowRoot;
|
|
24498
|
+
const button = shadowRoot.querySelector("button");
|
|
24499
|
+
const copyIcon = shadowRoot.querySelector("#copy_icon");
|
|
24500
|
+
const copiedIcon = shadowRoot.querySelector("#copied_icon");
|
|
24501
|
+
const copiedNotif = shadowRoot.querySelector("#copied_notif");
|
|
24502
|
+
copyIcon.removeAttribute("aria-hidden");
|
|
24503
|
+
const copy = async () => {
|
|
24504
|
+
await addToClipboard(valueToCopy);
|
|
24505
|
+
copiedNotif.removeAttribute("aria-hidden");
|
|
24506
|
+
copyIcon.setAttribute("aria-hidden", "true");
|
|
24507
|
+
copiedIcon.setAttribute("aria-hidden", "false");
|
|
24508
|
+
setTimeout(() => {
|
|
24509
|
+
copiedNotif.setAttribute("aria-hidden", "true");
|
|
24510
|
+
copyIcon.setAttribute("aria-hidden", "false");
|
|
24511
|
+
copiedIcon.setAttribute("aria-hidden", "true");
|
|
24512
|
+
}, 1500);
|
|
24513
|
+
};
|
|
24514
|
+
button.onclick = () => {
|
|
24515
|
+
copy();
|
|
24516
|
+
};
|
|
24517
|
+
}
|
|
24518
|
+
}
|
|
24519
|
+
customElements.define("clipboard-copy", ClipboardCopy);
|
|
24520
|
+
const addToClipboard = async text => {
|
|
24521
|
+
const type = "text/plain";
|
|
24522
|
+
const clipboardItemData = {
|
|
24523
|
+
[type]: text
|
|
24524
|
+
};
|
|
24525
|
+
const clipboardItem = new ClipboardItem(clipboardItemData);
|
|
24526
|
+
await window.navigator.clipboard.write([clipboardItem]);
|
|
24527
|
+
};
|
|
24528
|
+
})();
|
|
24529
|
+
(() => {
|
|
24530
|
+
/*
|
|
24531
|
+
:host {
|
|
24532
|
+
display: block;
|
|
24533
|
+
}
|
|
24534
|
+
:host code[class*="language-"], :host pre[class*="language-"]{
|
|
24535
|
+
margin-top: 0;
|
|
24536
|
+
}
|
|
24537
|
+
*/
|
|
24538
|
+
|
|
24539
|
+
const css = /* css */`
|
|
24540
|
+
#code_block {
|
|
24541
|
+
position: relative;
|
|
24542
|
+
}
|
|
24543
|
+
|
|
24544
|
+
#pre {
|
|
24545
|
+
margin-top: 16px;
|
|
24546
|
+
margin-right: 0;
|
|
24547
|
+
margin-bottom: 16px;
|
|
24548
|
+
margin-left: 0;
|
|
24549
|
+
padding: 16px;
|
|
24550
|
+
font-size: 86%;
|
|
24551
|
+
background: #333;
|
|
24552
|
+
}
|
|
24553
|
+
`;
|
|
24554
|
+
const html = /* html */`<style>
|
|
24555
|
+
${css}
|
|
24556
|
+
</style>
|
|
24557
|
+
<div id="code_block">
|
|
24558
|
+
<pre id="pre"><code></code></pre>
|
|
24559
|
+
<div
|
|
24560
|
+
id="clipboard_copy_container"
|
|
24561
|
+
style="position: absolute; right: 0; top: 0"
|
|
24562
|
+
>
|
|
24563
|
+
<clipboard-copy></clipboard-copy>
|
|
24564
|
+
</div>
|
|
24565
|
+
</div>
|
|
24566
|
+
`;
|
|
24567
|
+
let loadPromise;
|
|
24568
|
+
const loadPrism = () => {
|
|
24569
|
+
if (loadPromise) {
|
|
24570
|
+
return loadPromise;
|
|
24571
|
+
}
|
|
24572
|
+
// https://prismjs.com/#basic-usage
|
|
24573
|
+
const scriptLoadPromise = new Promise((resolve, reject) => {
|
|
24574
|
+
window.Prism = window.Prism || {};
|
|
24575
|
+
window.Prism.manual = true;
|
|
24576
|
+
const script = document.createElement("script");
|
|
24577
|
+
script.src = "https://cdn.jsdelivr.net/npm/prismjs";
|
|
24578
|
+
script.onload = () => {
|
|
24579
|
+
resolve(window.Prism);
|
|
24580
|
+
};
|
|
24581
|
+
script.onerror = error => {
|
|
24582
|
+
reject(error);
|
|
24583
|
+
};
|
|
24584
|
+
document.head.appendChild(script);
|
|
24585
|
+
});
|
|
24586
|
+
const cssInjectionPromise = (async () => {
|
|
24587
|
+
const prismCssUrl = "https://cdn.jsdelivr.net/npm/prismjs/themes/prism-tomorrow.css?inline";
|
|
24588
|
+
const response = await window.fetch(prismCssUrl, {
|
|
24589
|
+
method: "GET"
|
|
24590
|
+
});
|
|
24591
|
+
const cssText = await response.text();
|
|
24592
|
+
const cssStylesheet = new CSSStyleSheet({
|
|
24593
|
+
baseUrl: prismCssUrl
|
|
24594
|
+
});
|
|
24595
|
+
cssStylesheet.replaceSync(cssText);
|
|
24596
|
+
return cssStylesheet;
|
|
24597
|
+
})();
|
|
24598
|
+
loadPromise = Promise.all([scriptLoadPromise, cssInjectionPromise]);
|
|
24599
|
+
return loadPromise;
|
|
24600
|
+
};
|
|
24601
|
+
class CodeBlock extends HTMLElement {
|
|
24602
|
+
constructor() {
|
|
24603
|
+
super();
|
|
24604
|
+
const root = this.attachShadow({
|
|
24605
|
+
mode: "open"
|
|
24606
|
+
});
|
|
24607
|
+
root.innerHTML = html;
|
|
24608
|
+
loadPrism();
|
|
24609
|
+
}
|
|
24610
|
+
async connectedCallback() {
|
|
24611
|
+
const shadowRoot = this.shadowRoot;
|
|
24612
|
+
const language = this.getAttribute("lang").toLowerCase();
|
|
24613
|
+
const isEscaped = this.hasAttribute("data-escaped");
|
|
24614
|
+
const addCopyButton = this.hasAttribute("data-copy-button");
|
|
24615
|
+
let code = this.innerHTML.trimStart();
|
|
24616
|
+
this.innerHTML = "";
|
|
24617
|
+
const codeNode = shadowRoot.querySelector("code");
|
|
24618
|
+
codeNode.className = `language-${language}`;
|
|
24619
|
+
codeNode.textContent = isEscaped ? unescapeHTML(code) : code;
|
|
24620
|
+
if (addCopyButton) {
|
|
24621
|
+
const clipboardCopy = shadowRoot.querySelector("clipboard-copy");
|
|
24622
|
+
clipboardCopy.setAttribute("value", isEscaped ? unescapeHTML(code) : code);
|
|
24623
|
+
}
|
|
24624
|
+
const [Prism, prismCssStyleSheet] = await loadPrism();
|
|
24625
|
+
shadowRoot.adoptedStyleSheets.push(prismCssStyleSheet);
|
|
24626
|
+
Prism.highlightAllUnder(shadowRoot);
|
|
24627
|
+
}
|
|
24628
|
+
}
|
|
24629
|
+
customElements.define("code-block", CodeBlock);
|
|
24630
|
+
const escape = document.createElement("textarea");
|
|
24631
|
+
function unescapeHTML(html) {
|
|
24632
|
+
escape.innerHTML = html;
|
|
24633
|
+
return escape.textContent;
|
|
24634
|
+
}
|
|
24635
|
+
})();
|
|
24636
|
+
|
|
24118
24637
|
const Code = props => {
|
|
24638
|
+
if (props.language) {
|
|
24639
|
+
return jsx(CodeBlock, {
|
|
24640
|
+
...props
|
|
24641
|
+
});
|
|
24642
|
+
}
|
|
24119
24643
|
if (props.box) {
|
|
24120
24644
|
return jsx(CodeBox, {
|
|
24121
24645
|
...props
|
|
@@ -24922,5 +25446,5 @@ const UserSvg = () => jsx("svg", {
|
|
|
24922
25446
|
})
|
|
24923
25447
|
});
|
|
24924
25448
|
|
|
24925
|
-
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 };
|
|
25449
|
+
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 };
|
|
24926
25450
|
//# sourceMappingURL=jsenv_navi.js.map
|