@crewlethq/ui 0.17.1 → 0.18.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 +36 -1
- package/dist/AccessDeniedCard/AccessDeniedCard.d.ts +39 -0
- package/dist/AccessDeniedCard/index.d.ts +3 -0
- package/dist/AccessDeniedCard/index.js +8 -0
- package/dist/AccessDeniedCard-WXM5DBDZ.css +8 -0
- package/dist/ArtifactCard/ArtifactCard.d.ts +61 -0
- package/dist/ArtifactCard/index.d.ts +3 -0
- package/dist/ArtifactCard/index.js +12 -0
- package/dist/ArtifactCard-EXVAEBV6.css +109 -0
- package/dist/AvatarPicker/index.js +4 -4
- package/dist/ChangeMark/ChangeMark.d.ts +26 -0
- package/dist/ChangeMark/index.d.ts +3 -0
- package/dist/ChangeMark/index.js +8 -0
- package/dist/ChangeMark-3VMTW7MT.css +22 -0
- package/dist/Combobox/index.js +1 -1
- package/dist/CommandPalette/index.js +3 -3
- package/dist/CursorFlag/CursorFlag.d.ts +34 -0
- package/dist/CursorFlag/index.d.ts +3 -0
- package/dist/CursorFlag/index.js +3 -0
- package/dist/CursorFlag-AJQJBUGY.css +61 -0
- package/dist/DataTable/index.js +6 -6
- package/dist/DataView/index.js +12 -12
- package/dist/DateTimePicker/index.js +2 -2
- package/dist/FollowBanner/FollowBanner.d.ts +35 -0
- package/dist/FollowBanner/index.d.ts +2 -0
- package/dist/FollowBanner/index.js +7 -0
- package/dist/FrameProtocol/index.d.ts +2 -0
- package/dist/FrameProtocol/index.js +2 -0
- package/dist/FrameProtocol/protocol.d.ts +164 -0
- package/dist/HuePicker/index.js +2 -2
- package/dist/LinkInterstitial/LinkInterstitial.d.ts +41 -0
- package/dist/LinkInterstitial/index.d.ts +3 -0
- package/dist/LinkInterstitial/index.js +11 -0
- package/dist/LinkInterstitial-ET4MSVSV.css +34 -0
- package/dist/ListInput/index.js +1 -1
- package/dist/LiveCursor/LiveCursor.d.ts +34 -0
- package/dist/LiveCursor/index.d.ts +3 -0
- package/dist/LiveCursor/index.js +4 -0
- package/dist/LiveCursor-DZHGIYWE.css +47 -0
- package/dist/MarkdownEditor/index.js +2 -2
- package/dist/Modal/index.js +2 -2
- package/dist/OrgTable/index.js +2 -2
- package/dist/PresenceModel/index.d.ts +2 -0
- package/dist/PresenceModel/index.js +3 -0
- package/dist/PresenceModel/presence.d.ts +80 -0
- package/dist/PresenceRing/PresenceRing.d.ts +31 -0
- package/dist/PresenceRing/index.d.ts +3 -0
- package/dist/PresenceRing/index.js +2 -0
- package/dist/PresenceRing-M4C22Q6U.css +68 -0
- package/dist/PresenceStack/PresenceStack.d.ts +36 -0
- package/dist/PresenceStack/index.d.ts +3 -0
- package/dist/PresenceStack/index.js +9 -0
- package/dist/PresenceStack-QSXQJND5.css +59 -0
- package/dist/PricingCard/index.js +2 -2
- package/dist/Principal/Principal.d.ts +35 -0
- package/dist/Principal/index.d.ts +2 -0
- package/dist/Principal/index.js +4 -0
- package/dist/PrincipalPicker/PrincipalPicker.d.ts +45 -0
- package/dist/PrincipalPicker/index.d.ts +3 -0
- package/dist/PrincipalPicker/index.js +12 -0
- package/dist/PrincipalPicker-7NNZTGUP.css +41 -0
- package/dist/SandboxedFrame/SandboxedFrame.d.ts +142 -0
- package/dist/SandboxedFrame/index.d.ts +3 -0
- package/dist/SandboxedFrame/index.js +8 -0
- package/dist/SandboxedFrame-L6HBQZCD.css +50 -0
- package/dist/ShareDialog/ShareDialog.d.ts +101 -0
- package/dist/ShareDialog/index.d.ts +5 -0
- package/dist/ShareDialog/index.js +19 -0
- package/dist/ShareDialog/roles.d.ts +10 -0
- package/dist/ShareDialog-YZ4F37MW.css +146 -0
- package/dist/SheetGrid/SheetGrid.d.ts +78 -0
- package/dist/SheetGrid/cells.d.ts +117 -0
- package/dist/SheetGrid/index.d.ts +5 -0
- package/dist/SheetGrid/index.js +18 -0
- package/dist/SheetGrid-4HOXDVIB.css +595 -0
- package/dist/SheetModel/clipboard.d.ts +37 -0
- package/dist/SheetModel/edits.d.ts +68 -0
- package/dist/SheetModel/index.d.ts +14 -0
- package/dist/SheetModel/index.js +3 -0
- package/dist/SheetModel/labels.d.ts +71 -0
- package/dist/SheetModel/navigation.d.ts +79 -0
- package/dist/SheetModel/options.d.ts +28 -0
- package/dist/SheetModel/types.d.ts +126 -0
- package/dist/SheetModel/values.d.ts +76 -0
- package/dist/SheetModel/view.d.ts +32 -0
- package/dist/Switcher/index.js +5 -5
- package/dist/Tag/Tag.d.ts +13 -0
- package/dist/Tag/index.js +1 -1
- package/dist/{Tag-4BRQS6GN.css → Tag-SRGTK5KI.css} +42 -0
- package/dist/TagsInput/index.js +2 -2
- package/dist/ThemeSwitcher/apply.d.ts +43 -0
- package/dist/ThemeSwitcher/index.d.ts +4 -2
- package/dist/ThemeSwitcher/index.js +3 -2
- package/dist/ThemeSwitcher/preferences.d.ts +2 -19
- package/dist/ThemeToggle/index.js +3 -2
- package/dist/TimeWindowPicker/index.js +3 -3
- package/dist/Timeline/Timeline.d.ts +7 -2
- package/dist/Timeline/index.js +1 -1
- package/dist/VersionTimeline/VersionTimeline.d.ts +76 -0
- package/dist/VersionTimeline/index.d.ts +3 -0
- package/dist/VersionTimeline/index.js +10 -0
- package/dist/VersionTimeline-EBJ6MIPJ.css +108 -0
- package/dist/{chunk-SBRE7IML.js → chunk-2ONWEDQT.js} +1 -1
- package/dist/chunk-2YR5ZPQ3.js +216 -0
- package/dist/chunk-3BYIWOTV.js +29 -0
- package/dist/chunk-3UAA4IWJ.js +98 -0
- package/dist/chunk-4KP4RC3O.js +25 -0
- package/dist/chunk-4U3GQ7D2.js +99 -0
- package/dist/chunk-5XACKNYR.js +53 -0
- package/dist/{chunk-FSKTOIYC.js → chunk-76FXDZAZ.js} +2 -2
- package/dist/chunk-A7EBCHEG.js +49 -0
- package/dist/{chunk-JCO3SIST.js → chunk-AQCV62K6.js} +1 -1
- package/dist/{chunk-O67VF5MS.js → chunk-AUQPBL4O.js} +2 -2
- package/dist/{chunk-HENOTGUV.js → chunk-BOW2VUCH.js} +2 -2
- package/dist/{chunk-UCYIRDND.js → chunk-DQSXWQMJ.js} +1 -1
- package/dist/chunk-ESKP3TXM.js +1 -0
- package/dist/chunk-F6V2PTN6.js +142 -0
- package/dist/chunk-FW7HN6AP.js +40 -0
- package/dist/chunk-FYXRWBJJ.js +1235 -0
- package/dist/{chunk-LOECRMHA.js → chunk-GFV4LJHH.js} +4 -3
- package/dist/chunk-I6POAB4V.js +20 -0
- package/dist/{chunk-PQ63NLFC.js → chunk-IFKBDRNJ.js} +1 -1
- package/dist/{chunk-6NN2F7GM.js → chunk-KVT3TJVG.js} +4 -4
- package/dist/chunk-LFZ45HV2.js +46 -0
- package/dist/{chunk-6TSZCBID.js → chunk-NP2C4Y4E.js} +1 -1
- package/dist/{chunk-FA2V2VT6.js → chunk-NZY77ZDU.js} +3 -3
- package/dist/chunk-PPAQFGS2.js +12 -0
- package/dist/chunk-S35G6PNC.js +80 -0
- package/dist/chunk-VYDFB6PJ.js +243 -0
- package/dist/chunk-WXAULPBH.js +135 -0
- package/dist/chunk-YM3GJHGW.js +69 -0
- package/dist/chunk-YYZRLLLY.js +822 -0
- package/dist/{chunk-K3OWD7BJ.js → chunk-Z24ZUSTX.js} +4 -19
- package/dist/chunk-ZXXDZJQN.js +36 -0
- package/dist/generated/index.d.ts +18 -0
- package/dist/generated/index.js +82 -62
- package/dist/index.js +82 -62
- package/dist/styles.css +1578 -149
- package/dist/utils/index.js +1 -1
- package/package.json +3 -3
- package/dist/{chunk-DEEVA6TV.js → chunk-2TZATTIU.js} +1 -1
- package/dist/{chunk-2UU5IGZI.js → chunk-5NVKTB6E.js} +1 -1
- package/dist/{chunk-CRVETI5L.js → chunk-CENOOTAV.js} +0 -0
- package/dist/{chunk-JF7X673Z.js → chunk-ERV5BUS3.js} +1 -1
- package/dist/{chunk-NXDEPUVG.js → chunk-PA4CYTBY.js} +1 -1
- package/dist/{chunk-77IEHFY4.js → chunk-QQGWES46.js} +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { LONGTEXT_MAX_DEFAULT, RATING_MAX_CEILING, RATING_MAX_DEFAULT, SHEET_COLUMN_TYPES, SHEET_COLUMN_WIDTHS, SHEET_LABELS, SHEET_ROW_HEIGHT, SHEET_ROW_NUMBER_WIDTH, SheetPendingEdits, TEXT_MAX_DEFAULT, URL_MAX, cellDescription, cellKey, cellSpeech, changeText, changeTime, checkValue, columnOffsets, columnWidth, compareValues, displayText, drawnColumns, editText, editorSide, findOption, findPerson, flagText, hasPrevious, inRange, isEmptyValue, isMod, isMultiCell, isSheetColumnType, isTypingKey, liveOptions, moveFrom, nextSort, normalizeValue, optionHue, parseOptionList, parseTSV, parseText, planClear, planPaste, presenceByCell, presenceByColumn, presenceByRow, rangeOf, ratingMax, refusalText, rowName, sameValue, scrollToRow, sheetLabels, sortRows, spokenText, statusTone, textMax, toTSV, visibleRows } from '../chunk-YYZRLLLY.js';
|
|
2
|
+
import '../chunk-S35G6PNC.js';
|
|
3
|
+
import '../chunk-AYKXMIOR.js';
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every string a sheet says, in one table both renderers read, so the React
|
|
3
|
+
* grid and the artifact kit's custom element say the same words and a host
|
|
4
|
+
* overrides them in one place.
|
|
5
|
+
*/
|
|
6
|
+
import type { SheetColumnType, SheetSyncState } from './types.js';
|
|
7
|
+
export interface SheetLabels {
|
|
8
|
+
/** The row number column's header, read but not seen. */
|
|
9
|
+
rowHeader: string;
|
|
10
|
+
/** The add-row control. */
|
|
11
|
+
addRow: string;
|
|
12
|
+
/** An empty cell, read but not seen. */
|
|
13
|
+
empty: string;
|
|
14
|
+
checked: string;
|
|
15
|
+
unchecked: string;
|
|
16
|
+
/** A rating, read out: "3 of 5 stars". */
|
|
17
|
+
rating: (value: number, max: number) => string;
|
|
18
|
+
/** An option that was archived after a value chose it. */
|
|
19
|
+
archived: (label: string) => string;
|
|
20
|
+
/** A person value the host could not resolve to a name. */
|
|
21
|
+
unknownPerson: string;
|
|
22
|
+
/** A column type, for a header's description and a schema editor. */
|
|
23
|
+
types: Record<SheetColumnType, string>;
|
|
24
|
+
/** A pending cell, in its description (D23). */
|
|
25
|
+
saving: string;
|
|
26
|
+
/** The default refusal when the host gives no reason: the reader cannot edit. */
|
|
27
|
+
forbidden: string;
|
|
28
|
+
/** A refusal the engine gave no reason for. */
|
|
29
|
+
couldNotSave: string;
|
|
30
|
+
/** A value that does not fit its column. */
|
|
31
|
+
notANumber: (column: string) => string;
|
|
32
|
+
belowMin: (column: string, min: string) => string;
|
|
33
|
+
aboveMax: (column: string, max: string) => string;
|
|
34
|
+
tooLong: (column: string, max: number) => string;
|
|
35
|
+
required: (column: string) => string;
|
|
36
|
+
notAnOption: (column: string) => string;
|
|
37
|
+
tooManyItems: (column: string, max: number) => string;
|
|
38
|
+
notAPerson: (column: string) => string;
|
|
39
|
+
notADate: (column: string) => string;
|
|
40
|
+
notAUrl: (column: string) => string;
|
|
41
|
+
notARating: (column: string, max: number) => string;
|
|
42
|
+
notABoolean: (column: string) => string;
|
|
43
|
+
/** A read-only cell a person tried to change. */
|
|
44
|
+
readOnly: (column: string) => string;
|
|
45
|
+
/** A remote write landed on the cell being edited. */
|
|
46
|
+
conflict: (writer: string, value: string) => string;
|
|
47
|
+
keepMine: string;
|
|
48
|
+
useTheirs: (writer: string) => string;
|
|
49
|
+
/** The writer of a conflicting change, when the host could not name them. */
|
|
50
|
+
someone: string;
|
|
51
|
+
/** A change mark's words: "Changed by Maya Ortiz, 10:42. Was 6.8." */
|
|
52
|
+
changed: (by: string, at: string, previous: string | null) => string;
|
|
53
|
+
/** The per-cell history control and its shortcut's description. */
|
|
54
|
+
history: string;
|
|
55
|
+
/** The sync strip. */
|
|
56
|
+
sync: (state: SheetSyncState) => string;
|
|
57
|
+
retry: string;
|
|
58
|
+
/** The editor's filter box in an option list. */
|
|
59
|
+
filter: string;
|
|
60
|
+
/** An option list with nothing left to show. */
|
|
61
|
+
noOptions: string;
|
|
62
|
+
/** Clears a select or a person cell from its list. */
|
|
63
|
+
clear: string;
|
|
64
|
+
/** The keyboard help a grid is described by. */
|
|
65
|
+
keyboardHelp: string;
|
|
66
|
+
/** A sort, for the header's control. */
|
|
67
|
+
sortBy: (column: string) => string;
|
|
68
|
+
}
|
|
69
|
+
export declare const SHEET_LABELS: SheetLabels;
|
|
70
|
+
/** Labels with a caller's overrides applied, the one way both renderers merge them. */
|
|
71
|
+
export declare function sheetLabels(overrides?: Partial<SheetLabels>): SheetLabels;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The sheet's keyboard model and geometry, as plain arithmetic both renderers
|
|
3
|
+
* share: which cell a key moves to, which cells a range covers, which rows a
|
|
4
|
+
* scroll position shows, and which way an editor's list opens.
|
|
5
|
+
*
|
|
6
|
+
* Positions are indexes into what is drawn: `row` counts the drawn rows from 0
|
|
7
|
+
* (the header row is -1) and `col` counts the drawn columns from 0.
|
|
8
|
+
*/
|
|
9
|
+
import type { SheetColumn, SheetColumnType } from './types.js';
|
|
10
|
+
export interface SheetPosition {
|
|
11
|
+
row: number;
|
|
12
|
+
col: number;
|
|
13
|
+
}
|
|
14
|
+
export interface SheetBounds {
|
|
15
|
+
/** Data rows drawn. */
|
|
16
|
+
rows: number;
|
|
17
|
+
/** Columns drawn. */
|
|
18
|
+
cols: number;
|
|
19
|
+
/** Rows a PageUp or a PageDown moves. */
|
|
20
|
+
page: number;
|
|
21
|
+
}
|
|
22
|
+
/** The modifier state a move reads, so a caller hands over a KeyboardEvent or anything shaped like one. */
|
|
23
|
+
export interface SheetKey {
|
|
24
|
+
key: string;
|
|
25
|
+
shiftKey?: boolean | undefined;
|
|
26
|
+
ctrlKey?: boolean | undefined;
|
|
27
|
+
metaKey?: boolean | undefined;
|
|
28
|
+
altKey?: boolean | undefined;
|
|
29
|
+
}
|
|
30
|
+
/** Whether the platform's command modifier is held: Command on a Mac, Control elsewhere, either accepted. */
|
|
31
|
+
export declare const isMod: (key: SheetKey) => boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Where a navigation key moves the active cell, or null for a key that is not
|
|
34
|
+
* one. The header row (-1) is reachable from the first row and moves along
|
|
35
|
+
* itself; Tab is not handled here, because at the row's edge it leaves the
|
|
36
|
+
* grid (the grid is one tab stop) rather than wrapping.
|
|
37
|
+
*/
|
|
38
|
+
export declare function moveFrom(at: SheetPosition, key: SheetKey, bounds: SheetBounds): SheetPosition | null;
|
|
39
|
+
/** A rectangle of cells, as its inclusive corners. */
|
|
40
|
+
export interface SheetRange {
|
|
41
|
+
top: number;
|
|
42
|
+
left: number;
|
|
43
|
+
bottom: number;
|
|
44
|
+
right: number;
|
|
45
|
+
}
|
|
46
|
+
/** The range an anchor and the active cell span. A header position counts as the first row. */
|
|
47
|
+
export declare function rangeOf(anchor: SheetPosition, active: SheetPosition): SheetRange;
|
|
48
|
+
export declare const inRange: (range: SheetRange, row: number, col: number) => boolean;
|
|
49
|
+
/** Whether a range is more than the one cell. */
|
|
50
|
+
export declare const isMultiCell: (range: SheetRange) => boolean;
|
|
51
|
+
/** The rows a scroll position shows, with an overscan either side, as [first, last] inclusive. */
|
|
52
|
+
export declare function visibleRows(scrollTop: number, viewport: number, rowHeight: number, rows: number, overscan?: number): [number, number];
|
|
53
|
+
/** The scrollTop that brings a row fully into view, or the current one when it already is. */
|
|
54
|
+
export declare function scrollToRow(row: number, scrollTop: number, viewport: number, rowHeight: number, header: number): number;
|
|
55
|
+
/**
|
|
56
|
+
* Which way an editor's list opens from its cell: below by default, above
|
|
57
|
+
* when there is not room below and more room above. Measured in the scroller's
|
|
58
|
+
* own coordinates, so a list never opens off the edge it would be clipped at.
|
|
59
|
+
*/
|
|
60
|
+
export declare function editorSide(cellTop: number, cellBottom: number, viewTop: number, viewBottom: number, panelHeight: number): 'below' | 'above';
|
|
61
|
+
/** The width each type takes when its column declares none, in px. */
|
|
62
|
+
export declare const SHEET_COLUMN_WIDTHS: Readonly<Record<SheetColumnType, number>>;
|
|
63
|
+
/** The width of the row number column, in px. */
|
|
64
|
+
export declare const SHEET_ROW_NUMBER_WIDTH = 52;
|
|
65
|
+
/** The row height a sheet assumes until it has measured `--size-sheet-row`, in px. */
|
|
66
|
+
export declare const SHEET_ROW_HEIGHT = 32;
|
|
67
|
+
export declare const columnWidth: (column: Pick<SheetColumn, "type" | "width">) => number;
|
|
68
|
+
/**
|
|
69
|
+
* Each column's offset from the leading edge, in px, after the row number
|
|
70
|
+
* column: what a frozen column's `inset-inline-start` is.
|
|
71
|
+
*/
|
|
72
|
+
export declare function columnOffsets(columns: readonly Pick<SheetColumn, 'type' | 'width'>[]): number[];
|
|
73
|
+
/**
|
|
74
|
+
* The columns in drawing order: the frozen ones lead, in their own order, so
|
|
75
|
+
* a frozen column is never stranded behind a scrolled one.
|
|
76
|
+
*/
|
|
77
|
+
export declare function drawnColumns<C extends Pick<SheetColumn, 'frozen'>>(columns: readonly C[]): C[];
|
|
78
|
+
/** Whether a key starts typing into a cell: one printable character with no command modifier. */
|
|
79
|
+
export declare const isTypingKey: (key: SheetKey) => boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What an option's colour name means on the sheet.
|
|
3
|
+
*
|
|
4
|
+
* A SELECT CHIP is an author's category, drawn in one of the six node hues
|
|
5
|
+
* the author chose for it (or neutral): chosen, never derived, which is the
|
|
6
|
+
* one sense in which a hue may name a thing rather than a state.
|
|
7
|
+
*
|
|
8
|
+
* A STATUS is a state, so it is drawn in one of the five tones, never a hue:
|
|
9
|
+
* the dashboard's state colours keep their meaning on a sheet too. Its tone
|
|
10
|
+
* is the colour name when that names a tone or a hue a tone is drawn in, and
|
|
11
|
+
* otherwise follows its category.
|
|
12
|
+
*
|
|
13
|
+
* Colour is never the only carrier: every chip and every status carries its
|
|
14
|
+
* label, and a status carries its dot.
|
|
15
|
+
*/
|
|
16
|
+
import { type NodeHue } from '../utils/nodeHue.js';
|
|
17
|
+
import type { Tone } from '../utils/tone.js';
|
|
18
|
+
import type { SheetColumn, SheetOption } from './types.js';
|
|
19
|
+
/** The hue a select chip is drawn in, or neutral for none, an unknown name or a grey. */
|
|
20
|
+
export declare function optionHue(color: string | undefined): NodeHue | 'neutral';
|
|
21
|
+
/** The tone a status option is drawn in. */
|
|
22
|
+
export declare function statusTone(option: Pick<SheetOption, 'color' | 'category'>): Tone;
|
|
23
|
+
/** The option an id names in a column, archived ones included, or undefined. */
|
|
24
|
+
export declare function findOption(column: Pick<SheetColumn, 'options'>, id: string): SheetOption | undefined;
|
|
25
|
+
/** The options a person may still choose: archived ones are drawn but never offered. */
|
|
26
|
+
export declare function liveOptions(column: Pick<SheetColumn, 'options'>): SheetOption[];
|
|
27
|
+
/** Parses the kit's `options` attribute: `Gold:amber,Silver:neutral,Bronze:rose`, ids derived from labels. */
|
|
28
|
+
export declare function parseOptionList(text: string): SheetOption[];
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shapes an editable sheet is drawn from.
|
|
3
|
+
*
|
|
4
|
+
* They mirror the engine's datastore schema (`artifacts.Column`,
|
|
5
|
+
* `artifacts.Option`) closely enough that a host maps a collection's schema
|
|
6
|
+
* onto them field for field, and loosely enough that a page can declare a
|
|
7
|
+
* sheet by hand. Values travel as the JSON the datastore holds: a sheet
|
|
8
|
+
* normalises what it is given (`normalizeValue`) rather than trusting it.
|
|
9
|
+
*/
|
|
10
|
+
import type { NodeHue } from '../utils/nodeHue.js';
|
|
11
|
+
/** Every column type a sheet draws and edits: the engine's `artifacts.ColumnTypes`, in its order. */
|
|
12
|
+
export declare const SHEET_COLUMN_TYPES: readonly ["text", "longtext", "number", "checkbox", "select", "multiselect", "status", "person", "date", "url", "rating"];
|
|
13
|
+
export type SheetColumnType = (typeof SHEET_COLUMN_TYPES)[number];
|
|
14
|
+
/** Whether a value read off the wire names a column type this build draws. */
|
|
15
|
+
export declare const isSheetColumnType: (value: unknown) => value is SheetColumnType;
|
|
16
|
+
/** A status option's category, which decides its tone when its colour names none. */
|
|
17
|
+
export type SheetStatusCategory = 'todo' | 'in_progress' | 'done' | 'blocked';
|
|
18
|
+
/** One option of a select, multi-select or status column. Ids are stable; labels and colours may change. */
|
|
19
|
+
export interface SheetOption {
|
|
20
|
+
id: string;
|
|
21
|
+
label: string;
|
|
22
|
+
/** A design-token hue or tone name (`amber`, `neutral`, `success`), never a literal colour. */
|
|
23
|
+
color?: string | undefined;
|
|
24
|
+
category?: SheetStatusCategory | undefined;
|
|
25
|
+
/** An archived option still draws the values that name it ("Archived: Gold") and is offered to nobody. */
|
|
26
|
+
archived?: boolean | undefined;
|
|
27
|
+
}
|
|
28
|
+
/** How a number column writes its values. */
|
|
29
|
+
export type SheetNumberStyle = 'plain' | 'percent' | 'currency';
|
|
30
|
+
/** One column of a sheet. */
|
|
31
|
+
export interface SheetColumn {
|
|
32
|
+
/** The document field the column edits. */
|
|
33
|
+
field: string;
|
|
34
|
+
/** The column's name, in the header and in every cell's accessible description. */
|
|
35
|
+
label: string;
|
|
36
|
+
type: SheetColumnType;
|
|
37
|
+
/** Width in px. Each type has a default. */
|
|
38
|
+
width?: number | undefined;
|
|
39
|
+
/** Stays in view while the sheet scrolls sideways. Frozen columns are the leading ones. */
|
|
40
|
+
frozen?: boolean | undefined;
|
|
41
|
+
readOnly?: boolean | undefined;
|
|
42
|
+
/** Clearing a required cell is refused on the cell. */
|
|
43
|
+
required?: boolean | undefined;
|
|
44
|
+
options?: readonly SheetOption[] | undefined;
|
|
45
|
+
/** Number: the least value; rating: unused. */
|
|
46
|
+
min?: number | undefined;
|
|
47
|
+
/** Number: the greatest value; rating: the number of stars (1 to 10, 5 by default). */
|
|
48
|
+
max?: number | undefined;
|
|
49
|
+
/** Number: decimals drawn and kept. */
|
|
50
|
+
precision?: number | undefined;
|
|
51
|
+
numberStyle?: SheetNumberStyle | undefined;
|
|
52
|
+
/** An ISO 4217 code, for `numberStyle: 'currency'`. */
|
|
53
|
+
currency?: string | undefined;
|
|
54
|
+
/** Text and long text: the most characters a value may hold. */
|
|
55
|
+
maxLength?: number | undefined;
|
|
56
|
+
/** Multi-select: the most options a value may hold. */
|
|
57
|
+
maxItems?: number | undefined;
|
|
58
|
+
/** Date: the value carries a time of day, as RFC 3339 UTC, rather than a calendar date. */
|
|
59
|
+
time?: boolean | undefined;
|
|
60
|
+
}
|
|
61
|
+
/** A person or an agent a person cell can name, as the host resolved them. */
|
|
62
|
+
export interface SheetPerson {
|
|
63
|
+
/** The value a person cell stores: the seat handle or principal reference. */
|
|
64
|
+
id: string;
|
|
65
|
+
name: string;
|
|
66
|
+
kind: 'human' | 'agent';
|
|
67
|
+
hue?: NodeHue | undefined;
|
|
68
|
+
character?: string | undefined;
|
|
69
|
+
src?: string | undefined;
|
|
70
|
+
}
|
|
71
|
+
/** What a cell holds once normalised. */
|
|
72
|
+
export type SheetValue = string | number | boolean | readonly string[] | null;
|
|
73
|
+
/** Who last changed a cell, for its change mark. */
|
|
74
|
+
export interface SheetChange {
|
|
75
|
+
/** The writer's display name. */
|
|
76
|
+
by: string;
|
|
77
|
+
at: string | number | Date;
|
|
78
|
+
/** The value before the change, when it is worth saying. */
|
|
79
|
+
previous?: SheetValue | undefined;
|
|
80
|
+
}
|
|
81
|
+
/** One row of a sheet. */
|
|
82
|
+
export interface SheetRow {
|
|
83
|
+
/** The document id. */
|
|
84
|
+
id: string;
|
|
85
|
+
/** The document's fields, as the datastore holds them. */
|
|
86
|
+
values: Readonly<Record<string, unknown>>;
|
|
87
|
+
/** Fields with an edit the engine has not confirmed yet: drawn as Saving (D23). */
|
|
88
|
+
pending?: readonly string[] | undefined;
|
|
89
|
+
/** Fields whose last edit the engine refused, with the reason said on the cell. */
|
|
90
|
+
refused?: Readonly<Record<string, string>> | undefined;
|
|
91
|
+
/** Fields changed since the reader last looked, with who changed them. */
|
|
92
|
+
changed?: Readonly<Record<string, SheetChange>> | undefined;
|
|
93
|
+
}
|
|
94
|
+
/** One cell edit a sheet asks its host to make. */
|
|
95
|
+
export interface SheetEdit {
|
|
96
|
+
rowId: string;
|
|
97
|
+
field: string;
|
|
98
|
+
value: SheetValue;
|
|
99
|
+
}
|
|
100
|
+
/** A collaborator on a cell. */
|
|
101
|
+
export interface SheetCellPresence {
|
|
102
|
+
rowId: string;
|
|
103
|
+
field: string;
|
|
104
|
+
/** The collaborator's session or seat, unique among the entries for one cell. */
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
kind: 'human' | 'agent';
|
|
108
|
+
hue: NodeHue;
|
|
109
|
+
/** Editing the cell rather than looking at it. */
|
|
110
|
+
editing?: boolean | undefined;
|
|
111
|
+
idle?: boolean | undefined;
|
|
112
|
+
}
|
|
113
|
+
/** A sort a sheet is drawn in. */
|
|
114
|
+
export interface SheetSort {
|
|
115
|
+
field: string;
|
|
116
|
+
direction: 'ascending' | 'descending';
|
|
117
|
+
}
|
|
118
|
+
/** Where a host's writes stand, for the sheet's sync strip. */
|
|
119
|
+
export interface SheetSyncState {
|
|
120
|
+
/** Edits sent and not yet confirmed. */
|
|
121
|
+
saving: number;
|
|
122
|
+
/** The connection is down; `saving` edits wait for it. */
|
|
123
|
+
offline?: boolean | undefined;
|
|
124
|
+
/** Edits that could not be saved and can be retried. */
|
|
125
|
+
failed?: number | undefined;
|
|
126
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A cell's value in its three forms, and the rules that hold a value to its
|
|
3
|
+
* column.
|
|
4
|
+
*
|
|
5
|
+
* normalizeValue what the datastore holds, coerced to the column's type
|
|
6
|
+
* displayText what a reader sees, formatted for their locale
|
|
7
|
+
* editText what an editor starts with and a copy writes: locale
|
|
8
|
+
* free, so a value copied out pastes back as itself
|
|
9
|
+
* parseText the inverse of editText, tolerant of what people type
|
|
10
|
+
* and paste, and the one place a value is refused before
|
|
11
|
+
* it is sent
|
|
12
|
+
*
|
|
13
|
+
* The engine validates every write again (the real boundary); refusing here
|
|
14
|
+
* first is what lets the sheet say why on the cell without a round trip.
|
|
15
|
+
*/
|
|
16
|
+
import type { SheetLabels } from './labels.js';
|
|
17
|
+
import type { SheetColumn, SheetPerson, SheetValue } from './types.js';
|
|
18
|
+
/** What formatting and parsing need beyond the column itself. */
|
|
19
|
+
export interface SheetValueContext {
|
|
20
|
+
/** The people a person cell may name. */
|
|
21
|
+
people?: readonly SheetPerson[] | undefined;
|
|
22
|
+
/** A BCP 47 tag; the reader's own locale when absent. */
|
|
23
|
+
locale?: string | undefined;
|
|
24
|
+
labels: SheetLabels;
|
|
25
|
+
}
|
|
26
|
+
/** The engine's default and ceiling lengths (`artifacts` limits), for a column that declares none. */
|
|
27
|
+
export declare const TEXT_MAX_DEFAULT = 1000;
|
|
28
|
+
export declare const LONGTEXT_MAX_DEFAULT = 20000;
|
|
29
|
+
export declare const URL_MAX = 2048;
|
|
30
|
+
export declare const RATING_MAX_DEFAULT = 5;
|
|
31
|
+
export declare const RATING_MAX_CEILING = 10;
|
|
32
|
+
/** The number of stars a rating column draws. */
|
|
33
|
+
export declare function ratingMax(column: Pick<SheetColumn, 'max'>): number;
|
|
34
|
+
/** The longest value a text or long text column takes. */
|
|
35
|
+
export declare function textMax(column: Pick<SheetColumn, 'type' | 'maxLength'>): number;
|
|
36
|
+
/**
|
|
37
|
+
* What the datastore holds, coerced to the column's type. A value of the wrong
|
|
38
|
+
* shape (a newer writer, a hand-edited document) is drawn as empty rather than
|
|
39
|
+
* thrown on, except where it has an obvious reading: a numeric string in a
|
|
40
|
+
* number column, a number in a text column.
|
|
41
|
+
*/
|
|
42
|
+
export declare function normalizeValue(column: Pick<SheetColumn, 'type'>, raw: unknown): SheetValue;
|
|
43
|
+
/** Whether a value is nothing at all: null, an empty string or an empty list. A false checkbox is a value. */
|
|
44
|
+
export declare function isEmptyValue(value: SheetValue): boolean;
|
|
45
|
+
/** Whether two values are the same value. */
|
|
46
|
+
export declare function sameValue(a: SheetValue, b: SheetValue): boolean;
|
|
47
|
+
/** The person a value names, if the host resolved one. */
|
|
48
|
+
export declare function findPerson(people: readonly SheetPerson[] | undefined, id: string): SheetPerson | undefined;
|
|
49
|
+
/** What a reader sees in a cell, formatted for their locale. Empty for an empty value. */
|
|
50
|
+
export declare function displayText(column: SheetColumn, value: SheetValue, context: SheetValueContext): string;
|
|
51
|
+
/** What a cell says to a screen reader: its display text, or a word for the values that draw none. */
|
|
52
|
+
export declare function spokenText(column: SheetColumn, value: SheetValue, context: SheetValueContext): string;
|
|
53
|
+
/** What an editor starts with and a copy writes. Locale free, so it pastes back as itself. */
|
|
54
|
+
export declare function editText(column: SheetColumn, value: SheetValue, context: SheetValueContext): string;
|
|
55
|
+
/** A parsed value, or why the text does not fit the column. */
|
|
56
|
+
export type SheetParse = {
|
|
57
|
+
ok: true;
|
|
58
|
+
value: SheetValue;
|
|
59
|
+
} | {
|
|
60
|
+
ok: false;
|
|
61
|
+
error: string;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Text, as a person typed or pasted it, read as a value of the column, or the
|
|
65
|
+
* reason it cannot be. Empty text clears the cell, unless the column is
|
|
66
|
+
* required.
|
|
67
|
+
*/
|
|
68
|
+
export declare function parseText(column: SheetColumn, text: string, context: SheetValueContext): SheetParse;
|
|
69
|
+
/**
|
|
70
|
+
* Why a value chosen in an editor (an option, a person, a checkbox) cannot be
|
|
71
|
+
* written, or null. The text path is held by `parseText`; this holds the
|
|
72
|
+
* values an editor hands over directly.
|
|
73
|
+
*/
|
|
74
|
+
export declare function checkValue(column: SheetColumn, value: SheetValue, context: SheetValueContext): string | null;
|
|
75
|
+
/** Orders two values of a column: empty last, then by the column's own order. */
|
|
76
|
+
export declare function compareValues(column: SheetColumn, a: SheetValue, b: SheetValue, context: SheetValueContext): number;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a sheet draws from its inputs, computed once for both renderers: the
|
|
3
|
+
* rows in their sorted order, the collaborators on each cell, and the words a
|
|
4
|
+
* focused cell is described by.
|
|
5
|
+
*/
|
|
6
|
+
import { type PresenceLabels } from '../PresenceModel/presence.js';
|
|
7
|
+
import { type SheetValueContext } from './values.js';
|
|
8
|
+
import type { SheetCellPresence, SheetColumn, SheetRow, SheetSort } from './types.js';
|
|
9
|
+
/** The rows in a sort's order, stable for equal values. With no sort, the host's order. */
|
|
10
|
+
export declare function sortRows(columns: readonly SheetColumn[], rows: readonly SheetRow[], sort: SheetSort | null | undefined, context: SheetValueContext): SheetRow[];
|
|
11
|
+
/** The next sort a header press asks for: ascending, then descending, then none. */
|
|
12
|
+
export declare function nextSort(current: SheetSort | null | undefined, field: string): SheetSort | null;
|
|
13
|
+
export declare const cellKey: (rowId: string, field: string) => string;
|
|
14
|
+
/** The collaborators on each cell, editors first, keyed by `cellKey`. */
|
|
15
|
+
export declare function presenceByCell(presence: readonly SheetCellPresence[] | undefined): Map<string, SheetCellPresence[]>;
|
|
16
|
+
/** The rows somebody has selected, with the first collaborator on each, for the row's leading bar. */
|
|
17
|
+
export declare function presenceByRow(presence: readonly SheetCellPresence[] | undefined): Map<string, SheetCellPresence>;
|
|
18
|
+
/** The collaborators in each column, at most two, for its header. */
|
|
19
|
+
export declare function presenceByColumn(presence: readonly SheetCellPresence[] | undefined, max?: number): Map<string, SheetCellPresence[]>;
|
|
20
|
+
/** The text on a cell's name flag: "Maya", or "Maya, @pm" when several are on it. */
|
|
21
|
+
export declare function flagText(entries: readonly SheetCellPresence[]): string;
|
|
22
|
+
/**
|
|
23
|
+
* Everything a focused cell is described by, after its own content: its
|
|
24
|
+
* column, whether it is saving or was refused, who else is on it and who
|
|
25
|
+
* changed it. "Score. Saving. Jane Founder is also here. Changed by Maya
|
|
26
|
+
* Ortiz, 10:42. Was 6.8."
|
|
27
|
+
*/
|
|
28
|
+
export declare function cellDescription(column: SheetColumn, row: SheetRow, others: readonly SheetCellPresence[], context: SheetValueContext, presenceLabels?: PresenceLabels): string;
|
|
29
|
+
/** A row's name, for its row header and an announcement: the first text column's value, or its number. */
|
|
30
|
+
export declare function rowName(columns: readonly SheetColumn[], row: SheetRow, index: number, context: SheetValueContext): string;
|
|
31
|
+
/** A cell's spoken value, the one form both renderers put in a cell for a screen reader. */
|
|
32
|
+
export declare function cellSpeech(column: SheetColumn, row: SheetRow, context: SheetValueContext): string;
|
package/dist/Switcher/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export { Switcher } from '../chunk-
|
|
1
|
+
export { Switcher } from '../chunk-NZY77ZDU.js';
|
|
2
2
|
import '../chunk-W5J7R5EB.js';
|
|
3
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-2TZATTIU.js';
|
|
4
4
|
import '../chunk-F73MC7EZ.js';
|
|
5
|
-
import '../chunk-4GB57WIT.js';
|
|
6
5
|
import '../chunk-FYTIJM2T.js';
|
|
6
|
+
import '../chunk-4GB57WIT.js';
|
|
7
|
+
import '../chunk-BWRGFKJP.js';
|
|
7
8
|
import '../chunk-OG6CL3EB.js';
|
|
8
9
|
import '../chunk-RSAQOKH3.js';
|
|
9
10
|
import '../chunk-IG75YMUN.js';
|
|
10
11
|
import '../chunk-4FQT6ZAY.js';
|
|
11
|
-
import '../chunk-PQADV6P6.js';
|
|
12
|
-
import '../chunk-BWRGFKJP.js';
|
|
13
12
|
import '../chunk-HMPFGIWM.js';
|
|
14
13
|
import '../chunk-R25RGPUB.js';
|
|
14
|
+
import '../chunk-PQADV6P6.js';
|
|
15
15
|
import '../chunk-BZFWDIV6.js';
|
|
16
16
|
import '../chunk-ODEQTPFM.js';
|
package/dist/Tag/Tag.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { HTMLAttributes, MouseEvent, ReactNode } from 'react';
|
|
2
|
+
import type { NodeHue } from '../utils/nodeHue.js';
|
|
2
3
|
import type { Tone } from '../utils/tone.js';
|
|
3
4
|
/**
|
|
4
5
|
* What a tag's colour says: a state, the accent, or nothing at all.
|
|
@@ -31,6 +32,18 @@ export type TagAppearance = 'soft' | 'outline';
|
|
|
31
32
|
interface TagLook {
|
|
32
33
|
/** The state this tag names. Neutral by default, which is what a category such as a phase takes. */
|
|
33
34
|
variant?: TagVariant | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* A hue an author CHOSE for this value, in place of a tone: a select
|
|
37
|
+
* option's colour on a sheet ("Gold" in amber). Drawn as the hue's fill
|
|
38
|
+
* under its ink, the steps a node is tinted with.
|
|
39
|
+
*
|
|
40
|
+
* CHOSEN, NEVER DERIVED, for the reason `NodeHue` gives: a hue somebody
|
|
41
|
+
* picked for a value names it the way its label does, where a hue hashed
|
|
42
|
+
* from the label would name nothing. It is never a state (a state is a
|
|
43
|
+
* `variant`), and the label is always drawn, so the hue is never the only
|
|
44
|
+
* carrier. With a hue the variant colours nothing, and `dot` draws neutral.
|
|
45
|
+
*/
|
|
46
|
+
hue?: NodeHue | undefined;
|
|
34
47
|
/** A tinted fill, or a boundary over the surface beneath. */
|
|
35
48
|
appearance?: TagAppearance | undefined;
|
|
36
49
|
/** Drawn before the label. A glyph component, not a name. */
|
package/dist/Tag/index.js
CHANGED
|
@@ -199,6 +199,48 @@
|
|
|
199
199
|
--crewlet-tag-line: var(--color-brand-accent-soft-strong);
|
|
200
200
|
}
|
|
201
201
|
|
|
202
|
+
/*
|
|
203
|
+
* A HUE AN AUTHOR CHOSE for a value (a select option's colour), drawn in the
|
|
204
|
+
* node steps: the hue's fill under its ink, the line as the outline. Like a
|
|
205
|
+
* tinted tone, the pill needs no edge of its own at rest: the hue separates
|
|
206
|
+
* it from any neutral ground.
|
|
207
|
+
*/
|
|
208
|
+
.crewlet-tag--hue-purple {
|
|
209
|
+
--crewlet-tag-fill: var(--color-node-purple-fill);
|
|
210
|
+
--crewlet-tag-ink: var(--color-node-purple-ink);
|
|
211
|
+
--crewlet-tag-line: var(--color-node-purple-line);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.crewlet-tag--hue-cyan {
|
|
215
|
+
--crewlet-tag-fill: var(--color-node-cyan-fill);
|
|
216
|
+
--crewlet-tag-ink: var(--color-node-cyan-ink);
|
|
217
|
+
--crewlet-tag-line: var(--color-node-cyan-line);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.crewlet-tag--hue-green {
|
|
221
|
+
--crewlet-tag-fill: var(--color-node-green-fill);
|
|
222
|
+
--crewlet-tag-ink: var(--color-node-green-ink);
|
|
223
|
+
--crewlet-tag-line: var(--color-node-green-line);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.crewlet-tag--hue-amber {
|
|
227
|
+
--crewlet-tag-fill: var(--color-node-amber-fill);
|
|
228
|
+
--crewlet-tag-ink: var(--color-node-amber-ink);
|
|
229
|
+
--crewlet-tag-line: var(--color-node-amber-line);
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
.crewlet-tag--hue-rose {
|
|
233
|
+
--crewlet-tag-fill: var(--color-node-rose-fill);
|
|
234
|
+
--crewlet-tag-ink: var(--color-node-rose-ink);
|
|
235
|
+
--crewlet-tag-line: var(--color-node-rose-line);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
.crewlet-tag--hue-blue {
|
|
239
|
+
--crewlet-tag-fill: var(--color-node-blue-fill);
|
|
240
|
+
--crewlet-tag-ink: var(--color-node-blue-ink);
|
|
241
|
+
--crewlet-tag-line: var(--color-node-blue-line);
|
|
242
|
+
}
|
|
243
|
+
|
|
202
244
|
/* ── appearance ────────────────────────────────────────────────────────── */
|
|
203
245
|
|
|
204
246
|
/*
|
package/dist/TagsInput/index.js
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** What a reader can ask the palette to be. `system` follows the platform. */
|
|
2
|
+
export type ThemePreference = 'system' | 'light' | 'dark';
|
|
3
|
+
/** How much room the interface gives itself. `normal` is the unscaled step. */
|
|
4
|
+
export type DensityPreference = 'normal' | 'compact' | 'comfortable';
|
|
5
|
+
/** Every theme preference, in the order a control offers them. */
|
|
6
|
+
export declare const THEME_PREFERENCES: readonly ["system", "light", "dark"];
|
|
7
|
+
/** Every density, in the order a control offers them. */
|
|
8
|
+
export declare const DENSITY_PREFERENCES: readonly ["normal", "compact", "comfortable"];
|
|
9
|
+
/**
|
|
10
|
+
* The shape a palette id has: the theme's folder name in `@crewlethq/tokens`,
|
|
11
|
+
* which a stylesheet quotes as an attribute value without escaping. A value
|
|
12
|
+
* outside it is refused rather than written, because it arrives from storage
|
|
13
|
+
* or from another document, and the attribute is read by a selector.
|
|
14
|
+
*/
|
|
15
|
+
export declare const PALETTE_ID: RegExp;
|
|
16
|
+
export declare function isThemePreference(value: unknown): value is ThemePreference;
|
|
17
|
+
export declare function isDensityPreference(value: unknown): value is DensityPreference;
|
|
18
|
+
export declare function isPaletteId(value: unknown): value is string;
|
|
19
|
+
/**
|
|
20
|
+
* Puts the theme on the root element.
|
|
21
|
+
*
|
|
22
|
+
* `system` REMOVES the attribute rather than writing a third value, because
|
|
23
|
+
* following the system IS the absence of a choice, and the stylesheet's own
|
|
24
|
+
* default is the system's: a document with no attribute is dark, or light
|
|
25
|
+
* where the platform asks for light. What beats the system is an explicit
|
|
26
|
+
* value, in both directions: `light` by a block of its own, `dark` by keeping
|
|
27
|
+
* the light media block from matching. A `data-theme="system"` names no
|
|
28
|
+
* palette, so it would be a choice only to the code that asks whether the
|
|
29
|
+
* attribute is there at all, which is the wrong answer to give it.
|
|
30
|
+
*/
|
|
31
|
+
export declare function applyTheme(theme: ThemePreference, root?: Element | null): void;
|
|
32
|
+
/** Puts the density on the root element. `normal` removes the attribute. */
|
|
33
|
+
export declare function applyDensity(density: DensityPreference, root?: Element | null): void;
|
|
34
|
+
/**
|
|
35
|
+
* Puts a named theme on the root element.
|
|
36
|
+
*
|
|
37
|
+
* The default theme REMOVES the attribute, for the reason `system` does: the
|
|
38
|
+
* default paints the bare root and has no block of its own under the
|
|
39
|
+
* attribute, so writing its id would select nothing. An id that is not the
|
|
40
|
+
* shape of one is refused with an error rather than written, because the
|
|
41
|
+
* caller handed over something that was never a palette.
|
|
42
|
+
*/
|
|
43
|
+
export declare function applyPalette(palette: string, root?: Element | null): void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { DensitySwitcher, ThemeSwitcher } from './ThemeSwitcher.js';
|
|
2
2
|
export type { DensitySwitcherProps, PreferenceControl, ThemeSwitcherProps } from './ThemeSwitcher.js';
|
|
3
|
-
export { applyDensity,
|
|
4
|
-
export
|
|
3
|
+
export { applyDensity, applyPalette, applyTheme, DENSITY_PREFERENCES, isDensityPreference, isPaletteId, isThemePreference, PALETTE_ID, THEME_PREFERENCES, } from './apply.js';
|
|
4
|
+
export { applyStoredPreferences, resolveTheme, useDensityPreference, useSystemTheme, useThemePreference, } from './preferences.js';
|
|
5
|
+
export type { DensityPreference, ThemePreference } from './apply.js';
|
|
6
|
+
export type { PreferenceOptions, ResolvedTheme, StoredPreferences } from './preferences.js';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export { DensitySwitcher, ThemeSwitcher } from '../chunk-
|
|
2
|
-
export {
|
|
1
|
+
export { DensitySwitcher, ThemeSwitcher } from '../chunk-2ONWEDQT.js';
|
|
2
|
+
export { applyStoredPreferences, resolveTheme, useDensityPreference, useSystemTheme, useThemePreference } from '../chunk-Z24ZUSTX.js';
|
|
3
3
|
import '../chunk-VYY56AMX.js';
|
|
4
|
+
export { DENSITY_PREFERENCES, PALETTE_ID, THEME_PREFERENCES, applyDensity, applyPalette, applyTheme, isDensityPreference, isPaletteId, isThemePreference } from '../chunk-ZXXDZJQN.js';
|
|
4
5
|
import '../chunk-26PEPONN.js';
|
|
5
6
|
import '../chunk-4LDTQWS7.js';
|
|
6
7
|
import '../chunk-CBOICT64.js';
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export type
|
|
3
|
-
/** How much room the interface gives itself. `normal` is the unscaled step. */
|
|
4
|
-
export type DensityPreference = 'normal' | 'compact' | 'comfortable';
|
|
5
|
-
/**
|
|
6
|
-
* Puts the theme on the root element.
|
|
7
|
-
*
|
|
8
|
-
* `system` REMOVES the attribute rather than writing a third value, because
|
|
9
|
-
* following the system IS the absence of a choice, and the stylesheet's own
|
|
10
|
-
* default is the system's: a document with no attribute is dark, or light
|
|
11
|
-
* where the platform asks for light. What beats the system is an explicit
|
|
12
|
-
* value, in both directions: `light` by a block of its own, `dark` by keeping
|
|
13
|
-
* the light media block from matching. A `data-theme="system"` names no
|
|
14
|
-
* palette, so it would be a choice only to the code that asks whether the
|
|
15
|
-
* attribute is there at all, which is the wrong answer to give it.
|
|
16
|
-
*/
|
|
17
|
-
export declare function applyTheme(theme: ThemePreference): void;
|
|
18
|
-
/** Puts the density on the root element. `normal` removes the attribute. */
|
|
19
|
-
export declare function applyDensity(density: DensityPreference): void;
|
|
1
|
+
import { type DensityPreference, type ThemePreference } from './apply.js';
|
|
2
|
+
export type { DensityPreference, ThemePreference } from './apply.js';
|
|
20
3
|
export interface PreferenceOptions {
|
|
21
4
|
/** Where the choice is kept. An application picks its own name. */
|
|
22
5
|
storageKey: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { ThemeToggle } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ThemeToggle } from '../chunk-NP2C4Y4E.js';
|
|
2
|
+
import '../chunk-Z24ZUSTX.js';
|
|
3
|
+
import '../chunk-ZXXDZJQN.js';
|
|
3
4
|
import '../chunk-4FQT6ZAY.js';
|
|
4
5
|
import '../chunk-BZFWDIV6.js';
|
|
5
6
|
import '../chunk-ODEQTPFM.js';
|