@sixthshift/design-system 0.2.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/README.md +135 -28
- package/dist/components/Badge/Badge.d.ts +5 -2
- package/dist/components/Badge/Badge.d.ts.map +1 -1
- package/dist/components/Badge/Badge.js +5 -3
- package/dist/components/Badge/Badge.js.map +1 -1
- package/dist/components/BarChart/BarChart.d.ts +8 -2
- package/dist/components/BarChart/BarChart.d.ts.map +1 -1
- package/dist/components/BarChart/BarChart.js +5 -3
- package/dist/components/BarChart/BarChart.js.map +1 -1
- package/dist/components/Calendar/Calendar.d.ts +17 -1
- package/dist/components/Calendar/Calendar.d.ts.map +1 -1
- package/dist/components/Calendar/Calendar.js +80 -225
- package/dist/components/Calendar/Calendar.js.map +1 -1
- package/dist/components/Calendar/CalendarView.d.ts +15 -0
- package/dist/components/Calendar/CalendarView.d.ts.map +1 -0
- package/dist/components/Calendar/CalendarView.js +255 -0
- package/dist/components/Calendar/CalendarView.js.map +1 -0
- package/dist/components/Calendar/calendar.types.d.ts +78 -27
- package/dist/components/Calendar/calendar.types.d.ts.map +1 -1
- package/dist/components/Calendar/calendar.types.js +10 -3
- package/dist/components/Calendar/calendar.types.js.map +1 -1
- package/dist/components/Calendar/index.d.ts +16 -2
- package/dist/components/Calendar/index.d.ts.map +1 -1
- package/dist/components/Calendar/index.js +15 -1
- package/dist/components/Calendar/index.js.map +1 -1
- package/dist/components/ColorDot/ColorDot.d.ts +9 -3
- package/dist/components/ColorDot/ColorDot.d.ts.map +1 -1
- package/dist/components/ColorDot/ColorDot.js +5 -3
- package/dist/components/ColorDot/ColorDot.js.map +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +2 -2
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/DatePicker/DatePicker.js +65 -10
- package/dist/components/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/DatePicker/datepicker.types.d.ts +34 -36
- package/dist/components/DatePicker/datepicker.types.d.ts.map +1 -1
- package/dist/components/DatePicker/datepicker.types.js +5 -3
- package/dist/components/DatePicker/datepicker.types.js.map +1 -1
- package/dist/components/DatePicker/index.d.ts +10 -1
- package/dist/components/DatePicker/index.d.ts.map +1 -1
- package/dist/components/DatePicker/index.js +8 -0
- package/dist/components/DatePicker/index.js.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +3 -2
- package/dist/components/DateRangePicker/DateRangePicker.d.ts.map +1 -1
- package/dist/components/DateRangePicker/DateRangePicker.js +17 -21
- package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
- package/dist/components/DateRangePicker/daterangepicker.types.d.ts +20 -20
- package/dist/components/DateRangePicker/daterangepicker.types.d.ts.map +1 -1
- package/dist/components/DateRangePicker/daterangepicker.types.js +6 -0
- package/dist/components/DateRangePicker/daterangepicker.types.js.map +1 -1
- package/dist/components/DateRangePicker/index.d.ts +8 -1
- package/dist/components/DateRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateRangePicker/index.js +6 -0
- package/dist/components/DateRangePicker/index.js.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +3 -3
- package/dist/components/DateTimePicker/DateTimePicker.d.ts.map +1 -1
- package/dist/components/DateTimePicker/DateTimePicker.js +30 -12
- package/dist/components/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/components/DateTimePicker/datetimepicker.types.d.ts +20 -17
- package/dist/components/DateTimePicker/datetimepicker.types.d.ts.map +1 -1
- package/dist/components/DateTimePicker/datetimepicker.types.js +10 -0
- package/dist/components/DateTimePicker/datetimepicker.types.js.map +1 -1
- package/dist/components/DateTimePicker/index.d.ts +8 -1
- package/dist/components/DateTimePicker/index.d.ts.map +1 -1
- package/dist/components/DateTimePicker/index.js +6 -0
- package/dist/components/DateTimePicker/index.js.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +3 -3
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +41 -20
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts +22 -18
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js +8 -0
- package/dist/components/DateTimeRangePicker/datetimerangepicker.types.js.map +1 -1
- package/dist/components/DateTimeRangePicker/index.d.ts +8 -0
- package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/index.js +7 -0
- package/dist/components/DateTimeRangePicker/index.js.map +1 -1
- package/dist/components/EmptyState/EmptyState.d.ts +16 -5
- package/dist/components/EmptyState/EmptyState.d.ts.map +1 -1
- package/dist/components/EmptyState/EmptyState.js +5 -3
- package/dist/components/EmptyState/EmptyState.js.map +1 -1
- package/dist/components/Field/Field.d.ts +3 -3
- package/dist/components/Field/Field.d.ts.map +1 -1
- package/dist/components/Field/Field.js +6 -4
- package/dist/components/Field/Field.js.map +1 -1
- package/dist/components/LineChart/LineChart.d.ts +18 -2
- package/dist/components/LineChart/LineChart.d.ts.map +1 -1
- package/dist/components/LineChart/LineChart.js +5 -3
- package/dist/components/LineChart/LineChart.js.map +1 -1
- package/dist/components/Markdown/Markdown.d.ts +2 -4
- package/dist/components/Markdown/Markdown.d.ts.map +1 -1
- package/dist/components/Markdown/Markdown.js +3 -2
- package/dist/components/Markdown/Markdown.js.map +1 -1
- package/dist/components/Message/Message.d.ts.map +1 -1
- package/dist/components/Message/Message.js +16 -1
- package/dist/components/Message/Message.js.map +1 -1
- package/dist/components/MetricList/MetricList.d.ts +3 -3
- package/dist/components/MetricList/MetricList.d.ts.map +1 -1
- package/dist/components/MetricList/MetricList.js +5 -3
- package/dist/components/MetricList/MetricList.js.map +1 -1
- package/dist/components/Modal/Modal.d.ts +24 -5
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +16 -6
- package/dist/components/Modal/Modal.js.map +1 -1
- package/dist/components/Modal/components/ModalContext.d.ts +14 -0
- package/dist/components/Modal/components/ModalContext.d.ts.map +1 -1
- package/dist/components/Modal/components/ModalContext.js.map +1 -1
- package/dist/components/Modal/components/ModalHeader.d.ts.map +1 -1
- package/dist/components/Modal/components/ModalHeader.js +13 -2
- package/dist/components/Modal/components/ModalHeader.js.map +1 -1
- package/dist/components/NavBottom/NavBottom.d.ts +2 -1
- package/dist/components/NavBottom/NavBottom.d.ts.map +1 -1
- package/dist/components/NavBottom/NavBottom.js +6 -4
- package/dist/components/NavBottom/NavBottom.js.map +1 -1
- package/dist/components/NavSide/NavItem.js +1 -1
- package/dist/components/NavSide/NavItem.js.map +1 -1
- package/dist/components/NavSide/NavSide.d.ts +2 -1
- package/dist/components/NavSide/NavSide.d.ts.map +1 -1
- package/dist/components/NavSide/NavSide.js +5 -3
- package/dist/components/NavSide/NavSide.js.map +1 -1
- package/dist/components/Popover/Popover.d.ts.map +1 -1
- package/dist/components/Popover/Popover.js +7 -0
- package/dist/components/Popover/Popover.js.map +1 -1
- package/dist/components/Popover/components/PopoverBody.d.ts.map +1 -1
- package/dist/components/Popover/components/PopoverBody.js +5 -2
- package/dist/components/Popover/components/PopoverBody.js.map +1 -1
- package/dist/components/Popover/components/PopoverContext.d.ts +1 -0
- package/dist/components/Popover/components/PopoverContext.d.ts.map +1 -1
- package/dist/components/Popover/components/PopoverContext.js.map +1 -1
- package/dist/components/Popover/components/PopoverTrigger.d.ts.map +1 -1
- package/dist/components/Popover/components/PopoverTrigger.js +2 -2
- package/dist/components/Popover/components/PopoverTrigger.js.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts +2 -1
- package/dist/components/ProgressBar/ProgressBar.d.ts.map +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +5 -3
- package/dist/components/ProgressBar/ProgressBar.js.map +1 -1
- package/dist/components/Select/Select.d.ts +11 -2
- package/dist/components/Select/Select.d.ts.map +1 -1
- package/dist/components/Select/Select.js +64 -18
- package/dist/components/Select/Select.js.map +1 -1
- package/dist/components/Select/SelectDropdown.d.ts +14 -2
- package/dist/components/Select/SelectDropdown.d.ts.map +1 -1
- package/dist/components/Select/SelectDropdown.js +19 -4
- package/dist/components/Select/SelectDropdown.js.map +1 -1
- package/dist/components/Select/SelectTrigger.d.ts +10 -3
- package/dist/components/Select/SelectTrigger.d.ts.map +1 -1
- package/dist/components/Select/SelectTrigger.js +12 -3
- package/dist/components/Select/SelectTrigger.js.map +1 -1
- package/dist/components/Select/useSelectKeyboard.d.ts +15 -1
- package/dist/components/Select/useSelectKeyboard.d.ts.map +1 -1
- package/dist/components/Select/useSelectKeyboard.js +73 -65
- package/dist/components/Select/useSelectKeyboard.js.map +1 -1
- package/dist/components/Sheet/Sheet.d.ts +19 -5
- package/dist/components/Sheet/Sheet.d.ts.map +1 -1
- package/dist/components/Sheet/Sheet.js +18 -6
- package/dist/components/Sheet/Sheet.js.map +1 -1
- package/dist/components/Sheet/components/SheetContext.d.ts +10 -0
- package/dist/components/Sheet/components/SheetContext.d.ts.map +1 -1
- package/dist/components/Sheet/components/SheetContext.js.map +1 -1
- package/dist/components/Sheet/components/SheetHeader.d.ts.map +1 -1
- package/dist/components/Sheet/components/SheetHeader.js +11 -2
- package/dist/components/Sheet/components/SheetHeader.js.map +1 -1
- package/dist/components/Skeleton/Skeleton.d.ts +2 -1
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/Skeleton/Skeleton.js +5 -3
- package/dist/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/Sparkline/Sparkline.d.ts +10 -2
- package/dist/components/Sparkline/Sparkline.d.ts.map +1 -1
- package/dist/components/Sparkline/Sparkline.js +5 -3
- package/dist/components/Sparkline/Sparkline.js.map +1 -1
- package/dist/components/StatsCard/StatsCard.d.ts +4 -4
- package/dist/components/StatsCard/StatsCard.d.ts.map +1 -1
- package/dist/components/StatsCard/StatsCard.js +5 -3
- package/dist/components/StatsCard/StatsCard.js.map +1 -1
- package/dist/components/Tabs/Tabs.d.ts +2 -2
- package/dist/components/Tabs/components/TabsList.d.ts +1 -1
- package/dist/components/Tabs/components/TabsList.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabsList.js +5 -4
- package/dist/components/Tabs/components/TabsList.js.map +1 -1
- package/dist/components/Tabs/components/TabsPanels.d.ts +1 -1
- package/dist/components/Tabs/components/TabsPanels.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabsPanels.js +5 -3
- package/dist/components/Tabs/components/TabsPanels.js.map +1 -1
- package/dist/components/TagChip/TagChip.d.ts +2 -1
- package/dist/components/TagChip/TagChip.d.ts.map +1 -1
- package/dist/components/TagChip/TagChip.js +5 -3
- package/dist/components/TagChip/TagChip.js.map +1 -1
- package/dist/components/TagInput/TagInput.d.ts +1 -1
- package/dist/components/TagInput/TagInput.d.ts.map +1 -1
- package/dist/components/TagInput/TagInput.js +5 -4
- package/dist/components/TagInput/TagInput.js.map +1 -1
- package/dist/components/TimePicker/TimePicker.d.ts +2 -2
- package/dist/components/TimePicker/TimePicker.d.ts.map +1 -1
- package/dist/components/TimePicker/TimePicker.js +27 -11
- package/dist/components/TimePicker/TimePicker.js.map +1 -1
- package/dist/components/TimePicker/timepicker.types.d.ts +14 -13
- package/dist/components/TimePicker/timepicker.types.d.ts.map +1 -1
- package/dist/components/TimePicker/timepicker.types.js +4 -3
- package/dist/components/TimePicker/timepicker.types.js.map +1 -1
- package/dist/date-time/index.d.ts +2 -0
- package/dist/date-time/index.d.ts.map +1 -1
- package/dist/date-time/index.js +9 -0
- package/dist/date-time/index.js.map +1 -1
- package/dist/date-time/iso.d.ts +261 -0
- package/dist/date-time/iso.d.ts.map +1 -0
- package/dist/date-time/iso.js +358 -0
- package/dist/date-time/iso.js.map +1 -0
- package/dist/date-time/now.d.ts +7 -6
- package/dist/date-time/now.d.ts.map +1 -1
- package/dist/date-time/now.js +3 -3
- package/dist/date-time/now.js.map +1 -1
- package/dist/theme/index.d.ts +4 -3
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +3 -2
- package/dist/theme/index.js.map +1 -1
- package/dist/theme/schema.d.ts +70 -32
- package/dist/theme/schema.d.ts.map +1 -1
- package/dist/theme/schema.js +36 -18
- package/dist/theme/schema.js.map +1 -1
- package/package.json +9 -15
- package/src/components/Badge/Badge.tsx +5 -4
- package/src/components/BarChart/BarChart.tsx +25 -30
- package/src/components/Calendar/Calendar.tsx +91 -401
- package/src/components/Calendar/CalendarView.tsx +445 -0
- package/src/components/Calendar/calendar.types.ts +94 -29
- package/src/components/Calendar/index.ts +16 -17
- package/src/components/ColorDot/ColorDot.tsx +6 -4
- package/src/components/DatePicker/DatePicker.tsx +92 -16
- package/src/components/DatePicker/datepicker.types.ts +38 -39
- package/src/components/DatePicker/index.ts +11 -10
- package/src/components/DateRangePicker/DateRangePicker.tsx +17 -21
- package/src/components/DateRangePicker/daterangepicker.types.ts +22 -22
- package/src/components/DateRangePicker/index.ts +9 -1
- package/src/components/DateTimePicker/DateTimePicker.tsx +46 -18
- package/src/components/DateTimePicker/datetimepicker.types.ts +22 -18
- package/src/components/DateTimePicker/index.ts +9 -1
- package/src/components/DateTimeRangePicker/DateTimeRangePicker.tsx +62 -28
- package/src/components/DateTimeRangePicker/datetimerangepicker.types.ts +24 -19
- package/src/components/DateTimeRangePicker/index.ts +9 -0
- package/src/components/EmptyState/EmptyState.tsx +8 -7
- package/src/components/Field/Field.tsx +7 -6
- package/src/components/LineChart/LineChart.tsx +147 -141
- package/src/components/Markdown/Markdown.tsx +4 -3
- package/src/components/Message/Message.tsx +17 -1
- package/src/components/MetricList/MetricList.tsx +10 -5
- package/src/components/Modal/Modal.tsx +119 -87
- package/src/components/Modal/components/ModalContext.tsx +14 -0
- package/src/components/Modal/components/ModalHeader.tsx +14 -2
- package/src/components/NavBottom/NavBottom.tsx +6 -4
- package/src/components/NavSide/NavItem.tsx +1 -1
- package/src/components/NavSide/NavSide.tsx +5 -3
- package/src/components/Popover/Popover.tsx +7 -0
- package/src/components/Popover/components/PopoverBody.tsx +6 -1
- package/src/components/Popover/components/PopoverContext.tsx +1 -0
- package/src/components/Popover/components/PopoverTrigger.tsx +2 -1
- package/src/components/ProgressBar/ProgressBar.tsx +32 -28
- package/src/components/Select/Select.tsx +76 -19
- package/src/components/Select/SelectDropdown.tsx +32 -3
- package/src/components/Select/SelectTrigger.tsx +26 -3
- package/src/components/Select/useSelectKeyboard.ts +20 -10
- package/src/components/Sheet/Sheet.tsx +108 -83
- package/src/components/Sheet/components/SheetContext.tsx +10 -0
- package/src/components/Sheet/components/SheetHeader.tsx +17 -2
- package/src/components/Skeleton/Skeleton.tsx +5 -3
- package/src/components/Sparkline/Sparkline.tsx +29 -36
- package/src/components/StatsCard/StatsCard.tsx +7 -6
- package/src/components/Tabs/components/TabsList.tsx +5 -3
- package/src/components/Tabs/components/TabsPanels.tsx +5 -3
- package/src/components/TagChip/TagChip.tsx +10 -3
- package/src/components/TagInput/TagInput.tsx +5 -3
- package/src/components/TimePicker/TimePicker.tsx +31 -13
- package/src/components/TimePicker/timepicker.types.ts +14 -13
- package/src/date-time/index.ts +61 -0
- package/src/date-time/iso.ts +511 -0
- package/src/date-time/now.ts +10 -9
- package/src/theme/index.ts +11 -3
- package/src/theme/schema.ts +82 -54
- package/src/theme/tokens.css +807 -0
- package/dist/styles.css +0 -2
- package/dist/theme.generated.css +0 -438
- package/src/styles/base.css +0 -41
- package/src/theme/palette.json +0 -100
- package/src/theme/palette.schema.json +0 -40
- package/src/theme/theme.json +0 -349
- package/src/theme/theme.schema.json +0 -876
- package/src/theme/typography.json +0 -7
- package/src/theme/typography.schema.json +0 -36
- package/tailwind.config.ts +0 -261
package/dist/date-time/now.d.ts
CHANGED
|
@@ -4,22 +4,23 @@
|
|
|
4
4
|
* Functions that answer "what time/date is it right now?"
|
|
5
5
|
*/
|
|
6
6
|
import { Temporal } from "@js-temporal/polyfill";
|
|
7
|
+
import type { ISODate, ISODateTime, ISOInstant } from "./iso.js";
|
|
7
8
|
/**
|
|
8
9
|
* Get the current instant (point in time)
|
|
9
10
|
*/
|
|
10
11
|
export declare function now(): Temporal.Instant;
|
|
11
12
|
/**
|
|
12
|
-
* Get the current instant as
|
|
13
|
+
* Get the current instant as a canonical ISO 8601 string (UTC, `...Z`)
|
|
13
14
|
*/
|
|
14
|
-
export declare function nowISO():
|
|
15
|
+
export declare function nowISO(): ISOInstant;
|
|
15
16
|
/**
|
|
16
17
|
* Get today's date in the system timezone
|
|
17
18
|
*/
|
|
18
19
|
export declare function today(): Temporal.PlainDate;
|
|
19
20
|
/**
|
|
20
|
-
* Get today's date as
|
|
21
|
+
* Get today's date as a canonical ISO 8601 string (`YYYY-MM-DD`)
|
|
21
22
|
*/
|
|
22
|
-
export declare function todayISO():
|
|
23
|
+
export declare function todayISO(): ISODate;
|
|
23
24
|
/**
|
|
24
25
|
* Get the current time in the system timezone
|
|
25
26
|
*/
|
|
@@ -29,9 +30,9 @@ export declare function currentTime(): Temporal.PlainTime;
|
|
|
29
30
|
*/
|
|
30
31
|
export declare function nowDateTime(): Temporal.PlainDateTime;
|
|
31
32
|
/**
|
|
32
|
-
* Get the current date/time as
|
|
33
|
+
* Get the current date/time as a canonical ISO 8601 string (no timezone)
|
|
33
34
|
*/
|
|
34
|
-
export declare function nowDateTimeISO():
|
|
35
|
+
export declare function nowDateTimeISO(): ISODateTime;
|
|
35
36
|
/**
|
|
36
37
|
* Get the current zoned date/time in the system timezone
|
|
37
38
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"now.d.ts","sourceRoot":"","sources":["../../src/date-time/now.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"now.d.ts","sourceRoot":"","sources":["../../src/date-time/now.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE9D;;GAEG;AACH,wBAAgB,GAAG,IAAI,QAAQ,CAAC,OAAO,CAEtC;AAED;;GAEG;AACH,wBAAgB,MAAM,IAAI,UAAU,CAEnC;AAED;;GAEG;AACH,wBAAgB,KAAK,IAAI,QAAQ,CAAC,SAAS,CAE1C;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,OAAO,CAElC;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,SAAS,CAEhD;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,QAAQ,CAAC,aAAa,CAEpD;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED;;GAEG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAAC,aAAa,CAEjD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAC,aAAa,CAEtE"}
|
package/dist/date-time/now.js
CHANGED
|
@@ -11,7 +11,7 @@ export function now() {
|
|
|
11
11
|
return Temporal.Now.instant();
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Get the current instant as
|
|
14
|
+
* Get the current instant as a canonical ISO 8601 string (UTC, `...Z`)
|
|
15
15
|
*/
|
|
16
16
|
export function nowISO() {
|
|
17
17
|
return Temporal.Now.instant().toString();
|
|
@@ -23,7 +23,7 @@ export function today() {
|
|
|
23
23
|
return Temporal.Now.plainDateISO();
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Get today's date as
|
|
26
|
+
* Get today's date as a canonical ISO 8601 string (`YYYY-MM-DD`)
|
|
27
27
|
*/
|
|
28
28
|
export function todayISO() {
|
|
29
29
|
return Temporal.Now.plainDateISO().toString();
|
|
@@ -41,7 +41,7 @@ export function nowDateTime() {
|
|
|
41
41
|
return Temporal.Now.plainDateTimeISO();
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Get the current date/time as
|
|
44
|
+
* Get the current date/time as a canonical ISO 8601 string (no timezone)
|
|
45
45
|
*/
|
|
46
46
|
export function nowDateTimeISO() {
|
|
47
47
|
return Temporal.Now.plainDateTimeISO().toString();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"now.js","sourceRoot":"","sources":["../../src/date-time/now.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"now.js","sourceRoot":"","sources":["../../src/date-time/now.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD;;GAEG;AACH,MAAM,UAAU,GAAG;IACjB,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;AAChC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAgB,CAAC;AACzD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,KAAK;IACnB,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC,QAAQ,EAAa,CAAC;AAC3D,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,QAAQ,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,QAAQ,EAAiB,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ;IACtB,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC;AACzC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/theme/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Exports
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* The token naming vocabulary and its types. Token *values* live in
|
|
5
|
+
* src/theme/tokens.css and are read from the stylesheet, not from here.
|
|
5
6
|
*/
|
|
6
|
-
export type { BgKey, BgToken, BorderKey, BorderToken, ColorMode, ColorModeSchema, ColorToken, Context, CSSVarName, Feedback, FgKey, FgToken, HexValue, Hierarchy, HSLValue, Semantic, ThemeSchema, TokenKey, } from "./schema.js";
|
|
7
|
-
export { contexts, cssVar, feedback,
|
|
7
|
+
export type { BgKey, BgToken, BorderKey, BorderToken, ColorMode, ColorModeSchema, ColorToken, Context, CSSVarName, Feedback, FgKey, FgToken, HexValue, Hierarchy, HSLValue, Intent, Semantic, StandaloneToken, State, ThemeSchema, TokenKey, TokenName, Weight, } from "./schema.js";
|
|
8
|
+
export { contexts, cssVar, feedback, hierarchy, hsl, intents, semantics, standaloneTokens, states, weights, } from "./schema.js";
|
|
8
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EACV,KAAK,EACL,OAAO,EACP,SAAS,EACT,WAAW,EACX,SAAS,EACT,eAAe,EACf,UAAU,EACV,OAAO,EACP,UAAU,EACV,QAAQ,EACR,KAAK,EACL,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,eAAe,EACf,KAAK,EACL,WAAW,EACX,QAAQ,EACR,SAAS,EACT,MAAM,GACP,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,EACH,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,OAAO,GACR,MAAM,UAAU,CAAC"}
|
package/dist/theme/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Exports
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* The token naming vocabulary and its types. Token *values* live in
|
|
5
|
+
* src/theme/tokens.css and are read from the stylesheet, not from here.
|
|
5
6
|
*/
|
|
6
|
-
export { contexts, cssVar, feedback,
|
|
7
|
+
export { contexts, cssVar, feedback, hierarchy, hsl, intents, semantics, standaloneTokens, states, weights, } from "./schema.js";
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/theme/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/theme/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA4BH,OAAO,EACL,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,SAAS,EACT,GAAG,EACH,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,MAAM,EACN,OAAO,GACR,MAAM,UAAU,CAAC"}
|
package/dist/theme/schema.d.ts
CHANGED
|
@@ -1,13 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Schema
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The naming convention for design tokens, as types and as data:
|
|
5
|
+
*
|
|
6
|
+
* {context}-[on-]{intent}[-{weight}][-{state}]
|
|
7
|
+
*
|
|
8
|
+
* src/theme/tokens.css is the only place tokens are defined, and nothing derives
|
|
9
|
+
* TypeScript from it. These types describe the *shape* a token name can take
|
|
10
|
+
* rather than enumerating the names that happen to exist today, which is why the
|
|
11
|
+
* vocabulary below is the thing to edit when the system grows a new axis.
|
|
12
|
+
*
|
|
13
|
+
* The trade that makes explicit: the union is complete but permissive. Every real
|
|
14
|
+
* token is assignable, and a few combinations it accepts are not defined. Keeping
|
|
15
|
+
* this vocabulary and tokens.css describing the same system is a manual job — a
|
|
16
|
+
* token whose name falls outside the grid below is unnameable in TypeScript even
|
|
17
|
+
* though its utility compiles.
|
|
18
|
+
*
|
|
19
|
+
* To read a value, read the CSS: `var(--bg-brand)` in a stylesheet, or
|
|
20
|
+
* `getComputedStyle(document.documentElement).getPropertyValue("--bg-brand")`
|
|
21
|
+
* at runtime.
|
|
6
22
|
*/
|
|
7
|
-
/** HSL color value without wrapper, e.g., "239 84% 67%" */
|
|
8
|
-
export type HSLValue = string;
|
|
9
23
|
/** Hex color value, e.g., "#6366f1" */
|
|
10
24
|
export type HexValue = string;
|
|
25
|
+
/**
|
|
26
|
+
* HSL color value without wrapper, e.g., "239 84% 67%"
|
|
27
|
+
*
|
|
28
|
+
* @deprecated Tokens hold hex values and palette references, never bare HSL
|
|
29
|
+
* triples. Kept only so the export surface stays stable.
|
|
30
|
+
*/
|
|
31
|
+
export type HSLValue = string;
|
|
11
32
|
/** Color mode */
|
|
12
33
|
export type ColorMode = "light" | "dark";
|
|
13
34
|
/** Contexts - what CSS property this affects */
|
|
@@ -22,44 +43,61 @@ export type Feedback = (typeof feedback)[number];
|
|
|
22
43
|
/** All semantics */
|
|
23
44
|
export declare const semantics: readonly ["strong", "normal", "subtle", "success", "warning", "danger"];
|
|
24
45
|
export type Semantic = (typeof semantics)[number];
|
|
25
|
-
/**
|
|
26
|
-
export
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export type
|
|
46
|
+
/** Every intent a token can carry, including the ones outside the grid above */
|
|
47
|
+
export declare const intents: readonly ["strong", "normal", "subtle", "success", "warning", "danger", "brand", "overlay"];
|
|
48
|
+
export type Intent = (typeof intents)[number];
|
|
49
|
+
/** Weight modifiers, applied to brand and feedback intents */
|
|
50
|
+
export declare const weights: readonly ["subtle", "strong"];
|
|
51
|
+
export type Weight = (typeof weights)[number];
|
|
52
|
+
/** Interaction states */
|
|
53
|
+
export declare const states: readonly ["hovered", "pressed", "disabled"];
|
|
54
|
+
export type State = (typeof states)[number];
|
|
55
|
+
/** Tokens that are a category of one, outside the grid */
|
|
56
|
+
export declare const standaloneTokens: readonly ["focus-ring"];
|
|
57
|
+
export type StandaloneToken = (typeof standaloneTokens)[number];
|
|
58
|
+
/** Intents that take a weight modifier — the hierarchy trio *is* the weight. */
|
|
59
|
+
type Weightable = Exclude<Intent, Hierarchy>;
|
|
60
|
+
/** `brand` | `brand-subtle` | `danger-strong` | ... */
|
|
61
|
+
type WeightedIntent = Intent | `${Weightable}-${Weight}`;
|
|
62
|
+
/** Any of the above, optionally in an interaction state */
|
|
63
|
+
type Stateful<T extends string> = T | `${T}-${State}`;
|
|
64
|
+
/** Background tokens */
|
|
65
|
+
export type BgToken = Stateful<`bg-${WeightedIntent}`>;
|
|
66
|
+
/** Foreground tokens, including the `fg-on-*` pairs */
|
|
67
|
+
export type FgToken = Stateful<`fg-${WeightedIntent}`> | Stateful<`fg-on-${WeightedIntent}`>;
|
|
68
|
+
/** Border tokens */
|
|
69
|
+
export type BorderToken = Stateful<`border-${WeightedIntent}`>;
|
|
70
|
+
/** Every token name the convention allows */
|
|
71
|
+
export type TokenName = BgToken | FgToken | BorderToken | StandaloneToken;
|
|
31
72
|
/** All color tokens */
|
|
32
|
-
export type ColorToken =
|
|
73
|
+
export type ColorToken = TokenName;
|
|
33
74
|
/** CSS variable name format */
|
|
34
75
|
export type CSSVarName = `--${ColorToken}`;
|
|
35
|
-
/**
|
|
36
|
-
export type BgKey =
|
|
37
|
-
/**
|
|
38
|
-
export type FgKey =
|
|
39
|
-
/**
|
|
40
|
-
export type BorderKey =
|
|
41
|
-
/**
|
|
42
|
-
export type TokenKey =
|
|
43
|
-
/**
|
|
44
|
-
export type ColorModeSchema =
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
/** Complete theme schema */
|
|
76
|
+
/** @deprecated Use {@link BgToken}. */
|
|
77
|
+
export type BgKey = BgToken;
|
|
78
|
+
/** @deprecated Use {@link FgToken}. */
|
|
79
|
+
export type FgKey = FgToken;
|
|
80
|
+
/** @deprecated Use {@link BorderToken}. */
|
|
81
|
+
export type BorderKey = BorderToken;
|
|
82
|
+
/** @deprecated Use {@link TokenName}. */
|
|
83
|
+
export type TokenKey = TokenName;
|
|
84
|
+
/** A set of token values for one mode */
|
|
85
|
+
export type ColorModeSchema = Partial<Record<TokenName, HexValue>>;
|
|
86
|
+
/** A complete theme */
|
|
48
87
|
export type ThemeSchema = {
|
|
49
|
-
$schema?: string;
|
|
50
88
|
name: string;
|
|
51
89
|
version: string;
|
|
52
90
|
light: ColorModeSchema;
|
|
53
91
|
dark: ColorModeSchema;
|
|
54
92
|
};
|
|
55
|
-
/** Get all token names for a context */
|
|
56
|
-
export declare function getTokenNames(context: "bg"): BgToken[];
|
|
57
|
-
export declare function getTokenNames(context: "fg"): FgToken[];
|
|
58
|
-
export declare function getTokenNames(context: "border"): BorderToken[];
|
|
59
|
-
/** Get all token names */
|
|
60
|
-
export declare function getAllTokenNames(): ColorToken[];
|
|
61
93
|
/** Type-safe CSS var reference */
|
|
62
94
|
export declare function cssVar(token: ColorToken): string;
|
|
63
|
-
/**
|
|
95
|
+
/**
|
|
96
|
+
* Type-safe HSL wrapper for Tailwind
|
|
97
|
+
*
|
|
98
|
+
* @deprecated Token values are hex and palette references, so wrapping one in
|
|
99
|
+
* `hsl()` yields invalid CSS. Use {@link cssVar}.
|
|
100
|
+
*/
|
|
64
101
|
export declare function hsl(token: ColorToken): string;
|
|
102
|
+
export {};
|
|
65
103
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/theme/schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/theme/schema.ts"],"names":[],"mappings":"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"}
|
package/dist/theme/schema.js
CHANGED
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Theme Schema
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* The naming convention for design tokens, as types and as data:
|
|
5
|
+
*
|
|
6
|
+
* {context}-[on-]{intent}[-{weight}][-{state}]
|
|
7
|
+
*
|
|
8
|
+
* src/theme/tokens.css is the only place tokens are defined, and nothing derives
|
|
9
|
+
* TypeScript from it. These types describe the *shape* a token name can take
|
|
10
|
+
* rather than enumerating the names that happen to exist today, which is why the
|
|
11
|
+
* vocabulary below is the thing to edit when the system grows a new axis.
|
|
12
|
+
*
|
|
13
|
+
* The trade that makes explicit: the union is complete but permissive. Every real
|
|
14
|
+
* token is assignable, and a few combinations it accepts are not defined. Keeping
|
|
15
|
+
* this vocabulary and tokens.css describing the same system is a manual job — a
|
|
16
|
+
* token whose name falls outside the grid below is unnameable in TypeScript even
|
|
17
|
+
* though its utility compiles.
|
|
18
|
+
*
|
|
19
|
+
* To read a value, read the CSS: `var(--bg-brand)` in a stylesheet, or
|
|
20
|
+
* `getComputedStyle(document.documentElement).getPropertyValue("--bg-brand")`
|
|
21
|
+
* at runtime.
|
|
6
22
|
*/
|
|
7
23
|
// =============================================================================
|
|
8
|
-
//
|
|
24
|
+
// VOCABULARY
|
|
9
25
|
// =============================================================================
|
|
10
26
|
/** Contexts - what CSS property this affects */
|
|
11
27
|
export const contexts = ["bg", "fg", "border"];
|
|
@@ -15,25 +31,27 @@ export const hierarchy = ["strong", "normal", "subtle"];
|
|
|
15
31
|
export const feedback = ["success", "warning", "danger"];
|
|
16
32
|
/** All semantics */
|
|
17
33
|
export const semantics = [...hierarchy, ...feedback];
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export function getAllTokenNames() {
|
|
30
|
-
return [...getTokenNames("bg"), ...getTokenNames("fg"), ...getTokenNames("border")];
|
|
31
|
-
}
|
|
34
|
+
/** Every intent a token can carry, including the ones outside the grid above */
|
|
35
|
+
export const intents = [...semantics, "brand", "overlay"];
|
|
36
|
+
/** Weight modifiers, applied to brand and feedback intents */
|
|
37
|
+
export const weights = ["subtle", "strong"];
|
|
38
|
+
/** Interaction states */
|
|
39
|
+
export const states = ["hovered", "pressed", "disabled"];
|
|
40
|
+
/** Tokens that are a category of one, outside the grid */
|
|
41
|
+
export const standaloneTokens = ["focus-ring"];
|
|
42
|
+
// =============================================================================
|
|
43
|
+
// UTILITIES
|
|
44
|
+
// =============================================================================
|
|
32
45
|
/** Type-safe CSS var reference */
|
|
33
46
|
export function cssVar(token) {
|
|
34
47
|
return `var(--${token})`;
|
|
35
48
|
}
|
|
36
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* Type-safe HSL wrapper for Tailwind
|
|
51
|
+
*
|
|
52
|
+
* @deprecated Token values are hex and palette references, so wrapping one in
|
|
53
|
+
* `hsl()` yields invalid CSS. Use {@link cssVar}.
|
|
54
|
+
*/
|
|
37
55
|
export function hsl(token) {
|
|
38
56
|
return `hsl(var(--${token}))`;
|
|
39
57
|
}
|
package/dist/theme/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/theme/schema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/theme/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAoBH,gFAAgF;AAChF,aAAa;AACb,gFAAgF;AAEhF,gDAAgD;AAChD,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAU,CAAC;AAGxD,0CAA0C;AAC1C,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAGjE,mCAAmC;AACnC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,CAAU,CAAC;AAGlE,oBAAoB;AACpB,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,SAAS,EAAE,GAAG,QAAQ,CAAU,CAAC;AAG9D,gFAAgF;AAChF,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,GAAG,SAAS,EAAE,OAAO,EAAE,SAAS,CAAU,CAAC;AAGnE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAGrD,yBAAyB;AACzB,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,UAAU,CAAU,CAAC;AAGlE,0DAA0D;AAC1D,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,YAAY,CAAU,CAAC;AA0DxD,gFAAgF;AAChF,YAAY;AACZ,gFAAgF;AAEhF,kCAAkC;AAClC,MAAM,UAAU,MAAM,CAAC,KAAiB;IACtC,OAAO,SAAS,KAAK,GAAG,CAAC;AAC3B,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,GAAG,CAAC,KAAiB;IACnC,OAAO,aAAa,KAAK,IAAI,CAAC;AAChC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sixthshift/design-system",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Personal design system - tokens, theme, and component library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"publishConfig": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
|
31
31
|
"dist",
|
|
32
|
-
"tailwind.config.ts",
|
|
33
32
|
"!src/**/*.test.ts",
|
|
34
33
|
"!src/**/*.test.tsx",
|
|
35
34
|
"!src/**/__tests__",
|
|
@@ -39,13 +38,11 @@
|
|
|
39
38
|
"!src/testing"
|
|
40
39
|
],
|
|
41
40
|
"exports": {
|
|
42
|
-
"./
|
|
43
|
-
"./theme.css": "./dist/theme.generated.css",
|
|
41
|
+
"./theme.css": "./src/theme/tokens.css",
|
|
44
42
|
"./theme": {
|
|
45
43
|
"types": "./dist/theme/index.d.ts",
|
|
46
44
|
"import": "./dist/theme/index.js"
|
|
47
45
|
},
|
|
48
|
-
"./tailwind.config": "./tailwind.config.ts",
|
|
49
46
|
"./utils": {
|
|
50
47
|
"types": "./dist/lib/utils.d.ts",
|
|
51
48
|
"import": "./dist/lib/utils.js"
|
|
@@ -365,21 +362,17 @@
|
|
|
365
362
|
},
|
|
366
363
|
"scripts": {
|
|
367
364
|
"prepare": "bun run build",
|
|
368
|
-
"build": "bun run clean:dist && bun run build:js && bun run
|
|
365
|
+
"build": "bun run clean:dist && bun run build:js && bun run scripts/check-exports.ts",
|
|
369
366
|
"build:js": "tsc -p tsconfig.build.json && bun run scripts/fix-extensions.ts",
|
|
370
|
-
"
|
|
371
|
-
"build:
|
|
372
|
-
"dev": "bun run dev:css & bun run dev:theme",
|
|
373
|
-
"dev:css": "tailwindcss -i src/styles/base.css -o dist/styles.css --watch",
|
|
374
|
-
"dev:theme": "bun run scripts/watch-theme.ts",
|
|
375
|
-
"storybook": "storybook dev -p 6006 --no-open",
|
|
376
|
-
"build-storybook": "storybook build",
|
|
367
|
+
"dev": "storybook dev -p 6006 --no-open",
|
|
368
|
+
"build:storybook": "storybook build",
|
|
377
369
|
"test": "vitest run --project unit --project date-time --reporter=dot",
|
|
378
370
|
"test:verbose": "vitest run --project unit --project date-time",
|
|
379
371
|
"test:watch": "vitest --project unit --project date-time",
|
|
380
372
|
"test:visual": "vitest run --project visual",
|
|
381
373
|
"test:visual:update": "vitest run --project visual --update",
|
|
382
|
-
"test:stories": "vitest run --project storybook",
|
|
374
|
+
"test:stories": "vitest run --project storybook --project storybook-dark",
|
|
375
|
+
"test:stories:dark": "vitest run --project storybook-dark",
|
|
383
376
|
"test:ui": "bunx vitest --ui",
|
|
384
377
|
"type-check": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p tsconfig.test.json",
|
|
385
378
|
"lint": "biome lint .",
|
|
@@ -441,7 +434,8 @@
|
|
|
441
434
|
"monaco-editor": "^0.55.1",
|
|
442
435
|
"react": "^18.2.0 || ^19.0.0",
|
|
443
436
|
"react-dom": "^18.2.0 || ^19.0.0",
|
|
444
|
-
"react-markdown": "^10.1.0"
|
|
437
|
+
"react-markdown": "^10.1.0",
|
|
438
|
+
"tailwindcss": "^4.0.0"
|
|
445
439
|
},
|
|
446
440
|
"peerDependenciesMeta": {
|
|
447
441
|
"@fontsource-variable/inter": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { cn } from "@sixthshift/design-system/utils";
|
|
2
2
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
import
|
|
3
|
+
import * as React from "react";
|
|
4
4
|
|
|
5
5
|
const badgeVariants = cva(
|
|
6
6
|
"inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-border-brand focus:ring-offset-2",
|
|
@@ -52,8 +52,9 @@ const badgeVariants = cva(
|
|
|
52
52
|
|
|
53
53
|
export type BadgeProps = React.HTMLAttributes<HTMLSpanElement> & VariantProps<typeof badgeVariants>;
|
|
54
54
|
|
|
55
|
-
export const Badge = ({ className, variant, intent, ...props }
|
|
56
|
-
return <span className={cn(badgeVariants({ variant, intent }), className)} {...props} />;
|
|
57
|
-
};
|
|
55
|
+
export const Badge = React.forwardRef<HTMLSpanElement, BadgeProps>(({ className, variant, intent, ...props }, ref) => {
|
|
56
|
+
return <span ref={ref} className={cn(badgeVariants({ variant, intent }), className)} {...props} />;
|
|
57
|
+
});
|
|
58
|
+
Badge.displayName = "Badge";
|
|
58
59
|
|
|
59
60
|
export { badgeVariants };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { cn } from "@sixthshift/design-system/utils";
|
|
2
|
-
import
|
|
2
|
+
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
export type BarChartItem = {
|
|
5
5
|
label: string;
|
|
@@ -17,35 +17,30 @@ export type BarChartProps = React.HTMLAttributes<HTMLDivElement> & {
|
|
|
17
17
|
|
|
18
18
|
const DEFAULT_COLORS = ["var(--fg-brand)", "var(--fg-success)", "var(--fg-warning)", "var(--fg-danger)", "var(--fg-subtle)"];
|
|
19
19
|
|
|
20
|
-
export const BarChart = (
|
|
21
|
-
data,
|
|
22
|
-
|
|
23
|
-
maxValue: maxValueProp,
|
|
24
|
-
formatValue = (v) => String(v),
|
|
25
|
-
barHeight = 24,
|
|
26
|
-
className,
|
|
27
|
-
...rest
|
|
28
|
-
}: BarChartProps) => {
|
|
29
|
-
const maxValue = maxValueProp ?? Math.max(...data.map((d) => d.value), 1);
|
|
20
|
+
export const BarChart = React.forwardRef<HTMLDivElement, BarChartProps>(
|
|
21
|
+
({ data, showValues = true, maxValue: maxValueProp, formatValue = (v) => String(v), barHeight = 24, className, ...rest }, ref) => {
|
|
22
|
+
const maxValue = maxValueProp ?? Math.max(...data.map((d) => d.value), 1);
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
24
|
+
return (
|
|
25
|
+
<div ref={ref} {...rest} className={cn("flex flex-col gap-2", className)}>
|
|
26
|
+
{data.map((item, i) => {
|
|
27
|
+
// Clamp both ends: a negative value would otherwise emit an invalid
|
|
28
|
+
// `width: -n%`, whose rendering is undefined.
|
|
29
|
+
const percent = Math.min(Math.max((item.value / maxValue) * 100, 0), 100);
|
|
30
|
+
const color = item.color ?? DEFAULT_COLORS[i % DEFAULT_COLORS.length];
|
|
38
31
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
return (
|
|
33
|
+
<div key={item.label} className="flex items-center gap-3">
|
|
34
|
+
<span className="w-20 shrink-0 truncate text-right text-fg-subtle text-sm">{item.label}</span>
|
|
35
|
+
<div className="flex-1 overflow-hidden rounded-sm bg-bg-subtle" style={{ height: barHeight }}>
|
|
36
|
+
<div className="h-full rounded-sm transition-all duration-300" style={{ width: `${percent}%`, backgroundColor: color }} />
|
|
37
|
+
</div>
|
|
38
|
+
{showValues && <span className="w-12 shrink-0 text-right font-medium text-fg-normal text-sm">{formatValue(item.value)}</span>}
|
|
44
39
|
</div>
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
40
|
+
);
|
|
41
|
+
})}
|
|
42
|
+
</div>
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
BarChart.displayName = "BarChart";
|