basalt-ui 2.27.2 → 2.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +466 -307
- package/MIGRATING.md +358 -12
- package/agent/rules/basalt-batteries.md +1 -1
- package/agent/rules/basalt-mantine.md +1 -1
- package/agent/rules/basalt-tokens.md +2 -2
- package/agent/skills/basalt-app/SKILL.md +3 -3
- package/agent/skills/basalt-charts/SKILL.md +1 -1
- package/agent/skills/basalt-design/SKILL.md +12 -6
- package/agent/skills/basalt-design/references/catalogue.md +42 -36
- package/agent/skills/basalt-design/references/recipes.md +47 -0
- package/agent/skills/basalt-design/references/states.md +1 -1
- package/configs/oxlint-basalt.json +2 -1
- package/configs/oxlint-plugin.js +112 -3
- package/configs/oxlint-plugin.test.ts +99 -4
- package/configs/oxlint.json +1 -0
- package/dist/agent/chat/thread-message.d.ts +1 -160
- package/dist/agent/chat/thread-message.d.ts.map +1 -1
- package/dist/agent/chat/thread-message.js +7 -162
- package/dist/agent/chat/virtualize.d.ts +5 -5
- package/dist/charts/ChartCard.d.ts +14 -7
- package/dist/charts/ChartCard.d.ts.map +1 -1
- package/dist/charts/ChartCard.js +112 -23
- package/dist/charts/Lines.d.ts.map +1 -1
- package/dist/charts/Lines.js +11 -4
- package/dist/charts/Sparkline.d.ts +14 -2
- package/dist/charts/Sparkline.d.ts.map +1 -1
- package/dist/charts/Sparkline.js +155 -44
- package/dist/charts/chart-box.module.css +59 -2
- package/dist/charts/chart-box.module.css.d.ts +5 -0
- package/dist/charts/chart-card.module.css +28 -17
- package/dist/charts/chart-card.module.css.d.ts +3 -0
- package/dist/charts/compile.d.ts +1 -1
- package/dist/charts/compile.d.ts.map +1 -1
- package/dist/charts/compile.js +38 -27
- package/dist/charts/labels.d.ts +13 -3
- package/dist/charts/labels.d.ts.map +1 -1
- package/dist/charts/labels.js +131 -20
- package/dist/charts/legend.d.ts.map +1 -1
- package/dist/charts/legend.js +1 -1
- package/dist/charts/ref-label.d.ts +37 -8
- package/dist/charts/ref-label.d.ts.map +1 -1
- package/dist/charts/ref-label.js +55 -10
- package/dist/charts/sparkline.module.css +50 -0
- package/dist/charts/sparkline.module.css.d.ts +3 -0
- package/dist/charts/state.d.ts +4 -4
- package/dist/charts/state.d.ts.map +1 -1
- package/dist/charts/state.js +23 -5
- package/dist/cli/doctor-upgrade.d.ts +11 -0
- package/dist/cli/doctor-upgrade.d.ts.map +1 -1
- package/dist/cli/doctor-upgrade.js +54 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +32 -0
- package/dist/cli/help.d.ts.map +1 -1
- package/dist/cli/help.js +8 -3
- package/dist/cli/index.d.ts +13 -13
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +36 -2
- package/dist/cli/init.d.ts +6 -0
- package/dist/cli/init.d.ts.map +1 -1
- package/dist/cli/init.js +118 -27
- package/dist/cli/router-wiring.d.ts +3 -0
- package/dist/cli/router-wiring.d.ts.map +1 -1
- package/dist/cli/router-wiring.js +2 -0
- package/dist/cli/shot/capture.d.ts +34 -2
- package/dist/cli/shot/capture.d.ts.map +1 -1
- package/dist/cli/shot/capture.js +95 -12
- package/dist/cli/shot/detect.d.ts +4 -1
- package/dist/cli/shot/detect.d.ts.map +1 -1
- package/dist/cli/shot/detect.js +38 -16
- package/dist/cli/shot/index.d.ts.map +1 -1
- package/dist/cli/shot/index.js +9 -2
- package/dist/cli/shot/measure.d.ts.map +1 -1
- package/dist/cli/shot/measure.js +11 -2
- package/dist/cli/shot/types.d.ts +4 -1
- package/dist/cli/shot/types.d.ts.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +10 -2
- package/dist/common/could-not-load.d.ts +13 -0
- package/dist/common/could-not-load.d.ts.map +1 -0
- package/dist/common/could-not-load.js +14 -0
- package/dist/common/empty-copy.d.ts +16 -0
- package/dist/common/empty-copy.d.ts.map +1 -0
- package/dist/common/empty-copy.js +9 -0
- package/dist/common/index.d.ts +1 -0
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +3 -0
- package/dist/common/props.d.ts +20 -0
- package/dist/common/props.d.ts.map +1 -1
- package/dist/common/props.js +13 -1
- package/dist/common/retry-button.module.css +7 -3
- package/dist/common/virtual-rows.d.ts +196 -0
- package/dist/common/virtual-rows.d.ts.map +1 -0
- package/dist/common/virtual-rows.js +290 -0
- package/dist/controls/controls.module.css +33 -1
- package/dist/controls/controls.module.css.d.ts +2 -0
- package/dist/controls/enum-filter.d.ts.map +1 -1
- package/dist/controls/enum-filter.js +8 -2
- package/dist/controls/filter-pill.d.ts +27 -3
- package/dist/controls/filter-pill.d.ts.map +1 -1
- package/dist/controls/filter-pill.js +15 -4
- package/dist/controls/form-layout.d.ts +9 -3
- package/dist/controls/form-layout.d.ts.map +1 -1
- package/dist/controls/form-layout.js +74 -12
- package/dist/controls/form-layout.module.css +112 -7
- package/dist/controls/form-layout.module.css.d.ts +1 -0
- package/dist/controls/multi-select-filter.d.ts +2 -2
- package/dist/controls/multi-select-filter.d.ts.map +1 -1
- package/dist/controls/multi-select-filter.js +12 -6
- package/dist/controls/range-filter.d.ts +1 -1
- package/dist/controls/range-filter.d.ts.map +1 -1
- package/dist/controls/range-filter.js +8 -2
- package/dist/dashboard/bar-list.d.ts +5 -5
- package/dist/dashboard/bar-list.d.ts.map +1 -1
- package/dist/dashboard/bar-list.js +15 -8
- package/dist/dashboard/bar-list.module.css +21 -5
- package/dist/dashboard/board-nav.d.ts +22 -0
- package/dist/dashboard/board-nav.d.ts.map +1 -0
- package/dist/dashboard/board-nav.js +49 -0
- package/dist/dashboard/board.d.ts +52 -0
- package/dist/dashboard/board.d.ts.map +1 -0
- package/dist/dashboard/board.js +247 -0
- package/dist/dashboard/board.module.css +179 -0
- package/dist/dashboard/board.module.css.d.ts +28 -0
- package/dist/dashboard/empty-state.d.ts +6 -6
- package/dist/dashboard/empty-state.d.ts.map +1 -1
- package/dist/dashboard/empty-state.js +17 -8
- package/dist/dashboard/event-list-model.d.ts +54 -0
- package/dist/dashboard/event-list-model.d.ts.map +1 -0
- package/dist/dashboard/event-list-model.js +76 -0
- package/dist/dashboard/event-list-rows.d.ts +23 -0
- package/dist/dashboard/event-list-rows.d.ts.map +1 -0
- package/dist/dashboard/event-list-rows.js +89 -0
- package/dist/dashboard/event-list-scroll.d.ts +55 -0
- package/dist/dashboard/event-list-scroll.d.ts.map +1 -0
- package/dist/dashboard/event-list-scroll.js +216 -0
- package/dist/dashboard/event-list-skeleton.d.ts +10 -0
- package/dist/dashboard/event-list-skeleton.d.ts.map +1 -0
- package/dist/dashboard/event-list-skeleton.js +34 -0
- package/dist/dashboard/event-list.d.ts +65 -0
- package/dist/dashboard/event-list.d.ts.map +1 -0
- package/dist/dashboard/event-list.js +208 -0
- package/dist/dashboard/event-list.module.css +336 -0
- package/dist/dashboard/event-list.module.css.d.ts +34 -0
- package/dist/dashboard/index.d.ts +2 -0
- package/dist/dashboard/index.d.ts.map +1 -1
- package/dist/dashboard/index.js +4 -0
- package/dist/dashboard/meter-model.d.ts +6 -3
- package/dist/dashboard/meter-model.d.ts.map +1 -1
- package/dist/dashboard/meter-model.js +9 -4
- package/dist/dashboard/meter-parts.d.ts +3 -0
- package/dist/dashboard/meter-parts.d.ts.map +1 -1
- package/dist/dashboard/meter-parts.js +36 -6
- package/dist/dashboard/meter.d.ts +3 -3
- package/dist/dashboard/meter.d.ts.map +1 -1
- package/dist/dashboard/meter.js +10 -2
- package/dist/dashboard/meter.module.css +20 -12
- package/dist/dashboard/meter.module.css.d.ts +0 -1
- package/dist/dashboard/page-summary.d.ts +3 -3
- package/dist/dashboard/page-summary.d.ts.map +1 -1
- package/dist/dashboard/page-summary.js +7 -2
- package/dist/dashboard/page-summary.module.css +5 -2
- package/dist/dashboard/query-state.d.ts +9 -8
- package/dist/dashboard/query-state.d.ts.map +1 -1
- package/dist/dashboard/query-state.js +29 -11
- package/dist/dashboard/section.d.ts +11 -3
- package/dist/dashboard/section.d.ts.map +1 -1
- package/dist/dashboard/section.js +34 -7
- package/dist/dashboard/settings-section.d.ts +8 -5
- package/dist/dashboard/settings-section.d.ts.map +1 -1
- package/dist/dashboard/settings-section.js +12 -8
- package/dist/dashboard/settings-section.module.css +25 -4
- package/dist/dashboard/settings-section.module.css.d.ts +1 -0
- package/dist/dashboard/stat-card-parts.d.ts +5 -1
- package/dist/dashboard/stat-card-parts.d.ts.map +1 -1
- package/dist/dashboard/stat-card-parts.js +8 -3
- package/dist/dashboard/stat-card.d.ts +3 -3
- package/dist/dashboard/stat-card.d.ts.map +1 -1
- package/dist/dashboard/stat-card.js +47 -12
- package/dist/dashboard/stat-card.module.css +42 -7
- package/dist/dashboard/stat-card.module.css.d.ts +3 -0
- package/dist/dashboard/stat-group.d.ts +2 -2
- package/dist/dashboard/stat-group.d.ts.map +1 -1
- package/dist/dashboard/stat-group.js +10 -3
- package/dist/dashboard/stat-strip.d.ts +5 -4
- package/dist/dashboard/stat-strip.d.ts.map +1 -1
- package/dist/dashboard/stat-strip.js +41 -31
- package/dist/dashboard/stat-strip.module.css +8 -6
- package/dist/dashboard/visual-slot.d.ts +4 -0
- package/dist/dashboard/visual-slot.d.ts.map +1 -1
- package/dist/dashboard/visual-slot.js +2 -0
- package/dist/dashboard/widget-header.d.ts +6 -6
- package/dist/dashboard/widget-header.d.ts.map +1 -1
- package/dist/dashboard/widget-header.js +4 -2
- package/dist/dashboard/widget-header.module.css +12 -15
- package/dist/format/shared.d.ts.map +1 -1
- package/dist/format/shared.js +24 -1
- package/dist/guard/index.d.ts +1 -1
- package/dist/guard/index.d.ts.map +1 -1
- package/dist/guard/index.js +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/shell/app-main.module.css +18 -0
- package/dist/styles.css +69 -0
- package/dist/surfaces.d.ts +2 -2
- package/dist/surfaces.d.ts.map +1 -1
- package/dist/surfaces.js +8 -2
- package/dist/table/cell-kinds.d.ts +47 -0
- package/dist/table/cell-kinds.d.ts.map +1 -0
- package/dist/table/cell-kinds.js +180 -0
- package/dist/table/cell-kinds.module.css +55 -0
- package/dist/table/cell-kinds.module.css.d.ts +15 -0
- package/dist/table/data-table-fold.d.ts +155 -0
- package/dist/table/data-table-fold.d.ts.map +1 -0
- package/dist/table/data-table-fold.js +320 -0
- package/dist/table/data-table-state.d.ts +10 -3
- package/dist/table/data-table-state.d.ts.map +1 -1
- package/dist/table/data-table-state.js +11 -6
- package/dist/table/data-table.d.ts +13 -28
- package/dist/table/data-table.d.ts.map +1 -1
- package/dist/table/data-table.js +362 -255
- package/dist/table/data-table.module.css +282 -3
- package/dist/table/data-table.module.css.d.ts +16 -0
- package/dist/table/table-features.d.ts +34 -4
- package/dist/table/table-features.d.ts.map +1 -1
- package/dist/table/table-features.js +10 -0
- package/dist/theme/card-inset.module.css +35 -0
- package/dist/theme/controls.module.css +55 -2
- package/dist/theme/ctl-theme.d.ts.map +1 -1
- package/dist/theme/ctl-theme.js +5 -0
- package/dist/theme/index.d.ts.map +1 -1
- package/dist/theme/index.js +14 -10
- package/dist/tokens/core.d.ts +1 -0
- package/dist/tokens/core.d.ts.map +1 -1
- package/dist/tokens/core.js +1 -0
- package/dist/tokens/derive.js +1 -1
- package/dist/tokens/palette.d.ts +2 -1
- package/dist/tokens/palette.d.ts.map +1 -1
- package/llms.txt +295 -5
- package/package.json +1 -1
- package/src/agent/chat/thread-message.tsx +10 -403
- package/src/agent/chat/virtualize.ts +5 -5
- package/src/charts/ChartCard.tsx +175 -31
- package/src/charts/Lines.tsx +13 -4
- package/src/charts/Sparkline.tsx +213 -48
- package/src/charts/chart-box.module.css +59 -2
- package/src/charts/chart-box.module.css.d.ts +5 -0
- package/src/charts/chart-card.module.css +28 -17
- package/src/charts/chart-card.module.css.d.ts +3 -0
- package/src/charts/compile.ts +59 -33
- package/src/charts/labels.ts +175 -24
- package/src/charts/legend.tsx +3 -2
- package/src/charts/ref-label.ts +114 -18
- package/src/charts/sparkline.module.css +50 -0
- package/src/charts/sparkline.module.css.d.ts +3 -0
- package/src/charts/state.tsx +40 -10
- package/src/cli/doctor-upgrade.ts +75 -0
- package/src/cli/doctor.ts +36 -0
- package/src/cli/help.ts +16 -6
- package/src/cli/index.ts +73 -67
- package/src/cli/init.ts +157 -36
- package/src/cli/router-wiring.ts +2 -2
- package/src/cli/shot/capture.ts +138 -16
- package/src/cli/shot/detect.ts +46 -22
- package/src/cli/shot/index.ts +8 -2
- package/src/cli/shot/measure.ts +11 -2
- package/src/cli/shot/types.ts +4 -1
- package/src/cli/sync.ts +12 -2
- package/src/common/could-not-load.ts +22 -0
- package/src/common/empty-copy.ts +17 -0
- package/src/common/index.ts +1 -0
- package/src/common/props.ts +30 -0
- package/src/common/retry-button.module.css +7 -3
- package/src/common/virtual-rows.tsx +682 -0
- package/src/controls/controls.module.css +33 -1
- package/src/controls/controls.module.css.d.ts +2 -0
- package/src/controls/enum-filter.tsx +8 -2
- package/src/controls/filter-pill.tsx +80 -27
- package/src/controls/form-layout.module.css +112 -7
- package/src/controls/form-layout.module.css.d.ts +1 -0
- package/src/controls/form-layout.tsx +115 -22
- package/src/controls/multi-select-filter.tsx +22 -11
- package/src/controls/range-filter.tsx +9 -3
- package/src/dashboard/bar-list.module.css +21 -5
- package/src/dashboard/bar-list.tsx +53 -45
- package/src/dashboard/board-nav.ts +67 -0
- package/src/dashboard/board.module.css +179 -0
- package/src/dashboard/board.module.css.d.ts +28 -0
- package/src/dashboard/board.tsx +415 -0
- package/src/dashboard/empty-state.tsx +21 -11
- package/src/dashboard/event-list-model.ts +125 -0
- package/src/dashboard/event-list-rows.tsx +117 -0
- package/src/dashboard/event-list-scroll.ts +291 -0
- package/src/dashboard/event-list-skeleton.tsx +62 -0
- package/src/dashboard/event-list.module.css +336 -0
- package/src/dashboard/event-list.module.css.d.ts +34 -0
- package/src/dashboard/event-list.tsx +336 -0
- package/src/dashboard/index.ts +2 -0
- package/src/dashboard/meter-model.ts +16 -7
- package/src/dashboard/meter-parts.tsx +53 -14
- package/src/dashboard/meter.module.css +20 -12
- package/src/dashboard/meter.module.css.d.ts +0 -1
- package/src/dashboard/meter.tsx +36 -18
- package/src/dashboard/page-summary.module.css +5 -2
- package/src/dashboard/page-summary.tsx +13 -6
- package/src/dashboard/query-state.tsx +55 -30
- package/src/dashboard/section.tsx +83 -41
- package/src/dashboard/settings-section.module.css +25 -4
- package/src/dashboard/settings-section.module.css.d.ts +1 -0
- package/src/dashboard/settings-section.tsx +18 -8
- package/src/dashboard/stat-card-parts.tsx +20 -3
- package/src/dashboard/stat-card.module.css +42 -7
- package/src/dashboard/stat-card.module.css.d.ts +3 -0
- package/src/dashboard/stat-card.tsx +55 -13
- package/src/dashboard/stat-group.tsx +22 -14
- package/src/dashboard/stat-strip.module.css +8 -6
- package/src/dashboard/stat-strip.tsx +29 -20
- package/src/dashboard/visual-slot.ts +5 -0
- package/src/dashboard/widget-header.module.css +12 -15
- package/src/dashboard/widget-header.tsx +8 -5
- package/src/format/shared.ts +30 -1
- package/src/guard/index.ts +7 -1
- package/src/index.ts +4 -0
- package/src/shell/app-main.module.css +18 -0
- package/src/styles.css +69 -0
- package/src/surfaces.ts +7 -1
- package/src/table/cell-kinds.module.css +55 -0
- package/src/table/cell-kinds.module.css.d.ts +15 -0
- package/src/table/cell-kinds.tsx +263 -0
- package/src/table/data-table-fold.tsx +567 -0
- package/src/table/data-table-state.ts +24 -13
- package/src/table/data-table.module.css +282 -3
- package/src/table/data-table.module.css.d.ts +16 -0
- package/src/table/data-table.tsx +430 -362
- package/src/table/table-features.ts +44 -4
- package/src/theme/__snapshots__/plain-theme.test.ts.snap +2 -66
- package/src/theme/card-inset.module.css +35 -0
- package/src/theme/controls.module.css +55 -2
- package/src/theme/ctl-theme.tsx +8 -0
- package/src/theme/index.ts +12 -8
- package/src/tokens/core.ts +1 -0
- package/src/tokens/derive.ts +1 -1
- package/src/tokens/palette.ts +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/format/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,WAAM,CAAA;AAE7B,sDAAsD;AACtD,MAAM,MAAM,YAAY,GAAG;IACzB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,CAAA;AAWD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,cAAmB,GAAG,IAAI,CAS5D;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,IAAI,IAAI,CAI1C;AAkCD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEjE;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,mBAAmB,GAChC,IAAI,CAAC,YAAY,CAGnB;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,qBAAqB,GAClC,IAAI,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/format/shared.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU,WAAM,CAAA;AAE7B,sDAAsD;AACtD,MAAM,MAAM,YAAY,GAAG;IACzB,4FAA4F;IAC5F,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC5B,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC3B,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC9B,CAAA;AAWD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,IAAI,GAAE,cAAmB,GAAG,IAAI,CAS5D;AAED,0FAA0F;AAC1F,wBAAgB,mBAAmB,IAAI,IAAI,CAI1C;AAkCD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEjE;AAED,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,mBAAmB,GAChC,IAAI,CAAC,YAAY,CAGnB;AAED,wBAAgB,UAAU,CACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,OAAO,EAAE,IAAI,CAAC,qBAAqB,GAClC,IAAI,CAAC,cAAc,CASrB;AA6BD,mDAAmD;AACnD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAA;AAE/C;+DAC+D;AAC/D,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAE9D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAUlC;AAED;;;;0DAI0D;AAC1D,wBAAgB,MAAM,CAAC,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,CAGjE"}
|
package/dist/format/shared.js
CHANGED
|
@@ -48,7 +48,30 @@ function numberFormat(locale, options) {
|
|
|
48
48
|
function dateFormat(locale, options) {
|
|
49
49
|
const resolved = resolveLocale(locale);
|
|
50
50
|
const withZone = options.timeZone === void 0 && defaults.timeZone !== void 0 ? { ...options, timeZone: defaults.timeZone } : options;
|
|
51
|
-
return memoize(
|
|
51
|
+
return memoize(
|
|
52
|
+
dateCaches,
|
|
53
|
+
resolved,
|
|
54
|
+
withZone,
|
|
55
|
+
() => shortSeptember(new Intl.DateTimeFormat(resolved, withZone))
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
const toShortSeptember = (text) => text.replace(/\bSept\b/g, "Sep");
|
|
59
|
+
function shortSeptember(formatter) {
|
|
60
|
+
if (!formatter.resolvedOptions().locale.startsWith("en")) return formatter;
|
|
61
|
+
const nativeFormat = formatter.format;
|
|
62
|
+
const nativeParts = formatter.formatToParts.bind(formatter);
|
|
63
|
+
const format = (date) => toShortSeptember(nativeFormat(date));
|
|
64
|
+
const formatToParts = (date) => nativeParts(date).map(
|
|
65
|
+
(part) => part.type === "month" ? { ...part, value: toShortSeptember(part.value) } : part
|
|
66
|
+
);
|
|
67
|
+
const nativeRange = formatter.formatRange.bind(formatter);
|
|
68
|
+
const formatRange = (start, end) => toShortSeptember(nativeRange(start, end));
|
|
69
|
+
Object.defineProperties(formatter, {
|
|
70
|
+
format: { value: format },
|
|
71
|
+
formatRange: { value: formatRange },
|
|
72
|
+
formatToParts: { value: formatToParts }
|
|
73
|
+
});
|
|
74
|
+
return formatter;
|
|
52
75
|
}
|
|
53
76
|
function isFiniteNumber(value) {
|
|
54
77
|
return typeof value === "number" && Number.isFinite(value);
|
package/dist/guard/index.d.ts
CHANGED
|
@@ -201,7 +201,7 @@ export declare const GUARD_RULES: {
|
|
|
201
201
|
readonly kind: "raw-spacing";
|
|
202
202
|
readonly pattern: (cfg: GuardConfig) => RegExp;
|
|
203
203
|
readonly appliesTo: (relPath: string) => boolean;
|
|
204
|
-
readonly message:
|
|
204
|
+
readonly message: `Use the Mantine spacing token, not the number (p/m/gap): ${string}. A number that equals a step IS that token.`;
|
|
205
205
|
};
|
|
206
206
|
readonly 'raw-radius': {
|
|
207
207
|
readonly kind: "raw-radius";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;AAgU9D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CA8BpE,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/guard/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAO7E,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,CAAA;AAgU9D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC,CA8BpE,CAAA;AAkdD,8EAA8E;AAC9E,eAAO,MAAM,oBAAoB,EAAE,WAiBlC,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAM,CAAA;AAE5E,gGAAgG;AAChG,wBAAgB,UAAU,CAAC,IAAI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+BvB;AAED,kGAAkG;AAClG,eAAO,MAAM,uBAAuB,6BAA6B,CAAA;AAEjE;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,GAAG,MAAM,CAM9F"}
|
package/dist/guard/index.js
CHANGED
|
@@ -237,6 +237,7 @@ const SUB_16_FONT_SIZE = /font-?[Ss]ize\s*:\s*['"]?(-?\d+(?:\.\d+)?)(?:px)?['"]?
|
|
|
237
237
|
const DEFAULT_SPACING_STEPS = Object.values(SPACE_SCALE_LEVEL0).toSorted(
|
|
238
238
|
(a, b) => a - b
|
|
239
239
|
);
|
|
240
|
+
const SPACING_TOKEN_LIST = Object.entries(SPACE_SCALE_LEVEL0).map(([name, px]) => `${px} \u2192 "${name}"`).join(", ");
|
|
240
241
|
const DEFAULT_FORBIDDEN_ACCENTS = ["teal", "violet", "grape", "indigo", "pink"];
|
|
241
242
|
const DEFAULT_GUARD_CONFIG = {
|
|
242
243
|
spacingSteps: DEFAULT_SPACING_STEPS,
|
|
@@ -348,6 +349,8 @@ const PLUGIN_RULE_IDS = /* @__PURE__ */ new Set([
|
|
|
348
349
|
"no-dev-helper",
|
|
349
350
|
// AST-only: a `<ViewTransition>` ancestor of `<Outlet>` is a JSX-ancestry claim over two import-resolved names.
|
|
350
351
|
"route-view-transition",
|
|
352
|
+
// AST-only: a text-colour position (`c=`, a `style` object's `color`) is a JSX/property claim over a member chain.
|
|
353
|
+
"status-fill-as-text",
|
|
351
354
|
// These two honour `basalt-agent-allow`, never `theme-allow` — but they are still REAL ids, so
|
|
352
355
|
// a `theme-allow ai-sdk-major` must parse as a (useless) scoped annotation rather than as prose.
|
|
353
356
|
"agent-no-raw-usechat",
|
|
@@ -781,7 +784,7 @@ const GUARD_RULES = {
|
|
|
781
784
|
// JSX-prop-shaped (`p={16}`) — CSS has no `=`/`{}` prop syntax; gated off explicitly (see
|
|
782
785
|
// off-identity-accent above for why "never matches today" still gets an explicit gate).
|
|
783
786
|
appliesTo: (relPath) => !relPath.endsWith(".css"),
|
|
784
|
-
message:
|
|
787
|
+
message: `Use the Mantine spacing token, not the number (p/m/gap): ${SPACING_TOKEN_LIST}. A number that equals a step IS that token.`
|
|
785
788
|
},
|
|
786
789
|
"raw-radius": {
|
|
787
790
|
kind: "raw-radius",
|
package/dist/index.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export { ThemeToggle } from './theme/theme-toggle.js';
|
|
|
15
15
|
export { StatusDot, type StatusDotProps } from './theme/status-dot.js';
|
|
16
16
|
export { StatusVerdict, type StatusVerdictProps } from './theme/status-verdict.js';
|
|
17
17
|
export { BasaltShell, PageBar, PageAside, useSizeClass, PageTitle, type ShellBaseProps, type SidebarBlock, type SettingsMenuItem, } from './shell/index.js';
|
|
18
|
-
export { WidgetHeader, DeltaBadge, Section, StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, StatGroup, type StatStripCell, type StatStripRow, EmptyState, SettingsSection, SettingsRow, DangerZone, Meter, type MeterProps, type MeterSegment, type MeterTick, type MeterZone, BarList, type BarListProps, PageSummary, type PageSummaryProps, } from './dashboard/index.js';
|
|
18
|
+
export { WidgetHeader, DeltaBadge, Section, StatCard, type StatCardBreakdownRow, type StatCardSparklineSize, StatGroup, type StatStripCell, type StatStripRow, EmptyState, SettingsSection, SettingsRow, DangerZone, Meter, type MeterProps, type MeterSegment, type MeterTick, type MeterZone, BarList, type BarListProps, EventList, type EventListProps, Board, type BoardProps, PageSummary, type PageSummaryProps, } from './dashboard/index.js';
|
|
19
19
|
export { unwrap } from './unwrap.js';
|
|
20
20
|
export type { BasaltRegister, SeriesKey } from './register.js';
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAA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AAW,EACX,UAAU,EACV,KAAK,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,OAAO,EACP,KAAK,YAAY,EACjB,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,EACL,KAAK,UAAU,EACf,WAAW,EACX,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAMjC,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,8 @@ import {
|
|
|
34
34
|
DangerZone,
|
|
35
35
|
Meter,
|
|
36
36
|
BarList,
|
|
37
|
+
EventList,
|
|
38
|
+
Board,
|
|
37
39
|
PageSummary
|
|
38
40
|
} from "./dashboard/index.js";
|
|
39
41
|
import { unwrap } from "./unwrap.js";
|
|
@@ -41,9 +43,11 @@ export {
|
|
|
41
43
|
BarList,
|
|
42
44
|
BasaltProvider,
|
|
43
45
|
BasaltShell,
|
|
46
|
+
Board,
|
|
44
47
|
DangerZone,
|
|
45
48
|
DeltaBadge,
|
|
46
49
|
EmptyState,
|
|
50
|
+
EventList,
|
|
47
51
|
Meter,
|
|
48
52
|
PageAside,
|
|
49
53
|
PageBar,
|
|
@@ -107,6 +107,24 @@
|
|
|
107
107
|
* table's page-sticky offset reads it instead of repeating this module's `sm` switch.
|
|
108
108
|
*/
|
|
109
109
|
--basalt-main-pad-block: var(--vx-space-stack-md);
|
|
110
|
+
/*
|
|
111
|
+
* PUBLIC `--basalt-main-content-h` — the height of Main's CONTENT box: what an element at
|
|
112
|
+
* `height: var(--basalt-main-content-h)` needs to fill the scrollport with nothing to scroll (a
|
|
113
|
+
* map, an editor, a full-page canvas). Descendants inherit the resolved length.
|
|
114
|
+
*
|
|
115
|
+
* It is the viewport minus the five things that are not content: the header offset, the footer
|
|
116
|
+
* offset PLUS the safe-area inset (same pair as `margin-bottom` above), the band, and Main's block
|
|
117
|
+
* padding twice. The band is `--basalt-page-bar-h` (its content box, published by `PageBar`) plus
|
|
118
|
+
* its own 1 px `border-bottom` the var never counts (`page-aside.module.css` explains the same
|
|
119
|
+
* pixel): `var(--basalt-page-bar-h, -1px) + 1px` adds it only while a band exists and nets to 0
|
|
120
|
+
* without one. `h="100%"` cannot do this job — Main sizes itself by flex, so a percentage height
|
|
121
|
+
* on a child does not resolve against it.
|
|
122
|
+
*/
|
|
123
|
+
--basalt-main-content-h: calc(
|
|
124
|
+
100dvh - var(--app-shell-header-offset, 0px) - var(--app-shell-footer-offset, 0px) -
|
|
125
|
+
env(safe-area-inset-bottom, 0px) - (var(--basalt-page-bar-h, -1px) + 1px) - 2 *
|
|
126
|
+
var(--basalt-main-pad-block)
|
|
127
|
+
);
|
|
110
128
|
padding: var(--basalt-main-pad-block) var(--app-shell-padding);
|
|
111
129
|
/* Without this a wide flex/grid child (a bare table, a nowrap control row) sizes Main to ITSELF. */
|
|
112
130
|
min-width: 0;
|
package/dist/styles.css
CHANGED
|
@@ -153,6 +153,29 @@
|
|
|
153
153
|
font-size: max(var(--basalt-input-fz-floor, 16px), var(--input-fz, 1rem)) !important;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/* Browser autofill paints its own yellow/blue over a field, and a focused Select keeps it. The UA
|
|
157
|
+
background cannot be overridden directly, so the field surface is painted over it with an inset
|
|
158
|
+
shadow and the long transition holds the UA colour off; text and caret keep the ink. A themed
|
|
159
|
+
`.input` sets its own `box-shadow` UNLAYERED, which outranks this layer: `controls.module.css`
|
|
160
|
+
re-points `--field-depth` under `:-webkit-autofill` for those. */
|
|
161
|
+
input:-webkit-autofill,
|
|
162
|
+
input:-webkit-autofill:hover,
|
|
163
|
+
input:-webkit-autofill:focus {
|
|
164
|
+
-webkit-text-fill-color: var(--vx-ink);
|
|
165
|
+
caret-color: var(--vx-ink);
|
|
166
|
+
box-shadow: 0 0 0 100vmax var(--vx-surface-field) inset;
|
|
167
|
+
transition: background-color 600000s 0s;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* A Slider's bar and thumb fill in ink, not the accent, unless it encodes a status: an explicit
|
|
171
|
+
`color=` writes `--slider-color` inline, which outranks this. Mantine's own default sits in
|
|
172
|
+
`@layer mantine`, so this layer wins. In the dark scheme the thumb is filled with the same var,
|
|
173
|
+
a light disc with its white border; the drag-value label does not read it. */
|
|
174
|
+
.mantine-Slider-root,
|
|
175
|
+
.mantine-RangeSlider-root {
|
|
176
|
+
--slider-color: var(--vx-ink);
|
|
177
|
+
}
|
|
178
|
+
|
|
156
179
|
/* `data-numeric` — one typographic law, every element. A number read as a MEASUREMENT (a preset
|
|
157
180
|
like `7d`/`30d`, a KPI value, a table cell, a count tag) is mono with tabular figures, so
|
|
158
181
|
digits line up column-wise and a changing value does not reflow its neighbours. Declared here,
|
|
@@ -386,6 +409,52 @@
|
|
|
386
409
|
}
|
|
387
410
|
}
|
|
388
411
|
|
|
412
|
+
/* MapLibre's compact attribution (Wave 43, argo's astro Map tab). basalt has no maplibre dependency;
|
|
413
|
+
* this only restyles the control a consumer's map renders, onto the radius scale and the micro text
|
|
414
|
+
* size: the shipped 12 px radius on the box and its 24 px button is off the scale and, over a card,
|
|
415
|
+
* a nested step under 3 px. The box takes the control tier (4 px under a flush card), the button the
|
|
416
|
+
* Mantine `xs` step (4 px under the box).
|
|
417
|
+
*
|
|
418
|
+
* UNLAYERED on purpose: `maplibre-gl.css` is unlayered, and an unlayered rule beats every layered
|
|
419
|
+
* one whatever the specificity, so a `@layer basalt` block would lose to it. The doubled `:root`
|
|
420
|
+
* lifts each rule to (0,4,0), over maplibre's highest (0,3,0) (`.maplibregl-ctrl-bottom-left >
|
|
421
|
+
* .maplibregl-ctrl-attrib.maplibregl-compact-show`, which sets its own 12 px radius), whichever
|
|
422
|
+
* stylesheet loads last and in every corner and state. A consumer overrides with a longer selector,
|
|
423
|
+
* or an equal one later in source. `.maplibregl-ctrl-group` is not here: its 4 px radius is already
|
|
424
|
+
* a scale step. */
|
|
425
|
+
:root:root .maplibregl-ctrl.maplibregl-ctrl-attrib {
|
|
426
|
+
border-radius: var(--vx-radius-ctrl);
|
|
427
|
+
background-color: var(--vx-surface-panel);
|
|
428
|
+
color: var(--vx-muted);
|
|
429
|
+
font-size: var(--vx-text-micro);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
:root:root .maplibregl-ctrl-attrib a {
|
|
433
|
+
color: inherit;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/* One step under the box, snapped onto the scale like the SegmentedControl indicator: 2 when the box
|
|
437
|
+
* leaves a 3 px step, else square. */
|
|
438
|
+
:root:root .maplibregl-ctrl-attrib-button {
|
|
439
|
+
/* theme-allow css-raw-surface — a snapped nested step: the scale's 2 px xs, or square under a small box */
|
|
440
|
+
border-radius: round(down, min(2px, max(0px, var(--vx-radius-ctrl) - 3px)), 2px);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/* The glyph is maplibre's dark SVG background-image, drawn again as a mask in the muted ink so it
|
|
444
|
+
* follows the scheme (a `filter` would also invert the button's own fill). */
|
|
445
|
+
:root:root .maplibregl-ctrl-attrib-button {
|
|
446
|
+
background-image: none;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
:root:root .maplibregl-ctrl-attrib-button::after {
|
|
450
|
+
content: '';
|
|
451
|
+
position: absolute;
|
|
452
|
+
inset: 0;
|
|
453
|
+
background-color: var(--vx-muted);
|
|
454
|
+
mask: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M4 10a6 6 0 1 0 12 0 6 6 0 1 0-12 0m5-3a1 1 0 1 0 2 0 1 1 0 1 0-2 0m0 3a1 1 0 1 1 2 0v3a1 1 0 1 1-2 0v-3'/%3E%3C/svg%3E")
|
|
455
|
+
center / 24px 24px no-repeat;
|
|
456
|
+
}
|
|
457
|
+
|
|
389
458
|
/* chart-engine:start — generated by scripts/gen-chart-css.ts from chartEngineCss() */
|
|
390
459
|
@layer basalt {
|
|
391
460
|
:root {
|
package/dist/surfaces.d.ts
CHANGED
|
@@ -32,7 +32,7 @@ export type RuleName = 'tokens' | 'charts' | 'mantine' | 'state' | 'controls' |
|
|
|
32
32
|
* const id: PluginRuleId = 'hand-rolled-filter' // ok
|
|
33
33
|
* // const bad: PluginRuleId = 'hand-rolled-filters' // tsc error
|
|
34
34
|
*/
|
|
35
|
-
export declare const PLUGIN_RULE_ID_LIST: readonly ["no-raw-font-size", "raw-size-literal", "card-inset", "chart-in-raw-surface", "shadow-basalt-export", "hand-rolled-shell", "raw-scroll-container", "hand-rolled-filter", "control-outside-home", "bound-control-outside-home", "control-size-literal", "in-body-page-title", "responsive-twin", "search-literal-link", "use-search-from-literal", "query-fn-unwrap", "forms-field-key", "chart-engine-boundary", "chart-host-single", "token-layer-boundary", "agent-no-raw-usechat", "ai-sdk-major", "no-import-meta-env", "raw-breakpoint", "no-dev-helper", "route-view-transition"];
|
|
35
|
+
export declare const PLUGIN_RULE_ID_LIST: readonly ["no-raw-font-size", "raw-size-literal", "card-inset", "chart-in-raw-surface", "shadow-basalt-export", "hand-rolled-shell", "raw-scroll-container", "hand-rolled-filter", "control-outside-home", "bound-control-outside-home", "control-size-literal", "in-body-page-title", "responsive-twin", "search-literal-link", "use-search-from-literal", "query-fn-unwrap", "forms-field-key", "chart-engine-boundary", "chart-host-single", "token-layer-boundary", "agent-no-raw-usechat", "ai-sdk-major", "no-import-meta-env", "raw-breakpoint", "no-dev-helper", "route-view-transition", "status-fill-as-text"];
|
|
36
36
|
/** One registered oxlint plugin rule id — the literal union of {@link PLUGIN_RULE_ID_LIST}. */
|
|
37
37
|
export type PluginRuleId = (typeof PLUGIN_RULE_ID_LIST)[number];
|
|
38
38
|
/** The 3 shipped skill names (agent/skills/basalt-{name}/SKILL.md, placed into a consumer's
|
|
@@ -205,7 +205,7 @@ export declare const SURFACES: {
|
|
|
205
205
|
readonly rule: "tokens";
|
|
206
206
|
readonly skill: readonly ["basalt-design", "basalt-charts"];
|
|
207
207
|
readonly guardKinds: readonly ["raw-hex", "raw-color-fn", "off-identity-accent", "off-system-surface-var", "raw-font-family", "raw-radius", "raw-surface", "inline-font-size", "css-raw-surface", "surface-shadow-override", "unknown-vx-token", "series-palette", "theme-allow-unscoped"];
|
|
208
|
-
readonly pluginRules: readonly ["no-raw-font-size", "raw-size-literal", "token-layer-boundary"];
|
|
208
|
+
readonly pluginRules: readonly ["no-raw-font-size", "raw-size-literal", "status-fill-as-text", "token-layer-boundary"];
|
|
209
209
|
readonly description: "VX token refs, buildPaletteCss, defineSeries, seriesTokens, groupTokens, alpha (Mantine-free)";
|
|
210
210
|
readonly globs: {
|
|
211
211
|
readonly shipped: readonly ["**/tokens/**"];
|
package/dist/surfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAA;AAE3F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"surfaces.d.ts","sourceRoot":"","sources":["../src/surfaces.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAI9C;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,GAAG,UAAU,GAAG,WAAW,CAAA;AAE3F;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoY2B,CAAA;AAIhD;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,qBAMiB,CAAA;AAIxC;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,sBAMiB,CAAA;AAIzC,wFAAwF;AACxF,eAAO,MAAM,WAAW,qCAAsC,CAAA;AAI9D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,6BAA6B,EAAE,WAAW,CAAC,MAAM,CAAqC,CAAA;AAEnG;;;;;;;;;;;;GAYG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,GACzC,OAAO,CAET"}
|
package/dist/surfaces.js
CHANGED
|
@@ -24,7 +24,8 @@ const PLUGIN_RULE_ID_LIST = [
|
|
|
24
24
|
"no-import-meta-env",
|
|
25
25
|
"raw-breakpoint",
|
|
26
26
|
"no-dev-helper",
|
|
27
|
-
"route-view-transition"
|
|
27
|
+
"route-view-transition",
|
|
28
|
+
"status-fill-as-text"
|
|
28
29
|
];
|
|
29
30
|
const v = (spec, message, extra) => ({
|
|
30
31
|
spec,
|
|
@@ -162,7 +163,12 @@ const SURFACES = {
|
|
|
162
163
|
// The type-scale rules live with the tokens, not with `.`: both police a value that left the
|
|
163
164
|
// `--vx-*` system, which is this surface's whole subject. `token-layer-boundary` is the
|
|
164
165
|
// repo-local-only rule that keeps the layer upstream of Mantine (see below).
|
|
165
|
-
pluginRules: [
|
|
166
|
+
pluginRules: [
|
|
167
|
+
"no-raw-font-size",
|
|
168
|
+
"raw-size-literal",
|
|
169
|
+
"status-fill-as-text",
|
|
170
|
+
"token-layer-boundary"
|
|
171
|
+
],
|
|
166
172
|
description: "VX token refs, buildPaletteCss, defineSeries, seriesTokens, groupTokens, alpha (Mantine-free)",
|
|
167
173
|
globs: {
|
|
168
174
|
shipped: ["**/tokens/**"],
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Cell, Column, Row, RowData } from '@tanstack/react-table';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
import type { BasaltTableFeatures, DataTableAlign, DataTableColumnKind } from './table-features.js';
|
|
4
|
+
/**
|
|
5
|
+
* The table's own default `cell` (TanStack's, restated), installed as `defaultColumn.cell` so a
|
|
6
|
+
* column WITHOUT a renderer is identifiable by identity: v9 merges its default into every
|
|
7
|
+
* `columnDef`, so `columnDef.cell === undefined` can never be asked.
|
|
8
|
+
*/
|
|
9
|
+
export declare function DEFAULT_CELL(props: {
|
|
10
|
+
renderValue(): unknown;
|
|
11
|
+
}): string | null;
|
|
12
|
+
/** Reads `meta.kind`, throwing on a value outside the seven — the check a type cannot make at runtime. */
|
|
13
|
+
export declare function resolveKind<T extends RowData>(column: Column<BasaltTableFeatures, T, unknown>): DataTableColumnKind | undefined;
|
|
14
|
+
/** Figures read right: the kind's default alignment, which an explicit `meta.align` overrides. */
|
|
15
|
+
export declare function kindAlign(kind: DataTableColumnKind | undefined): DataTableAlign | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Column sizing law (SPEC § 6.6): a data column is as wide as its header or widest cell (body cells
|
|
18
|
+
* hold one line), and the slack of a wide container goes to ONE place, so a value sits beside its name:
|
|
19
|
+
* the LAST data column when it is a `text`, `entity` or kindless one (the row's tail reads on after the
|
|
20
|
+
* columns before it); else the LAST `text` column (a notes/detail column that may wrap, ahead of figures);
|
|
21
|
+
* (one whose cells are not all short); else a trailing spacer after the last data column — never an `entity` with columns after it, which
|
|
22
|
+
* would put a short name hundreds of pixels from its next value.
|
|
23
|
+
* `fixedIds` (the checkbox and actions columns) fit too but are not data. An earlier `text` column
|
|
24
|
+
* keeps its auto share (it may wrap) unless every cell it holds is short ({@link SHORT_TEXT} characters:
|
|
25
|
+
* nothing to wrap, so it takes no slack either; `rows` says what it holds), and a table where no column
|
|
26
|
+
* opted into a kind renders as before: no fit marks, no spacer.
|
|
27
|
+
*/
|
|
28
|
+
export declare function planColumnSizing<T extends RowData>(columns: readonly Column<BasaltTableFeatures, T, unknown>[], fixedIds: ReadonlySet<string>, rows: readonly Row<BasaltTableFeatures, T>[]): {
|
|
29
|
+
fitIds: ReadonlySet<string>;
|
|
30
|
+
spacer: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** A loading bar shaped like the kind's value: a figure short and flush right, a chip chip-sized. */
|
|
33
|
+
export declare function KindSkeleton({ kind, right, }: {
|
|
34
|
+
kind: DataTableColumnKind | undefined;
|
|
35
|
+
right: boolean;
|
|
36
|
+
}): ReactNode;
|
|
37
|
+
export declare function kindClass(kind: DataTableColumnKind): string;
|
|
38
|
+
/** The cell of a column with a `kind`: the column's own `cell` if it has one, else the kind's content. */
|
|
39
|
+
export declare function KindCell<T extends RowData>({ kind, cell, }: {
|
|
40
|
+
kind: DataTableColumnKind;
|
|
41
|
+
cell: Cell<BasaltTableFeatures, T, unknown>;
|
|
42
|
+
}): ReactNode;
|
|
43
|
+
/** A cell's content through its kind when it has one — the body cell and the fold disclosure share it. */
|
|
44
|
+
export declare function CellContent<T extends RowData>({ cell, }: {
|
|
45
|
+
cell: Cell<BasaltTableFeatures, T, unknown>;
|
|
46
|
+
}): ReactNode;
|
|
47
|
+
//# sourceMappingURL=cell-kinds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cell-kinds.d.ts","sourceRoot":"","sources":["../../src/table/cell-kinds.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAEvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMtC,OAAO,KAAK,EAAE,mBAAmB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAA;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wBAAgB,WAAW,CAAC,CAAC,SAAS,OAAO,EAAE,EAC7C,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,mBAAmB,EAAE,CAAC,EAAE,OAAO,CAAC,CAAA;CAC5C,GAAG,SAAS,CAGZ"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Badge, Skeleton, Tooltip } from "@mantine/core";
|
|
3
|
+
import { FlexRender } from "@tanstack/react-table";
|
|
4
|
+
import { cx } from "../common/props.js";
|
|
5
|
+
import { Meter } from "../dashboard/meter.js";
|
|
6
|
+
import { dateTime, integer, relativeTime } from "../format/index.js";
|
|
7
|
+
import { numberFormat } from "../format/shared.js";
|
|
8
|
+
import { DATA_TABLE_COLUMN_KINDS } from "./table-features.js";
|
|
9
|
+
import classes from "./cell-kinds.module.css";
|
|
10
|
+
function DEFAULT_CELL(props) {
|
|
11
|
+
return props.renderValue()?.toString?.() ?? null;
|
|
12
|
+
}
|
|
13
|
+
const KINDS = new Set(DATA_TABLE_COLUMN_KINDS);
|
|
14
|
+
function resolveKind(column) {
|
|
15
|
+
const kind = column.columnDef.meta?.kind;
|
|
16
|
+
if (kind === void 0) return void 0;
|
|
17
|
+
if (!KINDS.has(kind)) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
`BasaltDataTable: column "${column.id}" has meta.kind=${JSON.stringify(kind)} \u2014 expected ${DATA_TABLE_COLUMN_KINDS.map((k) => `'${k}'`).join(" | ")}.`
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return kind;
|
|
23
|
+
}
|
|
24
|
+
function kindAlign(kind) {
|
|
25
|
+
return kind === "number" || kind === "money" ? "right" : void 0;
|
|
26
|
+
}
|
|
27
|
+
const SHORT_TEXT = 32;
|
|
28
|
+
function isShortText(id, rows) {
|
|
29
|
+
return rows.length > 0 && rows.every((row) => {
|
|
30
|
+
const value = row.getValue(id);
|
|
31
|
+
return typeof value === "string" && value.length <= SHORT_TEXT;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
function planColumnSizing(columns, fixedIds, rows) {
|
|
35
|
+
const data = columns.filter((column) => !fixedIds.has(column.id));
|
|
36
|
+
const kinds = new Map(data.map((column) => [column.id, resolveKind(column)]));
|
|
37
|
+
const fitIds = new Set(columns.filter((column) => fixedIds.has(column.id)).map((c) => c.id));
|
|
38
|
+
const hasKinds = data.some((column) => kinds.get(column.id) !== void 0);
|
|
39
|
+
if (!hasKinds) return { fitIds, spacer: false };
|
|
40
|
+
const tail = data.at(-1);
|
|
41
|
+
const tailKind = tail === void 0 ? void 0 : kinds.get(tail.id);
|
|
42
|
+
const slackId = tail !== void 0 && (tailKind === void 0 || tailKind === "text" || tailKind === "entity") ? tail.id : data.findLast((column) => kinds.get(column.id) === "text" && !isShortText(column.id, rows))?.id;
|
|
43
|
+
for (const column of data) {
|
|
44
|
+
if (column.id === slackId) continue;
|
|
45
|
+
if (kinds.get(column.id) === "text" && !isShortText(column.id, rows)) continue;
|
|
46
|
+
fitIds.add(column.id);
|
|
47
|
+
}
|
|
48
|
+
return { fitIds, spacer: slackId === void 0 };
|
|
49
|
+
}
|
|
50
|
+
const SKELETON_WIDTH = {
|
|
51
|
+
number: "3rem",
|
|
52
|
+
money: "3rem",
|
|
53
|
+
status: "4.5rem",
|
|
54
|
+
"relative-time": "4.5rem",
|
|
55
|
+
meter: "4rem",
|
|
56
|
+
entity: "min(100%, 10rem)",
|
|
57
|
+
text: "min(100%, 10rem)",
|
|
58
|
+
kindless: "100%"
|
|
59
|
+
};
|
|
60
|
+
function KindSkeleton({
|
|
61
|
+
kind,
|
|
62
|
+
right
|
|
63
|
+
}) {
|
|
64
|
+
const chip = kind === "status";
|
|
65
|
+
const width = SKELETON_WIDTH[kind ?? "kindless"];
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
Skeleton,
|
|
68
|
+
{
|
|
69
|
+
height: chip ? 20 : 16,
|
|
70
|
+
radius: "sm",
|
|
71
|
+
w: width,
|
|
72
|
+
maw: "100%",
|
|
73
|
+
...right && { ml: "auto" }
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
const KIND_CLASS = {
|
|
78
|
+
entity: classes.entity,
|
|
79
|
+
status: classes.status,
|
|
80
|
+
number: classes.number,
|
|
81
|
+
money: classes.number,
|
|
82
|
+
"relative-time": classes.relativeTime,
|
|
83
|
+
meter: classes.meter,
|
|
84
|
+
text: classes.text
|
|
85
|
+
};
|
|
86
|
+
function kindClass(kind) {
|
|
87
|
+
return cx(KIND_CLASS[kind]);
|
|
88
|
+
}
|
|
89
|
+
function formatFigure(value) {
|
|
90
|
+
return Number.isInteger(value) ? integer(value) : numberFormat(void 0, { signDisplay: "negative", maximumFractionDigits: 20 }).format(value);
|
|
91
|
+
}
|
|
92
|
+
function formatMoney(value, currency) {
|
|
93
|
+
const digits = numberFormat(void 0, { style: "currency", currency }).resolvedOptions().maximumFractionDigits;
|
|
94
|
+
return numberFormat(void 0, {
|
|
95
|
+
signDisplay: "negative",
|
|
96
|
+
minimumFractionDigits: digits,
|
|
97
|
+
maximumFractionDigits: digits
|
|
98
|
+
}).format(value);
|
|
99
|
+
}
|
|
100
|
+
const chipColor = (color) => color === void 0 || color === "gray" ? "var(--vx-faint)" : color;
|
|
101
|
+
const Dash = () => /* @__PURE__ */ jsx("span", { className: classes.dash, children: "\u2014" });
|
|
102
|
+
function isAbsent(value) {
|
|
103
|
+
return value === null || value === void 0 || value === "";
|
|
104
|
+
}
|
|
105
|
+
function toDate(value) {
|
|
106
|
+
if (!(value instanceof Date) && typeof value !== "number" && typeof value !== "string") {
|
|
107
|
+
return void 0;
|
|
108
|
+
}
|
|
109
|
+
const date = new Date(value);
|
|
110
|
+
return Number.isNaN(date.getTime()) ? void 0 : date;
|
|
111
|
+
}
|
|
112
|
+
function columnLabel(column) {
|
|
113
|
+
const { header } = column.columnDef;
|
|
114
|
+
return typeof header === "string" ? header : column.id;
|
|
115
|
+
}
|
|
116
|
+
function RelativeTime({ value }) {
|
|
117
|
+
const date = toDate(value);
|
|
118
|
+
if (date === void 0) return /* @__PURE__ */ jsx(Dash, {});
|
|
119
|
+
const full = dateTime(date);
|
|
120
|
+
return (
|
|
121
|
+
// Beside the cell, on hover and keyboard focus: below it the tip covered the next row's time, above it
|
|
122
|
+
// the header's label on row one.
|
|
123
|
+
/* @__PURE__ */ jsx(Tooltip, { label: full, position: "right", events: { hover: true, focus: true, touch: false }, children: /* @__PURE__ */ jsxs("time", { dateTime: date.toISOString(), tabIndex: 0, children: [
|
|
124
|
+
relativeTime(date),
|
|
125
|
+
/* @__PURE__ */ jsx("span", { className: classes.srOnly, children: `, ${full}` })
|
|
126
|
+
] }) })
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
function KindCell({
|
|
130
|
+
kind,
|
|
131
|
+
cell
|
|
132
|
+
}) {
|
|
133
|
+
const { column } = cell;
|
|
134
|
+
const { cell: render, meta } = column.columnDef;
|
|
135
|
+
if (render !== DEFAULT_CELL) return /* @__PURE__ */ jsx(FlexRender, { cell });
|
|
136
|
+
const value = cell.getValue();
|
|
137
|
+
switch (kind) {
|
|
138
|
+
case "number":
|
|
139
|
+
case "money": {
|
|
140
|
+
if (typeof value !== "number" || !Number.isFinite(value)) return /* @__PURE__ */ jsx(Dash, {});
|
|
141
|
+
return kind === "money" ? formatMoney(value, meta?.currency ?? "USD") : formatFigure(value);
|
|
142
|
+
}
|
|
143
|
+
case "relative-time":
|
|
144
|
+
return /* @__PURE__ */ jsx(RelativeTime, { value });
|
|
145
|
+
case "status":
|
|
146
|
+
if (isAbsent(value)) return /* @__PURE__ */ jsx(Dash, {});
|
|
147
|
+
return /* @__PURE__ */ jsx(Badge, { color: chipColor(meta?.statusColor?.(value)), children: String(value) });
|
|
148
|
+
case "meter":
|
|
149
|
+
return /* @__PURE__ */ jsx(
|
|
150
|
+
Meter,
|
|
151
|
+
{
|
|
152
|
+
size: "row",
|
|
153
|
+
label: columnLabel(column),
|
|
154
|
+
value: typeof value === "number" ? value : null,
|
|
155
|
+
max: meta?.meterMax ?? 1
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
case "entity":
|
|
159
|
+
case "text":
|
|
160
|
+
return isAbsent(value) ? /* @__PURE__ */ jsx(Dash, {}) : String(value);
|
|
161
|
+
default:
|
|
162
|
+
return kind;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
function CellContent({
|
|
166
|
+
cell
|
|
167
|
+
}) {
|
|
168
|
+
const kind = resolveKind(cell.column);
|
|
169
|
+
return kind === void 0 ? /* @__PURE__ */ jsx(FlexRender, { cell }) : /* @__PURE__ */ jsx(KindCell, { kind, cell });
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
CellContent,
|
|
173
|
+
DEFAULT_CELL,
|
|
174
|
+
KindCell,
|
|
175
|
+
KindSkeleton,
|
|
176
|
+
kindAlign,
|
|
177
|
+
kindClass,
|
|
178
|
+
planColumnSizing,
|
|
179
|
+
resolveKind
|
|
180
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Cell kinds (`meta.kind`, SPEC § 6.6). Each class is the CHROME of one kind on its `<td>`; the font
|
|
3
|
+
* SIZE stays the theme's `sm` on `td`. Colours are tokens, never literals.
|
|
4
|
+
*/
|
|
5
|
+
.entity {
|
|
6
|
+
max-width: 100%;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
font-weight: 500;
|
|
9
|
+
color: var(--vx-ink);
|
|
10
|
+
text-overflow: ellipsis;
|
|
11
|
+
white-space: nowrap;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.status {
|
|
15
|
+
white-space: nowrap;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/* SPEC D33: figures are the proportional sans with lining tabular numerals; only times are mono. */
|
|
19
|
+
.number {
|
|
20
|
+
font-variant-numeric: tabular-nums;
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
color: var(--vx-ink);
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.relativeTime {
|
|
27
|
+
font-family: var(--mantine-font-family-monospace);
|
|
28
|
+
font-variant-numeric: tabular-nums;
|
|
29
|
+
color: var(--vx-muted);
|
|
30
|
+
white-space: nowrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.meter {
|
|
34
|
+
min-width: calc(4rem * var(--mantine-scale));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.text {
|
|
38
|
+
color: var(--vx-ink);
|
|
39
|
+
white-space: normal;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/* An absent value: a muted em dash, never an empty cell. */
|
|
43
|
+
.dash {
|
|
44
|
+
color: var(--vx-faint);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/* The full date for assistive tech, inside the `<time>`: visually hidden, still announced. */
|
|
48
|
+
.srOnly {
|
|
49
|
+
position: absolute;
|
|
50
|
+
width: 1px;
|
|
51
|
+
height: 1px;
|
|
52
|
+
overflow: hidden;
|
|
53
|
+
clip-path: inset(50%);
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed CSS-module declaration (the S4 CSS-modules path). Named string props — not an index
|
|
3
|
+
* signature — so dot access stays verbatim under the package's strict flags.
|
|
4
|
+
*/
|
|
5
|
+
declare const classes: {
|
|
6
|
+
readonly dash: string
|
|
7
|
+
readonly entity: string
|
|
8
|
+
readonly meter: string
|
|
9
|
+
readonly number: string
|
|
10
|
+
readonly relativeTime: string
|
|
11
|
+
readonly srOnly: string
|
|
12
|
+
readonly status: string
|
|
13
|
+
readonly text: string
|
|
14
|
+
}
|
|
15
|
+
export default classes
|