@ciridae/ui 1.3.0 → 1.4.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/README.md +2 -2
- package/dist/components/app-frame.js +4 -4
- package/dist/components/button.d.ts +0 -11
- package/dist/components/button.js +1 -26
- package/dist/components/color-theme.d.ts +3 -12
- package/dist/components/color-theme.js +2 -29
- package/dist/components/dropzone.d.ts +0 -4
- package/dist/components/dropzone.js +4 -9
- package/dist/components/feedback-sheet.d.ts +1 -16
- package/dist/components/feedback-sheet.js +7 -144
- package/dist/components/hotkeys.d.ts +1 -11
- package/dist/components/hotkeys.js +3 -44
- package/dist/components/keyboard-shortcuts.d.ts +0 -2
- package/dist/components/keyboard-shortcuts.js +2 -46
- package/dist/components/locale.d.ts +3 -42
- package/dist/components/locale.js +3 -48
- package/dist/components/log-list.d.ts +0 -2
- package/dist/components/log-list.js +0 -22
- package/dist/components/record.d.ts +0 -23
- package/dist/components/record.js +2 -80
- package/dist/components/sidebar.d.ts +0 -1
- package/dist/components/sidebar.js +0 -10
- package/dist/components/tabs.d.ts +0 -3
- package/dist/components/tabs.js +0 -4
- package/dist/feedback/contract.d.ts +1 -25
- package/dist/feedback/contract.js +2 -6
- package/dist/feedback/operator-controller.d.ts +3 -10
- package/dist/feedback/operator-controller.js +1 -28
- package/dist/preset.d.ts +0 -6
- package/dist/preset.js +0 -5
- package/dist/styled-system/styles.css +20 -82
- package/dist/theme/options.d.ts +1 -19
- package/dist/theme/options.js +0 -1
- package/dist/theme/tokens.d.ts +1 -8
- package/dist/theme/tokens.js +1 -17
- package/package.json +1 -49
- package/dist/components/profile-header.d.ts +0 -15
- package/dist/components/profile-header.js +0 -40
- package/dist/components/recent-items.d.ts +0 -28
- package/dist/components/recent-items.js +0 -63
- package/dist/components/theme-customizer.d.ts +0 -50
- package/dist/components/theme-customizer.js +0 -84
- package/dist/components/theme-toggle.d.ts +0 -3
- package/dist/components/theme-toggle.js +0 -65
- package/dist/feedback/comment-types.d.ts +0 -17
- package/dist/feedback/comment-types.js +0 -1
- package/dist/feedback/feedback-cache.d.ts +0 -6
- package/dist/feedback/feedback-cache.js +0 -58
- package/dist/feedback/feedback-center-model.d.ts +0 -8
- package/dist/feedback/feedback-center-model.js +0 -37
- package/dist/feedback/feedback-composer-types.d.ts +0 -11
- package/dist/feedback/feedback-composer-types.js +0 -1
- package/dist/feedback/feedback-controller.d.ts +0 -56
- package/dist/feedback/feedback-controller.js +0 -181
- package/dist/feedback/feedback-tracking-types.d.ts +0 -14
- package/dist/feedback/feedback-tracking-types.js +0 -1
- package/dist/feedback/submit-feedback-with-attachments.d.ts +0 -10
- package/dist/feedback/submit-feedback-with-attachments.js +0 -10
- package/dist/theme/index.d.ts +0 -3
- package/dist/theme/index.js +0 -7
|
@@ -41,36 +41,9 @@ function useFeedbackOperatorController(config, openFeedbackId, active = true) {
|
|
|
41
41
|
statusMutation,
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
/**
|
|
45
|
-
* The feedback sheet's `operator` tab, run against the API: pass it while the viewer answers
|
|
46
|
-
* feedback, with `active` while the sheet is open.
|
|
47
|
-
*/
|
|
48
|
-
function useFeedbackOperatorSheet(config, active) {
|
|
49
|
-
const [openFeedbackId, setOpenFeedbackId] = React.useState();
|
|
50
|
-
const { itemsQuery, itemQuery, messageMutation, statusMutation } = useFeedbackOperatorController(config, openFeedbackId, active);
|
|
51
|
-
return {
|
|
52
|
-
items: toLoadState(itemsQuery),
|
|
53
|
-
onOpenItem: setOpenFeedbackId,
|
|
54
|
-
item: openFeedbackId === undefined ? undefined : toLoadState(itemQuery),
|
|
55
|
-
onReply: async (feedbackId, body) => {
|
|
56
|
-
await messageMutation.mutateAsync({ feedbackId, body });
|
|
57
|
-
},
|
|
58
|
-
onStatusChange: async (feedbackId, status) => {
|
|
59
|
-
await statusMutation.mutateAsync({ feedbackId, status });
|
|
60
|
-
},
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
/** A query as the sheet reads it: loading until its first answer, then its data or failure. */
|
|
64
|
-
function toLoadState(query) {
|
|
65
|
-
if (query.isPending)
|
|
66
|
-
return { status: "loading" };
|
|
67
|
-
if (query.isError)
|
|
68
|
-
return { status: "error", error: query.error, retry: () => void query.refetch() };
|
|
69
|
-
return { status: "loaded", data: query.data };
|
|
70
|
-
}
|
|
71
44
|
function requireOpenFeedbackId(feedbackId) {
|
|
72
45
|
if (feedbackId === undefined)
|
|
73
46
|
throw new Error("Open feedback before loading it.");
|
|
74
47
|
return feedbackId;
|
|
75
48
|
}
|
|
76
|
-
export { useFeedbackOperatorController
|
|
49
|
+
export { useFeedbackOperatorController };
|
package/dist/preset.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { CiridaeTheme } from "./theme/options.js";
|
|
2
|
-
export type { Brand, CiridaeTheme, ColorTheme } from "./theme/options.js";
|
|
3
|
-
export { breakpointQuery, breakpoints, type Breakpoint } from "./theme/breakpoints.js";
|
|
4
|
-
export { deriveThemeTokens, type ThemeTokens } from "./theme/tokens.js";
|
|
5
2
|
export type CiridaePresetOptions = Partial<CiridaeTheme> & {
|
|
6
3
|
/**
|
|
7
4
|
* Element defaults for an app that owns the whole page: `html`, `body` and `#root` fill the
|
|
@@ -12,6 +9,3 @@ export type CiridaePresetOptions = Partial<CiridaeTheme> & {
|
|
|
12
9
|
};
|
|
13
10
|
/** The kit's tokens under a theme. Anything left out takes the default, which is today's look. */
|
|
14
11
|
export declare function createCiridaePreset({ appBase, ...theme }?: CiridaePresetOptions): import("@pandacss/dev").Preset;
|
|
15
|
-
export declare const ciridaePreset: import("@pandacss/dev").Preset;
|
|
16
|
-
/** `ciridaePreset` with `appBase`, for an app that owns the whole page. */
|
|
17
|
-
export declare const ciridaeAppPreset: import("@pandacss/dev").Preset;
|
package/dist/preset.js
CHANGED
|
@@ -3,8 +3,6 @@ import { breakpointQuery } from "./theme/breakpoints.js";
|
|
|
3
3
|
import { linearGradient } from "./theme/color.js";
|
|
4
4
|
import { noEdge, themedGradient } from "./theme/derive.js";
|
|
5
5
|
import { deriveThemeTokens } from "./theme/tokens.js";
|
|
6
|
-
export { breakpointQuery, breakpoints } from "./theme/breakpoints.js";
|
|
7
|
-
export { deriveThemeTokens } from "./theme/tokens.js";
|
|
8
6
|
const appBaseCss = {
|
|
9
7
|
"html, body, #root": {
|
|
10
8
|
margin: "0",
|
|
@@ -707,6 +705,3 @@ export function createCiridaePreset({ appBase = false, ...theme } = {}) {
|
|
|
707
705
|
},
|
|
708
706
|
});
|
|
709
707
|
}
|
|
710
|
-
export const ciridaePreset = createCiridaePreset();
|
|
711
|
-
/** `ciridaePreset` with `appBase`, for an app that owns the whole page. */
|
|
712
|
-
export const ciridaeAppPreset = createCiridaePreset({ appBase: true });
|
|
@@ -1206,10 +1206,6 @@
|
|
|
1206
1206
|
padding: var(--app-content-inset);
|
|
1207
1207
|
}
|
|
1208
1208
|
|
|
1209
|
-
.bg_border\.hairline {
|
|
1210
|
-
background: var(--colors-border\.hairline);
|
|
1211
|
-
}
|
|
1212
|
-
|
|
1213
1209
|
.bg_bg\.infoSubtle {
|
|
1214
1210
|
background: var(--colors-bg\.info-subtle);
|
|
1215
1211
|
}
|
|
@@ -1734,14 +1730,14 @@
|
|
|
1734
1730
|
border-color: var(--colors-border\.panel);
|
|
1735
1731
|
}
|
|
1736
1732
|
|
|
1737
|
-
.bd-t_1px_solid_token\(colors\.border\.panel\) {
|
|
1738
|
-
border-top: 1px solid var(--colors-border\.panel);
|
|
1739
|
-
}
|
|
1740
|
-
|
|
1741
1733
|
.flex_\[1_1_0\] {
|
|
1742
1734
|
flex: 1 1 0;
|
|
1743
1735
|
}
|
|
1744
1736
|
|
|
1737
|
+
.bd-t_1px_solid_token\(colors\.border\.panel\) {
|
|
1738
|
+
border-top: 1px solid var(--colors-border\.panel);
|
|
1739
|
+
}
|
|
1740
|
+
|
|
1745
1741
|
.bd-c_transparent {
|
|
1746
1742
|
border-color: var(--colors-transparent);
|
|
1747
1743
|
}
|
|
@@ -1834,10 +1830,6 @@
|
|
|
1834
1830
|
border-top: 2px dashed var(--colors-border\.divider);
|
|
1835
1831
|
}
|
|
1836
1832
|
|
|
1837
|
-
.bdr_\[calc\(token\(radii\.inset\)_\+_token\(spacing\.control\.trackInset\)\)\] {
|
|
1838
|
-
border-radius: calc(var(--radii-inset) + var(--spacing-control\.track-inset));
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1841
1833
|
.py_control\.compactInline {
|
|
1842
1834
|
padding-block: var(--spacing-control\.compact-inline);
|
|
1843
1835
|
}
|
|
@@ -2908,10 +2900,6 @@
|
|
|
2908
2900
|
grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
|
|
2909
2901
|
}
|
|
2910
2902
|
|
|
2911
|
-
.ls_\[normal\] {
|
|
2912
|
-
letter-spacing: normal;
|
|
2913
|
-
}
|
|
2914
|
-
|
|
2915
2903
|
.z_scrollbar {
|
|
2916
2904
|
z-index: var(--z-index-scrollbar);
|
|
2917
2905
|
}
|
|
@@ -3093,10 +3081,6 @@
|
|
|
3093
3081
|
grid-template-columns: minmax(0, 1fr) 360px;
|
|
3094
3082
|
}
|
|
3095
3083
|
|
|
3096
|
-
.grid-tc_max-content_minmax\(0\,_1fr\)_minmax\(0\,_auto\) {
|
|
3097
|
-
grid-template-columns: max-content minmax(0, 1fr) minmax(0, auto);
|
|
3098
|
-
}
|
|
3099
|
-
|
|
3100
3084
|
.c_\[\#2A2A2D\] {
|
|
3101
3085
|
color: #2A2A2D;
|
|
3102
3086
|
}
|
|
@@ -3109,6 +3093,10 @@
|
|
|
3109
3093
|
line-height: 1.4;
|
|
3110
3094
|
}
|
|
3111
3095
|
|
|
3096
|
+
.ls_\[normal\] {
|
|
3097
|
+
letter-spacing: normal;
|
|
3098
|
+
}
|
|
3099
|
+
|
|
3112
3100
|
.c_\[\#6B6B6E\] {
|
|
3113
3101
|
color: #6B6B6E;
|
|
3114
3102
|
}
|
|
@@ -4028,14 +4016,6 @@
|
|
|
4028
4016
|
width: var(--spacing-layout\.cluster-gap);
|
|
4029
4017
|
}
|
|
4030
4018
|
|
|
4031
|
-
.pb_panel\.default {
|
|
4032
|
-
padding-bottom: var(--spacing-panel\.default);
|
|
4033
|
-
}
|
|
4034
|
-
|
|
4035
|
-
.mb_layout\.controlGap {
|
|
4036
|
-
margin-bottom: var(--spacing-layout\.control-gap);
|
|
4037
|
-
}
|
|
4038
|
-
|
|
4039
4019
|
.min-h_\[calc\(token\(sizes\.control\.compact\)_\+_token\(spacing\.panel\.default\)_\*_2\)\] {
|
|
4040
4020
|
min-height: calc(var(--sizes-control\.compact) + var(--spacing-panel\.default) * 2);
|
|
4041
4021
|
}
|
|
@@ -4232,14 +4212,6 @@
|
|
|
4232
4212
|
height: var(--sizes-control\.resting-tab);
|
|
4233
4213
|
}
|
|
4234
4214
|
|
|
4235
|
-
.w_control\.small {
|
|
4236
|
-
width: var(--sizes-control\.small);
|
|
4237
|
-
}
|
|
4238
|
-
|
|
4239
|
-
.h_\[calc\(token\(sizes\.control\.small\)_-_2_\*_token\(spacing\.control\.trackInset\)\)\] {
|
|
4240
|
-
height: calc(var(--sizes-control\.small) - 2 * var(--spacing-control\.track-inset));
|
|
4241
|
-
}
|
|
4242
|
-
|
|
4243
4215
|
.lc_3 {
|
|
4244
4216
|
overflow: hidden;
|
|
4245
4217
|
display: -webkit-box;
|
|
@@ -4331,6 +4303,14 @@
|
|
|
4331
4303
|
width: 240px;
|
|
4332
4304
|
}
|
|
4333
4305
|
|
|
4306
|
+
.mb_layout\.controlGap {
|
|
4307
|
+
margin-bottom: var(--spacing-layout\.control-gap);
|
|
4308
|
+
}
|
|
4309
|
+
|
|
4310
|
+
.pb_panel\.default {
|
|
4311
|
+
padding-bottom: var(--spacing-panel\.default);
|
|
4312
|
+
}
|
|
4313
|
+
|
|
4334
4314
|
.w_\[612px\] {
|
|
4335
4315
|
width: 612px;
|
|
4336
4316
|
}
|
|
@@ -5091,10 +5071,6 @@
|
|
|
5091
5071
|
background: var(--colors-transparent);
|
|
5092
5072
|
}
|
|
5093
5073
|
|
|
5094
|
-
.\[\&\[aria-pressed\=true\]\]\:bg_\[token\(gradients\.raised\)\][aria-pressed=true] {
|
|
5095
|
-
background: var(--gradients-raised);
|
|
5096
|
-
}
|
|
5097
|
-
|
|
5098
5074
|
[data-ciridae-theme=light] .light\:bg_bg\.surface {
|
|
5099
5075
|
background: var(--colors-bg\.surface);
|
|
5100
5076
|
}
|
|
@@ -5695,10 +5671,6 @@
|
|
|
5695
5671
|
padding-inline: var(--spacing-layout\.tight-gap);
|
|
5696
5672
|
}
|
|
5697
5673
|
|
|
5698
|
-
.\[\&\[data-selected\]\]\:bd-c_accent\.green[data-selected] {
|
|
5699
|
-
border-color: var(--colors-accent\.green);
|
|
5700
|
-
}
|
|
5701
|
-
|
|
5702
5674
|
.\[\&\[data-layout\=compact\]\]\:gap_layout\.tightGap[data-layout=compact] {
|
|
5703
5675
|
gap: var(--spacing-layout\.tight-gap);
|
|
5704
5676
|
}
|
|
@@ -5855,10 +5827,6 @@
|
|
|
5855
5827
|
flex: 1 1 0%;
|
|
5856
5828
|
}
|
|
5857
5829
|
|
|
5858
|
-
:is(.\[\&_\+_\&\]\:bd-t_1px_solid_token\(colors\.border\.panel\)) + :is(.\[\&_\+_\&\]\:bd-t_1px_solid_token\(colors\.border\.panel\)) {
|
|
5859
|
-
border-top: 1px solid var(--colors-border\.panel);
|
|
5860
|
-
}
|
|
5861
|
-
|
|
5862
5830
|
.\[\&\[aria-checked\=true\]\]\:bd-c_fg\.primary[aria-checked=true] {
|
|
5863
5831
|
border-color: var(--colors-fg\.primary);
|
|
5864
5832
|
}
|
|
@@ -7561,10 +7529,6 @@
|
|
|
7561
7529
|
display: none;
|
|
7562
7530
|
}
|
|
7563
7531
|
|
|
7564
|
-
.\[\&\[data-selected\]\]\:bx-sh_soft[data-selected] {
|
|
7565
|
-
box-shadow: var(--shadows-soft);
|
|
7566
|
-
}
|
|
7567
|
-
|
|
7568
7532
|
.\[\&\[data-layout\=wide\]\]\:d_grid[data-layout=wide] {
|
|
7569
7533
|
display: grid;
|
|
7570
7534
|
}
|
|
@@ -9323,18 +9287,14 @@
|
|
|
9323
9287
|
flex: 1 1 0%;
|
|
9324
9288
|
}
|
|
9325
9289
|
|
|
9326
|
-
.\[\&\:is\(button\,_a\)\]\:hover\:bd-c_border\.glass:is(button, a):is(:hover, [data-hover]) {
|
|
9327
|
-
border-color: var(--colors-border\.glass);
|
|
9328
|
-
}
|
|
9329
|
-
|
|
9330
|
-
.\[\&\[data-selected\]\]\:hover\:bd-c_accent\.green[data-selected]:is(:hover, [data-hover]) {
|
|
9331
|
-
border-color: var(--colors-accent\.green);
|
|
9332
|
-
}
|
|
9333
|
-
|
|
9334
9290
|
.\[\&\[aria-current\=page\]\]\:\[\&\:not\(\[data-icon-only\]\)\]\:px_\[calc\(token\(spacing\.control\.compactInline\)_\+_token\(sizes\.border\.hairline\)\)\][aria-current=page]:not([data-icon-only]) {
|
|
9335
9291
|
padding-inline: calc(var(--spacing-control\.compact-inline) + var(--sizes-border\.hairline));
|
|
9336
9292
|
}
|
|
9337
9293
|
|
|
9294
|
+
.\[\&\:is\(button\,_a\)\]\:hover\:bd-c_border\.glass:is(button, a):is(:hover, [data-hover]) {
|
|
9295
|
+
border-color: var(--colors-border\.glass);
|
|
9296
|
+
}
|
|
9297
|
+
|
|
9338
9298
|
[data-variant=text] > .\[\[data-variant\=text\]_\>_\&\]\:focusVisible\:ring_0:is(:focus-visible, [data-focus-visible]) {
|
|
9339
9299
|
outline: 0;
|
|
9340
9300
|
}
|
|
@@ -9607,10 +9567,6 @@
|
|
|
9607
9567
|
display: none;
|
|
9608
9568
|
}
|
|
9609
9569
|
|
|
9610
|
-
.\[\&\[aria-pressed\=true\]\]\:before\:d_block[aria-pressed=true]::before {
|
|
9611
|
-
display: block;
|
|
9612
|
-
}
|
|
9613
|
-
|
|
9614
9570
|
.\[\&\[aria-checked\=true\]\]\:\[\&_\[data-radio\]_\>_span\]\:op_\[1\][aria-checked=true] [data-radio] > span {
|
|
9615
9571
|
opacity: 1;
|
|
9616
9572
|
}
|
|
@@ -10248,15 +10204,6 @@
|
|
|
10248
10204
|
.\[\@container_\(max-width\:_520px\)\]\:\[\&_\>_li_\>_\:not\(\[data-current\]\,_\[aria-pressed\=true\]\,_\[data-selected\]\)_\[data-stage-label\]\]\:d_none > li > :not([data-current], [aria-pressed=true], [data-selected]) [data-stage-label] {
|
|
10249
10205
|
display: none;
|
|
10250
10206
|
}
|
|
10251
|
-
}
|
|
10252
|
-
|
|
10253
|
-
@container (max-width: 480px) {
|
|
10254
|
-
.\[\@container_\(max-width\:_480px\)\]\:grid-tc_auto_minmax\(0\,_1fr\) {
|
|
10255
|
-
grid-template-columns: auto minmax(0, 1fr);
|
|
10256
|
-
}
|
|
10257
|
-
.\[\@container_\(max-width\:_480px\)\]\:\[\&_\>_\[data-actions\]\]\:grid-c_1_\/_-1 > [data-actions] {
|
|
10258
|
-
grid-column: 1 / -1;
|
|
10259
|
-
}
|
|
10260
10207
|
}
|
|
10261
10208
|
|
|
10262
10209
|
@container dashboard (max-width: 480px) {
|
|
@@ -10269,15 +10216,6 @@
|
|
|
10269
10216
|
.\[\@container_dashboard_\(max-width\:_480px\)\]\:\[\&_\>_\:nth-child\(n_\+_2\)\]\:bd-t_1px_solid_token\(colors\.border\.panel\) > :nth-child(n + 2) {
|
|
10270
10217
|
border-top: 1px solid var(--colors-border\.panel);
|
|
10271
10218
|
}
|
|
10272
|
-
}
|
|
10273
|
-
|
|
10274
|
-
@container (max-width: 420px) {
|
|
10275
|
-
.\[\@container_\(max-width\:_420px\)\]\:grid-tc_max-content_minmax\(0\,_1fr\) {
|
|
10276
|
-
grid-template-columns: max-content minmax(0, 1fr);
|
|
10277
|
-
}
|
|
10278
|
-
.\[\@container_\(max-width\:_420px\)\]\:\[\&_\[data-status\]\]\:grid-c_2 [data-status] {
|
|
10279
|
-
grid-column: 2;
|
|
10280
|
-
}
|
|
10281
10219
|
}
|
|
10282
10220
|
|
|
10283
10221
|
@container (max-width: 300px) {
|
package/dist/theme/options.d.ts
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
export type ColorTheme = "dark" | "light";
|
|
2
|
-
/**
|
|
3
|
-
* What a product calls itself (a short name for tight spots like a rail) and its public asset
|
|
4
|
-
* paths, served from the app, e.g. `/brand/favicon.svg`.
|
|
5
|
-
*/
|
|
6
|
-
export type Brand = {
|
|
7
|
-
name: string;
|
|
8
|
-
shortName?: string;
|
|
9
|
-
favicon?: string;
|
|
10
|
-
logo?: string;
|
|
11
|
-
mark?: string;
|
|
12
|
-
/** The social sharing card. */
|
|
13
|
-
card?: string;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* The few choices a product makes once. The fonts shape the tokens through `createCiridaePreset`;
|
|
17
|
-
* the last two are runtime settings `ThemeProvider` takes.
|
|
18
|
-
*/
|
|
2
|
+
/** The choice a product makes once: its fonts, which shape the tokens through `createCiridaePreset`. */
|
|
19
3
|
export type CiridaeTheme = {
|
|
20
4
|
fonts: {
|
|
21
5
|
display?: string;
|
|
22
6
|
sans?: string;
|
|
23
7
|
mono?: string;
|
|
24
8
|
};
|
|
25
|
-
defaultColorTheme: ColorTheme;
|
|
26
|
-
brand?: Brand;
|
|
27
9
|
};
|
|
28
10
|
export declare const defaultTheme: CiridaeTheme & {
|
|
29
11
|
fonts: Required<CiridaeTheme["fonts"]>;
|
package/dist/theme/options.js
CHANGED
package/dist/theme/tokens.d.ts
CHANGED
|
@@ -12,13 +12,6 @@ export type ThemeTokens = {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
|
-
* Every token value a theme decides. `createCiridaePreset` bakes these into the stylesheet
|
|
16
|
-
* `fontStylesheet` writes the same faces over it at runtime, so the two never drift.
|
|
15
|
+
* Every token value a theme decides. `createCiridaePreset` bakes these into the stylesheet.
|
|
17
16
|
*/
|
|
18
17
|
export declare function deriveThemeTokens(theme?: Partial<CiridaeTheme>): ThemeTokens;
|
|
19
|
-
/**
|
|
20
|
-
* The faces in `fonts` as a stylesheet of the variables Panda names them by. Unlayered, it wins
|
|
21
|
-
* over the built stylesheet's `@layer tokens` blocks, so the page shows the faces with no rebuild.
|
|
22
|
-
* A face left out keeps the built one.
|
|
23
|
-
*/
|
|
24
|
-
export declare function fontStylesheet(fonts: CiridaeTheme["fonts"]): string;
|
package/dist/theme/tokens.js
CHANGED
|
@@ -6,8 +6,7 @@ import { ciridaePalette } from "./palette.js";
|
|
|
6
6
|
const cardElevation = "0 1px 4px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.03)";
|
|
7
7
|
const softElevation = "0 1px 2px rgba(0,0,0,.04), 0 6px 20px -4px rgba(0,0,0,.05)";
|
|
8
8
|
/**
|
|
9
|
-
* Every token value a theme decides. `createCiridaePreset` bakes these into the stylesheet
|
|
10
|
-
* `fontStylesheet` writes the same faces over it at runtime, so the two never drift.
|
|
9
|
+
* Every token value a theme decides. `createCiridaePreset` bakes these into the stylesheet.
|
|
11
10
|
*/
|
|
12
11
|
export function deriveThemeTokens(theme = {}) {
|
|
13
12
|
const palette = derivePaletteTokens(ciridaePalette);
|
|
@@ -197,18 +196,3 @@ export function deriveThemeTokens(theme = {}) {
|
|
|
197
196
|
},
|
|
198
197
|
};
|
|
199
198
|
}
|
|
200
|
-
/**
|
|
201
|
-
* The faces in `fonts` as a stylesheet of the variables Panda names them by. Unlayered, it wins
|
|
202
|
-
* over the built stylesheet's `@layer tokens` blocks, so the page shows the faces with no rebuild.
|
|
203
|
-
* A face left out keeps the built one.
|
|
204
|
-
*/
|
|
205
|
-
export function fontStylesheet(fonts) {
|
|
206
|
-
const faces = deriveThemeTokens({ fonts }).fonts;
|
|
207
|
-
const declarations = [
|
|
208
|
-
// Display follows sans, so setting sans sets both.
|
|
209
|
-
...((fonts.display ?? fonts.sans) ? [`--fonts-display: ${faces.display};`] : []),
|
|
210
|
-
...(fonts.sans ? [`--fonts-sans: ${faces.sans};`] : []),
|
|
211
|
-
...(fonts.mono ? [`--fonts-mono: ${faces.mono};`] : []),
|
|
212
|
-
];
|
|
213
|
-
return `:root {\n${declarations.join("\n")}\n}`;
|
|
214
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ciridae/ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -58,10 +58,6 @@
|
|
|
58
58
|
"types": "./dist/components/icon.d.ts",
|
|
59
59
|
"default": "./dist/components/icon.js"
|
|
60
60
|
},
|
|
61
|
-
"./theme": {
|
|
62
|
-
"types": "./dist/theme/index.d.ts",
|
|
63
|
-
"default": "./dist/theme/index.js"
|
|
64
|
-
},
|
|
65
61
|
"./brand-icons": {
|
|
66
62
|
"types": "./dist/components/brand-icons.d.ts",
|
|
67
63
|
"default": "./dist/components/brand-icons.js"
|
|
@@ -86,10 +82,6 @@
|
|
|
86
82
|
"types": "./dist/components/feedback-sheet.d.ts",
|
|
87
83
|
"default": "./dist/components/feedback-sheet.js"
|
|
88
84
|
},
|
|
89
|
-
"./command-menu": {
|
|
90
|
-
"types": "./dist/components/command-menu.d.ts",
|
|
91
|
-
"default": "./dist/components/command-menu.js"
|
|
92
|
-
},
|
|
93
85
|
"./document-viewer": {
|
|
94
86
|
"types": "./dist/components/document-viewer.d.ts",
|
|
95
87
|
"default": "./dist/components/document-viewer.js"
|
|
@@ -110,10 +102,6 @@
|
|
|
110
102
|
"types": "./dist/components/hotkeys.d.ts",
|
|
111
103
|
"default": "./dist/components/hotkeys.js"
|
|
112
104
|
},
|
|
113
|
-
"./keyboard-shortcuts": {
|
|
114
|
-
"types": "./dist/components/keyboard-shortcuts.d.ts",
|
|
115
|
-
"default": "./dist/components/keyboard-shortcuts.js"
|
|
116
|
-
},
|
|
117
105
|
"./command-palette": {
|
|
118
106
|
"types": "./dist/components/command-palette.d.ts",
|
|
119
107
|
"default": "./dist/components/command-palette.js"
|
|
@@ -122,18 +110,6 @@
|
|
|
122
110
|
"types": "./dist/components/chat-sheet-controller.d.ts",
|
|
123
111
|
"default": "./dist/components/chat-sheet-controller.js"
|
|
124
112
|
},
|
|
125
|
-
"./recent-items": {
|
|
126
|
-
"types": "./dist/components/recent-items.d.ts",
|
|
127
|
-
"default": "./dist/components/recent-items.js"
|
|
128
|
-
},
|
|
129
|
-
"./theme-customizer": {
|
|
130
|
-
"types": "./dist/components/theme-customizer.d.ts",
|
|
131
|
-
"default": "./dist/components/theme-customizer.js"
|
|
132
|
-
},
|
|
133
|
-
"./theme-toggle": {
|
|
134
|
-
"types": "./dist/components/theme-toggle.d.ts",
|
|
135
|
-
"default": "./dist/components/theme-toggle.js"
|
|
136
|
-
},
|
|
137
113
|
"./segmented-bar": {
|
|
138
114
|
"types": "./dist/components/segmented-bar.d.ts",
|
|
139
115
|
"default": "./dist/components/segmented-bar.js"
|
|
@@ -142,10 +118,6 @@
|
|
|
142
118
|
"types": "./dist/components/meter.d.ts",
|
|
143
119
|
"default": "./dist/components/meter.js"
|
|
144
120
|
},
|
|
145
|
-
"./profile-header": {
|
|
146
|
-
"types": "./dist/components/profile-header.d.ts",
|
|
147
|
-
"default": "./dist/components/profile-header.js"
|
|
148
|
-
},
|
|
149
121
|
"./chat-sheet": {
|
|
150
122
|
"types": "./dist/components/chat-sheet.d.ts",
|
|
151
123
|
"default": "./dist/components/chat-sheet.js"
|
|
@@ -190,10 +162,6 @@
|
|
|
190
162
|
"types": "./dist/components/input.d.ts",
|
|
191
163
|
"default": "./dist/components/input.js"
|
|
192
164
|
},
|
|
193
|
-
"./keycap": {
|
|
194
|
-
"types": "./dist/components/keycap.d.ts",
|
|
195
|
-
"default": "./dist/components/keycap.js"
|
|
196
|
-
},
|
|
197
165
|
"./email-input": {
|
|
198
166
|
"types": "./dist/components/email-input.d.ts",
|
|
199
167
|
"default": "./dist/components/email-input.js"
|
|
@@ -218,10 +186,6 @@
|
|
|
218
186
|
"types": "./dist/components/environment-frame.d.ts",
|
|
219
187
|
"default": "./dist/components/environment-frame.js"
|
|
220
188
|
},
|
|
221
|
-
"./site-banner": {
|
|
222
|
-
"types": "./dist/components/site-banner.d.ts",
|
|
223
|
-
"default": "./dist/components/site-banner.js"
|
|
224
|
-
},
|
|
225
189
|
"./status-banner": {
|
|
226
190
|
"types": "./dist/components/status-banner.d.ts",
|
|
227
191
|
"default": "./dist/components/status-banner.js"
|
|
@@ -234,10 +198,6 @@
|
|
|
234
198
|
"types": "./dist/components/tabs.d.ts",
|
|
235
199
|
"default": "./dist/components/tabs.js"
|
|
236
200
|
},
|
|
237
|
-
"./stat-card": {
|
|
238
|
-
"types": "./dist/components/stat-card.d.ts",
|
|
239
|
-
"default": "./dist/components/stat-card.js"
|
|
240
|
-
},
|
|
241
201
|
"./project-avatar": {
|
|
242
202
|
"types": "./dist/components/project-avatar.d.ts",
|
|
243
203
|
"default": "./dist/components/project-avatar.js"
|
|
@@ -282,10 +242,6 @@
|
|
|
282
242
|
"types": "./dist/components/select.d.ts",
|
|
283
243
|
"default": "./dist/components/select.js"
|
|
284
244
|
},
|
|
285
|
-
"./checkbox-item": {
|
|
286
|
-
"types": "./dist/components/checkbox-item.d.ts",
|
|
287
|
-
"default": "./dist/components/checkbox-item.js"
|
|
288
|
-
},
|
|
289
245
|
"./radio-card": {
|
|
290
246
|
"types": "./dist/components/radio-card.d.ts",
|
|
291
247
|
"default": "./dist/components/radio-card.js"
|
|
@@ -342,10 +298,6 @@
|
|
|
342
298
|
"types": "./dist/components/toast.d.ts",
|
|
343
299
|
"default": "./dist/components/toast.js"
|
|
344
300
|
},
|
|
345
|
-
"./breadcrumb": {
|
|
346
|
-
"types": "./dist/components/page-frame.d.ts",
|
|
347
|
-
"default": "./dist/components/page-frame.js"
|
|
348
|
-
},
|
|
349
301
|
"./pagination": {
|
|
350
302
|
"types": "./dist/components/navigation.d.ts",
|
|
351
303
|
"default": "./dist/components/navigation.js"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from "react";
|
|
2
|
-
export type ProfileHeaderProps = Omit<ComponentProps<"header">, "children" | "title"> & {
|
|
3
|
-
name: string;
|
|
4
|
-
kind?: "user" | "agent";
|
|
5
|
-
/** The photo; initials stand in without one. */
|
|
6
|
-
src?: string;
|
|
7
|
-
/** Their role, such as "Site lead". */
|
|
8
|
-
title?: string;
|
|
9
|
-
team?: string;
|
|
10
|
-
email?: string;
|
|
11
|
-
/** What they do here, under the rest. */
|
|
12
|
-
description?: ReactNode;
|
|
13
|
-
actions?: ReactNode;
|
|
14
|
-
};
|
|
15
|
-
export declare function ProfileHeader({ name, kind, src, title, team, email, description, actions, className, ...props }: ProfileHeaderProps): import("react").JSX.Element;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/*
|
|
3
|
-
* The head of a person's or an agent's page: a large avatar, the name, their title and team,
|
|
4
|
-
* their email with a copy control, a line on what they do, and actions at the end. The actions
|
|
5
|
-
* drop under the name once the header is narrow.
|
|
6
|
-
*/
|
|
7
|
-
import { css, cx } from "#primitives/css";
|
|
8
|
-
import { CopyableText } from "./copyable-id.js";
|
|
9
|
-
import { Avatar } from "./data-display.js";
|
|
10
|
-
import { useCiridaeLocale } from "./locale.js";
|
|
11
|
-
const header = css({ containerType: "inline-size" });
|
|
12
|
-
const grid = css({
|
|
13
|
-
display: "grid",
|
|
14
|
-
gridTemplateColumns: "auto minmax(0, 1fr) auto",
|
|
15
|
-
alignItems: "start",
|
|
16
|
-
columnGap: "layout.contentGap",
|
|
17
|
-
rowGap: "layout.controlGap",
|
|
18
|
-
paddingInline: "layout.tightGap",
|
|
19
|
-
"@container (max-width: 480px)": {
|
|
20
|
-
gridTemplateColumns: "auto minmax(0, 1fr)",
|
|
21
|
-
"& > [data-actions]": { gridColumn: "1 / -1" },
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
const text = css({ display: "grid", gap: "layout.tightGap", minWidth: "0" });
|
|
25
|
-
const nameStyle = css({
|
|
26
|
-
margin: "none",
|
|
27
|
-
fontSize: "heading.page",
|
|
28
|
-
fontWeight: "medium",
|
|
29
|
-
letterSpacing: "compact",
|
|
30
|
-
lineHeight: "tight",
|
|
31
|
-
overflowWrap: "anywhere",
|
|
32
|
-
});
|
|
33
|
-
const muted = css({ color: "fg.muted", fontSize: "caption", fontWeight: "medium" });
|
|
34
|
-
const descriptionStyle = css({ margin: "none", color: "fg.secondary", fontSize: "body" });
|
|
35
|
-
const actionsStyle = css({ display: "flex", flexWrap: "wrap", gap: "layout.controlGap" });
|
|
36
|
-
export function ProfileHeader({ name, kind = "user", src, title, team, email, description, actions, className, ...props }) {
|
|
37
|
-
const { labels } = useCiridaeLocale();
|
|
38
|
-
const meta = [title, team].filter(Boolean).join(" · ");
|
|
39
|
-
return (_jsx("header", { ...props, className: cx(header, className), "data-ciridae-ui": "", children: _jsxs("div", { className: grid, children: [_jsx(Avatar, { label: name, kind: kind, src: src, size: "large", "aria-hidden": "true" }), _jsxs("div", { className: text, children: [_jsx("h2", { className: nameStyle, children: name }), meta && _jsx("span", { className: muted, children: meta }), email && (_jsx("span", { className: muted, children: _jsx(CopyableText, { text: email, label: labels.profileHeader.email }) })), description && _jsx("p", { className: descriptionStyle, children: description })] }), actions && (_jsx("div", { className: actionsStyle, "data-actions": "", children: actions }))] }) }));
|
|
40
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
type RecentItemsStorage<Item> = {
|
|
2
|
-
storageKey?: undefined;
|
|
3
|
-
parseItem?: undefined;
|
|
4
|
-
} | {
|
|
5
|
-
/** Keeps both lists in `localStorage` as `{ recent, pinned }`. */
|
|
6
|
-
storageKey: string;
|
|
7
|
-
/** Reads one stored entry back, or null to drop it, such as a record that is gone. */
|
|
8
|
-
parseItem: (stored: unknown) => Item | null;
|
|
9
|
-
};
|
|
10
|
-
export type UseRecentItemsOptions<Item> = RecentItemsStorage<Item> & {
|
|
11
|
-
/** What makes two items the same, such as a record's route. */
|
|
12
|
-
getId: (item: Item) => string;
|
|
13
|
-
/** The open item; it joins Recent unless it is pinned or already listed. */
|
|
14
|
-
current?: Item | null;
|
|
15
|
-
/** Recent's length; 10 by default. */
|
|
16
|
-
limit?: number;
|
|
17
|
-
/** Recent while nothing is stored. */
|
|
18
|
-
seed?: readonly Item[];
|
|
19
|
-
};
|
|
20
|
-
export declare function useRecentItems<Item>({ getId, current, limit, seed, storageKey, parseItem, }: UseRecentItemsOptions<Item>): {
|
|
21
|
-
recent: readonly Item[];
|
|
22
|
-
pinned: readonly Item[];
|
|
23
|
-
isPinned: (item: Item) => boolean;
|
|
24
|
-
pin: (item: Item) => void;
|
|
25
|
-
unpin: (item: Item) => void;
|
|
26
|
-
togglePin: (item: Item) => void;
|
|
27
|
-
};
|
|
28
|
-
export {};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* The items a person opened lately and the ones they pinned, for a sidebar's Pinned and Recent
|
|
3
|
-
* sections. An item joins Recent at the top the first time it opens; one already listed keeps its
|
|
4
|
-
* place, so reopening never reshuffles the list under the pointer. Pinning moves an item out of
|
|
5
|
-
* Recent to the end of Pinned; unpinning puts it back in Recent. Recent holds `limit` items.
|
|
6
|
-
*/
|
|
7
|
-
import { useCallback, useEffect, useState } from "react";
|
|
8
|
-
const DEFAULT_LIMIT = 10;
|
|
9
|
-
function readStored(storageKey, parseItem) {
|
|
10
|
-
try {
|
|
11
|
-
const text = globalThis.localStorage?.getItem(storageKey);
|
|
12
|
-
if (!text)
|
|
13
|
-
return null;
|
|
14
|
-
const stored = JSON.parse(text);
|
|
15
|
-
if (typeof stored !== "object" || stored === null)
|
|
16
|
-
return null;
|
|
17
|
-
const list = (value) => Array.isArray(value) ? value.flatMap((entry) => parseItem(entry) ?? []) : [];
|
|
18
|
-
return {
|
|
19
|
-
recent: "recent" in stored ? list(stored.recent) : [],
|
|
20
|
-
pinned: "pinned" in stored ? list(stored.pinned) : [],
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
// Unreadable storage starts from the seed.
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
export function useRecentItems({ getId, current, limit = DEFAULT_LIMIT, seed = [], storageKey, parseItem, }) {
|
|
29
|
-
const [state, setState] = useState(() => {
|
|
30
|
-
const stored = storageKey && parseItem ? readStored(storageKey, parseItem) : null;
|
|
31
|
-
return stored ?? { recent: seed.slice(0, limit), pinned: [] };
|
|
32
|
-
});
|
|
33
|
-
const listed = useCallback((items, item) => items.some((other) => getId(other) === getId(item)), [getId]);
|
|
34
|
-
const without = useCallback((items, item) => items.filter((other) => getId(other) !== getId(item)), [getId]);
|
|
35
|
-
const withRecent = useCallback((items, item) => listed(items, item) ? items : [item, ...items].slice(0, limit), [listed, limit]);
|
|
36
|
-
useEffect(() => {
|
|
37
|
-
if (!current)
|
|
38
|
-
return;
|
|
39
|
-
setState((previous) => listed(previous.pinned, current) || listed(previous.recent, current)
|
|
40
|
-
? previous
|
|
41
|
-
: { ...previous, recent: withRecent(previous.recent, current) });
|
|
42
|
-
}, [current, listed, withRecent]);
|
|
43
|
-
useEffect(() => {
|
|
44
|
-
if (!storageKey)
|
|
45
|
-
return;
|
|
46
|
-
try {
|
|
47
|
-
globalThis.localStorage?.setItem(storageKey, JSON.stringify(state));
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
// Storage is a convenience; the lists still work for this visit.
|
|
51
|
-
}
|
|
52
|
-
}, [state, storageKey]);
|
|
53
|
-
const pin = useCallback((item) => setState(({ recent, pinned }) => listed(pinned, item)
|
|
54
|
-
? { recent, pinned }
|
|
55
|
-
: { pinned: [...pinned, item], recent: without(recent, item) }), [listed, without]);
|
|
56
|
-
const unpin = useCallback((item) => setState(({ recent, pinned }) => ({
|
|
57
|
-
pinned: without(pinned, item),
|
|
58
|
-
recent: withRecent(recent, item),
|
|
59
|
-
})), [without, withRecent]);
|
|
60
|
-
const isPinned = (item) => listed(state.pinned, item);
|
|
61
|
-
const togglePin = (item) => (isPinned(item) ? unpin(item) : pin(item));
|
|
62
|
-
return { recent: state.recent, pinned: state.pinned, isPinned, pin, unpin, togglePin };
|
|
63
|
-
}
|