@tcn/ui 0.17.0 → 0.18.1
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/AI_USAGE.md +59 -0
- package/CHANGELOG.md +1009 -0
- package/ai-docs/actions.md +43 -0
- package/ai-docs/decorators.md +34 -0
- package/ai-docs/feedback.md +31 -0
- package/ai-docs/form.md +58 -0
- package/ai-docs/inputs.md +71 -0
- package/ai-docs/layouts.md +76 -0
- package/ai-docs/mobile.md +34 -0
- package/ai-docs/navigation.md +48 -0
- package/ai-docs/overlay.md +58 -0
- package/ai-docs/stacks.md +59 -0
- package/ai-docs/surfaces.md +79 -0
- package/ai-docs/themes.md +47 -0
- package/ai-docs/tokens.md +35 -0
- package/ai-docs/typography.md +38 -0
- package/ai-docs/utils.md +51 -0
- package/dist/actions/index.d.ts +0 -1
- package/dist/actions/index.d.ts.map +1 -1
- package/dist/actions/index.js +6 -8
- package/dist/actions/index.js.map +1 -1
- package/dist/draggable.css +1 -1
- package/dist/draggable.module-DFYR5n3n.js +5 -0
- package/dist/draggable.module-DFYR5n3n.js.map +1 -0
- package/dist/field_set.css +1 -1
- package/dist/field_set.module-BpJTFCi4.js +5 -0
- package/dist/field_set.module-BpJTFCi4.js.map +1 -0
- package/dist/form/field/field.js +11 -10
- package/dist/form/field/field.js.map +1 -1
- package/dist/form/field_set/field_set.d.ts +6 -10
- package/dist/form/field_set/field_set.d.ts.map +1 -1
- package/dist/form/field_set/field_set.js +33 -61
- package/dist/form/field_set/field_set.js.map +1 -1
- package/dist/form/field_set/legend.d.ts +20 -0
- package/dist/form/field_set/legend.d.ts.map +1 -0
- package/dist/form/field_set/legend.js +28 -0
- package/dist/form/field_set/legend.js.map +1 -0
- package/dist/form/index.d.ts +2 -1
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +24 -22
- package/dist/form/index.js.map +1 -1
- package/dist/inputs/color_input/color_input.js +2 -3
- package/dist/inputs/color_input/color_input.js.map +1 -1
- package/dist/inputs/color_input/color_picker.js +11 -10
- package/dist/inputs/color_input/color_picker.js.map +1 -1
- package/dist/inputs/combo_box/combo_box.js +11 -10
- package/dist/inputs/combo_box/combo_box.js.map +1 -1
- package/dist/inputs/date_picker/date_picker.js +11 -10
- package/dist/inputs/date_picker/date_picker.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_header.d.ts.map +1 -1
- package/dist/inputs/date_picker/date_picker_header.js +15 -14
- package/dist/inputs/date_picker/date_picker_header.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_input.js +9 -9
- package/dist/inputs/date_picker/date_picker_time_selector.js +2 -3
- package/dist/inputs/date_picker/date_picker_time_selector.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_input.js +2 -3
- package/dist/inputs/date_picker/date_picker_year_input.js.map +1 -1
- package/dist/inputs/date_picker/date_picker_year_selector.js +22 -22
- package/dist/inputs/date_picker/date_picker_year_selector.js.map +1 -1
- package/dist/inputs/mask_input/key_capture_input.js +21 -20
- package/dist/inputs/mask_input/key_capture_input.js.map +1 -1
- package/dist/inputs/mask_input/mask_input.js +18 -17
- package/dist/inputs/mask_input/mask_input.js.map +1 -1
- package/dist/inputs/multiselect/multiselect.js +11 -10
- package/dist/inputs/multiselect/multiselect.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_inline_values.d.ts.map +1 -1
- package/dist/inputs/multiselect/multiselect_inline_values.js +15 -15
- package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_values.js +16 -17
- package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_context.js +13 -12
- package/dist/inputs/phone_number_input/phone_number_context.js.map +1 -1
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js +2 -3
- package/dist/inputs/phone_number_input/phone_number_input_adapter.js.map +1 -1
- package/dist/inputs/phone_number_input/sip_input.js +8 -9
- package/dist/inputs/phone_number_input/sip_input.js.map +1 -1
- package/dist/inputs/select/select.js +9 -9
- package/dist/inputs/slider/slider.js +21 -20
- package/dist/inputs/slider/slider.js.map +1 -1
- package/dist/inputs/suggestions/suggestion_list.js +9 -9
- package/dist/inputs/switch/switch.js +16 -15
- package/dist/inputs/switch/switch.js.map +1 -1
- package/dist/inputs/unit_input/unit_input.js +11 -10
- package/dist/inputs/unit_input/unit_input.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js +11 -10
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js +11 -10
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js.map +1 -1
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js +11 -10
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js.map +1 -1
- package/dist/multiselect_values.css +1 -1
- package/dist/navigation/tabs/state/link/tab_link.js +11 -10
- package/dist/navigation/tabs/state/link/tab_link.js.map +1 -1
- package/dist/overlay/frame/frame.d.ts.map +1 -1
- package/dist/overlay/frame/frame.js +117 -76
- package/dist/overlay/frame/frame.js.map +1 -1
- package/dist/overlay/menu/menu.js +21 -20
- package/dist/overlay/menu/menu.js.map +1 -1
- package/dist/overlay/popper/base/dismissal_decorator.js +3 -3
- package/dist/overlay/popper/base/dismissal_decorator.js.map +1 -1
- package/dist/overlay/popper/context_popper.js +11 -10
- package/dist/overlay/popper/context_popper.js.map +1 -1
- package/dist/overlay/popper/element_popper.js +11 -10
- package/dist/overlay/popper/element_popper.js.map +1 -1
- package/dist/overlay/popper/legacy/popper.js +28 -27
- package/dist/overlay/popper/legacy/popper.js.map +1 -1
- package/dist/overlay/popper/preview_popper.js +11 -10
- package/dist/overlay/popper/preview_popper.js.map +1 -1
- package/dist/overlay/tethered/tethered.js +11 -10
- package/dist/overlay/tethered/tethered.js.map +1 -1
- package/dist/resizable.css +1 -1
- package/dist/resizable.module-ur5FBfxo.js +5 -0
- package/dist/resizable.module-ur5FBfxo.js.map +1 -0
- package/dist/resize_handle.css +1 -1
- package/dist/stacks/box/box.d.ts +14 -0
- package/dist/stacks/box/box.d.ts.map +1 -1
- package/dist/stacks/box/box.js +98 -99
- package/dist/stacks/box/box.js.map +1 -1
- package/dist/stacks/box/end_resize_handle.js +5 -5
- package/dist/stacks/box/end_resize_handle.js.map +1 -1
- package/dist/stacks/box/resize_handlers.d.ts.map +1 -1
- package/dist/stacks/box/resize_handlers.js +12 -12
- package/dist/stacks/box/resize_handlers.js.map +1 -1
- package/dist/stacks/box/start_resize_handle.js +7 -7
- package/dist/stacks/box/start_resize_handle.js.map +1 -1
- package/dist/stacks/box/types.d.ts +3 -2
- package/dist/stacks/box/types.d.ts.map +1 -1
- package/dist/stacks/h_collapsible_box.js +14 -13
- package/dist/stacks/h_collapsible_box.js.map +1 -1
- package/dist/stacks/v_collapsible_box.js +14 -13
- package/dist/stacks/v_collapsible_box.js.map +1 -1
- package/dist/surfaces/alert/alert.js +7 -8
- package/dist/surfaces/alert/alert.js.map +1 -1
- package/dist/themes/stories/button_showcase.d.ts.map +1 -1
- package/dist/themes/stories/controls_fieldset.d.ts.map +1 -1
- package/dist/themes/stories/menu_showcase.d.ts.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.css +1 -1
- package/dist/themes/themes/ergo/ergo_theme.d.ts.map +1 -1
- package/dist/themes/themes/ergo/ergo_theme.js +336 -294
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/themes/themes/ergo/parts/actions.css +1 -0
- package/dist/themes/themes/ergo/parts/base.css +1 -0
- package/dist/themes/themes/ergo/parts/form.css +1 -0
- package/dist/themes/themes/ergo/parts/inputs.css +1 -0
- package/dist/themes/themes/ergo/parts/navigation.css +1 -0
- package/dist/themes/themes/windows_98/windows_98.css +1 -1
- package/dist/themes/themes/windows_98/windows_98_theme.js +32 -43
- package/dist/themes/themes/windows_98/windows_98_theme.js.map +1 -1
- package/dist/utils/decorators/clone_with_decorator.d.ts +21 -0
- package/dist/utils/decorators/clone_with_decorator.d.ts.map +1 -0
- package/dist/utils/decorators/clone_with_decorator.js +16 -0
- package/dist/utils/decorators/clone_with_decorator.js.map +1 -0
- package/dist/utils/decorators/draggable/context.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/context.js.map +1 -0
- package/dist/utils/{dnd/handle.d.ts → decorators/draggable/drag_handle.d.ts} +1 -1
- package/dist/utils/decorators/draggable/drag_handle.d.ts.map +1 -0
- package/dist/utils/{dnd/handle.js → decorators/draggable/drag_handle.js} +2 -2
- package/dist/utils/decorators/draggable/drag_handle.js.map +1 -0
- package/dist/utils/decorators/draggable/draggable.d.ts.map +1 -0
- package/dist/utils/{dnd → decorators}/draggable/draggable.js +3 -3
- package/dist/utils/decorators/draggable/draggable.js.map +1 -0
- package/dist/utils/decorators/draggable/index.d.ts +11 -0
- package/dist/utils/decorators/draggable/index.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/index.js +14 -0
- package/dist/utils/{dnd → decorators/draggable}/types.d.ts +1 -1
- package/dist/utils/decorators/draggable/types.d.ts.map +1 -0
- package/dist/utils/{dnd/hooks → decorators/draggable}/use_drag_container.d.ts +2 -2
- package/dist/utils/decorators/draggable/use_drag_container.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/use_drag_container.js.map +1 -0
- package/dist/utils/decorators/draggable/use_draggable.d.ts.map +1 -0
- package/dist/utils/decorators/draggable/use_draggable.js.map +1 -0
- package/dist/utils/decorators/index.d.ts +3 -0
- package/dist/utils/decorators/index.d.ts.map +1 -0
- package/dist/utils/decorators/index.js +27 -0
- package/dist/utils/decorators/index.js.map +1 -0
- package/dist/utils/decorators/resizable/context.d.ts.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/context.js +1 -1
- package/dist/utils/decorators/resizable/context.js.map +1 -0
- package/dist/utils/decorators/resizable/handle_config.d.ts.map +1 -0
- package/dist/utils/decorators/resizable/handle_config.js +62 -0
- package/dist/utils/decorators/resizable/handle_config.js.map +1 -0
- package/dist/utils/decorators/resizable/index.d.ts.map +1 -0
- package/dist/utils/decorators/resizable/index.js.map +1 -0
- package/dist/utils/decorators/resizable/resizable.d.ts.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/resizable.js +2 -2
- package/dist/utils/decorators/resizable/resizable.js.map +1 -0
- package/dist/utils/decorators/resizable/resize_handle.d.ts.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/resize_handle.js +2 -2
- package/dist/utils/decorators/resizable/resize_handle.js.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/resize_strategy.d.ts +1 -1
- package/dist/utils/decorators/resizable/resize_strategy.d.ts.map +1 -0
- package/dist/utils/decorators/resizable/resize_strategy.js.map +1 -0
- package/dist/utils/{resize → decorators/resizable}/types.d.ts +2 -2
- package/dist/utils/decorators/resizable/types.d.ts.map +1 -0
- package/dist/utils/hooks/labelled_by_context.d.ts +21 -0
- package/dist/utils/hooks/labelled_by_context.d.ts.map +1 -0
- package/dist/utils/hooks/labelled_by_context.js +12 -0
- package/dist/utils/hooks/labelled_by_context.js.map +1 -0
- package/dist/utils/index.d.ts +8 -8
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +44 -40
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/listeners/click_away_listener.d.ts.map +1 -0
- package/dist/utils/{click_away_listener.js → listeners/click_away_listener.js} +1 -1
- package/dist/utils/listeners/click_away_listener.js.map +1 -0
- package/dist/utils/listeners/focus_redirect.d.ts.map +1 -0
- package/dist/utils/listeners/focus_redirect.js.map +1 -0
- package/dist/utils/listeners/index.d.ts +4 -0
- package/dist/utils/listeners/index.d.ts.map +1 -0
- package/dist/utils/listeners/index.js +10 -0
- package/dist/utils/listeners/index.js.map +1 -0
- package/dist/utils/listeners/mouse_leave_region.d.ts.map +1 -0
- package/dist/utils/listeners/mouse_leave_region.js.map +1 -0
- package/dist/utils/listeners/scroll_away_listener.d.ts.map +1 -0
- package/dist/utils/{scroll_away_listener.js → listeners/scroll_away_listener.js} +1 -1
- package/dist/utils/listeners/scroll_away_listener.js.map +1 -0
- package/dist/utils/system/index.d.ts +2 -0
- package/dist/utils/system/index.d.ts.map +1 -0
- package/dist/utils/system/index.js +2 -0
- package/dist/utils/system/index.js.map +1 -0
- package/dist/utils/system/variations.d.ts.map +1 -0
- package/dist/utils/system/variations.js +2 -0
- package/dist/utils/system/variations.js.map +1 -0
- package/dist/utils/types/sides.d.ts +3 -0
- package/dist/utils/types/sides.d.ts.map +1 -0
- package/package.json +7 -9
- package/src/actions/button/__stories__/button_group.stories.tsx +23 -24
- package/src/actions/index.ts +0 -1
- package/src/form/field/field.stories.tsx +2 -2
- package/src/form/field/h_field/h_field.stories.tsx +1 -1
- package/src/form/field/v_field/v_field.stories.tsx +1 -1
- package/src/form/field_set/field_set.module.css +0 -14
- package/src/form/field_set/field_set.stories.tsx +101 -1
- package/src/form/field_set/field_set.tsx +43 -57
- package/src/form/field_set/legend.tsx +44 -0
- package/src/form/index.ts +6 -1
- package/src/inputs/date_picker/date_picker_header.tsx +7 -5
- package/src/inputs/date_picker/date_picker_year_selector.tsx +5 -5
- package/src/inputs/multiselect/multiselect_inline_values.tsx +4 -3
- package/src/inputs/multiselect/multiselect_values.module.css +1 -0
- package/src/inputs/multiselect/multiselect_values.tsx +4 -4
- package/src/overlay/frame/frame.stories.tsx +2 -1
- package/src/overlay/frame/frame.tsx +68 -20
- package/src/overlay/popper/base/dismissal_decorator.tsx +3 -3
- package/src/overlay/popper/legacy/popper.stories.tsx +9 -2
- package/src/overlay/slide/slide.stories.tsx +1 -1
- package/src/stacks/box/box.tsx +29 -4
- package/src/stacks/box/end_resize_handle.tsx +1 -1
- package/src/stacks/box/resize_handlers.ts +1 -1
- package/src/stacks/box/start_resize_handle.tsx +1 -1
- package/src/stacks/box/types.ts +3 -2
- package/src/stacks/collapsible_box.stories.tsx +5 -5
- package/src/stacks/demo.stories.tsx +7 -7
- package/src/surfaces/page/page.stories.tsx +4 -4
- package/src/surfaces/window/window.stories.tsx +1 -1
- package/src/themes/stories/button_showcase.tsx +3 -1
- package/src/themes/stories/controls_fieldset.tsx +3 -1
- package/src/themes/stories/menu_showcase.tsx +3 -1
- package/src/themes/themes/ergo/INTERACTIVE.md +89 -0
- package/src/themes/themes/ergo/ROADMAP.md +116 -0
- package/src/themes/themes/ergo/ergo_theme.css +22 -717
- package/src/themes/themes/ergo/ergo_theme.ts +15 -1
- package/src/themes/themes/ergo/parts/actions.css +287 -0
- package/src/themes/themes/ergo/parts/base.css +62 -0
- package/src/themes/themes/ergo/parts/form.css +23 -0
- package/src/themes/themes/ergo/parts/inputs.css +252 -0
- package/src/themes/themes/ergo/parts/navigation.css +104 -0
- package/src/themes/themes/windows_98/windows_98.css +32 -43
- package/src/tokens/chip/chip.stories.tsx +5 -5
- package/src/utils/decorators/DECORATOR_PATTERN.md +86 -0
- package/src/utils/decorators/clone_with_decorator.ts +47 -0
- package/src/utils/{dnd → decorators/draggable}/__stories__/draggable.stories.tsx +7 -7
- package/src/utils/{dnd → decorators/draggable}/__stories__/use_draggable.stories.tsx +2 -2
- package/src/utils/{dnd/handle.tsx → decorators/draggable/drag_handle.tsx} +1 -1
- package/src/utils/{dnd → decorators}/draggable/draggable.tsx +2 -2
- package/src/utils/decorators/draggable/index.ts +15 -0
- package/src/utils/{dnd → decorators/draggable}/types.ts +1 -1
- package/src/utils/{dnd/hooks → decorators/draggable}/use_drag_container.ts +2 -2
- package/src/utils/decorators/index.ts +2 -0
- package/src/utils/{resize → decorators/resizable}/__stories__/resizable.stories.tsx +23 -23
- package/src/utils/{resize → decorators/resizable}/__tests__/handle_config.test.ts +19 -97
- package/src/utils/{resize → decorators/resizable}/__tests__/resize_strategy.test.ts +20 -20
- package/src/utils/{resize → decorators/resizable}/context.ts +1 -1
- package/src/utils/{resize → decorators/resizable}/handle_config.ts +7 -31
- package/src/utils/{resize → decorators/resizable}/resizable.tsx +1 -1
- package/src/utils/{resize → decorators/resizable}/resize_handle.module.css +1 -41
- package/src/utils/{resize → decorators/resizable}/resize_handle.tsx +1 -1
- package/src/utils/{resize → decorators/resizable}/resize_strategy.ts +1 -1
- package/src/utils/{resize → decorators/resizable}/types.ts +1 -7
- package/src/utils/hooks/labelled_by_context.ts +27 -0
- package/src/utils/index.ts +8 -8
- package/src/utils/{click_away_listener.tsx → listeners/click_away_listener.tsx} +1 -1
- package/src/utils/listeners/index.ts +3 -0
- package/src/utils/{scroll_away_listener.tsx → listeners/scroll_away_listener.tsx} +1 -1
- package/src/utils/system/index.ts +1 -0
- package/src/utils/types/sides.ts +2 -0
- package/dist/actions/button/slim_button/slim_button.d.ts +0 -9
- package/dist/actions/button/slim_button/slim_button.d.ts.map +0 -1
- package/dist/actions/button/slim_button/slim_button.js +0 -18
- package/dist/actions/button/slim_button/slim_button.js.map +0 -1
- package/dist/draggable.module-BgelQsuJ.js +0 -5
- package/dist/draggable.module-BgelQsuJ.js.map +0 -1
- package/dist/frame.css +0 -1
- package/dist/left_resize_handle.css +0 -1
- package/dist/resizable.module-I6iyBAvM.js +0 -5
- package/dist/resizable.module-I6iyBAvM.js.map +0 -1
- package/dist/right_resize_handle.css +0 -1
- package/dist/slim_button.css +0 -1
- package/dist/stacks/box/left_resize_handle.d.ts +0 -4
- package/dist/stacks/box/left_resize_handle.d.ts.map +0 -1
- package/dist/stacks/box/left_resize_handle.js +0 -36
- package/dist/stacks/box/left_resize_handle.js.map +0 -1
- package/dist/stacks/box/right_resize_handle.d.ts +0 -4
- package/dist/stacks/box/right_resize_handle.d.ts.map +0 -1
- package/dist/stacks/box/right_resize_handle.js +0 -36
- package/dist/stacks/box/right_resize_handle.js.map +0 -1
- package/dist/utils/click_away_listener.d.ts.map +0 -1
- package/dist/utils/click_away_listener.js.map +0 -1
- package/dist/utils/dnd/context.d.ts.map +0 -1
- package/dist/utils/dnd/context.js.map +0 -1
- package/dist/utils/dnd/draggable/draggable.d.ts.map +0 -1
- package/dist/utils/dnd/draggable/draggable.js.map +0 -1
- package/dist/utils/dnd/handle.d.ts.map +0 -1
- package/dist/utils/dnd/handle.js.map +0 -1
- package/dist/utils/dnd/hooks/use_drag_container.d.ts.map +0 -1
- package/dist/utils/dnd/hooks/use_drag_container.js.map +0 -1
- package/dist/utils/dnd/hooks/use_draggable.d.ts.map +0 -1
- package/dist/utils/dnd/hooks/use_draggable.js.map +0 -1
- package/dist/utils/dnd/types.d.ts.map +0 -1
- package/dist/utils/focus_redirect.d.ts.map +0 -1
- package/dist/utils/focus_redirect.js.map +0 -1
- package/dist/utils/mouse_leave_region.d.ts.map +0 -1
- package/dist/utils/mouse_leave_region.js.map +0 -1
- package/dist/utils/resize/context.d.ts.map +0 -1
- package/dist/utils/resize/context.js.map +0 -1
- package/dist/utils/resize/handle_config.d.ts.map +0 -1
- package/dist/utils/resize/handle_config.js +0 -85
- package/dist/utils/resize/handle_config.js.map +0 -1
- package/dist/utils/resize/index.d.ts.map +0 -1
- package/dist/utils/resize/resizable.d.ts.map +0 -1
- package/dist/utils/resize/resizable.js.map +0 -1
- package/dist/utils/resize/resize_handle.d.ts.map +0 -1
- package/dist/utils/resize/resize_handle.js.map +0 -1
- package/dist/utils/resize/resize_strategy.d.ts.map +0 -1
- package/dist/utils/resize/resize_strategy.js.map +0 -1
- package/dist/utils/resize/types.d.ts.map +0 -1
- package/dist/utils/scroll_away_listener.d.ts.map +0 -1
- package/dist/utils/scroll_away_listener.js.map +0 -1
- package/dist/utils/types/variations.d.ts.map +0 -1
- package/src/actions/button/__stories__/slim_button.stories.tsx +0 -274
- package/src/actions/button/slim_button/slim_button.module.css +0 -9
- package/src/actions/button/slim_button/slim_button.tsx +0 -26
- package/src/overlay/frame/frame.module.css +0 -5
- package/src/stacks/box/left_resize_handle.module.css +0 -12
- package/src/stacks/box/left_resize_handle.tsx +0 -39
- package/src/stacks/box/right_resize_handle.module.css +0 -12
- package/src/stacks/box/right_resize_handle.tsx +0 -38
- /package/dist/utils/{dnd → decorators/draggable}/context.d.ts +0 -0
- /package/dist/utils/{dnd → decorators/draggable}/context.js +0 -0
- /package/dist/utils/{dnd → decorators}/draggable/draggable.d.ts +0 -0
- /package/dist/utils/{resize → decorators/draggable}/index.js.map +0 -0
- /package/dist/utils/{dnd → decorators/draggable}/types.js +0 -0
- /package/dist/utils/{dnd → decorators/draggable}/types.js.map +0 -0
- /package/dist/utils/{dnd/hooks → decorators/draggable}/use_drag_container.js +0 -0
- /package/dist/utils/{dnd/hooks → decorators/draggable}/use_draggable.d.ts +0 -0
- /package/dist/utils/{dnd/hooks → decorators/draggable}/use_draggable.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/context.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/handle_config.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/index.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/index.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/resizable.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/resize_handle.d.ts +0 -0
- /package/dist/utils/{resize → decorators/resizable}/resize_strategy.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/types.js +0 -0
- /package/dist/utils/{resize → decorators/resizable}/types.js.map +0 -0
- /package/dist/utils/{click_away_listener.d.ts → listeners/click_away_listener.d.ts} +0 -0
- /package/dist/utils/{focus_redirect.d.ts → listeners/focus_redirect.d.ts} +0 -0
- /package/dist/utils/{focus_redirect.js → listeners/focus_redirect.js} +0 -0
- /package/dist/utils/{mouse_leave_region.d.ts → listeners/mouse_leave_region.d.ts} +0 -0
- /package/dist/utils/{mouse_leave_region.js → listeners/mouse_leave_region.js} +0 -0
- /package/dist/utils/{scroll_away_listener.d.ts → listeners/scroll_away_listener.d.ts} +0 -0
- /package/dist/utils/{types → system}/variations.d.ts +0 -0
- /package/src/utils/{dnd → decorators/draggable}/__stories__/draggable_stories.module.css +0 -0
- /package/src/utils/{dnd → decorators/draggable}/context.ts +0 -0
- /package/src/utils/{dnd → decorators}/draggable/draggable.module.css +0 -0
- /package/src/utils/{dnd/hooks → decorators/draggable}/use_draggable.ts +0 -0
- /package/src/utils/{resize → decorators/resizable}/__stories__/resizable_stories.module.css +0 -0
- /package/src/utils/{resize → decorators/resizable}/index.ts +0 -0
- /package/src/utils/{resize → decorators/resizable}/resizable.module.css +0 -0
- /package/src/utils/{click_away_listener.stories.tsx → listeners/click_away_listener.stories.tsx} +0 -0
- /package/src/utils/{focus_redirect.tsx → listeners/focus_redirect.tsx} +0 -0
- /package/src/utils/{mouse_leave_region.tsx → listeners/mouse_leave_region.tsx} +0 -0
- /package/src/utils/{scroll_away_listener.stories.tsx → listeners/scroll_away_listener.stories.tsx} +0 -0
- /package/src/utils/{types → system}/variations.ts +0 -0
package/src/stacks/box/box.tsx
CHANGED
|
@@ -7,8 +7,6 @@ import { removeUndefinedProperties } from '../utils/remove_undefined_properties.
|
|
|
7
7
|
import { BottomResizeHandle } from './bottom_resize_handle.js';
|
|
8
8
|
import { EndResizeHandle } from './end_resize_handle.js';
|
|
9
9
|
import { HandleProps } from './handle_props.js';
|
|
10
|
-
import { LeftResizeHandle } from './left_resize_handle.js';
|
|
11
|
-
import { RightResizeHandle } from './right_resize_handle.js';
|
|
12
10
|
import { StartResizeHandle } from './start_resize_handle.js';
|
|
13
11
|
import { TopResizeHandle } from './top_resize_handle.js';
|
|
14
12
|
import type {
|
|
@@ -43,20 +41,47 @@ export interface BoxProps<T extends HTMLElement = HTMLElement> extends HTMLAttri
|
|
|
43
41
|
overflow?: React.CSSProperties['overflow'];
|
|
44
42
|
overflowX?: React.CSSProperties['overflowX'];
|
|
45
43
|
overflowY?: React.CSSProperties['overflowY'];
|
|
44
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
46
45
|
enableResizeOnTop?: boolean;
|
|
46
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
47
47
|
enableResizeOnEnd?: boolean;
|
|
48
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
48
49
|
enableResizeOnBottom?: boolean;
|
|
50
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
49
51
|
enableResizeOnStart?: boolean;
|
|
52
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
50
53
|
enableResizeOnLeft?: boolean;
|
|
54
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
51
55
|
enableResizeOnRight?: boolean;
|
|
56
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
52
57
|
horizontalHandleProps?: HandleProps;
|
|
58
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
53
59
|
verticalHandleProps?: HandleProps;
|
|
60
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
54
61
|
onWidthResize?: OnWidthResize;
|
|
62
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
55
63
|
onHeightResize?: OnHeightResize;
|
|
64
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
56
65
|
onWidthResizeEnd?: OnWidthResizeEnd;
|
|
66
|
+
/** @deprecated Use Resizable + ResizeHandle instead */
|
|
57
67
|
onHeightResizeEnd?: OnHeightResizeEnd;
|
|
58
68
|
}
|
|
59
69
|
|
|
70
|
+
/** Union of deprecated resize-related prop names on BoxProps. Useful for Omit<BoxProps, DeprecatedBoxResizeProps>. */
|
|
71
|
+
export type DeprecatedBoxResizeProps =
|
|
72
|
+
| 'enableResizeOnTop'
|
|
73
|
+
| 'enableResizeOnEnd'
|
|
74
|
+
| 'enableResizeOnBottom'
|
|
75
|
+
| 'enableResizeOnStart'
|
|
76
|
+
| 'enableResizeOnLeft'
|
|
77
|
+
| 'enableResizeOnRight'
|
|
78
|
+
| 'horizontalHandleProps'
|
|
79
|
+
| 'verticalHandleProps'
|
|
80
|
+
| 'onWidthResize'
|
|
81
|
+
| 'onHeightResize'
|
|
82
|
+
| 'onWidthResizeEnd'
|
|
83
|
+
| 'onHeightResizeEnd';
|
|
84
|
+
|
|
60
85
|
export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
|
|
61
86
|
{
|
|
62
87
|
style,
|
|
@@ -206,7 +231,7 @@ export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
|
|
|
206
231
|
/>
|
|
207
232
|
)}
|
|
208
233
|
{enableResizeOnLeft && (
|
|
209
|
-
<
|
|
234
|
+
<StartResizeHandle
|
|
210
235
|
onWidthResize={onWidthResize}
|
|
211
236
|
onWidthResizeEnd={onWidthResizeEnd}
|
|
212
237
|
targetRef={boxRef}
|
|
@@ -214,7 +239,7 @@ export const Box = React.forwardRef<HTMLElement, BoxProps>(function Box(
|
|
|
214
239
|
/>
|
|
215
240
|
)}
|
|
216
241
|
{enableResizeOnRight && (
|
|
217
|
-
<
|
|
242
|
+
<EndResizeHandle
|
|
218
243
|
onWidthResize={onWidthResize}
|
|
219
244
|
onWidthResizeEnd={onWidthResizeEnd}
|
|
220
245
|
targetRef={boxRef}
|
|
@@ -19,7 +19,7 @@ export function createHorizontalResizeHandler(
|
|
|
19
19
|
targetRef: React.MutableRefObject<HTMLElement | null>,
|
|
20
20
|
onWidthResize?: OnWidthResize,
|
|
21
21
|
onWidthResizeEnd?: (width: number, origin: WidthResizeOrigin) => void,
|
|
22
|
-
origin: WidthResizeOrigin = '
|
|
22
|
+
origin: WidthResizeOrigin = 'end',
|
|
23
23
|
invert = false,
|
|
24
24
|
disableDirection = false
|
|
25
25
|
) {
|
package/src/stacks/box/types.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { HandleProps } from './handle_props.js';
|
|
2
|
+
import type { HorizontalSide, VerticalSide } from '../../utils/types/sides.js';
|
|
2
3
|
|
|
3
|
-
export type WidthResizeOrigin =
|
|
4
|
-
export type HeightResizeOrigin =
|
|
4
|
+
export type WidthResizeOrigin = HorizontalSide;
|
|
5
|
+
export type HeightResizeOrigin = VerticalSide;
|
|
5
6
|
|
|
6
7
|
export interface BaseOnResizePayload<
|
|
7
8
|
Origin extends WidthResizeOrigin | HeightResizeOrigin,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChevronLeftIcon as ChevronLeft } from '@tcn/icons/chevron_left_icon.js';
|
|
2
2
|
import { PlusIcon as Plus } from '@tcn/icons/plus_icon.js';
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import { Button
|
|
4
|
+
import { Button } from '../actions/index.js';
|
|
5
5
|
import { Title } from '../typography/index.js';
|
|
6
6
|
import { HCollapsibleBox } from './h_collapsible_box.js';
|
|
7
7
|
import { HStack } from './h_stack.js';
|
|
@@ -26,14 +26,14 @@ function MyPanel() {
|
|
|
26
26
|
return (
|
|
27
27
|
<VStack height="100%" vAlign="start" style={{ backgroundColor: 'white' }}>
|
|
28
28
|
<HStack padding="8px">
|
|
29
|
-
<
|
|
29
|
+
<Button utility hierarchy="tertiary">
|
|
30
30
|
<ChevronLeft size="lg" />
|
|
31
|
-
</
|
|
31
|
+
</Button>
|
|
32
32
|
<Title emphasis="strong">Foo</Title>
|
|
33
33
|
<Spacer />
|
|
34
|
-
<
|
|
34
|
+
<Button utility size="md" hierarchy="primary">
|
|
35
35
|
<Plus />
|
|
36
|
-
</
|
|
36
|
+
</Button>
|
|
37
37
|
</HStack>
|
|
38
38
|
</VStack>
|
|
39
39
|
);
|
|
@@ -6,7 +6,7 @@ import { BodyText, Headline, Subheadline, Title } from '../typography/index.js';
|
|
|
6
6
|
import { MoreHorizontalIcon } from '@tcn/icons/more_horizontal_icon.js';
|
|
7
7
|
import { PlayFilledIcon } from '@tcn/icons/play_filled_icon.js';
|
|
8
8
|
import { ShuffleIcon } from '@tcn/icons/shuffle_icon.js';
|
|
9
|
-
import { Button
|
|
9
|
+
import { Button } from '../actions/index.js';
|
|
10
10
|
import { CloudDownloadIcon } from '@tcn/icons/cloud_download_icon.js';
|
|
11
11
|
import { Spacer } from './spacer.js';
|
|
12
12
|
import styles from './demo.module.css';
|
|
@@ -28,9 +28,9 @@ export function Track() {
|
|
|
28
28
|
</HStack>
|
|
29
29
|
<HStack width="auto" gap="8px">
|
|
30
30
|
<BodyText>2:00</BodyText>
|
|
31
|
-
<
|
|
31
|
+
<Button utility hierarchy="tertiary" gap="4px">
|
|
32
32
|
<MoreHorizontalIcon size="lg" />
|
|
33
|
-
</
|
|
33
|
+
</Button>
|
|
34
34
|
</HStack>
|
|
35
35
|
</HStack>
|
|
36
36
|
);
|
|
@@ -83,12 +83,12 @@ export function Playing() {
|
|
|
83
83
|
</Button>
|
|
84
84
|
<Spacer />
|
|
85
85
|
<HStack width="auto" gap="8px">
|
|
86
|
-
<
|
|
86
|
+
<Button utility hierarchy="secondary" gap="4px">
|
|
87
87
|
<CloudDownloadIcon size="lg" />
|
|
88
|
-
</
|
|
89
|
-
<
|
|
88
|
+
</Button>
|
|
89
|
+
<Button utility hierarchy="secondary" gap="4px">
|
|
90
90
|
<MoreHorizontalIcon size="lg" />
|
|
91
|
-
</
|
|
91
|
+
</Button>
|
|
92
92
|
</HStack>
|
|
93
93
|
</HStack>
|
|
94
94
|
</VStack>
|
|
@@ -10,8 +10,8 @@ import { ZStack } from '../../stacks/z_stack.js';
|
|
|
10
10
|
import { Panel } from '../panel/panel.js';
|
|
11
11
|
import { Card } from '../card/card.js';
|
|
12
12
|
import { SBContent } from '../../layouts/__stories__/utils.js';
|
|
13
|
-
import { Resizable } from '../../utils/
|
|
14
|
-
import { ResizeHandle } from '../../utils/
|
|
13
|
+
import { Resizable } from '../../utils/decorators/resizable/resizable.js';
|
|
14
|
+
import { ResizeHandle } from '../../utils/decorators/resizable/resize_handle.js';
|
|
15
15
|
|
|
16
16
|
export default {
|
|
17
17
|
title: 'Surfaces/Page',
|
|
@@ -137,12 +137,12 @@ export const ResizableSecondaryColumn = () => {
|
|
|
137
137
|
</Header>
|
|
138
138
|
<Scaffold>
|
|
139
139
|
<Detail>
|
|
140
|
-
<BodyText>Drag the
|
|
140
|
+
<BodyText>Drag the start edge to resize this column.</BodyText>
|
|
141
141
|
</Detail>
|
|
142
142
|
</Scaffold>
|
|
143
143
|
</Panel>
|
|
144
144
|
</Column>
|
|
145
|
-
<ResizeHandle position="
|
|
145
|
+
<ResizeHandle position="start" />
|
|
146
146
|
</Resizable>
|
|
147
147
|
</Columns>
|
|
148
148
|
</Page>
|
|
@@ -6,7 +6,7 @@ import { Spacer } from '../../stacks/spacer.js';
|
|
|
6
6
|
import { Button } from '../../actions/index.js';
|
|
7
7
|
import { CrossIcon } from '@tcn/icons/cross_icon.js';
|
|
8
8
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
9
|
-
import { DragHandle } from '../../utils/
|
|
9
|
+
import { DragHandle } from '../../utils/decorators/draggable/drag_handle.js';
|
|
10
10
|
import { BugIcon } from '@tcn/icons/bug_icon.js';
|
|
11
11
|
|
|
12
12
|
export default {
|
|
@@ -7,11 +7,13 @@ import { VStack } from '../../stacks/v_stack.js';
|
|
|
7
7
|
import { Spacer } from '../../stacks/spacer.js';
|
|
8
8
|
import { Field } from '../../form/field/field.js';
|
|
9
9
|
import { FieldSet } from '../../form/field_set/field_set.js';
|
|
10
|
+
import { Legend } from '../../form/field_set/legend.js';
|
|
10
11
|
import { BodyText } from '../../typography/index.js';
|
|
11
12
|
|
|
12
13
|
export function ButtonShowcase() {
|
|
13
14
|
return (
|
|
14
|
-
<FieldSet
|
|
15
|
+
<FieldSet>
|
|
16
|
+
<Legend>Button Showcase</Legend>
|
|
15
17
|
{/* Basic Buttons */}
|
|
16
18
|
<Field label="Basic Buttons">
|
|
17
19
|
<HStack width="400px" gap="8px">
|
|
@@ -21,6 +21,7 @@ import { HStack } from '../../stacks/h_stack.js';
|
|
|
21
21
|
import { Spacer } from '../../stacks/spacer.js';
|
|
22
22
|
import { Field } from '../../form/field/field.js';
|
|
23
23
|
import { FieldSet } from '../../form/field_set/field_set.js';
|
|
24
|
+
import { Legend } from '../../form/field_set/legend.js';
|
|
24
25
|
|
|
25
26
|
export function ControlsFieldSet() {
|
|
26
27
|
const [disabled, setDisabled] = useState<boolean>(false);
|
|
@@ -49,7 +50,8 @@ export function ControlsFieldSet() {
|
|
|
49
50
|
<Switch checked={disabled} onChange={setDisabled} />
|
|
50
51
|
</Field>
|
|
51
52
|
<Spacer height="8px" />
|
|
52
|
-
<FieldSet
|
|
53
|
+
<FieldSet>
|
|
54
|
+
<Legend>Inputs</Legend>
|
|
53
55
|
<Field label="Input">
|
|
54
56
|
<Input disabled={disabled} />
|
|
55
57
|
</Field>
|
|
@@ -18,6 +18,7 @@ import { Spacer } from '../../stacks/spacer.js';
|
|
|
18
18
|
import { ZStack } from '../../stacks/z_stack.js';
|
|
19
19
|
import { Field } from '../../form/field/field.js';
|
|
20
20
|
import { FieldSet } from '../../form/field_set/field_set.js';
|
|
21
|
+
import { Legend } from '../../form/field_set/legend.js';
|
|
21
22
|
import { BodyText } from '../../typography/index.js';
|
|
22
23
|
import { Checkbox } from '../../inputs/index.js';
|
|
23
24
|
import { Divider } from '../../layouts/divider/divider.js';
|
|
@@ -117,7 +118,8 @@ export function MenuShowcase() {
|
|
|
117
118
|
};
|
|
118
119
|
|
|
119
120
|
return (
|
|
120
|
-
<FieldSet
|
|
121
|
+
<FieldSet>
|
|
122
|
+
<Legend>Menu Showcase</Legend>
|
|
121
123
|
{/* Basic Dropdown Menus */}
|
|
122
124
|
<Field label="Basic Dropdown Menus">
|
|
123
125
|
<VStack gap="8px" hAlign="end">
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# `.tcn-interactive` — The Interaction State Primitive
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
`.tcn-interactive` is a CSS class that provides the foundational interaction state system for all clickable/tappable elements. It is an atomic theme concept — alongside material, surface, and elevation — that doesn't define what something looks like, but how something responds to user interaction.
|
|
6
|
+
|
|
7
|
+
## What it provides
|
|
8
|
+
|
|
9
|
+
### CSS custom properties (state vocabulary)
|
|
10
|
+
|
|
11
|
+
These variables form the "interaction vocabulary" that all interactive components share:
|
|
12
|
+
|
|
13
|
+
| Variable | Purpose |
|
|
14
|
+
|----------|---------|
|
|
15
|
+
| `--ink` | Text/foreground color (defaults to `--on-material`) |
|
|
16
|
+
| `--act` | Action accent color (defaults to `--action`) |
|
|
17
|
+
| `--mat` | Background/material color (defaults to `--material`) |
|
|
18
|
+
| `--act-down` | Active/pressed state — darkened material (`black 12%` mix) |
|
|
19
|
+
| `--act-raised` | Hover state — action tinted into material (`--act 12%` mix) |
|
|
20
|
+
| `--act-focus` | Focus state — stronger action tint (`--act 16%` mix) |
|
|
21
|
+
| `--act-drag` | Drag state — strongest action tint (`--act 24%` mix) |
|
|
22
|
+
|
|
23
|
+
### Presentational defaults
|
|
24
|
+
|
|
25
|
+
| Property | Value | Why |
|
|
26
|
+
|----------|-------|-----|
|
|
27
|
+
| `cursor` | `pointer` | Signals clickability |
|
|
28
|
+
| `user-select` | `none` | Prevents accidental text selection during interaction |
|
|
29
|
+
| `background` | `var(--mat)` | Material background |
|
|
30
|
+
| `color` | `var(--ink)` | Foreground color |
|
|
31
|
+
| `transition` | `background 0.1s, color 0.1s` | Smooth state changes |
|
|
32
|
+
|
|
33
|
+
### Pseudo-state mapping
|
|
34
|
+
|
|
35
|
+
| State | Selector | Background |
|
|
36
|
+
|-------|----------|------------|
|
|
37
|
+
| Focus | `:focus-visible`, `[data-focus-visible]` | `--act-focus` + 2px outline |
|
|
38
|
+
| Hover | `:hover`, `[data-hover]` | `--act-raised` |
|
|
39
|
+
| Active | `:active`, `[data-active]` | `--act-down` |
|
|
40
|
+
| Disabled | `[data-is-disabled="true"]` | `pointer-events: none` |
|
|
41
|
+
|
|
42
|
+
The `data-*` attribute selectors exist alongside pseudo-classes so that components can programmatically force states (e.g., showing a hover state in Storybook without actual mouse interaction).
|
|
43
|
+
|
|
44
|
+
## Why we have it
|
|
45
|
+
|
|
46
|
+
Without `.tcn-interactive`, every clickable component would need to independently implement:
|
|
47
|
+
- Its own hover/focus/active/disabled background logic
|
|
48
|
+
- Its own color-mixing math for state changes
|
|
49
|
+
- Its own transition timing
|
|
50
|
+
|
|
51
|
+
By centralizing this in a single class, components opt into a consistent interaction model. A button, a toggle, a tab item, and a list item all respond to hover/focus/active in the same way — the only difference is what `--act`, `--mat`, and `--ink` resolve to in context.
|
|
52
|
+
|
|
53
|
+
This is what makes the "material system" work: a button inside a modal header automatically picks up the header's `--material` and `--on-material`, and the interactive states remix those colors correctly. No component needs to know what surface it's sitting on.
|
|
54
|
+
|
|
55
|
+
## Which components apply it
|
|
56
|
+
|
|
57
|
+
| Component | File | Additional classes |
|
|
58
|
+
|-----------|------|--------------------|
|
|
59
|
+
| `BaseButton` | `actions/button/base_button/base_button.tsx` | `.tcn-base-button` |
|
|
60
|
+
| `TabItem` | `navigation/tabs/primitives/tabs_list.tsx` | `.tcn-tab-item` |
|
|
61
|
+
| `Item` (list) | `layouts/list/item.tsx` | `.tcn-item` |
|
|
62
|
+
|
|
63
|
+
All button variants (`Button`, `Toggle`, `MobileButton`) inherit `.tcn-interactive` through `BaseButton`. This means the class is active on every button, toggle, tab, and list item in the system.
|
|
64
|
+
|
|
65
|
+
## How components customize it
|
|
66
|
+
|
|
67
|
+
Components override the vocabulary variables rather than the properties:
|
|
68
|
+
|
|
69
|
+
```css
|
|
70
|
+
/* Button sets --mat and --ink based on hierarchy */
|
|
71
|
+
.tcn-button[data-hierarchy="primary"] {
|
|
72
|
+
--mat: var(--tcn-button-color, var(--btn-primary));
|
|
73
|
+
--ink: var(--tcn-button-text-color, var(--btn-on-primary));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/* Toggle overrides for selected state */
|
|
77
|
+
.tcn-toggle[data-is-selected="true"] {
|
|
78
|
+
--mat: var(--tcn-button-color, var(--tgl-true));
|
|
79
|
+
--ink: var(--tcn-button-text-color, var(--ergo-white));
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/* Tab item overrides for selected state */
|
|
83
|
+
.tcn-tab-item[data-is-selected="true"] {
|
|
84
|
+
--mat: var(--tcn-button-color, var(--material));
|
|
85
|
+
--ink: var(--tcn-button-text-color, var(--ergo-primary));
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Because the state backgrounds (`--act-raised`, `--act-down`, `--act-focus`) are computed from `--mat` and `--act` via `color-mix()`, changing the input variables automatically produces correct state colors for any context.
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Ergo Theme — Part File Cascade
|
|
2
|
+
|
|
3
|
+
Tracks the split of the monolithic `ergo_theme.css` into modular part files loaded in a strict cascade order via `buildStyleSheet()`.
|
|
4
|
+
|
|
5
|
+
## Load Order & Status
|
|
6
|
+
|
|
7
|
+
| # | File | Status | Contains |
|
|
8
|
+
|---|------|--------|----------|
|
|
9
|
+
| 1 | `tokens/theme_tokens.css` | Done | Ergo palette, spacing, sizing, shape tokens |
|
|
10
|
+
| 2 | `tokens/system_tokens.css` | Done | Blackcat system tokens (maps palette to semantics) |
|
|
11
|
+
| 3 | `parts/base.css` | Done | `.tcn-theme-root`, `.tcn-interactive`, `.material` |
|
|
12
|
+
| 4 | `parts/actions.css` | Done | `.tcn-base-button`, `.tcn-button`, `.tcn-toggle`, `.tcn-fab`, `.tcn-mobile-button`, `.tcn-button-group`, `.tcn-select-group` |
|
|
13
|
+
| 5 | `parts/inputs.css` | Done | `.tcn-entry`, `.tcn-control`, `.tcn-input`, `.tcn-textarea`, `.tcn-control-set`, `.tcn-checkbox`, `.tcn-switch-wrapper`, `.tcn-slider`, `.tcn-radio-label`, `.tcn-select-selected-label`, `.tcn-multiselect-*` |
|
|
14
|
+
| 6 | `parts/form.css` | Done | `.tcn-field-set`, `.tcn-field-set-legend` |
|
|
15
|
+
| 7 | `parts/navigation.css` | Done | `.tcn-tabs-bar`, `.tcn-tabs-list`, `.tcn-tab-item` (default + inline variants) |
|
|
16
|
+
| 8 | `parts/tokens_display.css` | TODO | `.tcn-chip`, `.tcn-datum`, `.tcn-key`, `.tcn-value`, `.tcn-term` |
|
|
17
|
+
| 9 | `parts/decorators.css` | TODO | `.tcn-draggable`, `.tcn-drag-handle`, `.tcn-resize-handle` (new theme coverage) |
|
|
18
|
+
| 10 | `parts/layouts.css` | TODO | `.tcn-scaffold`, `.tcn-header`, `.tcn-footer`, `.tcn-utility-bar`, `.tcn-utility-strip`, `.tcn-bar`, `.tcn-group`, `.tcn-section`, `.tcn-heading`, `.tcn-detail`, `.tcn-caret`, `.tcn-columns`, `.tcn-rows`, `.tcn-divider-line` |
|
|
19
|
+
| 11 | `parts/table.css` | TODO | `.tcn-table`, `.tcn-thead`, `.tcn-tbody`, `.tcn-tfoot`, `.tcn-tr`, `.tcn-td`, `.tcn-th` |
|
|
20
|
+
| 12 | `parts/overlay.css` | TODO | `.tcn-tethered`, `.tcn-tooltip`, `.tcn-frame-dialog`, `.tcn-frame-veil` |
|
|
21
|
+
| 13 | `parts/surfaces.css` | TODO | `.tcn-page`, `.tcn-panel`, `.tcn-aside`, `.tcn-card`, `.tcn-modal`, `.tcn-drawer`, `.tcn-window`, `.tcn-pop-confirm`, `.tcn-confirm`, `.tcn-list`, `.tcn-item` |
|
|
22
|
+
| 14 | `parts/typography.css` | TODO | `.tcn-body-text`, `.tcn-headline`, `.tcn-title`, etc. (`[data-emphasis="faint"]`) |
|
|
23
|
+
|
|
24
|
+
> Once all parts are extracted, `ergo_theme.css` is deleted and this file may be renamed to `LAYERS.md`.
|
|
25
|
+
|
|
26
|
+
## Dependency Chain
|
|
27
|
+
|
|
28
|
+
Each layer can reference CSS custom properties and class behaviors defined in layers above it. Reverse references (later layer depending on an earlier one's internals) are not allowed.
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
tokens/theme_tokens.css
|
|
32
|
+
Defines: --ergo-* palette, spacing, sizing, shape
|
|
33
|
+
Depends on: nothing
|
|
34
|
+
|
|
35
|
+
tokens/system_tokens.css
|
|
36
|
+
Defines: --font-*, --gap-*, --padding-*, --status-color-*, --action-severity-*, --*-color-*
|
|
37
|
+
Depends on: theme_tokens (references --ergo-* variables)
|
|
38
|
+
|
|
39
|
+
parts/base.css
|
|
40
|
+
Defines: --action, --on-action, --material, --on-material (on .tcn-theme-root)
|
|
41
|
+
--ink, --act, --mat, --act-down, --act-raised, --act-focus, --act-drag (on .tcn-interactive)
|
|
42
|
+
.material background/color
|
|
43
|
+
Depends on: theme_tokens (--ergo-primary, --ergo-white, --ergo-accent-blue)
|
|
44
|
+
system_tokens (--font-family, --font-color)
|
|
45
|
+
|
|
46
|
+
parts/actions.css
|
|
47
|
+
Defines: --btn-*, --tgl-* button/toggle sizing and color system
|
|
48
|
+
Depends on: base (--action, --on-action, --material, --on-material, --ink, --act, --mat)
|
|
49
|
+
theme_tokens (--ergo-shape-radius-medium, severity colors)
|
|
50
|
+
system_tokens (--padding-small, --action-severity-*)
|
|
51
|
+
|
|
52
|
+
parts/navigation.css
|
|
53
|
+
Defines: tab indicator positioning, variant styles
|
|
54
|
+
Depends on: base (--material, --on-material, interactive vocabulary)
|
|
55
|
+
actions (uses --mat, --ink, --act from interactive chain)
|
|
56
|
+
theme_tokens (--ergo-primary, --ergo-accent-blue, --ergo-material-divider)
|
|
57
|
+
|
|
58
|
+
parts/inputs.css
|
|
59
|
+
Defines: form control chrome (border, focus, disabled states), multiselect containers
|
|
60
|
+
Depends on: base (--action, --material, --act, --mat)
|
|
61
|
+
theme_tokens (--ergo-grey, --ergo-sizing-action-md, --ergo-shape-radius-medium, --ergo-primary)
|
|
62
|
+
system_tokens (--ergo-text-size-input, --gap-small)
|
|
63
|
+
|
|
64
|
+
parts/form.css
|
|
65
|
+
Defines: field-set layout, legend chrome, disabled entry within field-set
|
|
66
|
+
Depends on: theme_tokens (--ergo-sizing-bar-md, --ergo-material-divider, --ergo-material-disabled-outline, --ergo-text-color-disabled-outline)
|
|
67
|
+
system_tokens (--gap-medium, --padding-medium)
|
|
68
|
+
|
|
69
|
+
parts/tokens_display.css
|
|
70
|
+
Defines: chip, datum, key/value/term display atoms
|
|
71
|
+
Depends on: base (--action, --on-material)
|
|
72
|
+
theme_tokens (--ergo-primary, --ergo-accent-blue, status colors)
|
|
73
|
+
|
|
74
|
+
parts/decorators.css
|
|
75
|
+
Defines: drag handle cursors, resize handle indicators
|
|
76
|
+
Depends on: theme_tokens (--ergo-grey-light, --ergo-grey-dark, --ergo-shape-radius-medium)
|
|
77
|
+
Note: must precede layouts and surfaces since handles appear inside both
|
|
78
|
+
|
|
79
|
+
parts/layouts.css
|
|
80
|
+
Defines: scaffold structure, section nesting depth system, bar/group dividers, columns/rows, caret, divider-line
|
|
81
|
+
Depends on: base (--material, --on-material)
|
|
82
|
+
theme_tokens (--ergo-sizing-bar-*, --ergo-material-border, section depth colors)
|
|
83
|
+
system_tokens (--padding-*, --gap-*)
|
|
84
|
+
|
|
85
|
+
parts/table.css
|
|
86
|
+
Defines: table chrome (header/body/footer colors, alternating rows, sticky borders)
|
|
87
|
+
Depends on: base (--material, --on-material, --action, --on-action)
|
|
88
|
+
theme_tokens (--ergo-white, --ergo-accent-blue-light, --ergo-grey)
|
|
89
|
+
system_tokens (--padding-medium)
|
|
90
|
+
layouts (inherits --pad-inline concept from scaffold/surface context)
|
|
91
|
+
|
|
92
|
+
parts/overlay.css
|
|
93
|
+
Defines: tethered positioning, tooltip chrome, frame-dialog border, veil backdrop
|
|
94
|
+
Depends on: base (--material, --on-material)
|
|
95
|
+
theme_tokens (--ergo-secondary-dark, --ergo-shape-triangle-medium)
|
|
96
|
+
system_tokens (--padding-medium)
|
|
97
|
+
|
|
98
|
+
parts/surfaces.css — LAST
|
|
99
|
+
Defines: page/panel/card/modal/drawer/window/pop-confirm composition
|
|
100
|
+
Depends on: ALL previous layers
|
|
101
|
+
Note: surfaces are the final composition layer. They set --material, --on-material,
|
|
102
|
+
--divide-header, --pad-inline for their children (scaffold, sections, inputs,
|
|
103
|
+
actions). This is why surfaces must be last — they orchestrate all other layers.
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Why this order matters
|
|
107
|
+
|
|
108
|
+
The cascade within `@layer tcn-theme` is determined by declaration order. Later declarations win on conflicts for equal specificity. This means:
|
|
109
|
+
|
|
110
|
+
1. **Tokens first** — everything references them, nothing references back
|
|
111
|
+
2. **Base before actions** — actions use `--ink`, `--act`, `--mat` defined by `.tcn-interactive` in base
|
|
112
|
+
3. **Actions before navigation** — tabs extend the interactive/action vocabulary
|
|
113
|
+
4. **Inputs independent** — form controls don't depend on actions or navigation
|
|
114
|
+
5. **Decorators before layouts/surfaces** — handles appear inside both; their base styles must exist first
|
|
115
|
+
6. **Layouts before surfaces** — surfaces set `--pad-inline`, `--divide-header` that scaffold/section read; layout structure rules must exist for surfaces to override them
|
|
116
|
+
7. **Surfaces last** — they compose everything: inputs inside cards, actions inside modals, layout slots inside panels. Surface-specific overrides (e.g., `.tcn-card .tcn-section`) must win over base layout rules
|