@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,555 @@
|
|
|
1
|
+
import { Flex, Icon, Text } from '@flickfyi/core'
|
|
2
|
+
import { Button } from '@flickfyi/core/atoms'
|
|
3
|
+
import {
|
|
4
|
+
Choice,
|
|
5
|
+
completedTaskStyle,
|
|
6
|
+
Field,
|
|
7
|
+
List,
|
|
8
|
+
Stepper,
|
|
9
|
+
} from '@flickfyi/core/molecules'
|
|
10
|
+
import * as stylex from '@stylexjs/stylex'
|
|
11
|
+
import { formatQuantity } from 'format-quantity'
|
|
12
|
+
import { Duration } from 'luxon'
|
|
13
|
+
import { useState } from 'react'
|
|
14
|
+
|
|
15
|
+
import { space } from '~/themes/scale.stylex'
|
|
16
|
+
import { appearance, button, roles } from '~/themes/shared'
|
|
17
|
+
|
|
18
|
+
import { kowalskiCatalog, type KowalskiInput, type KowalskiProps } from './catalog'
|
|
19
|
+
import { format } from './format'
|
|
20
|
+
import { FeatureAction, FeatureFacts, FeatureFrame, FeatureWell, layout } from './frame'
|
|
21
|
+
import { useClock } from './use-clock'
|
|
22
|
+
import { useConfiguredFeature } from './use-configured-feature'
|
|
23
|
+
|
|
24
|
+
type RecipeProps = KowalskiProps<'recipe'>
|
|
25
|
+
type Ingredient = RecipeProps['ingredients'][number]
|
|
26
|
+
type Step = RecipeProps['steps'][number]
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Cooks an RGF recipe in two modes. The overview is for reading: ingredients, servings, and
|
|
30
|
+
* Start cooking at the bottom. Cooking fits one screen with the current step and its action at
|
|
31
|
+
* the bottom, or the next timer to go off when nothing is ready; above it, in falling order of
|
|
32
|
+
* attention, the other running timers, the next few steps (greyed until ready), and what's done.
|
|
33
|
+
*/
|
|
34
|
+
export function Recipe(input: KowalskiInput<'recipe'>) {
|
|
35
|
+
const props = kowalskiCatalog.recipe.props.parse(input)
|
|
36
|
+
const schema = kowalskiCatalog.recipe.storeSchema
|
|
37
|
+
const baseServings = props.servings ?? null
|
|
38
|
+
const store = useConfiguredFeature({
|
|
39
|
+
name: props.id ?? 'KowalskiRecipe',
|
|
40
|
+
revision: props.revision,
|
|
41
|
+
schema,
|
|
42
|
+
scope: props.scope,
|
|
43
|
+
seed: schema.parse({ servings: baseServings ?? 1 }),
|
|
44
|
+
})
|
|
45
|
+
const [prepOpen, setPrepOpen] = useState(false)
|
|
46
|
+
const [showEarlier, setShowEarlier] = useState(false)
|
|
47
|
+
const [showLater, setShowLater] = useState(false)
|
|
48
|
+
const graph = recipeGraph(props.steps)
|
|
49
|
+
const checked = (id: string) => store.value[`step_${id}`]?.done
|
|
50
|
+
const endsAt = (id: string) => store.value[`step_${id}`]?.endsAt ?? null
|
|
51
|
+
// The clock runs while any unfinished step has a timer, including one whose time is up.
|
|
52
|
+
// Timer ends are the key, so starting or extending one refreshes the clock before paint.
|
|
53
|
+
const now = useClock(
|
|
54
|
+
props.steps.some(step => endsAt(step.id) !== null && !checked(step.id)),
|
|
55
|
+
props.steps.map(step => endsAt(step.id) ?? '').join(',')
|
|
56
|
+
)
|
|
57
|
+
const factor = baseServings === null ? 1 : store.value.servings / baseServings
|
|
58
|
+
const waitingOn = (step: Step) =>
|
|
59
|
+
(graph.prerequisites.get(step.id) ?? []).filter(id => !checked(id))
|
|
60
|
+
const done = props.steps.filter(step => checked(step.id))
|
|
61
|
+
const history = showEarlier ? done : done.slice(-1)
|
|
62
|
+
const active = props.steps
|
|
63
|
+
.filter(step => !checked(step.id) && endsAt(step.id) !== null)
|
|
64
|
+
.toSorted((a, b) => (endsAt(a.id) ?? 0) - (endsAt(b.id) ?? 0))
|
|
65
|
+
// Ready steps first, longest remaining chain first so long waits start early; then waiting steps in order.
|
|
66
|
+
const queue = props.steps
|
|
67
|
+
.filter(step => !checked(step.id) && endsAt(step.id) === null)
|
|
68
|
+
.toSorted(
|
|
69
|
+
(a, b) =>
|
|
70
|
+
Number(waitingOn(a).length > 0) - Number(waitingOn(b).length > 0) ||
|
|
71
|
+
(waitingOn(a).length > 0
|
|
72
|
+
? 0
|
|
73
|
+
: (graph.chain.get(b.id) ?? 0) - (graph.chain.get(a.id) ?? 0)) ||
|
|
74
|
+
props.steps.indexOf(a) - props.steps.indexOf(b)
|
|
75
|
+
)
|
|
76
|
+
const [first, ...rest] = queue
|
|
77
|
+
const current = first && waitingOn(first).length === 0 ? first : undefined
|
|
78
|
+
// With nothing ready, the card holds the timer that goes off next (timers sort soonest first).
|
|
79
|
+
const awaited = current ? undefined : active[0]
|
|
80
|
+
const upcoming = current ? rest : queue
|
|
81
|
+
const next = showLater ? upcoming : upcoming.slice(0, 2)
|
|
82
|
+
const timers = active.filter(step => step !== awaited)
|
|
83
|
+
const remaining = (step: Step) => Math.ceil(((endsAt(step.id) ?? now) - now) / 1000)
|
|
84
|
+
const set = (step: Step, state: { done: boolean; endsAt: number | null }) => {
|
|
85
|
+
store.set(() => ({ [`step_${step.id}`]: state }))
|
|
86
|
+
}
|
|
87
|
+
const complete = (step: Step) => set(step, { done: true, endsAt: endsAt(step.id) })
|
|
88
|
+
const reopen = (step: Step) => set(step, { done: false, endsAt: null })
|
|
89
|
+
const start = (step: Step, until: number) => set(step, { done: false, endsAt: until })
|
|
90
|
+
const extend = (step: Step, instant: number) =>
|
|
91
|
+
set(step, { done: false, endsAt: Math.max(instant, endsAt(step.id) ?? 0) + 60_000 })
|
|
92
|
+
const timeUp = (step: Step) =>
|
|
93
|
+
step.doneness ? `Time’s up. Done when ${step.doneness}.` : 'Time’s up'
|
|
94
|
+
// What a step takes: an ingredient with its scaled amount, or an earlier output by name.
|
|
95
|
+
const uses = (step: Step) =>
|
|
96
|
+
step.uses.map(({ id, portion, source }) => {
|
|
97
|
+
if (source.kind === 'output') {
|
|
98
|
+
return { id, label: graph.outputs.get(source.outputId) ?? '', value: portion }
|
|
99
|
+
}
|
|
100
|
+
const ingredient = props.ingredients.find(item => item.id === source.ingredientId)
|
|
101
|
+
return {
|
|
102
|
+
id,
|
|
103
|
+
label: ingredient?.label ?? '',
|
|
104
|
+
value: portion ?? (ingredient && quantity(ingredient, factor)),
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
const prep = (
|
|
108
|
+
<>
|
|
109
|
+
<Field label="Ingredients">
|
|
110
|
+
<FeatureFacts>
|
|
111
|
+
{props.ingredients.map(ingredient => (
|
|
112
|
+
<List.Item
|
|
113
|
+
description={ingredient.notes?.join(' · ')}
|
|
114
|
+
key={ingredient.id}
|
|
115
|
+
label={ingredient.label}
|
|
116
|
+
trailing={quantity(ingredient, factor)}
|
|
117
|
+
/>
|
|
118
|
+
))}
|
|
119
|
+
</FeatureFacts>
|
|
120
|
+
</Field>
|
|
121
|
+
{baseServings !== null && (
|
|
122
|
+
<Field label="Servings">
|
|
123
|
+
<Stepper
|
|
124
|
+
decrementDisabled={!store.ready || store.value.servings <= 1}
|
|
125
|
+
decrementLabel="Fewer servings"
|
|
126
|
+
incrementDisabled={!store.ready || store.value.servings >= 100}
|
|
127
|
+
incrementLabel="More servings"
|
|
128
|
+
onDecrement={() =>
|
|
129
|
+
store.set(current => ({ servings: Math.max(1, current.servings - 1) }))
|
|
130
|
+
}
|
|
131
|
+
onIncrement={() =>
|
|
132
|
+
store.set(current => ({ servings: Math.min(100, current.servings + 1) }))
|
|
133
|
+
}
|
|
134
|
+
>
|
|
135
|
+
<Text {...stylex.props(roles.h2, layout.stepperInput)}>
|
|
136
|
+
{format.formatNumber(store.value.servings)}
|
|
137
|
+
</Text>
|
|
138
|
+
</Stepper>
|
|
139
|
+
</Field>
|
|
140
|
+
)}
|
|
141
|
+
</>
|
|
142
|
+
)
|
|
143
|
+
const nextRow = (step: Step) => {
|
|
144
|
+
const waiting = waitingOn(step).length > 0
|
|
145
|
+
const minutes = timerMinutes(step)
|
|
146
|
+
return (
|
|
147
|
+
<Flex
|
|
148
|
+
key={step.id}
|
|
149
|
+
{...stylex.props(recipeStyles.row, waiting && recipeStyles.waiting)}
|
|
150
|
+
>
|
|
151
|
+
<Flex {...stylex.props(layout.grow)}>
|
|
152
|
+
<Choice
|
|
153
|
+
checked={false}
|
|
154
|
+
disabled={!store.ready || waiting}
|
|
155
|
+
onCheckedChange={() => complete(step)}
|
|
156
|
+
>
|
|
157
|
+
{step.instruction}
|
|
158
|
+
</Choice>
|
|
159
|
+
</Flex>
|
|
160
|
+
{minutes !== null && !waiting && (
|
|
161
|
+
<Button
|
|
162
|
+
accessibilityLabel={`Start timer: ${step.instruction}`}
|
|
163
|
+
disabled={!store.ready}
|
|
164
|
+
onClick={() => start(step, Date.now() + minutes * 60_000)}
|
|
165
|
+
style={[button.secondary, button.sm, recipeStyles.trailing]}
|
|
166
|
+
>
|
|
167
|
+
<Flex {...stylex.props(layout.actionContent)}>
|
|
168
|
+
<Icon name="timer" />
|
|
169
|
+
<Text>{`Start ${step.duration?.raw}`}</Text>
|
|
170
|
+
</Flex>
|
|
171
|
+
</Button>
|
|
172
|
+
)}
|
|
173
|
+
</Flex>
|
|
174
|
+
)
|
|
175
|
+
}
|
|
176
|
+
const timerRow = (step: Step) => (
|
|
177
|
+
<Flex key={step.id} {...stylex.props(recipeStyles.row)}>
|
|
178
|
+
<Flex {...stylex.props(layout.grow)}>
|
|
179
|
+
<Choice
|
|
180
|
+
checked={false}
|
|
181
|
+
description={remaining(step) > 0 ? undefined : timeUp(step)}
|
|
182
|
+
disabled={!store.ready}
|
|
183
|
+
onCheckedChange={() => complete(step)}
|
|
184
|
+
>
|
|
185
|
+
{step.instruction}
|
|
186
|
+
</Choice>
|
|
187
|
+
</Flex>
|
|
188
|
+
{remaining(step) > 0 ? (
|
|
189
|
+
<Text
|
|
190
|
+
animated="numeric"
|
|
191
|
+
{...stylex.props(appearance.accent, recipeStyles.trailing)}
|
|
192
|
+
>
|
|
193
|
+
{clockText(remaining(step))}
|
|
194
|
+
</Text>
|
|
195
|
+
) : (
|
|
196
|
+
<Button
|
|
197
|
+
accessibilityLabel={`Add a minute: ${step.instruction}`}
|
|
198
|
+
disabled={!store.ready}
|
|
199
|
+
onClick={() => extend(step, Date.now())}
|
|
200
|
+
style={[button.secondary, button.sm, recipeStyles.trailing]}
|
|
201
|
+
>
|
|
202
|
+
<Text>+1 min</Text>
|
|
203
|
+
</Button>
|
|
204
|
+
)}
|
|
205
|
+
</Flex>
|
|
206
|
+
)
|
|
207
|
+
if (!store.value.cooking) {
|
|
208
|
+
return (
|
|
209
|
+
<FeatureFrame
|
|
210
|
+
onRetry={store.retry}
|
|
211
|
+
notice={store.error}
|
|
212
|
+
component="recipe"
|
|
213
|
+
title={props.title}
|
|
214
|
+
detail={timeSummary(props.steps, graph)}
|
|
215
|
+
>
|
|
216
|
+
{prep}
|
|
217
|
+
<FeatureAction
|
|
218
|
+
component="recipe"
|
|
219
|
+
icon="play"
|
|
220
|
+
size="lg"
|
|
221
|
+
variant="primary"
|
|
222
|
+
disabled={!store.ready}
|
|
223
|
+
onClick={() => store.set(() => ({ cooking: true }))}
|
|
224
|
+
>
|
|
225
|
+
Start cooking
|
|
226
|
+
</FeatureAction>
|
|
227
|
+
</FeatureFrame>
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
return (
|
|
231
|
+
<FeatureFrame
|
|
232
|
+
onRetry={store.retry}
|
|
233
|
+
notice={store.error}
|
|
234
|
+
component="recipe"
|
|
235
|
+
title={props.title}
|
|
236
|
+
trailing={
|
|
237
|
+
<Text {...stylex.props(roles.muted)}>
|
|
238
|
+
{`${format.formatNumber(done.length)} of ${format.formatNumber(props.steps.length)} done`}
|
|
239
|
+
</Text>
|
|
240
|
+
}
|
|
241
|
+
>
|
|
242
|
+
{prepOpen ? (
|
|
243
|
+
<>
|
|
244
|
+
{prep}
|
|
245
|
+
<Disclosure label="Hide ingredients" open onClick={() => setPrepOpen(false)} />
|
|
246
|
+
</>
|
|
247
|
+
) : (
|
|
248
|
+
<Disclosure
|
|
249
|
+
label={[
|
|
250
|
+
baseServings === null
|
|
251
|
+
? props.yield
|
|
252
|
+
: format.formatMessage(
|
|
253
|
+
{
|
|
254
|
+
defaultMessage: '{count, plural, one {# serving} other {# servings}}',
|
|
255
|
+
id: 'kowalski.recipe.servings',
|
|
256
|
+
},
|
|
257
|
+
{ count: store.value.servings }
|
|
258
|
+
),
|
|
259
|
+
format.formatMessage(
|
|
260
|
+
{
|
|
261
|
+
defaultMessage:
|
|
262
|
+
'{count, plural, one {# ingredient} other {# ingredients}}',
|
|
263
|
+
id: 'kowalski.recipe.ingredients',
|
|
264
|
+
},
|
|
265
|
+
{ count: props.ingredients.length }
|
|
266
|
+
),
|
|
267
|
+
]
|
|
268
|
+
.filter(Boolean)
|
|
269
|
+
.join(' · ')}
|
|
270
|
+
open={false}
|
|
271
|
+
onClick={() => setPrepOpen(true)}
|
|
272
|
+
/>
|
|
273
|
+
)}
|
|
274
|
+
{done.length > history.length && (
|
|
275
|
+
<Disclosure
|
|
276
|
+
label={format.formatMessage(
|
|
277
|
+
{
|
|
278
|
+
defaultMessage:
|
|
279
|
+
'{count, plural, one {Show # earlier step} other {Show # earlier steps}}',
|
|
280
|
+
id: 'kowalski.recipe.earlier',
|
|
281
|
+
},
|
|
282
|
+
{ count: done.length - history.length }
|
|
283
|
+
)}
|
|
284
|
+
open={false}
|
|
285
|
+
onClick={() => setShowEarlier(true)}
|
|
286
|
+
/>
|
|
287
|
+
)}
|
|
288
|
+
{history.length > 0 && (
|
|
289
|
+
<List style={completedTaskStyle}>
|
|
290
|
+
{history.map(step => (
|
|
291
|
+
<Choice
|
|
292
|
+
checked
|
|
293
|
+
disabled={!store.ready}
|
|
294
|
+
key={step.id}
|
|
295
|
+
onCheckedChange={() => reopen(step)}
|
|
296
|
+
>
|
|
297
|
+
{step.instruction}
|
|
298
|
+
</Choice>
|
|
299
|
+
))}
|
|
300
|
+
</List>
|
|
301
|
+
)}
|
|
302
|
+
{upcoming.length > 2 && (
|
|
303
|
+
<Disclosure
|
|
304
|
+
label={
|
|
305
|
+
showLater
|
|
306
|
+
? 'Show fewer'
|
|
307
|
+
: format.formatMessage(
|
|
308
|
+
{
|
|
309
|
+
defaultMessage:
|
|
310
|
+
'{count, plural, one {Show # more step} other {Show # more steps}}',
|
|
311
|
+
id: 'kowalski.recipe.later',
|
|
312
|
+
},
|
|
313
|
+
{ count: upcoming.length - 2 }
|
|
314
|
+
)
|
|
315
|
+
}
|
|
316
|
+
open={showLater}
|
|
317
|
+
onClick={() => setShowLater(current => !current)}
|
|
318
|
+
/>
|
|
319
|
+
)}
|
|
320
|
+
{next.length > 0 && <List>{next.map(nextRow)}</List>}
|
|
321
|
+
{timers.length > 0 && <List>{timers.map(timerRow)}</List>}
|
|
322
|
+
<FeatureWell>
|
|
323
|
+
{current ? (
|
|
324
|
+
<>
|
|
325
|
+
<Text {...stylex.props(roles.h2)}>{current.instruction}</Text>
|
|
326
|
+
{current.uses.length > 0 && (
|
|
327
|
+
<List>
|
|
328
|
+
{uses(current).map(use => (
|
|
329
|
+
<List.Item key={use.id} label={use.label} trailing={use.value} />
|
|
330
|
+
))}
|
|
331
|
+
</List>
|
|
332
|
+
)}
|
|
333
|
+
{[current.temperature, current.equipment?.join(', ')]
|
|
334
|
+
.filter(Boolean)
|
|
335
|
+
.map(detail => (
|
|
336
|
+
<Text key={detail} {...stylex.props(roles.muted)}>
|
|
337
|
+
{detail}
|
|
338
|
+
</Text>
|
|
339
|
+
))}
|
|
340
|
+
<FeatureAction
|
|
341
|
+
component="recipe"
|
|
342
|
+
icon={timerMinutes(current) === null ? 'checkmark' : 'timer'}
|
|
343
|
+
size="lg"
|
|
344
|
+
variant="primary"
|
|
345
|
+
disabled={!store.ready}
|
|
346
|
+
onClick={() => {
|
|
347
|
+
const minutes = timerMinutes(current)
|
|
348
|
+
if (minutes === null) {
|
|
349
|
+
complete(current)
|
|
350
|
+
} else {
|
|
351
|
+
start(current, Date.now() + minutes * 60_000)
|
|
352
|
+
}
|
|
353
|
+
}}
|
|
354
|
+
>
|
|
355
|
+
{timerMinutes(current) === null ? 'Done' : `Start ${current.duration?.raw}`}
|
|
356
|
+
</FeatureAction>
|
|
357
|
+
</>
|
|
358
|
+
) : awaited ? (
|
|
359
|
+
<>
|
|
360
|
+
<Text {...stylex.props(roles.h2)}>{awaited.instruction}</Text>
|
|
361
|
+
{remaining(awaited) > 0 ? (
|
|
362
|
+
<Text
|
|
363
|
+
animated="numeric"
|
|
364
|
+
{...stylex.props(roles.display, appearance.accent)}
|
|
365
|
+
>
|
|
366
|
+
{clockText(remaining(awaited))}
|
|
367
|
+
</Text>
|
|
368
|
+
) : (
|
|
369
|
+
<Text {...stylex.props(roles.muted)}>{timeUp(awaited)}</Text>
|
|
370
|
+
)}
|
|
371
|
+
<Flex {...stylex.props(layout.actions)}>
|
|
372
|
+
<FeatureAction
|
|
373
|
+
component="recipe"
|
|
374
|
+
icon="checkmark"
|
|
375
|
+
size="lg"
|
|
376
|
+
variant={remaining(awaited) > 0 ? 'secondary' : 'primary'}
|
|
377
|
+
disabled={!store.ready}
|
|
378
|
+
onClick={() => complete(awaited)}
|
|
379
|
+
>
|
|
380
|
+
Done
|
|
381
|
+
</FeatureAction>
|
|
382
|
+
{remaining(awaited) <= 0 && (
|
|
383
|
+
<FeatureAction
|
|
384
|
+
component="recipe"
|
|
385
|
+
size="lg"
|
|
386
|
+
variant="secondary"
|
|
387
|
+
disabled={!store.ready}
|
|
388
|
+
onClick={() => extend(awaited, Date.now())}
|
|
389
|
+
>
|
|
390
|
+
+1 min
|
|
391
|
+
</FeatureAction>
|
|
392
|
+
)}
|
|
393
|
+
</Flex>
|
|
394
|
+
</>
|
|
395
|
+
) : (
|
|
396
|
+
<>
|
|
397
|
+
<Text {...stylex.props(roles.h2)}>All done</Text>
|
|
398
|
+
<FeatureAction
|
|
399
|
+
component="recipe"
|
|
400
|
+
variant="quiet"
|
|
401
|
+
disabled={!store.ready}
|
|
402
|
+
onClick={() =>
|
|
403
|
+
store.set(() => ({
|
|
404
|
+
cooking: false,
|
|
405
|
+
...Object.fromEntries(
|
|
406
|
+
props.steps.map(step => [
|
|
407
|
+
`step_${step.id}`,
|
|
408
|
+
{ done: false, endsAt: null },
|
|
409
|
+
])
|
|
410
|
+
),
|
|
411
|
+
}))
|
|
412
|
+
}
|
|
413
|
+
>
|
|
414
|
+
Cook again
|
|
415
|
+
</FeatureAction>
|
|
416
|
+
</>
|
|
417
|
+
)}
|
|
418
|
+
</FeatureWell>
|
|
419
|
+
</FeatureFrame>
|
|
420
|
+
)
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
function Disclosure({
|
|
424
|
+
label,
|
|
425
|
+
onClick,
|
|
426
|
+
open,
|
|
427
|
+
}: {
|
|
428
|
+
label: string
|
|
429
|
+
onClick: () => void
|
|
430
|
+
open: boolean
|
|
431
|
+
}) {
|
|
432
|
+
return (
|
|
433
|
+
<Button onClick={onClick} style={[button.quiet, button.sm, recipeStyles.disclosure]}>
|
|
434
|
+
<Flex {...stylex.props(layout.actionContent)}>
|
|
435
|
+
<Text>{label}</Text>
|
|
436
|
+
<Icon name={open ? 'chevron.up' : 'chevron.down'} />
|
|
437
|
+
</Flex>
|
|
438
|
+
</Button>
|
|
439
|
+
)
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
const recipeStyles = stylex.create({
|
|
443
|
+
disclosure: { alignSelf: 'flex-start', paddingLeft: 0, paddingRight: 0 },
|
|
444
|
+
row: { alignItems: 'center', columnGap: space[3], flexDirection: 'row' },
|
|
445
|
+
trailing: { flexShrink: 0 },
|
|
446
|
+
waiting: { opacity: 0.5 },
|
|
447
|
+
})
|
|
448
|
+
|
|
449
|
+
/** Kitchen fractions below 10 (2¼ cups) and whole numbers above (533 mL). */
|
|
450
|
+
function amount(value: number) {
|
|
451
|
+
return value >= 10
|
|
452
|
+
? format.formatNumber(Math.round(value))
|
|
453
|
+
: (formatQuantity(value, { vulgarFractions: true }) ?? format.formatNumber(value))
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/** RGF defaults attention to passive for wait steps and active otherwise. */
|
|
457
|
+
function attention(step: Step) {
|
|
458
|
+
return step.attention ?? (step.kind === 'wait' ? 'passive' : 'active')
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
function clockText(seconds: number) {
|
|
462
|
+
return Duration.fromObject({ seconds }).toFormat(seconds >= 3600 ? 'h:mm:ss' : 'm:ss')
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/** An ingredient's scaled amount with its unit, or the unit alone ("a pinch"). */
|
|
466
|
+
function quantity(ingredient: Ingredient, factor: number) {
|
|
467
|
+
return ingredient.amount === undefined
|
|
468
|
+
? ingredient.unit
|
|
469
|
+
: [amount(ingredient.amount * factor), ingredient.unit].filter(Boolean).join(' ')
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/** Prerequisites join after with the steps whose outputs a step uses. */
|
|
473
|
+
function recipeGraph(steps: Step[]) {
|
|
474
|
+
const producers = new Map(
|
|
475
|
+
steps.flatMap(step =>
|
|
476
|
+
(step.outputs ?? []).map(output => [output.id, step.id] as const)
|
|
477
|
+
)
|
|
478
|
+
)
|
|
479
|
+
const outputs = new Map(
|
|
480
|
+
steps.flatMap(step =>
|
|
481
|
+
(step.outputs ?? []).map(
|
|
482
|
+
output => [output.id, output.name ?? stepName(step)] as const
|
|
483
|
+
)
|
|
484
|
+
)
|
|
485
|
+
)
|
|
486
|
+
const prerequisites = new Map(
|
|
487
|
+
steps.map(step => [
|
|
488
|
+
step.id,
|
|
489
|
+
[
|
|
490
|
+
...new Set([
|
|
491
|
+
...(step.after ?? []),
|
|
492
|
+
...step.uses.flatMap(use =>
|
|
493
|
+
use.source.kind === 'output' ? [producers.get(use.source.outputId) ?? ''] : []
|
|
494
|
+
),
|
|
495
|
+
]),
|
|
496
|
+
].filter(Boolean),
|
|
497
|
+
])
|
|
498
|
+
)
|
|
499
|
+
// The longest timed chain from each step onward; edges only point back, so walk in reverse.
|
|
500
|
+
const chainFor = (minutes: (step: Step) => number) => {
|
|
501
|
+
const chain = new Map<string, number>()
|
|
502
|
+
for (const step of steps.toReversed()) {
|
|
503
|
+
const next = steps.filter(other => prerequisites.get(other.id)?.includes(step.id))
|
|
504
|
+
chain.set(
|
|
505
|
+
step.id,
|
|
506
|
+
minutes(step) + Math.max(0, ...next.map(other => chain.get(other.id) ?? 0))
|
|
507
|
+
)
|
|
508
|
+
}
|
|
509
|
+
return chain
|
|
510
|
+
}
|
|
511
|
+
return {
|
|
512
|
+
chain: chainFor(step => step.duration?.maxMinutes ?? step.duration?.minMinutes ?? 0),
|
|
513
|
+
outputs,
|
|
514
|
+
prerequisites,
|
|
515
|
+
shortest: chainFor(
|
|
516
|
+
step => step.duration?.minMinutes ?? step.duration?.maxMinutes ?? 0
|
|
517
|
+
),
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function stepName(step: Step | undefined) {
|
|
522
|
+
return step?.label ?? step?.outputs?.[0]?.name ?? step?.instruction ?? ''
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
/** Total time follows the longest chain, so parallel branches overlap; hands-on sums active steps. */
|
|
526
|
+
function timeSummary(steps: Step[], graph: ReturnType<typeof recipeGraph>) {
|
|
527
|
+
const longest = Math.max(0, ...graph.chain.values())
|
|
528
|
+
const shortest = Math.max(0, ...graph.shortest.values())
|
|
529
|
+
const handsOn = steps
|
|
530
|
+
.filter(step => attention(step) === 'active')
|
|
531
|
+
.reduce((total, step) => total + (timerMinutes(step) ?? 0), 0)
|
|
532
|
+
if (longest === 0) {
|
|
533
|
+
return undefined
|
|
534
|
+
}
|
|
535
|
+
const total = `${timeText(shortest, longest)} total`
|
|
536
|
+
return handsOn > 0 ? `${total}, ${timeText(handsOn, handsOn)} hands-on` : total
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function timeText(low: number, high: number) {
|
|
540
|
+
const hours = high >= 60
|
|
541
|
+
const units = format.formatters.getNumberFormat(format.locale, {
|
|
542
|
+
maximumFractionDigits: 1,
|
|
543
|
+
style: 'unit',
|
|
544
|
+
unit: hours ? 'hour' : 'minute',
|
|
545
|
+
unitDisplay: 'short',
|
|
546
|
+
})
|
|
547
|
+
const scale = hours ? 60 : 1
|
|
548
|
+
return low === high
|
|
549
|
+
? units.format(high / scale)
|
|
550
|
+
: units.formatRange(low / scale, high / scale)
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
function timerMinutes(step: Step) {
|
|
554
|
+
return step.duration?.minMinutes ?? step.duration?.maxMinutes ?? null
|
|
555
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
|
|
3
|
+
import { previewTheme } from '~/storybook/theme-fixtures'
|
|
4
|
+
|
|
5
|
+
import { FamilyRoutineComposition, TrainingComposition } from './composition'
|
|
6
|
+
import compositionSource from './composition.tsx?raw'
|
|
7
|
+
|
|
8
|
+
const meta = {
|
|
9
|
+
component: TrainingComposition,
|
|
10
|
+
globals: { hue: 145, theme: 'athletic' },
|
|
11
|
+
parameters: {
|
|
12
|
+
docs: {
|
|
13
|
+
description: {
|
|
14
|
+
component:
|
|
15
|
+
'Persistent Core features arranged as real apps. Change the theme or unit in the toolbar: progress, timer state, and checklist completion keep the same store bindings.',
|
|
16
|
+
},
|
|
17
|
+
source: { code: compositionSource, language: 'tsx' },
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
render: (_args, { globals }) => <TrainingComposition theme={previewTheme(globals)} />,
|
|
21
|
+
title: 'Kowalski/Compositions',
|
|
22
|
+
} satisfies Meta<typeof TrainingComposition>
|
|
23
|
+
|
|
24
|
+
export default meta
|
|
25
|
+
|
|
26
|
+
export const Athletic: StoryObj<typeof meta> = { name: 'Track day · Athletic' }
|
|
27
|
+
|
|
28
|
+
export const Compact: StoryObj<typeof meta> = {
|
|
29
|
+
globals: { theme: 'compact' },
|
|
30
|
+
name: 'Track day · Compact',
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export const Kids: StoryObj<typeof meta> = {
|
|
34
|
+
globals: { hue: 286, theme: 'kids' },
|
|
35
|
+
name: 'Family routine · Kids',
|
|
36
|
+
render: (_args, { globals }) => (
|
|
37
|
+
<FamilyRoutineComposition theme={previewTheme(globals)} />
|
|
38
|
+
),
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const FamilyCompact: StoryObj<typeof meta> = {
|
|
42
|
+
globals: { hue: 286, theme: 'compact' },
|
|
43
|
+
name: 'Family routine · Compact',
|
|
44
|
+
render: (_args, { globals }) => (
|
|
45
|
+
<FamilyRoutineComposition theme={previewTheme(globals)} />
|
|
46
|
+
),
|
|
47
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { Flex, Text, useTheme } from '@flickfyi/core'
|
|
2
|
+
import { Checklist, Goal, Timer } from '@flickfyi/core/kowalski'
|
|
3
|
+
import themes from '@flickfyi/core/themes'
|
|
4
|
+
import * as stylex from '@stylexjs/stylex'
|
|
5
|
+
|
|
6
|
+
import { space, text } from '~/themes/scale.stylex'
|
|
7
|
+
|
|
8
|
+
type CompositionTheme = ReturnType<(typeof themes)[keyof typeof themes]>
|
|
9
|
+
|
|
10
|
+
/** One persistent workout, unchanged when the app switches its theme or density. */
|
|
11
|
+
export function TrainingComposition({ theme = athletic }: { theme?: CompositionTheme }) {
|
|
12
|
+
useTheme(theme)
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Flex {...stylex.props(styles.page)}>
|
|
16
|
+
<Flex {...stylex.props(styles.heading)}>
|
|
17
|
+
<Text {...stylex.props(theme.muted)}>400 m track · steady effort</Text>
|
|
18
|
+
<Text {...stylex.props(theme.h1, styles.title)}>Track day</Text>
|
|
19
|
+
</Flex>
|
|
20
|
+
<Flex {...stylex.props(styles.workout)}>
|
|
21
|
+
<Flex {...stylex.props(styles.feature)}>
|
|
22
|
+
<Goal
|
|
23
|
+
id="TrackDayLaps"
|
|
24
|
+
progress={3}
|
|
25
|
+
target={8}
|
|
26
|
+
title="Your laps"
|
|
27
|
+
unit="laps"
|
|
28
|
+
/>
|
|
29
|
+
</Flex>
|
|
30
|
+
<Flex {...stylex.props(styles.feature)}>
|
|
31
|
+
<Timer
|
|
32
|
+
durationSeconds={90}
|
|
33
|
+
id="TrackDayRecovery"
|
|
34
|
+
mode="break"
|
|
35
|
+
title="Catch your breath"
|
|
36
|
+
/>
|
|
37
|
+
</Flex>
|
|
38
|
+
</Flex>
|
|
39
|
+
<Flex {...stylex.props(styles.preparation)}>
|
|
40
|
+
<Checklist
|
|
41
|
+
id="TrackDayPreparation"
|
|
42
|
+
items={[
|
|
43
|
+
{ id: 'water', label: 'Fill your water bottle' },
|
|
44
|
+
{ id: 'warmup', label: 'Walk a lap and loosen up' },
|
|
45
|
+
{ id: 'laces', label: 'Check your laces' },
|
|
46
|
+
]}
|
|
47
|
+
title="Before the first lap"
|
|
48
|
+
/>
|
|
49
|
+
</Flex>
|
|
50
|
+
</Flex>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** The same family routine works with Kids' large controls and Compact's density. */
|
|
55
|
+
export function FamilyRoutineComposition({ theme = kids }: { theme?: CompositionTheme }) {
|
|
56
|
+
useTheme(theme)
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Flex {...stylex.props(styles.page)}>
|
|
60
|
+
<Flex {...stylex.props(styles.heading)}>
|
|
61
|
+
<Text {...stylex.props(theme.h1, styles.title)}>Evening routine</Text>
|
|
62
|
+
</Flex>
|
|
63
|
+
<Checklist
|
|
64
|
+
id="FamilyRoutineEvening"
|
|
65
|
+
items={[
|
|
66
|
+
{ id: 'toys', label: 'Give every toy a home' },
|
|
67
|
+
{ id: 'bag', label: 'Pack tomorrow’s bag' },
|
|
68
|
+
{ id: 'teeth', label: 'Brush those teeth' },
|
|
69
|
+
]}
|
|
70
|
+
title="Three small things"
|
|
71
|
+
/>
|
|
72
|
+
<Flex {...stylex.props(styles.preparation)}>
|
|
73
|
+
<Timer durationSeconds={600} id="FamilyRoutineStory" title="Time for a story" />
|
|
74
|
+
</Flex>
|
|
75
|
+
</Flex>
|
|
76
|
+
)
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const athletic = themes.athletic({ hue: 145 })
|
|
80
|
+
const kids = themes.kids({ hue: 286 })
|
|
81
|
+
|
|
82
|
+
const styles = stylex.create({
|
|
83
|
+
feature: { flexBasis: '20rem', flexGrow: 1, minWidth: 0 },
|
|
84
|
+
heading: { gap: space[2], padding: space[3] },
|
|
85
|
+
page: {
|
|
86
|
+
alignItems: 'stretch',
|
|
87
|
+
alignSelf: 'center',
|
|
88
|
+
gap: space[4],
|
|
89
|
+
maxWidth: '72rem',
|
|
90
|
+
width: '100%',
|
|
91
|
+
},
|
|
92
|
+
preparation: { paddingTop: 0 },
|
|
93
|
+
title: { fontSize: text['2xl'], lineHeight: text['2xlLeading'] },
|
|
94
|
+
workout: {
|
|
95
|
+
alignItems: 'flex-start',
|
|
96
|
+
flexDirection: 'row',
|
|
97
|
+
flexWrap: 'wrap',
|
|
98
|
+
gap: space[4],
|
|
99
|
+
},
|
|
100
|
+
})
|