@flickfyi/flkr 0.0.182 → 0.0.185
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/dist/{api-client-CAg1b8Bh.js → api-client-nn4U_Vfn.js} +1 -1
- package/dist/{app-DpM5nhb9.js → app-COXGJhrt.js} +3 -3
- package/dist/{bundler-DNrDcqyk.js → bundler-CW4YC73e.js} +4 -2
- package/dist/cli.js +11 -11
- package/dist/{delegate-DcVye0KE.js → delegate-aUVluBjB.js} +2 -2
- package/dist/{generate-B1l1z_FZ.js → generate-BeL1QPDi.js} +1 -1
- package/dist/{preview-Dqn_Tq6K.js → preview-DTVM8Csb.js} +2 -2
- package/dist/{publish-BmDqO1xU.js → publish-BJG-s-w5.js} +4 -4
- package/dist/{pull-CO80DMn8.js → pull-B_Yfjpi2.js} +1 -1
- package/dist/{save-8crfOeo1.js → save-UrfgmK2-.js} +2 -2
- package/dist/{sdk-app-BXWrf_pf.js → sdk-app-BAxznAf9.js} +3 -3
- package/dist/{sdk-deploy-CaEonlvx.js → sdk-deploy-D1wgQxse.js} +3 -3
- package/dist/{sdk-generation-CF8ATbrL.js → sdk-generation-CLQ-QrVM.js} +1 -1
- package/dist/{sdk-project-CKV3U3u9.js → sdk-project-BaO0fqhW.js} +1 -1
- package/dist/{use-auth-B6nwU2rp.js → use-auth-CtM4_BAY.js} +1 -1
- package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +4 -4
- package/node_modules/@flickfyi/core/README.md +19 -9
- package/node_modules/@flickfyi/core/dist/chunks/{default-CuxDsQoM.js → default-BTmKidHV.js} +1 -1
- package/node_modules/@flickfyi/core/dist/chunks/{default-BB6YexEH.cjs → default-JhTq5I_y.cjs} +1 -1
- package/node_modules/@flickfyi/core/dist/chunks/{define-CUJRqVKY.cjs → define-BKCRhpuY.cjs} +1 -1
- package/node_modules/@flickfyi/core/dist/chunks/{define-e_VqSs4M.js → define-DZXgUsy7.js} +5 -5
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +728 -549
- package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +5 -5
- package/node_modules/@flickfyi/core/dist/kowalski/index.js +4297 -3700
- package/node_modules/@flickfyi/core/dist/kowalski/schemas.cjs +1 -0
- package/node_modules/@flickfyi/core/dist/kowalski/schemas.js +637 -0
- package/node_modules/@flickfyi/core/dist/kowalski-catalog.css +516 -0
- package/node_modules/@flickfyi/core/dist/kowalski.css +10 -0
- package/node_modules/@flickfyi/core/dist/themes/athletic/athletic.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/athletic/athletic.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/compact/compact.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/compact/compact.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/default/default.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/default/default.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/editorial/editorial.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/editorial/editorial.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/handwritten/handwritten.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/handwritten/handwritten.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/index.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/kids/kids.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/kids/kids.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/rounded/rounded.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/rounded/rounded.js +1 -1
- package/node_modules/@flickfyi/core/dist/themes/technical/technical.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/themes/technical/technical.js +1 -1
- package/node_modules/@flickfyi/core/dist-types/hooks/use-feature-store/index.d.ts +43 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/calculations.d.ts +57 -3
- package/node_modules/@flickfyi/core/dist-types/kowalski/calculator.d.ts +7 -6
- package/node_modules/@flickfyi/core/dist-types/kowalski/catalog.d.cts +524 -809
- package/node_modules/@flickfyi/core/dist-types/kowalski/catalog.d.ts +524 -809
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/bill-split.d.ts +38 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/bookmark.d.ts +48 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/budget.d.ts +39 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/calculator.d.ts +62 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/checklist.d.ts +35 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/color-palette.d.ts +32 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/contact.d.ts +41 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/countdown.d.ts +34 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/event.d.ts +43 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/expense.d.ts +40 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/goal.d.ts +36 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/habit.d.ts +57 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/ledger.d.ts +43 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/note.d.ts +35 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/poll.d.ts +41 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/random-picker.d.ts +69 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/rating.d.ts +33 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/reminder.d.ts +48 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/rotation.d.ts +39 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/scoreboard.d.ts +37 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/shopping-list.d.ts +41 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/task-board.d.ts +39 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/time-zone.d.ts +34 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/timer.d.ts +43 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/trip.d.ts +61 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/components/unit-converter.d.ts +106 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/create-schemas.d.ts +6 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/date-time.d.ts +1 -1
- package/node_modules/@flickfyi/core/dist-types/kowalski/everyday.d.ts +28 -8
- package/node_modules/@flickfyi/core/dist-types/kowalski/feature-schema.d.ts +65 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/format.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/fortune.d.ts +21 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/frame.d.ts +4 -4
- package/node_modules/@flickfyi/core/dist-types/kowalski/index.d.cts +31 -7
- package/node_modules/@flickfyi/core/dist-types/kowalski/index.d.ts +31 -7
- package/node_modules/@flickfyi/core/dist-types/kowalski/lesson.d.ts +89 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/recipe.d.ts +129 -8
- package/node_modules/@flickfyi/core/dist-types/kowalski/schemas.d.cts +4 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/schemas.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist-types/kowalski/time-since.d.ts +34 -0
- package/node_modules/@flickfyi/core/examples/example-metadata.ts +19 -2
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +25 -6
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +6 -12
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +22 -5
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +26 -5
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +6 -21
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +18 -5
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +6 -19
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +25 -5
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +6 -21
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +19 -6
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +6 -17
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +30 -5
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +22 -5
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +23 -5
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +6 -19
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +23 -5
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/fortune/fortune.stories.tsx +61 -0
- package/node_modules/@flickfyi/core/examples/kowalski/fortune/fortune.tsx +11 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +18 -5
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +3 -19
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +22 -5
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +25 -5
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +6 -20
- package/node_modules/@flickfyi/core/examples/kowalski/lesson/lesson.stories.tsx +99 -0
- package/node_modules/@flickfyi/core/examples/kowalski/lesson/lesson.tsx +11 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +21 -5
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +3 -17
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +26 -5
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +3 -21
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +37 -6
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +18 -5
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +6 -14
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +117 -5
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +6 -115
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +22 -5
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +26 -5
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +6 -22
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +26 -5
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +6 -21
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +28 -6
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +6 -22
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +27 -6
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +6 -22
- package/node_modules/@flickfyi/core/examples/kowalski/time-since/time-since.stories.tsx +33 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-since/time-since.tsx +12 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +22 -6
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +6 -17
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +18 -5
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +6 -18
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +25 -5
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +3 -21
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +19 -6
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +6 -19
- package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.tsx +2 -13
- package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/counter/counter.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/grid/grid.tsx +4 -9
- package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/list/list.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/log/log.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.tsx +0 -8
- package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +10 -3
- package/node_modules/@flickfyi/core/examples/parrott/timer/timer.tsx +0 -8
- package/node_modules/@flickfyi/core/package.json +16 -3
- package/node_modules/@flickfyi/core/src/{kowalski/use-configured-feature.ts → hooks/use-configured-feature/index.ts} +1 -1
- package/node_modules/@flickfyi/core/src/{kowalski/use-feature-store.ts → hooks/use-feature-store/index.ts} +37 -12
- package/node_modules/@flickfyi/core/src/kowalski/README.md +13 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +36 -8
- package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +15 -7
- package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +110 -704
- package/node_modules/@flickfyi/core/src/kowalski/components/bill-split.tsx +284 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/bookmark.tsx +347 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/budget.tsx +169 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/calculator.tsx +202 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/checklist.tsx +119 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/color-palette.tsx +302 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/contact.tsx +247 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/countdown.tsx +173 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/event.tsx +260 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/expense.tsx +257 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/goal.tsx +182 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/habit.tsx +272 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/ledger.tsx +211 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/note.tsx +188 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/poll.tsx +242 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/random-picker.tsx +308 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/rating.tsx +112 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/reminder.tsx +298 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/rotation.tsx +146 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/scoreboard.tsx +139 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/shopping-list.tsx +144 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/task-board.tsx +146 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/time-zone.tsx +240 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/timer.tsx +225 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/trip.tsx +338 -0
- package/node_modules/@flickfyi/core/src/kowalski/components/unit-converter.tsx +285 -0
- package/node_modules/@flickfyi/core/src/kowalski/create-schemas.ts +8 -0
- package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +1 -1
- package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +1 -640
- package/node_modules/@flickfyi/core/src/kowalski/feature-schema.ts +84 -0
- package/node_modules/@flickfyi/core/src/kowalski/format.ts +29 -3
- package/node_modules/@flickfyi/core/src/kowalski/fortune.tsx +67 -0
- package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +5 -6
- package/node_modules/@flickfyi/core/src/kowalski/index.ts +31 -22
- package/node_modules/@flickfyi/core/src/kowalski/lesson.tsx +564 -0
- package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +78 -37
- package/node_modules/@flickfyi/core/src/kowalski/schemas.ts +67 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +22 -20
- package/node_modules/@flickfyi/core/src/kowalski/time-since.tsx +145 -0
- package/node_modules/@flickfyi/core/src/molecules/progress/progress.tsx +4 -1
- package/node_modules/@flickfyi/core/src/oklch.ts +1 -6
- package/node_modules/@flickfyi/core/src/parrott/theme.ts +3 -1
- package/node_modules/@flickfyi/core/src/themes/editorial/editorial.ts +6 -1
- package/node_modules/@flickfyi/core/src/themes/palette.ts +5 -5
- package/node_modules/@flickfyi/core/src/themes/stories/composition.tsx +11 -9
- package/node_modules/@flickfyi/core/src/themes/stories/gallery.tsx +7 -11
- package/node_modules/@flickfyi/core/tsgo.bun.lock +7 -7
- package/node_modules/@flickfyi/core/tsgo.package.json +1 -1
- package/package.json +2 -2
- package/node_modules/@flickfyi/core/dist-types/kowalski/clocks.d.ts +0 -4
- package/node_modules/@flickfyi/core/dist-types/kowalski/details.d.ts +0 -7
- package/node_modules/@flickfyi/core/dist-types/kowalski/productivity.d.ts +0 -5
- package/node_modules/@flickfyi/core/dist-types/kowalski/tools.d.ts +0 -7
- package/node_modules/@flickfyi/core/dist-types/kowalski/use-feature-store.d.ts +0 -15
- package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +0 -464
- package/node_modules/@flickfyi/core/src/kowalski/details.tsx +0 -1387
- package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +0 -575
- package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +0 -1213
- /package/node_modules/@flickfyi/core/dist-types/{kowalski/use-clock.d.ts → hooks/use-clock/index.d.ts} +0 -0
- /package/node_modules/@flickfyi/core/dist-types/{kowalski/use-configured-feature.d.ts → hooks/use-configured-feature/index.d.ts} +0 -0
- /package/node_modules/@flickfyi/core/src/{kowalski/use-clock.ts → hooks/use-clock/index.ts} +0 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Text } from '@flickfyi/core'
|
|
2
|
+
import { Choice, completedTaskStyle, List, Stat } from '@flickfyi/core/molecules'
|
|
3
|
+
import * as stylex from '@stylexjs/stylex'
|
|
4
|
+
import { z } from 'zod/v4'
|
|
5
|
+
|
|
6
|
+
import { useConfiguredFeature } from '~/hooks/use-configured-feature'
|
|
7
|
+
import { formatCurrency } from '~/kowalski/calculations'
|
|
8
|
+
import type { CreateSchemas } from '~/kowalski/create-schemas'
|
|
9
|
+
import { entries, featureFields } from '~/kowalski/feature-schema'
|
|
10
|
+
import { format } from '~/kowalski/format'
|
|
11
|
+
import { FeatureAction, FeatureFrame, FeatureWell } from '~/kowalski/frame'
|
|
12
|
+
import { roles } from '~/themes/shared'
|
|
13
|
+
|
|
14
|
+
const defaultId = 'KowalskiShoppingList'
|
|
15
|
+
const defaultScope = 'private'
|
|
16
|
+
|
|
17
|
+
export const ShoppingListData = /* @__PURE__ */ z
|
|
18
|
+
.strictObject({
|
|
19
|
+
currency: z
|
|
20
|
+
.string()
|
|
21
|
+
.optional()
|
|
22
|
+
.describe('A three-letter ISO currency code, e.g. "USD" or "EUR". Omit for "USD".'),
|
|
23
|
+
items: z
|
|
24
|
+
.array(
|
|
25
|
+
z.strictObject({
|
|
26
|
+
id: z.string().describe('A short ID, unique within this list, e.g. "tent".'),
|
|
27
|
+
label: z.string().describe('One item to buy, e.g. "Oat milk".'),
|
|
28
|
+
price: z.number().optional().describe('Price per unit. Omit if unknown.'),
|
|
29
|
+
quantity: z.number().optional().describe('How many to buy. Omit for 1.'),
|
|
30
|
+
})
|
|
31
|
+
)
|
|
32
|
+
.describe('The items to buy.'),
|
|
33
|
+
title: z.string().optional().describe('A short heading. Omit for "Shopping list".'),
|
|
34
|
+
})
|
|
35
|
+
.describe(
|
|
36
|
+
'Check items off a shopping list with optional prices and a running cart total. No ordering.'
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
export type ShoppingListData = z.infer<typeof ShoppingListData>
|
|
40
|
+
|
|
41
|
+
export const ShoppingListProps = z.strictObject({
|
|
42
|
+
data: ShoppingListData,
|
|
43
|
+
...featureFields,
|
|
44
|
+
scope: featureFields.scope.default(defaultScope),
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
export type ShoppingListProps = z.input<typeof ShoppingListProps> & {
|
|
48
|
+
style?: stylex.StyleXArray<stylex.StyleXStyles>
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export const shoppingListStoreSchema = entries('got_', z.boolean(), {})
|
|
52
|
+
|
|
53
|
+
export const createSchemas: CreateSchemas = ({
|
|
54
|
+
id = defaultId,
|
|
55
|
+
scope = defaultScope,
|
|
56
|
+
} = {}) => ({
|
|
57
|
+
[`stores/${scope}/${id}`]: shoppingListStoreSchema,
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
export function ShoppingList({
|
|
61
|
+
data,
|
|
62
|
+
id,
|
|
63
|
+
revision = 0,
|
|
64
|
+
scope = defaultScope,
|
|
65
|
+
style,
|
|
66
|
+
}: ShoppingListProps) {
|
|
67
|
+
const items = data.items.map(item => ({ ...item, quantity: item.quantity ?? 1 }))
|
|
68
|
+
const schema = shoppingListStoreSchema
|
|
69
|
+
const store = useConfiguredFeature({
|
|
70
|
+
name: id ?? defaultId,
|
|
71
|
+
revision,
|
|
72
|
+
schema,
|
|
73
|
+
scope,
|
|
74
|
+
seed: schema.parse({}),
|
|
75
|
+
})
|
|
76
|
+
const money = (value: number) => formatCurrency(value, data.currency)
|
|
77
|
+
const got = (id: string) => Boolean(store.value[`got_${id}`])
|
|
78
|
+
const priced = items.filter(item => item.price !== undefined)
|
|
79
|
+
const cost = (item: (typeof items)[number]) => (item.price ?? 0) * item.quantity
|
|
80
|
+
const total = priced.reduce((sum, item) => sum + cost(item), 0)
|
|
81
|
+
const cart = priced
|
|
82
|
+
.filter(item => got(item.id))
|
|
83
|
+
.reduce((sum, item) => sum + cost(item), 0)
|
|
84
|
+
const count = items.filter(item => got(item.id)).length
|
|
85
|
+
return (
|
|
86
|
+
<FeatureFrame
|
|
87
|
+
style={style}
|
|
88
|
+
onRetry={store.retry}
|
|
89
|
+
notice={store.error}
|
|
90
|
+
component="shoppingList"
|
|
91
|
+
title={data.title ?? 'Shopping list'}
|
|
92
|
+
trailing={
|
|
93
|
+
<Text {...stylex.props(roles.muted)}>
|
|
94
|
+
{`${format.formatNumber(count)} of ${format.formatNumber(items.length)}`}
|
|
95
|
+
</Text>
|
|
96
|
+
}
|
|
97
|
+
>
|
|
98
|
+
{priced.length > 0 && (
|
|
99
|
+
<FeatureWell>
|
|
100
|
+
<Stat>
|
|
101
|
+
<Stat.Value>{money(cart)}</Stat.Value>
|
|
102
|
+
<Stat.Caption>{`In the cart of ${money(total)}`}</Stat.Caption>
|
|
103
|
+
</Stat>
|
|
104
|
+
</FeatureWell>
|
|
105
|
+
)}
|
|
106
|
+
<List style={completedTaskStyle}>
|
|
107
|
+
{items.map(item => (
|
|
108
|
+
<Choice
|
|
109
|
+
checked={got(item.id)}
|
|
110
|
+
description={
|
|
111
|
+
item.price === undefined
|
|
112
|
+
? item.quantity > 1
|
|
113
|
+
? `× ${format.formatNumber(item.quantity)}`
|
|
114
|
+
: undefined
|
|
115
|
+
: item.quantity > 1
|
|
116
|
+
? `${format.formatNumber(item.quantity)} × ${money(item.price)}`
|
|
117
|
+
: money(item.price)
|
|
118
|
+
}
|
|
119
|
+
disabled={!store.ready}
|
|
120
|
+
key={item.id}
|
|
121
|
+
onCheckedChange={checked =>
|
|
122
|
+
store.set(() => ({ [`got_${item.id}`]: checked }))
|
|
123
|
+
}
|
|
124
|
+
>
|
|
125
|
+
{item.label}
|
|
126
|
+
</Choice>
|
|
127
|
+
))}
|
|
128
|
+
</List>
|
|
129
|
+
{count > 0 && (
|
|
130
|
+
<FeatureAction
|
|
131
|
+
component="shoppingList"
|
|
132
|
+
disabled={!store.ready}
|
|
133
|
+
onClick={() =>
|
|
134
|
+
store.set(() =>
|
|
135
|
+
Object.fromEntries(items.map(item => [`got_${item.id}`, false]))
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
>
|
|
139
|
+
Start a new trip
|
|
140
|
+
</FeatureAction>
|
|
141
|
+
)}
|
|
142
|
+
</FeatureFrame>
|
|
143
|
+
)
|
|
144
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { Text } from '@flickfyi/core'
|
|
2
|
+
import { Button } from '@flickfyi/core/atoms'
|
|
3
|
+
import { List, Segmented } from '@flickfyi/core/molecules'
|
|
4
|
+
import * as stylex from '@stylexjs/stylex'
|
|
5
|
+
import { useState } from 'react'
|
|
6
|
+
import { z } from 'zod/v4'
|
|
7
|
+
|
|
8
|
+
import { useConfiguredFeature } from '~/hooks/use-configured-feature'
|
|
9
|
+
import type { CreateSchemas } from '~/kowalski/create-schemas'
|
|
10
|
+
import { everydayStyles } from '~/kowalski/everyday'
|
|
11
|
+
import { entries, featureFields } from '~/kowalski/feature-schema'
|
|
12
|
+
import { format } from '~/kowalski/format'
|
|
13
|
+
import { FeatureFacts, FeatureFrame, FeatureWell, layout } from '~/kowalski/frame'
|
|
14
|
+
import { button, roles } from '~/themes/shared'
|
|
15
|
+
|
|
16
|
+
const defaultId = 'KowalskiTaskBoard'
|
|
17
|
+
const defaultScope = 'private'
|
|
18
|
+
|
|
19
|
+
export const TaskBoardData = /* @__PURE__ */ z
|
|
20
|
+
.strictObject({
|
|
21
|
+
tasks: z
|
|
22
|
+
.array(
|
|
23
|
+
z.strictObject({
|
|
24
|
+
id: z.string().describe('A short ID, unique within this list, e.g. "tent".'),
|
|
25
|
+
label: z.string().describe('One short task.'),
|
|
26
|
+
})
|
|
27
|
+
)
|
|
28
|
+
.describe('The tasks, all starting in To do.'),
|
|
29
|
+
title: z.string().optional().describe('A short heading. Omit for "Tasks".'),
|
|
30
|
+
})
|
|
31
|
+
.describe('Move tasks between To do, Doing, and Done. No assignees, dates, or sync.')
|
|
32
|
+
|
|
33
|
+
export type TaskBoardData = z.infer<typeof TaskBoardData>
|
|
34
|
+
|
|
35
|
+
export const TaskBoardProps = z.strictObject({
|
|
36
|
+
data: TaskBoardData,
|
|
37
|
+
...featureFields,
|
|
38
|
+
scope: featureFields.scope.default(defaultScope),
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
export type TaskBoardProps = z.input<typeof TaskBoardProps> & {
|
|
42
|
+
style?: stylex.StyleXArray<stylex.StyleXStyles>
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const taskBoardStoreSchema = entries(
|
|
46
|
+
'status_',
|
|
47
|
+
z.enum(['todo', 'doing', 'done']),
|
|
48
|
+
{}
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
export const createSchemas: CreateSchemas = ({
|
|
52
|
+
id = defaultId,
|
|
53
|
+
scope = defaultScope,
|
|
54
|
+
} = {}) => ({
|
|
55
|
+
[`stores/${scope}/${id}`]: taskBoardStoreSchema,
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
export function TaskBoard({
|
|
59
|
+
data,
|
|
60
|
+
id,
|
|
61
|
+
revision = 0,
|
|
62
|
+
scope = defaultScope,
|
|
63
|
+
style,
|
|
64
|
+
}: TaskBoardProps) {
|
|
65
|
+
const tasks = data.tasks
|
|
66
|
+
const schema = taskBoardStoreSchema
|
|
67
|
+
const store = useConfiguredFeature({
|
|
68
|
+
name: id ?? defaultId,
|
|
69
|
+
revision,
|
|
70
|
+
schema,
|
|
71
|
+
scope,
|
|
72
|
+
seed: schema.parse({}),
|
|
73
|
+
})
|
|
74
|
+
const [column, setColumn] = useState<TaskStatus>('todo')
|
|
75
|
+
const statusOf = (id: string): TaskStatus => store.value[`status_${id}`] ?? 'todo'
|
|
76
|
+
const visible = tasks.filter(task => statusOf(task.id) === column)
|
|
77
|
+
return (
|
|
78
|
+
<FeatureFrame
|
|
79
|
+
style={style}
|
|
80
|
+
onRetry={store.retry}
|
|
81
|
+
notice={store.error}
|
|
82
|
+
component="taskBoard"
|
|
83
|
+
title={data.title ?? 'Tasks'}
|
|
84
|
+
trailing={
|
|
85
|
+
<Text {...stylex.props(roles.muted)}>
|
|
86
|
+
{`${format.formatNumber(tasks.filter(task => statusOf(task.id) === 'done').length)} of ${format.formatNumber(tasks.length)} done`}
|
|
87
|
+
</Text>
|
|
88
|
+
}
|
|
89
|
+
>
|
|
90
|
+
<Segmented
|
|
91
|
+
options={taskColumns.map(option => ({
|
|
92
|
+
label: `${option.label} ${format.formatNumber(tasks.filter(task => statusOf(task.id) === option.value).length)}`,
|
|
93
|
+
value: option.value,
|
|
94
|
+
}))}
|
|
95
|
+
value={column}
|
|
96
|
+
onChange={setColumn}
|
|
97
|
+
/>
|
|
98
|
+
{visible.length === 0 ? (
|
|
99
|
+
<FeatureWell style={everydayStyles.empty}>
|
|
100
|
+
<Text {...stylex.props(roles.muted)}>
|
|
101
|
+
{column === 'done' ? 'Nothing finished yet.' : 'Nothing here.'}
|
|
102
|
+
</Text>
|
|
103
|
+
</FeatureWell>
|
|
104
|
+
) : (
|
|
105
|
+
<FeatureFacts>
|
|
106
|
+
{visible.map(task => {
|
|
107
|
+
const next: TaskStatus =
|
|
108
|
+
column === 'todo' ? 'doing' : column === 'doing' ? 'done' : 'todo'
|
|
109
|
+
return (
|
|
110
|
+
<List.Item
|
|
111
|
+
key={task.id}
|
|
112
|
+
label={task.label}
|
|
113
|
+
trailing={
|
|
114
|
+
<Button
|
|
115
|
+
accessibilityLabel={`${moveLabels[column]}: ${task.label}`}
|
|
116
|
+
disabled={!store.ready}
|
|
117
|
+
onClick={() => {
|
|
118
|
+
store.set(() => ({ [`status_${task.id}`]: next }))
|
|
119
|
+
}}
|
|
120
|
+
style={[button.quiet, button.sm, layout.trailingAction]}
|
|
121
|
+
>
|
|
122
|
+
<Text>{moveLabels[column]}</Text>
|
|
123
|
+
</Button>
|
|
124
|
+
}
|
|
125
|
+
/>
|
|
126
|
+
)
|
|
127
|
+
})}
|
|
128
|
+
</FeatureFacts>
|
|
129
|
+
)}
|
|
130
|
+
</FeatureFrame>
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
type TaskStatus = 'doing' | 'done' | 'todo'
|
|
135
|
+
|
|
136
|
+
const moveLabels: Record<TaskStatus, string> = {
|
|
137
|
+
doing: 'Finish',
|
|
138
|
+
done: 'Reopen',
|
|
139
|
+
todo: 'Start',
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
const taskColumns: { label: string; value: TaskStatus }[] = [
|
|
143
|
+
{ label: 'To do', value: 'todo' },
|
|
144
|
+
{ label: 'Doing', value: 'doing' },
|
|
145
|
+
{ label: 'Done', value: 'done' },
|
|
146
|
+
]
|
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { Flex, Text } from '@flickfyi/core'
|
|
2
|
+
import * as stylex from '@stylexjs/stylex'
|
|
3
|
+
import { DateTime, Duration } from 'luxon'
|
|
4
|
+
import { useState } from 'react'
|
|
5
|
+
import { z } from 'zod/v4'
|
|
6
|
+
|
|
7
|
+
import { useClock } from '~/hooks/use-clock'
|
|
8
|
+
import { useConfiguredFeature } from '~/hooks/use-configured-feature'
|
|
9
|
+
import { parseInstant } from '~/kowalski/calculations'
|
|
10
|
+
import type { CreateSchemas } from '~/kowalski/create-schemas'
|
|
11
|
+
import { FeatureDateTime } from '~/kowalski/date-time'
|
|
12
|
+
import { featureFields, replacement, store } from '~/kowalski/feature-schema'
|
|
13
|
+
import { format } from '~/kowalski/format'
|
|
14
|
+
import { FeatureAction, FeatureFrame, FeatureWell } from '~/kowalski/frame'
|
|
15
|
+
import { space, text } from '~/themes/scale.stylex'
|
|
16
|
+
import { appearance, roles } from '~/themes/shared'
|
|
17
|
+
|
|
18
|
+
const defaultId = 'KowalskiTimeZone'
|
|
19
|
+
const defaultScope = 'private'
|
|
20
|
+
|
|
21
|
+
export const TimeZoneData = /* @__PURE__ */ z
|
|
22
|
+
.strictObject({
|
|
23
|
+
at: z
|
|
24
|
+
.string()
|
|
25
|
+
.optional()
|
|
26
|
+
.describe(
|
|
27
|
+
'A moment to compare, as ISO 8601 with an offset. Omit to show the live current time.'
|
|
28
|
+
),
|
|
29
|
+
title: z.string().optional().describe('A short heading. Omit for "World clock".'),
|
|
30
|
+
zones: z
|
|
31
|
+
.array(z.string())
|
|
32
|
+
.describe('Two or more IANA time zones to compare, e.g. "Europe/London".'),
|
|
33
|
+
})
|
|
34
|
+
.describe('Compare local times in named time zones, live or at an explicit instant.')
|
|
35
|
+
|
|
36
|
+
export type TimeZoneData = z.infer<typeof TimeZoneData>
|
|
37
|
+
|
|
38
|
+
export const TimeZoneProps = z.strictObject({
|
|
39
|
+
data: TimeZoneData,
|
|
40
|
+
...featureFields,
|
|
41
|
+
scope: featureFields.scope.default(defaultScope),
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export type TimeZoneProps = z.input<typeof TimeZoneProps> & {
|
|
45
|
+
style?: stylex.StyleXArray<stylex.StyleXStyles>
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const timeZoneStoreSchema = store({
|
|
49
|
+
at: replacement(z.string().nullable().default(null)),
|
|
50
|
+
})
|
|
51
|
+
|
|
52
|
+
export const createSchemas: CreateSchemas = ({
|
|
53
|
+
id = defaultId,
|
|
54
|
+
scope = defaultScope,
|
|
55
|
+
} = {}) => ({
|
|
56
|
+
[`stores/${scope}/${id}`]: timeZoneStoreSchema,
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
export function TimeZone({
|
|
60
|
+
data,
|
|
61
|
+
id,
|
|
62
|
+
revision = 0,
|
|
63
|
+
scope = defaultScope,
|
|
64
|
+
style,
|
|
65
|
+
}: TimeZoneProps) {
|
|
66
|
+
const schema = timeZoneStoreSchema
|
|
67
|
+
const store = useConfiguredFeature({
|
|
68
|
+
name: id ?? defaultId,
|
|
69
|
+
revision,
|
|
70
|
+
schema,
|
|
71
|
+
scope,
|
|
72
|
+
seed: schema.parse({ at: { value: data.at } }),
|
|
73
|
+
})
|
|
74
|
+
const [editing, setEditing] = useState(false)
|
|
75
|
+
const live = store.value.at.value === null
|
|
76
|
+
const now = useClock(live)
|
|
77
|
+
const instant = parseInstant(store.value.at.value) ?? now
|
|
78
|
+
const referenceZone = data.zones[0] ?? 'UTC'
|
|
79
|
+
const referenceCity = referenceZone.split('/').at(-1)?.replaceAll('_', ' ')
|
|
80
|
+
const reference = DateTime.fromMillis(instant, { locale: 'en', zone: referenceZone })
|
|
81
|
+
const referenceDate = DateTime.utc(reference.year, reference.month, reference.day)
|
|
82
|
+
return (
|
|
83
|
+
<FeatureFrame
|
|
84
|
+
style={style}
|
|
85
|
+
onRetry={store.retry}
|
|
86
|
+
notice={store.error}
|
|
87
|
+
component="timeZone"
|
|
88
|
+
title={data.title ?? 'World clock'}
|
|
89
|
+
detail={`Times relative to ${referenceCity}`}
|
|
90
|
+
trailing={
|
|
91
|
+
<Text {...stylex.props(roles.muted, live && appearance.accent)}>
|
|
92
|
+
{store.saving
|
|
93
|
+
? 'Saving…'
|
|
94
|
+
: !store.ready && !store.error
|
|
95
|
+
? 'Loading…'
|
|
96
|
+
: live
|
|
97
|
+
? 'Live'
|
|
98
|
+
: 'Fixed time'}
|
|
99
|
+
</Text>
|
|
100
|
+
}
|
|
101
|
+
>
|
|
102
|
+
<Flex {...stylex.props(timeZoneStyles.clocks)}>
|
|
103
|
+
{data.zones.map((zone, index) => {
|
|
104
|
+
const local = reference.setZone(zone)
|
|
105
|
+
const days = DateTime.utc(local.year, local.month, local.day).diff(
|
|
106
|
+
referenceDate,
|
|
107
|
+
'days'
|
|
108
|
+
).days
|
|
109
|
+
const minutes = local.offset - reference.offset
|
|
110
|
+
const difference = format.formatDuration(
|
|
111
|
+
Duration.fromObject({ minutes: Math.abs(minutes) })
|
|
112
|
+
.shiftTo('hours', 'minutes', 'seconds')
|
|
113
|
+
.toObject(),
|
|
114
|
+
{ style: 'long' }
|
|
115
|
+
)
|
|
116
|
+
const clockParts = format.formatTimeToParts(instant, {
|
|
117
|
+
fractionalSecondDigits: !live && local.millisecond !== 0 ? 3 : undefined,
|
|
118
|
+
hour: 'numeric',
|
|
119
|
+
hour12: true,
|
|
120
|
+
minute: '2-digit',
|
|
121
|
+
second:
|
|
122
|
+
!live && (local.second !== 0 || local.millisecond !== 0)
|
|
123
|
+
? '2-digit'
|
|
124
|
+
: undefined,
|
|
125
|
+
timeZone: zone,
|
|
126
|
+
})
|
|
127
|
+
const clock = clockParts
|
|
128
|
+
.filter(part => part.type !== 'dayPeriod')
|
|
129
|
+
.map(part => part.value)
|
|
130
|
+
.join('')
|
|
131
|
+
.trim()
|
|
132
|
+
return (
|
|
133
|
+
<FeatureWell key={`${zone}:${index}`}>
|
|
134
|
+
<Flex {...stylex.props(timeZoneStyles.zoneRow)}>
|
|
135
|
+
<Flex {...stylex.props(timeZoneStyles.city)}>
|
|
136
|
+
<Text {...stylex.props(roles.h2)}>
|
|
137
|
+
{zone.split('/').at(-1)?.replaceAll('_', ' ')}
|
|
138
|
+
</Text>
|
|
139
|
+
<Text {...stylex.props(roles.muted)}>
|
|
140
|
+
{index === 0
|
|
141
|
+
? 'Reference'
|
|
142
|
+
: minutes === 0
|
|
143
|
+
? 'Same time'
|
|
144
|
+
: `${difference} ${minutes > 0 ? 'ahead' : 'behind'}`}
|
|
145
|
+
</Text>
|
|
146
|
+
{days !== 0 && (
|
|
147
|
+
<Text {...stylex.props(roles.muted, appearance.accent)}>
|
|
148
|
+
{days === 1
|
|
149
|
+
? 'Next day'
|
|
150
|
+
: days === -1
|
|
151
|
+
? 'Previous day'
|
|
152
|
+
: `${format.formatNumber(Math.abs(days))} days ${days > 0 ? 'ahead' : 'behind'}`}
|
|
153
|
+
</Text>
|
|
154
|
+
)}
|
|
155
|
+
</Flex>
|
|
156
|
+
<Flex {...stylex.props(timeZoneStyles.local)}>
|
|
157
|
+
<Flex {...stylex.props(timeZoneStyles.time)}>
|
|
158
|
+
<Text
|
|
159
|
+
animated={live ? 'numeric' : undefined}
|
|
160
|
+
{...stylex.props(
|
|
161
|
+
roles.display,
|
|
162
|
+
timeZoneStyles.digits(clock.length)
|
|
163
|
+
)}
|
|
164
|
+
>
|
|
165
|
+
{clock}
|
|
166
|
+
</Text>
|
|
167
|
+
<Text {...stylex.props(roles.muted, timeZoneStyles.period)}>
|
|
168
|
+
{clockParts.find(part => part.type === 'dayPeriod')?.value}
|
|
169
|
+
</Text>
|
|
170
|
+
</Flex>
|
|
171
|
+
<Text {...stylex.props(roles.muted)}>
|
|
172
|
+
{format.formatDate(instant, {
|
|
173
|
+
day: 'numeric',
|
|
174
|
+
...(local.year <= 0 ? { era: 'short', year: 'numeric' } : {}),
|
|
175
|
+
month: 'short',
|
|
176
|
+
weekday: 'short',
|
|
177
|
+
timeZone: zone,
|
|
178
|
+
})}
|
|
179
|
+
</Text>
|
|
180
|
+
</Flex>
|
|
181
|
+
</Flex>
|
|
182
|
+
</FeatureWell>
|
|
183
|
+
)
|
|
184
|
+
})}
|
|
185
|
+
</Flex>
|
|
186
|
+
<FeatureDateTime
|
|
187
|
+
actionLabel="Compare another time"
|
|
188
|
+
compact
|
|
189
|
+
component="timeZone"
|
|
190
|
+
label={`Comparison time · ${referenceCity}`}
|
|
191
|
+
ready={store.ready}
|
|
192
|
+
saving={store.saving}
|
|
193
|
+
submitLabel="Compare this time"
|
|
194
|
+
timeZone={referenceZone}
|
|
195
|
+
value={store.value.at.value}
|
|
196
|
+
onChange={(at, onSaved) => store.set(() => ({ at: { value: at } }), onSaved)}
|
|
197
|
+
onEditingChange={setEditing}
|
|
198
|
+
/>
|
|
199
|
+
{!live && (
|
|
200
|
+
<FeatureAction
|
|
201
|
+
component="timeZone"
|
|
202
|
+
icon="clock"
|
|
203
|
+
disabled={!store.ready || store.saving || editing}
|
|
204
|
+
onClick={() => store.set(() => ({ at: { value: null } }))}
|
|
205
|
+
>
|
|
206
|
+
Return to live
|
|
207
|
+
</FeatureAction>
|
|
208
|
+
)}
|
|
209
|
+
{!live && editing && !store.saving && (
|
|
210
|
+
<Text {...stylex.props(roles.muted)}>
|
|
211
|
+
Save or cancel your comparison before returning to live.
|
|
212
|
+
</Text>
|
|
213
|
+
)}
|
|
214
|
+
</FeatureFrame>
|
|
215
|
+
)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Long readings step down the display scale so they never overflow their well.
|
|
219
|
+
const timeZoneStyles = /* @__PURE__ */ stylex.create({
|
|
220
|
+
city: { flexBasis: space[24], flexGrow: 1, gap: space[1], minWidth: 0 },
|
|
221
|
+
clocks: { gap: space[2] },
|
|
222
|
+
digits: (length: number) => ({
|
|
223
|
+
fontSize: length > 8 ? text['2xl'] : length > 5 ? text['3xl'] : text['4xl'],
|
|
224
|
+
lineHeight:
|
|
225
|
+
length > 8
|
|
226
|
+
? text['2xlLeading']
|
|
227
|
+
: length > 5
|
|
228
|
+
? text['3xlLeading']
|
|
229
|
+
: text['4xlLeading'],
|
|
230
|
+
}),
|
|
231
|
+
local: { alignItems: 'flex-end', flexGrow: 1, gap: space[1], textAlign: 'right' },
|
|
232
|
+
period: { marginBottom: space[1] },
|
|
233
|
+
time: { alignItems: 'flex-end', flexDirection: 'row', gap: space[1.5] },
|
|
234
|
+
zoneRow: {
|
|
235
|
+
alignItems: 'center',
|
|
236
|
+
flexDirection: 'row',
|
|
237
|
+
flexWrap: 'wrap',
|
|
238
|
+
gap: space[3],
|
|
239
|
+
},
|
|
240
|
+
})
|