jaci-ui 0.1.1 → 0.3.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/CHANGELOG.md +12 -0
- package/README.md +77 -1
- package/dist/components/button-group/button-group.cjs +22 -0
- package/dist/components/button-group/button-group.cjs.map +1 -0
- package/dist/components/button-group/button-group.d.cts +12 -0
- package/dist/components/button-group/button-group.d.ts +12 -0
- package/dist/components/button-group/button-group.js +21 -0
- package/dist/components/button-group/button-group.js.map +1 -0
- package/dist/components/button-group/index.d.cts +2 -0
- package/dist/components/button-group/index.d.ts +2 -0
- package/dist/components/color-picker/color-picker.cjs +77 -22
- package/dist/components/color-picker/color-picker.cjs.map +1 -1
- package/dist/components/color-picker/color-picker.d.cts +3 -3
- package/dist/components/color-picker/color-picker.d.ts +3 -3
- package/dist/components/color-picker/color-picker.js +77 -22
- package/dist/components/color-picker/color-picker.js.map +1 -1
- package/dist/components/date-picker/date-picker.cjs +227 -30
- package/dist/components/date-picker/date-picker.cjs.map +1 -1
- package/dist/components/date-picker/date-picker.d.cts +23 -5
- package/dist/components/date-picker/date-picker.d.ts +23 -5
- package/dist/components/date-picker/date-picker.js +226 -32
- package/dist/components/date-picker/date-picker.js.map +1 -1
- package/dist/components/date-picker/date-utils.cjs +32 -2
- package/dist/components/date-picker/date-utils.cjs.map +1 -1
- package/dist/components/date-picker/date-utils.d.cts +5 -0
- package/dist/components/date-picker/date-utils.d.ts +5 -0
- package/dist/components/date-picker/date-utils.js +29 -3
- package/dist/components/date-picker/date-utils.js.map +1 -1
- package/dist/components/date-picker/index.d.cts +3 -2
- package/dist/components/date-picker/index.d.ts +3 -2
- package/dist/components/empty-state/empty-state.cjs +62 -0
- package/dist/components/empty-state/empty-state.cjs.map +1 -0
- package/dist/components/empty-state/empty-state.d.cts +18 -0
- package/dist/components/empty-state/empty-state.d.ts +18 -0
- package/dist/components/empty-state/empty-state.js +57 -0
- package/dist/components/empty-state/empty-state.js.map +1 -0
- package/dist/components/empty-state/index.d.cts +2 -0
- package/dist/components/empty-state/index.d.ts +2 -0
- package/dist/components/icon-button/icon-button.cjs +40 -0
- package/dist/components/icon-button/icon-button.cjs.map +1 -0
- package/dist/components/icon-button/icon-button.d.cts +12 -0
- package/dist/components/icon-button/icon-button.d.ts +12 -0
- package/dist/components/icon-button/icon-button.js +40 -0
- package/dist/components/icon-button/icon-button.js.map +1 -0
- package/dist/components/icon-button/index.d.cts +2 -0
- package/dist/components/icon-button/index.d.ts +2 -0
- package/dist/components/input-group/index.d.cts +2 -0
- package/dist/components/input-group/index.d.ts +2 -0
- package/dist/components/input-group/input-group.cjs +32 -0
- package/dist/components/input-group/input-group.cjs.map +1 -0
- package/dist/components/input-group/input-group.d.cts +15 -0
- package/dist/components/input-group/input-group.d.ts +15 -0
- package/dist/components/input-group/input-group.js +30 -0
- package/dist/components/input-group/input-group.js.map +1 -0
- package/dist/index.cjs +22 -0
- package/dist/index.d.cts +13 -2
- package/dist/index.d.ts +13 -2
- package/dist/index.js +7 -2
- package/dist/styled-system/recipes/button-group.cjs +30 -0
- package/dist/styled-system/recipes/button-group.cjs.map +1 -0
- package/dist/styled-system/recipes/button-group.js +30 -0
- package/dist/styled-system/recipes/button-group.js.map +1 -0
- package/dist/styled-system/recipes/color-picker.cjs +1 -0
- package/dist/styled-system/recipes/color-picker.cjs.map +1 -1
- package/dist/styled-system/recipes/color-picker.js +1 -0
- package/dist/styled-system/recipes/color-picker.js.map +1 -1
- package/dist/styled-system/recipes/date-picker.cjs +6 -0
- package/dist/styled-system/recipes/date-picker.cjs.map +1 -1
- package/dist/styled-system/recipes/date-picker.js +6 -0
- package/dist/styled-system/recipes/date-picker.js.map +1 -1
- package/dist/styled-system/recipes/empty-state.cjs +36 -0
- package/dist/styled-system/recipes/empty-state.cjs.map +1 -0
- package/dist/styled-system/recipes/empty-state.js +36 -0
- package/dist/styled-system/recipes/empty-state.js.map +1 -0
- package/dist/styled-system/recipes/icon-button.cjs +40 -0
- package/dist/styled-system/recipes/icon-button.cjs.map +1 -0
- package/dist/styled-system/recipes/icon-button.js +40 -0
- package/dist/styled-system/recipes/icon-button.js.map +1 -0
- package/dist/styled-system/recipes/input-group.cjs +30 -0
- package/dist/styled-system/recipes/input-group.cjs.map +1 -0
- package/dist/styled-system/recipes/input-group.js +30 -0
- package/dist/styled-system/recipes/input-group.js.map +1 -0
- package/dist/styles/theme.cjs +15 -0
- package/dist/styles/theme.cjs.map +1 -1
- package/dist/styles/theme.js +15 -0
- package/dist/styles/theme.js.map +1 -1
- package/dist/styles.css +382 -5
- package/dist/theme/index.d.cts +2 -0
- package/dist/theme/index.d.ts +2 -0
- package/dist/theme/theme-provider.cjs +86 -0
- package/dist/theme/theme-provider.cjs.map +1 -0
- package/dist/theme/theme-provider.d.cts +66 -0
- package/dist/theme/theme-provider.d.ts +66 -0
- package/dist/theme/theme-provider.js +85 -0
- package/dist/theme/theme-provider.js.map +1 -0
- package/package.json +1 -1
package/dist/styles.css
CHANGED
|
@@ -475,6 +475,9 @@
|
|
|
475
475
|
--jaci-easings-out: cubic-bezier(0, 0, 0.2, 1);
|
|
476
476
|
--jaci-easings-in-out: cubic-bezier(0.4, 0, 0.2, 1);
|
|
477
477
|
--jaci-easings-standard: cubic-bezier(0.2, 0, 0, 1);
|
|
478
|
+
--jaci-transitions-colors: background-color, border-color, box-shadow, color;
|
|
479
|
+
--jaci-transitions-transform: transform;
|
|
480
|
+
--jaci-transitions-standard: background-color, border-color, box-shadow, color, transform;
|
|
478
481
|
--jaci-animations-ping: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;
|
|
479
482
|
--jaci-animations-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
480
483
|
--jaci-animations-bounce: bounce 1s infinite;
|
|
@@ -500,6 +503,10 @@
|
|
|
500
503
|
--jaci-colors-success: var(--jaci-colors-green-700);
|
|
501
504
|
--jaci-colors-warning: var(--jaci-colors-amber-700);
|
|
502
505
|
--jaci-colors-danger: var(--jaci-colors-red-600);
|
|
506
|
+
--jaci-colors-info: var(--jaci-colors-blue-600);
|
|
507
|
+
--jaci-colors-focus: var(--jaci-colors-blue-600);
|
|
508
|
+
--jaci-colors-disabled: var(--jaci-colors-neutral-400);
|
|
509
|
+
--jaci-colors-selected: var(--jaci-colors-blue-50);
|
|
503
510
|
--jaci-colors-link-default: var(--jaci-colors-neutral-600);
|
|
504
511
|
--jaci-colors-link-hover: var(--jaci-colors-neutral-900);
|
|
505
512
|
}
|
|
@@ -515,6 +522,8 @@
|
|
|
515
522
|
--jaci-colors-border-default: var(--jaci-colors-neutral-700);
|
|
516
523
|
--jaci-colors-border-strong: var(--jaci-colors-neutral-500);
|
|
517
524
|
--jaci-colors-border-interactive: var(--jaci-colors-neutral-200);
|
|
525
|
+
--jaci-colors-disabled: var(--jaci-colors-neutral-600);
|
|
526
|
+
--jaci-colors-selected: var(--jaci-colors-blue-950);
|
|
518
527
|
--jaci-colors-link-default: var(--jaci-colors-neutral-400);
|
|
519
528
|
--jaci-colors-link-hover: var(--jaci-colors-neutral-200)
|
|
520
529
|
}
|
|
@@ -732,11 +741,44 @@
|
|
|
732
741
|
|
|
733
742
|
.jaci-form {
|
|
734
743
|
gap: var(--jaci-spacing-6);
|
|
744
|
+
display: flex;
|
|
735
745
|
flex-direction: column;
|
|
736
746
|
width: 100%;
|
|
737
747
|
}
|
|
738
748
|
|
|
739
|
-
.jaci-
|
|
749
|
+
.jaci-iconButton {
|
|
750
|
+
border-color: var(--jaci-colors-border-interactive);
|
|
751
|
+
border-radius: var(--jaci-radii-lg);
|
|
752
|
+
border-style: solid;
|
|
753
|
+
border-width: 1px;
|
|
754
|
+
overflow: hidden;
|
|
755
|
+
align-items: center;
|
|
756
|
+
box-sizing: border-box;
|
|
757
|
+
cursor: pointer;
|
|
758
|
+
display: inline-flex;
|
|
759
|
+
flex-shrink: 0;
|
|
760
|
+
justify-content: center;
|
|
761
|
+
--transition-duration: var(--jaci-durations-fast);
|
|
762
|
+
transition-duration: var(--jaci-durations-fast);
|
|
763
|
+
--transition-prop: background-color, border-color, box-shadow, color, transform;
|
|
764
|
+
transition-property: background-color, border-color, box-shadow, color, transform;
|
|
765
|
+
--transition-easing: var(--jaci-easings-standard);
|
|
766
|
+
transition-timing-function: var(--jaci-easings-standard);
|
|
767
|
+
max-width: 100%;
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
.jaci-iconButton:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
771
|
+
cursor: not-allowed;
|
|
772
|
+
opacity: 0.5;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
.jaci-iconButton:is(:focus-visible, [data-focus-visible]) {
|
|
776
|
+
outline: 2px solid;
|
|
777
|
+
outline-color: var(--jaci-colors-focus);
|
|
778
|
+
outline-offset: 2px;
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
.jaci-stack {
|
|
740
782
|
display: flex;
|
|
741
783
|
}
|
|
742
784
|
|
|
@@ -1039,6 +1081,65 @@
|
|
|
1039
1081
|
color: var(--jaci-colors-fg-on-accent);
|
|
1040
1082
|
}
|
|
1041
1083
|
|
|
1084
|
+
.jaci-iconButton--variant_outline {
|
|
1085
|
+
background-color: var(--jaci-colors-transparent);
|
|
1086
|
+
color: var(--jaci-colors-fg-default);
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
.jaci-iconButton--variant_outline:is(:hover, [data-hover]) {
|
|
1090
|
+
border-color: var(--jaci-colors-border-strong);
|
|
1091
|
+
background-color: var(--jaci-colors-surface-subtle);
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
.jaci-iconButton--size_md {
|
|
1095
|
+
font-size: var(--jaci-font-sizes-md);
|
|
1096
|
+
height: var(--jaci-sizes-10);
|
|
1097
|
+
width: var(--jaci-sizes-10);
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
.jaci-iconButton--variant_solid {
|
|
1101
|
+
border-color: var(--jaci-colors-accent-default);
|
|
1102
|
+
background-color: var(--jaci-colors-accent-default);
|
|
1103
|
+
color: var(--jaci-colors-fg-on-accent);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
.jaci-iconButton--variant_solid:is(:hover, [data-hover]) {
|
|
1107
|
+
border-color: var(--jaci-colors-accent-hover);
|
|
1108
|
+
background-color: var(--jaci-colors-accent-hover);
|
|
1109
|
+
}
|
|
1110
|
+
|
|
1111
|
+
.jaci-iconButton--variant_ghost {
|
|
1112
|
+
border-color: var(--jaci-colors-transparent);
|
|
1113
|
+
background-color: var(--jaci-colors-transparent);
|
|
1114
|
+
color: var(--jaci-colors-fg-default);
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
.jaci-iconButton--variant_ghost:is(:hover, [data-hover]) {
|
|
1118
|
+
background-color: var(--jaci-colors-surface-subtle);
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
.jaci-iconButton--variant_danger {
|
|
1122
|
+
border-color: var(--jaci-colors-danger);
|
|
1123
|
+
background-color: var(--jaci-colors-danger);
|
|
1124
|
+
color: var(--jaci-colors-fg-on-accent);
|
|
1125
|
+
}
|
|
1126
|
+
|
|
1127
|
+
.jaci-iconButton--variant_danger:is(:hover, [data-hover]) {
|
|
1128
|
+
opacity: 0.9;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
.jaci-iconButton--size_sm {
|
|
1132
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
1133
|
+
height: var(--jaci-sizes-9);
|
|
1134
|
+
width: var(--jaci-sizes-9);
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
.jaci-iconButton--size_lg {
|
|
1138
|
+
font-size: var(--jaci-font-sizes-lg);
|
|
1139
|
+
height: var(--jaci-sizes-12);
|
|
1140
|
+
width: var(--jaci-sizes-12);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1042
1143
|
.jaci-stack--direction_vertical {
|
|
1043
1144
|
flex-direction: column;
|
|
1044
1145
|
}
|
|
@@ -1844,6 +1945,12 @@
|
|
|
1844
1945
|
user-select: none;
|
|
1845
1946
|
}
|
|
1846
1947
|
|
|
1948
|
+
.jaci-buttonGroup__root {
|
|
1949
|
+
align-items: center;
|
|
1950
|
+
display: inline-flex;
|
|
1951
|
+
max-width: 100%;
|
|
1952
|
+
}
|
|
1953
|
+
|
|
1847
1954
|
.jaci-card__root {
|
|
1848
1955
|
border-color: var(--jaci-colors-border-default);
|
|
1849
1956
|
border-radius: var(--jaci-radii-2xl);
|
|
@@ -2175,7 +2282,10 @@
|
|
|
2175
2282
|
border-style: solid;
|
|
2176
2283
|
border-width: 1px;
|
|
2177
2284
|
gap: var(--jaci-spacing-3);
|
|
2178
|
-
|
|
2285
|
+
--backdrop-blur: blur(var(--jaci-blurs-md));
|
|
2286
|
+
backdrop-filter: var(--backdrop-blur, ) var(--backdrop-brightness, ) var(--backdrop-contrast, ) var(--backdrop-grayscale, ) var(--backdrop-hue-rotate, ) var(--backdrop-invert, ) var(--backdrop-opacity, ) var(--backdrop-saturate, ) var(--backdrop-sepia, );
|
|
2287
|
+
-webkit-backdrop-filter: var(--backdrop-blur, ) var(--backdrop-brightness, ) var(--backdrop-contrast, ) var(--backdrop-grayscale, ) var(--backdrop-hue-rotate, ) var(--backdrop-invert, ) var(--backdrop-opacity, ) var(--backdrop-saturate, ) var(--backdrop-sepia, );
|
|
2288
|
+
background-color: var(--jaci-colors-surface-overlay);
|
|
2179
2289
|
box-shadow: var(--jaci-shadows-lg);
|
|
2180
2290
|
box-sizing: border-box;
|
|
2181
2291
|
display: flex;
|
|
@@ -2202,6 +2312,22 @@
|
|
|
2202
2312
|
outline-offset: 2px;
|
|
2203
2313
|
}
|
|
2204
2314
|
|
|
2315
|
+
.jaci-color-picker__paletteIndicator {
|
|
2316
|
+
border-color: var(--jaci-colors-white);
|
|
2317
|
+
border-radius: var(--jaci-radii-full);
|
|
2318
|
+
border-style: solid;
|
|
2319
|
+
border-width: 2px;
|
|
2320
|
+
background-color: var(--jaci-colors-transparent);
|
|
2321
|
+
box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.65);
|
|
2322
|
+
pointer-events: none;
|
|
2323
|
+
position: absolute;
|
|
2324
|
+
transform: translate(-50%, -50%);
|
|
2325
|
+
height: var(--jaci-sizes-5);
|
|
2326
|
+
left: var(--jaci-color-palette-saturation);
|
|
2327
|
+
top: var(--jaci-color-palette-lightness);
|
|
2328
|
+
width: var(--jaci-sizes-5);
|
|
2329
|
+
}
|
|
2330
|
+
|
|
2205
2331
|
.jaci-color-picker__hue,.jaci-color-picker__alpha {
|
|
2206
2332
|
accent-color: var(--jaci-colors-accent-default);
|
|
2207
2333
|
box-sizing: border-box;
|
|
@@ -3274,6 +3400,46 @@
|
|
|
3274
3400
|
color: var(--jaci-colors-fg-default);
|
|
3275
3401
|
}
|
|
3276
3402
|
|
|
3403
|
+
.jaci-date-picker__close {
|
|
3404
|
+
border-color: var(--jaci-colors-accent-default);
|
|
3405
|
+
border-radius: var(--jaci-radii-md);
|
|
3406
|
+
border-style: solid;
|
|
3407
|
+
border-width: 1px;
|
|
3408
|
+
padding-inline: var(--jaci-spacing-3);
|
|
3409
|
+
padding-block: var(--jaci-spacing-2);
|
|
3410
|
+
align-items: center;
|
|
3411
|
+
align-self: flex-end;
|
|
3412
|
+
background-color: var(--jaci-colors-accent-default);
|
|
3413
|
+
color: var(--jaci-colors-fg-on-accent);
|
|
3414
|
+
cursor: pointer;
|
|
3415
|
+
display: inline-flex;
|
|
3416
|
+
font-family: system-ui, sans-serif;
|
|
3417
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
3418
|
+
font-weight: 600;
|
|
3419
|
+
justify-content: center;
|
|
3420
|
+
white-space: nowrap;
|
|
3421
|
+
margin-top: var(--jaci-spacing-2);
|
|
3422
|
+
min-height: var(--jaci-sizes-9);
|
|
3423
|
+
min-width: 5rem;
|
|
3424
|
+
max-width: 100%;
|
|
3425
|
+
}
|
|
3426
|
+
|
|
3427
|
+
.jaci-date-picker__close:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
3428
|
+
cursor: not-allowed;
|
|
3429
|
+
opacity: 0.5;
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3432
|
+
.jaci-date-picker__close:is(:focus-visible, [data-focus-visible]) {
|
|
3433
|
+
outline: 2px solid;
|
|
3434
|
+
outline-color: var(--jaci-colors-accent-default);
|
|
3435
|
+
outline-offset: 2px;
|
|
3436
|
+
}
|
|
3437
|
+
|
|
3438
|
+
.jaci-date-picker__close:is(:hover, [data-hover]) {
|
|
3439
|
+
border-color: var(--jaci-colors-accent-hover);
|
|
3440
|
+
background-color: var(--jaci-colors-accent-hover);
|
|
3441
|
+
}
|
|
3442
|
+
|
|
3277
3443
|
.jaci-date-picker__positioner {
|
|
3278
3444
|
outline: var(--jaci-borders-none);
|
|
3279
3445
|
z-index: 50;
|
|
@@ -3285,7 +3451,10 @@
|
|
|
3285
3451
|
border-radius: var(--jaci-radii-xl);
|
|
3286
3452
|
border-style: solid;
|
|
3287
3453
|
border-width: 1px;
|
|
3288
|
-
|
|
3454
|
+
--backdrop-blur: blur(var(--jaci-blurs-md));
|
|
3455
|
+
backdrop-filter: var(--backdrop-blur, ) var(--backdrop-brightness, ) var(--backdrop-contrast, ) var(--backdrop-grayscale, ) var(--backdrop-hue-rotate, ) var(--backdrop-invert, ) var(--backdrop-opacity, ) var(--backdrop-saturate, ) var(--backdrop-sepia, );
|
|
3456
|
+
-webkit-backdrop-filter: var(--backdrop-blur, ) var(--backdrop-brightness, ) var(--backdrop-contrast, ) var(--backdrop-grayscale, ) var(--backdrop-hue-rotate, ) var(--backdrop-invert, ) var(--backdrop-opacity, ) var(--backdrop-saturate, ) var(--backdrop-sepia, );
|
|
3457
|
+
background-color: var(--jaci-colors-surface-overlay);
|
|
3289
3458
|
box-shadow: var(--jaci-shadows-xl);
|
|
3290
3459
|
color: var(--jaci-colors-fg-default);
|
|
3291
3460
|
--transition-duration: var(--jaci-durations-normal);
|
|
@@ -3312,13 +3481,89 @@
|
|
|
3312
3481
|
|
|
3313
3482
|
.jaci-date-picker__caption {
|
|
3314
3483
|
flex: 1 1 0%;
|
|
3315
|
-
font-family: system-ui, sans-serif;
|
|
3316
|
-
font-size: var(--jaci-font-sizes-sm);
|
|
3317
3484
|
font-weight: 700;
|
|
3318
3485
|
text-align: center;
|
|
3319
3486
|
text-transform: capitalize;
|
|
3320
3487
|
}
|
|
3321
3488
|
|
|
3489
|
+
.jaci-date-picker__caption,.jaci-date-picker__monthSelect {
|
|
3490
|
+
font-family: system-ui, sans-serif;
|
|
3491
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
.jaci-date-picker__monthSelect {
|
|
3495
|
+
border-color: var(--jaci-colors-border-default);
|
|
3496
|
+
border-radius: var(--jaci-radii-md);
|
|
3497
|
+
border-style: solid;
|
|
3498
|
+
border-width: 1px;
|
|
3499
|
+
outline: var(--jaci-borders-none);
|
|
3500
|
+
padding-inline: var(--jaci-spacing-2);
|
|
3501
|
+
padding-block: var(--jaci-spacing-1);
|
|
3502
|
+
background-color: var(--jaci-colors-surface-default);
|
|
3503
|
+
color: var(--jaci-colors-fg-default);
|
|
3504
|
+
font-weight: 600;
|
|
3505
|
+
max-width: 10rem;
|
|
3506
|
+
min-width: var(--jaci-sizes-0);
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
.jaci-date-picker__monthSelect:is(:focus-visible, [data-focus-visible]) {
|
|
3510
|
+
border-color: var(--jaci-colors-accent-default);
|
|
3511
|
+
outline: 2px solid;
|
|
3512
|
+
outline-color: var(--jaci-colors-accent-default);
|
|
3513
|
+
outline-offset: 1px;
|
|
3514
|
+
}
|
|
3515
|
+
|
|
3516
|
+
.jaci-date-picker__yearSelect {
|
|
3517
|
+
border-color: var(--jaci-colors-border-default);
|
|
3518
|
+
border-radius: var(--jaci-radii-md);
|
|
3519
|
+
border-style: solid;
|
|
3520
|
+
border-width: 1px;
|
|
3521
|
+
outline: var(--jaci-borders-none);
|
|
3522
|
+
padding-inline: var(--jaci-spacing-2);
|
|
3523
|
+
padding-block: var(--jaci-spacing-1);
|
|
3524
|
+
background-color: var(--jaci-colors-surface-default);
|
|
3525
|
+
color: var(--jaci-colors-fg-default);
|
|
3526
|
+
font-family: system-ui, sans-serif;
|
|
3527
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
3528
|
+
font-weight: 600;
|
|
3529
|
+
max-width: 7rem;
|
|
3530
|
+
min-width: var(--jaci-sizes-0);
|
|
3531
|
+
}
|
|
3532
|
+
|
|
3533
|
+
.jaci-date-picker__yearSelect:is(:focus-visible, [data-focus-visible]) {
|
|
3534
|
+
border-color: var(--jaci-colors-accent-default);
|
|
3535
|
+
outline: 2px solid;
|
|
3536
|
+
outline-color: var(--jaci-colors-accent-default);
|
|
3537
|
+
outline-offset: 1px;
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3540
|
+
.jaci-date-picker__timeField {
|
|
3541
|
+
border-color: var(--jaci-colors-border-default);
|
|
3542
|
+
border-radius: var(--jaci-radii-md);
|
|
3543
|
+
border-style: solid;
|
|
3544
|
+
border-width: 1px;
|
|
3545
|
+
outline: var(--jaci-borders-none);
|
|
3546
|
+
padding-inline: var(--jaci-spacing-3);
|
|
3547
|
+
background-color: var(--jaci-colors-surface-default);
|
|
3548
|
+
box-sizing: border-box;
|
|
3549
|
+
color: var(--jaci-colors-fg-default);
|
|
3550
|
+
font-family: system-ui, sans-serif;
|
|
3551
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
3552
|
+
min-height: var(--jaci-sizes-9);
|
|
3553
|
+
width: 100%;
|
|
3554
|
+
}
|
|
3555
|
+
|
|
3556
|
+
.jaci-date-picker__timeField:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
3557
|
+
cursor: not-allowed;
|
|
3558
|
+
opacity: 0.5;
|
|
3559
|
+
}
|
|
3560
|
+
|
|
3561
|
+
.jaci-date-picker__timeField:is(:focus, [data-focus]) {
|
|
3562
|
+
border-color: var(--jaci-colors-accent-default);
|
|
3563
|
+
outline: 2px solid;
|
|
3564
|
+
outline-color: var(--jaci-colors-accent-default);
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3322
3567
|
.jaci-date-picker__navigation {
|
|
3323
3568
|
border: 0;
|
|
3324
3569
|
border-radius: var(--jaci-radii-md);
|
|
@@ -3352,6 +3597,54 @@
|
|
|
3352
3597
|
width: 100%;
|
|
3353
3598
|
}
|
|
3354
3599
|
|
|
3600
|
+
.jaci-date-picker__monthGrid {
|
|
3601
|
+
gap: var(--jaci-spacing-2);
|
|
3602
|
+
display: grid;
|
|
3603
|
+
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
3604
|
+
}
|
|
3605
|
+
|
|
3606
|
+
.jaci-date-picker__month {
|
|
3607
|
+
border: 0;
|
|
3608
|
+
border-radius: var(--jaci-radii-lg);
|
|
3609
|
+
outline: var(--jaci-borders-none);
|
|
3610
|
+
padding-inline: var(--jaci-spacing-2);
|
|
3611
|
+
align-items: center;
|
|
3612
|
+
background-color: var(--jaci-colors-transparent);
|
|
3613
|
+
color: var(--jaci-colors-fg-default);
|
|
3614
|
+
cursor: pointer;
|
|
3615
|
+
display: inline-flex;
|
|
3616
|
+
font-family: system-ui, sans-serif;
|
|
3617
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
3618
|
+
justify-content: center;
|
|
3619
|
+
text-transform: capitalize;
|
|
3620
|
+
min-height: var(--jaci-sizes-10);
|
|
3621
|
+
}
|
|
3622
|
+
|
|
3623
|
+
.jaci-date-picker__month:is(:disabled, [disabled], [data-disabled], [aria-disabled=true]) {
|
|
3624
|
+
cursor: not-allowed;
|
|
3625
|
+
opacity: 0.4;
|
|
3626
|
+
}
|
|
3627
|
+
|
|
3628
|
+
.jaci-date-picker__month[data-selected] {
|
|
3629
|
+
background-color: var(--jaci-colors-accent-default);
|
|
3630
|
+
color: var(--jaci-colors-fg-on-accent);
|
|
3631
|
+
font-weight: 700;
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
.jaci-date-picker__month[data-selected]:is(:hover, [data-hover]) {
|
|
3635
|
+
background-color: var(--jaci-colors-accent-hover);
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3638
|
+
.jaci-date-picker__month:is(:focus-visible, [data-focus-visible]) {
|
|
3639
|
+
outline: 2px solid;
|
|
3640
|
+
outline-color: var(--jaci-colors-accent-default);
|
|
3641
|
+
outline-offset: -2px;
|
|
3642
|
+
}
|
|
3643
|
+
|
|
3644
|
+
.jaci-date-picker__month:is(:hover, [data-hover]) {
|
|
3645
|
+
background-color: var(--jaci-colors-surface-subtle);
|
|
3646
|
+
}
|
|
3647
|
+
|
|
3355
3648
|
.jaci-date-picker__weekdays {
|
|
3356
3649
|
display: grid;
|
|
3357
3650
|
grid-template-columns: repeat(7, minmax(0, 1fr));
|
|
@@ -3698,6 +3991,50 @@
|
|
|
3698
3991
|
transform: translateY(0);
|
|
3699
3992
|
}
|
|
3700
3993
|
|
|
3994
|
+
.jaci-emptyState__root {
|
|
3995
|
+
padding: var(--jaci-spacing-8);
|
|
3996
|
+
border-color: var(--jaci-colors-border-default);
|
|
3997
|
+
border-radius: var(--jaci-radii-2xl);
|
|
3998
|
+
border-style: dashed;
|
|
3999
|
+
border-width: 1px;
|
|
4000
|
+
gap: var(--jaci-spacing-3);
|
|
4001
|
+
align-items: center;
|
|
4002
|
+
background-color: var(--jaci-colors-surface-default);
|
|
4003
|
+
box-sizing: border-box;
|
|
4004
|
+
color: var(--jaci-colors-fg-default);
|
|
4005
|
+
display: flex;
|
|
4006
|
+
flex-direction: column;
|
|
4007
|
+
justify-content: center;
|
|
4008
|
+
text-align: center;
|
|
4009
|
+
max-width: 100%;
|
|
4010
|
+
min-height: var(--jaci-sizes-32);
|
|
4011
|
+
}
|
|
4012
|
+
|
|
4013
|
+
.jaci-emptyState__icon {
|
|
4014
|
+
color: var(--jaci-colors-fg-muted);
|
|
4015
|
+
font-size: var(--jaci-font-sizes-2xl);
|
|
4016
|
+
line-height: 1;
|
|
4017
|
+
}
|
|
4018
|
+
|
|
4019
|
+
.jaci-emptyState__title {
|
|
4020
|
+
font-size: var(--jaci-font-sizes-lg);
|
|
4021
|
+
font-weight: 700;
|
|
4022
|
+
}
|
|
4023
|
+
|
|
4024
|
+
.jaci-emptyState__description {
|
|
4025
|
+
color: var(--jaci-colors-fg-muted);
|
|
4026
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
4027
|
+
max-width: var(--jaci-sizes-prose);
|
|
4028
|
+
}
|
|
4029
|
+
|
|
4030
|
+
.jaci-emptyState__action {
|
|
4031
|
+
gap: var(--jaci-spacing-2);
|
|
4032
|
+
display: flex;
|
|
4033
|
+
flex-wrap: wrap;
|
|
4034
|
+
justify-content: center;
|
|
4035
|
+
max-width: 100%;
|
|
4036
|
+
}
|
|
4037
|
+
|
|
3701
4038
|
.jaci-fieldset__root {
|
|
3702
4039
|
border: 0;
|
|
3703
4040
|
margin: var(--jaci-spacing-0);
|
|
@@ -3726,6 +4063,34 @@
|
|
|
3726
4063
|
line-height: 1.5;
|
|
3727
4064
|
}
|
|
3728
4065
|
|
|
4066
|
+
.jaci-inputGroup__root {
|
|
4067
|
+
align-items: stretch;
|
|
4068
|
+
display: flex;
|
|
4069
|
+
min-width: var(--jaci-sizes-0);
|
|
4070
|
+
width: 100%;
|
|
4071
|
+
}
|
|
4072
|
+
|
|
4073
|
+
.jaci-inputGroup__root > [data-slot=input] {
|
|
4074
|
+
flex: 1 1 0%;
|
|
4075
|
+
min-width: var(--jaci-sizes-0);
|
|
4076
|
+
}
|
|
4077
|
+
|
|
4078
|
+
.jaci-inputGroup__addon {
|
|
4079
|
+
border-color: var(--jaci-colors-border-default);
|
|
4080
|
+
border-style: solid;
|
|
4081
|
+
border-width: 2px;
|
|
4082
|
+
overflow: hidden;
|
|
4083
|
+
padding-inline: var(--jaci-spacing-3);
|
|
4084
|
+
align-items: center;
|
|
4085
|
+
background-color: var(--jaci-colors-surface-subtle);
|
|
4086
|
+
color: var(--jaci-colors-fg-muted);
|
|
4087
|
+
display: inline-flex;
|
|
4088
|
+
flex-shrink: 0;
|
|
4089
|
+
font-size: var(--jaci-font-sizes-sm);
|
|
4090
|
+
white-space: nowrap;
|
|
4091
|
+
max-width: 50%;
|
|
4092
|
+
}
|
|
4093
|
+
|
|
3729
4094
|
.jaci-list__root {
|
|
3730
4095
|
margin: var(--jaci-spacing-0);
|
|
3731
4096
|
padding: var(--jaci-spacing-0);
|
|
@@ -7077,6 +7442,18 @@
|
|
|
7077
7442
|
border-radius: var(--jaci-radii-xl);
|
|
7078
7443
|
}
|
|
7079
7444
|
|
|
7445
|
+
.jaci-buttonGroup__root--orientation_horizontal {
|
|
7446
|
+
gap: var(--jaci-spacing-2);
|
|
7447
|
+
flex-direction: row;
|
|
7448
|
+
flex-wrap: wrap;
|
|
7449
|
+
}
|
|
7450
|
+
|
|
7451
|
+
.jaci-buttonGroup__root--orientation_vertical {
|
|
7452
|
+
gap: var(--jaci-spacing-2);
|
|
7453
|
+
flex-direction: column;
|
|
7454
|
+
align-items: stretch;
|
|
7455
|
+
}
|
|
7456
|
+
|
|
7080
7457
|
.jaci-card__root--variant_elevated {
|
|
7081
7458
|
box-shadow: var(--jaci-shadows-md);
|
|
7082
7459
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { JaciThemeColorTokens, JaciThemeTokenGroup, JaciThemeTokenValue, JaciThemeTokens, ThemeContextValue, ThemeMode, ThemeProvider, ThemeProviderProps, useTheme } from "./theme-provider.cjs";
|
|
2
|
+
export { type JaciThemeColorTokens, type JaciThemeTokenGroup, type JaciThemeTokenValue, type JaciThemeTokens, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, useTheme };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { JaciThemeColorTokens, JaciThemeTokenGroup, JaciThemeTokenValue, JaciThemeTokens, ThemeContextValue, ThemeMode, ThemeProvider, ThemeProviderProps, useTheme } from "./theme-provider.js";
|
|
2
|
+
export { type JaciThemeColorTokens, type JaciThemeTokenGroup, type JaciThemeTokenValue, type JaciThemeTokens, type ThemeContextValue, type ThemeMode, ThemeProvider, type ThemeProviderProps, useTheme };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
let react = require("react");
|
|
3
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
|
+
//#region src/theme/theme-provider.tsx
|
|
5
|
+
const ThemeContext = (0, react.createContext)({
|
|
6
|
+
theme: "light",
|
|
7
|
+
resolvedTheme: "light",
|
|
8
|
+
setTheme: () => void 0
|
|
9
|
+
});
|
|
10
|
+
function kebabCase(value) {
|
|
11
|
+
return value.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase();
|
|
12
|
+
}
|
|
13
|
+
function flattenTokens(group, path, output) {
|
|
14
|
+
if (!group) return;
|
|
15
|
+
for (const [key, value] of Object.entries(group)) {
|
|
16
|
+
if (value === void 0) continue;
|
|
17
|
+
const nextPath = [...path, kebabCase(key)];
|
|
18
|
+
if (typeof value === "object") flattenTokens(value, nextPath, output);
|
|
19
|
+
else output[`--jaci-${nextPath.join("-")}`] = String(value);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
function tokenStyles(tokens) {
|
|
23
|
+
if (!tokens) return {};
|
|
24
|
+
const variables = {};
|
|
25
|
+
for (const [group, values] of Object.entries(tokens)) flattenTokens(values, [kebabCase(group)], variables);
|
|
26
|
+
return variables;
|
|
27
|
+
}
|
|
28
|
+
function initialSystemTheme(ssrTheme) {
|
|
29
|
+
return ssrTheme ?? "light";
|
|
30
|
+
}
|
|
31
|
+
const ThemeProvider = (0, react.forwardRef)(function ThemeProvider({ as = "div", children, defaultTheme = "light", onThemeChange, ssrTheme, style, theme, tokens, ...props }, ref) {
|
|
32
|
+
const [uncontrolledTheme, setUncontrolledTheme] = (0, react.useState)(defaultTheme);
|
|
33
|
+
const [systemTheme, setSystemTheme] = (0, react.useState)(() => initialSystemTheme(ssrTheme));
|
|
34
|
+
const currentTheme = theme ?? uncontrolledTheme;
|
|
35
|
+
(0, react.useEffect)(() => {
|
|
36
|
+
if (currentTheme !== "system") return;
|
|
37
|
+
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
38
|
+
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
|
39
|
+
const update = () => setSystemTheme(media.matches ? "dark" : "light");
|
|
40
|
+
update();
|
|
41
|
+
if (typeof media.addEventListener === "function") media.addEventListener("change", update);
|
|
42
|
+
else media.addListener?.(update);
|
|
43
|
+
return () => {
|
|
44
|
+
if (typeof media.removeEventListener === "function") media.removeEventListener("change", update);
|
|
45
|
+
else media.removeListener?.(update);
|
|
46
|
+
};
|
|
47
|
+
}, [currentTheme]);
|
|
48
|
+
const resolvedTheme = currentTheme === "system" ? systemTheme : currentTheme;
|
|
49
|
+
const setTheme = (0, react.useCallback)((nextTheme) => {
|
|
50
|
+
if (theme === void 0) setUncontrolledTheme(nextTheme);
|
|
51
|
+
onThemeChange?.(nextTheme);
|
|
52
|
+
}, [onThemeChange, theme]);
|
|
53
|
+
const contextValue = (0, react.useMemo)(() => ({
|
|
54
|
+
theme: currentTheme,
|
|
55
|
+
resolvedTheme,
|
|
56
|
+
setTheme
|
|
57
|
+
}), [
|
|
58
|
+
currentTheme,
|
|
59
|
+
resolvedTheme,
|
|
60
|
+
setTheme
|
|
61
|
+
]);
|
|
62
|
+
const mergedStyle = (0, react.useMemo)(() => ({
|
|
63
|
+
...style,
|
|
64
|
+
...tokenStyles(tokens)
|
|
65
|
+
}), [style, tokens]);
|
|
66
|
+
const Root = as;
|
|
67
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeContext.Provider, {
|
|
68
|
+
value: contextValue,
|
|
69
|
+
children: (0, react.createElement)(Root, {
|
|
70
|
+
...props,
|
|
71
|
+
"data-jaci-theme": resolvedTheme,
|
|
72
|
+
"data-jaci-component": "theme-provider",
|
|
73
|
+
"data-slot": "theme-provider",
|
|
74
|
+
ref,
|
|
75
|
+
style: mergedStyle
|
|
76
|
+
}, children)
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
function useTheme() {
|
|
80
|
+
return (0, react.useContext)(ThemeContext);
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
exports.ThemeProvider = ThemeProvider;
|
|
84
|
+
exports.useTheme = useTheme;
|
|
85
|
+
|
|
86
|
+
//# sourceMappingURL=theme-provider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme-provider.cjs","names":[],"sources":["../../src/theme/theme-provider.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n createContext,\n createElement,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ComponentPropsWithoutRef, CSSProperties, ElementType, ReactNode, Ref } from \"react\";\n\nexport type ThemeMode = \"light\" | \"dark\" | \"system\";\n\n/** A leaf value accepted by the theme variable mapper. */\nexport type JaciThemeTokenValue = string | number;\n\n/**\n * Semantic theme values. The groups intentionally accept additional keys so\n * applications can extend the token vocabulary without waiting for a package\n * release. Known semantic groups are documented in the public README.\n */\nexport type JaciThemeTokenGroup = {\n readonly [key: string]: JaciThemeTokenValue | JaciThemeTokenGroup | undefined;\n};\n\nexport interface JaciThemeColorTokens extends JaciThemeTokenGroup {\n surface?: JaciThemeTokenGroup;\n fg?: JaciThemeTokenGroup;\n border?: JaciThemeTokenGroup;\n accent?: JaciThemeTokenGroup;\n success?: JaciThemeTokenValue;\n warning?: JaciThemeTokenValue;\n danger?: JaciThemeTokenValue;\n info?: JaciThemeTokenValue;\n link?: JaciThemeTokenGroup;\n focus?: JaciThemeTokenValue;\n disabled?: JaciThemeTokenValue;\n selected?: JaciThemeTokenValue;\n}\n\nexport interface JaciThemeTokens {\n colors?: JaciThemeColorTokens;\n radii?: JaciThemeTokenGroup;\n shadows?: JaciThemeTokenGroup;\n durations?: JaciThemeTokenGroup;\n easings?: JaciThemeTokenGroup;\n transitions?: JaciThemeTokenGroup;\n spacing?: JaciThemeTokenGroup;\n fontSizes?: JaciThemeTokenGroup;\n lineHeights?: JaciThemeTokenGroup;\n typography?: JaciThemeTokenGroup;\n textStyles?: JaciThemeTokenGroup;\n fonts?: JaciThemeTokenGroup;\n}\n\nexport interface ThemeProviderProps extends Omit<ComponentPropsWithoutRef<\"div\">, \"children\"> {\n /** The controlled color mode. */\n theme?: ThemeMode;\n /** The initial color mode for an uncontrolled provider. */\n defaultTheme?: ThemeMode;\n /** The deterministic mode used for `system` while rendering on the server. */\n ssrTheme?: \"light\" | \"dark\";\n /** Scoped semantic token overrides. */\n tokens?: JaciThemeTokens;\n /** Called when a controlled provider requests a mode change. */\n onThemeChange?: (theme: ThemeMode) => void;\n /** The element that owns the theme scope. */\n as?: ElementType;\n children?: ReactNode;\n}\n\nexport interface ThemeContextValue {\n theme: ThemeMode;\n resolvedTheme: \"light\" | \"dark\";\n setTheme: (theme: ThemeMode) => void;\n}\n\nconst defaultThemeContext: ThemeContextValue = {\n theme: \"light\",\n resolvedTheme: \"light\",\n setTheme: () => undefined,\n};\n\nconst ThemeContext = createContext<ThemeContextValue>(defaultThemeContext);\n\nfunction kebabCase(value: string) {\n return value\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .replace(/[\\s_]+/g, \"-\")\n .toLowerCase();\n}\n\nfunction flattenTokens(\n group: JaciThemeTokenGroup | undefined,\n path: string[],\n output: Record<string, string>,\n) {\n if (!group) return;\n\n for (const [key, value] of Object.entries(group)) {\n if (value === undefined) continue;\n const nextPath = [...path, kebabCase(key)];\n\n if (typeof value === \"object\") {\n flattenTokens(value, nextPath, output);\n } else {\n output[`--jaci-${nextPath.join(\"-\")}`] = String(value);\n }\n }\n}\n\nfunction tokenStyles(tokens: JaciThemeTokens | undefined): CSSProperties {\n if (!tokens) return {};\n\n const variables: Record<string, string> = {};\n for (const [group, values] of Object.entries(tokens)) {\n flattenTokens(values, [kebabCase(group)], variables);\n }\n\n return variables as CSSProperties;\n}\n\nfunction initialSystemTheme(ssrTheme: \"light\" | \"dark\" | undefined) {\n return ssrTheme ?? \"light\";\n}\n\nexport const ThemeProvider = forwardRef<HTMLElement, ThemeProviderProps>(function ThemeProvider(\n {\n as = \"div\",\n children,\n defaultTheme = \"light\",\n onThemeChange,\n ssrTheme,\n style,\n theme,\n tokens,\n ...props\n },\n ref,\n) {\n const [uncontrolledTheme, setUncontrolledTheme] = useState<ThemeMode>(defaultTheme);\n const [systemTheme, setSystemTheme] = useState<\"light\" | \"dark\">(() =>\n initialSystemTheme(ssrTheme),\n );\n const currentTheme = theme ?? uncontrolledTheme;\n\n useEffect(() => {\n if (currentTheme !== \"system\") return;\n\n if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return;\n\n const media = window.matchMedia(\"(prefers-color-scheme: dark)\");\n const update = () => setSystemTheme(media.matches ? \"dark\" : \"light\");\n update();\n if (typeof media.addEventListener === \"function\") media.addEventListener(\"change\", update);\n else media.addListener?.(update);\n\n return () => {\n if (typeof media.removeEventListener === \"function\")\n media.removeEventListener(\"change\", update);\n else media.removeListener?.(update);\n };\n }, [currentTheme]);\n\n const resolvedTheme = currentTheme === \"system\" ? systemTheme : currentTheme;\n const setTheme = useCallback(\n (nextTheme: ThemeMode) => {\n if (theme === undefined) setUncontrolledTheme(nextTheme);\n onThemeChange?.(nextTheme);\n },\n [onThemeChange, theme],\n );\n const contextValue = useMemo(\n () => ({ theme: currentTheme, resolvedTheme, setTheme }),\n [currentTheme, resolvedTheme, setTheme],\n );\n const mergedStyle = useMemo(() => ({ ...style, ...tokenStyles(tokens) }), [style, tokens]);\n const Root = as;\n\n return (\n <ThemeContext.Provider value={contextValue}>\n {createElement(\n Root,\n {\n ...props,\n \"data-jaci-theme\": resolvedTheme,\n \"data-jaci-component\": \"theme-provider\",\n \"data-slot\": \"theme-provider\",\n ref: ref as Ref<HTMLElement>,\n style: mergedStyle,\n },\n children,\n )}\n </ThemeContext.Provider>\n );\n});\n\nexport function useTheme() {\n return useContext(ThemeContext);\n}\n"],"mappings":";;;;AAsFA,MAAM,gBAAA,GAAA,MAAA,cAAA,CAAgD;CALpD,OAAO;CACP,eAAe;CACf,gBAAgB,KAAA;AAGsD,CAAC;AAEzE,SAAS,UAAU,OAAe;CAChC,OAAO,MACJ,QAAQ,sBAAsB,OAAO,CAAC,CACtC,QAAQ,WAAW,GAAG,CAAC,CACvB,YAAY;AACjB;AAEA,SAAS,cACP,OACA,MACA,QACA;CACA,IAAI,CAAC,OAAO;CAEZ,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;EAChD,IAAI,UAAU,KAAA,GAAW;EACzB,MAAM,WAAW,CAAC,GAAG,MAAM,UAAU,GAAG,CAAC;EAEzC,IAAI,OAAO,UAAU,UACnB,cAAc,OAAO,UAAU,MAAM;OAErC,OAAO,UAAU,SAAS,KAAK,GAAG,OAAO,OAAO,KAAK;CAEzD;AACF;AAEA,SAAS,YAAY,QAAoD;CACvE,IAAI,CAAC,QAAQ,OAAO,CAAC;CAErB,MAAM,YAAoC,CAAC;CAC3C,KAAK,MAAM,CAAC,OAAO,WAAW,OAAO,QAAQ,MAAM,GACjD,cAAc,QAAQ,CAAC,UAAU,KAAK,CAAC,GAAG,SAAS;CAGrD,OAAO;AACT;AAEA,SAAS,mBAAmB,UAAwC;CAClE,OAAO,YAAY;AACrB;AAEA,MAAa,iBAAA,GAAA,MAAA,WAAA,CAA4D,SAAS,cAChF,EACE,KAAK,OACL,UACA,eAAe,SACf,eACA,UACA,OACA,OACA,QACA,GAAG,SAEL,KACA;CACA,MAAM,CAAC,mBAAmB,yBAAA,GAAA,MAAA,SAAA,CAA4C,YAAY;CAClF,MAAM,CAAC,aAAa,mBAAA,GAAA,MAAA,SAAA,OAClB,mBAAmB,QAAQ,CAC7B;CACA,MAAM,eAAe,SAAS;CAE9B,CAAA,GAAA,MAAA,UAAA,OAAgB;EACd,IAAI,iBAAiB,UAAU;EAE/B,IAAI,OAAO,WAAW,eAAe,OAAO,OAAO,eAAe,YAAY;EAE9E,MAAM,QAAQ,OAAO,WAAW,8BAA8B;EAC9D,MAAM,eAAe,eAAe,MAAM,UAAU,SAAS,OAAO;EACpE,OAAO;EACP,IAAI,OAAO,MAAM,qBAAqB,YAAY,MAAM,iBAAiB,UAAU,MAAM;OACpF,MAAM,cAAc,MAAM;EAE/B,aAAa;GACX,IAAI,OAAO,MAAM,wBAAwB,YACvC,MAAM,oBAAoB,UAAU,MAAM;QACvC,MAAM,iBAAiB,MAAM;EACpC;CACF,GAAG,CAAC,YAAY,CAAC;CAEjB,MAAM,gBAAgB,iBAAiB,WAAW,cAAc;CAChE,MAAM,YAAA,GAAA,MAAA,YAAA,EACH,cAAyB;EACxB,IAAI,UAAU,KAAA,GAAW,qBAAqB,SAAS;EACvD,gBAAgB,SAAS;CAC3B,GACA,CAAC,eAAe,KAAK,CACvB;CACA,MAAM,gBAAA,GAAA,MAAA,QAAA,QACG;EAAE,OAAO;EAAc;EAAe;CAAS,IACtD;EAAC;EAAc;EAAe;CAAQ,CACxC;CACA,MAAM,eAAA,GAAA,MAAA,QAAA,QAA6B;EAAE,GAAG;EAAO,GAAG,YAAY,MAAM;CAAE,IAAI,CAAC,OAAO,MAAM,CAAC;CACzF,MAAM,OAAO;CAEb,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAa,UAAd;EAAuB,OAAO;qCAE1B,MACA;GACE,GAAG;GACH,mBAAmB;GACnB,uBAAuB;GACvB,aAAa;GACR;GACL,OAAO;EACT,GACA,QACF;CACqB,CAAA;AAE3B,CAAC;AAED,SAAgB,WAAW;CACzB,QAAA,GAAA,MAAA,WAAA,CAAkB,YAAY;AAChC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, ElementType, ReactNode } from "react";
|
|
2
|
+
//#region src/theme/theme-provider.d.ts
|
|
3
|
+
type ThemeMode = "light" | "dark" | "system";
|
|
4
|
+
/** A leaf value accepted by the theme variable mapper. */
|
|
5
|
+
type JaciThemeTokenValue = string | number;
|
|
6
|
+
/**
|
|
7
|
+
* Semantic theme values. The groups intentionally accept additional keys so
|
|
8
|
+
* applications can extend the token vocabulary without waiting for a package
|
|
9
|
+
* release. Known semantic groups are documented in the public README.
|
|
10
|
+
*/
|
|
11
|
+
type JaciThemeTokenGroup = {
|
|
12
|
+
readonly [key: string]: JaciThemeTokenValue | JaciThemeTokenGroup | undefined;
|
|
13
|
+
};
|
|
14
|
+
interface JaciThemeColorTokens extends JaciThemeTokenGroup {
|
|
15
|
+
surface?: JaciThemeTokenGroup;
|
|
16
|
+
fg?: JaciThemeTokenGroup;
|
|
17
|
+
border?: JaciThemeTokenGroup;
|
|
18
|
+
accent?: JaciThemeTokenGroup;
|
|
19
|
+
success?: JaciThemeTokenValue;
|
|
20
|
+
warning?: JaciThemeTokenValue;
|
|
21
|
+
danger?: JaciThemeTokenValue;
|
|
22
|
+
info?: JaciThemeTokenValue;
|
|
23
|
+
link?: JaciThemeTokenGroup;
|
|
24
|
+
focus?: JaciThemeTokenValue;
|
|
25
|
+
disabled?: JaciThemeTokenValue;
|
|
26
|
+
selected?: JaciThemeTokenValue;
|
|
27
|
+
}
|
|
28
|
+
interface JaciThemeTokens {
|
|
29
|
+
colors?: JaciThemeColorTokens;
|
|
30
|
+
radii?: JaciThemeTokenGroup;
|
|
31
|
+
shadows?: JaciThemeTokenGroup;
|
|
32
|
+
durations?: JaciThemeTokenGroup;
|
|
33
|
+
easings?: JaciThemeTokenGroup;
|
|
34
|
+
transitions?: JaciThemeTokenGroup;
|
|
35
|
+
spacing?: JaciThemeTokenGroup;
|
|
36
|
+
fontSizes?: JaciThemeTokenGroup;
|
|
37
|
+
lineHeights?: JaciThemeTokenGroup;
|
|
38
|
+
typography?: JaciThemeTokenGroup;
|
|
39
|
+
textStyles?: JaciThemeTokenGroup;
|
|
40
|
+
fonts?: JaciThemeTokenGroup;
|
|
41
|
+
}
|
|
42
|
+
interface ThemeProviderProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
43
|
+
/** The controlled color mode. */
|
|
44
|
+
theme?: ThemeMode;
|
|
45
|
+
/** The initial color mode for an uncontrolled provider. */
|
|
46
|
+
defaultTheme?: ThemeMode;
|
|
47
|
+
/** The deterministic mode used for `system` while rendering on the server. */
|
|
48
|
+
ssrTheme?: "light" | "dark";
|
|
49
|
+
/** Scoped semantic token overrides. */
|
|
50
|
+
tokens?: JaciThemeTokens;
|
|
51
|
+
/** Called when a controlled provider requests a mode change. */
|
|
52
|
+
onThemeChange?: (theme: ThemeMode) => void;
|
|
53
|
+
/** The element that owns the theme scope. */
|
|
54
|
+
as?: ElementType;
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
}
|
|
57
|
+
interface ThemeContextValue {
|
|
58
|
+
theme: ThemeMode;
|
|
59
|
+
resolvedTheme: "light" | "dark";
|
|
60
|
+
setTheme: (theme: ThemeMode) => void;
|
|
61
|
+
}
|
|
62
|
+
declare const ThemeProvider: import("react").ForwardRefExoticComponent<ThemeProviderProps & import("react").RefAttributes<HTMLElement>>;
|
|
63
|
+
declare function useTheme(): ThemeContextValue;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { JaciThemeColorTokens, JaciThemeTokenGroup, JaciThemeTokenValue, JaciThemeTokens, ThemeContextValue, ThemeMode, ThemeProvider, ThemeProviderProps, useTheme };
|
|
66
|
+
//# sourceMappingURL=theme-provider.d.cts.map
|