@prestack/thread-ui 0.1.1 → 0.1.3
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 +518 -0
- package/dist/ui/animations/anm_appear.d.ts +8 -8
- package/dist/ui/animations/anm_blur_in.d.ts +12 -12
- package/dist/ui/animations/anm_blur_out.d.ts +12 -12
- package/dist/ui/animations/anm_dismiss.d.ts +12 -12
- package/dist/ui/animations/anm_drop.d.ts +12 -12
- package/dist/ui/animations/anm_fall.d.ts +12 -12
- package/dist/ui/animations/anm_flash.d.ts +9 -9
- package/dist/ui/animations/anm_glow.d.ts +8 -8
- package/dist/ui/animations/anm_lift.d.ts +8 -8
- package/dist/ui/animations/anm_nudge.d.ts +8 -8
- package/dist/ui/animations/anm_pop_in.d.ts +16 -16
- package/dist/ui/animations/anm_pop_out.d.ts +16 -16
- package/dist/ui/animations/anm_press.d.ts +9 -9
- package/dist/ui/animations/anm_pulse.d.ts +10 -10
- package/dist/ui/animations/anm_rise.d.ts +12 -12
- package/dist/ui/animations/anm_shake.d.ts +11 -11
- package/dist/ui/animations/anm_slide_in_left.d.ts +12 -12
- package/dist/ui/animations/anm_slide_in_right.d.ts +12 -12
- package/dist/ui/animations/anm_slide_out_left.d.ts +12 -12
- package/dist/ui/animations/anm_slide_out_right.d.ts +12 -12
- package/dist/ui/animations/anm_spin.d.ts +8 -8
- package/dist/ui/animations/anm_swell.d.ts +8 -8
- package/dist/ui/animations/anm_wobble.d.ts +13 -13
- package/dist/ui/animations/anm_zoom_in.d.ts +12 -12
- package/dist/ui/animations/anm_zoom_out.d.ts +12 -12
- package/dist/ui/animations.d.ts +8 -8
- package/dist/ui/animations.js +4 -4
- package/dist/ui/animations.ts +1 -1
- package/dist/ui/attach.js +25 -80
- package/dist/ui/attach.ts +12 -69
- package/dist/ui/charts.d.ts +0 -3
- package/dist/ui/charts.js +3 -7
- package/dist/ui/charts.tsx +0 -4
- package/dist/ui/checked.d.ts +1 -1
- package/dist/ui/checked.ts +1 -1
- package/dist/ui/collector.js +1 -1
- package/dist/ui/collector.ts +1 -1
- package/dist/ui/compositions.d.ts +9 -3
- package/dist/ui/compositions.js +9 -158
- package/dist/ui/compositions.ts +6 -170
- package/dist/ui/content.js +4 -7
- package/dist/ui/content.tsx +4 -15
- package/dist/ui/controls.js +1 -1
- package/dist/ui/door.d.ts +1 -1
- package/dist/ui/elements/accordion.d.ts +2 -1
- package/dist/ui/elements/accordion.js +4 -4
- package/dist/ui/elements/accordion.tsx +2 -1
- package/dist/ui/elements/aspect-ratio.d.ts +2 -1
- package/dist/ui/elements/aspect-ratio.js +1 -1
- package/dist/ui/elements/aspect-ratio.tsx +2 -1
- package/dist/ui/elements/avatar.d.ts +2 -1
- package/dist/ui/elements/avatar.js +3 -3
- package/dist/ui/elements/avatar.tsx +2 -1
- package/dist/ui/elements/badge.d.ts +2 -1
- package/dist/ui/elements/badge.js +3 -3
- package/dist/ui/elements/badge.tsx +2 -1
- package/dist/ui/elements/bars.d.ts +2 -1
- package/dist/ui/elements/bars.js +5 -5
- package/dist/ui/elements/bars.tsx +2 -1
- package/dist/ui/elements/bars.works.js +3 -3
- package/dist/ui/elements/box.d.ts +2 -1
- package/dist/ui/elements/box.js +1 -1
- package/dist/ui/elements/box.tsx +2 -1
- package/dist/ui/elements/breadcrumb.d.ts +2 -1
- package/dist/ui/elements/breadcrumb.js +5 -5
- package/dist/ui/elements/breadcrumb.tsx +2 -1
- package/dist/ui/elements/breadcrumb.works.js +1 -1
- package/dist/ui/elements/button.d.ts +2 -1
- package/dist/ui/elements/button.js +3 -3
- package/dist/ui/elements/button.tsx +2 -1
- package/dist/ui/elements/button.works.js +2 -2
- package/dist/ui/elements/column.d.ts +2 -1
- package/dist/ui/elements/column.js +1 -1
- package/dist/ui/elements/column.tsx +2 -1
- package/dist/ui/elements/consent.d.ts +2 -1
- package/dist/ui/elements/consent.js +10 -10
- package/dist/ui/elements/consent.tsx +2 -1
- package/dist/ui/elements/consent.works.js +1 -1
- package/dist/ui/elements/donut.d.ts +2 -1
- package/dist/ui/elements/donut.js +4 -4
- package/dist/ui/elements/donut.tsx +2 -1
- package/dist/ui/elements/donut.works.js +2 -2
- package/dist/ui/elements/each.d.ts +2 -1
- package/dist/ui/elements/each.js +3 -3
- package/dist/ui/elements/each.tsx +2 -1
- package/dist/ui/elements/each.works.js +2 -2
- package/dist/ui/elements/empty.d.ts +2 -1
- package/dist/ui/elements/empty.js +2 -2
- package/dist/ui/elements/empty.tsx +2 -1
- package/dist/ui/elements/field.d.ts +2 -1
- package/dist/ui/elements/field.js +3 -3
- package/dist/ui/elements/field.tsx +2 -1
- package/dist/ui/elements/field.works.js +1 -1
- package/dist/ui/elements/funnel.d.ts +2 -1
- package/dist/ui/elements/funnel.js +5 -5
- package/dist/ui/elements/funnel.tsx +2 -1
- package/dist/ui/elements/funnel.works.js +3 -3
- package/dist/ui/elements/gauge.d.ts +2 -1
- package/dist/ui/elements/gauge.js +3 -3
- package/dist/ui/elements/gauge.tsx +2 -1
- package/dist/ui/elements/gauge.works.js +1 -1
- package/dist/ui/elements/glyph.d.ts +2 -1
- package/dist/ui/elements/glyph.js +3 -3
- package/dist/ui/elements/glyph.tsx +2 -1
- package/dist/ui/elements/glyph.works.js +1 -1
- package/dist/ui/elements/grid.d.ts +2 -1
- package/dist/ui/elements/grid.js +1 -1
- package/dist/ui/elements/grid.tsx +2 -1
- package/dist/ui/elements/heatmap.d.ts +2 -1
- package/dist/ui/elements/heatmap.js +5 -5
- package/dist/ui/elements/heatmap.tsx +2 -1
- package/dist/ui/elements/heatmap.works.js +1 -1
- package/dist/ui/elements/hit-box.d.ts +2 -1
- package/dist/ui/elements/hit-box.js +2 -2
- package/dist/ui/elements/hit-box.tsx +2 -1
- package/dist/ui/elements/hit-box.works.d.ts +2 -2
- package/dist/ui/elements/hit-box.works.js +5 -5
- package/dist/ui/elements/hit-box.works.tsx +2 -1
- package/dist/ui/elements/image.d.ts +2 -1
- package/dist/ui/elements/image.js +2 -2
- package/dist/ui/elements/image.tsx +2 -1
- package/dist/ui/elements/line-chart.d.ts +2 -1
- package/dist/ui/elements/line-chart.js +4 -4
- package/dist/ui/elements/line-chart.tsx +2 -1
- package/dist/ui/elements/line-chart.works.js +2 -2
- package/dist/ui/elements/link.d.ts +2 -1
- package/dist/ui/elements/link.js +3 -3
- package/dist/ui/elements/link.tsx +2 -1
- package/dist/ui/elements/link.works.js +1 -1
- package/dist/ui/elements/media.d.ts +2 -1
- package/dist/ui/elements/media.js +2 -2
- package/dist/ui/elements/media.tsx +2 -1
- package/dist/ui/elements/menu.d.ts +2 -1
- package/dist/ui/elements/menu.js +5 -5
- package/dist/ui/elements/menu.tsx +2 -1
- package/dist/ui/elements/menu.works.d.ts +2 -1
- package/dist/ui/elements/menu.works.js +5 -5
- package/dist/ui/elements/menu.works.tsx +2 -1
- package/dist/ui/elements/money.d.ts +3 -1
- package/dist/ui/elements/money.js +10 -5
- package/dist/ui/elements/money.tsx +12 -3
- package/dist/ui/elements/money.works.js +1 -1
- package/dist/ui/elements/pagination.d.ts +2 -1
- package/dist/ui/elements/pagination.js +5 -5
- package/dist/ui/elements/pagination.tsx +2 -1
- package/dist/ui/elements/progress.d.ts +2 -1
- package/dist/ui/elements/progress.js +3 -3
- package/dist/ui/elements/progress.tsx +2 -1
- package/dist/ui/elements/radio-group.d.ts +2 -1
- package/dist/ui/elements/radio-group.js +4 -4
- package/dist/ui/elements/radio-group.tsx +2 -1
- package/dist/ui/elements/radio-group.works.js +1 -1
- package/dist/ui/elements/row.d.ts +2 -1
- package/dist/ui/elements/row.js +1 -1
- package/dist/ui/elements/row.tsx +2 -1
- package/dist/ui/elements/scatter.d.ts +2 -1
- package/dist/ui/elements/scatter.js +3 -3
- package/dist/ui/elements/scatter.tsx +2 -1
- package/dist/ui/elements/scatter.works.js +1 -1
- package/dist/ui/elements/select.d.ts +2 -1
- package/dist/ui/elements/select.js +4 -4
- package/dist/ui/elements/select.tsx +2 -1
- package/dist/ui/elements/separator.d.ts +2 -1
- package/dist/ui/elements/separator.js +2 -2
- package/dist/ui/elements/separator.tsx +2 -1
- package/dist/ui/elements/skeleton.d.ts +2 -1
- package/dist/ui/elements/skeleton.js +2 -2
- package/dist/ui/elements/skeleton.tsx +2 -1
- package/dist/ui/elements/slider.d.ts +2 -1
- package/dist/ui/elements/slider.js +3 -3
- package/dist/ui/elements/slider.tsx +2 -1
- package/dist/ui/elements/sparkline.d.ts +2 -1
- package/dist/ui/elements/sparkline.js +3 -3
- package/dist/ui/elements/sparkline.tsx +2 -1
- package/dist/ui/elements/sparkline.works.js +1 -1
- package/dist/ui/elements/spinner.d.ts +2 -1
- package/dist/ui/elements/spinner.js +2 -2
- package/dist/ui/elements/spinner.tsx +2 -1
- package/dist/ui/elements/stack.d.ts +2 -1
- package/dist/ui/elements/stack.js +1 -1
- package/dist/ui/elements/stack.tsx +2 -1
- package/dist/ui/elements/stat.d.ts +2 -1
- package/dist/ui/elements/stat.js +3 -3
- package/dist/ui/elements/stat.tsx +2 -1
- package/dist/ui/elements/stat.works.js +1 -1
- package/dist/ui/elements/surface.d.ts +2 -1
- package/dist/ui/elements/surface.js +2 -2
- package/dist/ui/elements/surface.tsx +2 -1
- package/dist/ui/elements/surface.works.js +1 -1
- package/dist/ui/elements/table.d.ts +2 -1
- package/dist/ui/elements/table.js +4 -4
- package/dist/ui/elements/table.tsx +2 -1
- package/dist/ui/elements/table.works.js +1 -1
- package/dist/ui/elements/tabs.d.ts +2 -1
- package/dist/ui/elements/tabs.js +4 -4
- package/dist/ui/elements/tabs.tsx +2 -1
- package/dist/ui/elements/tabs.works.js +1 -1
- package/dist/ui/elements/text.d.ts +2 -1
- package/dist/ui/elements/text.js +2 -2
- package/dist/ui/elements/text.tsx +2 -1
- package/dist/ui/elements/textarea.d.ts +2 -1
- package/dist/ui/elements/textarea.js +4 -4
- package/dist/ui/elements/textarea.tsx +2 -1
- package/dist/ui/elements/time.d.ts +3 -1
- package/dist/ui/elements/time.js +7 -4
- package/dist/ui/elements/time.tsx +9 -2
- package/dist/ui/elements/time.works.d.ts +1 -0
- package/dist/ui/elements/time.works.js +7 -3
- package/dist/ui/elements/time.works.ts +6 -2
- package/dist/ui/elements/toggle.d.ts +2 -1
- package/dist/ui/elements/toggle.js +3 -3
- package/dist/ui/elements/toggle.tsx +2 -1
- package/dist/ui/elements/tooltip.d.ts +2 -1
- package/dist/ui/elements/tooltip.js +2 -2
- package/dist/ui/elements/tooltip.tsx +2 -1
- package/dist/ui/elements/tooltip.works.js +2 -2
- package/dist/ui/elements/value.d.ts +3 -1
- package/dist/ui/elements/value.js +10 -5
- package/dist/ui/elements/value.tsx +12 -3
- package/dist/ui/elements/value.works.js +1 -1
- package/dist/ui/elements.d.ts +15 -11
- package/dist/ui/elements.js +6 -6
- package/dist/ui/elements.ts +7 -7
- package/dist/ui/fonts.d.ts +1 -1
- package/dist/ui/fonts.js +1 -1
- package/dist/ui/generators/dev.d.ts +1 -2
- package/dist/ui/generators/dev.js +33 -37
- package/dist/ui/generators/dev.ts +30 -37
- package/dist/ui/generators/elements.d.ts +1 -0
- package/dist/ui/generators/elements.js +11 -9
- package/dist/ui/generators/elements.ts +12 -9
- package/dist/ui/generators/i18n.js +6 -23
- package/dist/ui/generators/i18n.ts +1 -18
- package/dist/ui/generators/icons.js +5 -14
- package/dist/ui/generators/icons.ts +1 -10
- package/dist/ui/generators/react.js +4 -5
- package/dist/ui/generators/react.ts +2 -3
- package/dist/ui/generators/routes.js +66 -51
- package/dist/ui/generators/routes.ts +67 -46
- package/dist/ui/generators/show.js +9 -6
- package/dist/ui/generators/show.ts +4 -2
- package/dist/ui/generators/styles.js +12 -16
- package/dist/ui/generators/styles.ts +1 -5
- package/dist/ui/generators/variants.js +3 -3
- package/dist/ui/generators/variants.ts +1 -1
- package/dist/ui/i18n/catalogs/en.js +1 -1
- package/dist/ui/i18n/format.js +1 -1
- package/dist/ui/i18n/translator.js +2 -2
- package/dist/ui/material.d.ts +11 -11
- package/dist/ui/material.js +1 -1
- package/dist/ui/materials/mat_bordered.d.ts +13 -13
- package/dist/ui/materials/mat_bordered.js +1 -1
- package/dist/ui/materials/mat_ceramic.d.ts +13 -13
- package/dist/ui/materials/mat_ceramic.js +1 -1
- package/dist/ui/materials/mat_clay.d.ts +13 -13
- package/dist/ui/materials/mat_clay.js +1 -1
- package/dist/ui/materials/mat_elevated.d.ts +13 -13
- package/dist/ui/materials/mat_elevated.js +1 -1
- package/dist/ui/materials/mat_flat.d.ts +25 -25
- package/dist/ui/materials/mat_flat.js +1 -1
- package/dist/ui/materials/mat_glass.d.ts +17 -17
- package/dist/ui/materials/mat_glass.js +1 -1
- package/dist/ui/materials/mat_lit.d.ts +13 -13
- package/dist/ui/materials/mat_lit.js +1 -1
- package/dist/ui/materials/mat_moulded.d.ts +9 -9
- package/dist/ui/materials/mat_moulded.js +1 -1
- package/dist/ui/materials.d.ts +30 -30
- package/dist/ui/materials.js +3 -3
- package/dist/ui/materials.ts +1 -1
- package/dist/ui/modes.d.ts +2 -2
- package/dist/ui/presented.js +5 -5
- package/dist/ui/provider.d.ts +3 -0
- package/dist/ui/provider.js +9 -10
- package/dist/ui/provider.tsx +7 -5
- package/dist/ui/screens.js +6 -6
- package/dist/ui/screens.ts +1 -1
- package/dist/ui/scroll-lock.js +1 -1
- package/dist/ui/series.js +1 -1
- package/dist/ui/styleguide.js +1 -1
- package/dist/ui/tokens.d.ts +2 -2
- package/dist/ui/tokens.js +3 -3
- package/dist/ui/tokens.ts +1 -1
- package/dist/ui/validators.js +1 -1
- package/dist/ui/variant.d.ts +37 -37
- package/dist/ui/variant.js +2 -2
- package/dist/ui/variants/var_avatar-round.d.ts +13 -13
- package/dist/ui/variants/var_avatar-round.js +1 -1
- package/dist/ui/variants/var_bubble-me.d.ts +12 -12
- package/dist/ui/variants/var_bubble-me.js +1 -1
- package/dist/ui/variants/var_bubble-them.d.ts +10 -10
- package/dist/ui/variants/var_bubble-them.js +1 -1
- package/dist/ui/variants/var_button-border.d.ts +61 -61
- package/dist/ui/variants/var_button-border.js +1 -1
- package/dist/ui/variants/var_button-cta.d.ts +61 -61
- package/dist/ui/variants/var_button-cta.js +1 -1
- package/dist/ui/variants/var_button-destructive-ghost.d.ts +59 -59
- package/dist/ui/variants/var_button-destructive-ghost.js +1 -1
- package/dist/ui/variants/var_button-destructive.d.ts +61 -61
- package/dist/ui/variants/var_button-destructive.js +1 -1
- package/dist/ui/variants/var_button-fill.d.ts +61 -61
- package/dist/ui/variants/var_button-fill.js +1 -1
- package/dist/ui/variants/var_button-ghost.d.ts +59 -59
- package/dist/ui/variants/var_button-ghost.js +1 -1
- package/dist/ui/variants/var_button-glass.d.ts +40 -40
- package/dist/ui/variants/var_button-glass.js +1 -1
- package/dist/ui/variants/var_button-normal.d.ts +61 -61
- package/dist/ui/variants/var_button-normal.js +1 -1
- package/dist/ui/variants/var_button-quiet.d.ts +63 -63
- package/dist/ui/variants/var_button-quiet.js +1 -1
- package/dist/ui/variants/var_card.d.ts +17 -17
- package/dist/ui/variants/var_card.js +1 -1
- package/dist/ui/variants/var_chip.d.ts +10 -10
- package/dist/ui/variants/var_chip.js +1 -1
- package/dist/ui/variants/var_choice.d.ts +15 -15
- package/dist/ui/variants/var_choice.js +1 -1
- package/dist/ui/variants/var_framed.d.ts +5 -5
- package/dist/ui/variants/var_framed.js +1 -1
- package/dist/ui/variants/var_glyph-plain.d.ts +7 -7
- package/dist/ui/variants/var_glyph-plain.js +1 -1
- package/dist/ui/variants/var_input.d.ts +30 -30
- package/dist/ui/variants/var_input.js +1 -1
- package/dist/ui/variants/var_link-inline.d.ts +17 -17
- package/dist/ui/variants/var_link-inline.js +1 -1
- package/dist/ui/variants/var_list-row.d.ts +22 -22
- package/dist/ui/variants/var_list-row.js +1 -1
- package/dist/ui/variants/var_rule.d.ts +5 -5
- package/dist/ui/variants/var_rule.js +1 -1
- package/dist/ui/variants/var_skeleton-block.d.ts +9 -9
- package/dist/ui/variants/var_skeleton-block.js +1 -1
- package/dist/ui/variants/var_spinner-turning.d.ts +9 -9
- package/dist/ui/variants/var_spinner-turning.js +1 -1
- package/dist/ui/variants/var_stat-tile.d.ts +10 -10
- package/dist/ui/variants/var_stat-tile.js +1 -1
- package/dist/ui/variants/var_tab-bar.d.ts +14 -14
- package/dist/ui/variants/var_tab-bar.js +1 -1
- package/dist/ui/variants/var_tap-target.d.ts +11 -11
- package/dist/ui/variants/var_tap-target.js +1 -1
- package/dist/ui/variants.d.ts +88 -88
- package/dist/ui/wrappers.d.ts +7 -6
- package/dist/ui/wrappers.js +16 -14
- package/dist/ui/wrappers.tsx +21 -18
- package/package.json +2 -2
package/dist/ui/compositions.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from '@prestack/thread/
|
|
1
|
+
import { existsSync, readFileSync, readdirSync, rmSync, writeFileSync } from '@prestack/thread/integrations/disk'
|
|
2
2
|
import { basename, dirname, join, relative } from 'node:path'
|
|
3
3
|
import { argv, stdout } from 'node:process'
|
|
4
4
|
|
|
5
|
-
import { TYPED, wrapped } from '@prestack/thread/core/answers'
|
|
6
5
|
import { exit, invoked } from '@prestack/thread/core/invoked'
|
|
7
6
|
import { valuesIn } from '@prestack/thread/core/rows'
|
|
8
7
|
import type { Threaded } from '@prestack/thread/core/thread'
|
|
@@ -12,92 +11,6 @@ import { findTree, inTree } from '@prestack/thread/core/tree'
|
|
|
12
11
|
|
|
13
12
|
import { compiled } from './generators/react.ts'
|
|
14
13
|
|
|
15
|
-
export const TEACHES: readonly string[] = [
|
|
16
|
-
' what the body may reach, and how a premium state is written:',
|
|
17
|
-
'',
|
|
18
|
-
' `useUi()` is the door. It carries `actor` — who is asking, with the roles read from',
|
|
19
|
-
' the row that declared itself the caller — and `translate`, `clock` and `dispatch`. Name',
|
|
20
|
-
' it in the body and the import is written for you.',
|
|
21
|
-
'',
|
|
22
|
-
' A premium look is not decided at the call site. A grant already says who may run an',
|
|
23
|
-
' operation, in words your own entity declares, and a signal that names that operation',
|
|
24
|
-
' holds for exactly the callers the grant refuses. The rule is written once, on the',
|
|
25
|
-
' grant, and every screen follows it:',
|
|
26
|
-
'',
|
|
27
|
-
' <FeatureBox.paywalled>',
|
|
28
|
-
' <Text k=\'feature.title\' />',
|
|
29
|
-
' </FeatureBox.paywalled>',
|
|
30
|
-
'',
|
|
31
|
-
' Read it in three parts, and each is its own command:',
|
|
32
|
-
'',
|
|
33
|
-
' `locked` is a signal the ELEMENT declares it raises — `thread create element` with',
|
|
34
|
-
' `raises: locked`. A signal this app declares cannot be raised on an element that',
|
|
35
|
-
' never said it raises one, so `Box` will not take it. Nothing passes it here: it is',
|
|
36
|
-
' set for you wherever the gate refuses the operation the signal names.',
|
|
37
|
-
' `.paywalled` is a variant worn as the TAG, never passed as a prop, and it is what',
|
|
38
|
-
' carries the look — `thread create variant` with a `state: locked` and what it sets.',
|
|
39
|
-
' Declare that state on a MATERIAL instead and every variant made of it locks the same',
|
|
40
|
-
' way, which is how one overlay dresses a whole app from one row.',
|
|
41
|
-
' The rule itself is `thread grant`, and the words in it are options on the value your',
|
|
42
|
-
' entity names as saying what a caller may do — `thread create entity`.',
|
|
43
|
-
'',
|
|
44
|
-
' THE MEMBER IS THE VARIANT\'S WHOLE ID, CAMELCASED — never the part after the element',
|
|
45
|
-
' name. A variant `button-fill` is worn `<Button.buttonFill>`, and `<Button.fill>` is not',
|
|
46
|
-
' a thing. `.paywalled` above reads short only because that variant is itself named',
|
|
47
|
-
' `paywalled`; most carry the element in their id and wear all of it.',
|
|
48
|
-
'',
|
|
49
|
-
' how a control reaches an operation:',
|
|
50
|
-
'',
|
|
51
|
-
' Wiring is imperative. There is no `run=`, `operation=` or `dispatch=` prop on any',
|
|
52
|
-
' element, and the compiler is what will tell you so. A control calls dispatch in its own',
|
|
53
|
-
' handler:',
|
|
54
|
-
'',
|
|
55
|
-
' <Button.buttonFill label=\'common.save\'',
|
|
56
|
-
' onPress={() => useUi().dispatch?.(\'wf_save\')} />',
|
|
57
|
-
'',
|
|
58
|
-
' `dispatch` is optional on the hook, so `?.` is required — without it the compiler says',
|
|
59
|
-
' "Cannot invoke an object which is possibly \'undefined\'". The name is the operation\'s own',
|
|
60
|
-
' id from `thread create operation`, and one this app never declared is refused before it',
|
|
61
|
-
' runs. An operation whose `to:` named nobody is refused however the button looks — and',
|
|
62
|
-
' `to:` takes roles off an entity, which is a noun that arrives with `thread attach',
|
|
63
|
-
` ${packageOf('data')}\`.`,
|
|
64
|
-
'',
|
|
65
|
-
' Nothing here decides access. The gate still refuses the operation behind the lock',
|
|
66
|
-
' whatever the screen shows, so a screen that got this wrong shows the wrong thing and',
|
|
67
|
-
' still cannot do the wrong thing.',
|
|
68
|
-
'',
|
|
69
|
-
' how a press moves to another screen:',
|
|
70
|
-
'',
|
|
71
|
-
' Name the screen. `navigateTo` takes the screen\'s export name — its id in PascalCase, so',
|
|
72
|
-
' `order-detail` is reached as `navigateTo="OrderDetail"`:',
|
|
73
|
-
'',
|
|
74
|
-
' <Button.buttonNormal label=\'home.orders\' navigateTo="Orders" />',
|
|
75
|
-
'',
|
|
76
|
-
' That is the whole of it. `thread routes` reads every `navigateTo` the screens and their',
|
|
77
|
-
' compositions hold and writes the map — from which screen, through which button, to which',
|
|
78
|
-
' screen — and the pages. A page is reached by its route, and a sheet, popover, overlay or',
|
|
79
|
-
' toast opens where somebody already is, so the press is written the same way for both.',
|
|
80
|
-
' A name no screen has and a destination not written out as a name are each refused there.',
|
|
81
|
-
' Never an `href` and never',
|
|
82
|
-
' a router: a move the map cannot see is a screen the map reads as unreachable.',
|
|
83
|
-
'',
|
|
84
|
-
' how a screen shows data:',
|
|
85
|
-
'',
|
|
86
|
-
' A screen NAMES the reads it binds, and never fetches. `views` takes the ids of declared',
|
|
87
|
-
' views, the framework runs each one, and `useView` hands back what came out:',
|
|
88
|
-
'',
|
|
89
|
-
' export const Orders = screen(\'orders\', { as: \'page\', views: [\'vw_orders\'] }, () => (',
|
|
90
|
-
' <Each rows={useView<readonly Row[]>(\'vw_orders\') ?? []} by="id">',
|
|
91
|
-
' {(row) => <Text k="orders.line" with={{ name: row.name }} />}',
|
|
92
|
-
' </Each>',
|
|
93
|
-
' ))',
|
|
94
|
-
'',
|
|
95
|
-
' `useView` comes through the same door as `useUi`, and it refuses a name the screen did not',
|
|
96
|
-
' bind. `thread routes` refuses a view this app declares no operation for, and writes what each',
|
|
97
|
-
' screen shows into the map. A fetch of your own, or a hook you wrote, is how a screen ends up',
|
|
98
|
-
' showing something nothing declared, and there is no second way in.',
|
|
99
|
-
]
|
|
100
|
-
|
|
101
14
|
export const REACHES = /\buseUi\s*\(/
|
|
102
15
|
|
|
103
16
|
const here = 'thread/ui/compositions.ts'
|
|
@@ -130,7 +43,7 @@ export const COMPOSITIONS: Threaded & { readonly files: string } = {
|
|
|
130
43
|
declares,
|
|
131
44
|
}
|
|
132
45
|
|
|
133
|
-
const PASCAL = (id: string): string =>
|
|
46
|
+
export const PASCAL = (id: string): string =>
|
|
134
47
|
id
|
|
135
48
|
.split('-')
|
|
136
49
|
.map((part) => `${part.charAt(0).toUpperCase()}${part.slice(1)}`)
|
|
@@ -141,7 +54,7 @@ export function nameOf(at: string): string {
|
|
|
141
54
|
return PASCAL(file.replace(/^cmp_/, '').replace(/\.[^.]+$/, ''))
|
|
142
55
|
}
|
|
143
56
|
|
|
144
|
-
type Listed = {
|
|
57
|
+
export type Listed = {
|
|
145
58
|
readonly id: string
|
|
146
59
|
readonly at?: string
|
|
147
60
|
readonly describes?: string
|
|
@@ -149,96 +62,19 @@ type Listed = {
|
|
|
149
62
|
readonly arranges?: boolean
|
|
150
63
|
}
|
|
151
64
|
|
|
152
|
-
function sheetOf(tree: Tree, file: string, ...named: readonly string[]): readonly Listed[] {
|
|
65
|
+
export function sheetOf(tree: Tree, file: string, ...named: readonly string[]): readonly Listed[] {
|
|
153
66
|
const at = inTree(tree, file)
|
|
154
67
|
if (!existsSync(at)) return []
|
|
155
68
|
const held = valuesIn(readFileSync(at)) as Readonly<
|
|
156
|
-
Record<string, { readonly declares?: readonly Listed[] } | undefined>
|
|
69
|
+
Record<string, { readonly derives?: readonly Listed[]; readonly declares?: readonly Listed[] } | undefined>
|
|
157
70
|
>
|
|
158
71
|
for (const one of named) {
|
|
159
|
-
const found = held[one]?.declares
|
|
72
|
+
const found = held[one]?.derives ?? held[one]?.declares
|
|
160
73
|
if (found !== undefined) return found
|
|
161
74
|
}
|
|
162
75
|
return []
|
|
163
76
|
}
|
|
164
77
|
|
|
165
|
-
const camelOf = (id: string): string => id.replace(/-([a-z0-9])/g, (_, one: string) => one.toUpperCase())
|
|
166
|
-
|
|
167
|
-
const sentence = (one: Listed, pad: string): readonly string[] =>
|
|
168
|
-
String(one.describes ?? '').trim() === '' ? [] : wrapped(String(one.describes), pad)
|
|
169
|
-
|
|
170
|
-
function listed(tree: Tree, making: 'composition' | 'screen'): readonly string[] {
|
|
171
|
-
const elements = sheetOf(tree, `elements.${'ts'}`, 'ELEMENT', 'ELEMENTS')
|
|
172
|
-
const variants = sheetOf(tree, `variants.${'ts'}`, 'VARIANT', 'VARIANTS')
|
|
173
|
-
const compositions = sheetOf(tree, `compositions.${'ts'}`, 'COMPOSITION', 'COMPOSITIONS')
|
|
174
|
-
const screens = making === 'screen' ? sheetOf(tree, `screens.${'ts'}`, 'SCREEN', 'SCREENS') : []
|
|
175
|
-
|
|
176
|
-
const worn = new Map<string, string[]>()
|
|
177
|
-
for (const one of variants) {
|
|
178
|
-
for (const each of one.wears ?? []) {
|
|
179
|
-
const key = PASCAL(each)
|
|
180
|
-
const already = worn.get(key) ?? []
|
|
181
|
-
if (!already.includes(one.id)) worn.set(key, [...already, one.id])
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
const writes = (one: Listed): string => {
|
|
186
|
-
const name = PASCAL(one.id)
|
|
187
|
-
const members = (worn.get(name) ?? []).sort().map((each) => `<${name}.${camelOf(each)}>`)
|
|
188
|
-
if (members.length === 0) return `<${name}>`
|
|
189
|
-
return one.arranges === true ? `<${name}>, or ${members.join(' ')}` : members.join(' ')
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
const section = (title: string, rows: readonly Listed[], write: (one: Listed) => string): readonly string[] =>
|
|
193
|
-
rows.length === 0
|
|
194
|
-
? [` ${title}: none yet.`, '']
|
|
195
|
-
: [
|
|
196
|
-
` ${title} (${String(rows.length)}):`,
|
|
197
|
-
...rows.flatMap((one) => [` ${write(one)}`, ...sentence(one, ' ')]),
|
|
198
|
-
'',
|
|
199
|
-
]
|
|
200
|
-
|
|
201
|
-
return [
|
|
202
|
-
'',
|
|
203
|
-
...(making === 'screen'
|
|
204
|
-
? section('SCREENS that exist, and the name a press reaches each one by', screens, (one) => `${one.id} — navigateTo="${PASCAL(one.id)}"`)
|
|
205
|
-
: []),
|
|
206
|
-
...section('COMPOSITIONS you can place', compositions, (one) =>
|
|
207
|
-
`<${typeof one.at === 'string' && one.at !== '' ? nameOf(one.at) : PASCAL(one.id)}>`,
|
|
208
|
-
),
|
|
209
|
-
...section('ELEMENTS, written as the tags they can actually be typed as', elements, writes),
|
|
210
|
-
...(variants.length === 0
|
|
211
|
-
? [' VARIANTS: none yet.', '']
|
|
212
|
-
: [
|
|
213
|
-
` VARIANTS (${String(variants.length)}), under the elements that accept them:`,
|
|
214
|
-
...[...worn.keys()].sort().map((name) =>
|
|
215
|
-
` ${name} — ${(worn.get(name) ?? []).sort().map(camelOf).join(', ')}`,
|
|
216
|
-
),
|
|
217
|
-
...(() => {
|
|
218
|
-
const nobody = variants.filter((one) => (one.wears ?? []).length === 0).map((one) => one.id)
|
|
219
|
-
return nobody.length === 0
|
|
220
|
-
? []
|
|
221
|
-
: [` worn by nothing, so writable nowhere: ${nobody.sort().join(', ')}`]
|
|
222
|
-
})(),
|
|
223
|
-
'',
|
|
224
|
-
]),
|
|
225
|
-
' Materials, style guide values, fonts and animations are chosen inside a VARIANT, never inside',
|
|
226
|
-
` a body — \`${TYPED} create variant\` prints every one of them at the moment one is needed.`,
|
|
227
|
-
'',
|
|
228
|
-
|
|
229
|
-
` Every element and the tags it is written as: \`${TYPED} create element\`. Every variant and`,
|
|
230
|
-
` the tag it is worn as: \`${TYPED} create variant\`. Then open the one nearest to what you are`,
|
|
231
|
-
` about to build with \`${TYPED} read <id>\` — it already answers how a body is arranged, how a`,
|
|
232
|
-
' variant is worn and how a control reaches an operation, and a file cannot be wrong in the way',
|
|
233
|
-
' a remembered example can.',
|
|
234
|
-
'',
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
export const catalogue = async (): Promise<readonly string[]> => listed(findTree(), 'composition')
|
|
239
|
-
|
|
240
|
-
export const screening = async (): Promise<readonly string[]> => listed(findTree(), 'screen')
|
|
241
|
-
|
|
242
78
|
const TAG = /<([A-Z][A-Za-z0-9]*)/g
|
|
243
79
|
|
|
244
80
|
export function composed(
|
package/dist/ui/content.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import { formatValue, runValidator, validatorFor } from "./validators.js";
|
|
2
|
+
import { formatValue, runValidator } from './validators.js';
|
|
4
3
|
export function renderValue({ validator, value, context }, surface) {
|
|
5
|
-
const entry = validatorFor(validator);
|
|
6
4
|
const result = runValidator(validator, value, context ?? {});
|
|
7
|
-
if (!result.ok)
|
|
8
|
-
return
|
|
9
|
-
}
|
|
10
|
-
return (_jsx("span", { className: surface.className, ...surface.marks, "data-validator": entry.name, children: formatValue(validator, result.value, context ?? {}) }));
|
|
5
|
+
if (!result.ok)
|
|
6
|
+
return surface.text(result.errorKey);
|
|
7
|
+
return formatValue(validator, result.value, context ?? {});
|
|
11
8
|
}
|
package/dist/ui/content.tsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
3
|
import { useCallback, useSyncExternalStore, type ReactNode } from 'react'
|
|
4
|
-
import { formatValue, runValidator
|
|
4
|
+
import { formatValue, runValidator } from './validators.ts'
|
|
5
5
|
import { ICON_TARGET, strokeFor } from './icons.ts'
|
|
6
6
|
|
|
7
7
|
import { element, useSurface, useUi, useVisibility } from './wrappers.tsx'
|
|
@@ -19,21 +19,10 @@ export function renderValue(
|
|
|
19
19
|
{ validator, value, context }: ValueProps,
|
|
20
20
|
surface: ReturnType<typeof useSurface>,
|
|
21
21
|
): ReactNode {
|
|
22
|
-
const entry = validatorFor(validator)
|
|
23
22
|
const result = runValidator(validator, value, context ?? {})
|
|
24
23
|
|
|
25
|
-
if (!result.ok)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{surface.text(result.errorKey)}
|
|
29
|
-
</span>
|
|
30
|
-
)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<span className={surface.className} {...surface.marks} data-validator={entry.name}>
|
|
35
|
-
{formatValue(validator, result.value, context ?? {})}
|
|
36
|
-
</span>
|
|
37
|
-
)
|
|
24
|
+
if (!result.ok) return surface.text(result.errorKey)
|
|
25
|
+
|
|
26
|
+
return formatValue(validator, result.value, context ?? {})
|
|
38
27
|
}
|
|
39
28
|
|
package/dist/ui/controls.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
export { Menu } from
|
|
2
|
+
export { Menu } from './elements/menu.js';
|
package/dist/ui/door.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const PRESENTATIONS: readonly [
|
|
1
|
+
export declare const PRESENTATIONS: readonly ['page', 'sheet', 'popover', 'overlay', 'toast'];
|
|
2
2
|
export type Presentation = (typeof PRESENTATIONS)[number];
|
|
3
3
|
export declare const PRESENTATION_BEHAVIOUR: Readonly<Record<Presentation, {
|
|
4
4
|
readonly portal: boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { TabItem } from '../disclosure.tsx';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface AccordionProps {
|
|
4
5
|
readonly items: readonly TabItem[];
|
|
5
6
|
readonly initial: readonly string[];
|
|
6
7
|
readonly exclusive?: boolean;
|
|
7
8
|
readonly onChange?: (said: readonly string[]) => void;
|
|
8
|
-
readonly dispatch?:
|
|
9
|
+
readonly dispatch?: keyof Dispatching;
|
|
9
10
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
10
11
|
readonly invokeOn?: 'press' | 'shown';
|
|
11
12
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { roleClass } from
|
|
4
|
-
import { element, useSurface } from
|
|
5
|
-
import { Each } from
|
|
6
|
-
import { shown, section, header, region, uses } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
|
+
import { Each } from '../elements/each.js';
|
|
6
|
+
import { shown, section, header, region, uses } from './accordion.works.js';
|
|
7
7
|
export const Accordion = element('Accordion', (props, className) => {
|
|
8
8
|
const kept = uses(props);
|
|
9
9
|
const surface = useSurface({ className: roleClass(undefined, className),
|
|
@@ -4,6 +4,7 @@ import type { MessageKey } from '../content.tsx'
|
|
|
4
4
|
import { roleClass } from '../fonts.ts'
|
|
5
5
|
import type { TabItem } from '../disclosure.tsx'
|
|
6
6
|
|
|
7
|
+
import type { Dispatching } from '../checked.ts'
|
|
7
8
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
8
9
|
import { Each } from '../elements/each.tsx'
|
|
9
10
|
import { shown, section, header, region, uses } from './accordion.works.ts'
|
|
@@ -14,7 +15,7 @@ export interface AccordionProps {
|
|
|
14
15
|
readonly initial: readonly string[]
|
|
15
16
|
readonly exclusive?: boolean
|
|
16
17
|
readonly onChange?: (said: readonly string[]) => void
|
|
17
|
-
readonly dispatch?:
|
|
18
|
+
readonly dispatch?: keyof Dispatching
|
|
18
19
|
readonly input?: Readonly<Record<string, unknown>>
|
|
19
20
|
readonly invokeOn?: 'press' | 'shown'
|
|
20
21
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface AspectRatioProps {
|
|
4
5
|
readonly children: ReactNode;
|
|
5
6
|
readonly ratio: number;
|
|
6
|
-
readonly dispatch?:
|
|
7
|
+
readonly dispatch?: keyof Dispatching;
|
|
7
8
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
8
9
|
readonly invokeOn?: 'press' | 'shown';
|
|
9
10
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { element, useSurface } from
|
|
3
|
+
import { element, useSurface } from '../wrappers.js';
|
|
4
4
|
export const AspectRatio = element('AspectRatio', (props, className) => {
|
|
5
5
|
const surface = useSurface({ className,
|
|
6
6
|
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
import type { ReactNode } from 'react'
|
|
4
4
|
|
|
5
|
+
import type { Dispatching } from '../checked.ts'
|
|
5
6
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
export interface AspectRatioProps {
|
|
9
10
|
readonly children: ReactNode
|
|
10
11
|
readonly ratio: number
|
|
11
|
-
readonly dispatch?:
|
|
12
|
+
readonly dispatch?: keyof Dispatching
|
|
12
13
|
readonly input?: Readonly<Record<string, unknown>>
|
|
13
14
|
readonly invokeOn?: 'press' | 'shown'
|
|
14
15
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface AvatarProps {
|
|
4
5
|
readonly labelKey: MessageKey;
|
|
5
6
|
readonly src?: string;
|
|
6
7
|
readonly initials?: string;
|
|
7
|
-
readonly dispatch?:
|
|
8
|
+
readonly dispatch?: keyof Dispatching;
|
|
8
9
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
9
10
|
readonly invokeOn?: 'press' | 'shown';
|
|
10
11
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { roleClass } from
|
|
4
|
-
import { element, useSurface } from
|
|
5
|
-
import { shown } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
|
+
import { shown } from './avatar.works.js';
|
|
6
6
|
export const Avatar = element('Avatar', (props, className) => {
|
|
7
7
|
const surface = useSurface({ className: roleClass(undefined, className),
|
|
8
8
|
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { MessageKey } from '../content.tsx'
|
|
4
4
|
import { roleClass } from '../fonts.ts'
|
|
5
5
|
|
|
6
|
+
import type { Dispatching } from '../checked.ts'
|
|
6
7
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
7
8
|
import { shown } from './avatar.works.ts'
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ export interface AvatarProps {
|
|
|
11
12
|
readonly labelKey: MessageKey
|
|
12
13
|
readonly src?: string
|
|
13
14
|
readonly initials?: string
|
|
14
|
-
readonly dispatch?:
|
|
15
|
+
readonly dispatch?: keyof Dispatching
|
|
15
16
|
readonly input?: Readonly<Record<string, unknown>>
|
|
16
17
|
readonly invokeOn?: 'press' | 'shown'
|
|
17
18
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface BadgeProps {
|
|
4
5
|
readonly labelKey: MessageKey;
|
|
5
6
|
readonly count?: number;
|
|
6
7
|
readonly max?: number;
|
|
7
|
-
readonly dispatch?:
|
|
8
|
+
readonly dispatch?: keyof Dispatching;
|
|
8
9
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
9
10
|
readonly invokeOn?: 'press' | 'shown';
|
|
10
11
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { roleClass } from
|
|
4
|
-
import { element, useSurface } from
|
|
5
|
-
import { shows } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
|
+
import { shows } from './badge.works.js';
|
|
6
6
|
export const Badge = element('Badge', (props, className) => {
|
|
7
7
|
const surface = useSurface({ className: roleClass(undefined, className),
|
|
8
8
|
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { MessageKey } from '../content.tsx'
|
|
4
4
|
import { roleClass } from '../fonts.ts'
|
|
5
5
|
|
|
6
|
+
import type { Dispatching } from '../checked.ts'
|
|
6
7
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
7
8
|
import { shows } from './badge.works.ts'
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ export interface BadgeProps {
|
|
|
11
12
|
readonly labelKey: MessageKey
|
|
12
13
|
readonly count?: number
|
|
13
14
|
readonly max?: number
|
|
14
|
-
readonly dispatch?:
|
|
15
|
+
readonly dispatch?: keyof Dispatching
|
|
15
16
|
readonly input?: Readonly<Record<string, unknown>>
|
|
16
17
|
readonly invokeOn?: 'press' | 'shown'
|
|
17
18
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { MessageKey } from '../content.tsx';
|
|
2
2
|
import type { Row } from '../charts.tsx';
|
|
3
|
+
import type { Dispatching } from '../checked.ts';
|
|
3
4
|
import { type Element } from '../wrappers.tsx';
|
|
4
5
|
export interface BarsProps {
|
|
5
6
|
readonly rows: readonly Row[];
|
|
@@ -7,7 +8,7 @@ export interface BarsProps {
|
|
|
7
8
|
readonly value: string;
|
|
8
9
|
readonly format?: string;
|
|
9
10
|
readonly titleKey?: MessageKey;
|
|
10
|
-
readonly dispatch?:
|
|
11
|
+
readonly dispatch?: keyof Dispatching;
|
|
11
12
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
12
13
|
readonly invokeOn?: 'press' | 'shown';
|
|
13
14
|
}
|
package/dist/ui/elements/bars.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { roleClass } from
|
|
4
|
-
import { measured as marking } from
|
|
5
|
-
import { element, useSurface } from
|
|
6
|
-
import { Each } from
|
|
7
|
-
import { shown, sized, uses } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { measured as marking } from '../charts.js';
|
|
5
|
+
import { element, useSurface } from '../wrappers.js';
|
|
6
|
+
import { Each } from '../elements/each.js';
|
|
7
|
+
import { shown, sized, uses } from './bars.works.js';
|
|
8
8
|
export const Bars = element('Bars', (props, className) => {
|
|
9
9
|
const kept = uses(props);
|
|
10
10
|
const surface = useSurface({ className: roleClass(undefined, className),
|
|
@@ -5,6 +5,7 @@ import type { Row } from '../charts.tsx'
|
|
|
5
5
|
import { roleClass } from '../fonts.ts'
|
|
6
6
|
import { measured as marking } from '../charts.tsx'
|
|
7
7
|
|
|
8
|
+
import type { Dispatching } from '../checked.ts'
|
|
8
9
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
9
10
|
import { Each } from '../elements/each.tsx'
|
|
10
11
|
import { shown, sized, uses } from './bars.works.ts'
|
|
@@ -16,7 +17,7 @@ export interface BarsProps {
|
|
|
16
17
|
readonly value: string
|
|
17
18
|
readonly format?: string
|
|
18
19
|
readonly titleKey?: MessageKey
|
|
19
|
-
readonly dispatch?:
|
|
20
|
+
readonly dispatch?: keyof Dispatching
|
|
20
21
|
readonly input?: Readonly<Record<string, unknown>>
|
|
21
22
|
readonly invokeOn?: 'press' | 'shown'
|
|
22
23
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { formatValue } from
|
|
2
|
-
import { seriesColour } from
|
|
3
|
-
import { num, str, useRamp } from
|
|
1
|
+
import { formatValue } from '../validators.js';
|
|
2
|
+
import { seriesColour } from '../series.js';
|
|
3
|
+
import { num, str, useRamp } from '../charts.js';
|
|
4
4
|
export function uses(props) {
|
|
5
5
|
const ramp = useRamp(props.rows.length);
|
|
6
6
|
return { ...(props.rows.length === 0 ? { holds: ['empty'] } : {}), ramp };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { MessageKey } from '../content.tsx';
|
|
3
|
+
import type { Dispatching } from '../checked.ts';
|
|
3
4
|
import { type Element } from '../wrappers.tsx';
|
|
4
5
|
export interface BoxProps {
|
|
5
6
|
readonly children: ReactNode;
|
|
6
7
|
readonly labelKey?: MessageKey;
|
|
7
8
|
readonly scrolling?: boolean;
|
|
8
|
-
readonly dispatch?:
|
|
9
|
+
readonly dispatch?: keyof Dispatching;
|
|
9
10
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
10
11
|
readonly invokeOn?: 'press' | 'shown';
|
|
11
12
|
}
|
package/dist/ui/elements/box.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { element, useSurface } from
|
|
3
|
+
import { element, useSurface } from '../wrappers.js';
|
|
4
4
|
export const Box = element('Box', (props, className) => {
|
|
5
5
|
const surface = useSurface({ className,
|
|
6
6
|
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
package/dist/ui/elements/box.tsx
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import type { ReactNode } from 'react'
|
|
4
4
|
import type { MessageKey } from '../content.tsx'
|
|
5
5
|
|
|
6
|
+
import type { Dispatching } from '../checked.ts'
|
|
6
7
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
7
8
|
|
|
8
9
|
|
|
@@ -10,7 +11,7 @@ export interface BoxProps {
|
|
|
10
11
|
readonly children: ReactNode
|
|
11
12
|
readonly labelKey?: MessageKey
|
|
12
13
|
readonly scrolling?: boolean
|
|
13
|
-
readonly dispatch?:
|
|
14
|
+
readonly dispatch?: keyof Dispatching
|
|
14
15
|
readonly input?: Readonly<Record<string, unknown>>
|
|
15
16
|
readonly invokeOn?: 'press' | 'shown'
|
|
16
17
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { MapIsland } from '../islands/map.ts';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface BreadcrumbProps {
|
|
4
5
|
readonly map: MapIsland;
|
|
5
6
|
readonly current: string;
|
|
6
|
-
readonly dispatch?:
|
|
7
|
+
readonly dispatch?: keyof Dispatching;
|
|
7
8
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
8
9
|
readonly invokeOn?: 'press' | 'shown';
|
|
9
10
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { roleClass } from
|
|
4
|
-
import { Link } from
|
|
5
|
-
import { element, useSurface } from
|
|
6
|
-
import { Each } from
|
|
7
|
-
import { crumb, steps } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { Link } from './link.js';
|
|
5
|
+
import { element, useSurface } from '../wrappers.js';
|
|
6
|
+
import { Each } from '../elements/each.js';
|
|
7
|
+
import { crumb, steps } from './breadcrumb.works.js';
|
|
8
8
|
export const Breadcrumb = element('Breadcrumb', (props, className) => {
|
|
9
9
|
const surface = useSurface({ className: roleClass(undefined, className),
|
|
10
10
|
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) }, });
|
|
@@ -4,6 +4,7 @@ import { roleClass } from '../fonts.ts'
|
|
|
4
4
|
import type { MapIsland } from '../islands/map.ts'
|
|
5
5
|
import { Link } from './link.tsx'
|
|
6
6
|
|
|
7
|
+
import type { Dispatching } from '../checked.ts'
|
|
7
8
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
8
9
|
import { Each } from '../elements/each.tsx'
|
|
9
10
|
import { crumb, steps } from './breadcrumb.works.ts'
|
|
@@ -12,7 +13,7 @@ import { crumb, steps } from './breadcrumb.works.ts'
|
|
|
12
13
|
export interface BreadcrumbProps {
|
|
13
14
|
readonly map: MapIsland
|
|
14
15
|
readonly current: string
|
|
15
|
-
readonly dispatch?:
|
|
16
|
+
readonly dispatch?: keyof Dispatching
|
|
16
17
|
readonly input?: Readonly<Record<string, unknown>>
|
|
17
18
|
readonly invokeOn?: 'press' | 'shown'
|
|
18
19
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { MessageKey } from '../content.tsx';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface ButtonProps {
|
|
4
5
|
readonly label: MessageKey;
|
|
@@ -8,10 +9,10 @@ export interface ButtonProps {
|
|
|
8
9
|
readonly type?: string;
|
|
9
10
|
readonly disabled?: boolean;
|
|
10
11
|
readonly loading?: boolean;
|
|
11
|
-
readonly dispatch?: string;
|
|
12
12
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
13
13
|
readonly navigateTo?: string;
|
|
14
14
|
readonly onPress?: () => void;
|
|
15
|
+
readonly dispatch?: keyof Dispatching;
|
|
15
16
|
readonly invokeOn?: 'press' | 'shown';
|
|
16
17
|
}
|
|
17
18
|
export declare const Button: Element<'Button', ButtonProps>;
|