@novi-ui/tactile 0.4.0 → 0.5.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.
Files changed (53) hide show
  1. package/dist/combo-box/combo-box.d.mts +34 -0
  2. package/dist/combo-box/combo-box.d.mts.map +1 -0
  3. package/dist/combo-box/combo-box.mjs +127 -0
  4. package/dist/combo-box/combo-box.mjs.map +1 -0
  5. package/dist/combo-box/combo-box.styles.d.mts +88 -0
  6. package/dist/combo-box/combo-box.styles.d.mts.map +1 -0
  7. package/dist/combo-box/combo-box.styles.mjs +115 -0
  8. package/dist/combo-box/combo-box.styles.mjs.map +1 -0
  9. package/dist/combo-box/index.d.mts +3 -0
  10. package/dist/date-picker/date-picker.d.mts +16 -0
  11. package/dist/date-picker/date-picker.d.mts.map +1 -0
  12. package/dist/date-picker/date-picker.mjs +162 -0
  13. package/dist/date-picker/date-picker.mjs.map +1 -0
  14. package/dist/date-picker/date-picker.styles.d.mts +103 -0
  15. package/dist/date-picker/date-picker.styles.d.mts.map +1 -0
  16. package/dist/date-picker/date-picker.styles.mjs +134 -0
  17. package/dist/date-picker/date-picker.styles.mjs.map +1 -0
  18. package/dist/date-picker/index.d.mts +3 -0
  19. package/dist/index.d.mts +16 -1
  20. package/dist/index.mjs +11 -1
  21. package/dist/menu/menu.styles.d.mts +6 -6
  22. package/dist/number-field/index.d.mts +3 -0
  23. package/dist/number-field/number-field.d.mts +16 -0
  24. package/dist/number-field/number-field.d.mts.map +1 -0
  25. package/dist/number-field/number-field.mjs +117 -0
  26. package/dist/number-field/number-field.mjs.map +1 -0
  27. package/dist/number-field/number-field.styles.d.mts +76 -0
  28. package/dist/number-field/number-field.styles.d.mts.map +1 -0
  29. package/dist/number-field/number-field.styles.mjs +96 -0
  30. package/dist/number-field/number-field.styles.mjs.map +1 -0
  31. package/dist/pagination/index.d.mts +3 -0
  32. package/dist/pagination/pagination.d.mts +14 -0
  33. package/dist/pagination/pagination.d.mts.map +1 -0
  34. package/dist/pagination/pagination.mjs +100 -0
  35. package/dist/pagination/pagination.mjs.map +1 -0
  36. package/dist/pagination/pagination.styles.d.mts +73 -0
  37. package/dist/pagination/pagination.styles.d.mts.map +1 -0
  38. package/dist/pagination/pagination.styles.mjs +100 -0
  39. package/dist/pagination/pagination.styles.mjs.map +1 -0
  40. package/dist/popover/popover.styles.d.mts +3 -3
  41. package/dist/select/select.d.mts +1 -1
  42. package/dist/select/select.mjs +1 -1
  43. package/dist/select/select.mjs.map +1 -1
  44. package/dist/table/index.d.mts +3 -0
  45. package/dist/table/table.d.mts +104 -0
  46. package/dist/table/table.d.mts.map +1 -0
  47. package/dist/table/table.mjs +172 -0
  48. package/dist/table/table.mjs.map +1 -0
  49. package/dist/table/table.styles.d.mts +58 -0
  50. package/dist/table/table.styles.d.mts.map +1 -0
  51. package/dist/table/table.styles.mjs +83 -0
  52. package/dist/table/table.styles.mjs.map +1 -0
  53. package/package.json +4 -3
@@ -0,0 +1,34 @@
1
+ import { ReactNode } from "react";
2
+ import { ComboBoxProps } from "@novi-ui/core";
3
+ //#region src/combo-box/combo-box.d.ts
4
+ interface ComboBoxItemProps {
5
+ /** 選択値。`onSelectionChange` に渡る */
6
+ id: string;
7
+ isDisabled?: boolean;
8
+ children?: ReactNode;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * ComboBox の選択肢。`ComboBox` の子として置く。
13
+ *
14
+ * @example
15
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
16
+ */
17
+ declare function ComboBoxItem({ id, isDisabled, children, className }: ComboBoxItemProps): import("react").JSX.Element;
18
+ /**
19
+ * 文字を打って絞り込み、一覧から1つ選ぶ。
20
+ *
21
+ * **一覧は画面下端のシートに出る**(Raster は入力欄の隣、Flatlay はフロー内)。
22
+ * 親指で届く位置に選択肢が並び、行は 48px 以上。
23
+ * IME 変換中の Enter と矢印キーは一覧に届かず、変換確定で誤選択しない。
24
+ *
25
+ * @example
26
+ * <ComboBox label="都道府県" onSelectionChange={setPref}>
27
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
28
+ * <ComboBoxItem id="osaka">大阪府</ComboBoxItem>
29
+ * </ComboBox>
30
+ */
31
+ declare function ComboBox({ variant, size, radius, label, placeholder, description, errorMessage, name, selectedKey, defaultSelectedKey, onSelectionChange, inputValue, defaultInputValue, onInputChange, allowsCustomValue, menuTrigger, onOpenChange, onKeyDown, isDisabled, isReadOnly, isRequired, isInvalid, children, className, classNames, id }: ComboBoxProps): import("react").JSX.Element;
32
+ //#endregion
33
+ export { ComboBox, ComboBoxItem, ComboBoxItemProps };
34
+ //# sourceMappingURL=combo-box.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combo-box.d.mts","names":[],"sources":["../../src/combo-box/combo-box.tsx"],"mappings":";;;UAiCiB;;EAEf;EACA;EACA,WAAW;EACX;;;;;;;;iBASc,eAAe,IAAI,YAAY,UAAU,aAAa,oCAAiB,IAAA;;;;;;;;;;;;;;iBA2BvE,WACd,SACA,MACA,QACA,OACA,aACA,aACA,cACA,MACA,aACA,oBACA,mBACA,YACA,mBACA,eACA,mBACA,aACA,cACA,WACA,YACA,YACA,YACA,WACA,UACA,WACA,YACA,MACC,gCAAa,IAAA"}
@@ -0,0 +1,127 @@
1
+ "use client";
2
+ import { comboBoxStyles } from "./combo-box.styles.mjs";
3
+ import { Button, ComboBox, FieldError, Group, Input, Label, ListBox, ListBoxItem, Popover, Text } from "react-aria-components";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { useImeSafeKeys } from "@novi-ui/core/client";
6
+ //#region src/combo-box/combo-box.tsx
7
+ function TriggerIcon() {
8
+ return /* @__PURE__ */ jsx("svg", {
9
+ viewBox: "0 0 16 16",
10
+ width: "1em",
11
+ height: "1em",
12
+ fill: "none",
13
+ "aria-hidden": "true",
14
+ children: /* @__PURE__ */ jsx("path", {
15
+ d: "M4 6.5l4 4 4-4",
16
+ stroke: "currentColor",
17
+ strokeWidth: "1.75",
18
+ strokeLinecap: "round",
19
+ strokeLinejoin: "round"
20
+ })
21
+ });
22
+ }
23
+ /**
24
+ * ComboBox の選択肢。`ComboBox` の子として置く。
25
+ *
26
+ * @example
27
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
28
+ */
29
+ function ComboBoxItem({ id, isDisabled, children, className }) {
30
+ return /* @__PURE__ */ jsx(ListBoxItem, {
31
+ id,
32
+ isDisabled,
33
+ textValue: typeof children === "string" ? children : void 0,
34
+ "data-slot": "option",
35
+ className: className ?? comboBoxStyles().option(),
36
+ children
37
+ });
38
+ }
39
+ /**
40
+ * 文字を打って絞り込み、一覧から1つ選ぶ。
41
+ *
42
+ * **一覧は画面下端のシートに出る**(Raster は入力欄の隣、Flatlay はフロー内)。
43
+ * 親指で届く位置に選択肢が並び、行は 48px 以上。
44
+ * IME 変換中の Enter と矢印キーは一覧に届かず、変換確定で誤選択しない。
45
+ *
46
+ * @example
47
+ * <ComboBox label="都道府県" onSelectionChange={setPref}>
48
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
49
+ * <ComboBoxItem id="osaka">大阪府</ComboBoxItem>
50
+ * </ComboBox>
51
+ */
52
+ function ComboBox$1({ variant, size, radius, label, placeholder, description, errorMessage, name, selectedKey, defaultSelectedKey, onSelectionChange, inputValue, defaultInputValue, onInputChange, allowsCustomValue, menuTrigger, onOpenChange, onKeyDown, isDisabled, isReadOnly, isRequired, isInvalid, children, className, classNames, id }) {
53
+ const s = comboBoxStyles({
54
+ variant,
55
+ size,
56
+ radius
57
+ });
58
+ const keyProps = useImeSafeKeys(onKeyDown);
59
+ return /* @__PURE__ */ jsxs(ComboBox, {
60
+ id,
61
+ name,
62
+ selectedKey,
63
+ defaultSelectedKey,
64
+ onSelectionChange: (key) => onSelectionChange?.(key === null ? null : String(key)),
65
+ inputValue,
66
+ defaultInputValue,
67
+ onInputChange,
68
+ allowsCustomValue,
69
+ menuTrigger,
70
+ onOpenChange,
71
+ isDisabled,
72
+ isReadOnly,
73
+ isRequired,
74
+ isInvalid,
75
+ "data-slot": "root",
76
+ className: s.root({ class: [className, classNames?.root] }),
77
+ children: [
78
+ label !== void 0 && /* @__PURE__ */ jsx(Label, {
79
+ "data-slot": "label",
80
+ className: s.label({ class: classNames?.label }),
81
+ children: label
82
+ }),
83
+ /* @__PURE__ */ jsxs(Group, {
84
+ "data-slot": "inputWrapper",
85
+ className: s.inputWrapper({ class: classNames?.inputWrapper }),
86
+ children: [/* @__PURE__ */ jsx(Input, {
87
+ "data-slot": "input",
88
+ placeholder,
89
+ className: s.input({ class: classNames?.input }),
90
+ ...keyProps
91
+ }), /* @__PURE__ */ jsx(Button, {
92
+ "data-slot": "trigger",
93
+ className: s.trigger({ class: classNames?.trigger }),
94
+ children: /* @__PURE__ */ jsx("span", {
95
+ "data-slot": "icon",
96
+ className: s.icon({ class: classNames?.icon }),
97
+ children: /* @__PURE__ */ jsx(TriggerIcon, {})
98
+ })
99
+ })]
100
+ }),
101
+ description !== void 0 && /* @__PURE__ */ jsx(Text, {
102
+ slot: "description",
103
+ "data-slot": "description",
104
+ className: s.description({ class: classNames?.description }),
105
+ children: description
106
+ }),
107
+ /* @__PURE__ */ jsx(FieldError, {
108
+ "data-slot": "errorMessage",
109
+ className: s.errorMessage({ class: classNames?.errorMessage }),
110
+ children: errorMessage
111
+ }),
112
+ /* @__PURE__ */ jsx(Popover, {
113
+ "data-slot": "popover",
114
+ className: s.popover({ class: classNames?.popover }),
115
+ children: /* @__PURE__ */ jsx(ListBox, {
116
+ "data-slot": "listbox",
117
+ className: s.listbox({ class: classNames?.listbox }),
118
+ children
119
+ })
120
+ })
121
+ ]
122
+ });
123
+ }
124
+ //#endregion
125
+ export { ComboBox$1 as ComboBox, ComboBoxItem };
126
+
127
+ //# sourceMappingURL=combo-box.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combo-box.mjs","names":["ComboBox","RACComboBox"],"sources":["../../src/combo-box/combo-box.tsx"],"sourcesContent":["'use client'\n\nimport type { ComboBoxProps } from '@novi-ui/core'\nimport { useImeSafeKeys } from '@novi-ui/core/client'\nimport type { ReactNode } from 'react'\nimport {\n Button,\n FieldError,\n Group,\n Input,\n Label,\n ListBox,\n ListBoxItem,\n Popover,\n ComboBox as RACComboBox,\n Text,\n} from 'react-aria-components'\nimport { comboBoxStyles } from './combo-box.styles'\n\nfunction TriggerIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" width=\"1em\" height=\"1em\" fill=\"none\" aria-hidden=\"true\">\n <path\n d=\"M4 6.5l4 4 4-4\"\n stroke=\"currentColor\"\n strokeWidth=\"1.75\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nexport interface ComboBoxItemProps {\n /** 選択値。`onSelectionChange` に渡る */\n id: string\n isDisabled?: boolean\n children?: ReactNode\n className?: string\n}\n\n/**\n * ComboBox の選択肢。`ComboBox` の子として置く。\n *\n * @example\n * <ComboBoxItem id=\"tokyo\">東京都</ComboBoxItem>\n */\nexport function ComboBoxItem({ id, isDisabled, children, className }: ComboBoxItemProps) {\n return (\n <ListBoxItem\n id={id}\n isDisabled={isDisabled}\n textValue={typeof children === 'string' ? children : undefined}\n data-slot=\"option\"\n className={className ?? comboBoxStyles().option()}\n >\n {children}\n </ListBoxItem>\n )\n}\n\n/**\n * 文字を打って絞り込み、一覧から1つ選ぶ。\n *\n * **一覧は画面下端のシートに出る**(Raster は入力欄の隣、Flatlay はフロー内)。\n * 親指で届く位置に選択肢が並び、行は 48px 以上。\n * IME 変換中の Enter と矢印キーは一覧に届かず、変換確定で誤選択しない。\n *\n * @example\n * <ComboBox label=\"都道府県\" onSelectionChange={setPref}>\n * <ComboBoxItem id=\"tokyo\">東京都</ComboBoxItem>\n * <ComboBoxItem id=\"osaka\">大阪府</ComboBoxItem>\n * </ComboBox>\n */\nexport function ComboBox({\n variant,\n size,\n radius,\n label,\n placeholder,\n description,\n errorMessage,\n name,\n selectedKey,\n defaultSelectedKey,\n onSelectionChange,\n inputValue,\n defaultInputValue,\n onInputChange,\n allowsCustomValue,\n menuTrigger,\n onOpenChange,\n onKeyDown,\n isDisabled,\n isReadOnly,\n isRequired,\n isInvalid,\n children,\n className,\n classNames,\n id,\n}: ComboBoxProps) {\n const s = comboBoxStyles({ variant, size, radius })\n const keyProps = useImeSafeKeys<HTMLInputElement>(onKeyDown)\n\n return (\n <RACComboBox\n id={id}\n name={name}\n selectedKey={selectedKey}\n defaultSelectedKey={defaultSelectedKey}\n onSelectionChange={(key) => onSelectionChange?.(key === null ? null : String(key))}\n inputValue={inputValue}\n defaultInputValue={defaultInputValue}\n onInputChange={onInputChange}\n allowsCustomValue={allowsCustomValue}\n menuTrigger={menuTrigger}\n onOpenChange={onOpenChange}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={isInvalid}\n data-slot=\"root\"\n className={s.root({ class: [className, classNames?.root] })}\n >\n {label !== undefined && (\n <Label data-slot=\"label\" className={s.label({ class: classNames?.label })}>\n {label}\n </Label>\n )}\n\n <Group\n data-slot=\"inputWrapper\"\n className={s.inputWrapper({ class: classNames?.inputWrapper })}\n >\n <Input\n data-slot=\"input\"\n placeholder={placeholder}\n className={s.input({ class: classNames?.input })}\n {...keyProps}\n />\n <Button data-slot=\"trigger\" className={s.trigger({ class: classNames?.trigger })}>\n <span data-slot=\"icon\" className={s.icon({ class: classNames?.icon })}>\n <TriggerIcon />\n </span>\n </Button>\n </Group>\n\n {description !== undefined && (\n <Text\n slot=\"description\"\n data-slot=\"description\"\n className={s.description({ class: classNames?.description })}\n >\n {description}\n </Text>\n )}\n\n <FieldError\n data-slot=\"errorMessage\"\n className={s.errorMessage({ class: classNames?.errorMessage })}\n >\n {errorMessage}\n </FieldError>\n\n <Popover data-slot=\"popover\" className={s.popover({ class: classNames?.popover })}>\n <ListBox data-slot=\"listbox\" className={s.listbox({ class: classNames?.listbox })}>\n {children}\n </ListBox>\n </Popover>\n </RACComboBox>\n )\n}\n"],"mappings":";;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EAAE,OAAO,YAAY,MAAM,CAAC;KAC/C,GAAI;IACL,CAAA,GACD,oBAAC,QAAD;KAAQ,aAAU;KAAU,WAAW,EAAE,QAAQ,EAAE,OAAO,YAAY,QAAQ,CAAC;KAC7E,UAAA,oBAAC,QAAD;MAAM,aAAU;MAAO,WAAW,EAAE,KAAK,EAAE,OAAO,YAAY,KAAK,CAAC;MAClE,UAAA,oBAAC,aAAD,CAAc,CAAA;KACV,CAAA;IACA,CAAA,CACH;;GAEN,gBAAgB,KAAA,KACf,oBAAC,MAAD;IACE,MAAK;IACL,aAAU;IACV,WAAW,EAAE,YAAY,EAAE,OAAO,YAAY,YAAY,CAAC;IAE1D,UAAA;GACG,CAAA;GAGR,oBAAC,YAAD;IACE,aAAU;IACV,WAAW,EAAE,aAAa,EAAE,OAAO,YAAY,aAAa,CAAC;IAE5D,UAAA;GACS,CAAA;GAEZ,oBAAC,SAAD;IAAS,aAAU;IAAU,WAAW,EAAE,QAAQ,EAAE,OAAO,YAAY,QAAQ,CAAC;IAC9E,UAAA,oBAAC,SAAD;KAAS,aAAU;KAAU,WAAW,EAAE,QAAQ,EAAE,OAAO,YAAY,QAAQ,CAAC;KAC7E;IACM,CAAA;GACF,CAAA;EACE;;AAEjB"}
@@ -0,0 +1,88 @@
1
+ import { VariantMap } from "@novi-ui/core";
2
+ //#region src/combo-box/combo-box.styles.d.ts
3
+ /**
4
+ * ComboBox のスタイル定義。
5
+ *
6
+ * @example
7
+ * import { comboBoxStyles } from '@novi-ui/tactile'
8
+ * import { tv } from 'tailwind-variants'
9
+ *
10
+ * const myComboBox = tv({ extend: comboBoxStyles, slots: { popover: '!max-h-[50dvh]' } })
11
+ */
12
+ declare const comboBoxStyles: import("tailwind-variants").TVReturnType<{
13
+ variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
14
+ inputWrapper: string;
15
+ }>;
16
+ size: VariantMap<"sm" | "md" | "lg", {
17
+ inputWrapper: string;
18
+ input: string;
19
+ option: string;
20
+ }>;
21
+ radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
22
+ inputWrapper: string;
23
+ }>;
24
+ }, {
25
+ root: string;
26
+ label: string;
27
+ inputWrapper: string;
28
+ input: string;
29
+ trigger: string;
30
+ icon: string;
31
+ popover: string;
32
+ listbox: string;
33
+ option: string;
34
+ description: string;
35
+ errorMessage: string;
36
+ }, undefined, {
37
+ variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
38
+ inputWrapper: string;
39
+ }>;
40
+ size: VariantMap<"sm" | "md" | "lg", {
41
+ inputWrapper: string;
42
+ input: string;
43
+ option: string;
44
+ }>;
45
+ radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
46
+ inputWrapper: string;
47
+ }>;
48
+ }, {
49
+ root: string;
50
+ label: string;
51
+ inputWrapper: string;
52
+ input: string;
53
+ trigger: string;
54
+ icon: string;
55
+ popover: string;
56
+ listbox: string;
57
+ option: string;
58
+ description: string;
59
+ errorMessage: string;
60
+ }, import("tailwind-variants").TVReturnTypeLike<{
61
+ variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
62
+ inputWrapper: string;
63
+ }>;
64
+ size: VariantMap<"sm" | "md" | "lg", {
65
+ inputWrapper: string;
66
+ input: string;
67
+ option: string;
68
+ }>;
69
+ radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
70
+ inputWrapper: string;
71
+ }>;
72
+ }, {
73
+ root: string;
74
+ label: string;
75
+ inputWrapper: string;
76
+ input: string;
77
+ trigger: string;
78
+ icon: string;
79
+ popover: string;
80
+ listbox: string;
81
+ option: string;
82
+ description: string;
83
+ errorMessage: string;
84
+ }>>;
85
+ type ComboBoxStyleProps = Parameters<typeof comboBoxStyles>[0];
86
+ //#endregion
87
+ export { ComboBoxStyleProps, comboBoxStyles };
88
+ //# sourceMappingURL=combo-box.styles.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combo-box.styles.d.mts","names":[],"sources":["../../src/combo-box/combo-box.styles.ts"],"mappings":";;;;;;;;;;;cA4Ha,4CAAc;;IAlD4B;;;IAeN;IAAe;IAAgB;;;IAkB3B;;;;;;;;;;;;;;;;IAjCE;;;IAeN;IAAe;IAAgB;;;IAkB3B;;;;;;;;;;;;;;;;IAjCE;;;IAeN;IAAe;IAAgB;;;IAkB3B;;;;;;;;;;;;;;;KAuBzC,qBAAqB,kBAAkB"}
@@ -0,0 +1,115 @@
1
+ import { disabledState, focusRing } from "../styles/focus-ring.mjs";
2
+ import { tv } from "tailwind-variants";
3
+ //#region src/combo-box/combo-box.styles.ts
4
+ const slots = {
5
+ root: "flex flex-col gap-1.5",
6
+ label: "text-[length:var(--novi-text-sm)] font-medium text-[var(--novi-color-fg)]",
7
+ inputWrapper: [
8
+ "text-[var(--novi-color-fg)]",
9
+ "flex items-center w-full overflow-hidden",
10
+ "bg-[var(--novi-color-surface)]",
11
+ "shadow-[var(--novi-shadow-sm)]",
12
+ "rounded-[var(--novi-radius-md)]",
13
+ "transition-[opacity,box-shadow]",
14
+ "duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]",
15
+ "data-[invalid]:ring-1 data-[invalid]:ring-[var(--novi-color-danger)]",
16
+ focusRing,
17
+ disabledState
18
+ ].join(" "),
19
+ input: [
20
+ "w-full min-w-0 bg-transparent outline-none",
21
+ "text-[var(--novi-color-fg)]",
22
+ "placeholder:text-[var(--novi-color-muted)]"
23
+ ].join(" "),
24
+ trigger: [
25
+ "shrink-0 self-stretch aspect-square inline-flex items-center justify-center",
26
+ "text-[var(--novi-color-muted)]",
27
+ "outline-none",
28
+ "data-[pressed]:scale-[0.97]",
29
+ "motion-reduce:data-[pressed]:scale-100",
30
+ "data-[focus-visible]:bg-[var(--novi-color-subtle)]",
31
+ "data-[disabled]:opacity-40 data-[disabled]:cursor-default",
32
+ "transition-[background-color,transform]",
33
+ "duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]"
34
+ ].join(" "),
35
+ icon: "shrink-0 inline-flex",
36
+ popover: [
37
+ "!fixed !top-auto !inset-x-0 !bottom-0 !max-w-none !w-full",
38
+ "!max-h-[70dvh]",
39
+ "bg-[var(--novi-color-surface)]",
40
+ "text-[var(--novi-color-fg)]",
41
+ "rounded-t-[var(--novi-radius-lg)]",
42
+ "shadow-[var(--novi-shadow-lg)]",
43
+ "overflow-auto",
44
+ "pb-[env(safe-area-inset-bottom,0px)]",
45
+ "pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]",
46
+ "data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]"
47
+ ].join(" "),
48
+ listbox: "outline-none p-1.5 flex flex-col",
49
+ option: [
50
+ "flex items-center justify-between gap-[var(--novi-gap-inline)]",
51
+ "px-[var(--novi-pad-control-x-md)] cursor-pointer outline-none",
52
+ "text-[var(--novi-color-fg)]",
53
+ "rounded-[var(--novi-radius-md)]",
54
+ "transition-[background-color] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]",
55
+ "data-[focused]:bg-[var(--novi-color-subtle)]",
56
+ "data-[selected]:font-bold",
57
+ disabledState
58
+ ].join(" "),
59
+ description: "text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]",
60
+ errorMessage: "text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)]"
61
+ };
62
+ /**
63
+ * ComboBox のスタイル定義。
64
+ *
65
+ * @example
66
+ * import { comboBoxStyles } from '@novi-ui/tactile'
67
+ * import { tv } from 'tailwind-variants'
68
+ *
69
+ * const myComboBox = tv({ extend: comboBoxStyles, slots: { popover: '!max-h-[50dvh]' } })
70
+ */
71
+ const comboBoxStyles = tv({
72
+ slots,
73
+ variants: {
74
+ variant: {
75
+ solid: { inputWrapper: "bg-[var(--novi-color-surface)] shadow-[var(--novi-shadow-sm)]" },
76
+ outline: { inputWrapper: "bg-transparent shadow-[var(--novi-shadow-none)] ring-1 ring-[var(--novi-color-border-strong)]" },
77
+ soft: { inputWrapper: "bg-[var(--novi-color-subtle)] shadow-[var(--novi-shadow-none)]" },
78
+ ghost: { inputWrapper: "bg-transparent shadow-[var(--novi-shadow-none)]" },
79
+ plain: { inputWrapper: "bg-transparent shadow-[var(--novi-shadow-none)] rounded-[var(--novi-radius-none)] border-b border-[var(--novi-color-border-strong)]" }
80
+ },
81
+ size: {
82
+ sm: {
83
+ inputWrapper: "h-10",
84
+ input: "px-[var(--novi-pad-control-x-sm)] text-[length:var(--novi-text-base)]",
85
+ option: "h-12 text-[length:var(--novi-text-sm)]"
86
+ },
87
+ md: {
88
+ inputWrapper: "h-12",
89
+ input: "px-[var(--novi-pad-control-x-md)] text-[length:var(--novi-text-base)]",
90
+ option: "h-14 text-[length:var(--novi-text-base)]"
91
+ },
92
+ lg: {
93
+ inputWrapper: "h-14",
94
+ input: "px-[var(--novi-pad-control-x-lg)] text-[length:var(--novi-text-lg)]",
95
+ option: "h-16 text-[length:var(--novi-text-base)]"
96
+ }
97
+ },
98
+ radius: {
99
+ none: { inputWrapper: "rounded-[var(--novi-radius-none)]" },
100
+ sm: { inputWrapper: "rounded-[var(--novi-radius-sm)]" },
101
+ md: { inputWrapper: "rounded-[var(--novi-radius-md)]" },
102
+ lg: { inputWrapper: "rounded-[var(--novi-radius-lg)]" },
103
+ full: { inputWrapper: "rounded-[var(--novi-radius-full)]" }
104
+ }
105
+ },
106
+ defaultVariants: {
107
+ variant: "outline",
108
+ size: "md",
109
+ radius: "md"
110
+ }
111
+ });
112
+ //#endregion
113
+ export { comboBoxStyles };
114
+
115
+ //# sourceMappingURL=combo-box.styles.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combo-box.styles.mjs","names":[],"sources":["../../src/combo-box/combo-box.styles.ts"],"sourcesContent":["import type {\n comboBoxRequiredSlots,\n comboBoxSlots,\n NoviRadius,\n NoviSize,\n NoviVariant,\n SlotMap,\n VariantMap,\n} from '@novi-ui/core'\nimport { tv } from 'tailwind-variants'\nimport { disabledState, focusRing } from '../styles/focus-ring'\n\nconst slots = {\n root: 'flex flex-col gap-1.5',\n label: 'text-[length:var(--novi-text-sm)] font-medium text-[var(--novi-color-fg)]',\n // Input と同じ持ち上がった面。開くボタンが右端に付くので、余白は input 側に置く\n inputWrapper: [\n 'text-[var(--novi-color-fg)]',\n 'flex items-center w-full overflow-hidden',\n 'bg-[var(--novi-color-surface)]',\n 'shadow-[var(--novi-shadow-sm)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[opacity,box-shadow]',\n 'duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[invalid]:ring-1 data-[invalid]:ring-[var(--novi-color-danger)]',\n focusRing,\n disabledState,\n ].join(' '),\n input: [\n 'w-full min-w-0 bg-transparent outline-none',\n 'text-[var(--novi-color-fg)]',\n 'placeholder:text-[var(--novi-color-muted)]',\n ].join(' '),\n // 開くボタンは**指で押す面**。枠の高さいっぱいの正方形(NumberField の増減と同じ型)\n trigger: [\n 'shrink-0 self-stretch aspect-square inline-flex items-center justify-center',\n 'text-[var(--novi-color-muted)]',\n 'outline-none',\n 'data-[pressed]:scale-[0.97]',\n 'motion-reduce:data-[pressed]:scale-100',\n 'data-[focus-visible]:bg-[var(--novi-color-subtle)]',\n 'data-[disabled]:opacity-40 data-[disabled]:cursor-default',\n 'transition-[background-color,transform]',\n 'duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n ].join(' '),\n icon: 'shrink-0 inline-flex',\n popover: [\n // ここが Raster との構造差そのもの。入力欄の隣ではなく画面下端に張り付く(Select と同じ)\n '!fixed !top-auto !inset-x-0 !bottom-0 !max-w-none !w-full',\n '!max-h-[70dvh]',\n 'bg-[var(--novi-color-surface)]',\n 'text-[var(--novi-color-fg)]',\n 'rounded-t-[var(--novi-radius-lg)]',\n 'shadow-[var(--novi-shadow-lg)]',\n 'overflow-auto',\n 'pb-[env(safe-area-inset-bottom,0px)]',\n 'pl-[env(safe-area-inset-left,0px)] pr-[env(safe-area-inset-right,0px)]',\n 'data-[entering]:motion-safe:animate-[novi-slide-up_260ms_var(--novi-ease-emphasized)]',\n ].join(' '),\n listbox: 'outline-none p-1.5 flex flex-col',\n option: [\n 'flex items-center justify-between gap-[var(--novi-gap-inline)]',\n 'px-[var(--novi-pad-control-x-md)] cursor-pointer outline-none',\n 'text-[var(--novi-color-fg)]',\n 'rounded-[var(--novi-radius-md)]',\n 'transition-[background-color] duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n 'data-[focused]:bg-[var(--novi-color-subtle)]',\n 'data-[selected]:font-bold',\n disabledState,\n ].join(' '),\n description: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)]',\n errorMessage: 'text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)]',\n} satisfies SlotMap<typeof comboBoxSlots, (typeof comboBoxRequiredSlots)[number]>\n\nconst variant: VariantMap<NoviVariant, { inputWrapper: string }> = {\n solid: { inputWrapper: 'bg-[var(--novi-color-surface)] shadow-[var(--novi-shadow-sm)]' },\n outline: {\n inputWrapper:\n 'bg-transparent shadow-[var(--novi-shadow-none)] ring-1 ring-[var(--novi-color-border-strong)]',\n },\n soft: { inputWrapper: 'bg-[var(--novi-color-subtle)] shadow-[var(--novi-shadow-none)]' },\n ghost: { inputWrapper: 'bg-transparent shadow-[var(--novi-shadow-none)]' },\n plain: {\n inputWrapper:\n 'bg-transparent shadow-[var(--novi-shadow-none)] rounded-[var(--novi-radius-none)] border-b border-[var(--novi-color-border-strong)]',\n },\n}\n\n/** 高さは Button / Input と揃える。40 / 48 / 56px。一覧の行は 48px 以上。 */\nconst size: VariantMap<NoviSize, { inputWrapper: string; input: string; option: string }> = {\n sm: {\n inputWrapper: 'h-10',\n input: 'px-[var(--novi-pad-control-x-sm)] text-[length:var(--novi-text-base)]',\n option: 'h-12 text-[length:var(--novi-text-sm)]',\n },\n md: {\n inputWrapper: 'h-12',\n input: 'px-[var(--novi-pad-control-x-md)] text-[length:var(--novi-text-base)]',\n option: 'h-14 text-[length:var(--novi-text-base)]',\n },\n lg: {\n inputWrapper: 'h-14',\n input: 'px-[var(--novi-pad-control-x-lg)] text-[length:var(--novi-text-lg)]',\n option: 'h-16 text-[length:var(--novi-text-base)]',\n },\n}\n\nconst radius: VariantMap<NoviRadius, { inputWrapper: string }> = {\n none: { inputWrapper: 'rounded-[var(--novi-radius-none)]' },\n sm: { inputWrapper: 'rounded-[var(--novi-radius-sm)]' },\n md: { inputWrapper: 'rounded-[var(--novi-radius-md)]' },\n lg: { inputWrapper: 'rounded-[var(--novi-radius-lg)]' },\n full: { inputWrapper: 'rounded-[var(--novi-radius-full)]' },\n}\n\n/**\n * ComboBox のスタイル定義。\n *\n * @example\n * import { comboBoxStyles } from '@novi-ui/tactile'\n * import { tv } from 'tailwind-variants'\n *\n * const myComboBox = tv({ extend: comboBoxStyles, slots: { popover: '!max-h-[50dvh]' } })\n */\nexport const comboBoxStyles = tv({\n slots,\n variants: { variant, size, radius },\n defaultVariants: { variant: 'outline', size: 'md', radius: 'md' },\n})\n\nexport type ComboBoxStyleProps = Parameters<typeof comboBoxStyles>[0]\n"],"mappings":";;;AAYA,MAAM,QAAQ;CACZ,MAAM;CACN,OAAO;CAEP,cAAc;EACZ;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,OAAO;EACL;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CAEV,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,MAAM;CACN,SAAS;EAEP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,SAAS;CACT,QAAQ;EACN;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC,CAAC,KAAK,GAAG;CACV,aAAa;CACb,cAAc;AAChB;;;;;;;;;;AAoDA,MAAa,iBAAiB,GAAG;CAC/B;CACA,UAAU;EAAE;GAnDZ,OAAO,EAAE,cAAc,gEAAgE;GACvF,SAAS,EACP,cACE,gGACJ;GACA,MAAM,EAAE,cAAc,iEAAiE;GACvF,OAAO,EAAE,cAAc,kDAAkD;GACzE,OAAO,EACL,cACE,sIACJ;EAyCY;EAAS;GApCrB,IAAI;IACF,cAAc;IACd,OAAO;IACP,QAAQ;GACV;GACA,IAAI;IACF,cAAc;IACd,OAAO;IACP,QAAQ;GACV;GACA,IAAI;IACF,cAAc;IACd,OAAO;IACP,QAAQ;GACV;EAsBqB;EAAM;GAlB3B,MAAM,EAAE,cAAc,oCAAoC;GAC1D,IAAI,EAAE,cAAc,kCAAkC;GACtD,IAAI,EAAE,cAAc,kCAAkC;GACtD,IAAI,EAAE,cAAc,kCAAkC;GACtD,MAAM,EAAE,cAAc,oCAAoC;EAc/B;CAAO;CAClC,iBAAiB;EAAE,SAAS;EAAW,MAAM;EAAM,QAAQ;CAAK;AAClE,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ComboBox, ComboBoxItem, ComboBoxItemProps } from "./combo-box.mjs";
2
+ import { ComboBoxStyleProps, comboBoxStyles } from "./combo-box.styles.mjs";
3
+ export { ComboBox, ComboBoxItem, type ComboBoxItemProps, type ComboBoxStyleProps, comboBoxStyles };
@@ -0,0 +1,16 @@
1
+ import { DatePickerProps } from "@novi-ui/core";
2
+ //#region src/date-picker/date-picker.d.ts
3
+ /**
4
+ * 日付を入力する。年 / 月 / 日のマスに直接打つか、カレンダーを開いて選ぶ。
5
+ *
6
+ * **カレンダーは画面下端のシートに出る**(Raster は入力欄の隣、Flatlay はフロー内)。
7
+ * 升目は 44px で、親指で押せる。
8
+ * 値は `@internationalized/date` の `CalendarDate`(ADR-B6)。
9
+ *
10
+ * @example
11
+ * <DatePicker label="出荷日" value={date} onChange={setDate} minValue={today} />
12
+ */
13
+ declare function DatePicker({ variant, size, radius, label, description, errorMessage, name, value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, placeholderValue, isOpen, defaultOpen, onOpenChange, isDisabled, isReadOnly, isRequired, isInvalid, className, classNames, id }: DatePickerProps): import("react").JSX.Element;
14
+ //#endregion
15
+ export { DatePicker };
16
+ //# sourceMappingURL=date-picker.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-picker.d.mts","names":[],"sources":["../../src/date-picker/date-picker.tsx"],"mappings":";;;;;;;;;;;;iBAiDgB,aACd,SACA,MACA,QACA,OACA,aACA,cACA,MACA,OACA,cACA,UACA,UACA,UACA,mBACA,kBACA,QACA,aACA,cACA,YACA,YACA,YACA,WACA,WACA,YACA,MACC,kCAAe,IAAA"}
@@ -0,0 +1,162 @@
1
+ "use client";
2
+ import { datePickerStyles } from "./date-picker.styles.mjs";
3
+ import { Button, Calendar, CalendarCell, CalendarGrid, DateInput, DatePicker, DateSegment, Dialog, FieldError, Group, Heading, Label, Popover, Text } from "react-aria-components";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ //#region src/date-picker/date-picker.tsx
6
+ function CalendarIcon() {
7
+ return /* @__PURE__ */ jsxs("svg", {
8
+ viewBox: "0 0 16 16",
9
+ width: "1em",
10
+ height: "1em",
11
+ fill: "none",
12
+ "aria-hidden": "true",
13
+ children: [/* @__PURE__ */ jsx("rect", {
14
+ x: "2.5",
15
+ y: "3.5",
16
+ width: "11",
17
+ height: "10",
18
+ stroke: "currentColor",
19
+ strokeWidth: "1.5"
20
+ }), /* @__PURE__ */ jsx("path", {
21
+ d: "M2.5 6.5h11M5.5 2v3M10.5 2v3",
22
+ stroke: "currentColor",
23
+ strokeWidth: "1.5"
24
+ })]
25
+ });
26
+ }
27
+ function ChevronIcon({ direction }) {
28
+ return /* @__PURE__ */ jsx("svg", {
29
+ viewBox: "0 0 16 16",
30
+ width: "1em",
31
+ height: "1em",
32
+ fill: "none",
33
+ "aria-hidden": "true",
34
+ children: /* @__PURE__ */ jsx("path", {
35
+ d: direction === "prev" ? "M10 4l-4 4 4 4" : "M6 4l4 4-4 4",
36
+ stroke: "currentColor",
37
+ strokeWidth: "1.5"
38
+ })
39
+ });
40
+ }
41
+ /**
42
+ * 日付を入力する。年 / 月 / 日のマスに直接打つか、カレンダーを開いて選ぶ。
43
+ *
44
+ * **カレンダーは画面下端のシートに出る**(Raster は入力欄の隣、Flatlay はフロー内)。
45
+ * 升目は 44px で、親指で押せる。
46
+ * 値は `@internationalized/date` の `CalendarDate`(ADR-B6)。
47
+ *
48
+ * @example
49
+ * <DatePicker label="出荷日" value={date} onChange={setDate} minValue={today} />
50
+ */
51
+ function DatePicker$1({ variant, size, radius, label, description, errorMessage, name, value, defaultValue, onChange, minValue, maxValue, isDateUnavailable, placeholderValue, isOpen, defaultOpen, onOpenChange, isDisabled, isReadOnly, isRequired, isInvalid, className, classNames, id }) {
52
+ const s = datePickerStyles({
53
+ variant,
54
+ size,
55
+ radius
56
+ });
57
+ return /* @__PURE__ */ jsxs(DatePicker, {
58
+ id,
59
+ name,
60
+ value,
61
+ defaultValue,
62
+ onChange,
63
+ minValue,
64
+ maxValue,
65
+ isDateUnavailable,
66
+ placeholderValue,
67
+ isOpen,
68
+ defaultOpen,
69
+ onOpenChange,
70
+ isDisabled,
71
+ isReadOnly,
72
+ isRequired,
73
+ isInvalid,
74
+ granularity: "day",
75
+ "data-slot": "root",
76
+ className: `group ${s.root({ class: [className, classNames?.root] })}`,
77
+ children: [
78
+ label !== void 0 && /* @__PURE__ */ jsx(Label, {
79
+ "data-slot": "label",
80
+ className: s.label({ class: classNames?.label }),
81
+ children: label
82
+ }),
83
+ /* @__PURE__ */ jsxs(Group, {
84
+ "data-slot": "inputWrapper",
85
+ className: s.inputWrapper({ class: classNames?.inputWrapper }),
86
+ children: [/* @__PURE__ */ jsx(DateInput, {
87
+ "data-slot": "dateInput",
88
+ className: s.dateInput({ class: classNames?.dateInput }),
89
+ children: (segment) => /* @__PURE__ */ jsx(DateSegment, {
90
+ segment,
91
+ "data-slot": "segment",
92
+ className: s.segment({ class: classNames?.segment })
93
+ })
94
+ }), /* @__PURE__ */ jsx(Button, {
95
+ "data-slot": "trigger",
96
+ className: s.trigger({ class: classNames?.trigger }),
97
+ children: /* @__PURE__ */ jsx("span", {
98
+ "data-slot": "icon",
99
+ className: s.icon({ class: classNames?.icon }),
100
+ children: /* @__PURE__ */ jsx(CalendarIcon, {})
101
+ })
102
+ })]
103
+ }),
104
+ description !== void 0 && /* @__PURE__ */ jsx(Text, {
105
+ slot: "description",
106
+ "data-slot": "description",
107
+ className: s.description({ class: classNames?.description }),
108
+ children: description
109
+ }),
110
+ /* @__PURE__ */ jsx(FieldError, {
111
+ "data-slot": "errorMessage",
112
+ className: s.errorMessage({ class: classNames?.errorMessage }),
113
+ children: errorMessage
114
+ }),
115
+ /* @__PURE__ */ jsx(Popover, {
116
+ "data-slot": "popover",
117
+ className: s.popover({ class: classNames?.popover }),
118
+ children: /* @__PURE__ */ jsx(Dialog, {
119
+ className: "outline-none",
120
+ children: /* @__PURE__ */ jsxs(Calendar, {
121
+ "data-slot": "calendar",
122
+ className: s.calendar({ class: classNames?.calendar }),
123
+ children: [/* @__PURE__ */ jsxs("header", {
124
+ "data-slot": "calendarHeader",
125
+ className: s.calendarHeader({ class: classNames?.calendarHeader }),
126
+ children: [
127
+ /* @__PURE__ */ jsx(Button, {
128
+ slot: "previous",
129
+ "data-slot": "prevButton",
130
+ className: s.prevButton({ class: classNames?.prevButton }),
131
+ children: /* @__PURE__ */ jsx(ChevronIcon, { direction: "prev" })
132
+ }),
133
+ /* @__PURE__ */ jsx(Heading, {
134
+ "data-slot": "calendarTitle",
135
+ className: s.calendarTitle({ class: classNames?.calendarTitle })
136
+ }),
137
+ /* @__PURE__ */ jsx(Button, {
138
+ slot: "next",
139
+ "data-slot": "nextButton",
140
+ className: s.nextButton({ class: classNames?.nextButton }),
141
+ children: /* @__PURE__ */ jsx(ChevronIcon, { direction: "next" })
142
+ })
143
+ ]
144
+ }), /* @__PURE__ */ jsx(CalendarGrid, {
145
+ "data-slot": "calendarGrid",
146
+ className: s.calendarGrid({ class: classNames?.calendarGrid }),
147
+ children: (date) => /* @__PURE__ */ jsx(CalendarCell, {
148
+ date,
149
+ "data-slot": "calendarCell",
150
+ className: s.calendarCell({ class: classNames?.calendarCell })
151
+ })
152
+ })]
153
+ })
154
+ })
155
+ })
156
+ ]
157
+ });
158
+ }
159
+ //#endregion
160
+ export { DatePicker$1 as DatePicker };
161
+
162
+ //# sourceMappingURL=date-picker.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-picker.mjs","names":["DatePicker","RACDatePicker"],"sources":["../../src/date-picker/date-picker.tsx"],"sourcesContent":["'use client'\n\nimport type { DatePickerProps } from '@novi-ui/core'\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n DateInput,\n DateSegment,\n Dialog,\n FieldError,\n Group,\n Heading,\n Label,\n Popover,\n DatePicker as RACDatePicker,\n Text,\n} from 'react-aria-components'\nimport { datePickerStyles } from './date-picker.styles'\n\nfunction CalendarIcon() {\n return (\n <svg viewBox=\"0 0 16 16\" width=\"1em\" height=\"1em\" fill=\"none\" aria-hidden=\"true\">\n <rect x=\"2.5\" y=\"3.5\" width=\"11\" height=\"10\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M2.5 6.5h11M5.5 2v3M10.5 2v3\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n )\n}\n\nfunction ChevronIcon({ direction }: { direction: 'prev' | 'next' }) {\n const d = direction === 'prev' ? 'M10 4l-4 4 4 4' : 'M6 4l4 4-4 4'\n return (\n <svg viewBox=\"0 0 16 16\" width=\"1em\" height=\"1em\" fill=\"none\" aria-hidden=\"true\">\n <path d={d} stroke=\"currentColor\" strokeWidth=\"1.5\" />\n </svg>\n )\n}\n\n/**\n * 日付を入力する。年 / 月 / 日のマスに直接打つか、カレンダーを開いて選ぶ。\n *\n * **カレンダーは画面下端のシートに出る**(Raster は入力欄の隣、Flatlay はフロー内)。\n * 升目は 44px で、親指で押せる。\n * 値は `@internationalized/date` の `CalendarDate`(ADR-B6)。\n *\n * @example\n * <DatePicker label=\"出荷日\" value={date} onChange={setDate} minValue={today} />\n */\nexport function DatePicker({\n variant,\n size,\n radius,\n label,\n description,\n errorMessage,\n name,\n value,\n defaultValue,\n onChange,\n minValue,\n maxValue,\n isDateUnavailable,\n placeholderValue,\n isOpen,\n defaultOpen,\n onOpenChange,\n isDisabled,\n isReadOnly,\n isRequired,\n isInvalid,\n className,\n classNames,\n id,\n}: DatePickerProps) {\n const s = datePickerStyles({ variant, size, radius })\n\n return (\n <RACDatePicker\n id={id}\n name={name}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n minValue={minValue}\n maxValue={maxValue}\n isDateUnavailable={isDateUnavailable}\n placeholderValue={placeholderValue}\n isOpen={isOpen}\n defaultOpen={defaultOpen}\n onOpenChange={onOpenChange}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired}\n isInvalid={isInvalid}\n granularity=\"day\"\n data-slot=\"root\"\n className={`group ${s.root({ class: [className, classNames?.root] })}`}\n >\n {label !== undefined && (\n <Label data-slot=\"label\" className={s.label({ class: classNames?.label })}>\n {label}\n </Label>\n )}\n\n <Group\n data-slot=\"inputWrapper\"\n className={s.inputWrapper({ class: classNames?.inputWrapper })}\n >\n <DateInput data-slot=\"dateInput\" className={s.dateInput({ class: classNames?.dateInput })}>\n {(segment) => (\n <DateSegment\n segment={segment}\n data-slot=\"segment\"\n className={s.segment({ class: classNames?.segment })}\n />\n )}\n </DateInput>\n <Button data-slot=\"trigger\" className={s.trigger({ class: classNames?.trigger })}>\n <span data-slot=\"icon\" className={s.icon({ class: classNames?.icon })}>\n <CalendarIcon />\n </span>\n </Button>\n </Group>\n\n {description !== undefined && (\n <Text\n slot=\"description\"\n data-slot=\"description\"\n className={s.description({ class: classNames?.description })}\n >\n {description}\n </Text>\n )}\n\n <FieldError\n data-slot=\"errorMessage\"\n className={s.errorMessage({ class: classNames?.errorMessage })}\n >\n {errorMessage}\n </FieldError>\n\n <Popover data-slot=\"popover\" className={s.popover({ class: classNames?.popover })}>\n <Dialog className=\"outline-none\">\n <Calendar data-slot=\"calendar\" className={s.calendar({ class: classNames?.calendar })}>\n <header\n data-slot=\"calendarHeader\"\n className={s.calendarHeader({ class: classNames?.calendarHeader })}\n >\n <Button\n slot=\"previous\"\n data-slot=\"prevButton\"\n className={s.prevButton({ class: classNames?.prevButton })}\n >\n <ChevronIcon direction=\"prev\" />\n </Button>\n <Heading\n data-slot=\"calendarTitle\"\n className={s.calendarTitle({ class: classNames?.calendarTitle })}\n />\n <Button\n slot=\"next\"\n data-slot=\"nextButton\"\n className={s.nextButton({ class: classNames?.nextButton })}\n >\n <ChevronIcon direction=\"next\" />\n </Button>\n </header>\n <CalendarGrid\n data-slot=\"calendarGrid\"\n className={s.calendarGrid({ class: classNames?.calendarGrid })}\n >\n {(date) => (\n <CalendarCell\n date={date}\n data-slot=\"calendarCell\"\n className={s.calendarCell({ class: classNames?.calendarCell })}\n />\n )}\n </CalendarGrid>\n </Calendar>\n </Dialog>\n </Popover>\n </RACDatePicker>\n )\n}\n"],"mappings":";;;;;AAqBA,SAAS,eAAe;CACtB,OACE,qBAAC,OAAD;EAAK,SAAQ;EAAY,OAAM;EAAM,QAAO;EAAM,MAAK;EAAO,eAAY;EAA1E,UAAA,CACE,oBAAC,QAAD;GAAM,GAAE;GAAM,GAAE;GAAM,OAAM;GAAK,QAAO;GAAK,QAAO;GAAe,aAAY;EAAO,CAAA,GACtF,oBAAC,QAAD;GAAM,GAAE;GAA+B,QAAO;GAAe,aAAY;EAAO,CAAA,CAC7E;;AAET;AAEA,SAAS,YAAY,EAAE,aAA6C;CAElE,OACE,oBAAC,OAAD;EAAK,SAAQ;EAAY,OAAM;EAAM,QAAO;EAAM,MAAK;EAAO,eAAY;EACxE,UAAA,oBAAC,QAAD;GAAM,GAHA,cAAc,SAAS,mBAAmB;GAGpC,QAAO;GAAe,aAAY;EAAO,CAAA;CAClD,CAAA;AAET;;;;;;;;;;;AAYA,S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