@krizaka/ui 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/achievement.js +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/app-shell.js +1 -1
- package/dist/argument-card.js +2 -2
- package/dist/card-grid.js +1 -1
- package/dist/card.js +1 -1
- package/dist/choice-grid.js +1 -1
- package/dist/chunk-2FRWNSRO.js +23 -0
- package/dist/chunk-2FRWNSRO.js.map +1 -0
- package/dist/chunk-4LOMIQVX.js +21 -0
- package/dist/chunk-4LOMIQVX.js.map +1 -0
- package/dist/chunk-BTMFZ66D.js +135 -0
- package/dist/chunk-BTMFZ66D.js.map +1 -0
- package/dist/chunk-C2BRIFJG.js +13 -0
- package/dist/chunk-C2BRIFJG.js.map +1 -0
- package/dist/{chunk-K3SWZXYT.js → chunk-DGQMDJXK.js} +2 -2
- package/dist/chunk-G3ETON2A.js +22 -0
- package/dist/chunk-G3ETON2A.js.map +1 -0
- package/dist/chunk-IZ7MV6HM.js +26 -0
- package/dist/chunk-IZ7MV6HM.js.map +1 -0
- package/dist/chunk-KDXRYUD3.js +39 -0
- package/dist/chunk-KDXRYUD3.js.map +1 -0
- package/dist/{chunk-OGJI5X4W.js → chunk-ZKVQGXLD.js} +5 -3
- package/dist/{chunk-OGJI5X4W.js.map → chunk-ZKVQGXLD.js.map} +1 -1
- package/dist/chunk-ZNMFG62E.js +20 -0
- package/dist/chunk-ZNMFG62E.js.map +1 -0
- package/dist/cn.d.ts +9 -1
- package/dist/cn.js +5 -3
- package/dist/code-block.js +1 -1
- package/dist/command.js +1 -1
- package/dist/confirm-button.js +1 -1
- package/dist/continue-prompt.js +1 -1
- package/dist/cta-panel.js +1 -1
- package/dist/data-table.js +3 -2
- package/dist/data-table.js.map +1 -1
- package/dist/date-picker.d.ts +652 -61
- package/dist/date-picker.js +918 -122
- package/dist/date-picker.js.map +1 -1
- package/dist/decision-list.js +1 -1
- package/dist/dropdown-menu.js +1 -1
- package/dist/error-page.js +1 -1
- package/dist/field.js +1 -1
- package/dist/filter-bar.js +3 -2
- package/dist/form.d.ts +23 -12
- package/dist/form.js +11 -47
- package/dist/form.js.map +1 -1
- package/dist/gallery-page.js +1 -1
- package/dist/glow-card.js +1 -1
- package/dist/goal-gauge.js +1 -1
- package/dist/how-it-works-page.js +1 -1
- package/dist/image-cropper.js +3 -1
- package/dist/image-cropper.js.map +1 -1
- package/dist/landscape.js +1 -1
- package/dist/link-card.js +1 -1
- package/dist/longform-page.js +1 -1
- package/dist/marquee.js +1 -1
- package/dist/mascot-quote.js +1 -1
- package/dist/motion.css +18 -1
- package/dist/native/form.d.ts +60 -15
- package/dist/native/form.js +103 -42
- package/dist/native/form.js.map +1 -1
- package/dist/native.d.ts +443 -2
- package/dist/native.js +1655 -448
- package/dist/native.js.map +1 -1
- package/dist/nav-bar.js +1 -1
- package/dist/page-hero.js +2 -2
- package/dist/page.js +2 -2
- package/dist/popover.js +1 -1
- package/dist/pricing-page.js +1 -1
- package/dist/product-page.js +1 -1
- package/dist/profile-card.js +1 -1
- package/dist/promise-card.js +1 -1
- package/dist/radio-group.d.ts +66 -32
- package/dist/radio-group.js +54 -10
- package/dist/radio-group.js.map +1 -1
- package/dist/scroll-stage.js +1 -1
- package/dist/slider.d.ts +96 -35
- package/dist/slider.js +67 -13
- package/dist/slider.js.map +1 -1
- package/dist/stage-banner.js +1 -1
- package/dist/terminal-replay.js +34 -60
- package/dist/terminal-replay.js.map +1 -1
- package/dist/toast.js +1 -1
- package/dist/toc.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/video-player.js +3 -1
- package/dist/video-player.js.map +1 -1
- package/package.json +8 -8
- package/registry/cn.json +1 -1
- package/registry/combobox.json +225 -3
- package/registry/date-picker.json +1739 -288
- package/registry/dialog.json +74 -3
- package/registry/examples/combobox/native/multiple.d.ts +4 -0
- package/registry/examples/combobox/native/multiple.dark.png +0 -0
- package/registry/examples/combobox/native/multiple.js +15 -0
- package/registry/examples/combobox/native/multiple.light.png +0 -0
- package/registry/examples/combobox/native/multiple.tsx +15 -0
- package/registry/examples/combobox/native/search.d.ts +4 -0
- package/registry/examples/combobox/native/search.dark.png +0 -0
- package/registry/examples/combobox/native/search.js +15 -0
- package/registry/examples/combobox/native/search.light.png +0 -0
- package/registry/examples/combobox/native/search.tsx +15 -0
- package/registry/examples/date-picker/birth-date-wheel.d.ts +4 -0
- package/registry/examples/date-picker/birth-date-wheel.js +13 -0
- package/registry/examples/date-picker/birth-date-wheel.tsx +11 -0
- package/registry/examples/date-picker/birth-date.d.ts +4 -0
- package/registry/examples/date-picker/birth-date.js +25 -0
- package/registry/examples/date-picker/birth-date.tsx +21 -0
- package/registry/examples/date-picker/calendar.js +1 -1
- package/registry/examples/date-picker/calendar.tsx +2 -6
- package/registry/examples/date-picker/day-strip.d.ts +4 -0
- package/registry/examples/date-picker/day-strip.js +28 -0
- package/registry/examples/date-picker/day-strip.tsx +27 -0
- package/registry/examples/date-picker/month-year.d.ts +4 -0
- package/registry/examples/date-picker/month-year.js +13 -0
- package/registry/examples/date-picker/month-year.tsx +10 -0
- package/registry/examples/date-picker/native/birth-date-wheel.d.ts +4 -0
- package/registry/examples/date-picker/native/birth-date-wheel.dark.png +0 -0
- package/registry/examples/date-picker/native/birth-date-wheel.js +13 -0
- package/registry/examples/date-picker/native/birth-date-wheel.light.png +0 -0
- package/registry/examples/date-picker/native/birth-date-wheel.tsx +9 -0
- package/registry/examples/date-picker/native/calendar.d.ts +4 -0
- package/registry/examples/date-picker/native/calendar.dark.png +0 -0
- package/registry/examples/date-picker/native/calendar.js +13 -0
- package/registry/examples/date-picker/native/calendar.light.png +0 -0
- package/registry/examples/date-picker/native/calendar.tsx +8 -0
- package/registry/examples/date-picker/native/day-strip.d.ts +4 -0
- package/registry/examples/date-picker/native/day-strip.dark.png +0 -0
- package/registry/examples/date-picker/native/day-strip.js +29 -0
- package/registry/examples/date-picker/native/day-strip.light.png +0 -0
- package/registry/examples/date-picker/native/day-strip.tsx +26 -0
- package/registry/examples/date-picker/native/month-year.d.ts +4 -0
- package/registry/examples/date-picker/native/month-year.dark.png +0 -0
- package/registry/examples/date-picker/native/month-year.js +13 -0
- package/registry/examples/date-picker/native/month-year.light.png +0 -0
- package/registry/examples/date-picker/native/month-year.tsx +8 -0
- package/registry/examples/date-picker/native/time-slots.d.ts +4 -0
- package/registry/examples/date-picker/native/time-slots.dark.png +0 -0
- package/registry/examples/date-picker/native/time-slots.js +15 -0
- package/registry/examples/date-picker/native/time-slots.light.png +0 -0
- package/registry/examples/date-picker/native/time-slots.tsx +15 -0
- package/registry/examples/date-picker/native/time-wheel.d.ts +4 -0
- package/registry/examples/date-picker/native/time-wheel.dark.png +0 -0
- package/registry/examples/date-picker/native/time-wheel.js +13 -0
- package/registry/examples/date-picker/native/time-wheel.light.png +0 -0
- package/registry/examples/date-picker/native/time-wheel.tsx +8 -0
- package/registry/examples/date-picker/time-slots.d.ts +4 -0
- package/registry/examples/date-picker/time-slots.js +26 -0
- package/registry/examples/date-picker/time-slots.tsx +25 -0
- package/registry/examples/date-picker/time-wheel.d.ts +4 -0
- package/registry/examples/date-picker/time-wheel.js +13 -0
- package/registry/examples/date-picker/time-wheel.tsx +10 -0
- package/registry/examples/date-picker/wheel.d.ts +4 -0
- package/registry/examples/date-picker/wheel.js +14 -0
- package/registry/examples/date-picker/wheel.tsx +16 -0
- package/registry/examples/dialog/native/sheet.d.ts +4 -0
- package/registry/examples/dialog/native/sheet.dark.png +0 -0
- package/registry/examples/dialog/native/sheet.js +21 -0
- package/registry/examples/dialog/native/sheet.light.png +0 -0
- package/registry/examples/dialog/native/sheet.tsx +18 -0
- package/registry/examples/field/native/select.d.ts +4 -0
- package/registry/examples/field/native/select.dark.png +0 -0
- package/registry/examples/field/native/select.js +29 -0
- package/registry/examples/field/native/select.light.png +0 -0
- package/registry/examples/field/native/select.tsx +25 -0
- package/registry/examples/form/native/audience.dark.png +0 -0
- package/registry/examples/form/native/audience.light.png +0 -0
- package/registry/examples/form/native/profile.dark.png +0 -0
- package/registry/examples/form/native/profile.light.png +0 -0
- package/registry/examples/form/native/settings.dark.png +0 -0
- package/registry/examples/form/native/settings.light.png +0 -0
- package/registry/examples/form/native/sign-up.dark.png +0 -0
- package/registry/examples/form/native/sign-up.light.png +0 -0
- package/registry/examples/form/native/upload.dark.png +0 -0
- package/registry/examples/form/native/upload.light.png +0 -0
- package/registry/examples/radio-group/buttons.d.ts +4 -0
- package/registry/examples/radio-group/buttons.js +17 -0
- package/registry/examples/radio-group/buttons.tsx +21 -0
- package/registry/examples/radio-group/cards.js +1 -1
- package/registry/examples/radio-group/cards.tsx +2 -2
- package/registry/examples/radio-group/native/buttons.d.ts +4 -0
- package/registry/examples/radio-group/native/buttons.dark.png +0 -0
- package/registry/examples/radio-group/native/buttons.js +25 -0
- package/registry/examples/radio-group/native/buttons.light.png +0 -0
- package/registry/examples/radio-group/native/buttons.tsx +21 -0
- package/registry/examples/radio-group/native/cards.d.ts +4 -0
- package/registry/examples/radio-group/native/cards.dark.png +0 -0
- package/registry/examples/radio-group/native/cards.js +23 -0
- package/registry/examples/radio-group/native/cards.light.png +0 -0
- package/registry/examples/radio-group/native/cards.tsx +19 -0
- package/registry/examples/radio-group/native/list.d.ts +4 -0
- package/registry/examples/radio-group/native/list.dark.png +0 -0
- package/registry/examples/radio-group/native/list.js +24 -0
- package/registry/examples/radio-group/native/list.light.png +0 -0
- package/registry/examples/radio-group/native/list.tsx +20 -0
- package/registry/examples/radio-group/native/segmented.d.ts +4 -0
- package/registry/examples/radio-group/native/segmented.dark.png +0 -0
- package/registry/examples/radio-group/native/segmented.js +24 -0
- package/registry/examples/radio-group/native/segmented.light.png +0 -0
- package/registry/examples/radio-group/native/segmented.tsx +20 -0
- package/registry/examples/radio-group/segmented.d.ts +4 -0
- package/registry/examples/radio-group/segmented.js +15 -0
- package/registry/examples/radio-group/segmented.tsx +12 -0
- package/registry/examples/slider/floating.d.ts +4 -0
- package/registry/examples/slider/floating.js +11 -0
- package/registry/examples/slider/floating.tsx +12 -0
- package/registry/examples/slider/native/default.d.ts +4 -0
- package/registry/examples/slider/native/default.dark.png +0 -0
- package/registry/examples/slider/native/default.js +14 -0
- package/registry/examples/slider/native/default.light.png +0 -0
- package/registry/examples/slider/native/default.tsx +13 -0
- package/registry/examples/slider/native/range.d.ts +4 -0
- package/registry/examples/slider/native/range.dark.png +0 -0
- package/registry/examples/slider/native/range.js +12 -0
- package/registry/examples/slider/native/range.light.png +0 -0
- package/registry/examples/slider/native/range.tsx +11 -0
- package/registry/examples/slider/native/stepped.d.ts +4 -0
- package/registry/examples/slider/native/stepped.dark.png +0 -0
- package/registry/examples/slider/native/stepped.js +28 -0
- package/registry/examples/slider/native/stepped.light.png +0 -0
- package/registry/examples/slider/native/stepped.tsx +24 -0
- package/registry/examples/slider/native/vertical.d.ts +4 -0
- package/registry/examples/slider/native/vertical.dark.png +0 -0
- package/registry/examples/slider/native/vertical.js +16 -0
- package/registry/examples/slider/native/vertical.light.png +0 -0
- package/registry/examples/slider/native/vertical.tsx +13 -0
- package/registry/examples/slider/price-range.d.ts +4 -0
- package/registry/examples/slider/price-range.js +29 -0
- package/registry/examples/slider/price-range.tsx +27 -0
- package/registry/examples/slider/stepped.d.ts +4 -0
- package/registry/examples/slider/stepped.js +28 -0
- package/registry/examples/slider/stepped.tsx +24 -0
- package/registry/examples/slider/vertical.d.ts +4 -0
- package/registry/examples/slider/vertical.js +15 -0
- package/registry/examples/slider/vertical.tsx +14 -0
- package/registry/examples/switch/native/default.d.ts +4 -0
- package/registry/examples/switch/native/default.dark.png +0 -0
- package/registry/examples/switch/native/default.js +16 -0
- package/registry/examples/switch/native/default.light.png +0 -0
- package/registry/examples/switch/native/default.tsx +13 -0
- package/registry/examples/switch/native/settings.d.ts +4 -0
- package/registry/examples/switch/native/settings.dark.png +0 -0
- package/registry/examples/switch/native/settings.js +20 -0
- package/registry/examples/switch/native/settings.light.png +0 -0
- package/registry/examples/switch/native/settings.tsx +17 -0
- package/registry/field.json +15 -3
- package/registry/form.json +250 -42
- package/registry/index.json +29 -24
- package/registry/radio-group.json +227 -15
- package/registry/slider.json +314 -13
- package/registry/switch.json +115 -3
- package/registry/tabs.json +2 -2
- package/registry/theme.json +7 -0
- package/skills/choice-controls/SKILL.md +39 -0
- package/skills/date-picker/SKILL.md +43 -0
- package/skills/form/SKILL.md +3 -0
- package/dist/chunk-2USC2YT6.js +0 -17
- package/dist/chunk-2USC2YT6.js.map +0 -1
- package/dist/chunk-5AXLA4LK.js +0 -13
- package/dist/chunk-5AXLA4LK.js.map +0 -1
- package/dist/chunk-FJDSLNXK.js +0 -11
- package/dist/chunk-FJDSLNXK.js.map +0 -1
- package/dist/chunk-KNBYZGSQ.js +0 -11
- package/dist/chunk-KNBYZGSQ.js.map +0 -1
- package/dist/chunk-RUPRYJ45.js +0 -82
- package/dist/chunk-RUPRYJ45.js.map +0 -1
- package/dist/chunk-VCAAHCHL.js +0 -17
- package/dist/chunk-VCAAHCHL.js.map +0 -1
- /package/dist/{chunk-K3SWZXYT.js.map → chunk-DGQMDJXK.js.map} +0 -0
package/registry/dialog.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "A window over the page — centred, a bottom sheet or a side panel — and `AlertDialog` for a confirmation.",
|
|
7
7
|
"status": "stable",
|
|
8
8
|
"category": "overlays",
|
|
9
|
-
"platforms": "
|
|
9
|
+
"platforms": "both",
|
|
10
10
|
"whenToUse": [
|
|
11
11
|
"For a short task that must be finished or cancelled before going back: invite someone, edit a title.",
|
|
12
12
|
"`AlertDialog` to confirm a destructive or irreversible action, with an async `onConfirm`.",
|
|
@@ -308,7 +308,78 @@
|
|
|
308
308
|
}
|
|
309
309
|
]
|
|
310
310
|
},
|
|
311
|
-
"native":
|
|
311
|
+
"native": {
|
|
312
|
+
"entry": "@krizaka/ui/native",
|
|
313
|
+
"import": "import { Sheet } from \"@krizaka/ui/native\";",
|
|
314
|
+
"differences": [
|
|
315
|
+
"One component, `Sheet`: a bottom sheet on React Native's `Modal` (focus kept inside, the back button and the scrim close it), its grip on top, rising with the theme's ease.",
|
|
316
|
+
"It holds what a phone shows over a screen: a choice (`Select`, `Combobox` use it), the details of a pin on a map, a short form."
|
|
317
|
+
],
|
|
318
|
+
"props": [
|
|
319
|
+
{
|
|
320
|
+
"component": "Sheet",
|
|
321
|
+
"description": "A bottom sheet: it rises over a dimmed screen, its grip on top, the scrim closes it. The web `Dialog` on a phone —\na choice (`Select`, `Combobox`), the details of a pin on a map, a short form. React Native's `Modal`: focus stays\ninside, the back button closes it. Rises with the theme's ease; still under reduced motion.",
|
|
322
|
+
"props": [
|
|
323
|
+
{
|
|
324
|
+
"name": "children",
|
|
325
|
+
"type": "ReactNode",
|
|
326
|
+
"default": null,
|
|
327
|
+
"description": "The content: a list, details, a form.",
|
|
328
|
+
"required": true
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"name": "onOpenChange",
|
|
332
|
+
"type": "(open: boolean) => void",
|
|
333
|
+
"default": null,
|
|
334
|
+
"description": "Called to close it: the scrim pressed, the back button, a choice made.",
|
|
335
|
+
"required": true
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"name": "open",
|
|
339
|
+
"type": "boolean",
|
|
340
|
+
"default": null,
|
|
341
|
+
"description": "Open (controlled).",
|
|
342
|
+
"required": true
|
|
343
|
+
},
|
|
344
|
+
{
|
|
345
|
+
"name": "closeLabel",
|
|
346
|
+
"type": "string",
|
|
347
|
+
"default": "Close",
|
|
348
|
+
"description": "The name of the close action read by screen readers (\"Close\"), passed translated.",
|
|
349
|
+
"required": false
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"name": "style",
|
|
353
|
+
"type": "StyleProp<ViewStyle>",
|
|
354
|
+
"default": null,
|
|
355
|
+
"description": "Styles merged last, on the sheet.",
|
|
356
|
+
"required": false
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
"name": "title",
|
|
360
|
+
"type": "string",
|
|
361
|
+
"default": null,
|
|
362
|
+
"description": "The title at the top of the sheet (its accessible name), passed translated.",
|
|
363
|
+
"required": false
|
|
364
|
+
}
|
|
365
|
+
]
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"examples": [
|
|
369
|
+
{
|
|
370
|
+
"name": "sheet",
|
|
371
|
+
"title": "Bottom sheet",
|
|
372
|
+
"description": "The details of a pick-up point over the dimmed screen.",
|
|
373
|
+
"path": "examples/dialog/native/sheet.tsx",
|
|
374
|
+
"module": "@krizaka/ui/registry/examples/dialog/native/sheet",
|
|
375
|
+
"code": "import { Button, Sheet, Txt } from \"@krizaka/ui/native\";\nimport * as React from \"react\";\nimport { View } from \"react-native\";\n\n// A bottom sheet: it rises over the dimmed screen, the scrim or the back button closes it.\nexport default function NativeDialogSheet({ defaultOpen }: { defaultOpen?: boolean }) {\n const [open, setOpen] = React.useState(Boolean(defaultOpen));\n return (\n <View>\n <Button label=\"Show the pick-up point\" onPress={() => setOpen(true)} />\n <Sheet open={open} onOpenChange={setOpen} title=\"Café Olimpico\">\n <Txt tone=\"secondary\">124 Rue Saint-Viateur O, Montréal · 350 m away</Txt>\n <Txt>Open until 10 pm. Ask for the order under your name at the counter.</Txt>\n <Button label=\"Get directions\" variant=\"primary\" onPress={() => setOpen(false)} />\n </Sheet>\n </View>\n );\n}\n",
|
|
376
|
+
"screenshots": {
|
|
377
|
+
"dark": "examples/dialog/native/sheet.dark.png",
|
|
378
|
+
"light": "examples/dialog/native/sheet.light.png"
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
]
|
|
382
|
+
},
|
|
312
383
|
"files": [
|
|
313
384
|
{
|
|
314
385
|
"path": "dialog/alert-dialog.tsx",
|
|
@@ -324,7 +395,7 @@
|
|
|
324
395
|
},
|
|
325
396
|
{
|
|
326
397
|
"path": "dialog/meta.ts",
|
|
327
|
-
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Dialog\",\n summary: \"A window over the page — centred, a bottom sheet or a side panel — and `AlertDialog` for a confirmation.\",\n status: \"stable\",\n category: \"overlays\",\n platforms: \"
|
|
398
|
+
"content": "import type { ComponentMeta } from \"../meta\";\n\nexport const meta = {\n title: \"Dialog\",\n summary: \"A window over the page — centred, a bottom sheet or a side panel — and `AlertDialog` for a confirmation.\",\n status: \"stable\",\n category: \"overlays\",\n platforms: \"both\",\n whenToUse: [\n \"For a short task that must be finished or cancelled before going back: invite someone, edit a title.\",\n \"`AlertDialog` to confirm a destructive or irreversible action, with an async `onConfirm`.\",\n \"`Sheet` (bottom) on phones, `placement=\\\"right\\\"` for a side panel of details.\",\n \"A gate the user must answer (age, terms): `hideClose` and `dismissible={false}`.\",\n ],\n whenNotToUse: [\n { when: \"For information next to an element, without blocking the page.\", use: \"popover\" },\n { when: \"For a message that needs no answer.\", use: \"toast\" },\n { when: \"For a long form or a flow of several steps: give it its own page.\" },\n { when: \"To confirm the deletion of one item in place.\", use: \"confirm-button\" },\n ],\n bestPractices: [\n \"Always a `Dialog.Title`; a `Dialog.Description` when the title is not enough.\",\n \"Name the buttons by what they do (“Send the invitation”), the cancel one by what it keeps (“Keep it”).\",\n \"Pass `closeLabel` translated: it names the close button.\",\n ],\n accessibility: {\n keyboard: [\n { keys: \"Esc\", action: \"Closes the dialog (unless `dismissible={false}`).\" },\n { keys: \"Tab / Shift+Tab\", action: \"Move within the dialog: the focus is trapped while it is open.\" },\n ],\n notes: [\n \"Radix Dialog: `role=\\\"dialog\\\"` (or `alertdialog`), `aria-modal`, named by its title and described by its description.\",\n \"The focus moves into the dialog when it opens and returns to the trigger when it closes; the page behind does not scroll.\",\n \"`AlertDialog` keeps the focus on the cancel button first.\",\n ],\n },\n related: [\"popover\", \"confirm-button\", \"command\", \"toast\"],\n web: {\n imports: [\"Dialog\", \"Sheet\", \"AlertDialog\"],\n examples: [\n { name: \"center\", title: \"Centred\", description: \"A short form, `size=\\\"md\\\"`.\" },\n { name: \"bottom\", title: \"Bottom sheet\", description: \"`placement=\\\"bottom\\\"`: a sheet on a phone, centred from `sm` up.\" },\n { name: \"right\", title: \"Side panel\", description: \"`placement=\\\"right\\\"`: full height, for details.\" },\n { name: \"left\", title: \"Navigation drawer\", description: \"`placement=\\\"left\\\"`: full height from the left, for an app's navigation on a phone.\" },\n { name: \"sheet-form\", title: \"Sheet with a form\", description: \"`Sheet`, `size=\\\"lg\\\"`.\" },\n { name: \"alert-destructive\", title: \"Alert dialog\", description: \"`AlertDialog tone=\\\"danger\\\"` with an async `onConfirm`.\" },\n { name: \"gate\", title: \"Gate\", description: \"No close button: it closes only through its actions.\" },\n ],\n },\n native: {\n imports: [\"Sheet\"],\n differences: [\n \"One component, `Sheet`: a bottom sheet on React Native's `Modal` (focus kept inside, the back button and the scrim close it), its grip on top, rising with the theme's ease.\",\n \"It holds what a phone shows over a screen: a choice (`Select`, `Combobox` use it), the details of a pin on a map, a short form.\",\n ],\n examples: [{ name: \"sheet\", title: \"Bottom sheet\", description: \"The details of a pick-up point over the dimmed screen.\" }],\n },\n} satisfies ComponentMeta;\n"
|
|
328
399
|
},
|
|
329
400
|
{
|
|
330
401
|
"path": "meta.ts",
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/combobox/native/multiple.tsx
|
|
4
|
+
import { Combobox } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var TOPICS = ["Music", "Sport", "Art", "Cooking", "Gaming", "Travel"].map((t) => ({ value: t.toLowerCase(), label: t }));
|
|
9
|
+
function NativeComboboxMultiple() {
|
|
10
|
+
const [topics, setTopics] = React.useState(["music", "travel"]);
|
|
11
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 300 }, children: /* @__PURE__ */ jsx(Combobox, { label: "Interests", multiple: true, options: TOPICS, value: topics, onValueChange: (v) => setTopics(Array.isArray(v) ? v : [v]) }) });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
NativeComboboxMultiple as default
|
|
15
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Combobox } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
const TOPICS = ["Music", "Sport", "Art", "Cooking", "Gaming", "Travel"].map((t) => ({ value: t.toLowerCase(), label: t }));
|
|
6
|
+
|
|
7
|
+
// Several values: checkboxes in the sheet, Done closes it; the field lists the choices.
|
|
8
|
+
export default function NativeComboboxMultiple() {
|
|
9
|
+
const [topics, setTopics] = React.useState<string[]>(["music", "travel"]);
|
|
10
|
+
return (
|
|
11
|
+
<View style={{ width: 300 }}>
|
|
12
|
+
<Combobox label="Interests" multiple options={TOPICS} value={topics} onValueChange={(v) => setTopics(Array.isArray(v) ? v : [v])} />
|
|
13
|
+
</View>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/combobox/native/search.tsx
|
|
4
|
+
import { Combobox } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var CITIES = ["Montr\xE9al", "Qu\xE9bec", "Laval", "Gatineau", "Sherbrooke", "Trois-Rivi\xE8res"].map((c) => ({ value: c.toLowerCase(), label: c }));
|
|
9
|
+
function NativeComboboxSearch() {
|
|
10
|
+
const [city, setCity] = React.useState("montr\xE9al");
|
|
11
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 300 }, children: /* @__PURE__ */ jsx(Combobox, { label: "City", placeholder: "Choose a city", options: CITIES, value: city, onValueChange: (v) => setCity(String(v)) }) });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
NativeComboboxSearch as default
|
|
15
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Combobox } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
const CITIES = ["Montréal", "Québec", "Laval", "Gatineau", "Sherbrooke", "Trois-Rivières"].map((c) => ({ value: c.toLowerCase(), label: c }));
|
|
6
|
+
|
|
7
|
+
// A choice among many, searched in a sheet: what is typed filters the options.
|
|
8
|
+
export default function NativeComboboxSearch() {
|
|
9
|
+
const [city, setCity] = React.useState<string>("montréal");
|
|
10
|
+
return (
|
|
11
|
+
<View style={{ width: 300 }}>
|
|
12
|
+
<Combobox label="City" placeholder="Choose a city" options={CITIES} value={city} onValueChange={(v) => setCity(String(v))} />
|
|
13
|
+
</View>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/birth-date-wheel.tsx
|
|
4
|
+
import { DateWheel } from "@krizaka/ui/date-picker";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function DatePickerBirthDateWheel() {
|
|
8
|
+
const [birth, setBirth] = React.useState("1994-06-18");
|
|
9
|
+
return /* @__PURE__ */ jsx(DateWheel, { label: "Date of birth", locale: "en-US", value: birth, onValueChange: setBirth, max: "2008-10-11", hint: "You must be 18 or older." });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
DatePickerBirthDateWheel as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { DateWheel } from "@krizaka/ui/date-picker";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// The wheels of a date of birth, in the locale's order, ending at the 18th birthday: an under-18 date cannot be chosen.
|
|
7
|
+
// `max` is fixed here for the documentation; in an app, `max={latestBirthDate(18)}`.
|
|
8
|
+
export default function DatePickerBirthDateWheel() {
|
|
9
|
+
const [birth, setBirth] = React.useState<string | null>("1994-06-18");
|
|
10
|
+
return <DateWheel label="Date of birth" locale="en-US" value={birth} onValueChange={setBirth} max="2008-10-11" hint="You must be 18 or older." />;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/birth-date.tsx
|
|
4
|
+
import { DateField, isRealDate, latestBirthDate } from "@krizaka/ui/date-picker";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function DatePickerBirthDate() {
|
|
8
|
+
const [birth, setBirth] = React.useState("2015-03-27");
|
|
9
|
+
const minor = isRealDate(birth) && birth > latestBirthDate(18);
|
|
10
|
+
return /* @__PURE__ */ jsx(
|
|
11
|
+
DateField,
|
|
12
|
+
{
|
|
13
|
+
label: "Date of birth",
|
|
14
|
+
locale: "en-GB",
|
|
15
|
+
autoComplete: "bday",
|
|
16
|
+
value: birth,
|
|
17
|
+
onValueChange: setBirth,
|
|
18
|
+
hint: "Private, never shown. For example, 27 3 1990.",
|
|
19
|
+
error: minor ? "You must be 18 or older to create an account." : void 0
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
DatePickerBirthDate as default
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { DateField, isRealDate, latestBirthDate } from "@krizaka/ui/date-picker";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// A date of birth typed as day, month and year (the browser can fill it); an under-18 date is refused at once.
|
|
7
|
+
export default function DatePickerBirthDate() {
|
|
8
|
+
const [birth, setBirth] = React.useState("2015-03-27");
|
|
9
|
+
const minor = isRealDate(birth) && birth > latestBirthDate(18);
|
|
10
|
+
return (
|
|
11
|
+
<DateField
|
|
12
|
+
label="Date of birth"
|
|
13
|
+
locale="en-GB"
|
|
14
|
+
autoComplete="bday"
|
|
15
|
+
value={birth}
|
|
16
|
+
onValueChange={setBirth}
|
|
17
|
+
hint="Private, never shown. For example, 27 3 1990."
|
|
18
|
+
error={minor ? "You must be 18 or older to create an account." : undefined}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -7,7 +7,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
var weekend = (iso) => [0, 6].includes((/* @__PURE__ */ new Date(`${iso}T12:00:00`)).getDay());
|
|
8
8
|
function DatePickerCalendar() {
|
|
9
9
|
const [day, setDay] = React.useState("2026-10-15");
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
10
|
+
return /* @__PURE__ */ jsx(Calendar, { variant: "card", locale: "en-GB", value: day, onSelect: setDay, isDateDisabled: weekend, min: "2026-10-12", today: "2026-10-11" });
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
13
13
|
DatePickerCalendar as default
|
|
@@ -5,12 +5,8 @@ import * as React from "react";
|
|
|
5
5
|
|
|
6
6
|
const weekend = (iso: string) => [0, 6].includes(new Date(`${iso}T12:00:00`).getDay());
|
|
7
7
|
|
|
8
|
-
// The month is the interface:
|
|
8
|
+
// The month is the interface: a card of its own, weekends unavailable, today marked by the node.
|
|
9
9
|
export default function DatePickerCalendar() {
|
|
10
10
|
const [day, setDay] = React.useState("2026-10-15");
|
|
11
|
-
return
|
|
12
|
-
<div className="inline-block rounded-xl border border-border-default bg-surface-1 p-3">
|
|
13
|
-
<Calendar locale="en-GB" value={day} onSelect={setDay} isDateDisabled={weekend} min="2026-10-12" today="2026-10-11" />
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
11
|
+
return <Calendar variant="card" locale="en-GB" value={day} onSelect={setDay} isDateDisabled={weekend} min="2026-10-12" today="2026-10-11" />;
|
|
16
12
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/day-strip.tsx
|
|
4
|
+
import { DayStrip } from "@krizaka/ui/date-picker";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var closed = (iso) => (/* @__PURE__ */ new Date(`${iso}T12:00:00`)).getDay() === 0;
|
|
8
|
+
var sessions = /* @__PURE__ */ new Set(["2026-10-14", "2026-10-17", "2026-10-21"]);
|
|
9
|
+
function DatePickerDayStrip() {
|
|
10
|
+
const [day, setDay] = React.useState("2026-10-14");
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
12
|
+
DayStrip,
|
|
13
|
+
{
|
|
14
|
+
label: "Session day",
|
|
15
|
+
locale: "en-US",
|
|
16
|
+
value: day,
|
|
17
|
+
onValueChange: setDay,
|
|
18
|
+
start: "2026-10-11",
|
|
19
|
+
today: "2026-10-11",
|
|
20
|
+
isDateDisabled: closed,
|
|
21
|
+
isDateMarked: (d) => sessions.has(d),
|
|
22
|
+
labels: { marked: "has a session" }
|
|
23
|
+
}
|
|
24
|
+
) });
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
DatePickerDayStrip as default
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { DayStrip } from "@krizaka/ui/date-picker";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
const closed = (iso: string) => new Date(`${iso}T12:00:00`).getDay() === 0;
|
|
7
|
+
const sessions = new Set(["2026-10-14", "2026-10-17", "2026-10-21"]);
|
|
8
|
+
|
|
9
|
+
// The next two weeks in a row: Sundays closed, the days with a session marked.
|
|
10
|
+
export default function DatePickerDayStrip() {
|
|
11
|
+
const [day, setDay] = React.useState<string | null>("2026-10-14");
|
|
12
|
+
return (
|
|
13
|
+
<div className="w-full max-w-md">
|
|
14
|
+
<DayStrip
|
|
15
|
+
label="Session day"
|
|
16
|
+
locale="en-US"
|
|
17
|
+
value={day}
|
|
18
|
+
onValueChange={setDay}
|
|
19
|
+
start="2026-10-11"
|
|
20
|
+
today="2026-10-11"
|
|
21
|
+
isDateDisabled={closed}
|
|
22
|
+
isDateMarked={(d) => sessions.has(d)}
|
|
23
|
+
labels={{ marked: "has a session" }}
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/month-year.tsx
|
|
4
|
+
import { MonthPicker } from "@krizaka/ui/date-picker";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function DatePickerMonthYear() {
|
|
8
|
+
const [month, setMonth] = React.useState("2026-09");
|
|
9
|
+
return /* @__PURE__ */ jsx(MonthPicker, { variant: "card", locale: "en-US", value: month, onValueChange: setMonth, max: "2026-10", current: "2026-10" });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
DatePickerMonthYear as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { MonthPicker } from "@krizaka/ui/date-picker";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// A billing month: twelve months at a glance, the year above them, nothing later than this month.
|
|
7
|
+
export default function DatePickerMonthYear() {
|
|
8
|
+
const [month, setMonth] = React.useState<string | null>("2026-09");
|
|
9
|
+
return <MonthPicker variant="card" locale="en-US" value={month} onValueChange={setMonth} max="2026-10" current="2026-10" />;
|
|
10
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/native/birth-date-wheel.tsx
|
|
4
|
+
import { DateWheel } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeDatePickerBirthDateWheel() {
|
|
8
|
+
const [birth, setBirth] = React.useState("1994-06-18");
|
|
9
|
+
return /* @__PURE__ */ jsx(DateWheel, { label: "Date of birth", locale: "en-US", value: birth, onValueChange: setBirth, max: "2008-10-11", hint: "You must be 18 or older." });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
NativeDatePickerBirthDateWheel as default
|
|
13
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DateWheel } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// The wheels of a date of birth in the locale's order, ending at the 18th birthday; each value passed ticks under the
|
|
5
|
+
// thumb (the app's `haptics`). `max` is fixed here for the documentation; in an app, `max={latestBirthDate(18)}`.
|
|
6
|
+
export default function NativeDatePickerBirthDateWheel() {
|
|
7
|
+
const [birth, setBirth] = React.useState<string | null>("1994-06-18");
|
|
8
|
+
return <DateWheel label="Date of birth" locale="en-US" value={birth} onValueChange={setBirth} max="2008-10-11" hint="You must be 18 or older." />;
|
|
9
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/native/calendar.tsx
|
|
4
|
+
import { Calendar } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeDatePickerCalendar() {
|
|
8
|
+
const [day, setDay] = React.useState("2026-10-15");
|
|
9
|
+
return /* @__PURE__ */ jsx(Calendar, { locale: "en-US", value: day, onSelect: setDay, min: "2026-10-11", today: "2026-10-11" });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
NativeDatePickerCalendar as default
|
|
13
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Calendar } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// A month to book a day: 44-pt days, today's node, the past unavailable.
|
|
5
|
+
export default function NativeDatePickerCalendar() {
|
|
6
|
+
const [day, setDay] = React.useState("2026-10-15");
|
|
7
|
+
return <Calendar locale="en-US" value={day} onSelect={setDay} min="2026-10-11" today="2026-10-11" />;
|
|
8
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/native/day-strip.tsx
|
|
4
|
+
import { DayStrip } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var sessions = /* @__PURE__ */ new Set(["2026-10-14", "2026-10-17"]);
|
|
9
|
+
function NativeDatePickerDayStrip() {
|
|
10
|
+
const [day, setDay] = React.useState("2026-10-14");
|
|
11
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 320 }, children: /* @__PURE__ */ jsx(
|
|
12
|
+
DayStrip,
|
|
13
|
+
{
|
|
14
|
+
label: "Session day",
|
|
15
|
+
locale: "en-US",
|
|
16
|
+
value: day,
|
|
17
|
+
onValueChange: setDay,
|
|
18
|
+
start: "2026-10-11",
|
|
19
|
+
today: "2026-10-11",
|
|
20
|
+
days: 10,
|
|
21
|
+
isDateDisabled: (d) => (/* @__PURE__ */ new Date(`${d}T12:00:00`)).getDay() === 0,
|
|
22
|
+
isDateMarked: (d) => sessions.has(d),
|
|
23
|
+
markedLabel: "has a session"
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
NativeDatePickerDayStrip as default
|
|
29
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DayStrip } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
const sessions = new Set(["2026-10-14", "2026-10-17"]);
|
|
6
|
+
|
|
7
|
+
// The days ahead, swiped sideways: Sundays closed, the days with a session marked.
|
|
8
|
+
export default function NativeDatePickerDayStrip() {
|
|
9
|
+
const [day, setDay] = React.useState<string | null>("2026-10-14");
|
|
10
|
+
return (
|
|
11
|
+
<View style={{ width: 320 }}>
|
|
12
|
+
<DayStrip
|
|
13
|
+
label="Session day"
|
|
14
|
+
locale="en-US"
|
|
15
|
+
value={day}
|
|
16
|
+
onValueChange={setDay}
|
|
17
|
+
start="2026-10-11"
|
|
18
|
+
today="2026-10-11"
|
|
19
|
+
days={10}
|
|
20
|
+
isDateDisabled={(d) => new Date(`${d}T12:00:00`).getDay() === 0}
|
|
21
|
+
isDateMarked={(d) => sessions.has(d)}
|
|
22
|
+
markedLabel="has a session"
|
|
23
|
+
/>
|
|
24
|
+
</View>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/native/month-year.tsx
|
|
4
|
+
import { MonthPicker } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeDatePickerMonthYear() {
|
|
8
|
+
const [month, setMonth] = React.useState("2026-09");
|
|
9
|
+
return /* @__PURE__ */ jsx(MonthPicker, { locale: "en-US", value: month, onValueChange: setMonth, max: "2026-10" });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
NativeDatePickerMonthYear as default
|
|
13
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MonthPicker } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// A billing month: the twelve months of the year, nothing later than this month.
|
|
5
|
+
export default function NativeDatePickerMonthYear() {
|
|
6
|
+
const [month, setMonth] = React.useState<string | null>("2026-09");
|
|
7
|
+
return <MonthPicker locale="en-US" value={month} onValueChange={setMonth} max="2026-10" />;
|
|
8
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/native/time-slots.tsx
|
|
4
|
+
import { TimePicker, timeSlots } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
var taken = /* @__PURE__ */ new Set(["10:00", "11:30"]);
|
|
9
|
+
function NativeDatePickerTimeSlots() {
|
|
10
|
+
const [time, setTime] = React.useState("10:30");
|
|
11
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 320 }, children: /* @__PURE__ */ jsx(TimePicker, { variant: "slots", label: "Appointment time", locale: "en-US", slots: timeSlots("09:00", "12:00", 30), isTimeDisabled: (t) => taken.has(t), value: time, onValueChange: setTime }) });
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
NativeDatePickerTimeSlots as default
|
|
15
|
+
};
|
|
Binary file
|