@photonix/basic 3.0.0 → 3.1.0
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/index.css +270 -14
- package/dist/index.d.mts +259 -2
- package/dist/index.d.ts +259 -2
- package/dist/index.js +1877 -349
- package/dist/index.mjs +1880 -363
- package/package.json +4 -3
package/dist/index.css
CHANGED
|
@@ -14,6 +14,15 @@
|
|
|
14
14
|
--surface-brand-subtle: var(--color-primary-100);
|
|
15
15
|
--surface-brand-primary-subtle: var(--color-primary-100);
|
|
16
16
|
}
|
|
17
|
+
:root,
|
|
18
|
+
[data-theme] {
|
|
19
|
+
--shadow-xs: var(--shadow-down-xs);
|
|
20
|
+
--shadow-sm: var(--shadow-down-sm);
|
|
21
|
+
--shadow-md: var(--shadow-down-md);
|
|
22
|
+
--shadow-lg: var(--shadow-down-lg);
|
|
23
|
+
--shadow-xl: var(--shadow-down-xl);
|
|
24
|
+
--shadow-2xl: var(--shadow-down-2xl);
|
|
25
|
+
}
|
|
17
26
|
|
|
18
27
|
/* ../ultimate/src/styles/global.css */
|
|
19
28
|
:root {
|
|
@@ -7359,6 +7368,7 @@
|
|
|
7359
7368
|
line-height: var(--title-md-line-height);
|
|
7360
7369
|
}
|
|
7361
7370
|
.textFieldContainer {
|
|
7371
|
+
--text-field-content-gap: var(--space-xs);
|
|
7362
7372
|
align-items: center;
|
|
7363
7373
|
border: var(--border-sm) solid var(--border-neutral-tertiary);
|
|
7364
7374
|
border-radius: var(--radius-2xs);
|
|
@@ -7401,6 +7411,7 @@
|
|
|
7401
7411
|
min-block-size: var(--dimensions-44);
|
|
7402
7412
|
}
|
|
7403
7413
|
.medium {
|
|
7414
|
+
--text-field-content-gap: var(--space-xs);
|
|
7404
7415
|
font-size: var(--body-md-size);
|
|
7405
7416
|
line-height: var(--body-md-line-height);
|
|
7406
7417
|
min-block-size: var(--dimensions-44);
|
|
@@ -7410,6 +7421,7 @@
|
|
|
7410
7421
|
min-block-size: var(--dimensions-36);
|
|
7411
7422
|
}
|
|
7412
7423
|
.small {
|
|
7424
|
+
--text-field-content-gap: var(--space-2xs);
|
|
7413
7425
|
font-size: var(--body-sm-size);
|
|
7414
7426
|
line-height: var(--body-sm-line-height);
|
|
7415
7427
|
min-block-size: var(--dimensions-36);
|
|
@@ -7444,7 +7456,7 @@
|
|
|
7444
7456
|
color: var(--foreground-neutral-primary);
|
|
7445
7457
|
display: flex;
|
|
7446
7458
|
justify-content: center;
|
|
7447
|
-
margin-inline-end: var(--
|
|
7459
|
+
margin-inline-end: var(--text-field-content-gap);
|
|
7448
7460
|
}
|
|
7449
7461
|
.textFieldLeadingText {
|
|
7450
7462
|
align-items: center;
|
|
@@ -7456,7 +7468,7 @@
|
|
|
7456
7468
|
font-size: var(--body-lg-size);
|
|
7457
7469
|
font-weight: var(--body-lg-weight);
|
|
7458
7470
|
justify-content: center;
|
|
7459
|
-
margin-inline-end: var(--
|
|
7471
|
+
margin-inline-end: var(--text-field-content-gap);
|
|
7460
7472
|
padding: var(--space-4xs) var(--space-2xs);
|
|
7461
7473
|
white-space: nowrap;
|
|
7462
7474
|
}
|
|
@@ -7465,7 +7477,7 @@
|
|
|
7465
7477
|
display: flex;
|
|
7466
7478
|
flex: 1;
|
|
7467
7479
|
flex-direction: column;
|
|
7468
|
-
padding-inline-end: var(--
|
|
7480
|
+
padding-inline-end: var(--text-field-content-gap);
|
|
7469
7481
|
position: relative;
|
|
7470
7482
|
}
|
|
7471
7483
|
.textFieldInlineLabel {
|
|
@@ -7538,7 +7550,7 @@
|
|
|
7538
7550
|
.textFieldTrailingGroup {
|
|
7539
7551
|
align-items: center;
|
|
7540
7552
|
display: flex;
|
|
7541
|
-
gap: var(--
|
|
7553
|
+
gap: var(--text-field-content-gap);
|
|
7542
7554
|
}
|
|
7543
7555
|
.textFieldClearButton {
|
|
7544
7556
|
block-size: var(--dimensions-20) !important;
|
|
@@ -7585,7 +7597,7 @@
|
|
|
7585
7597
|
font-family: var(--body-lg-family);
|
|
7586
7598
|
font-size: var(--body-lg-size);
|
|
7587
7599
|
font-weight: var(--body-lg-weight);
|
|
7588
|
-
gap: var(--
|
|
7600
|
+
gap: var(--text-field-content-gap);
|
|
7589
7601
|
line-height: var(--body-lg-line-height);
|
|
7590
7602
|
transition: color var(--motion-duration-normal) var(--motion-ease-standard);
|
|
7591
7603
|
}
|
|
@@ -7593,9 +7605,6 @@
|
|
|
7593
7605
|
.activeDropdown {
|
|
7594
7606
|
color: var(--text-neutral-primary);
|
|
7595
7607
|
}
|
|
7596
|
-
.textFieldTrailingDropdown span {
|
|
7597
|
-
margin-inline-end: calc(var(--dimensions-4) * -1);
|
|
7598
|
-
}
|
|
7599
7608
|
.textFieldChevronIcon {
|
|
7600
7609
|
align-items: center;
|
|
7601
7610
|
color: var(--foreground-neutral-primary);
|
|
@@ -7613,7 +7622,7 @@
|
|
|
7613
7622
|
color: var(--foreground-neutral-primary);
|
|
7614
7623
|
cursor: pointer;
|
|
7615
7624
|
display: flex;
|
|
7616
|
-
gap: var(--
|
|
7625
|
+
gap: var(--text-field-content-gap);
|
|
7617
7626
|
z-index: var(--z-local-below);
|
|
7618
7627
|
}
|
|
7619
7628
|
.textFieldPasswordToggleButton {
|
|
@@ -7754,17 +7763,12 @@
|
|
|
7754
7763
|
font-size: var(--body-sm-size);
|
|
7755
7764
|
font-weight: var(--body-sm-weight);
|
|
7756
7765
|
line-height: var(--body-sm-line-height);
|
|
7757
|
-
margin-inline-end: var(--space-2xs);
|
|
7758
7766
|
padding: 0 var(--space-3xs);
|
|
7759
7767
|
}
|
|
7760
|
-
.small .textFieldInputWrapper {
|
|
7761
|
-
padding-inline-end: var(--space-2xs);
|
|
7762
|
-
}
|
|
7763
7768
|
.small .textFieldTrailingDropdown {
|
|
7764
7769
|
font-family: var(--body-sm-family);
|
|
7765
7770
|
font-size: var(--body-sm-size);
|
|
7766
7771
|
font-weight: var(--body-sm-weight);
|
|
7767
|
-
gap: var(--space-3xs);
|
|
7768
7772
|
line-height: var(--body-sm-line-height);
|
|
7769
7773
|
}
|
|
7770
7774
|
.small .textFieldChevronIcon svg {
|
|
@@ -8384,6 +8388,9 @@
|
|
|
8384
8388
|
user-select: none;
|
|
8385
8389
|
vertical-align: middle;
|
|
8386
8390
|
}
|
|
8391
|
+
.chipRoot.rounded {
|
|
8392
|
+
border-radius: var(--radius-2xs);
|
|
8393
|
+
}
|
|
8387
8394
|
.chipRoot::after {
|
|
8388
8395
|
background-color: transparent;
|
|
8389
8396
|
content: "";
|
|
@@ -8567,6 +8574,42 @@
|
|
|
8567
8574
|
block-size: var(--dimensions-16);
|
|
8568
8575
|
inline-size: var(--dimensions-16);
|
|
8569
8576
|
}
|
|
8577
|
+
.small {
|
|
8578
|
+
block-size: var(--dimensions-32);
|
|
8579
|
+
font-size: var(--title-sm-size);
|
|
8580
|
+
font-weight: var(--title-sm-weight-emphasize);
|
|
8581
|
+
letter-spacing: var(--title-sm-letter-spacing);
|
|
8582
|
+
line-height: var(--title-sm-line-height);
|
|
8583
|
+
padding: 0 var(--dimensions-6);
|
|
8584
|
+
}
|
|
8585
|
+
.small.hasAvatar {
|
|
8586
|
+
padding: var(--dimensions-4);
|
|
8587
|
+
}
|
|
8588
|
+
.small .chipIcon,
|
|
8589
|
+
.small .chipIcon :global(svg) {
|
|
8590
|
+
block-size: var(--dimensions-16);
|
|
8591
|
+
inline-size: var(--dimensions-16);
|
|
8592
|
+
}
|
|
8593
|
+
.small .chipAvatar {
|
|
8594
|
+
block-size: var(--dimensions-24);
|
|
8595
|
+
flex-shrink: 0;
|
|
8596
|
+
inline-size: var(--dimensions-24);
|
|
8597
|
+
}
|
|
8598
|
+
.small .chipContent {
|
|
8599
|
+
padding: 0 var(--dimensions-4);
|
|
8600
|
+
}
|
|
8601
|
+
.small .chipTrailingIcon,
|
|
8602
|
+
.small .chipDelete,
|
|
8603
|
+
.small .chipAction,
|
|
8604
|
+
.small .chipTrailingIcon :global(svg),
|
|
8605
|
+
.small .chipDelete :global(svg),
|
|
8606
|
+
.small .chipAction :global(svg) {
|
|
8607
|
+
block-size: var(--dimensions-16);
|
|
8608
|
+
inline-size: var(--dimensions-16);
|
|
8609
|
+
}
|
|
8610
|
+
.outline .chipDelete {
|
|
8611
|
+
color: var(--foreground-neutral-primary);
|
|
8612
|
+
}
|
|
8570
8613
|
.clickable {
|
|
8571
8614
|
cursor: pointer;
|
|
8572
8615
|
}
|
|
@@ -8843,3 +8886,216 @@
|
|
|
8843
8886
|
background: var(--surface-neutral-elevator);
|
|
8844
8887
|
}
|
|
8845
8888
|
}
|
|
8889
|
+
|
|
8890
|
+
/* ../ultimate/src/components/star/Star.module.css */
|
|
8891
|
+
.starRoot {
|
|
8892
|
+
align-items: center;
|
|
8893
|
+
background: transparent;
|
|
8894
|
+
block-size: var(--dimensions-40);
|
|
8895
|
+
border: none;
|
|
8896
|
+
border-radius: 50%;
|
|
8897
|
+
color: var(--foreground-neutral-primary);
|
|
8898
|
+
cursor: pointer;
|
|
8899
|
+
display: inline-flex;
|
|
8900
|
+
flex-shrink: 0;
|
|
8901
|
+
inline-size: var(--dimensions-40);
|
|
8902
|
+
isolation: isolate;
|
|
8903
|
+
justify-content: center;
|
|
8904
|
+
outline: none;
|
|
8905
|
+
padding: 0;
|
|
8906
|
+
position: relative;
|
|
8907
|
+
-webkit-tap-highlight-color: transparent;
|
|
8908
|
+
transition: background-color var(--motion-duration-fast) var(--motion-ease-out);
|
|
8909
|
+
}
|
|
8910
|
+
.starRoot:focus-visible {
|
|
8911
|
+
outline: var(--border-md) solid var(--border-state-focus);
|
|
8912
|
+
outline-offset: var(--dimensions-2);
|
|
8913
|
+
}
|
|
8914
|
+
.starRoot:disabled {
|
|
8915
|
+
color: var(--foreground-state-disabled);
|
|
8916
|
+
cursor: not-allowed;
|
|
8917
|
+
}
|
|
8918
|
+
.starRoot::before {
|
|
8919
|
+
background-color: transparent;
|
|
8920
|
+
border-radius: 50%;
|
|
8921
|
+
content: "";
|
|
8922
|
+
inset: 0;
|
|
8923
|
+
opacity: var(--opacity-visible);
|
|
8924
|
+
pointer-events: none;
|
|
8925
|
+
position: absolute;
|
|
8926
|
+
transform: scale(1);
|
|
8927
|
+
transition:
|
|
8928
|
+
background-color var(--motion-duration-fast) ease-out,
|
|
8929
|
+
transform var(--motion-duration-fast) ease-out,
|
|
8930
|
+
opacity var(--motion-duration-fast) ease-out;
|
|
8931
|
+
}
|
|
8932
|
+
.starRoot:hover:not(:disabled)::before {
|
|
8933
|
+
background-color: var(--surface-neutral-on-surface);
|
|
8934
|
+
}
|
|
8935
|
+
.starRoot:active:not(:disabled)::before {
|
|
8936
|
+
background-color: var(--surface-state-press);
|
|
8937
|
+
}
|
|
8938
|
+
.starStatePressed::before {
|
|
8939
|
+
animation: star-pressed-expand var(--motion-duration-medium) var(--motion-ease-out) forwards;
|
|
8940
|
+
}
|
|
8941
|
+
@keyframes star-pressed-expand {
|
|
8942
|
+
0% {
|
|
8943
|
+
opacity: 1;
|
|
8944
|
+
transform: scale(1);
|
|
8945
|
+
}
|
|
8946
|
+
40% {
|
|
8947
|
+
opacity: 1;
|
|
8948
|
+
transform: scale(1.2);
|
|
8949
|
+
}
|
|
8950
|
+
100% {
|
|
8951
|
+
opacity: 0;
|
|
8952
|
+
transform: scale(1);
|
|
8953
|
+
}
|
|
8954
|
+
}
|
|
8955
|
+
.starIconWrapper {
|
|
8956
|
+
align-items: center;
|
|
8957
|
+
block-size: var(--dimensions-24);
|
|
8958
|
+
display: flex;
|
|
8959
|
+
inline-size: var(--dimensions-24);
|
|
8960
|
+
justify-content: center;
|
|
8961
|
+
position: relative;
|
|
8962
|
+
transition: color 150ms ease-out;
|
|
8963
|
+
z-index: var(--z-local-content);
|
|
8964
|
+
}
|
|
8965
|
+
.starStateChecked.starVariantDefault {
|
|
8966
|
+
color: var(--surface-accent-yellow);
|
|
8967
|
+
}
|
|
8968
|
+
.starStateChecked.starVariantNeutral {
|
|
8969
|
+
color: var(--foreground-neutral-primary);
|
|
8970
|
+
}
|
|
8971
|
+
.starSizeSmall {
|
|
8972
|
+
block-size: var(--dimensions-32);
|
|
8973
|
+
inline-size: var(--dimensions-32);
|
|
8974
|
+
}
|
|
8975
|
+
.starSizeSmall .starIconWrapper {
|
|
8976
|
+
block-size: var(--dimensions-20);
|
|
8977
|
+
inline-size: var(--dimensions-20);
|
|
8978
|
+
}
|
|
8979
|
+
.starSizeMedium {
|
|
8980
|
+
block-size: var(--dimensions-40);
|
|
8981
|
+
inline-size: var(--dimensions-40);
|
|
8982
|
+
}
|
|
8983
|
+
.starSizeMedium .starIconWrapper {
|
|
8984
|
+
block-size: var(--dimensions-24);
|
|
8985
|
+
inline-size: var(--dimensions-24);
|
|
8986
|
+
}
|
|
8987
|
+
|
|
8988
|
+
/* ../ultimate/src/components/otp/OTP.module.css */
|
|
8989
|
+
.separator {
|
|
8990
|
+
align-self: center;
|
|
8991
|
+
color: var(--text-neutral-secondary);
|
|
8992
|
+
text-align: center;
|
|
8993
|
+
user-select: none;
|
|
8994
|
+
}
|
|
8995
|
+
.cellSlot {
|
|
8996
|
+
display: flex;
|
|
8997
|
+
min-inline-size: 0;
|
|
8998
|
+
position: relative;
|
|
8999
|
+
}
|
|
9000
|
+
.dot {
|
|
9001
|
+
background-color: var(--text-neutral-primary);
|
|
9002
|
+
block-size: var(--dimensions-8);
|
|
9003
|
+
border-radius: 50%;
|
|
9004
|
+
inline-size: var(--dimensions-8);
|
|
9005
|
+
inset: 0;
|
|
9006
|
+
margin: auto;
|
|
9007
|
+
pointer-events: none;
|
|
9008
|
+
position: absolute;
|
|
9009
|
+
}
|
|
9010
|
+
.cell {
|
|
9011
|
+
appearance: none;
|
|
9012
|
+
background: transparent;
|
|
9013
|
+
block-size: 100%;
|
|
9014
|
+
border: var(--border-sm) solid var(--border-neutral-tertiary);
|
|
9015
|
+
border-radius: var(--radius-2xs);
|
|
9016
|
+
box-sizing: border-box;
|
|
9017
|
+
caret-color: var(--text-neutral-primary);
|
|
9018
|
+
color: var(--text-neutral-primary);
|
|
9019
|
+
display: block;
|
|
9020
|
+
font: inherit;
|
|
9021
|
+
inline-size: 100%;
|
|
9022
|
+
letter-spacing: inherit;
|
|
9023
|
+
margin: 0;
|
|
9024
|
+
min-inline-size: 0;
|
|
9025
|
+
outline: none;
|
|
9026
|
+
padding: var(--space-5xs) var(--space-4xs);
|
|
9027
|
+
text-align: center;
|
|
9028
|
+
transition: background-color var(--motion-duration-normal) var(--motion-ease-standard), border-color var(--motion-duration-normal) var(--motion-ease-standard);
|
|
9029
|
+
}
|
|
9030
|
+
.masked {
|
|
9031
|
+
caret-color: transparent;
|
|
9032
|
+
color: transparent;
|
|
9033
|
+
}
|
|
9034
|
+
.masked::selection {
|
|
9035
|
+
background-color: transparent;
|
|
9036
|
+
color: transparent;
|
|
9037
|
+
}
|
|
9038
|
+
.large {
|
|
9039
|
+
block-size: var(--dimensions-44);
|
|
9040
|
+
}
|
|
9041
|
+
.medium {
|
|
9042
|
+
block-size: var(--dimensions-36);
|
|
9043
|
+
}
|
|
9044
|
+
.small {
|
|
9045
|
+
block-size: var(--dimensions-28);
|
|
9046
|
+
}
|
|
9047
|
+
.small .cell {
|
|
9048
|
+
padding-block: 0;
|
|
9049
|
+
}
|
|
9050
|
+
.cell:focus {
|
|
9051
|
+
border-color: var(--border-state-focus);
|
|
9052
|
+
box-shadow: inset 0 0 0 var(--border-sm) var(--border-state-focus);
|
|
9053
|
+
}
|
|
9054
|
+
.cell[aria-invalid=true] {
|
|
9055
|
+
background-color: var(--surface-state-error);
|
|
9056
|
+
border-color: var(--border-state-error);
|
|
9057
|
+
}
|
|
9058
|
+
.cell[aria-invalid=true]:focus {
|
|
9059
|
+
box-shadow: inset 0 0 0 var(--border-sm) var(--border-state-error);
|
|
9060
|
+
}
|
|
9061
|
+
.cell:disabled {
|
|
9062
|
+
background-color: var(--surface-state-disabled);
|
|
9063
|
+
cursor: not-allowed;
|
|
9064
|
+
opacity: var(--opacity-disabled);
|
|
9065
|
+
}
|
|
9066
|
+
.cell:disabled + .dot {
|
|
9067
|
+
opacity: var(--opacity-disabled);
|
|
9068
|
+
}
|
|
9069
|
+
.cell:read-only:not(:disabled, [aria-invalid=true]) {
|
|
9070
|
+
background-color: var(--surface-neutral-secondary);
|
|
9071
|
+
cursor: text;
|
|
9072
|
+
}
|
|
9073
|
+
.cell:hover:not(:focus, :disabled, :read-only, [aria-invalid=true]) {
|
|
9074
|
+
background-color: var(--surface-state-hover);
|
|
9075
|
+
border-color: var(--border-state-hover);
|
|
9076
|
+
}
|
|
9077
|
+
.dotField.large,
|
|
9078
|
+
.dotField.medium,
|
|
9079
|
+
.dotField.small {
|
|
9080
|
+
block-size: var(--dimensions-16);
|
|
9081
|
+
}
|
|
9082
|
+
.cell.dotFieldInput {
|
|
9083
|
+
border-radius: 50%;
|
|
9084
|
+
padding: 0;
|
|
9085
|
+
}
|
|
9086
|
+
.cell.dotFieldInput[data-filled=true] {
|
|
9087
|
+
background-color: var(--text-neutral-primary);
|
|
9088
|
+
border-color: var(--text-neutral-primary);
|
|
9089
|
+
}
|
|
9090
|
+
.cell.dotFieldInput[aria-invalid=true][data-filled=true] {
|
|
9091
|
+
background-color: var(--border-state-error);
|
|
9092
|
+
border-color: var(--border-state-error);
|
|
9093
|
+
}
|
|
9094
|
+
.cell.dotFieldInput:focus {
|
|
9095
|
+
outline: none;
|
|
9096
|
+
}
|
|
9097
|
+
@media (prefers-reduced-motion: reduce) {
|
|
9098
|
+
.cell {
|
|
9099
|
+
transition: none;
|
|
9100
|
+
}
|
|
9101
|
+
}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
export * from '@photonix/icons';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Layout component type definitions
|
|
@@ -565,6 +566,8 @@ interface CheckboxProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
565
566
|
* Whether the checkbox is checked (controlled)
|
|
566
567
|
*/
|
|
567
568
|
checked?: boolean;
|
|
569
|
+
/** Participate in native form validation. */
|
|
570
|
+
required?: boolean;
|
|
568
571
|
/**
|
|
569
572
|
* Initial checked state when uncontrolled
|
|
570
573
|
*/
|
|
@@ -603,6 +606,8 @@ interface RadioProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
603
606
|
* Whether the radio is selected (controlled)
|
|
604
607
|
*/
|
|
605
608
|
checked?: boolean;
|
|
609
|
+
/** Participate in native form validation. */
|
|
610
|
+
required?: boolean;
|
|
606
611
|
/**
|
|
607
612
|
* Initial selected state when uncontrolled
|
|
608
613
|
*/
|
|
@@ -622,11 +627,42 @@ interface RadioProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
622
627
|
}
|
|
623
628
|
declare const Radio: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLButtonElement>>;
|
|
624
629
|
|
|
630
|
+
/** Props shared by RadioGroup and CheckboxGroup so the two groups read the same way. */
|
|
631
|
+
interface SelectionGroupBaseProps extends Omit<React.FieldsetHTMLAttributes<HTMLFieldSetElement>, 'onChange' | 'defaultValue' | 'value' | 'form' | 'name'> {
|
|
632
|
+
/** Visible group label (legend). Omit only when `aria-label` names the group. */
|
|
633
|
+
label?: React.ReactNode;
|
|
634
|
+
/** Supporting text below the label. */
|
|
635
|
+
description?: React.ReactNode;
|
|
636
|
+
/** Error message; also marks the group invalid. */
|
|
637
|
+
error?: React.ReactNode;
|
|
638
|
+
/** Form field name applied to every option. */
|
|
639
|
+
name?: string;
|
|
640
|
+
/** Associates the options with a form outside the group. */
|
|
641
|
+
form?: string;
|
|
642
|
+
disabled?: boolean;
|
|
643
|
+
required?: boolean;
|
|
644
|
+
/** Layout of the options. @default 'vertical' */
|
|
645
|
+
orientation?: 'horizontal' | 'vertical';
|
|
646
|
+
children: React.ReactNode;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
interface RadioGroupProps extends SelectionGroupBaseProps {
|
|
650
|
+
/** Selected option value (controlled). */
|
|
651
|
+
value?: string;
|
|
652
|
+
/** Initially selected option value (uncontrolled). */
|
|
653
|
+
defaultValue?: string;
|
|
654
|
+
onChange?: (value: string) => void;
|
|
655
|
+
}
|
|
656
|
+
/** Single-choice group of `Radio` children with roving focus and native form support. */
|
|
657
|
+
declare const RadioGroup: React.ForwardRefExoticComponent<RadioGroupProps & React.RefAttributes<HTMLFieldSetElement>>;
|
|
658
|
+
|
|
625
659
|
interface SwitchProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
|
|
626
660
|
/**
|
|
627
661
|
* Whether the switch is on (controlled)
|
|
628
662
|
*/
|
|
629
663
|
checked?: boolean;
|
|
664
|
+
/** Participate in native form validation. */
|
|
665
|
+
required?: boolean;
|
|
630
666
|
/**
|
|
631
667
|
* Initial state when uncontrolled
|
|
632
668
|
*/
|
|
@@ -662,6 +698,8 @@ interface TextFieldDropdownOption {
|
|
|
662
698
|
disabled?: boolean;
|
|
663
699
|
}
|
|
664
700
|
interface TextFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size'> {
|
|
701
|
+
/** Style the native input without changing the field wrapper layout. */
|
|
702
|
+
inputStyle?: React.CSSProperties;
|
|
665
703
|
/** Label text. */
|
|
666
704
|
label?: string;
|
|
667
705
|
/** Whether the label is placed inside or outside the input box. Default is 'outside'. */
|
|
@@ -1002,7 +1040,12 @@ interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1002
1040
|
/**
|
|
1003
1041
|
* Size of the chip
|
|
1004
1042
|
*/
|
|
1005
|
-
size?: 'medium' | 'large';
|
|
1043
|
+
size?: 'small' | 'medium' | 'large';
|
|
1044
|
+
/**
|
|
1045
|
+
* Corner shape: 'pill' is fully rounded, 'rounded' uses the Button corner
|
|
1046
|
+
* radius (e.g. tags inside an input).
|
|
1047
|
+
*/
|
|
1048
|
+
shape?: 'pill' | 'rounded';
|
|
1006
1049
|
/**
|
|
1007
1050
|
* Whether the chip is disabled
|
|
1008
1051
|
*/
|
|
@@ -1017,6 +1060,16 @@ interface ChipProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
1017
1060
|
* Callback when clear button is clicked (only for filled + hasDropdown)
|
|
1018
1061
|
*/
|
|
1019
1062
|
onClear?: (e: React.MouseEvent) => void;
|
|
1063
|
+
/**
|
|
1064
|
+
* Shows the chip's delete button (CancelFilled) on any variant, e.g. for
|
|
1065
|
+
* removable tags. Takes precedence over `actionIcon`.
|
|
1066
|
+
*/
|
|
1067
|
+
onRemove?: (e: React.MouseEvent) => void;
|
|
1068
|
+
/**
|
|
1069
|
+
* Accessible label for the close button
|
|
1070
|
+
* @default `Remove ${label}`
|
|
1071
|
+
*/
|
|
1072
|
+
removeLabel?: string;
|
|
1020
1073
|
/**
|
|
1021
1074
|
* Optional action icon shown after the dropdown affordance
|
|
1022
1075
|
*/
|
|
@@ -1106,4 +1159,208 @@ declare const LayoutProvider: React.FC<LayoutProviderProps>;
|
|
|
1106
1159
|
*/
|
|
1107
1160
|
declare const useLayout: () => LayoutContextValue | null;
|
|
1108
1161
|
|
|
1109
|
-
|
|
1162
|
+
/** Native fieldset with a legend, supporting text and an error message for grouped controls. */
|
|
1163
|
+
interface FieldsetProps extends React.FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
1164
|
+
/** Visible group label. Omit only when the group is named with aria-label. */
|
|
1165
|
+
legend?: React.ReactNode;
|
|
1166
|
+
description?: React.ReactNode;
|
|
1167
|
+
error?: React.ReactNode;
|
|
1168
|
+
}
|
|
1169
|
+
declare const Fieldset: React.ForwardRefExoticComponent<FieldsetProps & React.RefAttributes<HTMLFieldSetElement>>;
|
|
1170
|
+
|
|
1171
|
+
interface CheckboxGroupProps extends SelectionGroupBaseProps {
|
|
1172
|
+
/** Checked option values (controlled). */
|
|
1173
|
+
value?: string[];
|
|
1174
|
+
/** Initially checked option values (uncontrolled). */
|
|
1175
|
+
defaultValue?: string[];
|
|
1176
|
+
onChange?: (value: string[]) => void;
|
|
1177
|
+
/** Message shown by native validation when `required` and nothing is checked. */
|
|
1178
|
+
requiredMessage?: string;
|
|
1179
|
+
}
|
|
1180
|
+
declare const CheckboxGroupContext: React.Context<{
|
|
1181
|
+
value: string[];
|
|
1182
|
+
name?: string;
|
|
1183
|
+
form?: string;
|
|
1184
|
+
disabled?: boolean;
|
|
1185
|
+
toggle: (value: string, checked: boolean) => void;
|
|
1186
|
+
} | null>;
|
|
1187
|
+
/** Multi-choice group of `Checkbox` children; same API shape as `RadioGroup`. */
|
|
1188
|
+
declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLFieldSetElement>>;
|
|
1189
|
+
|
|
1190
|
+
interface NumberFieldProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "type" | "min" | "max" | "step" | "size"> {
|
|
1191
|
+
label: string;
|
|
1192
|
+
size?: "small" | "medium" | "large";
|
|
1193
|
+
inputWidth?: number | string;
|
|
1194
|
+
value?: number | null;
|
|
1195
|
+
defaultValue?: number | null;
|
|
1196
|
+
onChange?: (value: number | null) => void;
|
|
1197
|
+
min?: number;
|
|
1198
|
+
max?: number;
|
|
1199
|
+
step?: number;
|
|
1200
|
+
error?: string;
|
|
1201
|
+
description?: string;
|
|
1202
|
+
/** Accessible name of the decrement button. @default `Decrease ${label}` */
|
|
1203
|
+
decreaseLabel?: string;
|
|
1204
|
+
/** Accessible name of the increment button. @default `Increase ${label}` */
|
|
1205
|
+
increaseLabel?: string;
|
|
1206
|
+
}
|
|
1207
|
+
declare function NumberField({ label, size, inputWidth, value, defaultValue, onChange, min, max, step, error, description, disabled, readOnly, name, decreaseLabel, increaseLabel, ...props }: NumberFieldProps): react_jsx_runtime.JSX.Element;
|
|
1208
|
+
|
|
1209
|
+
interface RatingProps {
|
|
1210
|
+
label: string;
|
|
1211
|
+
value?: number;
|
|
1212
|
+
defaultValue?: number;
|
|
1213
|
+
max?: number;
|
|
1214
|
+
onChange?: (value: number) => void;
|
|
1215
|
+
disabled?: boolean;
|
|
1216
|
+
readOnly?: boolean;
|
|
1217
|
+
name?: string;
|
|
1218
|
+
form?: string;
|
|
1219
|
+
/** Show a button that resets the rating to 0. @default false */
|
|
1220
|
+
clearable?: boolean;
|
|
1221
|
+
/** Visible text of the clear button. */
|
|
1222
|
+
clearText?: string;
|
|
1223
|
+
/** Accessible name of the clear button. */
|
|
1224
|
+
clearLabel?: string;
|
|
1225
|
+
/** Accessible name of each star. */
|
|
1226
|
+
getStarLabel?: (value: number, max: number) => string;
|
|
1227
|
+
}
|
|
1228
|
+
declare function Rating({ label, value, defaultValue, max, onChange, disabled, readOnly, name, form, clearable, clearText, clearLabel, getStarLabel, }: RatingProps): react_jsx_runtime.JSX.Element;
|
|
1229
|
+
|
|
1230
|
+
interface OTPProps {
|
|
1231
|
+
label: string;
|
|
1232
|
+
length?: number;
|
|
1233
|
+
/** Insert a visual dash between groups of digits. */
|
|
1234
|
+
groupSize?: number;
|
|
1235
|
+
/** Conceal each entered digit with a dot. Used by PIN. */
|
|
1236
|
+
masked?: boolean;
|
|
1237
|
+
/** Use the label only as an accessible name, without displaying it. */
|
|
1238
|
+
hideLabel?: boolean;
|
|
1239
|
+
/** Render circular PIN indicators instead of rectangular input fields. */
|
|
1240
|
+
dotFields?: boolean;
|
|
1241
|
+
size?: "small" | "medium" | "large";
|
|
1242
|
+
value?: string;
|
|
1243
|
+
defaultValue?: string;
|
|
1244
|
+
onChange?: (value: string) => void;
|
|
1245
|
+
/** Called automatically when every cell is filled. Verify the code here and pass failures via error. */
|
|
1246
|
+
onComplete?: (value: string) => void;
|
|
1247
|
+
disabled?: boolean;
|
|
1248
|
+
/** Display an existing code without edits. Copying a cell copies the full code. */
|
|
1249
|
+
readOnly?: boolean;
|
|
1250
|
+
required?: boolean;
|
|
1251
|
+
name?: string;
|
|
1252
|
+
form?: string;
|
|
1253
|
+
/** Supporting text below the inputs; an error takes precedence. */
|
|
1254
|
+
helperText?: string;
|
|
1255
|
+
error?: string;
|
|
1256
|
+
/** Accessible name of each cell. */
|
|
1257
|
+
getCellLabel?: (label: string, position: number, length: number) => string;
|
|
1258
|
+
/**
|
|
1259
|
+
* Sequential entry, used by PIN: every tap, focus or key lands on the first empty
|
|
1260
|
+
* cell — digits fill left to right, Backspace clears from the right and no cell
|
|
1261
|
+
* can be picked by hand.
|
|
1262
|
+
*/
|
|
1263
|
+
sequential?: boolean;
|
|
1264
|
+
/** Focus the field when it mounts (on the next cell when `sequential`). */
|
|
1265
|
+
autoFocus?: boolean;
|
|
1266
|
+
}
|
|
1267
|
+
/** Segmented numeric entry with independent input cells, paste/autofill and native form support. */
|
|
1268
|
+
declare function OTP({ label, length, groupSize, masked, hideLabel, dotFields, size, value, defaultValue, onChange, onComplete, disabled, readOnly, required, name, form, helperText, error, getCellLabel, sequential, autoFocus, }: OTPProps): react_jsx_runtime.JSX.Element;
|
|
1269
|
+
|
|
1270
|
+
interface PINProps extends Omit<OTPProps, "label" | "masked" | "hideLabel" | "dotFields" | "groupSize" | "readOnly" | "size"> {
|
|
1271
|
+
/** Number of digits in the PIN. @default 4 */
|
|
1272
|
+
length?: number;
|
|
1273
|
+
/** Accessible name for the PIN inputs; no visible label is rendered. */
|
|
1274
|
+
"aria-label"?: string;
|
|
1275
|
+
/** Focus the first empty dot on mount. Only one field on a page can; pass `false` for the rest. @default true */
|
|
1276
|
+
autoFocus?: boolean;
|
|
1277
|
+
}
|
|
1278
|
+
/**
|
|
1279
|
+
* Numeric PIN entry with empty circular indicators that fill as digits are entered.
|
|
1280
|
+
* Entry is sequential: digits fill left to right, Backspace clears from the right and
|
|
1281
|
+
* no dot can be picked by hand.
|
|
1282
|
+
*/
|
|
1283
|
+
declare function PIN({ length, "aria-label": accessibleLabel, autoFocus, ...props }: PINProps): react_jsx_runtime.JSX.Element;
|
|
1284
|
+
|
|
1285
|
+
interface EmptyProps {
|
|
1286
|
+
title?: string;
|
|
1287
|
+
description?: React.ReactNode;
|
|
1288
|
+
icon?: React.ReactNode;
|
|
1289
|
+
action?: React.ReactNode;
|
|
1290
|
+
}
|
|
1291
|
+
declare function Empty({ title, description, icon, action, }: EmptyProps): react_jsx_runtime.JSX.Element;
|
|
1292
|
+
|
|
1293
|
+
interface ResultProps {
|
|
1294
|
+
status: "success" | "error" | "warning" | "info";
|
|
1295
|
+
title: string;
|
|
1296
|
+
description?: React.ReactNode;
|
|
1297
|
+
action?: React.ReactNode;
|
|
1298
|
+
}
|
|
1299
|
+
declare function Result({ status, title, description, action }: ResultProps): react_jsx_runtime.JSX.Element;
|
|
1300
|
+
|
|
1301
|
+
/**
|
|
1302
|
+
* How each label/value pair is laid out (Figma "Detail Field"):
|
|
1303
|
+
* - `stack`: label above the value (Detail Field Stack).
|
|
1304
|
+
* - `inline`: label on the left, value right-aligned on the same row (Detail Field Inline).
|
|
1305
|
+
* - `column`: label and value in a 2 : 3 column grid, value left-aligned (Detail Field Column).
|
|
1306
|
+
*/
|
|
1307
|
+
type DataListLayout = "stack" | "inline" | "column";
|
|
1308
|
+
/**
|
|
1309
|
+
* Per-item variant (Figma Detail Field `variant`).
|
|
1310
|
+
* - `normal`: default row.
|
|
1311
|
+
* - `emphasize`: value in medium weight.
|
|
1312
|
+
* - `total`: summary row — emphasized label and value.
|
|
1313
|
+
* - `flexible` (inline/column): the label hugs its text and the value takes the remaining width.
|
|
1314
|
+
* - `hero` (stack): the value as a large headline figure, e.g. a balance; supports `masked`.
|
|
1315
|
+
* - `complex` (stack): a rich value (avatar, title, meta) that fills the row, with the action at the end.
|
|
1316
|
+
*/
|
|
1317
|
+
type DataListItemVariant = "normal" | "emphasize" | "total" | "flexible" | "hero" | "complex";
|
|
1318
|
+
interface DataListItem {
|
|
1319
|
+
id: string;
|
|
1320
|
+
label: React.ReactNode;
|
|
1321
|
+
value: React.ReactNode;
|
|
1322
|
+
/** @default "normal" */
|
|
1323
|
+
variant?: DataListItemVariant;
|
|
1324
|
+
/**
|
|
1325
|
+
* Medium-weight label (Figma Label `emphasized`): primary text. With `labelLead` the label
|
|
1326
|
+
* stays secondary and only takes the weight (`subEmphasized`). Implied by `variant="total"`.
|
|
1327
|
+
*/
|
|
1328
|
+
labelEmphasized?: boolean;
|
|
1329
|
+
/** Lead-in before the label in primary text, e.g. "Send to" (Figma Label `subNormal`/`subEmphasized`). */
|
|
1330
|
+
labelLead?: React.ReactNode;
|
|
1331
|
+
/** Icon before the label, 20px (Figma Label `hasPrefix`). */
|
|
1332
|
+
labelIcon?: React.ReactNode;
|
|
1333
|
+
/** Secondary text at the end of the label row, e.g. "20/500" (Figma Label `hasTrailing`). */
|
|
1334
|
+
labelTrailing?: React.ReactNode;
|
|
1335
|
+
/** 20px icon before the value (Figma Body `leadingIcon`). */
|
|
1336
|
+
icon?: React.ReactNode;
|
|
1337
|
+
/** Muted text before the value, e.g. a currency symbol. */
|
|
1338
|
+
valuePrefix?: React.ReactNode;
|
|
1339
|
+
/** `hero` only: replace the figure with six dots (Figma Balance `hidden`). */
|
|
1340
|
+
masked?: boolean;
|
|
1341
|
+
/** Secondary text on a second line under the value (Figma Body `2 line`). */
|
|
1342
|
+
description?: React.ReactNode;
|
|
1343
|
+
/** Status badge (Figma Body `text w badge`), e.g. `<Badge shape="rounded" color="onLight" />`. */
|
|
1344
|
+
badge?: React.ReactNode;
|
|
1345
|
+
/** `inline`: right after the value, 8px apart. `below`: on its own line under the value. @default "inline" */
|
|
1346
|
+
badgePlacement?: "inline" | "below";
|
|
1347
|
+
/**
|
|
1348
|
+
* Control after the value, e.g. a copy IconButton (Figma Body `trailingIcon`, 20px). It sits in a
|
|
1349
|
+
* 20px slot and never grows the row; use `size="medium"` so the button's icon is 20px.
|
|
1350
|
+
*/
|
|
1351
|
+
action?: React.ReactNode;
|
|
1352
|
+
}
|
|
1353
|
+
interface DataListProps {
|
|
1354
|
+
items: DataListItem[];
|
|
1355
|
+
/** Accessible name of the list. @default "Details" */
|
|
1356
|
+
label?: string;
|
|
1357
|
+
/** @default "stack" for `orientation="vertical"`, otherwise "inline" */
|
|
1358
|
+
layout?: DataListLayout;
|
|
1359
|
+
/** Label size (Figma Label `size`): `sm` = title-sm, `lg` = title-md. @default "sm" in stack, "lg" otherwise */
|
|
1360
|
+
labelSize?: "sm" | "lg";
|
|
1361
|
+
/** @deprecated Use `layout`: "horizontal" maps to `inline`, "vertical" to `stack`. */
|
|
1362
|
+
orientation?: "horizontal" | "vertical";
|
|
1363
|
+
}
|
|
1364
|
+
declare function DataList({ items, label, layout, labelSize, orientation, }: DataListProps): react_jsx_runtime.JSX.Element;
|
|
1365
|
+
|
|
1366
|
+
export { AVATAR_IMAGES, AspectRatio$1 as AspectRatio, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type AvatarSize, AvatarTemplate, type AvatarTemplateProps, type BackgroundToken, Badge, Box, Button, type ButtonProps, Center, Checkbox, CheckboxGroup, CheckboxGroupContext, type CheckboxGroupProps, Chip, ChipBar, type ChipProps, Cluster, Container, CustomScrollbar, DataList, type DataListItem, type DataListItemVariant, type DataListLayout, type DataListProps, Divider, Empty, type EmptyProps, Fieldset, type FieldsetProps, Flex, Grid, GridItem, HStack, Heading, IconButton, Image, LayoutContext, LayoutProvider, NumberField, type NumberFieldProps, OTP, type OTPProps, PIN, type PINProps, Portal, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type RadiusToken, Rating, type RatingProps, Result, type ResultProps, type ShadowToken, SimpleGrid, Skeleton, SlotPlaceholder, type SlotPlaceholderProps, Spacer, type SpacingToken, Spinner, Stack, Switch, type SwitchProps, Text, TextArea, type TextAreaProps, TextField, type TextFieldDropdownOption, type TextFieldProps, VStack, VisuallyHidden, useLayout };
|