@flickfyi/flkr 0.0.141 → 0.0.146
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 +502 -95
- 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 +10 -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,462 @@
|
|
|
1
|
+
// @vitest-environment happy-dom
|
|
2
|
+
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
|
5
|
+
|
|
6
|
+
import { FeatureDate, FeatureDateTime } from '~/kowalski/date-time'
|
|
7
|
+
|
|
8
|
+
vi.mock('@stylexjs/stylex', () => ({
|
|
9
|
+
create: <T,>(styles: T) => styles,
|
|
10
|
+
defineVars: <T,>(vars: T) => vars,
|
|
11
|
+
props: () => ({}),
|
|
12
|
+
}))
|
|
13
|
+
|
|
14
|
+
vi.mock('@flickfyi/photon', async () => {
|
|
15
|
+
const { Children, createElement, isValidElement } = await import('react')
|
|
16
|
+
const Host = ({ children }: React.PropsWithChildren) =>
|
|
17
|
+
createElement('div', {}, children)
|
|
18
|
+
return {
|
|
19
|
+
Button: ({
|
|
20
|
+
children,
|
|
21
|
+
disabled,
|
|
22
|
+
onClick,
|
|
23
|
+
}: React.PropsWithChildren<{
|
|
24
|
+
disabled?: boolean
|
|
25
|
+
onClick?: () => void
|
|
26
|
+
}>) => createElement('button', { disabled, onClick }, children),
|
|
27
|
+
Flex: Host,
|
|
28
|
+
Icon: () => null,
|
|
29
|
+
Input: ({
|
|
30
|
+
onChange,
|
|
31
|
+
placeholder,
|
|
32
|
+
value,
|
|
33
|
+
}: {
|
|
34
|
+
onChange: (value: string) => void
|
|
35
|
+
placeholder: string
|
|
36
|
+
value: string
|
|
37
|
+
}) =>
|
|
38
|
+
createElement('input', {
|
|
39
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) =>
|
|
40
|
+
onChange(event.target.value),
|
|
41
|
+
placeholder,
|
|
42
|
+
value,
|
|
43
|
+
}),
|
|
44
|
+
Picker: ({
|
|
45
|
+
children,
|
|
46
|
+
label,
|
|
47
|
+
onChange,
|
|
48
|
+
value,
|
|
49
|
+
}: React.PropsWithChildren<{
|
|
50
|
+
label: string
|
|
51
|
+
onChange: (value: string) => void
|
|
52
|
+
value: string
|
|
53
|
+
}>) =>
|
|
54
|
+
createElement(
|
|
55
|
+
'select',
|
|
56
|
+
{
|
|
57
|
+
'aria-label': label,
|
|
58
|
+
onChange: (event: React.ChangeEvent<HTMLSelectElement>) =>
|
|
59
|
+
onChange(event.target.value),
|
|
60
|
+
value,
|
|
61
|
+
},
|
|
62
|
+
Children.map(children, child =>
|
|
63
|
+
isValidElement<{ value: string }>(child)
|
|
64
|
+
? createElement('option', { value: child.props.value }, child.props.value)
|
|
65
|
+
: null
|
|
66
|
+
)
|
|
67
|
+
),
|
|
68
|
+
Text: Host,
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
beforeEach(() => vi.stubGlobal('_CRAYONCORE_$REACT', React))
|
|
73
|
+
afterEach(() => {
|
|
74
|
+
cleanup()
|
|
75
|
+
vi.unstubAllGlobals()
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
it('edits the requested timezone and only publishes an ISO instant on Save', () => {
|
|
79
|
+
const onChange = vi.fn()
|
|
80
|
+
render(
|
|
81
|
+
<FeatureDateTime
|
|
82
|
+
component="countdown"
|
|
83
|
+
label="Target"
|
|
84
|
+
onChange={onChange}
|
|
85
|
+
ready
|
|
86
|
+
timeZone="Asia/Kolkata"
|
|
87
|
+
value="2026-12-31T20:00:00Z"
|
|
88
|
+
/>
|
|
89
|
+
)
|
|
90
|
+
expect(screen.getByText('Fri, January 1, 2027')).toBeTruthy()
|
|
91
|
+
expect(screen.queryByRole('textbox')).toBeNull()
|
|
92
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
93
|
+
expect(screen.getByPlaceholderText<HTMLInputElement>('h:mm AM/PM').value).toBe(
|
|
94
|
+
'1:30 AM'
|
|
95
|
+
)
|
|
96
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
97
|
+
target: { value: '01/02/2027' },
|
|
98
|
+
})
|
|
99
|
+
fireEvent.change(screen.getByPlaceholderText('h:mm AM/PM'), {
|
|
100
|
+
target: { value: '3:45 PM' },
|
|
101
|
+
})
|
|
102
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
103
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
104
|
+
expect(onChange).toHaveBeenCalledWith('2027-01-02T10:15:00.000Z')
|
|
105
|
+
})
|
|
106
|
+
|
|
107
|
+
it('rejects a nonexistent daylight-saving wall time without shifting the date', () => {
|
|
108
|
+
const onChange = vi.fn()
|
|
109
|
+
render(
|
|
110
|
+
<FeatureDateTime
|
|
111
|
+
component="countdown"
|
|
112
|
+
label="Target"
|
|
113
|
+
onChange={onChange}
|
|
114
|
+
ready
|
|
115
|
+
timeZone="America/Los_Angeles"
|
|
116
|
+
value="2027-03-14T09:30:00Z"
|
|
117
|
+
/>
|
|
118
|
+
)
|
|
119
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
120
|
+
fireEvent.change(screen.getByPlaceholderText('h:mm AM/PM'), {
|
|
121
|
+
target: { value: '2:30 AM' },
|
|
122
|
+
})
|
|
123
|
+
expect(
|
|
124
|
+
screen.getByText('This time is skipped when the clocks change. Choose another time.')
|
|
125
|
+
).toBeTruthy()
|
|
126
|
+
expect(
|
|
127
|
+
screen.getByRole<HTMLButtonElement>('button', { name: 'Save date' }).disabled
|
|
128
|
+
).toBe(true)
|
|
129
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
130
|
+
fireEvent.change(screen.getByPlaceholderText('h:mm AM/PM'), {
|
|
131
|
+
target: { value: '3:30 AM' },
|
|
132
|
+
})
|
|
133
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
134
|
+
expect(onChange).toHaveBeenCalledWith('2027-03-14T10:30:00.000Z')
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
it('retains the second repeated hour and lets the user explicitly choose the first', () => {
|
|
138
|
+
const onChange = vi.fn()
|
|
139
|
+
render(
|
|
140
|
+
<FeatureDateTime
|
|
141
|
+
component="countdown"
|
|
142
|
+
label="Target"
|
|
143
|
+
onChange={onChange}
|
|
144
|
+
ready
|
|
145
|
+
timeZone="America/Los_Angeles"
|
|
146
|
+
value="2026-11-01T09:30:00Z"
|
|
147
|
+
/>
|
|
148
|
+
)
|
|
149
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
150
|
+
const occurrence = screen.getByRole<HTMLSelectElement>('combobox', {
|
|
151
|
+
name: 'Occurrence',
|
|
152
|
+
})
|
|
153
|
+
expect(occurrence.value).toContain('Second')
|
|
154
|
+
fireEvent.change(screen.getByPlaceholderText('h:mm AM/PM'), {
|
|
155
|
+
target: { value: '1:31 AM' },
|
|
156
|
+
})
|
|
157
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
158
|
+
expect(onChange).toHaveBeenLastCalledWith('2026-11-01T09:31:00.000Z')
|
|
159
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
160
|
+
const choice = screen.getByRole<HTMLSelectElement>('combobox', { name: 'Occurrence' })
|
|
161
|
+
fireEvent.change(choice, { target: { value: choice.options[0].value } })
|
|
162
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
163
|
+
expect(onChange).toHaveBeenLastCalledWith('2026-11-01T08:30:00.000Z')
|
|
164
|
+
})
|
|
165
|
+
|
|
166
|
+
it('preserves the exact stored instant when saved unchanged and discards cancelled drafts', () => {
|
|
167
|
+
const onChange = vi.fn()
|
|
168
|
+
const value = '2026-11-01T01:30:42-08:00'
|
|
169
|
+
render(
|
|
170
|
+
<FeatureDateTime
|
|
171
|
+
component="countdown"
|
|
172
|
+
label="Target"
|
|
173
|
+
onChange={onChange}
|
|
174
|
+
ready
|
|
175
|
+
timeZone="America/Los_Angeles"
|
|
176
|
+
value={value}
|
|
177
|
+
/>
|
|
178
|
+
)
|
|
179
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
180
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
181
|
+
expect(onChange).toHaveBeenCalledExactlyOnceWith(value)
|
|
182
|
+
onChange.mockClear()
|
|
183
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
184
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
185
|
+
target: { value: '12/05/2026' },
|
|
186
|
+
})
|
|
187
|
+
fireEvent.click(screen.getByRole('button', { name: 'Cancel' }))
|
|
188
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
189
|
+
expect(screen.queryByRole('combobox')).toBeNull()
|
|
190
|
+
expect(screen.queryByText(value)).toBeNull()
|
|
191
|
+
})
|
|
192
|
+
|
|
193
|
+
it.each([
|
|
194
|
+
['2027-01-31', '2027-02-28'],
|
|
195
|
+
['2028-01-31', '2028-02-29'],
|
|
196
|
+
])('edits %s as a calendar date without timezone drift', (value, expected) => {
|
|
197
|
+
const onChange = vi.fn()
|
|
198
|
+
render(
|
|
199
|
+
<FeatureDate
|
|
200
|
+
component="trip"
|
|
201
|
+
label="Departure"
|
|
202
|
+
onChange={onChange}
|
|
203
|
+
ready
|
|
204
|
+
value={value}
|
|
205
|
+
/>
|
|
206
|
+
)
|
|
207
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date' }))
|
|
208
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
209
|
+
target: {
|
|
210
|
+
value: `${expected.slice(5, 7)}/${expected.slice(8, 10)}/${expected.slice(0, 4)}`,
|
|
211
|
+
},
|
|
212
|
+
})
|
|
213
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
214
|
+
expect(onChange).toHaveBeenCalledWith(expected)
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
it('gates editing on store readiness and only removes explicitly clearable dates', () => {
|
|
218
|
+
const onChange = vi.fn()
|
|
219
|
+
const view = render(
|
|
220
|
+
<FeatureDate
|
|
221
|
+
component="trip"
|
|
222
|
+
label="Departure"
|
|
223
|
+
onChange={onChange}
|
|
224
|
+
ready={false}
|
|
225
|
+
value="2027-01-01"
|
|
226
|
+
/>
|
|
227
|
+
)
|
|
228
|
+
expect(
|
|
229
|
+
screen.getByRole<HTMLButtonElement>('button', { name: 'Change date' }).disabled
|
|
230
|
+
).toBe(true)
|
|
231
|
+
view.rerender(
|
|
232
|
+
<FeatureDate
|
|
233
|
+
clearable
|
|
234
|
+
component="trip"
|
|
235
|
+
label="Departure"
|
|
236
|
+
onChange={onChange}
|
|
237
|
+
ready
|
|
238
|
+
value="2027-01-01"
|
|
239
|
+
/>
|
|
240
|
+
)
|
|
241
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date' }))
|
|
242
|
+
fireEvent.click(screen.getByRole('button', { name: 'Remove date' }))
|
|
243
|
+
expect(onChange).toHaveBeenCalledWith(null)
|
|
244
|
+
})
|
|
245
|
+
|
|
246
|
+
it('keeps a rejected date draft open so related fields can be corrected', () => {
|
|
247
|
+
const onChange = vi.fn(() => false)
|
|
248
|
+
render(
|
|
249
|
+
<FeatureDate
|
|
250
|
+
component="trip"
|
|
251
|
+
label="Departure"
|
|
252
|
+
onChange={onChange}
|
|
253
|
+
ready
|
|
254
|
+
value="2027-01-01"
|
|
255
|
+
/>
|
|
256
|
+
)
|
|
257
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date' }))
|
|
258
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
259
|
+
target: { value: '01/02/2027' },
|
|
260
|
+
})
|
|
261
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
262
|
+
expect(onChange).toHaveBeenCalledWith('2027-01-02')
|
|
263
|
+
expect(screen.getByPlaceholderText<HTMLInputElement>('MM/DD/YYYY').value).toBe(
|
|
264
|
+
'01/02/2027'
|
|
265
|
+
)
|
|
266
|
+
})
|
|
267
|
+
|
|
268
|
+
it('keeps precise seconds while changing a calendar date and reports staged editing', () => {
|
|
269
|
+
const onChange = vi.fn()
|
|
270
|
+
const onEditingChange = vi.fn()
|
|
271
|
+
const view = render(
|
|
272
|
+
<FeatureDateTime
|
|
273
|
+
component="event"
|
|
274
|
+
label="Starts"
|
|
275
|
+
ready
|
|
276
|
+
timeZone="America/Los_Angeles"
|
|
277
|
+
value="2026-11-05T18:30:42.125-08:00"
|
|
278
|
+
onChange={onChange}
|
|
279
|
+
onEditingChange={onEditingChange}
|
|
280
|
+
submitLabel="Apply date & time"
|
|
281
|
+
/>
|
|
282
|
+
)
|
|
283
|
+
expect(screen.getByText('6:30:42.125 PM PST')).toBeTruthy()
|
|
284
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
285
|
+
expect(onEditingChange).toHaveBeenLastCalledWith(true)
|
|
286
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
287
|
+
target: { value: '12/05/2026' },
|
|
288
|
+
})
|
|
289
|
+
fireEvent.click(screen.getByRole('button', { name: 'Apply date & time' }))
|
|
290
|
+
expect(onChange).toHaveBeenCalledWith('2026-12-06T02:30:42.125Z')
|
|
291
|
+
expect(onEditingChange).toHaveBeenLastCalledWith(false)
|
|
292
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
293
|
+
view.unmount()
|
|
294
|
+
expect(onEditingChange).toHaveBeenLastCalledWith(false)
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
it('retains a live calendar draft across optimistic updates and rejection until acknowledgement', () => {
|
|
298
|
+
let settle: ((accepted: boolean) => void) | undefined
|
|
299
|
+
function LiveCalendar() {
|
|
300
|
+
const original = '2027-01-01T08:00:42.125Z'
|
|
301
|
+
const [value, setValue] = React.useState(original)
|
|
302
|
+
const [saving, setSaving] = React.useState(false)
|
|
303
|
+
return (
|
|
304
|
+
<FeatureDateTime
|
|
305
|
+
component="countdown"
|
|
306
|
+
label="Target"
|
|
307
|
+
ready
|
|
308
|
+
saving={saving}
|
|
309
|
+
timeZone="America/Los_Angeles"
|
|
310
|
+
value={value}
|
|
311
|
+
onChange={(next, onSaved) => {
|
|
312
|
+
if (!next) {
|
|
313
|
+
return false
|
|
314
|
+
}
|
|
315
|
+
setValue(next)
|
|
316
|
+
setSaving(true)
|
|
317
|
+
settle = accepted => {
|
|
318
|
+
setSaving(false)
|
|
319
|
+
if (accepted) {
|
|
320
|
+
onSaved?.()
|
|
321
|
+
} else {
|
|
322
|
+
setValue(original)
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
return true
|
|
326
|
+
}}
|
|
327
|
+
/>
|
|
328
|
+
)
|
|
329
|
+
}
|
|
330
|
+
render(<LiveCalendar />)
|
|
331
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
332
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
333
|
+
target: { value: '02/01/2027' },
|
|
334
|
+
})
|
|
335
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
336
|
+
expect(screen.getByText('Saving date…')).toBeTruthy()
|
|
337
|
+
expect(screen.queryByRole('combobox')).toBeNull()
|
|
338
|
+
expect(screen.queryByRole('button', { name: 'Cancel' })).toBeNull()
|
|
339
|
+
act(() => settle?.(false))
|
|
340
|
+
expect(screen.getByPlaceholderText<HTMLInputElement>('MM/DD/YYYY').value).toBe(
|
|
341
|
+
'02/01/2027'
|
|
342
|
+
)
|
|
343
|
+
expect(screen.getByPlaceholderText<HTMLInputElement>('h:mm AM/PM').value).toBe(
|
|
344
|
+
'12:00:42.125 AM'
|
|
345
|
+
)
|
|
346
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
347
|
+
act(() => settle?.(true))
|
|
348
|
+
expect(screen.queryByRole('combobox')).toBeNull()
|
|
349
|
+
expect(screen.getByText('Mon, February 1, 2027')).toBeTruthy()
|
|
350
|
+
})
|
|
351
|
+
|
|
352
|
+
it('identifies the BC era for astronomical year zero', () => {
|
|
353
|
+
render(
|
|
354
|
+
<FeatureDate
|
|
355
|
+
component="trip"
|
|
356
|
+
label="Departure"
|
|
357
|
+
ready
|
|
358
|
+
value="0000-01-01"
|
|
359
|
+
onChange={() => {}}
|
|
360
|
+
/>
|
|
361
|
+
)
|
|
362
|
+
expect(screen.getByText('Sat, January 1, 1 BC')).toBeTruthy()
|
|
363
|
+
})
|
|
364
|
+
|
|
365
|
+
it('restores the parent calendar editing guard when an Activity becomes visible again', async () => {
|
|
366
|
+
function Form({ mode }: { mode: 'hidden' | 'visible' }) {
|
|
367
|
+
const [editing, setEditing] = React.useState(false)
|
|
368
|
+
return (
|
|
369
|
+
<>
|
|
370
|
+
<button disabled={editing}>Outer save</button>
|
|
371
|
+
<React.Activity mode={mode}>
|
|
372
|
+
<FeatureDate
|
|
373
|
+
component="trip"
|
|
374
|
+
label="Departure"
|
|
375
|
+
ready
|
|
376
|
+
value="2027-01-01"
|
|
377
|
+
onChange={() => {}}
|
|
378
|
+
onEditingChange={setEditing}
|
|
379
|
+
/>
|
|
380
|
+
</React.Activity>
|
|
381
|
+
</>
|
|
382
|
+
)
|
|
383
|
+
}
|
|
384
|
+
const view = render(<Form mode="visible" />)
|
|
385
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date' }))
|
|
386
|
+
expect(
|
|
387
|
+
screen.getByRole<HTMLButtonElement>('button', { name: 'Outer save' }).disabled
|
|
388
|
+
).toBe(true)
|
|
389
|
+
view.rerender(<Form mode="hidden" />)
|
|
390
|
+
view.rerender(<Form mode="visible" />)
|
|
391
|
+
expect(
|
|
392
|
+
screen.getByRole<HTMLButtonElement>('button', { name: 'Outer save' }).disabled
|
|
393
|
+
).toBe(true)
|
|
394
|
+
})
|
|
395
|
+
|
|
396
|
+
it('keeps invalid inline drafts out of the parent and uses one outer save', () => {
|
|
397
|
+
const onChange = vi.fn()
|
|
398
|
+
const onEditingChange = vi.fn()
|
|
399
|
+
render(
|
|
400
|
+
<FeatureDateTime
|
|
401
|
+
inline
|
|
402
|
+
component="event"
|
|
403
|
+
label="Starts"
|
|
404
|
+
ready
|
|
405
|
+
timeZone="America/Los_Angeles"
|
|
406
|
+
value="2026-11-05T18:30:00-08:00"
|
|
407
|
+
onChange={onChange}
|
|
408
|
+
onEditingChange={onEditingChange}
|
|
409
|
+
/>
|
|
410
|
+
)
|
|
411
|
+
expect(screen.queryByRole('button', { name: 'Save date' })).toBeNull()
|
|
412
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
413
|
+
target: { value: '02/30/2027' },
|
|
414
|
+
})
|
|
415
|
+
expect(onChange).not.toHaveBeenCalled()
|
|
416
|
+
expect(onEditingChange).toHaveBeenLastCalledWith(true)
|
|
417
|
+
fireEvent.change(screen.getByPlaceholderText('MM/DD/YYYY'), {
|
|
418
|
+
target: { value: '02/28/2027' },
|
|
419
|
+
})
|
|
420
|
+
expect(onChange).toHaveBeenLastCalledWith('2027-03-01T02:30:00.000Z')
|
|
421
|
+
expect(onEditingChange).toHaveBeenLastCalledWith(false)
|
|
422
|
+
})
|
|
423
|
+
|
|
424
|
+
it('clears an inline date only when requested and can add it again', () => {
|
|
425
|
+
const onChange = vi.fn()
|
|
426
|
+
render(
|
|
427
|
+
<FeatureDate
|
|
428
|
+
inline
|
|
429
|
+
clearable
|
|
430
|
+
component="trip"
|
|
431
|
+
label="Departure"
|
|
432
|
+
ready
|
|
433
|
+
value="2027-01-01"
|
|
434
|
+
onChange={onChange}
|
|
435
|
+
/>
|
|
436
|
+
)
|
|
437
|
+
fireEvent.click(screen.getByRole('button', { name: 'Clear' }))
|
|
438
|
+
expect(onChange).toHaveBeenLastCalledWith(null)
|
|
439
|
+
expect(screen.queryByPlaceholderText('MM/DD/YYYY')).toBeNull()
|
|
440
|
+
fireEvent.click(screen.getByRole('button', { name: 'Add date' }))
|
|
441
|
+
expect(onChange).toHaveBeenLastCalledWith('2027-01-01')
|
|
442
|
+
})
|
|
443
|
+
|
|
444
|
+
it('accepts minute-only edits to an instant that originally included fractional seconds', () => {
|
|
445
|
+
const onChange = vi.fn()
|
|
446
|
+
render(
|
|
447
|
+
<FeatureDateTime
|
|
448
|
+
component="countdown"
|
|
449
|
+
label="Target"
|
|
450
|
+
ready
|
|
451
|
+
timeZone="America/Los_Angeles"
|
|
452
|
+
value="2026-11-05T18:30:42.125-08:00"
|
|
453
|
+
onChange={onChange}
|
|
454
|
+
/>
|
|
455
|
+
)
|
|
456
|
+
fireEvent.click(screen.getByRole('button', { name: 'Change date & time' }))
|
|
457
|
+
fireEvent.change(screen.getByPlaceholderText('h:mm AM/PM'), {
|
|
458
|
+
target: { value: '7:45 PM' },
|
|
459
|
+
})
|
|
460
|
+
fireEvent.click(screen.getByRole('button', { name: 'Save date' }))
|
|
461
|
+
expect(onChange).toHaveBeenCalledWith('2026-11-06T03:45:00.000Z')
|
|
462
|
+
})
|