@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
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TimePicker, timeSlots } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
const taken = new Set(["10:00", "11:30"]);
|
|
6
|
+
|
|
7
|
+
// The free times of an agenda as buttons; taken ones dashed and struck through.
|
|
8
|
+
export default function NativeDatePickerTimeSlots() {
|
|
9
|
+
const [time, setTime] = React.useState<string | null>("10:30");
|
|
10
|
+
return (
|
|
11
|
+
<View style={{ width: 320 }}>
|
|
12
|
+
<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} />
|
|
13
|
+
</View>
|
|
14
|
+
);
|
|
15
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/native/time-wheel.tsx
|
|
4
|
+
import { TimePicker } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeDatePickerTimeWheel() {
|
|
8
|
+
const [time, setTime] = React.useState("19:30");
|
|
9
|
+
return /* @__PURE__ */ jsx(TimePicker, { label: "Remind me at", locale: "en-US", value: time, onValueChange: setTime });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
NativeDatePickerTimeWheel as default
|
|
13
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TimePicker } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
|
|
4
|
+
// A reminder set by the thumb: hours, minutes by 5, the period of a 12-hour locale. The value is "HH:mm".
|
|
5
|
+
export default function NativeDatePickerTimeWheel() {
|
|
6
|
+
const [time, setTime] = React.useState<string | null>("19:30");
|
|
7
|
+
return <TimePicker label="Remind me at" locale="en-US" value={time} onValueChange={setTime} />;
|
|
8
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/time-slots.tsx
|
|
4
|
+
import { TimePicker, timeSlots } from "@krizaka/ui/date-picker";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var taken = /* @__PURE__ */ new Set(["10:00", "13:30", "14:00"]);
|
|
8
|
+
function DatePickerTimeSlots() {
|
|
9
|
+
const [time, setTime] = React.useState("11:00");
|
|
10
|
+
return /* @__PURE__ */ jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsx(
|
|
11
|
+
TimePicker,
|
|
12
|
+
{
|
|
13
|
+
variant: "slots",
|
|
14
|
+
label: "Appointment time",
|
|
15
|
+
locale: "en-US",
|
|
16
|
+
slots: timeSlots("09:00", "17:00", 30),
|
|
17
|
+
isTimeDisabled: (t) => taken.has(t),
|
|
18
|
+
groupLabels: { morning: "Morning", afternoon: "Afternoon", evening: "Evening" },
|
|
19
|
+
value: time,
|
|
20
|
+
onValueChange: setTime
|
|
21
|
+
}
|
|
22
|
+
) });
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
DatePickerTimeSlots as default
|
|
26
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { TimePicker, timeSlots } from "@krizaka/ui/date-picker";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
const taken = new Set(["10:00", "13:30", "14:00"]);
|
|
7
|
+
|
|
8
|
+
// The free times of an agenda, by part of the day; taken slots are struck through and skipped by the arrows.
|
|
9
|
+
export default function DatePickerTimeSlots() {
|
|
10
|
+
const [time, setTime] = React.useState<string | null>("11:00");
|
|
11
|
+
return (
|
|
12
|
+
<div className="w-full max-w-md">
|
|
13
|
+
<TimePicker
|
|
14
|
+
variant="slots"
|
|
15
|
+
label="Appointment time"
|
|
16
|
+
locale="en-US"
|
|
17
|
+
slots={timeSlots("09:00", "17:00", 30)}
|
|
18
|
+
isTimeDisabled={(t) => taken.has(t)}
|
|
19
|
+
groupLabels={{ morning: "Morning", afternoon: "Afternoon", evening: "Evening" }}
|
|
20
|
+
value={time}
|
|
21
|
+
onValueChange={setTime}
|
|
22
|
+
/>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/time-wheel.tsx
|
|
4
|
+
import { TimePicker } from "@krizaka/ui/date-picker";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function DatePickerTimeWheel() {
|
|
8
|
+
const [time, setTime] = React.useState("19:30");
|
|
9
|
+
return /* @__PURE__ */ jsx(TimePicker, { label: "Remind me at", locale: "en-US", value: time, onValueChange: setTime, minuteStep: 5 });
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
DatePickerTimeWheel as default
|
|
13
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { TimePicker } from "@krizaka/ui/date-picker";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
// A reminder set by the thumb: hours, minutes by 5 and the period, as the locale writes them. The value is "HH:mm".
|
|
7
|
+
export default function DatePickerTimeWheel() {
|
|
8
|
+
const [time, setTime] = React.useState<string | null>("19:30");
|
|
9
|
+
return <TimePicker label="Remind me at" locale="en-US" value={time} onValueChange={setTime} minuteStep={5} />;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/date-picker/wheel.tsx
|
|
4
|
+
import { Wheel, WheelPicker } from "@krizaka/ui/date-picker";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
var sizes = Array.from({ length: 12 }, (_, i) => ({ value: String(i + 1), label: i === 0 ? "1 guest" : `${i + 1} guests` }));
|
|
8
|
+
function DatePickerWheel() {
|
|
9
|
+
const [size, setSize] = React.useState("4");
|
|
10
|
+
return /* @__PURE__ */ jsx(WheelPicker, { label: "Party size", children: /* @__PURE__ */ jsx(Wheel, { label: "Guests", options: sizes, value: size, onValueChange: setSize, className: "w-36" }) });
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
DatePickerWheel as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Wheel, WheelPicker } from "@krizaka/ui/date-picker";
|
|
4
|
+
import * as React from "react";
|
|
5
|
+
|
|
6
|
+
const sizes = Array.from({ length: 12 }, (_, i) => ({ value: String(i + 1), label: i === 0 ? "1 guest" : `${i + 1} guests` }));
|
|
7
|
+
|
|
8
|
+
// Any short list turned by the thumb: a party size. The keyboard moves it too (↑ ↓, Page Up / Down, Home / End).
|
|
9
|
+
export default function DatePickerWheel() {
|
|
10
|
+
const [size, setSize] = React.useState("4");
|
|
11
|
+
return (
|
|
12
|
+
<WheelPicker label="Party size">
|
|
13
|
+
<Wheel label="Guests" options={sizes} value={size} onValueChange={setSize} className="w-36" />
|
|
14
|
+
</WheelPicker>
|
|
15
|
+
);
|
|
16
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/dialog/native/sheet.tsx
|
|
4
|
+
import { Button, Sheet, Txt } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
function NativeDialogSheet({ defaultOpen }) {
|
|
9
|
+
const [open, setOpen] = React.useState(Boolean(defaultOpen));
|
|
10
|
+
return /* @__PURE__ */ jsxs(View, { children: [
|
|
11
|
+
/* @__PURE__ */ jsx(Button, { label: "Show the pick-up point", onPress: () => setOpen(true) }),
|
|
12
|
+
/* @__PURE__ */ jsxs(Sheet, { open, onOpenChange: setOpen, title: "Caf\xE9 Olimpico", children: [
|
|
13
|
+
/* @__PURE__ */ jsx(Txt, { tone: "secondary", children: "124 Rue Saint-Viateur O, Montr\xE9al \xB7 350 m away" }),
|
|
14
|
+
/* @__PURE__ */ jsx(Txt, { children: "Open until 10 pm. Ask for the order under your name at the counter." }),
|
|
15
|
+
/* @__PURE__ */ jsx(Button, { label: "Get directions", variant: "primary", onPress: () => setOpen(false) })
|
|
16
|
+
] })
|
|
17
|
+
] });
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
NativeDialogSheet as default
|
|
21
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Button, Sheet, Txt } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
// A bottom sheet: it rises over the dimmed screen, the scrim or the back button closes it.
|
|
6
|
+
export default function NativeDialogSheet({ defaultOpen }: { defaultOpen?: boolean }) {
|
|
7
|
+
const [open, setOpen] = React.useState(Boolean(defaultOpen));
|
|
8
|
+
return (
|
|
9
|
+
<View>
|
|
10
|
+
<Button label="Show the pick-up point" onPress={() => setOpen(true)} />
|
|
11
|
+
<Sheet open={open} onOpenChange={setOpen} title="Café Olimpico">
|
|
12
|
+
<Txt tone="secondary">124 Rue Saint-Viateur O, Montréal · 350 m away</Txt>
|
|
13
|
+
<Txt>Open until 10 pm. Ask for the order under your name at the counter.</Txt>
|
|
14
|
+
<Button label="Get directions" variant="primary" onPress={() => setOpen(false)} />
|
|
15
|
+
</Sheet>
|
|
16
|
+
</View>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/field/native/select.tsx
|
|
4
|
+
import { Select } from "@krizaka/ui/native";
|
|
5
|
+
import * as React from "react";
|
|
6
|
+
import { View } from "react-native";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
function NativeFieldSelect() {
|
|
9
|
+
const [category, setCategory] = React.useState(null);
|
|
10
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 300 }, children: /* @__PURE__ */ jsx(
|
|
11
|
+
Select,
|
|
12
|
+
{
|
|
13
|
+
label: "Category",
|
|
14
|
+
placeholder: "Choose a category",
|
|
15
|
+
value: category,
|
|
16
|
+
onValueChange: setCategory,
|
|
17
|
+
hint: "Where your video is listed.",
|
|
18
|
+
options: [
|
|
19
|
+
{ value: "music", label: "Music" },
|
|
20
|
+
{ value: "sport", label: "Sport", description: "Training, matches, challenges" },
|
|
21
|
+
{ value: "art", label: "Art" },
|
|
22
|
+
{ value: "talk", label: "Talk" }
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
) });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
NativeFieldSelect as default
|
|
29
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Select } from "@krizaka/ui/native";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { View } from "react-native";
|
|
4
|
+
|
|
5
|
+
// One choice among many: the field opens a sheet of options; picking one closes it.
|
|
6
|
+
export default function NativeFieldSelect() {
|
|
7
|
+
const [category, setCategory] = React.useState<string | null>(null);
|
|
8
|
+
return (
|
|
9
|
+
<View style={{ width: 300 }}>
|
|
10
|
+
<Select
|
|
11
|
+
label="Category"
|
|
12
|
+
placeholder="Choose a category"
|
|
13
|
+
value={category}
|
|
14
|
+
onValueChange={setCategory}
|
|
15
|
+
hint="Where your video is listed."
|
|
16
|
+
options={[
|
|
17
|
+
{ value: "music", label: "Music" },
|
|
18
|
+
{ value: "sport", label: "Sport", description: "Training, matches, challenges" },
|
|
19
|
+
{ value: "art", label: "Art" },
|
|
20
|
+
{ value: "talk", label: "Talk" },
|
|
21
|
+
]}
|
|
22
|
+
/>
|
|
23
|
+
</View>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/radio-group/buttons.tsx
|
|
4
|
+
import { RadioGroup } from "@krizaka/ui/radio-group";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
var TIPS = [
|
|
7
|
+
["10", "10 %", "$4.20"],
|
|
8
|
+
["15", "15 %", "$6.30"],
|
|
9
|
+
["20", "20 %", "$8.40"],
|
|
10
|
+
["0", "No tip", "\u2014"]
|
|
11
|
+
];
|
|
12
|
+
function RadioGroupButtons() {
|
|
13
|
+
return /* @__PURE__ */ jsx(RadioGroup.Root, { label: "Tip", defaultValue: "15", variant: "buttons", children: TIPS.map(([value, label, amount]) => /* @__PURE__ */ jsx(RadioGroup.Button, { value, hint: amount, className: "w-24", children: label }, value)) });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
RadioGroupButtons as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RadioGroup } from "@krizaka/ui/radio-group";
|
|
2
|
+
|
|
3
|
+
const TIPS = [
|
|
4
|
+
["10", "10 %", "$4.20"],
|
|
5
|
+
["15", "15 %", "$6.30"],
|
|
6
|
+
["20", "20 %", "$8.40"],
|
|
7
|
+
["0", "No tip", "—"],
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
// Tactile keys: raised on their ledge, pressed in while held — the chosen one stays sunk, lit in the accent.
|
|
11
|
+
export default function RadioGroupButtons() {
|
|
12
|
+
return (
|
|
13
|
+
<RadioGroup.Root label="Tip" defaultValue="15" variant="buttons">
|
|
14
|
+
{TIPS.map(([value, label, amount]) => (
|
|
15
|
+
<RadioGroup.Button key={value} value={value} hint={amount} className="w-24">
|
|
16
|
+
{label}
|
|
17
|
+
</RadioGroup.Button>
|
|
18
|
+
))}
|
|
19
|
+
</RadioGroup.Root>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -9,7 +9,7 @@ var AMOUNTS = [
|
|
|
9
9
|
["50", "$50", "A night out"]
|
|
10
10
|
];
|
|
11
11
|
function RadioGroupCards() {
|
|
12
|
-
return /* @__PURE__ */ jsx(RadioGroup.Root, { label: "Amount", defaultValue: "20", className: "
|
|
12
|
+
return /* @__PURE__ */ jsx(RadioGroup.Root, { label: "Amount", defaultValue: "20", variant: "cards", className: "w-[30rem] max-w-full grid-cols-3", children: AMOUNTS.map(([value, amount, hint]) => /* @__PURE__ */ jsxs(RadioGroup.Card, { value, children: [
|
|
13
13
|
/* @__PURE__ */ jsx("span", { className: "font-display text-lg font-bold", children: amount }),
|
|
14
14
|
/* @__PURE__ */ jsx("span", { className: "text-xs text-fg-secondary", children: hint })
|
|
15
15
|
] }, value)) });
|
|
@@ -6,10 +6,10 @@ const AMOUNTS = [
|
|
|
6
6
|
["50", "$50", "A night out"],
|
|
7
7
|
];
|
|
8
8
|
|
|
9
|
-
// Whole cards: the chosen one carries the accent border and
|
|
9
|
+
// Whole cards: the chosen one carries the accent border, its tint and its lit check.
|
|
10
10
|
export default function RadioGroupCards() {
|
|
11
11
|
return (
|
|
12
|
-
<RadioGroup.Root label="Amount" defaultValue="20" className="
|
|
12
|
+
<RadioGroup.Root label="Amount" defaultValue="20" variant="cards" className="w-[30rem] max-w-full grid-cols-3">
|
|
13
13
|
{AMOUNTS.map(([value, amount, hint]) => (
|
|
14
14
|
<RadioGroup.Card key={value} value={value}>
|
|
15
15
|
<span className="font-display text-lg font-bold">{amount}</span>
|
|
Binary file
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/radio-group/native/buttons.tsx
|
|
4
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeRadioGroupButtons() {
|
|
8
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 340 }, children: /* @__PURE__ */ jsx(
|
|
9
|
+
RadioGroup,
|
|
10
|
+
{
|
|
11
|
+
label: "Tip",
|
|
12
|
+
variant: "buttons",
|
|
13
|
+
defaultValue: "15",
|
|
14
|
+
options: [
|
|
15
|
+
{ value: "10", label: "10 %", hint: "$4.20" },
|
|
16
|
+
{ value: "15", label: "15 %", hint: "$6.30" },
|
|
17
|
+
{ value: "20", label: "20 %", hint: "$8.40" },
|
|
18
|
+
{ value: "0", label: "None" }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
) });
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
NativeRadioGroupButtons as default
|
|
25
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// Tactile keys: raised on their ledge, sunk while pressed and once chosen — an impact haptic under the thumb.
|
|
5
|
+
export default function NativeRadioGroupButtons() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ width: 340 }}>
|
|
8
|
+
<RadioGroup
|
|
9
|
+
label="Tip"
|
|
10
|
+
variant="buttons"
|
|
11
|
+
defaultValue="15"
|
|
12
|
+
options={[
|
|
13
|
+
{ value: "10", label: "10 %", hint: "$4.20" },
|
|
14
|
+
{ value: "15", label: "15 %", hint: "$6.30" },
|
|
15
|
+
{ value: "20", label: "20 %", hint: "$8.40" },
|
|
16
|
+
{ value: "0", label: "None" },
|
|
17
|
+
]}
|
|
18
|
+
/>
|
|
19
|
+
</View>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/radio-group/native/cards.tsx
|
|
4
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeRadioGroupCards() {
|
|
8
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 340 }, children: /* @__PURE__ */ jsx(
|
|
9
|
+
RadioGroup,
|
|
10
|
+
{
|
|
11
|
+
label: "Credit pack",
|
|
12
|
+
variant: "cards",
|
|
13
|
+
defaultValue: "pro",
|
|
14
|
+
options: [
|
|
15
|
+
{ value: "starter", label: "100 credits", description: "$4.99" },
|
|
16
|
+
{ value: "pro", label: "500 credits", description: "$19.99 \xB7 save 20 %" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
) });
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
NativeRadioGroupCards as default
|
|
23
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// Whole cards: the chosen one tinted, its check lit.
|
|
5
|
+
export default function NativeRadioGroupCards() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ width: 340 }}>
|
|
8
|
+
<RadioGroup
|
|
9
|
+
label="Credit pack"
|
|
10
|
+
variant="cards"
|
|
11
|
+
defaultValue="pro"
|
|
12
|
+
options={[
|
|
13
|
+
{ value: "starter", label: "100 credits", description: "$4.99" },
|
|
14
|
+
{ value: "pro", label: "500 credits", description: "$19.99 · save 20 %" },
|
|
15
|
+
]}
|
|
16
|
+
/>
|
|
17
|
+
</View>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/radio-group/native/list.tsx
|
|
4
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeRadioGroupList() {
|
|
8
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 300 }, children: /* @__PURE__ */ jsx(
|
|
9
|
+
RadioGroup,
|
|
10
|
+
{
|
|
11
|
+
label: "Notification frequency",
|
|
12
|
+
defaultValue: "daily",
|
|
13
|
+
options: [
|
|
14
|
+
{ value: "instant", label: "Instantly" },
|
|
15
|
+
{ value: "daily", label: "Once a day", description: "At 6 pm, a summary." },
|
|
16
|
+
{ value: "weekly", label: "Once a week" },
|
|
17
|
+
{ value: "never", label: "Never", disabled: true }
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
) });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
NativeRadioGroupList as default
|
|
24
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// Dots and their words in 44-pt rows; one option disabled.
|
|
5
|
+
export default function NativeRadioGroupList() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ width: 300 }}>
|
|
8
|
+
<RadioGroup
|
|
9
|
+
label="Notification frequency"
|
|
10
|
+
defaultValue="daily"
|
|
11
|
+
options={[
|
|
12
|
+
{ value: "instant", label: "Instantly" },
|
|
13
|
+
{ value: "daily", label: "Once a day", description: "At 6 pm, a summary." },
|
|
14
|
+
{ value: "weekly", label: "Once a week" },
|
|
15
|
+
{ value: "never", label: "Never", disabled: true },
|
|
16
|
+
]}
|
|
17
|
+
/>
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
// registry/examples/radio-group/native/segmented.tsx
|
|
4
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
5
|
+
import { View } from "react-native";
|
|
6
|
+
import { jsx } from "react/jsx-runtime";
|
|
7
|
+
function NativeRadioGroupSegmented() {
|
|
8
|
+
return /* @__PURE__ */ jsx(View, { style: { width: 300 }, children: /* @__PURE__ */ jsx(
|
|
9
|
+
RadioGroup,
|
|
10
|
+
{
|
|
11
|
+
label: "Billing",
|
|
12
|
+
variant: "segmented",
|
|
13
|
+
defaultValue: "yearly",
|
|
14
|
+
options: [
|
|
15
|
+
{ value: "monthly", label: "Monthly" },
|
|
16
|
+
{ value: "yearly", label: "Yearly" },
|
|
17
|
+
{ value: "lifetime", label: "Lifetime" }
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
) });
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
NativeRadioGroupSegmented as default
|
|
24
|
+
};
|
|
Binary file
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { RadioGroup } from "@krizaka/ui/native";
|
|
2
|
+
import { View } from "react-native";
|
|
3
|
+
|
|
4
|
+
// A segmented control that is a form's choice (a radio group), not a view switch.
|
|
5
|
+
export default function NativeRadioGroupSegmented() {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{ width: 300 }}>
|
|
8
|
+
<RadioGroup
|
|
9
|
+
label="Billing"
|
|
10
|
+
variant="segmented"
|
|
11
|
+
defaultValue="yearly"
|
|
12
|
+
options={[
|
|
13
|
+
{ value: "monthly", label: "Monthly" },
|
|
14
|
+
{ value: "yearly", label: "Yearly" },
|
|
15
|
+
{ value: "lifetime", label: "Lifetime" },
|
|
16
|
+
]}
|
|
17
|
+
/>
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
20
|
+
}
|