panelui-native 0.25.0 → 0.30.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 +18 -1
- package/lib/module/components/accordion/index.js +8 -8
- package/lib/module/components/accordion/index.js.map +1 -1
- package/lib/module/components/alert/index.js +2 -2
- package/lib/module/components/alert/index.js.map +1 -1
- package/lib/module/components/area-chart/index.js +182 -50
- package/lib/module/components/area-chart/index.js.map +1 -1
- package/lib/module/components/attachment/index.js +2 -1
- package/lib/module/components/attachment/index.js.map +1 -1
- package/lib/module/components/avatar/index.js +3 -3
- package/lib/module/components/avatar/index.js.map +1 -1
- package/lib/module/components/badge/index.js +4 -4
- package/lib/module/components/badge/index.js.map +1 -1
- package/lib/module/components/bar-chart/index.js +197 -56
- package/lib/module/components/bar-chart/index.js.map +1 -1
- package/lib/module/components/bottom-sheet/index.js +15 -10
- package/lib/module/components/bottom-sheet/index.js.map +1 -1
- package/lib/module/components/breadcrumb/index.js +6 -6
- package/lib/module/components/breadcrumb/index.js.map +1 -1
- package/lib/module/components/button/index.js +11 -6
- package/lib/module/components/button/index.js.map +1 -1
- package/lib/module/components/calendar/index.js +792 -0
- package/lib/module/components/calendar/index.js.map +1 -0
- package/lib/module/components/carousel/index.js +680 -0
- package/lib/module/components/carousel/index.js.map +1 -0
- package/lib/module/components/chip/index.js +4 -4
- package/lib/module/components/chip/index.js.map +1 -1
- package/lib/module/components/code-block/highlight.js +363 -0
- package/lib/module/components/code-block/highlight.js.map +1 -0
- package/lib/module/components/code-block/index.js +313 -0
- package/lib/module/components/code-block/index.js.map +1 -0
- package/lib/module/components/date-picker/index.js +165 -0
- package/lib/module/components/date-picker/index.js.map +1 -0
- package/lib/module/components/dialog/index.js +7 -2
- package/lib/module/components/dialog/index.js.map +1 -1
- package/lib/module/components/direction/index.js +2 -1
- package/lib/module/components/direction/index.js.map +1 -1
- package/lib/module/components/empty-state/index.js +2 -2
- package/lib/module/components/empty-state/index.js.map +1 -1
- package/lib/module/components/field/index.js +5 -5
- package/lib/module/components/field/index.js.map +1 -1
- package/lib/module/components/flow/index.js +3 -3
- package/lib/module/components/flow/index.js.map +1 -1
- package/lib/module/components/frame/index.js +5 -5
- package/lib/module/components/frame/index.js.map +1 -1
- package/lib/module/components/input-group/index.js +3 -2
- package/lib/module/components/input-group/index.js.map +1 -1
- package/lib/module/components/item/index.js +9 -9
- package/lib/module/components/item/index.js.map +1 -1
- package/lib/module/components/label/index.js +4 -4
- package/lib/module/components/label/index.js.map +1 -1
- package/lib/module/components/line-chart/index.js +167 -44
- package/lib/module/components/line-chart/index.js.map +1 -1
- package/lib/module/components/map/index.js +7 -7
- package/lib/module/components/map/index.js.map +1 -1
- package/lib/module/components/marker/index.js +3 -3
- package/lib/module/components/marker/index.js.map +1 -1
- package/lib/module/components/menu/index.js +714 -0
- package/lib/module/components/menu/index.js.map +1 -0
- package/lib/module/components/message/index.js +7 -7
- package/lib/module/components/message/index.js.map +1 -1
- package/lib/module/components/message-scroller/index.js +5 -4
- package/lib/module/components/message-scroller/index.js.map +1 -1
- package/lib/module/components/plan/index.js +296 -0
- package/lib/module/components/plan/index.js.map +1 -0
- package/lib/module/components/popover/index.js +73 -10
- package/lib/module/components/popover/index.js.map +1 -1
- package/lib/module/components/radio-group/index.js +15 -10
- package/lib/module/components/radio-group/index.js.map +1 -1
- package/lib/module/components/reasoning/index.js +244 -0
- package/lib/module/components/reasoning/index.js.map +1 -0
- package/lib/module/components/section-rail/index.js +4 -4
- package/lib/module/components/section-rail/index.js.map +1 -1
- package/lib/module/components/select/index.js +10 -4
- package/lib/module/components/select/index.js.map +1 -1
- package/lib/module/components/sources/index.js +221 -0
- package/lib/module/components/sources/index.js.map +1 -0
- package/lib/module/components/steps/index.js +4 -4
- package/lib/module/components/steps/index.js.map +1 -1
- package/lib/module/components/tabs/index.js +7 -7
- package/lib/module/components/tabs/index.js.map +1 -1
- package/lib/module/components/task/index.js +300 -0
- package/lib/module/components/task/index.js.map +1 -0
- package/lib/module/components/textarea/index.js +295 -0
- package/lib/module/components/textarea/index.js.map +1 -0
- package/lib/module/components/timeline/index.js +4 -4
- package/lib/module/components/timeline/index.js.map +1 -1
- package/lib/module/components/toast/index.js +2 -2
- package/lib/module/components/toast/index.js.map +1 -1
- package/lib/module/components/toggle-button/index.js +5 -5
- package/lib/module/components/toggle-button/index.js.map +1 -1
- package/lib/module/components/tooltip/index.js +648 -0
- package/lib/module/components/tooltip/index.js.map +1 -0
- package/lib/module/components/typography/index.js +2 -2
- package/lib/module/components/typography/index.js.map +1 -1
- package/lib/module/hooks/index.js +1 -0
- package/lib/module/hooks/index.js.map +1 -1
- package/lib/module/hooks/use-back-handler.js +37 -0
- package/lib/module/hooks/use-back-handler.js.map +1 -0
- package/lib/module/icons/index.js +202 -0
- package/lib/module/icons/index.js.map +1 -1
- package/lib/module/index.js +13 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/primitives/collapse.js +112 -0
- package/lib/module/primitives/collapse.js.map +1 -0
- package/lib/module/primitives/keyboard-avoider.js +2 -1
- package/lib/module/primitives/keyboard-avoider.js.map +1 -1
- package/lib/module/primitives/text.js +25 -1
- package/lib/module/primitives/text.js.map +1 -1
- package/lib/module/utils/date.js +386 -0
- package/lib/module/utils/date.js.map +1 -0
- package/lib/typescript/src/components/accordion/index.d.ts.map +1 -1
- package/lib/typescript/src/components/alert/index.d.ts.map +1 -1
- package/lib/typescript/src/components/area-chart/index.d.ts +41 -1
- package/lib/typescript/src/components/area-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/attachment/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bar-chart/index.d.ts +44 -2
- package/lib/typescript/src/components/bar-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/bottom-sheet/index.d.ts.map +1 -1
- package/lib/typescript/src/components/breadcrumb/index.d.ts.map +1 -1
- package/lib/typescript/src/components/button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/calendar/index.d.ts +173 -0
- package/lib/typescript/src/components/calendar/index.d.ts.map +1 -0
- package/lib/typescript/src/components/carousel/index.d.ts +179 -0
- package/lib/typescript/src/components/carousel/index.d.ts.map +1 -0
- package/lib/typescript/src/components/chip/index.d.ts.map +1 -1
- package/lib/typescript/src/components/code-block/highlight.d.ts +39 -0
- package/lib/typescript/src/components/code-block/highlight.d.ts.map +1 -0
- package/lib/typescript/src/components/code-block/index.d.ts +113 -0
- package/lib/typescript/src/components/code-block/index.d.ts.map +1 -0
- package/lib/typescript/src/components/date-picker/index.d.ts +97 -0
- package/lib/typescript/src/components/date-picker/index.d.ts.map +1 -0
- package/lib/typescript/src/components/dialog/index.d.ts.map +1 -1
- package/lib/typescript/src/components/direction/index.d.ts.map +1 -1
- package/lib/typescript/src/components/empty-state/index.d.ts.map +1 -1
- package/lib/typescript/src/components/field/index.d.ts.map +1 -1
- package/lib/typescript/src/components/frame/index.d.ts.map +1 -1
- package/lib/typescript/src/components/input-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/item/index.d.ts.map +1 -1
- package/lib/typescript/src/components/label/index.d.ts.map +1 -1
- package/lib/typescript/src/components/line-chart/index.d.ts +41 -2
- package/lib/typescript/src/components/line-chart/index.d.ts.map +1 -1
- package/lib/typescript/src/components/map/index.d.ts.map +1 -1
- package/lib/typescript/src/components/marker/index.d.ts.map +1 -1
- package/lib/typescript/src/components/menu/index.d.ts +261 -0
- package/lib/typescript/src/components/menu/index.d.ts.map +1 -0
- package/lib/typescript/src/components/message/index.d.ts.map +1 -1
- package/lib/typescript/src/components/message-scroller/index.d.ts.map +1 -1
- package/lib/typescript/src/components/plan/index.d.ts +127 -0
- package/lib/typescript/src/components/plan/index.d.ts.map +1 -0
- package/lib/typescript/src/components/popover/index.d.ts +35 -1
- package/lib/typescript/src/components/popover/index.d.ts.map +1 -1
- package/lib/typescript/src/components/radio-group/index.d.ts.map +1 -1
- package/lib/typescript/src/components/reasoning/index.d.ts +97 -0
- package/lib/typescript/src/components/reasoning/index.d.ts.map +1 -0
- package/lib/typescript/src/components/select/index.d.ts.map +1 -1
- package/lib/typescript/src/components/sources/index.d.ts +85 -0
- package/lib/typescript/src/components/sources/index.d.ts.map +1 -0
- package/lib/typescript/src/components/steps/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tabs/index.d.ts.map +1 -1
- package/lib/typescript/src/components/task/index.d.ts +103 -0
- package/lib/typescript/src/components/task/index.d.ts.map +1 -0
- package/lib/typescript/src/components/textarea/index.d.ts +175 -0
- package/lib/typescript/src/components/textarea/index.d.ts.map +1 -0
- package/lib/typescript/src/components/timeline/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toast/index.d.ts.map +1 -1
- package/lib/typescript/src/components/toggle-button/index.d.ts.map +1 -1
- package/lib/typescript/src/components/tooltip/index.d.ts +180 -0
- package/lib/typescript/src/components/tooltip/index.d.ts.map +1 -0
- package/lib/typescript/src/components/typography/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/index.d.ts +1 -0
- package/lib/typescript/src/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/hooks/use-back-handler.d.ts +19 -0
- package/lib/typescript/src/hooks/use-back-handler.d.ts.map +1 -0
- package/lib/typescript/src/icons/index.d.ts +17 -0
- package/lib/typescript/src/icons/index.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +16 -4
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/primitives/collapse.d.ts +42 -0
- package/lib/typescript/src/primitives/collapse.d.ts.map +1 -0
- package/lib/typescript/src/primitives/keyboard-avoider.d.ts.map +1 -1
- package/lib/typescript/src/primitives/text.d.ts +20 -0
- package/lib/typescript/src/primitives/text.d.ts.map +1 -1
- package/lib/typescript/src/utils/date.d.ts +116 -0
- package/lib/typescript/src/utils/date.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/components/accordion/index.tsx +8 -12
- package/src/components/alert/index.tsx +2 -2
- package/src/components/area-chart/index.tsx +208 -55
- package/src/components/attachment/index.tsx +2 -2
- package/src/components/avatar/index.tsx +3 -3
- package/src/components/badge/index.tsx +6 -6
- package/src/components/bar-chart/index.tsx +214 -54
- package/src/components/bottom-sheet/index.tsx +17 -16
- package/src/components/breadcrumb/index.tsx +6 -8
- package/src/components/button/index.tsx +12 -8
- package/src/components/calendar/index.tsx +970 -0
- package/src/components/carousel/index.tsx +788 -0
- package/src/components/chip/index.tsx +4 -6
- package/src/components/code-block/highlight.ts +278 -0
- package/src/components/code-block/index.tsx +341 -0
- package/src/components/date-picker/index.tsx +255 -0
- package/src/components/dialog/index.tsx +7 -2
- package/src/components/direction/index.tsx +2 -1
- package/src/components/empty-state/index.tsx +2 -2
- package/src/components/field/index.tsx +3 -5
- package/src/components/flow/index.tsx +3 -3
- package/src/components/frame/index.tsx +5 -7
- package/src/components/input-group/index.tsx +3 -2
- package/src/components/item/index.tsx +9 -9
- package/src/components/label/index.tsx +2 -2
- package/src/components/line-chart/index.tsx +189 -50
- package/src/components/map/index.tsx +7 -9
- package/src/components/marker/index.tsx +3 -3
- package/src/components/menu/index.tsx +812 -0
- package/src/components/message/index.tsx +7 -7
- package/src/components/message-scroller/index.tsx +5 -4
- package/src/components/plan/index.tsx +325 -0
- package/src/components/popover/index.tsx +111 -8
- package/src/components/radio-group/index.tsx +13 -4
- package/src/components/reasoning/index.tsx +297 -0
- package/src/components/section-rail/index.tsx +4 -4
- package/src/components/select/index.tsx +10 -4
- package/src/components/sources/index.tsx +278 -0
- package/src/components/steps/index.tsx +4 -4
- package/src/components/tabs/index.tsx +7 -9
- package/src/components/task/index.tsx +329 -0
- package/src/components/textarea/index.tsx +381 -0
- package/src/components/timeline/index.tsx +4 -4
- package/src/components/toast/index.tsx +2 -2
- package/src/components/toggle-button/index.tsx +5 -7
- package/src/components/tooltip/index.tsx +793 -0
- package/src/components/typography/index.tsx +2 -2
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-back-handler.ts +37 -0
- package/src/icons/index.tsx +147 -0
- package/src/index.ts +116 -0
- package/src/primitives/collapse.tsx +128 -0
- package/src/primitives/keyboard-avoider.tsx +2 -1
- package/src/primitives/text.tsx +28 -1
- package/src/utils/date.ts +446 -0
- package/theme.css +112 -0
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date helpers for the calendar.
|
|
3
|
+
*
|
|
4
|
+
* No date library. Everything a month grid needs is arithmetic on `Date`, and
|
|
5
|
+
* a dependency that ships a full timezone database to render seven columns is
|
|
6
|
+
* a poor trade for a library whose whole runtime is three small packages.
|
|
7
|
+
*
|
|
8
|
+
* Two rules hold throughout:
|
|
9
|
+
*
|
|
10
|
+
* - **Days are compared at local midnight.** A `Date` carries a time, and two
|
|
11
|
+
* values on the same day are not equal unless that time is stripped. Every
|
|
12
|
+
* comparison here goes through `startOfDay`.
|
|
13
|
+
* - **Month arithmetic is done with `setMonth`, not by adding days.** The
|
|
14
|
+
* platform already knows that a month is 28, 29, 30 or 31 days long.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/** Names of the weekdays and months, in the caller's locale. */
|
|
18
|
+
export type DateLocale = string | undefined;
|
|
19
|
+
|
|
20
|
+
export function startOfDay(date: Date): Date {
|
|
21
|
+
const copy = new Date(date);
|
|
22
|
+
copy.setHours(0, 0, 0, 0);
|
|
23
|
+
return copy;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function isSameDay(a: Date | null | undefined, b: Date | null | undefined): boolean {
|
|
27
|
+
if (!a || !b) return false;
|
|
28
|
+
return (
|
|
29
|
+
a.getFullYear() === b.getFullYear() &&
|
|
30
|
+
a.getMonth() === b.getMonth() &&
|
|
31
|
+
a.getDate() === b.getDate()
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function isSameMonth(a: Date, b: Date): boolean {
|
|
36
|
+
return a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function startOfMonth(date: Date): Date {
|
|
40
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Day 0 of the *next* month, which the platform resolves to the last day of
|
|
45
|
+
* this one — so a leap February needs no special case.
|
|
46
|
+
*/
|
|
47
|
+
export function endOfMonth(date: Date): Date {
|
|
48
|
+
return new Date(date.getFullYear(), date.getMonth() + 1, 0);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function addMonths(date: Date, months: number): Date {
|
|
52
|
+
const copy = new Date(date.getFullYear(), date.getMonth(), 1);
|
|
53
|
+
copy.setMonth(copy.getMonth() + months);
|
|
54
|
+
return copy;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function addDays(date: Date, days: number): Date {
|
|
58
|
+
const copy = new Date(date);
|
|
59
|
+
copy.setDate(copy.getDate() + days);
|
|
60
|
+
return copy;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Whole days from `a` to `b`, ignoring the time of day on both. */
|
|
64
|
+
export function daysBetween(a: Date, b: Date): number {
|
|
65
|
+
const MS = 24 * 60 * 60 * 1000;
|
|
66
|
+
return Math.round((startOfDay(b).getTime() - startOfDay(a).getTime()) / MS);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function isBefore(a: Date, b: Date): boolean {
|
|
70
|
+
return startOfDay(a).getTime() < startOfDay(b).getTime();
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function isAfter(a: Date, b: Date): boolean {
|
|
74
|
+
return startOfDay(a).getTime() > startOfDay(b).getTime();
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Inclusive at both ends, which is what a selected range means to a reader. */
|
|
78
|
+
export function isWithin(date: Date, from: Date, to: Date): boolean {
|
|
79
|
+
const time = startOfDay(date).getTime();
|
|
80
|
+
const start = startOfDay(from).getTime();
|
|
81
|
+
const end = startOfDay(to).getTime();
|
|
82
|
+
return time >= Math.min(start, end) && time <= Math.max(start, end);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function clampDate(date: Date, min?: Date, max?: Date): Date {
|
|
86
|
+
if (min && isBefore(date, min)) return min;
|
|
87
|
+
if (max && isAfter(date, max)) return max;
|
|
88
|
+
return date;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* The six-week grid for a month.
|
|
93
|
+
*
|
|
94
|
+
* Always six rows, and always starting on the chosen first day of the week, so
|
|
95
|
+
* the calendar does not change height as the months are paged through. A grid
|
|
96
|
+
* that grows a row in March and loses it again in April makes everything below
|
|
97
|
+
* it jump, and the days themselves appear to move between months.
|
|
98
|
+
*
|
|
99
|
+
* The leading and trailing cells belong to the neighbouring months; whether
|
|
100
|
+
* they are drawn or left blank is the caller's decision.
|
|
101
|
+
*/
|
|
102
|
+
export function monthGrid(month: Date, weekStartsOn: number): Date[][] {
|
|
103
|
+
const first = startOfMonth(month);
|
|
104
|
+
// How far back to the most recent `weekStartsOn`. The `+ 7` keeps the
|
|
105
|
+
// modulo positive when the week starts later than the first of the month.
|
|
106
|
+
const lead = (first.getDay() - weekStartsOn + 7) % 7;
|
|
107
|
+
const start = addDays(first, -lead);
|
|
108
|
+
|
|
109
|
+
return Array.from({ length: 6 }, (_unusedWeek, week) =>
|
|
110
|
+
Array.from({ length: 7 }, (_unusedDay, day) => addDays(start, week * 7 + day))
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Formatting, guarded.
|
|
116
|
+
*
|
|
117
|
+
* `Intl` is on modern Hermes, but the data behind it is not guaranteed —
|
|
118
|
+
* builds without the full ICU set throw or return something unusable for
|
|
119
|
+
* locales they do not carry. Every formatter here falls back to English rather
|
|
120
|
+
* than taking the screen down over a month name.
|
|
121
|
+
*/
|
|
122
|
+
function format(date: Date, locale: DateLocale, options: Intl.DateTimeFormatOptions): string | null {
|
|
123
|
+
try {
|
|
124
|
+
return new Intl.DateTimeFormat(locale, options).format(date);
|
|
125
|
+
} catch {
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* A locale tag carrying an explicit calendar and Latin digits.
|
|
132
|
+
*
|
|
133
|
+
* The calendar has to go in the *tag*, not in the options bag. Hermes builds
|
|
134
|
+
* its `Intl` on the platform's own date formatter, which reads the Unicode
|
|
135
|
+
* extension on a locale identifier but does not reliably honour `calendar` as
|
|
136
|
+
* an option — so `{ calendar: 'gregory' }` was quietly ignored and an Arabic
|
|
137
|
+
* device kept answering in Hijri. Any extension already on the tag is dropped
|
|
138
|
+
* first, so a caller passing `ar-u-ca-islamic` cannot end up with two.
|
|
139
|
+
*/
|
|
140
|
+
function withCalendar(locale: DateLocale, calendar: 'gregory' | 'islamic'): string {
|
|
141
|
+
const base = (locale ?? 'en').split('-u-')[0] || 'en';
|
|
142
|
+
return `${base}-u-ca-${calendar}-nu-latn`;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Gregorian formatting, pinned.
|
|
147
|
+
*
|
|
148
|
+
* Asking for a month name in Arabic without saying which calendar gets a Hijri
|
|
149
|
+
* one back, because that is what the locale resolves to — right for the
|
|
150
|
+
* language, wrong for a grid whose cells are counting Gregorian days. The
|
|
151
|
+
* digits are pinned too, so the caption and the numbers under it are in one
|
|
152
|
+
* set.
|
|
153
|
+
*/
|
|
154
|
+
function formatGregory(
|
|
155
|
+
date: Date,
|
|
156
|
+
locale: DateLocale,
|
|
157
|
+
options: Intl.DateTimeFormatOptions
|
|
158
|
+
): string | null {
|
|
159
|
+
return (
|
|
160
|
+
format(date, withCalendar(locale, 'gregory'), options) ??
|
|
161
|
+
// A build that cannot parse the extension at all still gets asked, in the
|
|
162
|
+
// hope that it honours the option instead.
|
|
163
|
+
format(date, locale, { ...options, calendar: 'gregory', numberingSystem: 'latn' })
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* -------------------------------------------------------------------------- */
|
|
168
|
+
/* Calendar systems */
|
|
169
|
+
/* -------------------------------------------------------------------------- */
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Which calendar the months and day numbers are counted in.
|
|
173
|
+
*
|
|
174
|
+
* `auto` takes whatever the locale resolves to, which on an Arabic device is
|
|
175
|
+
* usually islamic. It is not the default: a grid whose month boundaries move
|
|
176
|
+
* with the device's language is a surprise, and the caller who wants that can
|
|
177
|
+
* ask for it.
|
|
178
|
+
*/
|
|
179
|
+
export type CalendarSystem = 'gregory' | 'islamic' | 'auto';
|
|
180
|
+
|
|
181
|
+
/** Year, month and day as the chosen calendar counts them. 1-based month. */
|
|
182
|
+
export interface CalendarParts {
|
|
183
|
+
year: number;
|
|
184
|
+
month: number;
|
|
185
|
+
day: number;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/** What `auto` resolves to for a locale, falling back to the Gregorian. */
|
|
189
|
+
export function resolveCalendar(system: CalendarSystem, locale: DateLocale): 'gregory' | 'islamic' {
|
|
190
|
+
if (system !== 'auto') return system;
|
|
191
|
+
try {
|
|
192
|
+
const resolved = new Intl.DateTimeFormat(locale).resolvedOptions().calendar ?? '';
|
|
193
|
+
return resolved.startsWith('islamic') ? 'islamic' : 'gregory';
|
|
194
|
+
} catch {
|
|
195
|
+
return 'gregory';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A date's year, month and day in the given calendar.
|
|
201
|
+
*
|
|
202
|
+
* `formatToParts` rather than a parsed string, because the order and the
|
|
203
|
+
* separators are the locale's business and we only want the numbers. The
|
|
204
|
+
* numbering system is pinned to Latin so the parts come back parseable
|
|
205
|
+
* whatever language is on the device, and so the cells and the caption above
|
|
206
|
+
* them end up in one set of digits.
|
|
207
|
+
*/
|
|
208
|
+
export function calendarParts(
|
|
209
|
+
date: Date,
|
|
210
|
+
system: 'gregory' | 'islamic',
|
|
211
|
+
locale: DateLocale
|
|
212
|
+
): CalendarParts {
|
|
213
|
+
if (system === 'gregory') {
|
|
214
|
+
return { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() };
|
|
215
|
+
}
|
|
216
|
+
try {
|
|
217
|
+
const parts = new Intl.DateTimeFormat(withCalendar(locale, 'islamic'), {
|
|
218
|
+
year: 'numeric',
|
|
219
|
+
month: 'numeric',
|
|
220
|
+
day: 'numeric',
|
|
221
|
+
}).formatToParts(date);
|
|
222
|
+
const read = (type: string) => Number(parts.find((part) => part.type === type)?.value);
|
|
223
|
+
const year = read('year');
|
|
224
|
+
const month = read('month');
|
|
225
|
+
const day = read('day');
|
|
226
|
+
if (!Number.isFinite(year) || !Number.isFinite(month) || !Number.isFinite(day)) {
|
|
227
|
+
throw new Error('unusable');
|
|
228
|
+
}
|
|
229
|
+
return { year, month, day };
|
|
230
|
+
} catch {
|
|
231
|
+
// No islamic data in this build. Gregorian is wrong, but it is coherent —
|
|
232
|
+
// the grid, the caption and the cells will at least agree with each other.
|
|
233
|
+
return { year: date.getFullYear(), month: date.getMonth() + 1, day: date.getDate() };
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export function isSameCalendarMonth(
|
|
238
|
+
a: Date,
|
|
239
|
+
b: Date,
|
|
240
|
+
system: 'gregory' | 'islamic',
|
|
241
|
+
locale: DateLocale
|
|
242
|
+
): boolean {
|
|
243
|
+
if (system === 'gregory') return isSameMonth(a, b);
|
|
244
|
+
const one = calendarParts(a, system, locale);
|
|
245
|
+
const two = calendarParts(b, system, locale);
|
|
246
|
+
return one.year === two.year && one.month === two.month;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* The first day of the calendar month `date` falls in.
|
|
251
|
+
*
|
|
252
|
+
* Walked back a day at a time rather than computed. A Hijri month is 29 or 30
|
|
253
|
+
* days depending on the year, and the platform's own calendar data already
|
|
254
|
+
* knows which — stepping until the day number reads 1 asks it, instead of
|
|
255
|
+
* shipping a table that will disagree with the device.
|
|
256
|
+
*/
|
|
257
|
+
export function startOfCalendarMonth(
|
|
258
|
+
date: Date,
|
|
259
|
+
system: 'gregory' | 'islamic',
|
|
260
|
+
locale: DateLocale
|
|
261
|
+
): Date {
|
|
262
|
+
if (system === 'gregory') return startOfMonth(date);
|
|
263
|
+
let cursor = startOfDay(date);
|
|
264
|
+
for (let step = 0; step < 31; step += 1) {
|
|
265
|
+
if (calendarParts(cursor, system, locale).day === 1) return cursor;
|
|
266
|
+
cursor = addDays(cursor, -1);
|
|
267
|
+
}
|
|
268
|
+
return cursor;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/** Days in the calendar month `date` falls in. */
|
|
272
|
+
export function daysInCalendarMonth(
|
|
273
|
+
date: Date,
|
|
274
|
+
system: 'gregory' | 'islamic',
|
|
275
|
+
locale: DateLocale
|
|
276
|
+
): number {
|
|
277
|
+
if (system === 'gregory') return endOfMonth(date).getDate();
|
|
278
|
+
const start = startOfCalendarMonth(date, system, locale);
|
|
279
|
+
for (let length = 28; length <= 31; length += 1) {
|
|
280
|
+
if (calendarParts(addDays(start, length), system, locale).day === 1) return length;
|
|
281
|
+
}
|
|
282
|
+
return 30;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
/** Page by whole calendar months, forwards or back. */
|
|
286
|
+
export function addCalendarMonths(
|
|
287
|
+
date: Date,
|
|
288
|
+
months: number,
|
|
289
|
+
system: 'gregory' | 'islamic',
|
|
290
|
+
locale: DateLocale
|
|
291
|
+
): Date {
|
|
292
|
+
if (system === 'gregory') return addMonths(date, months);
|
|
293
|
+
let cursor = startOfCalendarMonth(date, system, locale);
|
|
294
|
+
for (let step = 0; step < Math.abs(months); step += 1) {
|
|
295
|
+
cursor =
|
|
296
|
+
months > 0
|
|
297
|
+
? // One past the end of this month is the first of the next.
|
|
298
|
+
addDays(cursor, daysInCalendarMonth(cursor, system, locale))
|
|
299
|
+
: // One before the start of this month is somewhere in the previous
|
|
300
|
+
// one, which then gets walked back to its own first day.
|
|
301
|
+
startOfCalendarMonth(addDays(cursor, -1), system, locale);
|
|
302
|
+
}
|
|
303
|
+
return cursor;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/** The day-of-month a cell shows. */
|
|
307
|
+
export function calendarDayNumber(
|
|
308
|
+
date: Date,
|
|
309
|
+
system: 'gregory' | 'islamic',
|
|
310
|
+
locale: DateLocale
|
|
311
|
+
): number {
|
|
312
|
+
return system === 'gregory' ? date.getDate() : calendarParts(date, system, locale).day;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/** "Ramadan 1447" or "March 2026", in whichever calendar is in force. */
|
|
316
|
+
export function calendarMonthLabel(
|
|
317
|
+
date: Date,
|
|
318
|
+
system: 'gregory' | 'islamic',
|
|
319
|
+
locale: DateLocale
|
|
320
|
+
): string {
|
|
321
|
+
if (system === 'gregory') return monthLabel(date, locale);
|
|
322
|
+
return (
|
|
323
|
+
format(date, withCalendar(locale, 'islamic'), { month: 'long', year: 'numeric' }) ??
|
|
324
|
+
monthLabel(date, locale)
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* The names of a calendar's months, in order, for the dropdown.
|
|
330
|
+
*
|
|
331
|
+
* Sampled from a real year in that calendar rather than from twelve Gregorian
|
|
332
|
+
* firsts — the old code did the latter and got twelve arbitrary Hijri names in
|
|
333
|
+
* whatever order the Gregorian 1sts happened to fall, then indexed them by
|
|
334
|
+
* Gregorian month, which meant nothing at all.
|
|
335
|
+
*/
|
|
336
|
+
export function calendarMonthNames(
|
|
337
|
+
reference: Date,
|
|
338
|
+
system: 'gregory' | 'islamic',
|
|
339
|
+
locale: DateLocale,
|
|
340
|
+
style: 'long' | 'short' = 'short'
|
|
341
|
+
): string[] {
|
|
342
|
+
if (system === 'gregory') return monthNames(locale, style);
|
|
343
|
+
const names: string[] = [];
|
|
344
|
+
let cursor = startOfCalendarMonth(reference, system, locale);
|
|
345
|
+
// Back to month 1 of this year, then forward through all twelve.
|
|
346
|
+
cursor = addCalendarMonths(cursor, -(calendarParts(cursor, system, locale).month - 1), system, locale);
|
|
347
|
+
for (let month = 0; month < 12; month += 1) {
|
|
348
|
+
names.push(
|
|
349
|
+
format(cursor, withCalendar(locale, 'islamic'), { month: style }) ?? String(month + 1)
|
|
350
|
+
);
|
|
351
|
+
cursor = addCalendarMonths(cursor, 1, system, locale);
|
|
352
|
+
}
|
|
353
|
+
return names;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/** The whole date read out, in whichever calendar is in force. */
|
|
357
|
+
export function calendarLongDate(
|
|
358
|
+
date: Date,
|
|
359
|
+
system: 'gregory' | 'islamic',
|
|
360
|
+
locale: DateLocale
|
|
361
|
+
): string {
|
|
362
|
+
if (system === 'gregory') return longDate(date, locale);
|
|
363
|
+
return (
|
|
364
|
+
format(date, withCalendar(locale, 'islamic'), {
|
|
365
|
+
weekday: 'long',
|
|
366
|
+
day: 'numeric',
|
|
367
|
+
month: 'long',
|
|
368
|
+
year: 'numeric',
|
|
369
|
+
}) ?? longDate(date, locale)
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** The compact form a trigger shows, in whichever calendar is in force. */
|
|
374
|
+
export function calendarShortDate(
|
|
375
|
+
date: Date,
|
|
376
|
+
system: 'gregory' | 'islamic',
|
|
377
|
+
locale: DateLocale
|
|
378
|
+
): string {
|
|
379
|
+
if (system === 'gregory') return shortDate(date, locale);
|
|
380
|
+
return (
|
|
381
|
+
format(date, withCalendar(locale, 'islamic'), {
|
|
382
|
+
day: 'numeric',
|
|
383
|
+
month: 'short',
|
|
384
|
+
year: 'numeric',
|
|
385
|
+
}) ?? shortDate(date, locale)
|
|
386
|
+
);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const MONTHS_EN = [
|
|
390
|
+
'January',
|
|
391
|
+
'February',
|
|
392
|
+
'March',
|
|
393
|
+
'April',
|
|
394
|
+
'May',
|
|
395
|
+
'June',
|
|
396
|
+
'July',
|
|
397
|
+
'August',
|
|
398
|
+
'September',
|
|
399
|
+
'October',
|
|
400
|
+
'November',
|
|
401
|
+
'December',
|
|
402
|
+
];
|
|
403
|
+
|
|
404
|
+
const WEEKDAYS_EN = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
405
|
+
|
|
406
|
+
/** Month names in order, for the caption and its dropdown. */
|
|
407
|
+
export function monthNames(locale: DateLocale, style: 'long' | 'short' = 'long'): string[] {
|
|
408
|
+
return MONTHS_EN.map((fallback, month) => {
|
|
409
|
+
const formatted = formatGregory(new Date(2021, month, 1), locale, { month: style });
|
|
410
|
+
return formatted ?? (style === 'short' ? fallback.slice(0, 3) : fallback);
|
|
411
|
+
});
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
/** Column headings, rotated so the first one is `weekStartsOn`. */
|
|
415
|
+
export function weekdayNames(locale: DateLocale, weekStartsOn: number): string[] {
|
|
416
|
+
// 2021-08-01 was a Sunday, so adding the index lands on each weekday in turn.
|
|
417
|
+
return Array.from({ length: 7 }, (_unused, day) => {
|
|
418
|
+
const index = (day + weekStartsOn) % 7;
|
|
419
|
+
const formatted = formatGregory(new Date(2021, 7, 1 + index), locale, { weekday: 'short' });
|
|
420
|
+
return formatted ?? WEEKDAYS_EN[index]!;
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** "March 2026", for the caption. */
|
|
425
|
+
export function monthLabel(date: Date, locale: DateLocale): string {
|
|
426
|
+
return (
|
|
427
|
+
formatGregory(date, locale, { month: 'long', year: 'numeric' }) ??
|
|
428
|
+
`${MONTHS_EN[date.getMonth()]} ${date.getFullYear()}`
|
|
429
|
+
);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** "12 March 2026" — the whole date, for a screen reader to read out. */
|
|
433
|
+
export function longDate(date: Date, locale: DateLocale): string {
|
|
434
|
+
return (
|
|
435
|
+
formatGregory(date, locale, { weekday: 'long', day: 'numeric', month: 'long', year: 'numeric' }) ??
|
|
436
|
+
`${WEEKDAYS_EN[date.getDay()]} ${date.getDate()} ${MONTHS_EN[date.getMonth()]} ${date.getFullYear()}`
|
|
437
|
+
);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
/** "12 Mar 2026" — the compact form a trigger shows. */
|
|
441
|
+
export function shortDate(date: Date, locale: DateLocale): string {
|
|
442
|
+
return (
|
|
443
|
+
formatGregory(date, locale, { day: 'numeric', month: 'short', year: 'numeric' }) ??
|
|
444
|
+
`${date.getDate()} ${MONTHS_EN[date.getMonth()]!.slice(0, 3)} ${date.getFullYear()}`
|
|
445
|
+
);
|
|
446
|
+
}
|
package/theme.css
CHANGED
|
@@ -45,6 +45,17 @@
|
|
|
45
45
|
--color-card-foreground: unset;
|
|
46
46
|
--color-popover: unset;
|
|
47
47
|
--color-popover-foreground: unset;
|
|
48
|
+
/*
|
|
49
|
+
* The floating-panel surface, one notch further from the page than
|
|
50
|
+
* `--color-popover`. A menu is the thing furthest forward on the screen and
|
|
51
|
+
* usually the thing on top of a popover, so it needs a step of its own —
|
|
52
|
+
* without one a menu opened over a popover disappears into it.
|
|
53
|
+
*
|
|
54
|
+
* Kept separate from the `--color-surface-*` ladder because that ladder
|
|
55
|
+
* describes depth *within* the page, and this describes leaving it.
|
|
56
|
+
*/
|
|
57
|
+
--color-overlay: unset;
|
|
58
|
+
--color-overlay-foreground: unset;
|
|
48
59
|
--color-primary: unset;
|
|
49
60
|
--color-primary-foreground: unset;
|
|
50
61
|
--color-secondary: unset;
|
|
@@ -99,6 +110,22 @@
|
|
|
99
110
|
* These are the tokens to override in your app's global.css, after the
|
|
100
111
|
* `panelui-native/theme.css` import, to put a chart on brand.
|
|
101
112
|
*/
|
|
113
|
+
/*
|
|
114
|
+
* Syntax colours, for CodeBlock. A ramp of their own rather than the chart
|
|
115
|
+
* series: those only have to be told apart from one another, while these
|
|
116
|
+
* have to be legible as small monospace on a muted panel and to keep their
|
|
117
|
+
* conventional associations — a string is warm, a comment recedes.
|
|
118
|
+
*/
|
|
119
|
+
--color-code-keyword: unset;
|
|
120
|
+
--color-code-string: unset;
|
|
121
|
+
--color-code-number: unset;
|
|
122
|
+
--color-code-comment: unset;
|
|
123
|
+
--color-code-function: unset;
|
|
124
|
+
--color-code-property: unset;
|
|
125
|
+
--color-code-punctuation: unset;
|
|
126
|
+
--color-code-inserted: unset;
|
|
127
|
+
--color-code-deleted: unset;
|
|
128
|
+
|
|
102
129
|
--color-chart-1: unset;
|
|
103
130
|
--color-chart-2: unset;
|
|
104
131
|
--color-chart-3: unset;
|
|
@@ -133,6 +160,9 @@
|
|
|
133
160
|
--color-popover: #ffffff;
|
|
134
161
|
--color-popover-foreground: #262626;
|
|
135
162
|
|
|
163
|
+
--color-overlay: #ffffff;
|
|
164
|
+
--color-overlay-foreground: #262626;
|
|
165
|
+
|
|
136
166
|
--color-primary: #262626;
|
|
137
167
|
--color-primary-foreground: #fafafa;
|
|
138
168
|
|
|
@@ -182,6 +212,17 @@
|
|
|
182
212
|
--color-destructive-soft: rgba(239, 68, 68, 0.1);
|
|
183
213
|
--color-destructive-subtle: rgba(239, 68, 68, 0.08);
|
|
184
214
|
|
|
215
|
+
/* syntax colours */
|
|
216
|
+
--color-code-keyword: #8250df;
|
|
217
|
+
--color-code-string: #0a7d55;
|
|
218
|
+
--color-code-number: #0550ae;
|
|
219
|
+
--color-code-comment: #8b949e;
|
|
220
|
+
--color-code-function: #6639ba;
|
|
221
|
+
--color-code-property: #953800;
|
|
222
|
+
--color-code-punctuation: #57606a;
|
|
223
|
+
--color-code-inserted: #0a7d55;
|
|
224
|
+
--color-code-deleted: #cf222e;
|
|
225
|
+
|
|
185
226
|
/* chart series, in order of prominence */
|
|
186
227
|
--color-chart-1: #262626;
|
|
187
228
|
--color-chart-2: #3b82f6;
|
|
@@ -213,6 +254,10 @@
|
|
|
213
254
|
--color-popover: #1d1d1d;
|
|
214
255
|
--color-popover-foreground: #f5f5f5;
|
|
215
256
|
|
|
257
|
+
/* color-mix(background 92%, white) — one step past the popover */
|
|
258
|
+
--color-overlay: #232323;
|
|
259
|
+
--color-overlay-foreground: #f5f5f5;
|
|
260
|
+
|
|
216
261
|
--color-primary: #f5f5f5;
|
|
217
262
|
--color-primary-foreground: #262626;
|
|
218
263
|
|
|
@@ -266,6 +311,17 @@
|
|
|
266
311
|
--color-destructive-soft: rgba(241, 87, 87, 0.06);
|
|
267
312
|
--color-destructive-subtle: rgba(241, 87, 87, 0.16);
|
|
268
313
|
|
|
314
|
+
/* syntax colours */
|
|
315
|
+
--color-code-keyword: #d2a8ff;
|
|
316
|
+
--color-code-string: #7ee787;
|
|
317
|
+
--color-code-number: #79c0ff;
|
|
318
|
+
--color-code-comment: #8b949e;
|
|
319
|
+
--color-code-function: #d2a8ff;
|
|
320
|
+
--color-code-property: #ffa657;
|
|
321
|
+
--color-code-punctuation: #8b949e;
|
|
322
|
+
--color-code-inserted: #7ee787;
|
|
323
|
+
--color-code-deleted: #ff7b72;
|
|
324
|
+
|
|
269
325
|
/* chart series, in order of prominence */
|
|
270
326
|
--color-chart-1: #fafafa;
|
|
271
327
|
--color-chart-2: #60a5fa;
|
|
@@ -313,6 +369,9 @@
|
|
|
313
369
|
--color-popover: #ffffff;
|
|
314
370
|
--color-popover-foreground: #171717;
|
|
315
371
|
|
|
372
|
+
--color-overlay: #ffffff;
|
|
373
|
+
--color-overlay-foreground: #171717;
|
|
374
|
+
|
|
316
375
|
--color-primary: #171717;
|
|
317
376
|
--color-primary-foreground: #ffffff;
|
|
318
377
|
|
|
@@ -355,6 +414,17 @@
|
|
|
355
414
|
--color-destructive-soft: rgba(229, 72, 77, 0.1);
|
|
356
415
|
--color-destructive-subtle: rgba(229, 72, 77, 0.08);
|
|
357
416
|
|
|
417
|
+
/* syntax colours */
|
|
418
|
+
--color-code-keyword: #8250df;
|
|
419
|
+
--color-code-string: #0a7d55;
|
|
420
|
+
--color-code-number: #0550ae;
|
|
421
|
+
--color-code-comment: #8b949e;
|
|
422
|
+
--color-code-function: #6639ba;
|
|
423
|
+
--color-code-property: #953800;
|
|
424
|
+
--color-code-punctuation: #57606a;
|
|
425
|
+
--color-code-inserted: #0a7d55;
|
|
426
|
+
--color-code-deleted: #cf222e;
|
|
427
|
+
|
|
358
428
|
/* chart series, in order of prominence */
|
|
359
429
|
--color-chart-1: #0070f3;
|
|
360
430
|
--color-chart-2: #171717;
|
|
@@ -382,6 +452,9 @@
|
|
|
382
452
|
--color-popover: #101010;
|
|
383
453
|
--color-popover-foreground: #ededed;
|
|
384
454
|
|
|
455
|
+
--color-overlay: #191919;
|
|
456
|
+
--color-overlay-foreground: #ededed;
|
|
457
|
+
|
|
385
458
|
--color-primary: #ededed;
|
|
386
459
|
--color-primary-foreground: #0a0a0a;
|
|
387
460
|
|
|
@@ -424,6 +497,17 @@
|
|
|
424
497
|
--color-destructive-soft: rgba(229, 72, 77, 0.1);
|
|
425
498
|
--color-destructive-subtle: rgba(229, 72, 77, 0.16);
|
|
426
499
|
|
|
500
|
+
/* syntax colours */
|
|
501
|
+
--color-code-keyword: #d2a8ff;
|
|
502
|
+
--color-code-string: #7ee787;
|
|
503
|
+
--color-code-number: #79c0ff;
|
|
504
|
+
--color-code-comment: #8b949e;
|
|
505
|
+
--color-code-function: #d2a8ff;
|
|
506
|
+
--color-code-property: #ffa657;
|
|
507
|
+
--color-code-punctuation: #8b949e;
|
|
508
|
+
--color-code-inserted: #7ee787;
|
|
509
|
+
--color-code-deleted: #ff7b72;
|
|
510
|
+
|
|
427
511
|
/* chart series, in order of prominence */
|
|
428
512
|
--color-chart-1: #3291ff;
|
|
429
513
|
--color-chart-2: #ededed;
|
|
@@ -452,6 +536,9 @@
|
|
|
452
536
|
--color-popover: #ffffff;
|
|
453
537
|
--color-popover-foreground: #171717;
|
|
454
538
|
|
|
539
|
+
--color-overlay: #ffffff;
|
|
540
|
+
--color-overlay-foreground: #171717;
|
|
541
|
+
|
|
455
542
|
/* Brand green is too light for white text; light mode uses the
|
|
456
543
|
darker ramp step so the contrast ratio holds. */
|
|
457
544
|
--color-primary: #24b47e;
|
|
@@ -496,6 +583,17 @@
|
|
|
496
583
|
--color-destructive-soft: rgba(239, 68, 68, 0.1);
|
|
497
584
|
--color-destructive-subtle: rgba(239, 68, 68, 0.08);
|
|
498
585
|
|
|
586
|
+
/* syntax colours */
|
|
587
|
+
--color-code-keyword: #8250df;
|
|
588
|
+
--color-code-string: #0a7d55;
|
|
589
|
+
--color-code-number: #0550ae;
|
|
590
|
+
--color-code-comment: #8b949e;
|
|
591
|
+
--color-code-function: #6639ba;
|
|
592
|
+
--color-code-property: #953800;
|
|
593
|
+
--color-code-punctuation: #57606a;
|
|
594
|
+
--color-code-inserted: #0a7d55;
|
|
595
|
+
--color-code-deleted: #cf222e;
|
|
596
|
+
|
|
499
597
|
/* chart series, in order of prominence */
|
|
500
598
|
--color-chart-1: #24b47e;
|
|
501
599
|
--color-chart-2: #1f2937;
|
|
@@ -523,6 +621,9 @@
|
|
|
523
621
|
--color-popover: #232323;
|
|
524
622
|
--color-popover-foreground: #ededed;
|
|
525
623
|
|
|
624
|
+
--color-overlay: #2a2a2a;
|
|
625
|
+
--color-overlay-foreground: #ededed;
|
|
626
|
+
|
|
526
627
|
--color-primary: #3ecf8e;
|
|
527
628
|
--color-primary-foreground: #052e1b;
|
|
528
629
|
|
|
@@ -565,6 +666,17 @@
|
|
|
565
666
|
--color-destructive-soft: rgba(241, 87, 87, 0.08);
|
|
566
667
|
--color-destructive-subtle: rgba(241, 87, 87, 0.16);
|
|
567
668
|
|
|
669
|
+
/* syntax colours */
|
|
670
|
+
--color-code-keyword: #d2a8ff;
|
|
671
|
+
--color-code-string: #7ee787;
|
|
672
|
+
--color-code-number: #79c0ff;
|
|
673
|
+
--color-code-comment: #8b949e;
|
|
674
|
+
--color-code-function: #d2a8ff;
|
|
675
|
+
--color-code-property: #ffa657;
|
|
676
|
+
--color-code-punctuation: #8b949e;
|
|
677
|
+
--color-code-inserted: #7ee787;
|
|
678
|
+
--color-code-deleted: #ff7b72;
|
|
679
|
+
|
|
568
680
|
/* chart series, in order of prominence */
|
|
569
681
|
--color-chart-1: #3ecf8e;
|
|
570
682
|
--color-chart-2: #ededed;
|