@tcn/ui 0.13.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{Color-6BZIO3FS-C9xkPWgz.js → Color-6BZIO3FS-CKNkzBV6.js} +2 -2
- package/dist/{Color-6BZIO3FS-C9xkPWgz.js.map → Color-6BZIO3FS-CKNkzBV6.js.map} +1 -1
- package/dist/{WithTooltip-65CFNBJE-DEnh547F.js → WithTooltip-65CFNBJE-Bgt57Jw2.js} +2 -2
- package/dist/WithTooltip-65CFNBJE-Bgt57Jw2.js.map +1 -0
- package/dist/actions/__docs__/components/showcase.js +1 -1
- package/dist/actions/button/button_group/button_group.d.ts +1 -0
- package/dist/actions/button/button_group/button_group.d.ts.map +1 -1
- package/dist/actions/button/button_group/button_group.js +33 -30
- package/dist/actions/button/button_group/button_group.js.map +1 -1
- package/dist/actions/types.js +2 -0
- package/dist/actions/types.js.map +1 -0
- package/dist/aside.css +1 -1
- package/dist/containers.css +1 -0
- package/dist/containers.module-DlGySre0.js +5 -0
- package/dist/containers.module-DlGySre0.js.map +1 -0
- package/dist/floating_action_button.css +1 -0
- package/dist/form/field/common/types.js +2 -0
- package/dist/form/field/common/types.js.map +1 -0
- package/dist/form/field_set/field_set.d.ts.map +1 -1
- package/dist/form/field_set/field_set.js +11 -11
- package/dist/form/field_set/field_set.js.map +1 -1
- package/dist/formatter-EIJCOSYU-ByaSCvt6.js +6 -0
- package/dist/formatter-EIJCOSYU-ByaSCvt6.js.map +1 -0
- package/dist/inputs/mask_input/mask_config.js +2 -0
- package/dist/inputs/mask_input/mask_config.js.map +1 -0
- package/dist/inputs/mask_input/mask_cursor.js +2 -0
- package/dist/inputs/mask_input/mask_cursor.js.map +1 -0
- package/dist/inputs/multiselect/multiselect_inline_values.js +9 -7
- package/dist/inputs/multiselect/multiselect_inline_values.js.map +1 -1
- package/dist/inputs/multiselect/multiselect_values.js +4 -2
- package/dist/inputs/multiselect/multiselect_values.js.map +1 -1
- package/dist/layouts/containers/rail.d.ts.map +1 -0
- package/dist/layouts/containers/rail.js +67 -0
- package/dist/layouts/containers/rail.js.map +1 -0
- package/dist/layouts/containers/scaffold.d.ts.map +1 -0
- package/dist/layouts/containers/scaffold.js +67 -0
- package/dist/layouts/containers/scaffold.js.map +1 -0
- package/dist/layouts/containers/side/side.d.ts.map +1 -0
- package/dist/layouts/containers/side/side.js +22 -0
- package/dist/layouts/containers/side/side.js.map +1 -0
- package/dist/layouts/containers/utility_strip/utility_strip.d.ts.map +1 -0
- package/dist/layouts/{rail → containers}/utility_strip/utility_strip.js +5 -5
- package/dist/layouts/containers/utility_strip/utility_strip.js.map +1 -0
- package/dist/layouts/index.d.ts +5 -8
- package/dist/layouts/index.d.ts.map +1 -1
- package/dist/layouts/index.js +36 -38
- package/dist/layouts/index.js.map +1 -1
- package/dist/layouts/section/detail.d.ts +4 -0
- package/dist/layouts/section/detail.d.ts.map +1 -0
- package/dist/layouts/section/detail.js +11 -0
- package/dist/layouts/section/detail.js.map +1 -0
- package/dist/layouts/section/heading.js +1 -1
- package/dist/layouts/section/index.d.ts +4 -0
- package/dist/layouts/section/index.d.ts.map +1 -0
- package/dist/layouts/section/index.js +9 -0
- package/dist/layouts/section/index.js.map +1 -0
- package/dist/layouts/section/section.js +1 -1
- package/dist/mobile/actions/button/mobile_button.d.ts +6 -0
- package/dist/mobile/actions/button/mobile_button.d.ts.map +1 -0
- package/dist/mobile/actions/button/mobile_button.js +21 -0
- package/dist/mobile/actions/button/mobile_button.js.map +1 -0
- package/dist/mobile/actions/floating_action_button/floating_action_button.d.ts +6 -0
- package/dist/mobile/actions/floating_action_button/floating_action_button.d.ts.map +1 -0
- package/dist/mobile/actions/floating_action_button/floating_action_button.js +20 -0
- package/dist/mobile/actions/floating_action_button/floating_action_button.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker.d.ts +17 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker.js +80 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_body.d.ts +7 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_body.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_body.js +35 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_body.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_date.d.ts +8 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_date.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_date.js +74 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_date.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_day.d.ts +6 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_day.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_day.js +39 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_day.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.d.ts +9 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js +163 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_header.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.d.ts +9 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js +190 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_input.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_time_selector.d.ts +11 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_time_selector.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_time_selector.js +50 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_time_selector.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.d.ts +7 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js +109 -0
- package/dist/mobile/inputs/date_picker/mobile_date_picker_year_selector.js.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_overlay_header.d.ts +6 -0
- package/dist/mobile/inputs/date_picker/mobile_overlay_header.d.ts.map +1 -0
- package/dist/mobile/inputs/date_picker/mobile_overlay_header.js +34 -0
- package/dist/mobile/inputs/date_picker/mobile_overlay_header.js.map +1 -0
- package/dist/mobile/inputs/index.d.ts +5 -0
- package/dist/mobile/inputs/index.d.ts.map +1 -0
- package/dist/mobile/inputs/index.js +11 -0
- package/dist/mobile/inputs/index.js.map +1 -0
- package/dist/mobile/portal/mobile_portal.d.ts +5 -0
- package/dist/mobile/portal/mobile_portal.d.ts.map +1 -0
- package/dist/mobile/portal/mobile_portal.js +10 -0
- package/dist/mobile/portal/mobile_portal.js.map +1 -0
- package/dist/mobile/viewport/mobile_viewport.d.ts +21 -0
- package/dist/mobile/viewport/mobile_viewport.d.ts.map +1 -0
- package/dist/mobile/viewport/mobile_viewport.js +31 -0
- package/dist/mobile/viewport/mobile_viewport.js.map +1 -0
- package/dist/mobile_button.css +1 -0
- package/dist/mobile_date_picker.css +1 -0
- package/dist/mobile_date_picker_date.css +1 -0
- package/dist/mobile_date_picker_day.css +1 -0
- package/dist/mobile_date_picker_header.css +1 -0
- package/dist/mobile_date_picker_input.css +1 -0
- package/dist/mobile_date_picker_time_selector.css +1 -0
- package/dist/mobile_date_picker_year_selector.css +1 -0
- package/dist/mobile_overlay_header.css +1 -0
- package/dist/mobile_viewport.css +1 -0
- package/dist/navigation/tabs/state/link/use_tab_link.d.ts +2 -1
- package/dist/navigation/tabs/state/link/use_tab_link.d.ts.map +1 -1
- package/dist/navigation/tabs/state/link/use_tab_link.js.map +1 -1
- package/dist/overlay/tethered/types.js +2 -0
- package/dist/overlay/tethered/types.js.map +1 -0
- package/dist/panel.css +1 -1
- package/dist/phone_number_input.css +1 -1
- package/dist/section.css +1 -1
- package/dist/section.module-BXlxYmJK.js +5 -0
- package/dist/section.module-BXlxYmJK.js.map +1 -0
- package/dist/{showcase-y9D3_Y8T.js → showcase-DBFp_Epk.js} +94 -94
- package/dist/showcase-DBFp_Epk.js.map +1 -0
- package/dist/side.css +1 -1
- package/dist/stacks/box/handle_props.js +2 -0
- package/dist/stacks/box/handle_props.js.map +1 -0
- package/dist/stacks/box/types.js +2 -0
- package/dist/stacks/box/types.js.map +1 -0
- package/dist/surfaces/aside/aside.d.ts +1 -1
- package/dist/surfaces/aside/aside.d.ts.map +1 -1
- package/dist/surfaces/aside/aside.js +1 -1
- package/dist/surfaces/aside/aside.js.map +1 -1
- package/dist/surfaces/card/card.d.ts +1 -1
- package/dist/surfaces/card/card.d.ts.map +1 -1
- package/dist/surfaces/card/card.js +1 -1
- package/dist/surfaces/card/card.js.map +1 -1
- package/dist/surfaces/drawers/drawer.js +1 -1
- package/dist/surfaces/drawers/drawer.js.map +1 -1
- package/dist/surfaces/modal/modal.js +1 -1
- package/dist/surfaces/modal/modal.js.map +1 -1
- package/dist/surfaces/page/page.d.ts +1 -1
- package/dist/surfaces/page/page.d.ts.map +1 -1
- package/dist/surfaces/page/page.js +1 -1
- package/dist/surfaces/page/page.js.map +1 -1
- package/dist/surfaces/panel/panel.d.ts +1 -1
- package/dist/surfaces/panel/panel.d.ts.map +1 -1
- package/dist/surfaces/panel/panel.js +1 -1
- package/dist/surfaces/panel/panel.js.map +1 -1
- package/dist/surfaces/pop_confirm/pop_confirm.js +8 -9
- package/dist/surfaces/pop_confirm/pop_confirm.js.map +1 -1
- package/dist/surfaces/window/window.js +1 -1
- package/dist/surfaces/window/window.js.map +1 -1
- package/dist/{syntaxhighlighter-ED5Y7EFY-CqInEOwQ.js → syntaxhighlighter-ED5Y7EFY-B0ag_7lq.js} +2 -2
- package/dist/syntaxhighlighter-ED5Y7EFY-B0ag_7lq.js.map +1 -0
- package/dist/term.css +1 -0
- package/dist/themes/build_stylesheet.d.ts +2 -0
- package/dist/themes/build_stylesheet.d.ts.map +1 -0
- package/dist/themes/build_stylesheet.js +9 -0
- package/dist/themes/build_stylesheet.js.map +1 -0
- package/dist/themes/theme_variables.d.ts +7 -0
- package/dist/themes/theme_variables.d.ts.map +1 -1
- package/dist/themes/theme_variables.js +16 -9
- package/dist/themes/theme_variables.js.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 +314 -154
- package/dist/themes/themes/ergo/ergo_theme.js.map +1 -1
- package/dist/themes/themes/ergo/tokens/system_tokens.css +1 -0
- package/dist/themes/themes/ergo/tokens/theme_tokens.css +1 -0
- package/dist/tokens/index.d.ts +1 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +4 -2
- package/dist/tokens/index.js.map +1 -1
- package/dist/tokens/key/key.d.ts +8 -1
- package/dist/tokens/key/key.d.ts.map +1 -1
- package/dist/tokens/key/key.js +20 -3
- package/dist/tokens/key/key.js.map +1 -1
- package/dist/tokens/term/term.d.ts +4 -0
- package/dist/tokens/term/term.d.ts.map +1 -0
- package/dist/tokens/term/term.js +20 -0
- package/dist/tokens/term/term.js.map +1 -0
- package/dist/tokens/value/value.d.ts +8 -1
- package/dist/tokens/value/value.d.ts.map +1 -1
- package/dist/tokens/value/value.js +23 -5
- package/dist/tokens/value/value.js.map +1 -1
- package/dist/utility_strip.css +1 -1
- package/dist/utils/calendar/calendar_date.js +2 -0
- package/dist/utils/calendar/calendar_date.js.map +1 -0
- package/dist/utils/dnd/types.js +2 -0
- package/dist/utils/dnd/types.js.map +1 -0
- package/dist/utils/types/variations.d.ts +1 -0
- package/dist/utils/types/variations.d.ts.map +1 -1
- package/dist/value.css +1 -0
- package/dist/value.module-DFaCouFD.js +5 -0
- package/dist/value.module-DFaCouFD.js.map +1 -0
- package/package.json +17 -16
- package/src/actions/button/button_group/button_group.tsx +18 -10
- package/src/form/field_set/field_set.tsx +4 -2
- package/src/inputs/phone_number_input/phone_number_input.module.css +7 -5
- package/src/layouts/__stories__/composed.stories.tsx +13 -8
- package/src/layouts/__stories__/composed_stories.module.css +1 -0
- package/src/layouts/__stories__/rail.stories.tsx +23 -25
- package/src/layouts/__stories__/scaffold.stories.tsx +21 -41
- package/src/layouts/__stories__/utils/layout_theme.css +0 -4
- package/src/layouts/__stories__/utils/layout_theme_provider.tsx +8 -1
- package/src/layouts/__stories__/utils.tsx +15 -29
- package/src/layouts/containers/containers.module.css +55 -0
- package/src/layouts/{rail → containers}/rail.tsx +15 -5
- package/src/layouts/{scaffold → containers}/scaffold.tsx +15 -5
- package/src/layouts/{rail → containers}/side/side.tsx +2 -1
- package/src/layouts/index.ts +6 -8
- package/src/layouts/section/__stories__/section.stories.tsx +79 -50
- package/src/layouts/section/detail.tsx +14 -0
- package/src/layouts/section/index.ts +3 -0
- package/src/layouts/section/section.module.css +0 -36
- package/src/mobile/actions/button/mobile_button.module.css +34 -0
- package/src/mobile/actions/button/mobile_button.stories.tsx +97 -0
- package/src/mobile/actions/button/mobile_button.tsx +26 -0
- package/src/mobile/actions/floating_action_button/floating_action_button.module.css +28 -0
- package/src/mobile/actions/floating_action_button/floating_action_button.stories.tsx +102 -0
- package/src/mobile/actions/floating_action_button/floating_action_button.tsx +25 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker.module.css +22 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker.tsx +118 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_body.tsx +57 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_date.module.css +80 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_date.tsx +102 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_day.module.css +6 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_day.tsx +40 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_header.module.css +21 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_header.tsx +180 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_input.module.css +13 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_input.stories.tsx +27 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_input.tsx +240 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_time_selector.module.css +7 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_time_selector.tsx +81 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_year_selector.module.css +55 -0
- package/src/mobile/inputs/date_picker/mobile_date_picker_year_selector.tsx +119 -0
- package/src/mobile/inputs/date_picker/mobile_overlay_header.module.css +5 -0
- package/src/mobile/inputs/date_picker/mobile_overlay_header.tsx +29 -0
- package/src/mobile/inputs/index.ts +4 -0
- package/src/mobile/portal/mobile_portal.tsx +14 -0
- package/src/mobile/viewport/mobile_viewport.module.css +23 -0
- package/src/mobile/viewport/mobile_viewport.tsx +80 -0
- package/src/navigation/tabs/state/link/use_tab_link.ts +1 -1
- package/src/overlay/slide/slide.stories.tsx +6 -9
- package/src/surfaces/aside/aside.module.css +1 -0
- package/src/surfaces/aside/aside.stories.tsx +24 -38
- package/src/surfaces/aside/aside.tsx +1 -1
- package/src/surfaces/card/card.stories.tsx +5 -7
- package/src/surfaces/card/card.tsx +1 -1
- package/src/surfaces/drawers/drawer.stories.tsx +10 -13
- package/src/surfaces/drawers/drawer.tsx +1 -1
- package/src/surfaces/modal/__stories__/modal.stories.tsx +10 -13
- package/src/surfaces/modal/modal.tsx +1 -1
- package/src/surfaces/page/page.stories.tsx +28 -32
- package/src/surfaces/page/page.tsx +1 -1
- package/src/surfaces/panel/__stories__/panel.stories.tsx +199 -66
- package/src/surfaces/panel/panel.module.css +1 -1
- package/src/surfaces/panel/panel.tsx +1 -1
- package/src/surfaces/pop_confirm/pop_confirm.stories.tsx +29 -37
- package/src/surfaces/tooltip/__stories__/tooltip.stories.tsx +8 -10
- package/src/surfaces/window/window.stories.tsx +6 -15
- package/src/surfaces/window/window.tsx +1 -1
- package/src/themes/build_stylesheet.ts +5 -0
- package/src/themes/theme_variables.ts +9 -0
- package/src/themes/themes/ergo/__stories__/components/tone_picker/sb_tone_card.tsx +6 -8
- package/src/themes/themes/ergo/__stories__/material.stories.tsx +4 -6
- package/src/themes/themes/ergo/ergo_theme.css +208 -215
- package/src/themes/themes/ergo/ergo_theme.ts +4 -2
- package/src/themes/themes/ergo/tokens/system_tokens.css +68 -0
- package/src/themes/themes/ergo/tokens/theme_tokens.css +99 -0
- package/src/tokens/index.ts +1 -0
- package/src/tokens/key/key.tsx +23 -2
- package/src/tokens/term/term.module.css +14 -0
- package/src/tokens/term/term.stories.tsx +84 -0
- package/src/tokens/term/term.tsx +20 -0
- package/src/tokens/value/value.module.css +5 -0
- package/src/tokens/value/value.tsx +24 -2
- package/src/utils/types/variations.ts +1 -0
- package/tsconfig.json +5 -33
- package/dist/WithTooltip-65CFNBJE-DEnh547F.js.map +0 -1
- package/dist/body.css +0 -1
- package/dist/formatter-EIJCOSYU-DWmgEY3b.js +0 -6
- package/dist/formatter-EIJCOSYU-DWmgEY3b.js.map +0 -1
- package/dist/layouts/body/body.d.ts +0 -23
- package/dist/layouts/body/body.d.ts.map +0 -1
- package/dist/layouts/body/body.js +0 -20
- package/dist/layouts/body/body.js.map +0 -1
- package/dist/layouts/rail/rail.d.ts.map +0 -1
- package/dist/layouts/rail/rail.js +0 -55
- package/dist/layouts/rail/rail.js.map +0 -1
- package/dist/layouts/rail/side/side.d.ts.map +0 -1
- package/dist/layouts/rail/side/side.js +0 -21
- package/dist/layouts/rail/side/side.js.map +0 -1
- package/dist/layouts/rail/utility_strip/utility_strip.d.ts.map +0 -1
- package/dist/layouts/rail/utility_strip/utility_strip.js.map +0 -1
- package/dist/layouts/row/row.d.ts +0 -4
- package/dist/layouts/row/row.d.ts.map +0 -1
- package/dist/layouts/row/row.js +0 -11
- package/dist/layouts/row/row.js.map +0 -1
- package/dist/layouts/scaffold/scaffold.d.ts.map +0 -1
- package/dist/layouts/scaffold/scaffold.js +0 -55
- package/dist/layouts/scaffold/scaffold.js.map +0 -1
- package/dist/rail.css +0 -1
- package/dist/row.css +0 -1
- package/dist/scaffold.css +0 -1
- package/dist/section.module-0wyGkhDg.js +0 -5
- package/dist/section.module-0wyGkhDg.js.map +0 -1
- package/dist/showcase-y9D3_Y8T.js.map +0 -1
- package/dist/syntaxhighlighter-ED5Y7EFY-CqInEOwQ.js.map +0 -1
- package/src/layouts/body/body.module.css +0 -8
- package/src/layouts/body/body.tsx +0 -40
- package/src/layouts/rail/rail.module.css +0 -14
- package/src/layouts/row/row.module.css +0 -5
- package/src/layouts/row/row.tsx +0 -15
- package/src/layouts/scaffold/scaffold.module.css +0 -14
- /package/dist/layouts/{rail → containers}/rail.d.ts +0 -0
- /package/dist/layouts/{scaffold → containers}/scaffold.d.ts +0 -0
- /package/dist/layouts/{rail → containers}/side/side.d.ts +0 -0
- /package/dist/layouts/{rail → containers}/utility_strip/utility_strip.d.ts +0 -0
- /package/src/layouts/{rail → containers}/side/side.module.css +0 -0
- /package/src/layouts/{rail → containers}/utility_strip/utility_strip.module.css +0 -0
- /package/src/layouts/{rail → containers}/utility_strip/utility_strip.tsx +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_header.js","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_header.tsx"],"sourcesContent":["import { useSignalValue } from '@tcn/state';\nimport { HStack } from '../../../stacks/h_stack.js';\nimport { VStack } from '../../../stacks/v_stack.js';\nimport { Spacer } from '../../../stacks/spacer.js';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { getMonthsOfYear } from '../../../utils/calendar/get_months_of_year.js';\nimport { DatePickerPresenter } from '../../../inputs/date_picker/date_picker_presenter.js';\nimport { MobileDatePickerYearSelector } from './mobile_date_picker_year_selector.js';\nimport { MobileButton } from '../../actions/button/mobile_button.js';\nimport { MobilePortal } from '../../portal/mobile_portal.js';\nimport { MobileOverlayHeader } from './mobile_overlay_header.js';\nimport { FocusRedirect } from '../../../utils/index.js';\nimport { ChevronLeftIcon } from '@tcn/icons/chevron_left_icon.js';\nimport { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';\nimport { clsx } from 'clsx';\nimport styles from './mobile_date_picker_header.module.css';\n\nexport interface MobileDatePickerHeaderProps {\n presenter: DatePickerPresenter;\n countryCode: string;\n selectMonthMessage?: string;\n selectYearMessage?: string;\n}\n\nexport function MobileDatePickerHeader({\n presenter,\n countryCode,\n selectMonthMessage = 'Select Month',\n selectYearMessage = 'Select Year',\n}: MobileDatePickerHeaderProps) {\n const state = useSignalValue(presenter.stateBroadcast);\n const [monthOpen, setMonthOpen] = useState(false);\n const [yearOpen, setYearOpen] = useState(false);\n const monthButtonRef = useRef<HTMLButtonElement | null>(null);\n const yearButtonRef = useRef<HTMLButtonElement | null>(null);\n const monthListRef = useRef<HTMLDivElement | null>(null);\n\n const longMonths = useMemo(() => getMonthsOfYear(countryCode, 'long'), [countryCode]);\n const shortMonths = useMemo(() => getMonthsOfYear(countryCode, 'short'), [countryCode]);\n\n function selectMonth(value: string) {\n presenter.setVisibleMonth(Number(value));\n }\n\n function previous() {\n presenter.setVisibleMonth(state.visibleMonth - 1);\n }\n\n function next() {\n presenter.setVisibleMonth(state.visibleMonth + 1);\n }\n\n function openMonths() {\n setMonthOpen(true);\n }\n\n function closeMonths() {\n setMonthOpen(false);\n requestAnimationFrame(() => monthButtonRef.current?.focus());\n }\n\n function openYears() {\n setYearOpen(true);\n }\n\n function closeYears() {\n setYearOpen(false);\n requestAnimationFrame(() => yearButtonRef.current?.focus());\n }\n\n function handleMonthKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeMonths();\n }\n }\n\n function handleYearKeyDown(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeYears();\n }\n }\n\n function handleMonthRedirect() {\n monthListRef.current?.focus();\n }\n\n return (\n <>\n <HStack\n className={clsx(\n styles['mobile-date-picker-header'],\n 'tcn-mobile-date-picker-header'\n )}\n minWidth=\"35px\"\n width=\"100%\"\n >\n <MobileButton\n disabled={!state.canNavigateToPreviousMonth}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={previous}\n >\n <ChevronLeftIcon flipOnRtl size=\"md\" />\n </MobileButton>\n <Spacer />\n <HStack hAlign=\"center\" gap=\"4px\" width=\"auto\">\n <MobileButton\n ref={monthButtonRef}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={openMonths}\n >\n {shortMonths[state.visibleMonth]}\n </MobileButton>\n <MobileButton\n ref={yearButtonRef}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={openYears}\n >\n {String(state.visibleYear)}\n </MobileButton>\n </HStack>\n <Spacer />\n <MobileButton\n disabled={!state.canNavigateToNextMonth}\n hierarchy=\"tertiary\"\n width=\"auto\"\n onClick={next}\n >\n <ChevronRightIcon flipOnRtl size=\"md\" />\n </MobileButton>\n </HStack>\n\n {monthOpen && (\n <MobilePortal>\n <VStack\n className={styles['mobile-date-picker-overlay']}\n onKeyDown={handleMonthKeyDown}\n >\n <MobileOverlayHeader title={selectMonthMessage} onClose={closeMonths} />\n <VStack\n ref={monthListRef}\n tabIndex={0}\n padding=\"16px\"\n gap=\"8px\"\n height=\"flex\"\n overflowY=\"auto\"\n className={styles['mobile-month-list']}\n >\n {longMonths.map((month, index) => (\n <MobileButton\n key={index}\n hierarchy={index === state.visibleMonth ? 'primary' : 'secondary'}\n width=\"100%\"\n onClick={() => {\n selectMonth(String(index));\n closeMonths();\n }}\n >\n {month}\n </MobileButton>\n ))}\n <FocusRedirect onRedirect={handleMonthRedirect} />\n </VStack>\n </VStack>\n </MobilePortal>\n )}\n\n {yearOpen && (\n <MobilePortal>\n <VStack className={styles['mobile-year-overlay']} onKeyDown={handleYearKeyDown}>\n <MobileOverlayHeader title={selectYearMessage} onClose={closeYears} />\n <MobileDatePickerYearSelector presenter={presenter} onClose={closeYears} />\n </VStack>\n </MobilePortal>\n )}\n </>\n );\n}\n"],"names":["MobileDatePickerHeader","presenter","countryCode","selectMonthMessage","selectYearMessage","state","useSignalValue","monthOpen","setMonthOpen","useState","yearOpen","setYearOpen","monthButtonRef","useRef","yearButtonRef","monthListRef","longMonths","useMemo","getMonthsOfYear","shortMonths","selectMonth","value","previous","next","openMonths","closeMonths","openYears","closeYears","handleMonthKeyDown","event","handleYearKeyDown","handleMonthRedirect","jsxs","Fragment","HStack","clsx","styles","jsx","MobileButton","ChevronLeftIcon","Spacer","ChevronRightIcon","MobilePortal","VStack","MobileOverlayHeader","month","index","FocusRedirect","MobileDatePickerYearSelector"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAwBO,SAASA,GAAuB;AAAA,EACrC,WAAAC;AAAA,EACA,aAAAC;AAAA,EACA,oBAAAC,IAAqB;AAAA,EACrB,mBAAAC,IAAoB;AACtB,GAAgC;AAC9B,QAAMC,IAAQC,EAAeL,EAAU,cAAc,GAC/C,CAACM,GAAWC,CAAY,IAAIC,EAAS,EAAK,GAC1C,CAACC,GAAUC,CAAW,IAAIF,EAAS,EAAK,GACxCG,IAAiBC,EAAiC,IAAI,GACtDC,IAAgBD,EAAiC,IAAI,GACrDE,IAAeF,EAA8B,IAAI,GAEjDG,IAAaC,EAAQ,MAAMC,EAAgBhB,GAAa,MAAM,GAAG,CAACA,CAAW,CAAC,GAC9EiB,IAAcF,EAAQ,MAAMC,EAAgBhB,GAAa,OAAO,GAAG,CAACA,CAAW,CAAC;AAEtF,WAASkB,EAAYC,GAAe;AAClC,IAAApB,EAAU,gBAAgB,OAAOoB,CAAK,CAAC;AAAA,EACzC;AAEA,WAASC,IAAW;AAClB,IAAArB,EAAU,gBAAgBI,EAAM,eAAe,CAAC;AAAA,EAClD;AAEA,WAASkB,IAAO;AACd,IAAAtB,EAAU,gBAAgBI,EAAM,eAA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AAAA,kBARIC;AAAA,gBAAA,CAUR;AAAA,gBACD,gBAAAT,EAACU,GAAA,EAAc,YAAYhB,EAAA,CAAqB;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,QAClD;AAAA,MAAA;AAAA,IAAA,GAEJ;AAAA,IAGDrB,KACC,gBAAA2B,EAACK,GAAA,EACC,UAAA,gBAAAV,EAACW,GAAA,EAAO,WAAWP,EAAO,qBAAqB,GAAG,WAAWN,GAC3D,UAAA;AAAA,MAAA,gBAAAO,EAACO,GAAA,EAAoB,OAAOxC,GAAmB,SAASuB,GAAY;AAAA,MACpE,gBAAAU,EAACW,GAAA,EAA6B,WAAA/C,GAAsB,SAAS0B,EAAA,CAAY;AAAA,IAAA,EAAA,CAC3E,EAAA,CACF;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DatePickerInputProps } from '../../../inputs/date_picker/date_picker_input.js';
|
|
3
|
+
export interface MobileDatePickerInputProps extends DatePickerInputProps {
|
|
4
|
+
selectTimeMessage?: string;
|
|
5
|
+
selectMonthMessage?: string;
|
|
6
|
+
selectYearMessage?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const MobileDatePickerInput: React.ForwardRefExoticComponent<MobileDatePickerInputProps & React.RefAttributes<HTMLButtonElement>>;
|
|
9
|
+
//# sourceMappingURL=mobile_date_picker_input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_input.d.ts","sourceRoot":"","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_input.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkE,MAAM,OAAO,CAAC;AASvF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kDAAkD,CAAC;AAG7F,MAAM,WAAW,0BAA2B,SAAQ,oBAAoB;IACtE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,sGA6NhC,CAAC"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { jsxs as a, Fragment as ce, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import le, { useState as N, useRef as m, useCallback as ae, useMemo as g, useLayoutEffect as q } from "react";
|
|
3
|
+
import { MobileButton as h } from "../../actions/button/mobile_button.js";
|
|
4
|
+
import { ButtonGroup as me } from "../../../actions/button/button_group/button_group.js";
|
|
5
|
+
import { MobilePortal as x } from "../../portal/mobile_portal.js";
|
|
6
|
+
import { MobileDatePicker as se } from "./mobile_date_picker.js";
|
|
7
|
+
import { MobileDatePickerTimeSelector as fe } from "./mobile_date_picker_time_selector.js";
|
|
8
|
+
import { MobileOverlayHeader as j } from "./mobile_overlay_header.js";
|
|
9
|
+
import "../../../utils/click_away_listener.js";
|
|
10
|
+
import { FocusRedirect as v } from "../../../utils/focus_redirect.js";
|
|
11
|
+
import "../../../utils/scroll_away_listener.js";
|
|
12
|
+
import "../../../utils/hooks/use_resize_observer.js";
|
|
13
|
+
import "../../../utils/dnd/context.js";
|
|
14
|
+
import "clsx";
|
|
15
|
+
import "../../../draggable.module-BgelQsuJ.js";
|
|
16
|
+
import { VStack as C } from "../../../stacks/v_stack.js";
|
|
17
|
+
import '../../../mobile_date_picker_input.css';const ue = "_mobile-date-picker-overlay_099a224", pe = "_mobile-time-picker-overlay_6622396", H = { "mobile-date-picker-overlay": ue, "mobile-time-picker-overlay": pe }, Ie = le.forwardRef(function({
|
|
18
|
+
value: i = /* @__PURE__ */ new Date(),
|
|
19
|
+
onChange: D,
|
|
20
|
+
onError: K,
|
|
21
|
+
min: y = /* @__PURE__ */ new Date("01/01/1924"),
|
|
22
|
+
max: b = /* @__PURE__ */ new Date("01/01/2124"),
|
|
23
|
+
disabled: r,
|
|
24
|
+
width: R = "100%",
|
|
25
|
+
maxWidth: G,
|
|
26
|
+
minWidth: ke,
|
|
27
|
+
showTime: L = !1,
|
|
28
|
+
timeIntervalInMinutes: V = 15,
|
|
29
|
+
hierarchy: P = "secondary",
|
|
30
|
+
disabledDates: W,
|
|
31
|
+
selectDateMessage: w = "Select Date",
|
|
32
|
+
selectTimeMessage: F = "Select Time",
|
|
33
|
+
selectMonthMessage: z,
|
|
34
|
+
selectYearMessage: J,
|
|
35
|
+
countryCode: n,
|
|
36
|
+
renderActions: Q,
|
|
37
|
+
onTimeSelected: U,
|
|
38
|
+
...T
|
|
39
|
+
}, o) {
|
|
40
|
+
const [s, S] = N(!1), [f, A] = N(!1), u = m(null), p = m(null), M = m(null), O = m(null), _ = ae(
|
|
41
|
+
(e) => {
|
|
42
|
+
M.current = e, typeof o == "function" ? o(e) : o != null && (o.current = e);
|
|
43
|
+
},
|
|
44
|
+
[o]
|
|
45
|
+
), X = g(() => new Intl.DateTimeFormat(n, {
|
|
46
|
+
year: "numeric",
|
|
47
|
+
month: "short",
|
|
48
|
+
day: "numeric"
|
|
49
|
+
}), [n]), Y = g(() => new Intl.DateTimeFormat(n, {
|
|
50
|
+
hour: "numeric",
|
|
51
|
+
minute: "2-digit",
|
|
52
|
+
hour12: !0
|
|
53
|
+
}), [n]), B = i != null ? X.format(i) : w, Z = i != null ? Y.format(i) : F;
|
|
54
|
+
function E() {
|
|
55
|
+
S(!0);
|
|
56
|
+
}
|
|
57
|
+
function d() {
|
|
58
|
+
S(!1), requestAnimationFrame(() => M.current?.focus());
|
|
59
|
+
}
|
|
60
|
+
function $() {
|
|
61
|
+
A(!0);
|
|
62
|
+
}
|
|
63
|
+
function k() {
|
|
64
|
+
A(!1), requestAnimationFrame(() => O.current?.focus());
|
|
65
|
+
}
|
|
66
|
+
q(() => {
|
|
67
|
+
s && requestAnimationFrame(() => u.current?.focus());
|
|
68
|
+
}, [s]), q(() => {
|
|
69
|
+
f && requestAnimationFrame(() => p.current?.focus());
|
|
70
|
+
}, [f]);
|
|
71
|
+
function ee(e) {
|
|
72
|
+
e.key === "Escape" && d();
|
|
73
|
+
}
|
|
74
|
+
function te(e) {
|
|
75
|
+
e.key === "Escape" && k();
|
|
76
|
+
}
|
|
77
|
+
function ie() {
|
|
78
|
+
u.current?.focus();
|
|
79
|
+
}
|
|
80
|
+
function re() {
|
|
81
|
+
p.current?.focus();
|
|
82
|
+
}
|
|
83
|
+
function ne(e) {
|
|
84
|
+
D?.(e), d();
|
|
85
|
+
}
|
|
86
|
+
function oe(e, c, l) {
|
|
87
|
+
if (i != null) {
|
|
88
|
+
const I = new Date(i);
|
|
89
|
+
I.setHours(e, c, l), D?.(I);
|
|
90
|
+
}
|
|
91
|
+
U?.(e, c, l), k();
|
|
92
|
+
}
|
|
93
|
+
return /* @__PURE__ */ a(ce, { children: [
|
|
94
|
+
L ? /* @__PURE__ */ a(me, { hierarchy: P, width: R, children: [
|
|
95
|
+
/* @__PURE__ */ t(
|
|
96
|
+
h,
|
|
97
|
+
{
|
|
98
|
+
ref: _,
|
|
99
|
+
hAlign: "start",
|
|
100
|
+
disabled: r,
|
|
101
|
+
onClick: E,
|
|
102
|
+
width: "flex",
|
|
103
|
+
...T,
|
|
104
|
+
children: /* @__PURE__ */ t("span", { className: "ellipsis", children: B })
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ t(
|
|
108
|
+
h,
|
|
109
|
+
{
|
|
110
|
+
ref: O,
|
|
111
|
+
hAlign: "start",
|
|
112
|
+
disabled: r || i == null,
|
|
113
|
+
onClick: $,
|
|
114
|
+
width: "auto",
|
|
115
|
+
children: /* @__PURE__ */ t("span", { className: "ellipsis", children: Z })
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
] }) : /* @__PURE__ */ t(
|
|
119
|
+
h,
|
|
120
|
+
{
|
|
121
|
+
ref: _,
|
|
122
|
+
hAlign: "start",
|
|
123
|
+
disabled: r,
|
|
124
|
+
hierarchy: P,
|
|
125
|
+
onClick: E,
|
|
126
|
+
width: R,
|
|
127
|
+
maxWidth: G,
|
|
128
|
+
...T,
|
|
129
|
+
children: /* @__PURE__ */ t("span", { className: "ellipsis", children: B })
|
|
130
|
+
}
|
|
131
|
+
),
|
|
132
|
+
s && /* @__PURE__ */ t(x, { children: /* @__PURE__ */ a(
|
|
133
|
+
C,
|
|
134
|
+
{
|
|
135
|
+
className: H["mobile-date-picker-overlay"],
|
|
136
|
+
onKeyDown: ee,
|
|
137
|
+
children: [
|
|
138
|
+
/* @__PURE__ */ t(j, { title: w, onClose: d }),
|
|
139
|
+
/* @__PURE__ */ t(
|
|
140
|
+
se,
|
|
141
|
+
{
|
|
142
|
+
ref: u,
|
|
143
|
+
value: i,
|
|
144
|
+
onChange: ne,
|
|
145
|
+
min: y,
|
|
146
|
+
max: b,
|
|
147
|
+
onError: K,
|
|
148
|
+
disabled: r,
|
|
149
|
+
disabledDates: W,
|
|
150
|
+
countryCode: n,
|
|
151
|
+
renderActions: Q,
|
|
152
|
+
selectMonthMessage: z,
|
|
153
|
+
selectYearMessage: J
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ t(v, { onRedirect: ie })
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
) }),
|
|
160
|
+
f && /* @__PURE__ */ t(x, { children: /* @__PURE__ */ a(
|
|
161
|
+
C,
|
|
162
|
+
{
|
|
163
|
+
className: H["mobile-time-picker-overlay"],
|
|
164
|
+
onKeyDown: te,
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ t(j, { title: F, onClose: k }),
|
|
167
|
+
/* @__PURE__ */ t(
|
|
168
|
+
fe,
|
|
169
|
+
{
|
|
170
|
+
ref: p,
|
|
171
|
+
origin: i,
|
|
172
|
+
min: y,
|
|
173
|
+
max: b,
|
|
174
|
+
intervalInMinutes: V,
|
|
175
|
+
disabled: r,
|
|
176
|
+
onSelect: (e, c, l) => {
|
|
177
|
+
oe(e, c, l);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
),
|
|
181
|
+
/* @__PURE__ */ t(v, { onRedirect: re })
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
) })
|
|
185
|
+
] });
|
|
186
|
+
});
|
|
187
|
+
export {
|
|
188
|
+
Ie as MobileDatePickerInput
|
|
189
|
+
};
|
|
190
|
+
//# sourceMappingURL=mobile_date_picker_input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_input.js","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_input.tsx"],"sourcesContent":["import React, { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { MobileButton } from '../../actions/button/mobile_button.js';\nimport { ButtonGroup } from '../../../actions/button/button_group/button_group.js';\nimport { MobilePortal } from '../../portal/mobile_portal.js';\nimport { MobileDatePicker } from './mobile_date_picker.js';\nimport { MobileDatePickerTimeSelector } from './mobile_date_picker_time_selector.js';\nimport { MobileOverlayHeader } from './mobile_overlay_header.js';\nimport { FocusRedirect } from '../../../utils/index.js';\nimport { VStack } from '../../../stacks/v_stack.js';\nimport type { DatePickerInputProps } from '../../../inputs/date_picker/date_picker_input.js';\nimport styles from './mobile_date_picker_input.module.css';\n\nexport interface MobileDatePickerInputProps extends DatePickerInputProps {\n selectTimeMessage?: string;\n selectMonthMessage?: string;\n selectYearMessage?: string;\n}\n\nexport const MobileDatePickerInput = React.forwardRef<\n HTMLButtonElement,\n MobileDatePickerInputProps\n>(function MobileDatePickerInput(\n {\n value = new Date(),\n onChange,\n onError,\n min = new Date('01/01/1924'),\n max = new Date('01/01/2124'),\n disabled,\n width = '100%',\n maxWidth,\n minWidth,\n showTime = false,\n timeIntervalInMinutes = 15,\n hierarchy = 'secondary',\n disabledDates,\n selectDateMessage = 'Select Date',\n selectTimeMessage = 'Select Time',\n selectMonthMessage,\n selectYearMessage,\n countryCode,\n renderActions,\n onTimeSelected,\n ...props\n },\n ref\n) {\n const [dateOpen, setDateOpen] = useState(false);\n const [timeOpen, setTimeOpen] = useState(false);\n const pickerRef = useRef<HTMLDivElement | null>(null);\n const timeRef = useRef<HTMLDivElement | null>(null);\n const dateButtonRef = useRef<HTMLButtonElement | null>(null);\n const timeButtonRef = useRef<HTMLButtonElement | null>(null);\n\n const setDateButtonRef = useCallback(\n (node: HTMLButtonElement | null) => {\n dateButtonRef.current = node;\n if (typeof ref === 'function') {\n ref(node);\n } else if (ref != null) {\n (ref as React.MutableRefObject<HTMLButtonElement | null>).current = node;\n }\n },\n [ref]\n );\n\n const dateFormatter = useMemo(() => {\n return new Intl.DateTimeFormat(countryCode, {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n });\n }, [countryCode]);\n\n const timeFormatter = useMemo(() => {\n return new Intl.DateTimeFormat(countryCode, {\n hour: 'numeric',\n minute: '2-digit',\n hour12: true,\n });\n }, [countryCode]);\n\n const formattedDate = value != null ? dateFormatter.format(value) : selectDateMessage;\n const formattedTime = value != null ? timeFormatter.format(value) : selectTimeMessage;\n\n function openDatePicker() {\n setDateOpen(true);\n }\n\n function closeDatePicker() {\n setDateOpen(false);\n requestAnimationFrame(() => dateButtonRef.current?.focus());\n }\n\n function openTimePicker() {\n setTimeOpen(true);\n }\n\n function closeTimePicker() {\n setTimeOpen(false);\n requestAnimationFrame(() => timeButtonRef.current?.focus());\n }\n\n useLayoutEffect(() => {\n if (dateOpen) {\n requestAnimationFrame(() => pickerRef.current?.focus());\n }\n }, [dateOpen]);\n\n useLayoutEffect(() => {\n if (timeOpen) {\n requestAnimationFrame(() => timeRef.current?.focus());\n }\n }, [timeOpen]);\n\n function handleDateEscape(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeDatePicker();\n }\n }\n\n function handleTimeEscape(event: React.KeyboardEvent) {\n if (event.key === 'Escape') {\n closeTimePicker();\n }\n }\n\n function handleDateRedirect() {\n pickerRef.current?.focus();\n }\n\n function handleTimeRedirect() {\n timeRef.current?.focus();\n }\n\n function dateSelected(date: Date | null) {\n onChange?.(date);\n closeDatePicker();\n }\n\n function timeSelected(hour: number, minutes: number, seconds: number) {\n if (value != null) {\n const updated = new Date(value);\n updated.setHours(hour, minutes, seconds);\n onChange?.(updated);\n }\n onTimeSelected?.(hour, minutes, seconds);\n closeTimePicker();\n }\n\n return (\n <>\n {showTime ? (\n <ButtonGroup hierarchy={hierarchy} width={width}>\n <MobileButton\n ref={setDateButtonRef}\n hAlign=\"start\"\n disabled={disabled}\n onClick={openDatePicker}\n width=\"flex\"\n {...props}\n >\n <span className=\"ellipsis\">{formattedDate}</span>\n </MobileButton>\n <MobileButton\n ref={timeButtonRef}\n hAlign=\"start\"\n disabled={disabled || value == null}\n onClick={openTimePicker}\n width=\"auto\"\n >\n <span className=\"ellipsis\">{formattedTime}</span>\n </MobileButton>\n </ButtonGroup>\n ) : (\n <MobileButton\n ref={setDateButtonRef}\n hAlign=\"start\"\n disabled={disabled}\n hierarchy={hierarchy}\n onClick={openDatePicker}\n width={width}\n maxWidth={maxWidth}\n {...props}\n >\n <span className=\"ellipsis\">{formattedDate}</span>\n </MobileButton>\n )}\n\n {dateOpen && (\n <MobilePortal>\n <VStack\n className={styles['mobile-date-picker-overlay']}\n onKeyDown={handleDateEscape}\n >\n <MobileOverlayHeader title={selectDateMessage} onClose={closeDatePicker} />\n <MobileDatePicker\n ref={pickerRef}\n value={value}\n onChange={dateSelected}\n min={min}\n max={max}\n onError={onError}\n disabled={disabled}\n disabledDates={disabledDates}\n countryCode={countryCode}\n renderActions={renderActions}\n selectMonthMessage={selectMonthMessage}\n selectYearMessage={selectYearMessage}\n />\n <FocusRedirect onRedirect={handleDateRedirect} />\n </VStack>\n </MobilePortal>\n )}\n\n {timeOpen && (\n <MobilePortal>\n <VStack\n className={styles['mobile-time-picker-overlay']}\n onKeyDown={handleTimeEscape}\n >\n <MobileOverlayHeader title={selectTimeMessage} onClose={closeTimePicker} />\n <MobileDatePickerTimeSelector\n ref={timeRef}\n origin={value}\n min={min}\n max={max}\n intervalInMinutes={timeIntervalInMinutes}\n disabled={disabled}\n onSelect={(hour, minutes, seconds) => {\n timeSelected(hour, minutes, seconds);\n }}\n />\n <FocusRedirect onRedirect={handleTimeRedirect} />\n </VStack>\n </MobilePortal>\n )}\n </>\n );\n});\n"],"names":["MobileDatePickerInput","React","value","onChange","onError","min","max","disabled","width","maxWidth","minWidth","showTime","timeIntervalInMinutes","hierarchy","disabledDates","selectDateMessage","selectTimeMessage","selectMonthMessage","selectYearMessage","countryCode","renderActions","onTimeSelected","props","ref","dateOpen","setDateOpen","useState","timeOpen","setTimeOpen","pickerRef","useRef","timeRef","dateButtonRef","timeButtonRef","setDateButtonRef","useCallback","node","dateFormatter","useMemo","timeFormatter","formattedDate","formattedTime","openDatePicker","closeDatePicker","openTimePicker","closeTimePicker","useLayoutEffect","handleDateEscape","event","handleTimeEscape","handleDateRedirect","handleTimeRedirect","dateSelected","date","timeSelected","hour","minutes","seconds","updated","jsxs","Fragment","ButtonGroup","jsx","MobileButton","MobilePortal","VStack","styles","MobileOverlayHeader","MobileDatePicker","FocusRedirect","MobileDatePickerTimeSelector"],"mappings":";;;;;;;;;;;;;;;;0KAkBaA,KAAwBC,GAAM,WAGzC,SACA;AAAA,EACE,OAAAC,wBAAY,KAAA;AAAA,EACZ,UAAAC;AAAA,EACA,SAAAC;AAAA,EACA,KAAAC,IAAM,oBAAI,KAAK,YAAY;AAAA,EAC3B,KAAAC,IAAM,oBAAI,KAAK,YAAY;AAAA,EAC3B,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,uBAAAC,IAAwB;AAAA,EACxB,WAAAC,IAAY;AAAA,EACZ,eAAAC;AAAA,EACA,mBAAAC,IAAoB;AAAA,EACpB,mBAAAC,IAAoB;AAAA,EACpB,oBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,gBAAAC;AAAA,EACA,GAAGC;AACL,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4BAA4B;AAAA,QAC9C,WAAWjB;AAAA,QAEX,UAAA;AAAA,UAAA,gBAAAa,EAACK,GAAA,EAAoB,OAAOnD,GAAmB,SAAS6B,GAAiB;AAAA,UACzE,gBAAAiB;AAAA,YAACQ;AAAA,YAAA;AAAA,cACC,KAAKvC;AAAA,cACL,QAAQ7B;AAAA,cACR,KAAAG;AAAA,cACA,KAAAC;AAAA,cACA,mBAAmBM;AAAA,cACnB,UAAAL;AAAA,cACA,UAAU,CAACgD,GAAMC,GAASC,MAAY;AACpC,gBAAAH,GAAaC,GAAMC,GAASC,CAAO;AAAA,cACrC;AAAA,YAAA;AAAA,UAAA;AAAA,UAEF,gBAAAK,EAACO,GAAA,EAAc,YAAYlB,GAAA,CAAoB;AAAA,QAAA;AAAA,MAAA;AAAA,IAAA,EACjD,CACF;AAAA,EAAA,GAEJ;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface MobileDatePickerTimeSelectorProps {
|
|
3
|
+
origin: Date | null;
|
|
4
|
+
intervalInMinutes: number;
|
|
5
|
+
max: Date | null;
|
|
6
|
+
min: Date | null;
|
|
7
|
+
onSelect: (hours: number, minutes: number, seconds: number) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const MobileDatePickerTimeSelector: React.ForwardRefExoticComponent<MobileDatePickerTimeSelectorProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
//# sourceMappingURL=mobile_date_picker_time_selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_time_selector.d.ts","sourceRoot":"","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_time_selector.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,MAAM,WAAW,iCAAiC;IAChD,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IACjB,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,4BAA4B,0GAiEvC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { VStack as y } from "../../../stacks/v_stack.js";
|
|
3
|
+
import { clsx as D } from "clsx";
|
|
4
|
+
import H from "react";
|
|
5
|
+
import { MobileButton as k } from "../../actions/button/mobile_button.js";
|
|
6
|
+
import '../../../mobile_date_picker_time_selector.css';const I = "_mobile-time-selector_bf904b8", _ = { "mobile-time-selector": I }, z = H.forwardRef(function({ origin: t, intervalInMinutes: a, max: u, min: d, onSelect: f, disabled: g }, p) {
|
|
7
|
+
const s = a * 1e3 * 60, S = 24 * 1e3 * 60 * 60 / s, n = new Date(t || /* @__PURE__ */ new Date()), r = [], b = d?.getTime() ?? -1 / 0, h = u?.getTime() ?? 1 / 0;
|
|
8
|
+
n.setHours(0, 0, 0, 0);
|
|
9
|
+
let c = n.getTime();
|
|
10
|
+
for (let i = 0; i < S; i++) {
|
|
11
|
+
const e = new Date(c);
|
|
12
|
+
let o = e.getHours() % 12;
|
|
13
|
+
const M = e.getMinutes(), x = e.getHours() >= 12 ? "PM" : "AM";
|
|
14
|
+
o = o === 0 ? 12 : o;
|
|
15
|
+
const T = t != null && e.getHours() === t.getHours() && e.getMinutes() === t.getMinutes() && e.getSeconds() === t.getSeconds(), m = e.getTime(), w = m < b || m > h;
|
|
16
|
+
r.push(
|
|
17
|
+
/* @__PURE__ */ l(
|
|
18
|
+
k,
|
|
19
|
+
{
|
|
20
|
+
width: "100%",
|
|
21
|
+
hierarchy: T ? "primary" : "tertiary",
|
|
22
|
+
disabled: t == null || g || w,
|
|
23
|
+
onClick: () => {
|
|
24
|
+
f(e.getHours(), e.getMinutes(), e.getSeconds());
|
|
25
|
+
},
|
|
26
|
+
children: `${o.toString().padStart(2, "0")}:${M.toString().padStart(2, "0")} ${x}`
|
|
27
|
+
},
|
|
28
|
+
i
|
|
29
|
+
)
|
|
30
|
+
), c += s;
|
|
31
|
+
}
|
|
32
|
+
return /* @__PURE__ */ l(
|
|
33
|
+
y,
|
|
34
|
+
{
|
|
35
|
+
ref: p,
|
|
36
|
+
tabIndex: 0,
|
|
37
|
+
width: "100%",
|
|
38
|
+
height: "flex",
|
|
39
|
+
overflowY: "auto",
|
|
40
|
+
padding: "8px",
|
|
41
|
+
gap: "4px",
|
|
42
|
+
className: D(_["mobile-time-selector"], "tcn-mobile-time-selector"),
|
|
43
|
+
children: r
|
|
44
|
+
}
|
|
45
|
+
);
|
|
46
|
+
});
|
|
47
|
+
export {
|
|
48
|
+
z as MobileDatePickerTimeSelector
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=mobile_date_picker_time_selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_time_selector.js","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_time_selector.tsx"],"sourcesContent":["import { VStack } from '../../../stacks/v_stack.js';\nimport { clsx } from 'clsx';\nimport React from 'react';\nimport { MobileButton } from '../../actions/button/mobile_button.js';\nimport styles from './mobile_date_picker_time_selector.module.css';\n\nexport interface MobileDatePickerTimeSelectorProps {\n origin: Date | null;\n intervalInMinutes: number;\n max: Date | null;\n min: Date | null;\n onSelect: (hours: number, minutes: number, seconds: number) => void;\n disabled?: boolean;\n}\n\nexport const MobileDatePickerTimeSelector = React.forwardRef<\n HTMLDivElement,\n MobileDatePickerTimeSelectorProps\n>(function MobileDatePickerTimeSelector(\n { origin, intervalInMinutes, max, min, onSelect, disabled },\n ref\n) {\n const stepInMilliseconds = intervalInMinutes * 1000 * 60;\n const amountOfSteps = (24 * 1000 * 60 * 60) / stepInMilliseconds;\n const normalizedDate = new Date(origin || new Date());\n const options: React.ReactElement[] = [];\n const minTime = min?.getTime() ?? -Infinity;\n const maxTime = max?.getTime() ?? Infinity;\n\n normalizedDate.setHours(0, 0, 0, 0);\n let offset = normalizedDate.getTime();\n\n for (let x = 0; x < amountOfSteps; x++) {\n const date = new Date(offset);\n\n let hour = date.getHours() % 12;\n const minute = date.getMinutes();\n const meridiem = date.getHours() >= 12 ? 'PM' : 'AM';\n hour = hour === 0 ? 12 : hour;\n\n const isSelected =\n origin != null &&\n date.getHours() === origin.getHours() &&\n date.getMinutes() === origin.getMinutes() &&\n date.getSeconds() === origin.getSeconds();\n\n const time = date.getTime();\n const isOutOfRange = time < minTime || time > maxTime;\n\n options.push(\n <MobileButton\n key={x}\n width=\"100%\"\n hierarchy={isSelected ? 'primary' : 'tertiary'}\n disabled={origin == null || disabled || isOutOfRange}\n onClick={() => {\n onSelect(date.getHours(), date.getMinutes(), date.getSeconds());\n }}\n >\n {`${hour.toString().padStart(2, '0')}:${minute.toString().padStart(2, '0')} ${meridiem}`}\n </MobileButton>\n );\n\n offset += stepInMilliseconds;\n }\n\n return (\n <VStack\n ref={ref}\n tabIndex={0}\n width=\"100%\"\n height=\"flex\"\n overflowY=\"auto\"\n padding=\"8px\"\n gap=\"4px\"\n className={clsx(styles['mobile-time-selector'], 'tcn-mobile-time-selector')}\n >\n {options}\n </VStack>\n );\n});\n"],"names":["MobileDatePickerTimeSelector","React","origin","intervalInMinutes","max","min","onSelect","disabled","ref","stepInMilliseconds","amountOfSteps","normalizedDate","options","minTime","maxTime","offset","x","date","hour","minute","meridiem","isSelected","time","isOutOfRange","jsx","MobileButton","VStack","clsx","styles"],"mappings":";;;;;8EAeaA,IAA+BC,EAAM,WAGhD,SACA,EAAE,QAAAC,GAAQ,mBAAAC,GAAmB,KAAAC,GAAK,KAAAC,GAAK,UAAAC,GAAU,U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IAACE;AAAA,IAAA;AAAA,MACC,KAAAlB;AAAA,MACA,UAAU;AAAA,MACV,OAAM;AAAA,MACN,QAAO;AAAA,MACP,WAAU;AAAA,MACV,SAAQ;AAAA,MACR,KAAI;AAAA,MACJ,WAAWmB,EAAKC,EAAO,sBAAsB,GAAG,0BAA0B;AAAA,MAEzE,UAAAhB;AAAA,IAAA;AAAA,EAAA;AAGP,CAAC;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DatePickerPresenter } from '../../../inputs/date_picker/date_picker_presenter.js';
|
|
2
|
+
export interface MobileDatePickerYearSelectorProps {
|
|
3
|
+
presenter: DatePickerPresenter;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function MobileDatePickerYearSelector({ presenter, onClose, }: MobileDatePickerYearSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
//# sourceMappingURL=mobile_date_picker_year_selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_year_selector.d.ts","sourceRoot":"","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_year_selector.tsx"],"names":[],"mappings":"AASA,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAK3F,MAAM,WAAW,iCAAiC;IAChD,SAAS,EAAE,mBAAmB,CAAC;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,4BAA4B,CAAC,EAC3C,SAAS,EACT,OAAO,GACR,EAAE,iCAAiC,2CAgGnC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
2
|
+
import { useState as B, useRef as _, useEffect as M } from "react";
|
|
3
|
+
import { ChevronLeftIcon as V } from "@tcn/icons/chevron_left_icon.js";
|
|
4
|
+
import { ChevronRightIcon as j } from "@tcn/icons/chevron_right_icon.js";
|
|
5
|
+
import { useSignalValue as z } from "@tcn/state";
|
|
6
|
+
import { MobileButton as h } from "../../actions/button/mobile_button.js";
|
|
7
|
+
import { HStack as b } from "../../../stacks/h_stack.js";
|
|
8
|
+
import { Spacer as y } from "../../../stacks/spacer.js";
|
|
9
|
+
import { VStack as D } from "../../../stacks/v_stack.js";
|
|
10
|
+
import { BodyText as H } from "../../../typography/body_text/body_text.js";
|
|
11
|
+
import "../../../typography/callout/callout.js";
|
|
12
|
+
import "../../../typography/caption/caption.js";
|
|
13
|
+
import "../../../typography/footnote/footnote.js";
|
|
14
|
+
import { Headline as N } from "../../../typography/headline/headline.js";
|
|
15
|
+
import "../../../typography/subheadline/subheadline.js";
|
|
16
|
+
import "../../../typography/title/title.js";
|
|
17
|
+
import "../../../utils/click_away_listener.js";
|
|
18
|
+
import { FocusRedirect as O } from "../../../utils/focus_redirect.js";
|
|
19
|
+
import "../../../utils/scroll_away_listener.js";
|
|
20
|
+
import "../../../utils/hooks/use_resize_observer.js";
|
|
21
|
+
import "../../../utils/dnd/context.js";
|
|
22
|
+
import { clsx as Y } from "clsx";
|
|
23
|
+
import "../../../draggable.module-BgelQsuJ.js";
|
|
24
|
+
import '../../../mobile_date_picker_year_selector.css';const $ = "_mobile-year-selector_31f3a58", E = "_mobile-year-button_494c1af", g = { "mobile-year-selector": $, "mobile-year-button": E };
|
|
25
|
+
function me({
|
|
26
|
+
presenter: n,
|
|
27
|
+
onClose: x
|
|
28
|
+
}) {
|
|
29
|
+
const { min: c, max: s, visibleYear: i, visibleMonth: F } = z(
|
|
30
|
+
n.stateBroadcast
|
|
31
|
+
), [a, m] = B(0), l = _(null), S = c == null ? -1 / 0 : c.getFullYear(), k = s == null ? 1 / 0 : s.getFullYear(), r = [], f = i % 20, p = i - f + a, w = p + 19;
|
|
32
|
+
for (let o = 0; o < 20; o++) {
|
|
33
|
+
const t = new Date(i, F, 1);
|
|
34
|
+
t.setFullYear(i - f + o + a);
|
|
35
|
+
const u = t.getFullYear() > k || t.getFullYear() < S;
|
|
36
|
+
r.push(
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
"button",
|
|
39
|
+
{
|
|
40
|
+
disabled: u,
|
|
41
|
+
className: Y(g["mobile-year-button"], "tcn-date-picker-year-button"),
|
|
42
|
+
"data-is-disabled": String(u),
|
|
43
|
+
"data-is-selected": String(t.getFullYear() === i),
|
|
44
|
+
onClick: () => {
|
|
45
|
+
n.setVisibleYear(t.getFullYear()), x();
|
|
46
|
+
},
|
|
47
|
+
children: /* @__PURE__ */ e(H, { children: t.getFullYear() })
|
|
48
|
+
},
|
|
49
|
+
o
|
|
50
|
+
)
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
function R() {
|
|
54
|
+
l.current?.focus();
|
|
55
|
+
}
|
|
56
|
+
M(() => {
|
|
57
|
+
l.current?.focus();
|
|
58
|
+
}, []);
|
|
59
|
+
const v = [
|
|
60
|
+
r.slice(0, 4),
|
|
61
|
+
r.slice(4, 8),
|
|
62
|
+
r.slice(8, 12),
|
|
63
|
+
r.slice(12, 16),
|
|
64
|
+
r.slice(16, 20)
|
|
65
|
+
];
|
|
66
|
+
function C() {
|
|
67
|
+
m(a - 20);
|
|
68
|
+
}
|
|
69
|
+
function I() {
|
|
70
|
+
m(a + 20);
|
|
71
|
+
}
|
|
72
|
+
return /* @__PURE__ */ d(
|
|
73
|
+
D,
|
|
74
|
+
{
|
|
75
|
+
ref: l,
|
|
76
|
+
tabIndex: 0,
|
|
77
|
+
padding: "8px",
|
|
78
|
+
width: "100%",
|
|
79
|
+
className: Y(
|
|
80
|
+
g["mobile-year-selector"],
|
|
81
|
+
"tcn-mobile-date-picker-year-selector"
|
|
82
|
+
),
|
|
83
|
+
gap: "4px",
|
|
84
|
+
children: [
|
|
85
|
+
/* @__PURE__ */ d(b, { gap: "4px", children: [
|
|
86
|
+
/* @__PURE__ */ e(h, { onClick: C, hierarchy: "tertiary", width: "auto", children: /* @__PURE__ */ e(V, { flipOnRtl: !0, size: "md" }) }),
|
|
87
|
+
/* @__PURE__ */ e(y, {}),
|
|
88
|
+
/* @__PURE__ */ e(
|
|
89
|
+
N,
|
|
90
|
+
{
|
|
91
|
+
selectable: !1,
|
|
92
|
+
emphasis: "faint",
|
|
93
|
+
hierarchy: "tertiary",
|
|
94
|
+
children: `${p}-${w}`
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ e(y, {}),
|
|
98
|
+
/* @__PURE__ */ e(h, { hierarchy: "tertiary", width: "auto", onClick: I, children: /* @__PURE__ */ e(j, { size: "md" }) })
|
|
99
|
+
] }),
|
|
100
|
+
v.map((o, t) => /* @__PURE__ */ e(b, { gap: "4px", width: "100%", children: o }, t)),
|
|
101
|
+
/* @__PURE__ */ e(O, { onRedirect: R })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
export {
|
|
107
|
+
me as MobileDatePickerYearSelector
|
|
108
|
+
};
|
|
109
|
+
//# sourceMappingURL=mobile_date_picker_year_selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_date_picker_year_selector.js","sources":["../../../../src/mobile/inputs/date_picker/mobile_date_picker_year_selector.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { ChevronLeftIcon } from '@tcn/icons/chevron_left_icon.js';\nimport { ChevronRightIcon } from '@tcn/icons/chevron_right_icon.js';\nimport { useSignalValue } from '@tcn/state';\nimport { MobileButton } from '../../actions/button/mobile_button.js';\nimport { HStack } from '../../../stacks/h_stack.js';\nimport { Spacer } from '../../../stacks/spacer.js';\nimport { VStack } from '../../../stacks/v_stack.js';\nimport { BodyText, Headline } from '../../../typography/index.js';\nimport { DatePickerPresenter } from '../../../inputs/date_picker/date_picker_presenter.js';\nimport { FocusRedirect } from '../../../utils/index.js';\nimport { clsx } from 'clsx';\nimport styles from './mobile_date_picker_year_selector.module.css';\n\nexport interface MobileDatePickerYearSelectorProps {\n presenter: DatePickerPresenter;\n onClose: () => void;\n}\n\nexport function MobileDatePickerYearSelector({\n presenter,\n onClose,\n}: MobileDatePickerYearSelectorProps) {\n const { min, max, visibleYear, visibleMonth } = useSignalValue(\n presenter.stateBroadcast\n );\n\n const [offset, setOffset] = useState(0);\n const containerRef = useRef<HTMLDivElement | null>(null);\n const minYear = min == null ? -Infinity : min.getFullYear();\n const maxYear = max == null ? Infinity : max.getFullYear();\n const years: React.ReactNode[] = [];\n const remainder = visibleYear % 20;\n const firstYear = visibleYear - remainder + offset;\n const lastYear = firstYear + 19;\n\n for (let x = 0; x < 20; x++) {\n const date = new Date(visibleYear, visibleMonth, 1);\n date.setFullYear(visibleYear - remainder + x + offset);\n\n const disabled = date.getFullYear() > maxYear || date.getFullYear() < minYear;\n\n years.push(\n <button\n key={x}\n disabled={disabled}\n className={clsx(styles['mobile-year-button'], 'tcn-date-picker-year-button')}\n data-is-disabled={String(disabled)}\n data-is-selected={String(date.getFullYear() === visibleYear)}\n onClick={() => {\n presenter.setVisibleYear(date.getFullYear());\n onClose();\n }}\n >\n <BodyText>{date.getFullYear()}</BodyText>\n </button>\n );\n }\n\n function focus() {\n containerRef.current?.focus();\n }\n\n useEffect(() => {\n containerRef.current?.focus();\n }, []);\n\n const rows = [\n years.slice(0, 4),\n years.slice(4, 8),\n years.slice(8, 12),\n years.slice(12, 16),\n years.slice(16, 20),\n ];\n\n function prev() {\n setOffset(offset - 20);\n }\n\n function next() {\n setOffset(offset + 20);\n }\n\n return (\n <VStack\n ref={containerRef}\n tabIndex={0}\n padding=\"8px\"\n width=\"100%\"\n className={clsx(\n styles['mobile-year-selector'],\n 'tcn-mobile-date-picker-year-selector'\n )}\n gap=\"4px\"\n >\n <HStack gap=\"4px\">\n <MobileButton onClick={prev} hierarchy=\"tertiary\" width=\"auto\">\n <ChevronLeftIcon flipOnRtl size=\"md\" />\n </MobileButton>\n <Spacer />\n <Headline\n selectable={false}\n emphasis=\"faint\"\n hierarchy=\"tertiary\"\n >{`${firstYear}-${lastYear}`}</Headline>\n <Spacer />\n <MobileButton hierarchy=\"tertiary\" width=\"auto\" onClick={next}>\n <ChevronRightIcon size=\"md\" />\n </MobileButton>\n </HStack>\n {rows.map((row, index) => (\n <HStack key={index} gap=\"4px\" width=\"100%\">\n {row}\n </HStack>\n ))}\n <FocusRedirect onRedirect={focus} />\n </VStack>\n );\n}\n"],"names":["MobileDatePickerYearSelector","presenter","onClose","min","max","visibleYear","visibleMonth","useSignalValue","offset","setOffset","useState","containerRef","useRef","minYear","maxYear","years","remainder","firstYear","lastYear","x","date","disabled","jsx","clsx","styles","BodyText","focus","useEffect","rows","prev","next","jsxs","VStack","HStack","MobileButton","ChevronLeftIcon","Spacer","Headline","ChevronRightIcon","row","index","FocusRedirect"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAmBO,SAASA,GAA6B;AAAA,EAC3C,WAAAC;AAAA,EACA,SAAAC;AACF,GAAsC;AACpC,QAAM,EAAE,KAAAC,GAAK,KAAAC,GAAK,aAAAC,GAAa,cAAAC,MAAiBC;AAAA,IAC9CN,EAAU;AAAA,EAAA,GAGN,CAACO,GAAQC,CAAS,IAAIC,EAAS,CAAC,GAChCC,IAAeC,EAA8B,IAAI,GACjDC,IAAUV,KAAO,OAAO,SAAYA,EAAI,YAAA,GACxCW,IAAUV,KAAO,OAAO,QAAWA,EAAI,YAAA,GACvCW,IAA2B,CAAA,GAC3BC,IAAYX,IAAc,IAC1BY,IAAYZ,IAAcW,IAAYR,GACtCU,IAAWD,IAAY;AAE7B,WAASE,IAAI,GAAGA,IAAI,IAAIA,KAAK;AAC3B,UAAMC,IAAO,IAAI,KAAKf,GAAaC,GAAc,CAAC;AAClD,IAAAc,EAAK,YAAYf,IAAcW,IAAYG,IAAIX,CAAM;AAErD,UAAMa,IAAWD,EAAK,YAAA,IAAgBN,KAAWM,EAAK,gBAAgBP;AAEtE,IAAAE,EAAM;AAAA,MACJ,gBAAAO;AAAA,QAAC;AAAA,QAAA;AAAA,UAEC,UAAAD;AAAA,UACA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AAgB,WAAS,IAAC,MAAK,MAAK,GACvC;AAAA,4BACCC,GAAA,EAAO;AAAA,UACR,gBAAAd;AAAA,YAACe;AAAA,YAAA;AAAA,cACC,YAAY;AAAA,cACZ,UAAS;AAAA,cACT,WAAU;AAAA,cACV,UAAA,GAAGpB,CAAS,IAAIC,CAAQ;AAAA,YAAA;AAAA,UAAA;AAAA,4BACzBkB,GAAA,EAAO;AAAA,UACR,gBAAAd,EAACY,GAAA,EAAa,WAAU,YAAW,OAAM,QAAO,SAASJ,GACvD,UAAA,gBAAAR,EAACgB,GAAA,EAAiB,MAAK,KAAA,CAAK,EAAA,CAC9B;AAAA,QAAA,GACF;AAAA,QACCV,EAAK,IAAI,CAACW,GAAKC,MACd,gBAAAlB,EAACW,GAAA,EAAmB,KAAI,OAAM,OAAM,QACjC,UAAAM,EAAA,GADUC,CAEb,CACD;AAAA,QACD,gBAAAlB,EAACmB,GAAA,EAAc,YAAYf,EAAA,CAAO;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGxC;"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface MobileOverlayHeaderProps {
|
|
2
|
+
title: string;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function MobileOverlayHeader({ title, onClose }: MobileOverlayHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
//# sourceMappingURL=mobile_overlay_header.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_overlay_header.d.ts","sourceRoot":"","sources":["../../../../src/mobile/inputs/date_picker/mobile_overlay_header.tsx"],"names":[],"mappings":"AAQA,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,wBAAwB,2CAe/E"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { HStack as t } from "../../../stacks/h_stack.js";
|
|
3
|
+
import { Spacer as m } from "../../../stacks/spacer.js";
|
|
4
|
+
import "../../../typography/body_text/body_text.js";
|
|
5
|
+
import "../../../typography/callout/callout.js";
|
|
6
|
+
import "../../../typography/caption/caption.js";
|
|
7
|
+
import "../../../typography/footnote/footnote.js";
|
|
8
|
+
import { Headline as a } from "../../../typography/headline/headline.js";
|
|
9
|
+
import "../../../typography/subheadline/subheadline.js";
|
|
10
|
+
import "../../../typography/title/title.js";
|
|
11
|
+
import { MobileButton as l } from "../../actions/button/mobile_button.js";
|
|
12
|
+
import { CrossIcon as p } from "@tcn/icons/cross_icon.js";
|
|
13
|
+
import { clsx as c } from "clsx";
|
|
14
|
+
import '../../../mobile_overlay_header.css';const d = "_mobile-overlay-header_c6e5f58", s = { "mobile-overlay-header": d };
|
|
15
|
+
function z({ title: e, onClose: o }) {
|
|
16
|
+
return /* @__PURE__ */ i(
|
|
17
|
+
t,
|
|
18
|
+
{
|
|
19
|
+
width: "100%",
|
|
20
|
+
height: "auto",
|
|
21
|
+
className: c(s["mobile-overlay-header"], "tcn-mobile-overlay-header"),
|
|
22
|
+
padding: "8px",
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ r(a, { size: "sm", children: e }),
|
|
25
|
+
/* @__PURE__ */ r(m, {}),
|
|
26
|
+
/* @__PURE__ */ r(l, { hierarchy: "tertiary", width: "auto", onClick: o, children: /* @__PURE__ */ r(p, { size: "md" }) })
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
z as MobileOverlayHeader
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=mobile_overlay_header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_overlay_header.js","sources":["../../../../src/mobile/inputs/date_picker/mobile_overlay_header.tsx"],"sourcesContent":["import { HStack } from '../../../stacks/h_stack.js';\nimport { Spacer } from '../../../stacks/spacer.js';\nimport { Headline } from '../../../typography/index.js';\nimport { MobileButton } from '../../actions/button/mobile_button.js';\nimport { CrossIcon } from '@tcn/icons/cross_icon.js';\nimport { clsx } from 'clsx';\nimport styles from './mobile_overlay_header.module.css';\n\nexport interface MobileOverlayHeaderProps {\n title: string;\n onClose: () => void;\n}\n\nexport function MobileOverlayHeader({ title, onClose }: MobileOverlayHeaderProps) {\n return (\n <HStack\n width=\"100%\"\n height=\"auto\"\n className={clsx(styles['mobile-overlay-header'], 'tcn-mobile-overlay-header')}\n padding=\"8px\"\n >\n <Headline size=\"sm\">{title}</Headline>\n <Spacer />\n <MobileButton hierarchy=\"tertiary\" width=\"auto\" onClick={onClose}>\n <CrossIcon size=\"md\" />\n </MobileButton>\n </HStack>\n );\n}\n"],"names":["MobileOverlayHeader","title","onClose","jsxs","HStack","clsx","styles","jsx","Headline","Spacer","MobileButton","CrossIcon"],"mappings":";;;;;;;;;;;;;;AAaO,SAASA,EAAoB,EAAE,OAAAC,GAAO,SAAAC,KAAqC;AAChF,SACE,gBAAAC;AAAA,IAACC;AAAA,IAAA;AAAA,MACC,OAAM;AAAA,MACN,QAAO;AAAA,MACP,WAAWC,EAAKC,EAAO,uBAAuB,GAAG,2BAA2B;AAAA,MAC5E,SAAQ;AAAA,MAER,UAAA;AAAA,QAAA,gBAAAC,EAACC,GAAA,EAAS,MAAK,MAAM,UAAAP,GAAM;AAAA,0BAC1BQ,GAAA,EAAO;AAAA,QACR,gBAAAF,EAACG,GAAA,EAAa,WAAU,YAAW,OAAM,QAAO,SAASR,GACvD,UAAA,gBAAAK,EAACI,GAAA,EAAU,MAAK,KAAA,CAAK,EAAA,CACvB;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export * from './date_picker/mobile_date_picker.js';
|
|
2
|
+
export * from './date_picker/mobile_date_picker_input.js';
|
|
3
|
+
export * from './date_picker/mobile_date_picker_header.js';
|
|
4
|
+
export * from './date_picker/mobile_date_picker_time_selector.js';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/mobile/inputs/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,mDAAmD,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MobileDatePicker as o } from "./date_picker/mobile_date_picker.js";
|
|
2
|
+
import { MobileDatePickerInput as i } from "./date_picker/mobile_date_picker_input.js";
|
|
3
|
+
import { MobileDatePickerHeader as c } from "./date_picker/mobile_date_picker_header.js";
|
|
4
|
+
import { MobileDatePickerTimeSelector as m } from "./date_picker/mobile_date_picker_time_selector.js";
|
|
5
|
+
export {
|
|
6
|
+
o as MobileDatePicker,
|
|
7
|
+
c as MobileDatePickerHeader,
|
|
8
|
+
i as MobileDatePickerInput,
|
|
9
|
+
m as MobileDatePickerTimeSelector
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_portal.d.ts","sourceRoot":"","sources":["../../../src/mobile/portal/mobile_portal.tsx"],"names":[],"mappings":"AAGA,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAM3D"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { Portal as t } from "../../overlay/portal/portal.js";
|
|
3
|
+
import { MobileViewport as i } from "../viewport/mobile_viewport.js";
|
|
4
|
+
function p({ children: r }) {
|
|
5
|
+
return /* @__PURE__ */ o(t, { children: /* @__PURE__ */ o(i, { children: r }) });
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
p as MobilePortal
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=mobile_portal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_portal.js","sources":["../../../src/mobile/portal/mobile_portal.tsx"],"sourcesContent":["import { Portal } from '../../overlay/portal/portal.js';\nimport { MobileViewport } from '../viewport/mobile_viewport.js';\n\nexport interface MobilePortalProps {\n children: React.ReactNode;\n}\n\nexport function MobilePortal({ children }: MobilePortalProps) {\n return (\n <Portal>\n <MobileViewport>{children}</MobileViewport>\n </Portal>\n );\n}\n"],"names":["MobilePortal","children","jsx","Portal","MobileViewport"],"mappings":";;;AAOO,SAASA,EAAa,EAAE,UAAAC,KAA+B;AAC5D,SACE,gBAAAC,EAACC,GAAA,EACC,UAAA,gBAAAD,EAACE,GAAA,EAAgB,UAAAH,GAAS,GAC5B;AAEJ;"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface MobileViewportProps {
|
|
3
|
+
children?: React.ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* MobileRoot: an app-like viewport container that tracks the Visual Viewport.
|
|
9
|
+
*
|
|
10
|
+
* Exposes CSS variables on the root element:
|
|
11
|
+
* --vv-width: px (visual viewport width)
|
|
12
|
+
* --vv-height: px (visual viewport height)
|
|
13
|
+
* --vv-offset-top: px
|
|
14
|
+
* --vv-offset-left: px
|
|
15
|
+
* --keyboard-inset: px (how much the keyboard overlaps the bottom of the layout viewport)
|
|
16
|
+
*
|
|
17
|
+
* Also relies on safe-area env vars for padding (iOS notch/home indicator).
|
|
18
|
+
*/
|
|
19
|
+
export declare function MobileViewport({ children, className, style }: MobileViewportProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=mobile_viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mobile_viewport.d.ts","sourceRoot":"","sources":["../../../src/mobile/viewport/mobile_viewport.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkC,MAAM,OAAO,CAAC;AAIvD,UAAU,mBAAmB;IAC3B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC7B;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAyDjF"}
|