@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
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { MessageKey } from '../content.tsx';
|
|
2
2
|
import { type FontRoleId } from '../fonts.ts';
|
|
3
|
+
import type { Dispatching } from '../checked.ts';
|
|
3
4
|
import { type Element } from '../wrappers.tsx';
|
|
4
5
|
export interface TextProps {
|
|
5
6
|
readonly k: MessageKey;
|
|
6
7
|
readonly with?: Readonly<Record<string, unknown>>;
|
|
7
8
|
readonly is?: FontRoleId;
|
|
8
9
|
readonly announce?: 'alert' | 'status';
|
|
9
|
-
readonly dispatch?:
|
|
10
|
+
readonly dispatch?: keyof Dispatching;
|
|
10
11
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
11
12
|
readonly invokeOn?: 'press' | 'shown';
|
|
12
13
|
}
|
package/dist/ui/elements/text.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { roleClass } from
|
|
4
|
-
import { element, useSurface } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
5
|
export const Text = element('Text', (props, className) => {
|
|
6
6
|
const surface = useSurface({ className: roleClass(props.is, className),
|
|
7
7
|
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, type FontRoleId } from '../fonts.ts'
|
|
5
5
|
|
|
6
|
+
import type { Dispatching } from '../checked.ts'
|
|
6
7
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
7
8
|
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ export interface TextProps {
|
|
|
11
12
|
readonly with?: Readonly<Record<string, unknown>>
|
|
12
13
|
readonly is?: FontRoleId
|
|
13
14
|
readonly announce?: 'alert' | 'status'
|
|
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,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 TextareaProps {
|
|
4
5
|
readonly labelKey: MessageKey;
|
|
@@ -7,7 +8,7 @@ export interface TextareaProps {
|
|
|
7
8
|
readonly onValue?: (said: string) => void;
|
|
8
9
|
readonly validator?: string;
|
|
9
10
|
readonly rows?: number;
|
|
10
|
-
readonly dispatch?:
|
|
11
|
+
readonly dispatch?: keyof Dispatching;
|
|
11
12
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
12
13
|
readonly invokeOn?: 'press' | 'shown';
|
|
13
14
|
}
|
|
@@ -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 { limited } from
|
|
6
|
-
import { does } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
|
+
import { limited } from '../validators.js';
|
|
6
|
+
import { does } from './textarea.works.js';
|
|
7
7
|
export const Textarea = element('Textarea', (props, className) => {
|
|
8
8
|
const surface = useSurface({ className: roleClass(undefined, className),
|
|
9
9
|
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 { limited } from '../validators.ts'
|
|
8
9
|
import { does } from './textarea.works.ts'
|
|
@@ -15,7 +16,7 @@ export interface TextareaProps {
|
|
|
15
16
|
readonly onValue?: (said: string) => void
|
|
16
17
|
readonly validator?: string
|
|
17
18
|
readonly rows?: number
|
|
18
|
-
readonly dispatch?:
|
|
19
|
+
readonly dispatch?: keyof Dispatching
|
|
19
20
|
readonly input?: Readonly<Record<string, unknown>>
|
|
20
21
|
readonly invokeOn?: 'press' | 'shown'
|
|
21
22
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type FontRoleId } from '../fonts.ts';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface TimeProps {
|
|
4
5
|
readonly value?: unknown;
|
|
5
6
|
readonly relative?: boolean;
|
|
6
7
|
readonly is?: FontRoleId;
|
|
7
|
-
readonly
|
|
8
|
+
readonly invalid?: boolean;
|
|
9
|
+
readonly dispatch?: keyof Dispatching;
|
|
8
10
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
9
11
|
readonly invokeOn?: 'press' | 'shown';
|
|
10
12
|
}
|
package/dist/ui/elements/time.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
|
+
import { shows, uses } from './time.works.js';
|
|
5
6
|
export const Time = element('Time', (props, className) => {
|
|
6
7
|
const kept = uses(props);
|
|
7
8
|
const surface = useSurface({ className: roleClass(props.is, className),
|
|
8
9
|
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
9
10
|
holds: [
|
|
11
|
+
...(props.invalid === true ? ['invalid'] : []),
|
|
10
12
|
...(kept.holds ?? []),
|
|
11
13
|
],
|
|
14
|
+
raises: ['invalid'],
|
|
12
15
|
...(kept.animates === undefined ? {} : { animates: kept.animates }), });
|
|
13
|
-
return (shows(props, surface, kept));
|
|
16
|
+
return (_jsx("span", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, ...(kept.on ?? {}), children: shows(props, surface, kept) }));
|
|
14
17
|
}, 'e-time', {});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { MessageKey } from '../content.tsx'
|
|
3
4
|
import { roleClass, type FontRoleId } from '../fonts.ts'
|
|
4
5
|
|
|
6
|
+
import type { Dispatching } from '../checked.ts'
|
|
5
7
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
6
8
|
import { shows, uses } from './time.works.ts'
|
|
7
9
|
|
|
@@ -10,7 +12,8 @@ export interface TimeProps {
|
|
|
10
12
|
readonly value?: unknown
|
|
11
13
|
readonly relative?: boolean
|
|
12
14
|
readonly is?: FontRoleId
|
|
13
|
-
readonly
|
|
15
|
+
readonly invalid?: boolean
|
|
16
|
+
readonly dispatch?: keyof Dispatching
|
|
14
17
|
readonly input?: Readonly<Record<string, unknown>>
|
|
15
18
|
readonly invokeOn?: 'press' | 'shown'
|
|
16
19
|
}
|
|
@@ -22,11 +25,15 @@ export const Time: Element<'Time', TimeProps> = element(
|
|
|
22
25
|
const surface = useSurface({ className: roleClass(props.is, className),
|
|
23
26
|
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
24
27
|
holds: [
|
|
28
|
+
...(props.invalid === true ? ['invalid' as const] : []),
|
|
25
29
|
...(kept.holds ?? []),
|
|
26
30
|
],
|
|
31
|
+
raises: ['invalid' as const],
|
|
27
32
|
...(kept.animates === undefined ? {} : { animates: kept.animates }), })
|
|
28
33
|
return (
|
|
29
|
-
|
|
34
|
+
<span className={surface.className} {...surface.marks} {...surface.invokes} {...surface.a11y} {...(kept.on ?? {})}>
|
|
35
|
+
{shows(props, surface, kept)}
|
|
36
|
+
</span>
|
|
30
37
|
)
|
|
31
38
|
},
|
|
32
39
|
'e-time',
|
|
@@ -4,6 +4,7 @@ import type { TimeProps } from './time.tsx';
|
|
|
4
4
|
export declare function uses(props: TimeProps): {
|
|
5
5
|
readonly holds?: readonly string[];
|
|
6
6
|
readonly animates?: boolean;
|
|
7
|
+
readonly on?: Readonly<Record<string, unknown>>;
|
|
7
8
|
readonly at: number | undefined;
|
|
8
9
|
};
|
|
9
10
|
export declare function shows(props: TimeProps, surface: Surface, kept: {
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { useCallback, useSyncExternalStore } from 'react';
|
|
2
|
-
import { renderValue } from
|
|
3
|
-
import {
|
|
2
|
+
import { renderValue } from '../content.js';
|
|
3
|
+
import { runValidator } from '../validators.js';
|
|
4
|
+
import { useUi } from '../wrappers.js';
|
|
4
5
|
const NO_CLOCK_YET = () => undefined;
|
|
5
6
|
export function uses(props) {
|
|
6
7
|
const { now, ticker } = useUi();
|
|
7
8
|
const subscribe = useCallback((onChange) => (props.relative === true && ticker !== undefined ? ticker.subscribe(onChange) : () => undefined), [props.relative, ticker]);
|
|
8
9
|
const read = useCallback(() => now?.(), [now]);
|
|
9
|
-
|
|
10
|
+
const at = useSyncExternalStore(subscribe, read, NO_CLOCK_YET);
|
|
11
|
+
const { relative, value } = props;
|
|
12
|
+
const { ok } = runValidator(relative === true ? 'relativeTime' : 'datetime', value, relative === true ? { now: at } : {});
|
|
13
|
+
return ok ? { at } : { at, holds: ['invalid'] };
|
|
10
14
|
}
|
|
11
15
|
export function shows(props, surface, kept) {
|
|
12
16
|
if (props.relative !== true || kept.at === undefined) {
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { useCallback, useSyncExternalStore, type ReactNode } from 'react'
|
|
2
2
|
|
|
3
3
|
import { renderValue } from '../content.tsx'
|
|
4
|
+
import { runValidator } from '../validators.ts'
|
|
4
5
|
import type { Surface } from '../door.ts'
|
|
5
6
|
import { useUi } from '../wrappers.tsx'
|
|
6
7
|
import type { TimeProps } from './time.tsx'
|
|
7
8
|
|
|
8
9
|
const NO_CLOCK_YET = (): number | undefined => undefined
|
|
9
10
|
|
|
10
|
-
export function uses(props: TimeProps): { readonly holds?: readonly string[]; readonly animates?: boolean; readonly at: number | undefined } {
|
|
11
|
+
export function uses(props: TimeProps): { readonly holds?: readonly string[]; readonly animates?: boolean; readonly on?: Readonly<Record<string, unknown>>; readonly at: number | undefined } {
|
|
11
12
|
const { now, ticker } = useUi()
|
|
12
13
|
const subscribe = useCallback(
|
|
13
14
|
(onChange: () => void) => (props.relative === true && ticker !== undefined ? ticker.subscribe(onChange) : () => undefined),
|
|
14
15
|
[props.relative, ticker],
|
|
15
16
|
)
|
|
16
17
|
const read = useCallback(() => now?.(), [now])
|
|
17
|
-
|
|
18
|
+
const at = useSyncExternalStore(subscribe, read, NO_CLOCK_YET)
|
|
19
|
+
const { relative, value } = props
|
|
20
|
+
const { ok } = runValidator(relative === true ? 'relativeTime' : 'datetime', value, relative === true ? { now: at } : {})
|
|
21
|
+
return ok ? { at } : { at, holds: ['invalid'] }
|
|
18
22
|
}
|
|
19
23
|
|
|
20
24
|
export function shows(props: TimeProps, surface: Surface, kept: { readonly at: number | undefined }): ReactNode {
|
|
@@ -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 ToggleProps {
|
|
4
5
|
readonly labelKey: MessageKey;
|
|
5
6
|
readonly on?: boolean;
|
|
6
7
|
readonly onToggle?: (said: boolean) => void;
|
|
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 { does } from
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
|
+
import { does } from './toggle.works.js';
|
|
6
6
|
export const Toggle = element('Toggle', (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 { does } from './toggle.works.ts'
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ export interface ToggleProps {
|
|
|
11
12
|
readonly labelKey: MessageKey
|
|
12
13
|
readonly on?: boolean
|
|
13
14
|
readonly onToggle?: (said: boolean) => void
|
|
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,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 TooltipProps {
|
|
5
6
|
readonly children: ReactNode;
|
|
6
7
|
readonly labelKey: MessageKey;
|
|
7
8
|
readonly side?: string;
|
|
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,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { element, useSurface } from
|
|
4
|
-
import { measured, bubble, showing, uses } from
|
|
3
|
+
import { element, useSurface } from '../wrappers.js';
|
|
4
|
+
import { measured, bubble, showing, uses } from './tooltip.works.js';
|
|
5
5
|
export const Tooltip = element('Tooltip', (props, className) => {
|
|
6
6
|
const kept = uses(props);
|
|
7
7
|
const surface = useSurface({ className,
|
|
@@ -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
|
import { measured, bubble, showing, uses } from './tooltip.works.ts'
|
|
8
9
|
|
|
@@ -11,7 +12,7 @@ export interface TooltipProps {
|
|
|
11
12
|
readonly children: ReactNode
|
|
12
13
|
readonly labelKey: MessageKey
|
|
13
14
|
readonly side?: 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,6 +1,6 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { useDismissLayer } from
|
|
3
|
-
import { positionOf } from
|
|
2
|
+
import { useDismissLayer } from '../dismiss-layer.js';
|
|
3
|
+
import { positionOf } from '../positioning.js';
|
|
4
4
|
export function uses(props) {
|
|
5
5
|
const trigger = useRef(null);
|
|
6
6
|
const layer = useRef(null);
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type FontRoleId } from '../fonts.ts';
|
|
2
|
+
import type { Dispatching } from '../checked.ts';
|
|
2
3
|
import { type Element } from '../wrappers.tsx';
|
|
3
4
|
export interface ValueProps {
|
|
4
5
|
readonly validator: string;
|
|
5
6
|
readonly value?: unknown;
|
|
6
7
|
readonly context?: Readonly<Record<string, unknown>>;
|
|
7
8
|
readonly is?: FontRoleId;
|
|
8
|
-
readonly
|
|
9
|
+
readonly invalid?: boolean;
|
|
10
|
+
readonly dispatch?: keyof Dispatching;
|
|
9
11
|
readonly input?: Readonly<Record<string, unknown>>;
|
|
10
12
|
readonly invokeOn?: 'press' | 'shown';
|
|
11
13
|
}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
'use client';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { roleClass } from '../fonts.js';
|
|
4
|
+
import { element, useSurface } from '../wrappers.js';
|
|
5
|
+
import { shows } from './value.works.js';
|
|
5
6
|
export const Value = element('Value', (props, className) => {
|
|
6
7
|
const surface = useSurface({ className: roleClass(props.is, className),
|
|
7
|
-
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
8
|
-
|
|
8
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
9
|
+
holds: [
|
|
10
|
+
...(props.invalid === true ? ['invalid'] : []),
|
|
11
|
+
],
|
|
12
|
+
raises: ['invalid'], });
|
|
13
|
+
return (_jsx("span", { className: surface.className, ...surface.marks, ...surface.invokes, ...surface.a11y, children: shows(props, surface) }));
|
|
9
14
|
}, 'e-value', {});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
+
import type { MessageKey } from '../content.tsx'
|
|
3
4
|
import { roleClass, type FontRoleId } from '../fonts.ts'
|
|
4
5
|
|
|
6
|
+
import type { Dispatching } from '../checked.ts'
|
|
5
7
|
import { type Element, element, useSurface } from '../wrappers.tsx'
|
|
6
8
|
import { shows } from './value.works.ts'
|
|
7
9
|
|
|
@@ -11,7 +13,8 @@ export interface ValueProps {
|
|
|
11
13
|
readonly value?: unknown
|
|
12
14
|
readonly context?: Readonly<Record<string, unknown>>
|
|
13
15
|
readonly is?: FontRoleId
|
|
14
|
-
readonly
|
|
16
|
+
readonly invalid?: boolean
|
|
17
|
+
readonly dispatch?: keyof Dispatching
|
|
15
18
|
readonly input?: Readonly<Record<string, unknown>>
|
|
16
19
|
readonly invokeOn?: 'press' | 'shown'
|
|
17
20
|
}
|
|
@@ -20,9 +23,15 @@ export const Value: Element<'Value', ValueProps> = element(
|
|
|
20
23
|
'Value',
|
|
21
24
|
(props: ValueProps, className) => {
|
|
22
25
|
const surface = useSurface({ className: roleClass(props.is, className),
|
|
23
|
-
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
26
|
+
invokes: { ...(props.dispatch === undefined ? {} : { dispatch: props.dispatch }), ...(props.input === undefined ? {} : { input: props.input }), ...(props.invokeOn === undefined ? {} : { on: props.invokeOn }) },
|
|
27
|
+
holds: [
|
|
28
|
+
...(props.invalid === true ? ['invalid' as const] : []),
|
|
29
|
+
],
|
|
30
|
+
raises: ['invalid' as const], })
|
|
24
31
|
return (
|
|
25
|
-
|
|
32
|
+
<span className={surface.className} {...surface.marks} {...surface.invokes} {...surface.a11y}>
|
|
33
|
+
{shows(props, surface)}
|
|
34
|
+
</span>
|
|
26
35
|
)
|
|
27
36
|
},
|
|
28
37
|
'e-value',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { renderValue } from
|
|
1
|
+
import { renderValue } from '../content.js';
|
|
2
2
|
export function shows(props, surface) {
|
|
3
3
|
return renderValue({ validator: props.validator, value: props.value, ...(props.context === undefined ? {} : { context: props.context }) }, surface);
|
|
4
4
|
}
|
package/dist/ui/elements.d.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export declare const ELEMENTS: {
|
|
2
|
-
readonly id:
|
|
3
|
-
readonly at:
|
|
4
|
-
readonly files:
|
|
5
|
-
readonly describes:
|
|
2
|
+
readonly id: 'element';
|
|
3
|
+
readonly at: 'thread/ui/elements.ts';
|
|
4
|
+
readonly files: 'ui/*.tsx';
|
|
5
|
+
readonly describes: 'An interface part, and function only: what it does, what it carries and which signals it raises, never how it looks and never markup a person writes. Its look is a variant it wears, its wording arrives as a message key rather than as words, and `thread elements` writes its file from this row, so the file is never typed. Every part this framework ships is listed here, an app adds its own to the same list, and a row that goes missing breaks the build, because what the framework offers is not an app’s to withdraw. A thing made of parts already listed here is a composition, not a new element.';
|
|
6
6
|
readonly version: 1;
|
|
7
7
|
readonly cites: readonly [{
|
|
8
|
-
readonly on:
|
|
9
|
-
readonly said:
|
|
8
|
+
readonly on: '2026-08-31';
|
|
9
|
+
readonly said: 'elements does not hold anything that can render anything, its functionality only . only our compiler can translate things into proper css and html and only at build time do we produce a renderable result.';
|
|
10
10
|
}, {
|
|
11
|
-
readonly on:
|
|
12
|
-
readonly said:
|
|
11
|
+
readonly on: '2026-08-29';
|
|
12
|
+
readonly said: 'CLI actually generates the tsx file, and you MUST give the file its body, properly.';
|
|
13
13
|
}];
|
|
14
|
-
readonly
|
|
14
|
+
readonly derives: readonly [{
|
|
15
15
|
readonly id: "accordion";
|
|
16
16
|
readonly at: "thread/ui/elements/accordion.tsx";
|
|
17
17
|
readonly by: "thread elements";
|
|
@@ -179,7 +179,6 @@ export declare const ELEMENTS: {
|
|
|
179
179
|
readonly type: "words";
|
|
180
180
|
readonly disabled: "flag";
|
|
181
181
|
readonly loading: "flag";
|
|
182
|
-
readonly dispatch: "words";
|
|
183
182
|
readonly input: "holding";
|
|
184
183
|
readonly navigateTo: "words";
|
|
185
184
|
readonly onPress: "doing";
|
|
@@ -484,7 +483,6 @@ export declare const ELEMENTS: {
|
|
|
484
483
|
readonly dwell: "count";
|
|
485
484
|
readonly moves: "flag";
|
|
486
485
|
readonly onDrop: "doing";
|
|
487
|
-
readonly dispatch: "words";
|
|
488
486
|
readonly input: "holding";
|
|
489
487
|
};
|
|
490
488
|
readonly sets: {
|
|
@@ -642,6 +640,8 @@ export declare const ELEMENTS: {
|
|
|
642
640
|
readonly at: "thread/ui/elements/money.tsx";
|
|
643
641
|
readonly by: "thread elements";
|
|
644
642
|
readonly runs: "thread elements --own --check";
|
|
643
|
+
readonly tag: "span";
|
|
644
|
+
readonly raises: readonly ["invalid"];
|
|
645
645
|
readonly carries: {
|
|
646
646
|
readonly value: "amount";
|
|
647
647
|
readonly is: "styling";
|
|
@@ -1068,6 +1068,8 @@ export declare const ELEMENTS: {
|
|
|
1068
1068
|
readonly at: "thread/ui/elements/time.tsx";
|
|
1069
1069
|
readonly by: "thread elements";
|
|
1070
1070
|
readonly runs: "thread elements --own --check";
|
|
1071
|
+
readonly tag: "span";
|
|
1072
|
+
readonly raises: readonly ["invalid"];
|
|
1071
1073
|
readonly keeps: true;
|
|
1072
1074
|
readonly carries: {
|
|
1073
1075
|
readonly value: "amount";
|
|
@@ -1131,6 +1133,8 @@ export declare const ELEMENTS: {
|
|
|
1131
1133
|
readonly at: "thread/ui/elements/value.tsx";
|
|
1132
1134
|
readonly by: "thread elements";
|
|
1133
1135
|
readonly runs: "thread elements --own --check";
|
|
1136
|
+
readonly tag: "span";
|
|
1137
|
+
readonly raises: readonly ["invalid"];
|
|
1134
1138
|
readonly carries: {
|
|
1135
1139
|
readonly validator: "ruling";
|
|
1136
1140
|
readonly value: "amount";
|
package/dist/ui/elements.js
CHANGED
|
@@ -15,7 +15,7 @@ export const ELEMENTS = {
|
|
|
15
15
|
said: 'CLI actually generates the tsx file, and you MUST give the file its body, properly.',
|
|
16
16
|
},
|
|
17
17
|
],
|
|
18
|
-
|
|
18
|
+
derives: arranging([
|
|
19
19
|
{ id: 'accordion', at: 'thread/ui/elements/accordion.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', keeps: true, works: './accordion.works.ts', carries: { items: 'parting', initial: 'ordering', exclusive: 'flag', onChange: 'choosing' }, places: { section: { tag: 'div', each: 'items', by: 'id', gives: 'section', holds: 'header region' }, header: { tag: 'button', gives: 'header', shows: 'label' }, region: { tag: 'div', gives: 'region', shows: 'inside' } }, describes: 'Sections that open one at a time, for long material somebody reads part of.' },
|
|
20
20
|
{ id: 'aspect-ratio', at: 'thread/ui/elements/aspect-ratio.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', arranges: true, carries: { ratio: 'count' }, measures: ['ratio'], works: './aspect-ratio.works.ts', sets: { aspectRatio: 'ratio' }, describes: 'A slot that keeps its proportions whatever width it gets, so a loading picture reserves its room.' },
|
|
21
21
|
{ id: 'avatar', at: 'thread/ui/elements/avatar.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'span', reads: 'picture', carries: { labelKey: 'naming', src: 'picture', initials: 'words' }, works: './avatar.works.ts', places: { picture: { tag: 'img', shows: 'src' }, lettering: { shows: 'lettering' } }, describes: 'A person or an organisation as a small picture, falling back to initials when there is no image.' },
|
|
@@ -23,7 +23,7 @@ export const ELEMENTS = {
|
|
|
23
23
|
{ id: 'bars', at: 'thread/ui/elements/bars.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', reads: 'picture', keeps: true, works: './bars.works.ts', carries: { rows: 'listing', by: 'ruling', value: 'ruling', format: 'words', titleKey: 'titling' }, places: { bar: { each: 'rows', by: 'by', marks: 'sized', holds: 'label amount' }, label: { shows: 'label' }, amount: { shows: 'amount' } }, describes: 'Quantities compared across categories. The default when the horizontal axis is not time.' },
|
|
24
24
|
{ id: 'box', at: 'thread/ui/elements/box.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', arranges: true, reads: 'grouping', raises: ['scrolling'], carries: { labelKey: 'titling' }, describes: 'The declared `div`. Groups children, optionally as a landmark region, and optionally scrolls. A box that scrolls raises `scrolling`, which a variant may dress; naming one makes it a group, and leaving it unnamed leaves it a box.' },
|
|
25
25
|
{ id: 'breadcrumb', at: 'thread/ui/elements/breadcrumb.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'nav', called: 'nav.breadcrumb', works: './breadcrumb.works.ts', carries: { map: 'mapping', current: 'ruling' }, places: { step: { tag: 'Link.linkInline', each: 'steps', by: 'id', gives: 'crumb' } }, describes: 'The trail back up from wherever somebody is, derived from the route rather than assembled by hand.' },
|
|
26
|
-
{ id: 'button', at: 'thread/ui/elements/button.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'button', keeps: true, works: './button.works.tsx', wires: 'wires', carries: { label: 'wording', with: 'holding', icon: 'words', shows: 'words', type: 'words', disabled: 'flag', loading: 'flag',
|
|
26
|
+
{ id: 'button', at: 'thread/ui/elements/button.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'button', keeps: true, works: './button.works.tsx', wires: 'wires', carries: { label: 'wording', with: 'holding', icon: 'words', shows: 'words', type: 'words', disabled: 'flag', loading: 'flag', input: 'holding', navigateTo: 'words', onPress: 'doing' }, places: { symbol: { when: 'iconed', shows: 'symbol', display: 'layout-flex', alignItems: 'align-centre' }, wording: { when: 'worded', shows: 'wording' } }, describes: 'A press that runs a declared workflow or goes to a declared screen. The only way to start either from a tap.' },
|
|
27
27
|
{ id: 'column', at: 'thread/ui/elements/column.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', describes: 'Children stacked top to bottom. The vertical arrangement, and the default shape of a form.', arranges: true, sets: { display: 'layout-flex', flexDirection: 'flow-down', gap: 'space-3' } },
|
|
28
28
|
{ id: 'consent', at: 'thread/ui/elements/consent.tsx', by: 'thread elements', runs: 'thread elements --own --check', keeps: true, works: './consent.works.tsx', carries: { decision: 'judging', onDecide: 'judged', policyKey: 'noting', preselected: 'ordering' }, places: { panel: { tag: 'Box.card', holds: 'body' }, body: { tag: 'Column', holds: 'title policy list actions' }, title: { tag: 'Text', gives: 'title' }, policy: { tag: 'Text', when: 'hasPolicy', gives: 'policy' }, list: { tag: 'Column', holds: 'category' }, category: { tag: 'Box', each: 'categories', by: 'id', holds: 'words switch fixed' }, words: { tag: 'Column', holds: 'label describe' }, label: { tag: 'Text', gives: 'label' }, describe: { tag: 'Text', gives: 'describe' }, switch: { tag: 'Toggle.input', when: 'optional', gives: 'chooser' }, fixed: { tag: 'Text', when: 'required', gives: 'fixed' }, actions: { tag: 'Box', holds: 'withdraw decline accept accept-all' }, withdraw: { tag: 'Button.buttonQuiet', when: 'withdrawable', gives: 'withdraw' }, decline: { tag: 'Button.buttonBorder', gives: 'decline' }, accept: { tag: 'Button.buttonBorder', gives: 'accept' }, 'accept-all': { tag: 'Button.buttonFill', gives: 'acceptAll' } }, describes: 'The complete permission-to-collect surface, with every declared category and its decision.' },
|
|
29
29
|
{ id: 'donut', at: 'thread/ui/elements/donut.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'svg', reads: 'picture', keeps: true, works: './donut.works.ts', carries: { rows: 'listing', by: 'ruling', value: 'ruling', titleKey: 'titling' }, places: { slice: { tag: 'circle', each: 'rows', by: 'by', gives: 'slice' } }, describes: 'Parts of one whole, for a handful of slices. Beyond that the reading is worse than a bar.' },
|
|
@@ -34,14 +34,14 @@ export const ELEMENTS = {
|
|
|
34
34
|
{ id: 'gauge', at: 'thread/ui/elements/gauge.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'svg', reads: 'picture', keeps: true, works: './gauge.works.ts', carries: { value: 'count', min: 'count', max: 'count', labelKey: 'naming' }, places: { track: { tag: 'path', gives: 'track' }, needle: { tag: 'path', gives: 'needle' } }, describes: 'A single quantity against a target, where the reading is how far along rather than how much.' },
|
|
35
35
|
{ id: 'grid', at: 'thread/ui/elements/grid.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', describes: 'Children arranged, and nothing more. Its tracks are not something a row can state — the style guide binds no track property, deliberately — so this sets nothing and a caller that wants a set of equal panels wraps a `Row` instead. Kept, and its sentence made true, because the one it carried promised tracks it has never laid out: “as many equal tracks as the container allows”, on a row with no `sets` at all.', arranges: true },
|
|
36
36
|
{ id: 'heatmap', at: 'thread/ui/elements/heatmap.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', reads: 'picture', keeps: true, works: './heatmap.works.ts', carries: { rows: 'listing', by: 'ruling', x: 'ruling', y: 'ruling', value: 'words', titleKey: 'titling' }, places: { cell: { each: 'rows', by: 'by', marks: 'sized' } }, describes: 'Density across two axes, for when the pattern matters more than any single cell.' },
|
|
37
|
-
{ id: 'hit-box', at: 'thread/ui/elements/hit-box.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', arranges: true, keeps: true, works: './hit-box.works.tsx', wires: 'wires', carries: { gesture: 'ruling', tuning: 'tuning', axis: 'words', grabs: 'subjecting', accepts: 'ordering', collects: 'subjecting', dwell: 'count', moves: 'flag', onDrop: 'doing',
|
|
37
|
+
{ id: 'hit-box', at: 'thread/ui/elements/hit-box.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', arranges: true, keeps: true, works: './hit-box.works.tsx', wires: 'wires', carries: { gesture: 'ruling', tuning: 'tuning', axis: 'words', grabs: 'subjecting', accepts: 'ordering', collects: 'subjecting', dwell: 'count', moves: 'flag', onDrop: 'doing', input: 'holding' }, sets: { display: 'layout-block', touchAction: 'touch', userSelect: 'pick', visibility: 'shown', position: 'flow' }, measures: ['touch', 'pick', 'shown', 'flow', 'width', 'height', 'carry', 'grip'], places: { carried: { tag: 'div', shows: 'carried', position: 'position-pinned', left: 'space-0', top: 'space-0', width: 'width', height: 'height', transform: 'carry', transformOrigin: 'grip', pointerEvents: 'reach-through', userSelect: 'picking-off', zIndex: 'layer-carried', willChange: 'readying-movement' } }, describes: 'A region that claims a gesture, composed with anything and declared by nothing. Put it where the grab should be, not on the element.' },
|
|
38
38
|
{ id: 'glyph', at: 'thread/ui/elements/glyph.tsx', by: 'thread elements', runs: 'thread elements --own --check', carries: { name: 'ruling', labelKey: 'noting' }, works: './glyph.works.tsx', describes: 'A semantic pictogram — `close`, `search` — resolved from whichever set the design chose at build time. It is laid out rather than left inline, because an `svg` that is left inline stands on a text baseline: the line it sits on keeps a descender\'s worth of room under the drawing, so the drawing rides above the middle of whatever holds it and the wording beside it reads as sitting lower. Measured 2026-09-03 in `thread-palette-lab`: a 24px symbol in a 28px box, its centre 2.00px above the row\'s and the wording\'s 0.36px below — 2.36px apart, the same amount everywhere, on every icon in the app.', sets: { display: 'layout-flex' } },
|
|
39
39
|
{ id: 'image', at: 'thread/ui/elements/image.tsx', by: 'thread elements', runs: 'thread elements --own --check', carries: { src: 'source', altKey: 'naming' }, tag: 'img', describes: 'A picture with alternative wording, for photographs and artwork rather than for interface symbols.' },
|
|
40
40
|
{ id: 'line-chart', at: 'thread/ui/elements/line-chart.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'svg', reads: 'picture', keeps: true, works: './line-chart.works.ts', carries: { rows: 'listing', by: 'words', value: 'ruling', titleKey: 'titling' }, places: { line: { tag: 'polyline', each: 'lines', by: 'group', gives: 'drawing' } }, describes: 'A quantity over time, with axes. The chart for a trend somebody will read values off.' },
|
|
41
41
|
{ id: 'link', at: 'thread/ui/elements/link.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'a', keeps: true, shows: 'labelKey', carries: { navigateTo: 'ruling', labelKey: 'wording', is: 'styling' }, works: './link.works.ts', describes: 'Wording that carries somebody to a declared screen. A press that navigates and does not act.' },
|
|
42
42
|
{ id: 'media', at: 'thread/ui/elements/media.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: { by: 'as', image: 'img', video: 'video', audio: 'audio', file: 'a' }, carries: { as: 'words', src: 'source', altKey: 'naming' }, describes: 'Whatever a media or file value turns out to be — a picture, a clip, a document — rendered by its kind.' },
|
|
43
43
|
{ id: 'menu', at: 'thread/ui/elements/menu.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'span', keeps: true, works: './menu.works.tsx', dresses: 'opener', measures: ['x', 'y'], carries: { labelKey: 'wording', items: 'listing', side: 'words' }, places: { opener: { tag: 'button', gives: 'opener', shows: 'labelKey' }, portal: { tag: 'Presented', gives: 'portal', holds: 'layer' }, layer: { tag: 'div', gives: 'listing', holds: 'row', position: 'position-lifted', left: 'x', top: 'y' }, row: { tag: 'MenuRow', each: 'items', by: 'labelKey', gives: 'row' } }, describes: 'Actions revealed on demand from a trigger, with keyboard traversal and dismissal already handled.' },
|
|
44
|
-
{ id: 'money', at: 'thread/ui/elements/money.tsx', by: 'thread elements', runs: 'thread elements --own --check', carries: { value: 'amount', is: 'styling' }, works: './money.works.ts', describes: 'An amount with its currency, formatted for the locale. Never a number and a symbol concatenated.' },
|
|
44
|
+
{ id: 'money', at: 'thread/ui/elements/money.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'span', raises: ['invalid'], carries: { value: 'amount', is: 'styling' }, works: './money.works.ts', describes: 'An amount with its currency, formatted for the locale. Never a number and a symbol concatenated.' },
|
|
45
45
|
{ id: 'pagination', at: 'thread/ui/elements/pagination.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'nav', called: 'nav.pagination', works: './pagination.works.ts', carries: { map: 'mapping', sequence: 'ordering', current: 'ruling' }, places: { step: { tag: 'Link.linkInline', each: 'steps', by: 'id', gives: 'step' } }, describes: 'Movement between pages of a long result, for when scrolling to the end is not reasonable.' },
|
|
46
46
|
{ id: 'progress', at: 'thread/ui/elements/progress.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', reads: 'progress', carries: { value: 'count', target: 'count', labelKey: 'naming' }, measures: ['fraction', 'span'], works: './progress.works.ts', places: { bar: { width: 'span' } }, describes: 'Work advancing toward a known end. The determinate half of what a spinner shows.' },
|
|
47
47
|
{ id: 'radio-group', at: 'thread/ui/elements/radio-group.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', reads: 'choices', keeps: true, works: './radio-group.works.ts', carries: { name: 'ruling', labelKey: 'naming', options: 'listing', chosen: 'words', onValue: 'picking', disabled: 'flag' }, places: { option: { tag: 'label', each: 'options', by: 'value', holds: 'control caption' }, control: { tag: 'input', reads: 'choosing', gives: 'option' }, caption: { shows: 'caption' } }, describes: 'One answer from a short set, all visible at once. The version of a picker with nothing hidden.' },
|
|
@@ -60,9 +60,9 @@ export const ELEMENTS = {
|
|
|
60
60
|
{ id: 'tabs', at: 'thread/ui/elements/tabs.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'div', keeps: true, works: './tabs.works.ts', carries: { items: 'parting', initial: 'words', onChange: 'picking', orientation: 'words' }, dresses: 'strip', places: { strip: { tag: 'div', gives: 'strip', holds: 'tab', display: 'layout-flex', alignItems: 'align-centre' }, tab: { tag: 'button', each: 'items', by: 'id', gives: 'tab', shows: 'label', display: 'layout-flex', alignItems: 'align-centre', justifyContent: 'align-centre', height: 'control-md', padding: 'control-pad-y control-pad-x', borderRadius: 'control-radius', borderWidth: 'edge-hair', borderStyle: 'line-off', borderColor: 'colour-clear', background: 'colour-clear', color: 'colour-ink', cursor: 'cursor-press', transition: 'motion-quick ease-out' }, panel: { tag: 'div', when: 'opened', gives: 'panel', shows: 'inside' } }, describes: 'Sibling panels where only one is visible, switched without going anywhere. Not navigation between screens. It `dresses` its strip rather than itself, which is the difference between a row of tabs and a capsule: the element wraps the strip AND the panel, so a variant landing on the element put `radius-lg` and a filled material around the whole assembly — measured 2026-09-03, and it is what made tabs read as one pill with a page inside it. The tab itself states its own look here because every key it had was structural, so the generator emitted a `button` with no class at all and nothing any style guide row said could reach it.' },
|
|
61
61
|
{ id: 'text', at: 'thread/ui/elements/text.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'span', shows: 'k', sets: { display: 'layout-inline-block' }, carries: { k: 'wording', with: 'holding', is: 'styling', announce: 'announcing' }, describes: 'The only place a message key becomes visible words. Every sentence a person reads passes through here. It sets `inline-block` because that is what makes a font role\'s trim reach it: `text-box-trim` acts on a block container\'s line boxes and an inline box is not one, so a role carrying the trim governed nothing wherever wording rendered inline. Measured 2026-09-03 at a 1280 viewport: 62 of 90 text elements trimmed to their cap height exactly without this, 72 with it, and the number wrapping to more than one line was 4 either way — it costs no wrapping. Inline-block rather than block because wording still belongs in a line beside other things when an app puts it there.' },
|
|
62
62
|
{ id: 'textarea', at: 'thread/ui/elements/textarea.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'label', carries: { labelKey: 'wording', name: 'words', value: 'words', onValue: 'picking', validator: 'words', rows: 'count' }, works: './textarea.works.ts', places: { label: { shows: 'labelKey' }, control: { tag: 'textarea', reads: 'writing', shows: 'value', takes: 'name rows validator' } }, describes: 'Prose being typed across more than one line, where the shape of what is written matters.' },
|
|
63
|
-
{ id: 'time', at: 'thread/ui/elements/time.tsx', by: 'thread elements', runs: 'thread elements --own --check', keeps: true, carries: { value: 'amount', relative: 'flag', is: 'styling' }, works: './time.works.ts', describes: 'A moment, formatted absolutely or as distance from now. Never a date somebody assembled from parts.' },
|
|
63
|
+
{ id: 'time', at: 'thread/ui/elements/time.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'span', raises: ['invalid'], keeps: true, carries: { value: 'amount', relative: 'flag', is: 'styling' }, works: './time.works.ts', describes: 'A moment, formatted absolutely or as distance from now. Never a date somebody assembled from parts.' },
|
|
64
64
|
{ id: 'toggle', at: 'thread/ui/elements/toggle.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'label', carries: { labelKey: 'wording', on: 'flag', onToggle: 'telling' }, works: './toggle.works.ts', places: { control: { tag: 'input', reads: 'choice', shows: 'on' }, label: { shows: 'labelKey' } }, describes: 'A single yes-or-no answer, flipped in place. Reach for this rather than two mutually exclusive buttons.' },
|
|
65
65
|
{ id: 'tooltip', at: 'thread/ui/elements/tooltip.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'span', arranges: true, keeps: true, works: './tooltip.works.ts', dresses: 'bubble', measures: ['x', 'y'], carries: { labelKey: 'wording', side: 'words' }, places: { bubble: { tag: 'span', when: 'showing', gives: 'bubble', shows: 'labelKey', position: 'position-lifted', left: 'x', top: 'y' } }, describes: 'A short clarification revealed by hovering or focusing. Never the only place something is said.' },
|
|
66
|
-
{ id: 'value', at: 'thread/ui/elements/value.tsx', by: 'thread elements', runs: 'thread elements --own --check', carries: { validator: 'ruling', value: 'amount', context: 'holding', is: 'styling' }, works: './value.works.ts', describes: 'A single formatted datum, punctuated by the validator that governs its kind rather than by the caller.' },
|
|
66
|
+
{ id: 'value', at: 'thread/ui/elements/value.tsx', by: 'thread elements', runs: 'thread elements --own --check', tag: 'span', raises: ['invalid'], carries: { validator: 'ruling', value: 'amount', context: 'holding', is: 'styling' }, works: './value.works.ts', describes: 'A single formatted datum, punctuated by the validator that governs its kind rather than by the caller.' },
|
|
67
67
|
]),
|
|
68
68
|
};
|