@flickfyi/flkr 0.0.141 → 0.0.153
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/node_modules/@flickfyi/attestation/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/biscuit/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/core/.oxlintrc.json +2 -1
- package/node_modules/@flickfyi/core/.turbo/turbo-build.log +499 -92
- package/node_modules/@flickfyi/core/README.md +58 -4
- package/node_modules/@flickfyi/core/dist/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/index.js +35 -24
- package/node_modules/@flickfyi/core/dist/kowalski/calculations.d.ts +17 -0
- package/node_modules/@flickfyi/core/dist/kowalski/calculator.d.ts +13 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.cjs +1 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.cts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.d.ts +962 -0
- package/node_modules/@flickfyi/core/dist/kowalski/catalog.js +639 -0
- package/node_modules/@flickfyi/core/dist/kowalski/clocks.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/date-time.d.ts +22 -0
- package/node_modules/@flickfyi/core/dist/kowalski/details.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/everyday.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/format.d.ts +4 -0
- package/node_modules/@flickfyi/core/dist/kowalski/frame.d.ts +161 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.cjs +21 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.cts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/index.js +7496 -0
- package/node_modules/@flickfyi/core/dist/kowalski/productivity.d.ts +5 -0
- package/node_modules/@flickfyi/core/dist/kowalski/recipe.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/kowalski/tools.d.ts +7 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-clock.d.ts +6 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-configured-feature.d.ts +19 -0
- package/node_modules/@flickfyi/core/dist/kowalski/use-feature-store.d.ts +15 -0
- package/node_modules/@flickfyi/core/dist/kowalski.css +506 -0
- package/node_modules/@flickfyi/core/dist/molecules/field/field.d.ts +8 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.cjs +1 -1
- package/node_modules/@flickfyi/core/dist/molecules/index.d.cts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.d.ts +3 -0
- package/node_modules/@flickfyi/core/dist/molecules/index.js +88 -27
- package/node_modules/@flickfyi/core/dist/molecules/segmented/segmented.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/molecules/stepper/stepper.d.ts +10 -0
- package/node_modules/@flickfyi/core/dist/quantum/use-store.d.ts +7 -1
- package/node_modules/@flickfyi/core/dist/themes.css +2 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bill-split/bill-split.tsx +17 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/bookmark/bookmark.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/budget/budget.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/calculator/calculator.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/checklist/checklist.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/color-palette/color-palette.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/contact/contact.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/countdown/countdown.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/event/event.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/expense/expense.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/goal/goal.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/habit/habit.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/ledger/ledger.tsx +25 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/note/note.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/poll/poll.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/random-picker/random-picker.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rating/rating.tsx +19 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/recipe/recipe.tsx +120 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/reminder/reminder.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/rotation/rotation.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/scoreboard/scoreboard.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/shopping-list/shopping-list.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/task-board/task-board.tsx +27 -0
- package/node_modules/@flickfyi/core/examples/kowalski/theme.ts +3 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/time-zone/time-zone.tsx +22 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/timer/timer.tsx +23 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/trip/trip.tsx +26 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.stories.tsx +15 -0
- package/node_modules/@flickfyi/core/examples/kowalski/unit-converter/unit-converter.tsx +24 -0
- package/node_modules/@flickfyi/core/examples/parrott/calculator/calculator.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/checklist/checklist.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/countdown/countdown.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/counter/counter.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/fortune/fortune.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/grid/grid.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/kale-smoothie/kale-smoothie.stories.tsx +1 -0
- package/node_modules/@flickfyi/core/examples/parrott/list/list.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/log/log.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timed-task/timed-task.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/examples/parrott/timer/timer.stories.tsx +3 -1
- package/node_modules/@flickfyi/core/fixtures/native/host/project.yml +3 -0
- package/node_modules/@flickfyi/core/fixtures/native/src/catalog-features.tsx +88 -0
- package/node_modules/@flickfyi/core/package.json +35 -5
- package/node_modules/@flickfyi/core/package.tsgo.json +19 -1
- package/node_modules/@flickfyi/core/scripts/vite-globals.d.ts +2 -0
- package/node_modules/@flickfyi/core/src/generated-types.d.ts +1 -0
- package/node_modules/@flickfyi/core/src/kowalski/README.md +9 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculations.ts +106 -0
- package/node_modules/@flickfyi/core/src/kowalski/calculator.ts +243 -0
- package/node_modules/@flickfyi/core/src/kowalski/catalog.ts +787 -0
- package/node_modules/@flickfyi/core/src/kowalski/clocks.tsx +464 -0
- package/node_modules/@flickfyi/core/src/kowalski/date-time.tsx +469 -0
- package/node_modules/@flickfyi/core/src/kowalski/details.tsx +1387 -0
- package/node_modules/@flickfyi/core/src/kowalski/everyday.tsx +652 -0
- package/node_modules/@flickfyi/core/src/kowalski/format.ts +48 -0
- package/node_modules/@flickfyi/core/src/kowalski/frame.tsx +351 -0
- package/node_modules/@flickfyi/core/src/kowalski/index.ts +23 -0
- package/node_modules/@flickfyi/core/src/kowalski/productivity.tsx +575 -0
- package/node_modules/@flickfyi/core/src/kowalski/recipe.tsx +555 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.stories.tsx +47 -0
- package/node_modules/@flickfyi/core/src/kowalski/stories/composition.tsx +100 -0
- package/node_modules/@flickfyi/core/src/kowalski/tools.tsx +1213 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-clock.ts +19 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-configured-feature.ts +85 -0
- package/node_modules/@flickfyi/core/src/kowalski/use-feature-store.ts +119 -0
- package/node_modules/@flickfyi/core/src/molecules/field/field.tsx +34 -0
- package/node_modules/@flickfyi/core/src/molecules/index.ts +3 -0
- package/node_modules/@flickfyi/core/src/molecules/segmented/segmented.tsx +48 -0
- package/node_modules/@flickfyi/core/src/molecules/stepper/stepper.tsx +54 -0
- package/node_modules/@flickfyi/core/src/quantum/use-store.ts +41 -16
- package/node_modules/@flickfyi/core/tests/fly.test.ts +34 -7
- package/node_modules/@flickfyi/core/tests/kowalski-calculations.test.ts +60 -0
- package/node_modules/@flickfyi/core/tests/kowalski-calculator.test.ts +142 -0
- package/node_modules/@flickfyi/core/tests/kowalski-contracts.test.ts +223 -0
- package/node_modules/@flickfyi/core/tests/kowalski-date-time.test.tsx +462 -0
- package/node_modules/@flickfyi/core/tests/kowalski-features.test.tsx +2158 -0
- package/node_modules/@flickfyi/core/tests/kowalski-store.test.tsx +514 -0
- package/node_modules/@flickfyi/core/tests/preview-build.test.ts +1 -1
- package/node_modules/@flickfyi/core/tests/quantum-use-store.test.ts +53 -1
- package/node_modules/@flickfyi/core/tests/verify-tsgo-assets.test.ts +1 -1
- package/node_modules/@flickfyi/core/tsconfig.vite-dts.json +2 -1
- package/node_modules/@flickfyi/core/tsgo.bun.lock +111 -9
- package/node_modules/@flickfyi/core/tsgo.package.json +21 -3
- package/node_modules/@flickfyi/core/vite.config.ts +9 -5
- package/node_modules/@flickfyi/core/vitest.config.ts +1 -1
- package/node_modules/@flickfyi/http-message-sig/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/identity/.turbo/turbo-build.log +8 -9
- package/node_modules/@flickfyi/lens/.turbo/turbo-build.log +7 -7
- package/node_modules/@flickfyi/photon/.turbo/turbo-build.log +4 -4
- package/node_modules/@flickfyi/photon/Sources/Photon/Components/Button.swift +29 -2
- package/node_modules/@flickfyi/photon/Sources/PhotonVersion/Resources/photon-version.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Components/ButtonHostTests.swift +26 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-features.styles.json +1 -0
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-native.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-scale.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-theme.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/catalog-typography.styles.json +1 -1
- package/node_modules/@flickfyi/photon/Tests/PhotonTests/Fixtures/StyleX/stylex-calculator.styles.json +1 -1
- package/node_modules/@flickfyi/photon/dist/globals.d.ts +5 -0
- package/node_modules/@flickfyi/photon/dist/version.cjs +1 -1
- package/node_modules/@flickfyi/photon/dist/version.js +1 -1
- package/node_modules/@flickfyi/photon/generated/react-swiftui.d.ts +1 -0
- package/node_modules/@flickfyi/photon/package.json +1 -1
- package/node_modules/@flickfyi/photon/src/globals.d.ts +5 -0
- package/node_modules/@flickfyi/rwsdk-extensions/.turbo/turbo-build.log +7 -7
- package/node_modules/@formatjs/fast-memoize/LICENSE.md +9 -0
- package/node_modules/@formatjs/fast-memoize/README.md +3 -0
- package/node_modules/@formatjs/fast-memoize/index.d.ts +35 -0
- package/node_modules/@formatjs/fast-memoize/index.js +69 -0
- package/node_modules/@formatjs/fast-memoize/index.js.map +1 -0
- package/node_modules/@formatjs/fast-memoize/package.json +25 -0
- package/node_modules/@formatjs/icu-messageformat-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-messageformat-parser/README.md +38 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.d.ts +393 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js +2187 -0
- package/node_modules/@formatjs/icu-messageformat-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.d.ts +175 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js +209 -0
- package/node_modules/@formatjs/icu-messageformat-parser/manipulator.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.d.ts +183 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js +162 -0
- package/node_modules/@formatjs/icu-messageformat-parser/no-parser.js.map +1 -0
- package/node_modules/@formatjs/icu-messageformat-parser/package.json +21 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.d.ts +154 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js +224 -0
- package/node_modules/@formatjs/icu-messageformat-parser/printer.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/LICENSE.md +9 -0
- package/node_modules/@formatjs/icu-skeleton-parser/README.md +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.d.ts +67 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js +380 -0
- package/node_modules/@formatjs/icu-skeleton-parser/index.js.map +1 -0
- package/node_modules/@formatjs/icu-skeleton-parser/package.json +15 -0
- package/node_modules/@formatjs/intl/LICENSE.md +9 -0
- package/node_modules/@formatjs/intl/README.md +3 -0
- package/node_modules/@formatjs/intl/index.d.ts +499 -0
- package/node_modules/@formatjs/intl/index.js +595 -0
- package/node_modules/@formatjs/intl/index.js.map +1 -0
- package/node_modules/@formatjs/intl/package.json +37 -0
- package/node_modules/decimal.js/LICENCE.md +23 -0
- package/node_modules/decimal.js/README.md +246 -0
- package/node_modules/decimal.js/decimal.d.ts +301 -0
- package/node_modules/decimal.js/decimal.js +4951 -0
- package/node_modules/decimal.js/decimal.mjs +4914 -0
- package/node_modules/decimal.js/package.json +55 -0
- package/node_modules/format-quantity/LICENSE +21 -0
- package/node_modules/format-quantity/README.md +181 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js +214 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.development.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.d.ts +131 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js +2 -0
- package/node_modules/format-quantity/dist/cjs/format-quantity.cjs.production.js.map +1 -0
- package/node_modules/format-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/format-quantity/dist/cjs/index.js +6 -0
- package/node_modules/format-quantity/dist/format-quantity.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.d.ts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js +268 -0
- package/node_modules/format-quantity/dist/format-quantity.legacy-esm.js.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs +208 -0
- package/node_modules/format-quantity/dist/format-quantity.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.production.d.mts +131 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs +2 -0
- package/node_modules/format-quantity/dist/format-quantity.production.mjs.map +1 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js +3 -0
- package/node_modules/format-quantity/dist/format-quantity.umd.min.js.map +1 -0
- package/node_modules/format-quantity/package.json +81 -0
- package/node_modules/intl-messageformat/LICENSE.md +33 -0
- package/node_modules/intl-messageformat/README.md +3 -0
- package/node_modules/intl-messageformat/index.d.ts +177 -0
- package/node_modules/intl-messageformat/index.js +327 -0
- package/node_modules/intl-messageformat/index.js.map +1 -0
- package/node_modules/intl-messageformat/intl-messageformat.iife.js +2819 -0
- package/node_modules/intl-messageformat/package.json +40 -0
- package/node_modules/numeric-quantity/LICENSE +21 -0
- package/node_modules/numeric-quantity/README.md +306 -0
- package/node_modules/numeric-quantity/dist/cjs/index.d.ts +1 -0
- package/node_modules/numeric-quantity/dist/cjs/index.js +6 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js +579 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.development.js.map +1 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js +2 -0
- package/node_modules/numeric-quantity/dist/cjs/numeric-quantity.cjs.production.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.iife.umd.min.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.d.ts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js +622 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.legacy-esm.js.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs +564 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.mjs.map +1 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.d.mts +293 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs +2 -0
- package/node_modules/numeric-quantity/dist/numeric-quantity.production.mjs.map +1 -0
- package/node_modules/numeric-quantity/package.json +72 -0
- package/node_modules/validator/LICENSE +20 -0
- package/node_modules/validator/README.md +269 -0
- package/node_modules/validator/es/index.js +218 -0
- package/node_modules/validator/es/lib/alpha.js +151 -0
- package/node_modules/validator/es/lib/blacklist.js +5 -0
- package/node_modules/validator/es/lib/contains.js +15 -0
- package/node_modules/validator/es/lib/equals.js +5 -0
- package/node_modules/validator/es/lib/escape.js +5 -0
- package/node_modules/validator/es/lib/isAbaRouting.js +15 -0
- package/node_modules/validator/es/lib/isAfter.js +10 -0
- package/node_modules/validator/es/lib/isAlpha.js +23 -0
- package/node_modules/validator/es/lib/isAlphanumeric.js +23 -0
- package/node_modules/validator/es/lib/isAscii.js +10 -0
- package/node_modules/validator/es/lib/isBIC.js +16 -0
- package/node_modules/validator/es/lib/isBase32.js +15 -0
- package/node_modules/validator/es/lib/isBase58.js +8 -0
- package/node_modules/validator/es/lib/isBase64.js +23 -0
- package/node_modules/validator/es/lib/isBefore.js +10 -0
- package/node_modules/validator/es/lib/isBoolean.js +15 -0
- package/node_modules/validator/es/lib/isBtcAddress.js +7 -0
- package/node_modules/validator/es/lib/isByteLength.js +19 -0
- package/node_modules/validator/es/lib/isCreditCard.js +43 -0
- package/node_modules/validator/es/lib/isCurrency.js +74 -0
- package/node_modules/validator/es/lib/isDataURI.js +31 -0
- package/node_modules/validator/es/lib/isDate.js +93 -0
- package/node_modules/validator/es/lib/isDecimal.js +22 -0
- package/node_modules/validator/es/lib/isDivisibleBy.js +6 -0
- package/node_modules/validator/es/lib/isEAN.js +70 -0
- package/node_modules/validator/es/lib/isEmail.js +165 -0
- package/node_modules/validator/es/lib/isEmpty.js +10 -0
- package/node_modules/validator/es/lib/isEthereumAddress.js +6 -0
- package/node_modules/validator/es/lib/isFQDN.js +67 -0
- package/node_modules/validator/es/lib/isFloat.js +14 -0
- package/node_modules/validator/es/lib/isFullWidth.js +6 -0
- package/node_modules/validator/es/lib/isHSL.js +13 -0
- package/node_modules/validator/es/lib/isHalfWidth.js +6 -0
- package/node_modules/validator/es/lib/isHash.js +21 -0
- package/node_modules/validator/es/lib/isHexColor.js +13 -0
- package/node_modules/validator/es/lib/isHexadecimal.js +6 -0
- package/node_modules/validator/es/lib/isIBAN.js +171 -0
- package/node_modules/validator/es/lib/isIMEI.js +40 -0
- package/node_modules/validator/es/lib/isIP.js +58 -0
- package/node_modules/validator/es/lib/isIPRange.js +41 -0
- package/node_modules/validator/es/lib/isISBN.js +47 -0
- package/node_modules/validator/es/lib/isISIN.js +55 -0
- package/node_modules/validator/es/lib/isISO15924.js +9 -0
- package/node_modules/validator/es/lib/isISO31661Alpha2.js +21 -0
- package/node_modules/validator/es/lib/isISO31661Alpha3.js +20 -0
- package/node_modules/validator/es/lib/isISO31661Numeric.js +8 -0
- package/node_modules/validator/es/lib/isISO4217.js +9 -0
- package/node_modules/validator/es/lib/isISO6346.js +28 -0
- package/node_modules/validator/es/lib/isISO6391.js +6 -0
- package/node_modules/validator/es/lib/isISO8601.js +42 -0
- package/node_modules/validator/es/lib/isISRC.js +8 -0
- package/node_modules/validator/es/lib/isISSN.js +19 -0
- package/node_modules/validator/es/lib/isIdentityCard.js +407 -0
- package/node_modules/validator/es/lib/isIn.js +23 -0
- package/node_modules/validator/es/lib/isInt.js +19 -0
- package/node_modules/validator/es/lib/isJSON.js +26 -0
- package/node_modules/validator/es/lib/isJWT.js +15 -0
- package/node_modules/validator/es/lib/isLatLong.js +21 -0
- package/node_modules/validator/es/lib/isLength.js +27 -0
- package/node_modules/validator/es/lib/isLicensePlate.js +58 -0
- package/node_modules/validator/es/lib/isLocale.js +107 -0
- package/node_modules/validator/es/lib/isLowercase.js +5 -0
- package/node_modules/validator/es/lib/isLuhnNumber.js +25 -0
- package/node_modules/validator/es/lib/isMACAddress.js +36 -0
- package/node_modules/validator/es/lib/isMD5.js +6 -0
- package/node_modules/validator/es/lib/isMagnetURI.js +9 -0
- package/node_modules/validator/es/lib/isMailtoURI.js +75 -0
- package/node_modules/validator/es/lib/isMimeType.js +40 -0
- package/node_modules/validator/es/lib/isMobilePhone.js +212 -0
- package/node_modules/validator/es/lib/isMongoId.js +6 -0
- package/node_modules/validator/es/lib/isMultibyte.js +10 -0
- package/node_modules/validator/es/lib/isNumeric.js +10 -0
- package/node_modules/validator/es/lib/isOctal.js +6 -0
- package/node_modules/validator/es/lib/isPassportNumber.js +145 -0
- package/node_modules/validator/es/lib/isPort.js +8 -0
- package/node_modules/validator/es/lib/isPostalCode.js +100 -0
- package/node_modules/validator/es/lib/isRFC3339.js +21 -0
- package/node_modules/validator/es/lib/isRgbColor.js +34 -0
- package/node_modules/validator/es/lib/isSemVer.js +14 -0
- package/node_modules/validator/es/lib/isSlug.js +6 -0
- package/node_modules/validator/es/lib/isStrongPassword.js +90 -0
- package/node_modules/validator/es/lib/isSurrogatePair.js +6 -0
- package/node_modules/validator/es/lib/isTaxID.js +1407 -0
- package/node_modules/validator/es/lib/isTime.js +22 -0
- package/node_modules/validator/es/lib/isULID.js +5 -0
- package/node_modules/validator/es/lib/isURL.js +241 -0
- package/node_modules/validator/es/lib/isUUID.js +23 -0
- package/node_modules/validator/es/lib/isUppercase.js +5 -0
- package/node_modules/validator/es/lib/isVAT.js +264 -0
- package/node_modules/validator/es/lib/isVariableWidth.js +7 -0
- package/node_modules/validator/es/lib/isWhitelisted.js +10 -0
- package/node_modules/validator/es/lib/ltrim.js +7 -0
- package/node_modules/validator/es/lib/matches.js +8 -0
- package/node_modules/validator/es/lib/normalizeEmail.js +131 -0
- package/node_modules/validator/es/lib/rtrim.js +15 -0
- package/node_modules/validator/es/lib/stripLow.js +7 -0
- package/node_modules/validator/es/lib/toBoolean.js +8 -0
- package/node_modules/validator/es/lib/toDate.js +6 -0
- package/node_modules/validator/es/lib/toFloat.js +5 -0
- package/node_modules/validator/es/lib/toInt.js +5 -0
- package/node_modules/validator/es/lib/trim.js +5 -0
- package/node_modules/validator/es/lib/unescape.js +8 -0
- package/node_modules/validator/es/lib/util/algorithms.js +79 -0
- package/node_modules/validator/es/lib/util/assertString.js +4 -0
- package/node_modules/validator/es/lib/util/checkHost.js +12 -0
- package/node_modules/validator/es/lib/util/includesArray.js +6 -0
- package/node_modules/validator/es/lib/util/includesString.js +4 -0
- package/node_modules/validator/es/lib/util/merge.js +14 -0
- package/node_modules/validator/es/lib/util/multilineRegex.js +12 -0
- package/node_modules/validator/es/lib/util/nullUndefinedCheck.js +3 -0
- package/node_modules/validator/es/lib/util/toString.js +13 -0
- package/node_modules/validator/es/lib/util/typeOf.js +10 -0
- package/node_modules/validator/es/lib/whitelist.js +5 -0
- package/node_modules/validator/index.js +229 -0
- package/node_modules/validator/lib/alpha.js +157 -0
- package/node_modules/validator/lib/blacklist.js +14 -0
- package/node_modules/validator/lib/contains.js +24 -0
- package/node_modules/validator/lib/equals.js +14 -0
- package/node_modules/validator/lib/escape.js +14 -0
- package/node_modules/validator/lib/isAbaRouting.js +23 -0
- package/node_modules/validator/lib/isAfter.js +19 -0
- package/node_modules/validator/lib/isAlpha.js +31 -0
- package/node_modules/validator/lib/isAlphanumeric.js +31 -0
- package/node_modules/validator/lib/isAscii.js +18 -0
- package/node_modules/validator/lib/isBIC.js +24 -0
- package/node_modules/validator/lib/isBase32.js +24 -0
- package/node_modules/validator/lib/isBase58.js +16 -0
- package/node_modules/validator/lib/isBase64.js +32 -0
- package/node_modules/validator/lib/isBefore.js +19 -0
- package/node_modules/validator/lib/isBoolean.js +24 -0
- package/node_modules/validator/lib/isBtcAddress.js +16 -0
- package/node_modules/validator/lib/isByteLength.js +27 -0
- package/node_modules/validator/lib/isCreditCard.js +52 -0
- package/node_modules/validator/lib/isCurrency.js +83 -0
- package/node_modules/validator/lib/isDataURI.js +40 -0
- package/node_modules/validator/lib/isDate.js +102 -0
- package/node_modules/validator/lib/isDecimal.js +31 -0
- package/node_modules/validator/lib/isDivisibleBy.js +15 -0
- package/node_modules/validator/lib/isEAN.js +78 -0
- package/node_modules/validator/lib/isEmail.js +174 -0
- package/node_modules/validator/lib/isEmpty.js +19 -0
- package/node_modules/validator/lib/isEthereumAddress.js +15 -0
- package/node_modules/validator/lib/isFQDN.js +76 -0
- package/node_modules/validator/lib/isFloat.js +22 -0
- package/node_modules/validator/lib/isFullWidth.js +14 -0
- package/node_modules/validator/lib/isHSL.js +22 -0
- package/node_modules/validator/lib/isHalfWidth.js +14 -0
- package/node_modules/validator/lib/isHash.js +30 -0
- package/node_modules/validator/lib/isHexColor.js +22 -0
- package/node_modules/validator/lib/isHexadecimal.js +15 -0
- package/node_modules/validator/lib/isIBAN.js +178 -0
- package/node_modules/validator/lib/isIMEI.js +49 -0
- package/node_modules/validator/lib/isIP.js +67 -0
- package/node_modules/validator/lib/isIPRange.js +50 -0
- package/node_modules/validator/lib/isISBN.js +56 -0
- package/node_modules/validator/lib/isISIN.js +64 -0
- package/node_modules/validator/lib/isISO15924.js +16 -0
- package/node_modules/validator/lib/isISO31661Alpha2.js +28 -0
- package/node_modules/validator/lib/isISO31661Alpha3.js +28 -0
- package/node_modules/validator/lib/isISO31661Numeric.js +16 -0
- package/node_modules/validator/lib/isISO4217.js +16 -0
- package/node_modules/validator/lib/isISO6346.js +35 -0
- package/node_modules/validator/lib/isISO6391.js +15 -0
- package/node_modules/validator/lib/isISO8601.js +50 -0
- package/node_modules/validator/lib/isISRC.js +16 -0
- package/node_modules/validator/lib/isISSN.js +28 -0
- package/node_modules/validator/lib/isIdentityCard.js +416 -0
- package/node_modules/validator/lib/isIn.js +32 -0
- package/node_modules/validator/lib/isInt.js +28 -0
- package/node_modules/validator/lib/isJSON.js +35 -0
- package/node_modules/validator/lib/isJWT.js +24 -0
- package/node_modules/validator/lib/isLatLong.js +30 -0
- package/node_modules/validator/lib/isLength.js +35 -0
- package/node_modules/validator/lib/isLicensePlate.js +67 -0
- package/node_modules/validator/lib/isLocale.js +115 -0
- package/node_modules/validator/lib/isLowercase.js +14 -0
- package/node_modules/validator/lib/isLuhnNumber.js +34 -0
- package/node_modules/validator/lib/isMACAddress.js +45 -0
- package/node_modules/validator/lib/isMD5.js +15 -0
- package/node_modules/validator/lib/isMagnetURI.js +18 -0
- package/node_modules/validator/lib/isMailtoURI.js +84 -0
- package/node_modules/validator/lib/isMimeType.js +48 -0
- package/node_modules/validator/lib/isMobilePhone.js +219 -0
- package/node_modules/validator/lib/isMongoId.js +15 -0
- package/node_modules/validator/lib/isMultibyte.js +18 -0
- package/node_modules/validator/lib/isNumeric.js +19 -0
- package/node_modules/validator/lib/isOctal.js +15 -0
- package/node_modules/validator/lib/isPassportNumber.js +152 -0
- package/node_modules/validator/lib/isPort.js +17 -0
- package/node_modules/validator/lib/isPostalCode.js +107 -0
- package/node_modules/validator/lib/isRFC3339.js +29 -0
- package/node_modules/validator/lib/isRgbColor.js +42 -0
- package/node_modules/validator/lib/isSemVer.js +22 -0
- package/node_modules/validator/lib/isSlug.js +15 -0
- package/node_modules/validator/lib/isStrongPassword.js +99 -0
- package/node_modules/validator/lib/isSurrogatePair.js +15 -0
- package/node_modules/validator/lib/isTaxID.js +1417 -0
- package/node_modules/validator/lib/isTime.js +31 -0
- package/node_modules/validator/lib/isULID.js +14 -0
- package/node_modules/validator/lib/isURL.js +249 -0
- package/node_modules/validator/lib/isUUID.js +32 -0
- package/node_modules/validator/lib/isUppercase.js +14 -0
- package/node_modules/validator/lib/isVAT.js +274 -0
- package/node_modules/validator/lib/isVariableWidth.js +16 -0
- package/node_modules/validator/lib/isWhitelisted.js +19 -0
- package/node_modules/validator/lib/ltrim.js +16 -0
- package/node_modules/validator/lib/matches.js +17 -0
- package/node_modules/validator/lib/normalizeEmail.js +140 -0
- package/node_modules/validator/lib/rtrim.js +24 -0
- package/node_modules/validator/lib/stripLow.js +16 -0
- package/node_modules/validator/lib/toBoolean.js +17 -0
- package/node_modules/validator/lib/toDate.js +15 -0
- package/node_modules/validator/lib/toFloat.js +14 -0
- package/node_modules/validator/lib/toInt.js +14 -0
- package/node_modules/validator/lib/trim.js +14 -0
- package/node_modules/validator/lib/unescape.js +17 -0
- package/node_modules/validator/lib/util/algorithms.js +88 -0
- package/node_modules/validator/lib/util/assertString.js +12 -0
- package/node_modules/validator/lib/util/checkHost.js +20 -0
- package/node_modules/validator/lib/util/includesArray.js +14 -0
- package/node_modules/validator/lib/util/includesString.js +12 -0
- package/node_modules/validator/lib/util/merge.js +22 -0
- package/node_modules/validator/lib/util/multilineRegex.js +20 -0
- package/node_modules/validator/lib/util/nullUndefinedCheck.js +11 -0
- package/node_modules/validator/lib/util/toString.js +21 -0
- package/node_modules/validator/lib/util/typeOf.js +18 -0
- package/node_modules/validator/lib/whitelist.js +14 -0
- package/node_modules/validator/package.json +76 -0
- package/node_modules/validator/validator.js +5808 -0
- package/node_modules/validator/validator.min.js +23 -0
- package/package.json +3 -3
|
@@ -0,0 +1,464 @@
|
|
|
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
|
+
|
|
6
|
+
import { space, text } from '~/themes/scale.stylex'
|
|
7
|
+
import { appearance, roles } from '~/themes/shared'
|
|
8
|
+
import { font } from '~/themes/tokens.stylex'
|
|
9
|
+
|
|
10
|
+
import { elapsedSeconds } from './calculations'
|
|
11
|
+
import { kowalskiCatalog, type KowalskiInput } from './catalog'
|
|
12
|
+
import { FeatureDateTime } from './date-time'
|
|
13
|
+
import { format } from './format'
|
|
14
|
+
import {
|
|
15
|
+
FeatureAction,
|
|
16
|
+
FeatureFrame,
|
|
17
|
+
FeatureProgress,
|
|
18
|
+
FeatureWell,
|
|
19
|
+
layout,
|
|
20
|
+
} from './frame'
|
|
21
|
+
import { useClock } from './use-clock'
|
|
22
|
+
import { useConfiguredFeature } from './use-configured-feature'
|
|
23
|
+
|
|
24
|
+
export function Timer(input: KowalskiInput<'timer'>) {
|
|
25
|
+
const props = kowalskiCatalog.timer.props.parse(input)
|
|
26
|
+
const schema = kowalskiCatalog.timer.storeSchema
|
|
27
|
+
const store = useConfiguredFeature({
|
|
28
|
+
name: props.id ?? 'KowalskiTimer',
|
|
29
|
+
revision: props.revision,
|
|
30
|
+
schema,
|
|
31
|
+
scope: props.scope,
|
|
32
|
+
seed: schema.parse({}),
|
|
33
|
+
})
|
|
34
|
+
const stopwatch = props.mode === 'stopwatch'
|
|
35
|
+
const complete =
|
|
36
|
+
!stopwatch && elapsedSeconds(store.value, Date.now()) >= props.durationSeconds
|
|
37
|
+
const now = useClock(store.value.startedAt !== null && !complete)
|
|
38
|
+
const elapsed = complete ? props.durationSeconds : elapsedSeconds(store.value, now)
|
|
39
|
+
const remaining = Math.max(0, props.durationSeconds - elapsed)
|
|
40
|
+
const running = store.value.startedAt !== null && !complete
|
|
41
|
+
const clockSeconds = stopwatch ? Math.floor(elapsed) : Math.ceil(remaining)
|
|
42
|
+
const showHours = (stopwatch ? clockSeconds : props.durationSeconds) >= 3600
|
|
43
|
+
// Older JavaScriptCore versions misplace separators when Intl hides zero hours.
|
|
44
|
+
const clockParts = format.formatDurationToParts(
|
|
45
|
+
Duration.fromObject({ seconds: clockSeconds })
|
|
46
|
+
.shiftTo('hours', 'minutes', 'seconds')
|
|
47
|
+
.toObject(),
|
|
48
|
+
{
|
|
49
|
+
hours: '2-digit',
|
|
50
|
+
hoursDisplay: 'always',
|
|
51
|
+
minutes: '2-digit',
|
|
52
|
+
minutesDisplay: 'always',
|
|
53
|
+
seconds: '2-digit',
|
|
54
|
+
secondsDisplay: 'always',
|
|
55
|
+
style: 'digital',
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
const clock = clockParts
|
|
59
|
+
.slice(showHours ? 0 : clockParts.findIndex(part => part.unit === 'minute'))
|
|
60
|
+
.map(part => part.value)
|
|
61
|
+
.join('')
|
|
62
|
+
const modeLabel =
|
|
63
|
+
props.mode === 'focus'
|
|
64
|
+
? 'Focus session'
|
|
65
|
+
: props.mode === 'break'
|
|
66
|
+
? 'Break time'
|
|
67
|
+
: stopwatch
|
|
68
|
+
? 'Stopwatch'
|
|
69
|
+
: 'Countdown timer'
|
|
70
|
+
const status = store.saving
|
|
71
|
+
? 'Saving…'
|
|
72
|
+
: !store.ready && !store.error
|
|
73
|
+
? 'Loading…'
|
|
74
|
+
: complete
|
|
75
|
+
? 'Complete'
|
|
76
|
+
: running
|
|
77
|
+
? 'Running'
|
|
78
|
+
: elapsed > 0
|
|
79
|
+
? 'Paused'
|
|
80
|
+
: 'Ready'
|
|
81
|
+
return (
|
|
82
|
+
<FeatureFrame
|
|
83
|
+
onRetry={store.retry}
|
|
84
|
+
notice={store.error}
|
|
85
|
+
component="timer"
|
|
86
|
+
title={props.title}
|
|
87
|
+
detail={modeLabel}
|
|
88
|
+
trailing={
|
|
89
|
+
<Text {...stylex.props(roles.muted, (running || complete) && appearance.accent)}>
|
|
90
|
+
{status}
|
|
91
|
+
</Text>
|
|
92
|
+
}
|
|
93
|
+
>
|
|
94
|
+
<FeatureWell style={timerStyles.clock}>
|
|
95
|
+
<Text
|
|
96
|
+
animated={running ? 'numeric' : undefined}
|
|
97
|
+
{...stylex.props(roles.display, timerStyles.digits(clock.length))}
|
|
98
|
+
>
|
|
99
|
+
{clock}
|
|
100
|
+
</Text>
|
|
101
|
+
<Text {...stylex.props(roles.muted)}>
|
|
102
|
+
{complete ? 'Time’s up' : stopwatch ? 'Time elapsed' : 'Time remaining'}
|
|
103
|
+
</Text>
|
|
104
|
+
{!stopwatch && (
|
|
105
|
+
<FeatureProgress component="timer" value={elapsed / props.durationSeconds} />
|
|
106
|
+
)}
|
|
107
|
+
</FeatureWell>
|
|
108
|
+
<Flex {...stylex.props(layout.actions)}>
|
|
109
|
+
<Flex {...stylex.props(timerStyles.primary)}>
|
|
110
|
+
<FeatureAction
|
|
111
|
+
component="timer"
|
|
112
|
+
icon={complete ? 'arrow.counterclockwise' : running ? 'pause' : 'play'}
|
|
113
|
+
variant="primary"
|
|
114
|
+
disabled={!store.ready}
|
|
115
|
+
onClick={() =>
|
|
116
|
+
store.set(current => {
|
|
117
|
+
const instant = Date.now()
|
|
118
|
+
if (complete) {
|
|
119
|
+
return { elapsedSeconds: 0, startedAt: instant }
|
|
120
|
+
}
|
|
121
|
+
const currentElapsed = elapsedSeconds(current, instant)
|
|
122
|
+
return current.startedAt === null
|
|
123
|
+
? { startedAt: instant }
|
|
124
|
+
: {
|
|
125
|
+
elapsedSeconds: stopwatch
|
|
126
|
+
? currentElapsed
|
|
127
|
+
: Math.min(props.durationSeconds, currentElapsed),
|
|
128
|
+
startedAt: null,
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
}
|
|
132
|
+
>
|
|
133
|
+
{complete
|
|
134
|
+
? 'Start again'
|
|
135
|
+
: running
|
|
136
|
+
? 'Pause'
|
|
137
|
+
: elapsed > 0
|
|
138
|
+
? 'Resume'
|
|
139
|
+
: 'Start'}
|
|
140
|
+
</FeatureAction>
|
|
141
|
+
</Flex>
|
|
142
|
+
<FeatureAction
|
|
143
|
+
component="timer"
|
|
144
|
+
variant="quiet"
|
|
145
|
+
disabled={!store.ready || (elapsed === 0 && store.value.startedAt === null)}
|
|
146
|
+
onClick={() => store.set(() => ({ elapsedSeconds: 0, startedAt: null }))}
|
|
147
|
+
>
|
|
148
|
+
Reset
|
|
149
|
+
</FeatureAction>
|
|
150
|
+
</Flex>
|
|
151
|
+
</FeatureFrame>
|
|
152
|
+
)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export function Countdown(input: KowalskiInput<'countdown'>) {
|
|
156
|
+
const props = kowalskiCatalog.countdown.props.parse(input)
|
|
157
|
+
const schema = kowalskiCatalog.countdown.storeSchema
|
|
158
|
+
const store = useConfiguredFeature({
|
|
159
|
+
name: props.id ?? 'KowalskiCountdown',
|
|
160
|
+
revision: props.revision,
|
|
161
|
+
schema,
|
|
162
|
+
scope: props.scope,
|
|
163
|
+
seed: schema.parse({ target: { value: props.target } }),
|
|
164
|
+
})
|
|
165
|
+
const now = useClock()
|
|
166
|
+
const target = store.value.target.value
|
|
167
|
+
? Date.parse(store.value.target.value)
|
|
168
|
+
: undefined
|
|
169
|
+
const seconds = target === undefined ? 0 : Math.max(0, Math.ceil((target - now) / 1000))
|
|
170
|
+
const units = [
|
|
171
|
+
{ label: 'day', value: Math.floor(seconds / 86_400) },
|
|
172
|
+
{ label: 'hour', value: Math.floor((seconds % 86_400) / 3600) },
|
|
173
|
+
{ label: 'minute', value: Math.floor((seconds % 3600) / 60) },
|
|
174
|
+
{ label: 'second', value: seconds % 60 },
|
|
175
|
+
]
|
|
176
|
+
const leadingIndex = seconds >= 86_400 ? 0 : seconds >= 3600 ? 1 : seconds >= 60 ? 2 : 3
|
|
177
|
+
const leading = units[leadingIndex]
|
|
178
|
+
const amount = format.formatNumber(leading.value)
|
|
179
|
+
return (
|
|
180
|
+
<FeatureFrame
|
|
181
|
+
onRetry={store.retry}
|
|
182
|
+
notice={store.error}
|
|
183
|
+
component="countdown"
|
|
184
|
+
title={props.title}
|
|
185
|
+
>
|
|
186
|
+
<FeatureWell style={countdownStyles.remaining}>
|
|
187
|
+
<Text
|
|
188
|
+
animated={seconds > 0 ? 'numeric' : undefined}
|
|
189
|
+
{...stylex.props(
|
|
190
|
+
roles.display,
|
|
191
|
+
countdownStyles.amount(amount.length),
|
|
192
|
+
seconds === 0 && countdownStyles.arrived
|
|
193
|
+
)}
|
|
194
|
+
>
|
|
195
|
+
{target === undefined ? '—' : seconds === 0 ? 'It’s time' : amount}
|
|
196
|
+
</Text>
|
|
197
|
+
<Text {...stylex.props(roles.muted)}>
|
|
198
|
+
{target === undefined
|
|
199
|
+
? 'Choose a target below'
|
|
200
|
+
: seconds === 0
|
|
201
|
+
? 'Your countdown has arrived'
|
|
202
|
+
: `${format.formatNumberToParts(leading.value, { style: 'unit', unit: leading.label, unitDisplay: 'long' }).find(part => part.type === 'unit')?.value} to go`}
|
|
203
|
+
</Text>
|
|
204
|
+
{seconds > 0 && leadingIndex < 3 && (
|
|
205
|
+
<Flex {...stylex.props(countdownStyles.units)}>
|
|
206
|
+
{units.slice(leadingIndex + 1).map(unit => (
|
|
207
|
+
<Flex key={unit.label} {...stylex.props(countdownStyles.unit)}>
|
|
208
|
+
<Text animated="numeric" {...stylex.props(roles.strong)}>
|
|
209
|
+
{format.formatNumber(unit.value)}
|
|
210
|
+
</Text>
|
|
211
|
+
<Text {...stylex.props(roles.muted)}>
|
|
212
|
+
{
|
|
213
|
+
format
|
|
214
|
+
.formatNumberToParts(unit.value, {
|
|
215
|
+
style: 'unit',
|
|
216
|
+
unit: unit.label,
|
|
217
|
+
unitDisplay: 'long',
|
|
218
|
+
})
|
|
219
|
+
.find(part => part.type === 'unit')?.value
|
|
220
|
+
}
|
|
221
|
+
</Text>
|
|
222
|
+
</Flex>
|
|
223
|
+
))}
|
|
224
|
+
</Flex>
|
|
225
|
+
)}
|
|
226
|
+
</FeatureWell>
|
|
227
|
+
<FeatureDateTime
|
|
228
|
+
component="countdown"
|
|
229
|
+
label="Target date & time"
|
|
230
|
+
ready={store.ready}
|
|
231
|
+
saving={store.saving}
|
|
232
|
+
timeZone={props.timeZone}
|
|
233
|
+
value={store.value.target.value || null}
|
|
234
|
+
onChange={(target, onSaved) =>
|
|
235
|
+
target === null
|
|
236
|
+
? false
|
|
237
|
+
: store.set(() => ({ target: { value: target } }), onSaved)
|
|
238
|
+
}
|
|
239
|
+
/>
|
|
240
|
+
</FeatureFrame>
|
|
241
|
+
)
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function TimeZone(input: KowalskiInput<'timeZone'>) {
|
|
245
|
+
const props = kowalskiCatalog.timeZone.props.parse(input)
|
|
246
|
+
const schema = kowalskiCatalog.timeZone.storeSchema
|
|
247
|
+
const store = useConfiguredFeature({
|
|
248
|
+
name: props.id ?? 'KowalskiTimeZone',
|
|
249
|
+
revision: props.revision,
|
|
250
|
+
schema,
|
|
251
|
+
scope: props.scope,
|
|
252
|
+
seed: schema.parse({ at: { value: props.at } }),
|
|
253
|
+
})
|
|
254
|
+
const [editing, setEditing] = useState(false)
|
|
255
|
+
const live = store.value.at.value === null
|
|
256
|
+
const now = useClock(live)
|
|
257
|
+
const instant = store.value.at.value ? Date.parse(store.value.at.value) : now
|
|
258
|
+
const referenceZone = props.zones[0]
|
|
259
|
+
const referenceCity = referenceZone.split('/').at(-1)?.replaceAll('_', ' ')
|
|
260
|
+
const reference = DateTime.fromMillis(instant, { locale: 'en', zone: referenceZone })
|
|
261
|
+
const referenceDate = DateTime.utc(reference.year, reference.month, reference.day)
|
|
262
|
+
return (
|
|
263
|
+
<FeatureFrame
|
|
264
|
+
onRetry={store.retry}
|
|
265
|
+
notice={store.error}
|
|
266
|
+
component="timeZone"
|
|
267
|
+
title={props.title}
|
|
268
|
+
detail={`Times relative to ${referenceCity}`}
|
|
269
|
+
trailing={
|
|
270
|
+
<Text {...stylex.props(roles.muted, live && appearance.accent)}>
|
|
271
|
+
{store.saving
|
|
272
|
+
? 'Saving…'
|
|
273
|
+
: !store.ready && !store.error
|
|
274
|
+
? 'Loading…'
|
|
275
|
+
: live
|
|
276
|
+
? 'Live'
|
|
277
|
+
: 'Fixed time'}
|
|
278
|
+
</Text>
|
|
279
|
+
}
|
|
280
|
+
>
|
|
281
|
+
<Flex {...stylex.props(timeZoneStyles.clocks)}>
|
|
282
|
+
{props.zones.map((zone, index) => {
|
|
283
|
+
const local = reference.setZone(zone)
|
|
284
|
+
const days = DateTime.utc(local.year, local.month, local.day).diff(
|
|
285
|
+
referenceDate,
|
|
286
|
+
'days'
|
|
287
|
+
).days
|
|
288
|
+
const minutes = local.offset - reference.offset
|
|
289
|
+
const difference = format.formatDuration(
|
|
290
|
+
Duration.fromObject({ minutes: Math.abs(minutes) })
|
|
291
|
+
.shiftTo('hours', 'minutes', 'seconds')
|
|
292
|
+
.toObject(),
|
|
293
|
+
{ style: 'long' }
|
|
294
|
+
)
|
|
295
|
+
const clockParts = format.formatTimeToParts(instant, {
|
|
296
|
+
fractionalSecondDigits: !live && local.millisecond !== 0 ? 3 : undefined,
|
|
297
|
+
hour: 'numeric',
|
|
298
|
+
hour12: true,
|
|
299
|
+
minute: '2-digit',
|
|
300
|
+
second:
|
|
301
|
+
!live && (local.second !== 0 || local.millisecond !== 0)
|
|
302
|
+
? '2-digit'
|
|
303
|
+
: undefined,
|
|
304
|
+
timeZone: zone,
|
|
305
|
+
})
|
|
306
|
+
const clock = clockParts
|
|
307
|
+
.filter(part => part.type !== 'dayPeriod')
|
|
308
|
+
.map(part => part.value)
|
|
309
|
+
.join('')
|
|
310
|
+
.trim()
|
|
311
|
+
return (
|
|
312
|
+
<FeatureWell key={`${zone}:${index}`}>
|
|
313
|
+
<Flex {...stylex.props(timeZoneStyles.zoneRow)}>
|
|
314
|
+
<Flex {...stylex.props(timeZoneStyles.city)}>
|
|
315
|
+
<Text {...stylex.props(roles.h2)}>
|
|
316
|
+
{zone.split('/').at(-1)?.replaceAll('_', ' ')}
|
|
317
|
+
</Text>
|
|
318
|
+
<Text {...stylex.props(roles.muted)}>
|
|
319
|
+
{index === 0
|
|
320
|
+
? 'Reference'
|
|
321
|
+
: minutes === 0
|
|
322
|
+
? 'Same time'
|
|
323
|
+
: `${difference} ${minutes > 0 ? 'ahead' : 'behind'}`}
|
|
324
|
+
</Text>
|
|
325
|
+
{days !== 0 && (
|
|
326
|
+
<Text {...stylex.props(roles.muted, appearance.accent)}>
|
|
327
|
+
{days === 1
|
|
328
|
+
? 'Next day'
|
|
329
|
+
: days === -1
|
|
330
|
+
? 'Previous day'
|
|
331
|
+
: `${format.formatNumber(Math.abs(days))} days ${days > 0 ? 'ahead' : 'behind'}`}
|
|
332
|
+
</Text>
|
|
333
|
+
)}
|
|
334
|
+
</Flex>
|
|
335
|
+
<Flex {...stylex.props(timeZoneStyles.local)}>
|
|
336
|
+
<Flex {...stylex.props(timeZoneStyles.time)}>
|
|
337
|
+
<Text
|
|
338
|
+
animated={live ? 'numeric' : undefined}
|
|
339
|
+
{...stylex.props(
|
|
340
|
+
roles.display,
|
|
341
|
+
timeZoneStyles.digits(clock.length)
|
|
342
|
+
)}
|
|
343
|
+
>
|
|
344
|
+
{clock}
|
|
345
|
+
</Text>
|
|
346
|
+
<Text {...stylex.props(roles.muted, timeZoneStyles.period)}>
|
|
347
|
+
{clockParts.find(part => part.type === 'dayPeriod')?.value}
|
|
348
|
+
</Text>
|
|
349
|
+
</Flex>
|
|
350
|
+
<Text {...stylex.props(roles.muted)}>
|
|
351
|
+
{format.formatDate(instant, {
|
|
352
|
+
day: 'numeric',
|
|
353
|
+
...(local.year <= 0 ? { era: 'short', year: 'numeric' } : {}),
|
|
354
|
+
month: 'short',
|
|
355
|
+
weekday: 'short',
|
|
356
|
+
timeZone: zone,
|
|
357
|
+
})}
|
|
358
|
+
</Text>
|
|
359
|
+
</Flex>
|
|
360
|
+
</Flex>
|
|
361
|
+
</FeatureWell>
|
|
362
|
+
)
|
|
363
|
+
})}
|
|
364
|
+
</Flex>
|
|
365
|
+
<FeatureDateTime
|
|
366
|
+
actionLabel="Compare another time"
|
|
367
|
+
compact
|
|
368
|
+
component="timeZone"
|
|
369
|
+
label={`Comparison time · ${referenceCity}`}
|
|
370
|
+
ready={store.ready}
|
|
371
|
+
saving={store.saving}
|
|
372
|
+
submitLabel="Compare this time"
|
|
373
|
+
timeZone={referenceZone}
|
|
374
|
+
value={store.value.at.value}
|
|
375
|
+
onChange={(at, onSaved) => store.set(() => ({ at: { value: at } }), onSaved)}
|
|
376
|
+
onEditingChange={setEditing}
|
|
377
|
+
/>
|
|
378
|
+
{!live && (
|
|
379
|
+
<FeatureAction
|
|
380
|
+
component="timeZone"
|
|
381
|
+
icon="clock"
|
|
382
|
+
disabled={!store.ready || store.saving || editing}
|
|
383
|
+
onClick={() => store.set(() => ({ at: { value: null } }))}
|
|
384
|
+
>
|
|
385
|
+
Return to live
|
|
386
|
+
</FeatureAction>
|
|
387
|
+
)}
|
|
388
|
+
{!live && editing && !store.saving && (
|
|
389
|
+
<Text {...stylex.props(roles.muted)}>
|
|
390
|
+
Save or cancel your comparison before returning to live.
|
|
391
|
+
</Text>
|
|
392
|
+
)}
|
|
393
|
+
</FeatureFrame>
|
|
394
|
+
)
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
// Long readings step down the display scale so they never overflow their well.
|
|
398
|
+
const timeZoneStyles = stylex.create({
|
|
399
|
+
city: { flexBasis: space[24], flexGrow: 1, gap: space[1], minWidth: 0 },
|
|
400
|
+
clocks: { gap: space[2] },
|
|
401
|
+
digits: (length: number) => ({
|
|
402
|
+
fontSize: length > 8 ? text['2xl'] : length > 5 ? text['3xl'] : text['4xl'],
|
|
403
|
+
lineHeight:
|
|
404
|
+
length > 8
|
|
405
|
+
? text['2xlLeading']
|
|
406
|
+
: length > 5
|
|
407
|
+
? text['3xlLeading']
|
|
408
|
+
: text['4xlLeading'],
|
|
409
|
+
}),
|
|
410
|
+
local: { alignItems: 'flex-end', flexGrow: 1, gap: space[1], textAlign: 'right' },
|
|
411
|
+
period: { marginBottom: space[1] },
|
|
412
|
+
time: { alignItems: 'flex-end', flexDirection: 'row', gap: space[1.5] },
|
|
413
|
+
zoneRow: {
|
|
414
|
+
alignItems: 'center',
|
|
415
|
+
flexDirection: 'row',
|
|
416
|
+
flexWrap: 'wrap',
|
|
417
|
+
gap: space[3],
|
|
418
|
+
},
|
|
419
|
+
})
|
|
420
|
+
|
|
421
|
+
const timerStyles = stylex.create({
|
|
422
|
+
clock: { alignItems: 'stretch', gap: space[3], textAlign: 'center' },
|
|
423
|
+
digits: (length: number) => ({
|
|
424
|
+
fontSize:
|
|
425
|
+
length > 11
|
|
426
|
+
? text['3xl']
|
|
427
|
+
: length > 8
|
|
428
|
+
? text['4xl']
|
|
429
|
+
: length > 5
|
|
430
|
+
? text['5xl']
|
|
431
|
+
: font.displaySize,
|
|
432
|
+
lineHeight:
|
|
433
|
+
length > 11
|
|
434
|
+
? text['3xlLeading']
|
|
435
|
+
: length > 8
|
|
436
|
+
? text['4xlLeading']
|
|
437
|
+
: length > 5
|
|
438
|
+
? text['5xlLeading']
|
|
439
|
+
: font.displayLeading,
|
|
440
|
+
}),
|
|
441
|
+
primary: { flexBasis: 0, flexGrow: 1, minWidth: 0 },
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
const countdownStyles = stylex.create({
|
|
445
|
+
amount: (length: number) => ({
|
|
446
|
+
fontSize: length > 6 ? text['4xl'] : length > 4 ? text['6xl'] : font.displaySize,
|
|
447
|
+
lineHeight:
|
|
448
|
+
length > 6
|
|
449
|
+
? text['4xlLeading']
|
|
450
|
+
: length > 4
|
|
451
|
+
? text['6xlLeading']
|
|
452
|
+
: font.displayLeading,
|
|
453
|
+
}),
|
|
454
|
+
arrived: { fontSize: text['4xl'], lineHeight: text['4xlLeading'] },
|
|
455
|
+
remaining: { alignItems: 'stretch', gap: space[2], textAlign: 'center' },
|
|
456
|
+
unit: { alignItems: 'baseline', flexDirection: 'row', gap: space[1] },
|
|
457
|
+
units: {
|
|
458
|
+
columnGap: space[3],
|
|
459
|
+
flexDirection: 'row',
|
|
460
|
+
flexWrap: 'wrap',
|
|
461
|
+
justifyContent: 'center',
|
|
462
|
+
rowGap: space[1],
|
|
463
|
+
},
|
|
464
|
+
})
|