@novi-ui/flatlay 0.3.0 → 0.4.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 (52) hide show
  1. package/dist/combo-box/combo-box.d.mts +37 -0
  2. package/dist/combo-box/combo-box.d.mts.map +1 -0
  3. package/dist/combo-box/combo-box.mjs +129 -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 +113 -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 +140 -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 +131 -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 +9 -9
  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 +93 -0
  26. package/dist/number-field/number-field.mjs.map +1 -0
  27. package/dist/number-field/number-field.styles.d.mts +88 -0
  28. package/dist/number-field/number-field.styles.d.mts.map +1 -0
  29. package/dist/number-field/number-field.styles.mjs +102 -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 +13 -0
  33. package/dist/pagination/pagination.d.mts.map +1 -0
  34. package/dist/pagination/pagination.mjs +98 -0
  35. package/dist/pagination/pagination.mjs.map +1 -0
  36. package/dist/pagination/pagination.styles.d.mts +67 -0
  37. package/dist/pagination/pagination.styles.d.mts.map +1 -0
  38. package/dist/pagination/pagination.styles.mjs +83 -0
  39. package/dist/pagination/pagination.styles.mjs.map +1 -0
  40. package/dist/select/select.d.mts +1 -1
  41. package/dist/select/select.mjs +1 -1
  42. package/dist/select/select.mjs.map +1 -1
  43. package/dist/table/index.d.mts +3 -0
  44. package/dist/table/table.d.mts +104 -0
  45. package/dist/table/table.d.mts.map +1 -0
  46. package/dist/table/table.mjs +167 -0
  47. package/dist/table/table.mjs.map +1 -0
  48. package/dist/table/table.styles.d.mts +58 -0
  49. package/dist/table/table.styles.d.mts.map +1 -0
  50. package/dist/table/table.styles.mjs +84 -0
  51. package/dist/table/table.styles.mjs.map +1 -0
  52. package/package.json +5 -4
@@ -0,0 +1,37 @@
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
+ * 選択済みの印は行頭の `▸`(Select と同じ)。
15
+ *
16
+ * @example
17
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
18
+ */
19
+ declare function ComboBoxItem({ id, isDisabled, children, className }: ComboBoxItemProps): import("react").JSX.Element;
20
+ /**
21
+ * 文字を打って絞り込み、一覧から1つ選ぶ。
22
+ * **一覧は入力欄の直後、フローの中に展開される**(Raster は隣に浮き、Tactile は画面下端のシート)。
23
+ *
24
+ * 開くと後続が押し下げられるので、何かが隠れることが無い。打つたびに絞られて
25
+ * 一覧の高さが変わり、その分だけ後続が上下する。それが帳票の挙動。
26
+ * IME 変換中の Enter と矢印キーは一覧に届かず、変換確定で誤選択しない。
27
+ *
28
+ * @example
29
+ * <ComboBox label="都道府県" onSelectionChange={setPref}>
30
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
31
+ * <ComboBoxItem id="osaka">大阪府</ComboBoxItem>
32
+ * </ComboBox>
33
+ */
34
+ 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;
35
+ //#endregion
36
+ export { ComboBox, ComboBoxItem, ComboBoxItemProps };
37
+ //# 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":";;;UAmBiB;;EAEf;EACA;EACA,WAAW;EACX;;;;;;;;;;iBAWc,eAAe,IAAI,YAAY,UAAU,aAAa,oCAAiB,IAAA;;;;;;;;;;;;;;;iBAmCvE,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,129 @@
1
+ "use client";
2
+ import { InflowPopover } from "../styles/inflow.mjs";
3
+ import { comboBoxStyles, optionMarkerClass } from "./combo-box.styles.mjs";
4
+ import { Button, ComboBox, FieldError, Group, Input, Label, ListBox, ListBoxItem, Text } from "react-aria-components";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ import { useImeSafeKeys } from "@novi-ui/core/client";
7
+ //#region src/combo-box/combo-box.tsx
8
+ /**
9
+ * ComboBox の選択肢。`ComboBox` の子として置く。
10
+ *
11
+ * 選択済みの印は行頭の `▸`(Select と同じ)。
12
+ *
13
+ * @example
14
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
15
+ */
16
+ function ComboBoxItem({ id, isDisabled, children, className }) {
17
+ return /* @__PURE__ */ jsx(ListBoxItem, {
18
+ id,
19
+ isDisabled,
20
+ textValue: typeof children === "string" ? children : void 0,
21
+ "data-slot": "option",
22
+ className: className ?? comboBoxStyles().option(),
23
+ children: ({ isSelected }) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("span", {
24
+ "aria-hidden": "true",
25
+ className: optionMarkerClass,
26
+ children: isSelected ? "▸" : ""
27
+ }), /* @__PURE__ */ jsx("span", {
28
+ className: "truncate",
29
+ children
30
+ })] })
31
+ });
32
+ }
33
+ /**
34
+ * 文字を打って絞り込み、一覧から1つ選ぶ。
35
+ * **一覧は入力欄の直後、フローの中に展開される**(Raster は隣に浮き、Tactile は画面下端のシート)。
36
+ *
37
+ * 開くと後続が押し下げられるので、何かが隠れることが無い。打つたびに絞られて
38
+ * 一覧の高さが変わり、その分だけ後続が上下する。それが帳票の挙動。
39
+ * IME 変換中の Enter と矢印キーは一覧に届かず、変換確定で誤選択しない。
40
+ *
41
+ * @example
42
+ * <ComboBox label="都道府県" onSelectionChange={setPref}>
43
+ * <ComboBoxItem id="tokyo">東京都</ComboBoxItem>
44
+ * <ComboBoxItem id="osaka">大阪府</ComboBoxItem>
45
+ * </ComboBox>
46
+ */
47
+ 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 }) {
48
+ const s = comboBoxStyles({
49
+ variant,
50
+ size,
51
+ radius
52
+ });
53
+ const keyProps = useImeSafeKeys(onKeyDown);
54
+ return /* @__PURE__ */ jsxs(ComboBox, {
55
+ id,
56
+ name,
57
+ selectedKey,
58
+ defaultSelectedKey,
59
+ onSelectionChange: (key) => onSelectionChange?.(key === null ? null : String(key)),
60
+ inputValue,
61
+ defaultInputValue,
62
+ onInputChange,
63
+ allowsCustomValue,
64
+ menuTrigger,
65
+ onOpenChange,
66
+ isDisabled,
67
+ isReadOnly,
68
+ isRequired,
69
+ isInvalid,
70
+ "data-slot": "root",
71
+ className: `group ${s.root({ class: [className, classNames?.root] })}`,
72
+ children: [
73
+ label !== void 0 && /* @__PURE__ */ jsx(Label, {
74
+ "data-slot": "label",
75
+ className: s.label({ class: classNames?.label }),
76
+ children: label
77
+ }),
78
+ /* @__PURE__ */ jsxs(Group, {
79
+ "data-slot": "inputWrapper",
80
+ className: s.inputWrapper({ class: classNames?.inputWrapper }),
81
+ children: [/* @__PURE__ */ jsx(Input, {
82
+ "data-slot": "input",
83
+ placeholder,
84
+ className: s.input({ class: classNames?.input }),
85
+ ...keyProps
86
+ }), /* @__PURE__ */ jsx(Button, {
87
+ "data-slot": "trigger",
88
+ className: s.trigger({ class: classNames?.trigger }),
89
+ children: /* @__PURE__ */ jsxs("span", {
90
+ "aria-hidden": "true",
91
+ "data-slot": "icon",
92
+ className: s.icon({ class: classNames?.icon }),
93
+ children: [/* @__PURE__ */ jsx("span", {
94
+ className: "group-data-[open]:hidden",
95
+ children: "▾"
96
+ }), /* @__PURE__ */ jsx("span", {
97
+ className: "hidden group-data-[open]:inline",
98
+ children: "▴"
99
+ })]
100
+ })
101
+ })]
102
+ }),
103
+ /* @__PURE__ */ jsx(InflowPopover, {
104
+ dataSlot: "popover",
105
+ className: s.popover({ class: classNames?.popover }),
106
+ children: /* @__PURE__ */ jsx(ListBox, {
107
+ "data-slot": "listbox",
108
+ className: s.listbox({ class: classNames?.listbox }),
109
+ children
110
+ })
111
+ }),
112
+ description !== void 0 && /* @__PURE__ */ jsx(Text, {
113
+ slot: "description",
114
+ "data-slot": "description",
115
+ className: s.description({ class: classNames?.description }),
116
+ children: description
117
+ }),
118
+ /* @__PURE__ */ jsx(FieldError, {
119
+ "data-slot": "errorMessage",
120
+ className: s.errorMessage({ class: classNames?.errorMessage }),
121
+ children: errorMessage
122
+ })
123
+ ]
124
+ });
125
+ }
126
+ //#endregion
127
+ export { ComboBox$1 as ComboBox, ComboBoxItem };
128
+
129
+ //# 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 ComboBox as RACComboBox,\n Text,\n} from 'react-aria-components'\nimport { InflowPopover } from '../styles/inflow'\nimport { comboBoxStyles, optionMarkerClass } from './combo-box.styles'\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 * 選択済みの印は行頭の `▸`(Select と同じ)。\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 {({ isSelected }) => (\n <>\n <span aria-hidden=\"true\" className={optionMarkerClass}>\n {isSelected ? '▸' : ''}\n </span>\n <span className=\"truncate\">{children}</span>\n </>\n )}\n </ListBoxItem>\n )\n}\n\n/**\n * 文字を打って絞り込み、一覧から1つ選ぶ。\n * **一覧は入力欄の直後、フローの中に展開される**(Raster は隣に浮き、Tactile は画面下端のシート)。\n *\n * 開くと後続が押し下げられるので、何かが隠れることが無い。打つたびに絞られて\n * 一覧の高さが変わり、その分だけ後続が上下する。それが帳票の挙動。\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 // trigger 側から open を参照するために group を付ける\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 <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 aria-hidden=\"true\" data-slot=\"icon\" className={s.icon({ class: classNames?.icon })}>\n {/* 回さずに差し替える。開いている間だけ字が反転する */}\n <span className=\"group-data-[open]:hidden\">▾</span>\n <span className=\"hidden group-data-[open]:inline\">▴</span>\n </span>\n </Button>\n </Group>\n\n {/* 展開部は入力欄の直後。ここに面が生えることで、description 以降が押し下がる */}\n <InflowPopover dataSlot=\"popover\" className={s.popover({ class: classNames?.popover })}>\n <ListBox data-slot=\"listbox\" className={s.listbox({ class: classNames?.listbox })}>\n {children}\n </ListBox>\n </InflowPopover>\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 </RACComboBox>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;AAmCA,SAAgB,aAAa,EAAE,IAAI,YAAY,UAAU,aAAgC;CACvF,OACE,oBAAC,aAAD;EACM;EACQ;EACZ,WAAW,OAAO,aAAa,WAAW,WAAW,KAAA;EACrD,aAAU;EACV,WAAW,aAAa,eAAe,CAAC,CAAC,OAAO;EAE9C,WAAA,EAAE,iBACF,qBAAA,UAAA,EAAA,UAAA,CACE,oBAAC,QAAD;GAAM,eAAY;GAAO,WAAW;GACjC,UAAA,aAAa,MAAM;EAChB,CAAA,GACN,oBAAC,QAAD;GAAM,WAAU;GAAY;EAAe,CAAA,CAC3C,EAAA,CAAA;CAEO,CAAA;AAEjB;;;;;;;;;;;;;;;AAgBA,SAAgBA,WAAS,EACvB,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,MACgB;CAChB,MAAM,IAAI,eAAe;EAAE;EAAS;EAAM;CAAO,CAAC;CAClD,MAAM,WAAW,eAAiC,SAAS;CAE3D,OACE,qBAACC,UAAD;EACM;EACE;EACO;EACO;EACpB,oBAAoB,QAA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GR,oBAAC,YAAD;IACE,aAAU;IACV,WAAW,EAAE,aAAa,EAAE,OAAO,YAAY,aAAa,CAAC;IAE5D,UAAA;GACS,CAAA;EACD;;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/flatlay'
8
+ * import { tv } from 'tailwind-variants'
9
+ *
10
+ * const myComboBox = tv({ extend: comboBoxStyles, slots: { option: 'h-8' } })
11
+ */
12
+ declare const comboBoxStyles: import("tailwind-variants").TVReturnType<{
13
+ size: VariantMap<"sm" | "md" | "lg", {
14
+ inputWrapper: string;
15
+ input: string;
16
+ option: string;
17
+ }>;
18
+ radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
19
+ inputWrapper: string;
20
+ }>;
21
+ variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
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
+ size: VariantMap<"sm" | "md" | "lg", {
38
+ inputWrapper: string;
39
+ input: string;
40
+ option: string;
41
+ }>;
42
+ radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
43
+ inputWrapper: string;
44
+ }>;
45
+ variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
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
+ size: VariantMap<"sm" | "md" | "lg", {
62
+ inputWrapper: string;
63
+ input: string;
64
+ option: string;
65
+ }>;
66
+ radius: VariantMap<"sm" | "md" | "lg" | "none" | "full", {
67
+ inputWrapper: string;
68
+ }>;
69
+ variant: VariantMap<"solid" | "outline" | "soft" | "ghost" | "plain", {
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;;IAnCsB;IAAe;IAAgB;;;IAkB3B;;;IA/BE;;;;;;;;;;;;;;;;IAaN;IAAe;IAAgB;;;IAkB3B;;;IA/BE;;;;;;;;;;;;;;;;IAaN;IAAe;IAAgB;;;IAkB3B;;;IA/BE;;;;;;;;;;;;;;;KAuD3C,qBAAqB,kBAAkB"}
@@ -0,0 +1,113 @@
1
+ import { disabledState, focusRing } from "../styles/focus-ring.mjs";
2
+ import { mono } from "../styles/mono.mjs";
3
+ import { tv } from "tailwind-variants";
4
+ //#region src/combo-box/combo-box.styles.ts
5
+ const slots = {
6
+ root: ["flex flex-col gap-1.5", "[&>[data-novi-inflow]:empty]:hidden"].join(" "),
7
+ label: `text-[length:var(--novi-text-sm)] text-[var(--novi-color-fg)] ${mono}`,
8
+ inputWrapper: [
9
+ "flex items-center w-full overflow-hidden",
10
+ "text-[var(--novi-color-fg)]",
11
+ "border",
12
+ "rounded-[var(--novi-radius-sm)]",
13
+ "data-[invalid]:border-[var(--novi-color-danger)]",
14
+ "transition-[border-color,opacity]",
15
+ "duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]",
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 inline-flex items-center justify-center",
26
+ "px-[var(--novi-pad-control-x-sm)]",
27
+ "text-[var(--novi-color-muted)]",
28
+ "border-l",
29
+ "outline-none",
30
+ "hover:text-[var(--novi-color-fg)] hover:bg-[var(--novi-color-subtle)]",
31
+ "data-[focus-visible]:text-[var(--novi-color-fg)]",
32
+ "data-[pressed]:bg-[var(--novi-color-fg)] data-[pressed]:text-[var(--novi-color-bg)]",
33
+ "data-[disabled]:opacity-40 data-[disabled]:cursor-default",
34
+ "transition-[background-color,color]",
35
+ "duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]"
36
+ ].join(" "),
37
+ icon: `shrink-0 leading-none ${mono}`,
38
+ popover: [
39
+ "border border-[var(--novi-color-border-strong)]",
40
+ "bg-[var(--novi-color-bg)] text-[var(--novi-color-fg)]",
41
+ "rounded-[var(--novi-radius-sm)]",
42
+ "overflow-hidden"
43
+ ].join(" "),
44
+ listbox: "outline-none flex flex-col divide-y divide-[var(--novi-color-border)]",
45
+ option: [
46
+ "flex items-center gap-[var(--novi-gap-inline)] px-[var(--novi-pad-control-x-sm)]",
47
+ "cursor-pointer outline-none",
48
+ "text-[var(--novi-color-fg)]",
49
+ "data-[focused]:bg-[var(--novi-color-subtle)]",
50
+ "data-[selected]:font-medium",
51
+ "transition-[background-color,color]",
52
+ "duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]",
53
+ disabledState
54
+ ].join(" "),
55
+ description: `text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)] ${mono}`,
56
+ errorMessage: `text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)] ${mono}`
57
+ };
58
+ /**
59
+ * ComboBox のスタイル定義。
60
+ *
61
+ * @example
62
+ * import { comboBoxStyles } from '@novi-ui/flatlay'
63
+ * import { tv } from 'tailwind-variants'
64
+ *
65
+ * const myComboBox = tv({ extend: comboBoxStyles, slots: { option: 'h-8' } })
66
+ */
67
+ const comboBoxStyles = tv({
68
+ slots,
69
+ variants: {
70
+ size: {
71
+ sm: {
72
+ inputWrapper: "h-7",
73
+ input: "px-[var(--novi-pad-control-x-sm)] text-[length:var(--novi-text-sm)]",
74
+ option: "h-6 text-[length:var(--novi-text-sm)]"
75
+ },
76
+ md: {
77
+ inputWrapper: "h-8",
78
+ input: "px-[var(--novi-pad-control-x-md)] text-[length:var(--novi-text-base)]",
79
+ option: "h-7 text-[length:var(--novi-text-base)]"
80
+ },
81
+ lg: {
82
+ inputWrapper: "h-10",
83
+ input: "px-[var(--novi-pad-control-x-lg)] text-[length:var(--novi-text-base)]",
84
+ option: "h-8 text-[length:var(--novi-text-base)]"
85
+ }
86
+ },
87
+ radius: {
88
+ none: { inputWrapper: "rounded-[var(--novi-radius-none)]" },
89
+ sm: { inputWrapper: "rounded-[var(--novi-radius-sm)]" },
90
+ md: { inputWrapper: "rounded-[var(--novi-radius-md)]" },
91
+ lg: { inputWrapper: "rounded-[var(--novi-radius-lg)]" },
92
+ full: { inputWrapper: "rounded-[var(--novi-radius-full)]" }
93
+ },
94
+ variant: {
95
+ solid: { inputWrapper: "bg-[var(--novi-color-surface)] border-[var(--novi-color-border-strong)]" },
96
+ outline: { inputWrapper: "bg-transparent border-[var(--novi-color-border-strong)]" },
97
+ soft: { inputWrapper: "bg-[var(--novi-color-subtle)] border-[var(--novi-color-border)]" },
98
+ ghost: { inputWrapper: "bg-transparent border-transparent border-b-[var(--novi-color-border-strong)]" },
99
+ plain: { inputWrapper: "bg-transparent border-transparent" }
100
+ }
101
+ },
102
+ defaultVariants: {
103
+ size: "md",
104
+ radius: "sm",
105
+ variant: "outline"
106
+ }
107
+ });
108
+ /** 選択済みの印 `▸`。Select と同じ幅の等幅セルに置く。 */
109
+ const optionMarkerClass = `w-[1ch] shrink-0 text-[var(--novi-color-primary)] ${mono}`;
110
+ //#endregion
111
+ export { comboBoxStyles, optionMarkerClass };
112
+
113
+ //# 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'\nimport { mono } from '../styles/mono'\n\nconst slots = {\n root: [\n 'flex flex-col gap-1.5',\n // 展開部の置き場所(`data-novi-inflow`)は閉じている間も残る。flex の gap は\n // 空の子にも掛かるので、畳まないと閉じたまま余白が 1 つ増える(Select と同じ)\n '[&>[data-novi-inflow]:empty]:hidden',\n ].join(' '),\n label: `text-[length:var(--novi-text-sm)] text-[var(--novi-color-fg)] ${mono}`,\n // 記入欄の枠。罫線の幅は全 variant が持ち、色だけを variant が決める\n inputWrapper: [\n 'flex items-center w-full overflow-hidden',\n 'text-[var(--novi-color-fg)]',\n 'border',\n 'rounded-[var(--novi-radius-sm)]',\n 'data-[invalid]:border-[var(--novi-color-danger)]',\n 'transition-[border-color,opacity]',\n 'duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\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 // 開くボタンは罫線で区切ったセル。押した瞬間だけ反転する(ADR-F3)\n trigger: [\n 'shrink-0 self-stretch inline-flex items-center justify-center',\n 'px-[var(--novi-pad-control-x-sm)]',\n 'text-[var(--novi-color-muted)]',\n 'border-l',\n 'outline-none',\n 'hover:text-[var(--novi-color-fg)] hover:bg-[var(--novi-color-subtle)]',\n 'data-[focus-visible]:text-[var(--novi-color-fg)]',\n 'data-[pressed]:bg-[var(--novi-color-fg)] data-[pressed]:text-[var(--novi-color-bg)]',\n 'data-[disabled]:opacity-40 data-[disabled]:cursor-default',\n 'transition-[background-color,color]',\n 'duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n ].join(' '),\n // 開閉の向きは記号で示す。回すのは z 軸の語彙なので、字を差し替える\n icon: `shrink-0 leading-none ${mono}`,\n popover: [\n // ここが構造差そのもの。浮かないので、面の存在は罫線が引き受ける\n 'border border-[var(--novi-color-border-strong)]',\n 'bg-[var(--novi-color-bg)] text-[var(--novi-color-fg)]',\n 'rounded-[var(--novi-radius-sm)]',\n 'overflow-hidden',\n ].join(' '),\n listbox: 'outline-none flex flex-col divide-y divide-[var(--novi-color-border)]',\n option: [\n 'flex items-center gap-[var(--novi-gap-inline)] px-[var(--novi-pad-control-x-sm)]',\n 'cursor-pointer outline-none',\n 'text-[var(--novi-color-fg)]',\n 'data-[focused]:bg-[var(--novi-color-subtle)]',\n 'data-[selected]:font-medium',\n 'transition-[background-color,color]',\n 'duration-[var(--novi-duration-fast)] ease-[var(--novi-ease-standard)]',\n disabledState,\n ].join(' '),\n description: `text-[length:var(--novi-text-sm)] text-[var(--novi-color-muted)] ${mono}`,\n errorMessage: `text-[length:var(--novi-text-sm)] text-[var(--novi-color-danger)] ${mono}`,\n} satisfies SlotMap<typeof comboBoxSlots, (typeof comboBoxRequiredSlots)[number]>\n\nconst variant: VariantMap<NoviVariant, { inputWrapper: string }> = {\n solid: {\n inputWrapper: 'bg-[var(--novi-color-surface)] border-[var(--novi-color-border-strong)]',\n },\n outline: { inputWrapper: 'bg-transparent border-[var(--novi-color-border-strong)]' },\n soft: { inputWrapper: 'bg-[var(--novi-color-subtle)] border-[var(--novi-color-border)]' },\n ghost: {\n inputWrapper: 'bg-transparent border-transparent border-b-[var(--novi-color-border-strong)]',\n },\n plain: { inputWrapper: 'bg-transparent border-transparent' },\n}\n\n/** 高さは Button / Input と揃える。28 / 32 / 40px。一覧の行は Select と同じ 24 / 28 / 32px。 */\nconst size: VariantMap<NoviSize, { inputWrapper: string; input: string; option: string }> = {\n sm: {\n inputWrapper: 'h-7',\n input: 'px-[var(--novi-pad-control-x-sm)] text-[length:var(--novi-text-sm)]',\n option: 'h-6 text-[length:var(--novi-text-sm)]',\n },\n md: {\n inputWrapper: 'h-8',\n input: 'px-[var(--novi-pad-control-x-md)] text-[length:var(--novi-text-base)]',\n option: 'h-7 text-[length:var(--novi-text-base)]',\n },\n lg: {\n inputWrapper: 'h-10',\n input: 'px-[var(--novi-pad-control-x-lg)] text-[length:var(--novi-text-base)]',\n option: 'h-8 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/flatlay'\n * import { tv } from 'tailwind-variants'\n *\n * const myComboBox = tv({ extend: comboBoxStyles, slots: { option: 'h-8' } })\n */\nexport const comboBoxStyles = tv({\n slots,\n // `variant` は最後に宣言する。先に書くと size のクラスに負ける\n variants: { size, radius, variant },\n defaultVariants: { size: 'md', radius: 'sm', variant: 'outline' },\n})\n\nexport type ComboBoxStyleProps = Parameters<typeof comboBoxStyles>[0]\n\n/** 選択済みの印 `▸`。Select と同じ幅の等幅セルに置く。 */\nexport const optionMarkerClass = `w-[1ch] shrink-0 text-[var(--novi-color-primary)] ${mono}`\n"],"mappings":";;;;AAaA,MAAM,QAAQ;CACZ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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 は隣に浮き、Tactile は画面下端のシート)。
7
+ * 開くと後続が押し下げられ、升目は縦横の罫線で切られる。
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":";;;;;;;;;;;;iBAoCgB,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,140 @@
1
+ "use client";
2
+ import { InflowPopover } from "../styles/inflow.mjs";
3
+ import { datePickerStyles } from "./date-picker.styles.mjs";
4
+ import { Button, Calendar, CalendarCell, CalendarGrid, DateInput, DatePicker, DateSegment, Dialog, FieldError, Group, Heading, Label, Text } from "react-aria-components";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ //#region src/date-picker/date-picker.tsx
7
+ function CalendarIcon() {
8
+ return /* @__PURE__ */ jsx("span", {
9
+ "aria-hidden": "true",
10
+ children: "▦"
11
+ });
12
+ }
13
+ /**
14
+ * 日付を入力する。年 / 月 / 日のマスに直接打つか、カレンダーを開いて選ぶ。
15
+ *
16
+ * **カレンダーは入力欄の直後、フローの中に展開される**(Raster は隣に浮き、Tactile は画面下端のシート)。
17
+ * 開くと後続が押し下げられ、升目は縦横の罫線で切られる。
18
+ * 値は `@internationalized/date` の `CalendarDate`(ADR-B6)。
19
+ *
20
+ * @example
21
+ * <DatePicker label="出荷日" value={date} onChange={setDate} minValue={today} />
22
+ */
23
+ 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 }) {
24
+ const s = datePickerStyles({
25
+ variant,
26
+ size,
27
+ radius
28
+ });
29
+ return /* @__PURE__ */ jsxs(DatePicker, {
30
+ id,
31
+ name,
32
+ value,
33
+ defaultValue,
34
+ onChange,
35
+ minValue,
36
+ maxValue,
37
+ isDateUnavailable,
38
+ placeholderValue,
39
+ isOpen,
40
+ defaultOpen,
41
+ onOpenChange,
42
+ isDisabled,
43
+ isReadOnly,
44
+ isRequired,
45
+ isInvalid,
46
+ granularity: "day",
47
+ "data-slot": "root",
48
+ className: `group ${s.root({ class: [className, classNames?.root] })}`,
49
+ children: [
50
+ label !== void 0 && /* @__PURE__ */ jsx(Label, {
51
+ "data-slot": "label",
52
+ className: s.label({ class: classNames?.label }),
53
+ children: label
54
+ }),
55
+ /* @__PURE__ */ jsxs(Group, {
56
+ "data-slot": "inputWrapper",
57
+ className: s.inputWrapper({ class: classNames?.inputWrapper }),
58
+ children: [/* @__PURE__ */ jsx(DateInput, {
59
+ "data-slot": "dateInput",
60
+ className: s.dateInput({ class: classNames?.dateInput }),
61
+ children: (segment) => /* @__PURE__ */ jsx(DateSegment, {
62
+ segment,
63
+ "data-slot": "segment",
64
+ className: s.segment({ class: classNames?.segment })
65
+ })
66
+ }), /* @__PURE__ */ jsx(Button, {
67
+ "data-slot": "trigger",
68
+ className: s.trigger({ class: classNames?.trigger }),
69
+ children: /* @__PURE__ */ jsx("span", {
70
+ "data-slot": "icon",
71
+ className: s.icon({ class: classNames?.icon }),
72
+ children: /* @__PURE__ */ jsx(CalendarIcon, {})
73
+ })
74
+ })]
75
+ }),
76
+ /* @__PURE__ */ jsx(InflowPopover, {
77
+ dataSlot: "popover",
78
+ className: s.popover({ class: classNames?.popover }),
79
+ children: /* @__PURE__ */ jsx(Dialog, {
80
+ className: "outline-none",
81
+ children: /* @__PURE__ */ jsxs(Calendar, {
82
+ "data-slot": "calendar",
83
+ className: s.calendar({ class: classNames?.calendar }),
84
+ children: [/* @__PURE__ */ jsxs("header", {
85
+ "data-slot": "calendarHeader",
86
+ className: s.calendarHeader({ class: classNames?.calendarHeader }),
87
+ children: [
88
+ /* @__PURE__ */ jsx(Button, {
89
+ slot: "previous",
90
+ "data-slot": "prevButton",
91
+ className: s.prevButton({ class: classNames?.prevButton }),
92
+ children: /* @__PURE__ */ jsx("span", {
93
+ "aria-hidden": "true",
94
+ children: "‹"
95
+ })
96
+ }),
97
+ /* @__PURE__ */ jsx(Heading, {
98
+ "data-slot": "calendarTitle",
99
+ className: s.calendarTitle({ class: classNames?.calendarTitle })
100
+ }),
101
+ /* @__PURE__ */ jsx(Button, {
102
+ slot: "next",
103
+ "data-slot": "nextButton",
104
+ className: s.nextButton({ class: classNames?.nextButton }),
105
+ children: /* @__PURE__ */ jsx("span", {
106
+ "aria-hidden": "true",
107
+ children: "›"
108
+ })
109
+ })
110
+ ]
111
+ }), /* @__PURE__ */ jsx(CalendarGrid, {
112
+ "data-slot": "calendarGrid",
113
+ className: s.calendarGrid({ class: classNames?.calendarGrid }),
114
+ children: (date) => /* @__PURE__ */ jsx(CalendarCell, {
115
+ date,
116
+ "data-slot": "calendarCell",
117
+ className: s.calendarCell({ class: classNames?.calendarCell })
118
+ })
119
+ })]
120
+ })
121
+ })
122
+ }),
123
+ description !== void 0 && /* @__PURE__ */ jsx(Text, {
124
+ slot: "description",
125
+ "data-slot": "description",
126
+ className: s.description({ class: classNames?.description }),
127
+ children: description
128
+ }),
129
+ /* @__PURE__ */ jsx(FieldError, {
130
+ "data-slot": "errorMessage",
131
+ className: s.errorMessage({ class: classNames?.errorMessage }),
132
+ children: errorMessage
133
+ })
134
+ ]
135
+ });
136
+ }
137
+ //#endregion
138
+ export { DatePicker$1 as DatePicker };
139
+
140
+ //# 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 DatePicker as RACDatePicker,\n Text,\n} from 'react-aria-components'\nimport { InflowPopover } from '../styles/inflow'\nimport { datePickerStyles } from './date-picker.styles'\n\nfunction CalendarIcon() {\n // 図形ではなく活字。帳票の語彙は記号であって図形ではない(ADR-F7)\n return <span aria-hidden=\"true\">▦</span>\n}\n\n/**\n * 日付を入力する。年 / 月 / 日のマスに直接打つか、カレンダーを開いて選ぶ。\n *\n * **カレンダーは入力欄の直後、フローの中に展開される**(Raster は隣に浮き、Tactile は画面下端のシート)。\n * 開くと後続が押し下げられ、升目は縦横の罫線で切られる。\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 以降が押し下がる */}\n <InflowPopover dataSlot=\"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 <span aria-hidden=\"true\">‹</span>\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 <span aria-hidden=\"true\">›</span>\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 </InflowPopover>\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 </RACDatePicker>\n )\n}\n"],"mappings":";;;;;;AAqBA,SAAS,eAAe;CAEtB,OAAO,oBAAC,QAAD;EAAM,eAAY;EAAO,UAAA;CAAO,CAAA;AACzC;;;;;;;;;;;AAYA,SAAgBA,aAAW,EACzB,SACA,MACA,QACA,OACA,aACA,cACA,MACA,OACA,cACA,UACA,UACA,UACA,mBACA,kBACA,QACA,aACA,cACA,YACA,YACA,YACA,WACA,WACA,YACA,MACkB;CAClB,MAAM,IAAI,iBAAiB;EAAE;EAAS;EAAM;CAAO,CAAC;CAEpD,OACE,qBAACC,YAAD;EACM;EACE;EACC;EACO;EACJ;EACA;EACA;EACS;EACD;EACV;EACK;EACC;EACF;EACA;EACA;EACD;EACX,aAAY;EACZ,aAAU;EACV,WAAW,SAAS,EAAE,KAAK,EAAE,OAAO,CAAC,WAAW,YAAY,IAAI,EAAE,CAAC;EAnBrE,UAAA;GAqBG,UAAU,KAAA,KACT,oBAAC,OAAD;IAAO,aAAU;IAAQ,WAAW,EAAE,MAAM,EAAE,OAAO,YAAY,MAAM,CAAC;IACrE,UAAA;GACI,CAAA;GAGT,qBAAC,OAAD;I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