@yamada-ui/react 2.2.1-dev-20260510005230 → 2.2.1-dev-20260510113404
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/cjs/components/calendar/calendar.cjs +8 -30
- package/dist/cjs/components/calendar/calendar.cjs.map +1 -1
- package/dist/cjs/components/checkbox/use-checkbox-group.cjs +1 -1
- package/dist/cjs/components/checkbox/use-checkbox-group.cjs.map +1 -1
- package/dist/esm/components/calendar/calendar.js +8 -30
- package/dist/esm/components/calendar/calendar.js.map +1 -1
- package/dist/esm/components/checkbox/use-checkbox-group.js +1 -1
- package/dist/esm/components/checkbox/use-checkbox-group.js.map +1 -1
- package/dist/types/components/autocomplete/autocomplete.style.d.ts +1 -1
- package/dist/types/components/calendar/calendar.style.d.ts +2 -2
- package/dist/types/components/carousel/carousel.style.d.ts +2 -2
- package/dist/types/components/checkbox-card/checkbox-card.d.ts +3 -3
- package/dist/types/components/checkbox-card/checkbox-card.style.d.ts +1 -1
- package/dist/types/components/color-picker/color-picker.style.d.ts +1 -1
- package/dist/types/components/color-selector/color-selector.style.d.ts +2 -2
- package/dist/types/components/drawer/drawer.style.d.ts +2 -2
- package/dist/types/components/empty-state/empty-state.style.d.ts +2 -2
- package/dist/types/components/modal/modal.style.d.ts +2 -2
- package/dist/types/components/notice/notice.style.d.ts +1 -1
- package/dist/types/components/number-input/number-input.style.d.ts +1 -1
- package/dist/types/components/radio-card/radio-card.d.ts +3 -3
- package/dist/types/components/radio-card/radio-card.style.d.ts +1 -1
- package/dist/types/components/select/select.style.d.ts +1 -1
- package/dist/types/components/steps/steps.style.d.ts +1 -1
- package/dist/types/components/tag/tag.style.d.ts +1 -1
- package/dist/types/components/timeline/timeline.d.ts +1 -1
- package/dist/types/components/timeline/timeline.style.d.ts +1 -1
- package/dist/types/providers/i18n-provider/i18n-provider.d.ts +1 -1
- package/package.json +2 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
3
|
const require_utils_index = require("../../utils/index.cjs");
|
|
4
4
|
const require_factory = require("../../core/system/factory.cjs");
|
|
5
|
+
const require_props = require("../../core/components/props.cjs");
|
|
5
6
|
const require_create_component = require("../../core/components/create-component.cjs");
|
|
6
7
|
const require_chevron_left_icon = require("../icon/icons/chevron-left-icon.cjs");
|
|
7
8
|
const require_chevron_right_icon = require("../icon/icons/chevron-right-icon.cjs");
|
|
@@ -143,10 +144,7 @@ const CalendarNavigation = withContext("div", ["row", "navigation"])(void 0, ({
|
|
|
143
144
|
] });
|
|
144
145
|
}, [children]);
|
|
145
146
|
return {
|
|
146
|
-
...getNavigationProps(
|
|
147
|
-
...navigationProps,
|
|
148
|
-
...rest
|
|
149
|
-
}),
|
|
147
|
+
...getNavigationProps(require_props.mergeProps(navigationProps, rest)()),
|
|
150
148
|
children: computedChildren
|
|
151
149
|
};
|
|
152
150
|
});
|
|
@@ -158,8 +156,7 @@ const CalendarControl = withContext("div", "control")(void 0, ({ children, ...re
|
|
|
158
156
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarMonthSelect, {}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CalendarYearSelect, {})] });
|
|
159
157
|
}, [children, month]);
|
|
160
158
|
return {
|
|
161
|
-
...controlProps,
|
|
162
|
-
...rest,
|
|
159
|
+
...require_props.mergeProps(controlProps, rest)(),
|
|
163
160
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [computedChildren, /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_factory.styled.div, { ...getStatusProps() })] })
|
|
164
161
|
};
|
|
165
162
|
});
|
|
@@ -167,22 +164,14 @@ const CalendarPrevButton = withContext("button", ["button", "prev"])(void 0, ({
|
|
|
167
164
|
const { buttonProps, getPrevButtonProps, prevButtonProps } = useComponentContext();
|
|
168
165
|
return {
|
|
169
166
|
children,
|
|
170
|
-
...getPrevButtonProps(
|
|
171
|
-
...buttonProps,
|
|
172
|
-
...prevButtonProps,
|
|
173
|
-
...rest
|
|
174
|
-
})
|
|
167
|
+
...getPrevButtonProps(require_props.mergeProps(buttonProps, prevButtonProps, rest)())
|
|
175
168
|
};
|
|
176
169
|
});
|
|
177
170
|
const CalendarNextButton = withContext("button", ["button", "next"])(void 0, ({ children = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_chevron_right_icon.ChevronRightIcon, {}), ...rest }) => {
|
|
178
171
|
const { buttonProps, getNextButtonProps, nextButtonProps } = useComponentContext();
|
|
179
172
|
return {
|
|
180
173
|
children,
|
|
181
|
-
...getNextButtonProps(
|
|
182
|
-
...buttonProps,
|
|
183
|
-
...nextButtonProps,
|
|
184
|
-
...rest
|
|
185
|
-
})
|
|
174
|
+
...getNextButtonProps(require_props.mergeProps(buttonProps, nextButtonProps, rest)())
|
|
186
175
|
};
|
|
187
176
|
});
|
|
188
177
|
withContext("span", "separator")({
|
|
@@ -191,11 +180,7 @@ withContext("span", "separator")({
|
|
|
191
180
|
});
|
|
192
181
|
const CalendarYearSelect = withContext((props) => {
|
|
193
182
|
const { yearItems, getYearSelectProps, selectProps, yearSelectProps } = useComponentContext();
|
|
194
|
-
const { contentProps, rootProps, ...rest } =
|
|
195
|
-
...selectProps,
|
|
196
|
-
...yearSelectProps,
|
|
197
|
-
...props
|
|
198
|
-
};
|
|
183
|
+
const { contentProps, rootProps, ...rest } = require_props.mergeProps(selectProps, yearSelectProps, props)();
|
|
199
184
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_select.SelectRoot, {
|
|
200
185
|
variant: "plain",
|
|
201
186
|
items: yearItems,
|
|
@@ -215,11 +200,7 @@ const CalendarYearSelect = withContext((props) => {
|
|
|
215
200
|
}, ["select", "years"])();
|
|
216
201
|
const CalendarMonthSelect = withContext((props) => {
|
|
217
202
|
const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } = useComponentContext();
|
|
218
|
-
const { contentProps, rootProps, ...rest } =
|
|
219
|
-
...selectProps,
|
|
220
|
-
...monthSelectProps,
|
|
221
|
-
...props
|
|
222
|
-
};
|
|
203
|
+
const { contentProps, rootProps, ...rest } = require_props.mergeProps(selectProps, monthSelectProps, props)();
|
|
223
204
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_select.SelectRoot, {
|
|
224
205
|
variant: "plain",
|
|
225
206
|
items: monthItems,
|
|
@@ -264,10 +245,7 @@ const CalendarMonth = withContext("table", "month")(void 0, ({ day: dayProp, ...
|
|
|
264
245
|
}, index))
|
|
265
246
|
})] });
|
|
266
247
|
return {
|
|
267
|
-
...getMonthProps(
|
|
268
|
-
...monthProps,
|
|
269
|
-
...rest
|
|
270
|
-
}),
|
|
248
|
+
...getMonthProps(require_props.mergeProps(monthProps, rest)()),
|
|
271
249
|
children
|
|
272
250
|
};
|
|
273
251
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.cjs","names":["createSlotComponent","calendarStyle","useCalendar","CalendarDescendantsContext","CalendarContext","styled","useCalendarContext","ChevronLeftIcon","ChevronRightIcon","resetFieldProps","useCalendarDay"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps({ ...navigationProps, ...rest }),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...controlProps,\n ...rest,\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps({ ...buttonProps, ...prevButtonProps, ...rest }),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps({ ...buttonProps, ...nextButtonProps, ...rest }),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = {\n ...selectProps,\n ...yearSelectProps,\n ...props,\n }\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = {\n ...selectProps,\n ...monthSelectProps,\n ...props,\n }\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps({ ...monthProps, ...rest }),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,cACD;;;;;;AASD,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACEC,qBAAAA,YAAY,MAAM;CA4GtB,OACE,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,4BAAD;EAA4B,OAAO;YACjC,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,iBAAD;GAAiB,QAAA,GAAA,MAAA,gBA5GZ;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,GACD;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAiEwC;aACrC,iBAAA,GAAA,kBAAA,KAAC,kBAAD;IAAkB,QAAA,GAAA,MAAA,gBA/Df;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,GACD;KACE;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAM4C;cACvC,iBAAA,GAAA,kBAAA,KAACC,gBAAAA,OAAO,KAAR;KAAY,GAAI,cAAc;eAC3B,YACC,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAC,oBAAD,EAAsB,CAAA,EACtB,iBAAA,GAAA,kBAAA,KAAC,eAAD,EAAiB,CAAA,CAChB,EAAA,CAAA;KAEM,CAAA;IACI,CAAA;GACH,CAAA;EACS,CAAA;GAGjC,OACD,EAAE;AAQH,MAAa,qBAAqB,YAChC,OACA,CAAC,OAAO,aAAa,CACtB,CA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AWJ,CACf;EACY,CAAA,CACf,EAAA,CAAA;CAGL,OAAO;EACL,GAAG,cAAc;GAAE,GAAG;GAAY,GAAG;GAAM,CAAC;EAC5C;EACD;EACD;AAEF,MAAM,mBAAmB,YAAY,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE;AAEjE,MAAM,kBAAkB,YAAY,MAAM,CAAC,QAAQ,UAAU,CAAC,EAAE;AAEhE,MAAM,gBAAgB,YAAY,SAAS,QAAQ,EAAE;AAErD,MAAM,eAAe,YAAY,MAAM,CAAC,OAAO,OAAO,CAAC,EAAE;AAKzD,MAAM,cAAc,YAAoC,MAAM,CAAC,QAAQ,MAAM,CAAC,CAC5E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,gBAAgBK,qBAAAA,eAAe,MAAM;CAE7C,OAAO,aAAa;EAEvB"}
|
|
1
|
+
{"version":3,"file":"calendar.cjs","names":["createSlotComponent","calendarStyle","useCalendar","CalendarDescendantsContext","CalendarContext","styled","mergeProps","useCalendarContext","ChevronLeftIcon","ChevronRightIcon","resetFieldProps","useCalendarDay"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps(mergeProps(navigationProps, rest)()),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...mergeProps(controlProps, rest)(),\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps(mergeProps(buttonProps, prevButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps(mergeProps(buttonProps, nextButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n yearSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n monthSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps(mergeProps(monthProps, rest)()),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACEA,yBAAAA,oBACF,YACAC,uBAAAA,cACD;;;;;;AASD,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACEC,qBAAAA,YAAY,MAAM;CA4GtB,OACE,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,4BAAD;EAA4B,OAAO;YACjC,iBAAA,GAAA,kBAAA,KAACC,qBAAAA,iBAAD;GAAiB,QAAA,GAAA,MAAA,gBA5GZ;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,GACD;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAiEwC;aACrC,iBAAA,GAAA,kBAAA,KAAC,kBAAD;IAAkB,QAAA,GAAA,MAAA,gBA/Df;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,GACD;KACE;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAM4C;cACvC,iBAAA,GAAA,kBAAA,KAACC,gBAAAA,OAAO,KAAR;KAAY,GAAI,cAAc;eAC3B,YACC,iBAAA,GAAA,kBAAA,MAAA,kBAAA,UAAA,EAAA,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAC,oBAAD,EAAsB,CAAA,EACtB,iBAAA,GAAA,kBAAA,KAAC,eAAD,EAAiB,CAAA,CAChB,EAAA,CAAA;KAEM,CAAA;IACI,CAAA;GACH,CAAA;EACS,CAAA;GAGjC,OACD,EAAE;AAQH,MAAa,qBAAqB,YAChC,OACA,CAAC,OAAO,aAAa,CACtB,CAAC,KAAA,IAAY,EAAE,UAAU,GAAG,WAAW;CACtC,MAAM,EAAE,oBAAoB,oBAAoB,qBA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cC,cAAAA,WAAW,YAAY,KAAK,EAAE,CAAC;EAChD;EACD;EACD;AAEF,MAAM,mBAAmB,YAAY,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE;AAEjE,MAAM,kBAAkB,YAAY,MAAM,CAAC,QAAQ,UAAU,CAAC,EAAE;AAEhE,MAAM,gBAAgB,YAAY,SAAS,QAAQ,EAAE;AAErD,MAAM,eAAe,YAAY,MAAM,CAAC,OAAO,OAAO,CAAC,EAAE;AAKzD,MAAM,cAAc,YAAoC,MAAM,CAAC,QAAQ,MAAM,CAAC,CAC5E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,gBAAgBK,qBAAAA,eAAe,MAAM;CAE7C,OAAO,aAAa;EAEvB"}
|
|
@@ -59,10 +59,10 @@ const useCheckboxGroup = (props = {}) => {
|
|
|
59
59
|
"data-checked": (0, require_utils_index.utils_exports.dataAttr)(checked),
|
|
60
60
|
"data-disabled": (0, require_utils_index.utils_exports.dataAttr)(trulyDisabled),
|
|
61
61
|
checked,
|
|
62
|
-
disabled: trulyDisabled,
|
|
63
62
|
readOnly,
|
|
64
63
|
required,
|
|
65
64
|
...props,
|
|
65
|
+
disabled: Boolean(props.disabled || trulyDisabled),
|
|
66
66
|
onBlur: (0, require_utils_index.utils_exports.handlerAll)(props.onBlur, eventProps.onBlur),
|
|
67
67
|
onChange: (0, require_utils_index.utils_exports.handlerAll)(props.onChange, onChange),
|
|
68
68
|
onFocus: (0, require_utils_index.utils_exports.handlerAll)(props.onFocus, eventProps.onFocus)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-checkbox-group.cjs","names":["createContext","useFieldProps","useControllableState","mergeProps","visuallyHiddenAttributes"],"sources":["../../../../src/components/checkbox/use-checkbox-group.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isNumber,\n isObject,\n isString,\n isUndefined,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\ninterface CheckboxGroupContext extends Omit<\n UseCheckboxGroupReturn,\n \"getRootProps\"\n> {}\n\nconst [CheckboxGroupContext, useCheckboxGroupContext] =\n createContext<CheckboxGroupContext>({\n name: \"CheckboxGroupContext\",\n strict: false,\n })\n\nexport { CheckboxGroupContext, useCheckboxGroupContext }\n\nexport interface UseCheckboxGroupProps<Y extends string = string>\n extends Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"value\">, FieldProps {\n /**\n * The initial value of the checkbox group.\n *\n * @default []\n */\n defaultValue?: Y[]\n /**\n * The maximum number of checkboxes that can be checked.\n */\n max?: number\n /**\n * The value of the checkbox group.\n */\n value?: Y[]\n /**\n * The callback fired when any children checkbox is checked or unchecked.\n */\n onChange?: (value: Y[]) => void\n}\n\nexport const useCheckboxGroup = <Y extends string = string>(\n props: UseCheckboxGroupProps<Y> = {},\n) => {\n const {\n context: { labelId } = {},\n props: {\n defaultValue = [],\n disabled,\n max,\n readOnly,\n required,\n value: valueProp,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps: { \"aria-describedby\": ariaDescribedbyProp, ...ariaProps },\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const interactive = !(readOnly || disabled)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n\n const onChange = useCallback(\n (valueOrEv: ChangeEvent<HTMLInputElement> | Y) => {\n if (!interactive) return\n\n if (isObject(valueOrEv)) valueOrEv = valueOrEv.target.value as Y\n\n setValue((prev) => {\n if (prev.includes(valueOrEv)) {\n return prev.filter((prevValue) => prevValue !== valueOrEv)\n } else if (!isNumber(max) || prev.length < max) {\n return [...prev, valueOrEv]\n } else {\n return prev\n }\n })\n },\n [interactive, max, setValue],\n )\n\n const getRootProps: PropGetter = useCallback(\n ({\n ref,\n \"aria-describedby\": ariaDescribedby,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n } = {}) =>\n mergeProps(\n dataProps,\n {\n \"aria-describedby\": cx(ariaDescribedbyProp, ariaDescribedby),\n \"aria-labelledby\": cx(labelId, ariaLabelledby),\n role: \"group\",\n },\n rest,\n props,\n {\n ref,\n },\n )(),\n [ariaDescribedbyProp, dataProps, labelId, rest],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => {\n const checked =\n !isUndefined(value) &&\n (isString(props.value) || isNumber(props.value)) &&\n value.includes(props.value as Y)\n const trulyDisabled = !checked && isNumber(max) && value.length >= max\n\n return {\n ...dataProps,\n ...ariaProps,\n type: \"checkbox\",\n style: visuallyHiddenAttributes.style,\n \"aria-checked\": checked,\n \"aria-disabled\": ariaAttr(trulyDisabled),\n \"data-checked\": dataAttr(checked),\n \"data-disabled\": dataAttr(trulyDisabled),\n checked,\n
|
|
1
|
+
{"version":3,"file":"use-checkbox-group.cjs","names":["createContext","useFieldProps","useControllableState","mergeProps","visuallyHiddenAttributes"],"sources":["../../../../src/components/checkbox/use-checkbox-group.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isNumber,\n isObject,\n isString,\n isUndefined,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\ninterface CheckboxGroupContext extends Omit<\n UseCheckboxGroupReturn,\n \"getRootProps\"\n> {}\n\nconst [CheckboxGroupContext, useCheckboxGroupContext] =\n createContext<CheckboxGroupContext>({\n name: \"CheckboxGroupContext\",\n strict: false,\n })\n\nexport { CheckboxGroupContext, useCheckboxGroupContext }\n\nexport interface UseCheckboxGroupProps<Y extends string = string>\n extends Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"value\">, FieldProps {\n /**\n * The initial value of the checkbox group.\n *\n * @default []\n */\n defaultValue?: Y[]\n /**\n * The maximum number of checkboxes that can be checked.\n */\n max?: number\n /**\n * The value of the checkbox group.\n */\n value?: Y[]\n /**\n * The callback fired when any children checkbox is checked or unchecked.\n */\n onChange?: (value: Y[]) => void\n}\n\nexport const useCheckboxGroup = <Y extends string = string>(\n props: UseCheckboxGroupProps<Y> = {},\n) => {\n const {\n context: { labelId } = {},\n props: {\n defaultValue = [],\n disabled,\n max,\n readOnly,\n required,\n value: valueProp,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps: { \"aria-describedby\": ariaDescribedbyProp, ...ariaProps },\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const interactive = !(readOnly || disabled)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n\n const onChange = useCallback(\n (valueOrEv: ChangeEvent<HTMLInputElement> | Y) => {\n if (!interactive) return\n\n if (isObject(valueOrEv)) valueOrEv = valueOrEv.target.value as Y\n\n setValue((prev) => {\n if (prev.includes(valueOrEv)) {\n return prev.filter((prevValue) => prevValue !== valueOrEv)\n } else if (!isNumber(max) || prev.length < max) {\n return [...prev, valueOrEv]\n } else {\n return prev\n }\n })\n },\n [interactive, max, setValue],\n )\n\n const getRootProps: PropGetter = useCallback(\n ({\n ref,\n \"aria-describedby\": ariaDescribedby,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n } = {}) =>\n mergeProps(\n dataProps,\n {\n \"aria-describedby\": cx(ariaDescribedbyProp, ariaDescribedby),\n \"aria-labelledby\": cx(labelId, ariaLabelledby),\n role: \"group\",\n },\n rest,\n props,\n {\n ref,\n },\n )(),\n [ariaDescribedbyProp, dataProps, labelId, rest],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => {\n const checked =\n !isUndefined(value) &&\n (isString(props.value) || isNumber(props.value)) &&\n value.includes(props.value as Y)\n const trulyDisabled = !checked && isNumber(max) && value.length >= max\n\n return {\n ...dataProps,\n ...ariaProps,\n type: \"checkbox\",\n style: visuallyHiddenAttributes.style,\n \"aria-checked\": checked,\n \"aria-disabled\": ariaAttr(trulyDisabled),\n \"data-checked\": dataAttr(checked),\n \"data-disabled\": dataAttr(trulyDisabled),\n checked,\n readOnly,\n required,\n ...props,\n disabled: Boolean(props.disabled || trulyDisabled),\n onBlur: handlerAll(props.onBlur, eventProps.onBlur),\n onChange: handlerAll(props.onChange, onChange),\n onFocus: handlerAll(props.onFocus, eventProps.onFocus),\n }\n },\n [\n ariaProps,\n dataProps,\n eventProps,\n max,\n onChange,\n readOnly,\n required,\n value,\n ],\n )\n\n const getLabelProps: PropGetter<\"label\"> = useCallback(\n (props) => ({\n ...dataProps,\n ...props,\n }),\n [dataProps],\n )\n\n return {\n max,\n value,\n getInputProps,\n getLabelProps,\n getRootProps,\n onChange,\n }\n}\n\nexport type UseCheckboxGroupReturn = ReturnType<typeof useCheckboxGroup>\n"],"mappings":";;;;;;;;;;AA2BA,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAAA,cAAoC;CAClC,MAAM;CACN,QAAQ;CACT,CAAC;AA0BJ,MAAa,oBACX,QAAkC,EAAE,KACjC;CACH,MAAM,EACJ,SAAS,EAAE,YAAY,EAAE,EACzB,OAAO,EACL,eAAe,EAAE,EACjB,UACA,KACA,UACA,UACA,OAAO,WACP,UAAU,cACV,GAAG,QAEL,WAAW,EAAE,oBAAoB,qBAAqB,GAAG,aACzD,WACA,eACEC,wBAAAA,cAAc,MAAM;CACxB,MAAM,cAAc,EAAE,YAAY;CAClC,MAAM,CAAC,OAAO,YAAYC,2CAAAA,qBAAqB;EAC7C;EACA,OAAO;EACP,UAAU;EACX,CAAC;CAEF,MAAM,YAAA,GAAA,MAAA,cACH,cAAiD;EAChD,IAAI,CAAC,aA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U,QAAQ,MAAM,YAAY,cAAc;IAClD,SAAA,GAAA,oBAAA,cAAA,YAAmB,MAAM,QAAQ,WAAW,OAAO;IACnD,WAAA,GAAA,oBAAA,cAAA,YAAqB,MAAM,UAAU,SAAS;IAC9C,UAAA,GAAA,oBAAA,cAAA,YAAoB,MAAM,SAAS,WAAW,QAAQ;IACvD;KAEH;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAcY;EACb,gBAAA,GAAA,MAAA,cAXC,WAAW;GACV,GAAG;GACH,GAAG;GACJ,GACD,CAAC,UAAU,CAOE;EACb;EACA;EACD"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { utils_exports } from "../../utils/index.js";
|
|
3
3
|
import { styled } from "../../core/system/factory.js";
|
|
4
|
+
import { mergeProps } from "../../core/components/props.js";
|
|
4
5
|
import { createSlotComponent } from "../../core/components/create-component.js";
|
|
5
6
|
import { ChevronLeftIcon } from "../icon/icons/chevron-left-icon.js";
|
|
6
7
|
import { ChevronRightIcon } from "../icon/icons/chevron-right-icon.js";
|
|
@@ -142,10 +143,7 @@ const CalendarNavigation = withContext("div", ["row", "navigation"])(void 0, ({
|
|
|
142
143
|
] });
|
|
143
144
|
}, [children]);
|
|
144
145
|
return {
|
|
145
|
-
...getNavigationProps(
|
|
146
|
-
...navigationProps,
|
|
147
|
-
...rest
|
|
148
|
-
}),
|
|
146
|
+
...getNavigationProps(mergeProps(navigationProps, rest)()),
|
|
149
147
|
children: computedChildren
|
|
150
148
|
};
|
|
151
149
|
});
|
|
@@ -157,8 +155,7 @@ const CalendarControl = withContext("div", "control")(void 0, ({ children, ...re
|
|
|
157
155
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CalendarMonthSelect, {}), /* @__PURE__ */ jsx(CalendarYearSelect, {})] });
|
|
158
156
|
}, [children, month]);
|
|
159
157
|
return {
|
|
160
|
-
...controlProps,
|
|
161
|
-
...rest,
|
|
158
|
+
...mergeProps(controlProps, rest)(),
|
|
162
159
|
children: /* @__PURE__ */ jsxs(Fragment$1, { children: [computedChildren, /* @__PURE__ */ jsx(styled.div, { ...getStatusProps() })] })
|
|
163
160
|
};
|
|
164
161
|
});
|
|
@@ -166,22 +163,14 @@ const CalendarPrevButton = withContext("button", ["button", "prev"])(void 0, ({
|
|
|
166
163
|
const { buttonProps, getPrevButtonProps, prevButtonProps } = useComponentContext();
|
|
167
164
|
return {
|
|
168
165
|
children,
|
|
169
|
-
...getPrevButtonProps(
|
|
170
|
-
...buttonProps,
|
|
171
|
-
...prevButtonProps,
|
|
172
|
-
...rest
|
|
173
|
-
})
|
|
166
|
+
...getPrevButtonProps(mergeProps(buttonProps, prevButtonProps, rest)())
|
|
174
167
|
};
|
|
175
168
|
});
|
|
176
169
|
const CalendarNextButton = withContext("button", ["button", "next"])(void 0, ({ children = /* @__PURE__ */ jsx(ChevronRightIcon, {}), ...rest }) => {
|
|
177
170
|
const { buttonProps, getNextButtonProps, nextButtonProps } = useComponentContext();
|
|
178
171
|
return {
|
|
179
172
|
children,
|
|
180
|
-
...getNextButtonProps(
|
|
181
|
-
...buttonProps,
|
|
182
|
-
...nextButtonProps,
|
|
183
|
-
...rest
|
|
184
|
-
})
|
|
173
|
+
...getNextButtonProps(mergeProps(buttonProps, nextButtonProps, rest)())
|
|
185
174
|
};
|
|
186
175
|
});
|
|
187
176
|
withContext("span", "separator")({
|
|
@@ -190,11 +179,7 @@ withContext("span", "separator")({
|
|
|
190
179
|
});
|
|
191
180
|
const CalendarYearSelect = withContext((props) => {
|
|
192
181
|
const { yearItems, getYearSelectProps, selectProps, yearSelectProps } = useComponentContext();
|
|
193
|
-
const { contentProps, rootProps, ...rest } =
|
|
194
|
-
...selectProps,
|
|
195
|
-
...yearSelectProps,
|
|
196
|
-
...props
|
|
197
|
-
};
|
|
182
|
+
const { contentProps, rootProps, ...rest } = mergeProps(selectProps, yearSelectProps, props)();
|
|
198
183
|
return /* @__PURE__ */ jsx(SelectRoot, {
|
|
199
184
|
variant: "plain",
|
|
200
185
|
items: yearItems,
|
|
@@ -214,11 +199,7 @@ const CalendarYearSelect = withContext((props) => {
|
|
|
214
199
|
}, ["select", "years"])();
|
|
215
200
|
const CalendarMonthSelect = withContext((props) => {
|
|
216
201
|
const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } = useComponentContext();
|
|
217
|
-
const { contentProps, rootProps, ...rest } =
|
|
218
|
-
...selectProps,
|
|
219
|
-
...monthSelectProps,
|
|
220
|
-
...props
|
|
221
|
-
};
|
|
202
|
+
const { contentProps, rootProps, ...rest } = mergeProps(selectProps, monthSelectProps, props)();
|
|
222
203
|
return /* @__PURE__ */ jsx(SelectRoot, {
|
|
223
204
|
variant: "plain",
|
|
224
205
|
items: monthItems,
|
|
@@ -263,10 +244,7 @@ const CalendarMonth = withContext("table", "month")(void 0, ({ day: dayProp, ...
|
|
|
263
244
|
}, index))
|
|
264
245
|
})] });
|
|
265
246
|
return {
|
|
266
|
-
...getMonthProps(
|
|
267
|
-
...monthProps,
|
|
268
|
-
...rest
|
|
269
|
-
}),
|
|
247
|
+
...getMonthProps(mergeProps(monthProps, rest)()),
|
|
270
248
|
children
|
|
271
249
|
};
|
|
272
250
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","names":["Select.Root"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps({ ...navigationProps, ...rest }),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...controlProps,\n ...rest,\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps({ ...buttonProps, ...prevButtonProps, ...rest }),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps({ ...buttonProps, ...nextButtonProps, ...rest }),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = {\n ...selectProps,\n ...yearSelectProps,\n ...props,\n }\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = {\n ...selectProps,\n ...monthSelectProps,\n ...props,\n }\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps({ ...monthProps, ...rest }),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,YACA,cACD;;;;;;AASD,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACE,YAAY,MAAM;CA4GtB,OACE,oBAAC,4BAAD;EAA4B,OAAO;YACjC,oBAAC,iBAAD;GAAiB,OA7GG,eACf;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,GACD;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAiEwC;aACrC,oBAAC,kBAAD;IAAkB,OAhEC,eAChB;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,GACD;KACE;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAM4C;cACvC,oBAAC,OAAO,KAAR;KAAY,GAAI,cAAc;eAC3B,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,oBAAD,EAAsB,CAAA,EACtB,oBAAC,eAAD,EAAiB,CAAA,CAChB,EAAA,CAAA;KAEM,CAAA;IACI,CAAA;GACH,CAAA;EACS,CAAA;GAGjC,OACD,EAAE;AAQH,MAAa,qBAAqB,YAChC,OACA,CAAC,OAAO,aAAa,CACtB,CAAC,KAAA,IAAY,EAAE,UAAU,GAAG,WAAW;CACtC,MAAM,EAAE,oBAAoB,oBAAoB,qBAAqB;CAErE,MAAM,mBAAmB,cAAc;EACrC,IAAI,UAAU,OAAO;EAErB,OACE,qBAAA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AAA,EAAA,UAAA,CACE,oBAAC,OAAO,OAAR;EAAc,eAAA;YACZ,oBAAC,kBAAD;GAAkB,GAAI;aACnB,SAAS,KAAK,EAAE,OAAO,SAAS,UAC/B,oBAAC,iBAAD;IAEE,GAAI,gBAAgB;KAAE,GAAG;KAAc;KAAO,CAAC;cAE9C;IACe,EAJX,MAIW,CAClB;GACe,CAAA;EACN,CAAA,EAEf,oBAAC,eAAD;EAAe,GAAI;YAChB,UAAU,KAAK,MAAM,UACpB,oBAAC,cAAD;GAA0B,GAAI;aAC3B,KAAK,KAAK,EAAE,OAAO,YAClB,oBAAC,aAAD;IAEQ,GAAG;IAAU;yCAEV,SAAS,EAAE,OAAO,CAAC,IAC1B,oBAAC,OAAO,MAAR,EAAA,UAAc,OAAoB,CAAA;IAExB,EANP,MAAM,cAAc,CAMb,CACd;GACW,EAXI,MAWJ,CACf;EACY,CAAA,CACf,EAAA,CAAA;CAGL,OAAO;EACL,GAAG,cAAc;GAAE,GAAG;GAAY,GAAG;GAAM,CAAC;EAC5C;EACD;EACD;AAEF,MAAM,mBAAmB,YAAY,MAAM,CAAC,OAAO,WAAW,CAAC,EAAE;AAEjE,MAAM,kBAAkB,YAAY,MAAM,CAAC,QAAQ,UAAU,CAAC,EAAE;AAEhE,MAAM,gBAAgB,YAAY,SAAS,QAAQ,EAAE;AAErD,MAAM,eAAe,YAAY,MAAM,CAAC,OAAO,OAAO,CAAC,EAAE;AAKzD,MAAM,cAAc,YAAoC,MAAM,CAAC,QAAQ,MAAM,CAAC,CAC5E,KAAA,IACC,UAAU;CACT,MAAM,EAAE,gBAAgB,eAAe,MAAM;CAE7C,OAAO,aAAa;EAEvB"}
|
|
1
|
+
{"version":3,"file":"calendar.js","names":["Select.Root"],"sources":["../../../../src/components/calendar/calendar.tsx"],"sourcesContent":["\"use client\"\n\nimport type { ReactElement } from \"react\"\nimport type { GenericsComponent, HTMLStyledProps, ThemeProps } from \"../../core\"\nimport type { ReactNodeOrFunction } from \"../../utils\"\nimport type { CalendarStyle } from \"./calendar.style\"\nimport type {\n UseCalendarDayProps,\n UseCalendarProps,\n UseCalendarReturn,\n} from \"./use-calendar\"\nimport { useMemo } from \"react\"\nimport { createSlotComponent, mergeProps, styled } from \"../../core\"\nimport { runIfFn } from \"../../utils\"\nimport { resetFieldProps } from \"../field\"\nimport { ChevronLeftIcon, ChevronRightIcon } from \"../icon\"\nimport { Select } from \"../select\"\nimport { calendarStyle } from \"./calendar.style\"\nimport {\n CalendarContext,\n CalendarDescendantsContext,\n useCalendar,\n useCalendarContext,\n useCalendarDay,\n} from \"./use-calendar\"\n\ninterface ComponentContext\n extends\n Pick<\n UseCalendarReturn,\n | \"getMonthProps\"\n | \"getMonthSelectProps\"\n | \"getNavigationProps\"\n | \"getNextButtonProps\"\n | \"getPrevButtonProps\"\n | \"getStatusProps\"\n | \"getWeekdayProps\"\n | \"getYearSelectProps\"\n | \"monthDays\"\n | \"monthItems\"\n | \"weekdays\"\n | \"yearItems\"\n >,\n Pick<\n CalendarRootProps,\n | \"buttonProps\"\n | \"controlProps\"\n | \"day\"\n | \"dayProps\"\n | \"monthProps\"\n | \"monthSelectProps\"\n | \"navigationProps\"\n | \"nextButtonProps\"\n | \"prevButtonProps\"\n | \"selectProps\"\n | \"weekdayProps\"\n | \"weekdaysProps\"\n | \"weekProps\"\n | \"weeksProps\"\n | \"yearSelectProps\"\n > {}\n\nexport interface CalendarRootProps<\n Multiple extends boolean = false,\n Range extends boolean = false,\n>\n extends\n Omit<HTMLStyledProps, \"defaultValue\" | \"onChange\">,\n ThemeProps<CalendarStyle>,\n UseCalendarProps<Multiple, Range>,\n Pick<CalendarMonthProps, \"day\"> {\n /**\n * Props for the button component.\n */\n buttonProps?: HTMLStyledProps<\"button\">\n /**\n * Props for the control component.\n */\n controlProps?: CalendarControlProps\n /**\n * Props for the day component.\n */\n dayProps?: Omit<CalendarDayProps, \"value\">\n /**\n * Props for the month component.\n */\n monthProps?: CalendarMonthProps\n /**\n * Props for the month select component.\n */\n monthSelectProps?: CalendarMonthSelectProps\n /**\n * Props for the navigation component.\n */\n navigationProps?: Omit<CalendarNavigationProps, \"children\">\n /**\n * Props for the next button component.\n */\n nextButtonProps?: CalendarNextButtonProps\n /**\n * Props for the prev button component.\n */\n prevButtonProps?: CalendarPrevButtonProps\n /**\n * Props for the select component.\n */\n selectProps?: Select.RootProps\n /**\n * Props for the weekday component.\n */\n weekdayProps?: HTMLStyledProps<\"th\">\n /**\n * Props for the weekdays component.\n */\n weekdaysProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the week component.\n */\n weekProps?: HTMLStyledProps<\"tr\">\n /**\n * Props for the weeks component.\n */\n weeksProps?: HTMLStyledProps<\"tbody\">\n /**\n * Props for the year select component.\n */\n yearSelectProps?: CalendarYearSelectProps\n}\n\nconst {\n ComponentContext,\n PropsContext: CalendarPropsContext,\n useComponentContext,\n usePropsContext: useCalendarPropsContext,\n withContext,\n withProvider,\n} = createSlotComponent<CalendarRootProps, CalendarStyle, ComponentContext>(\n \"calendar\",\n calendarStyle,\n)\n\nexport { CalendarPropsContext, useCalendarPropsContext }\n\n/**\n * `Calendar` is a component for displaying or selecting dates in a calendar.\n *\n * @see https://yamada-ui.com/docs/components/calendar\n */\nexport const CalendarRoot = withProvider(\n <Multiple extends boolean = false, Range extends boolean = false>({\n children,\n day,\n buttonProps,\n controlProps,\n dayProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ...props\n }: CalendarRootProps<Multiple, Range>) => {\n const {\n descendants,\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n monthDays,\n monthItems,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekdays,\n weekendDays,\n yearItems,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getRootProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n } = useCalendar(props)\n const calendarContext = useMemo(\n () => ({\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n }),\n [\n disabled,\n endOfMonth,\n excludeDate,\n holidays,\n locale,\n max,\n maxDate,\n minDate,\n month,\n multiple,\n range,\n startDayOfWeek,\n startOfMonth,\n today,\n value,\n weekendDays,\n onChange,\n onMonthChange,\n onNextMonth,\n onPrevMonth,\n ],\n )\n const componentContext = useMemo(\n () => ({\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n }),\n [\n day,\n monthDays,\n monthItems,\n weekdays,\n yearItems,\n buttonProps,\n controlProps,\n dayProps,\n getMonthProps,\n getMonthSelectProps,\n getNavigationProps,\n getNextButtonProps,\n getPrevButtonProps,\n getStatusProps,\n getWeekdayProps,\n getYearSelectProps,\n monthProps,\n monthSelectProps,\n navigationProps,\n nextButtonProps,\n prevButtonProps,\n selectProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n yearSelectProps,\n ],\n )\n\n return (\n <CalendarDescendantsContext value={descendants}>\n <CalendarContext value={calendarContext}>\n <ComponentContext value={componentContext}>\n <styled.div {...getRootProps()}>\n {children ?? (\n <>\n <CalendarNavigation />\n <CalendarMonth />\n </>\n )}\n </styled.div>\n </ComponentContext>\n </CalendarContext>\n </CalendarDescendantsContext>\n )\n },\n \"root\",\n)() as GenericsComponent<{\n <Multiple extends boolean = false, Range extends boolean = false>(\n props: CalendarRootProps<Multiple, Range>,\n ): ReactElement\n}>\n\nexport interface CalendarNavigationProps extends HTMLStyledProps {}\n\nexport const CalendarNavigation = withContext<\"div\", CalendarNavigationProps>(\n \"div\",\n [\"row\", \"navigation\"],\n)(undefined, ({ children, ...rest }) => {\n const { getNavigationProps, navigationProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return children\n\n return (\n <>\n <CalendarPrevButton />\n <CalendarControl />\n <CalendarNextButton />\n </>\n )\n }, [children])\n\n return {\n ...getNavigationProps(mergeProps(navigationProps, rest)()),\n children: computedChildren,\n }\n})\n\nexport interface CalendarControlProps extends Omit<\n HTMLStyledProps,\n \"children\"\n> {\n /**\n * The control children to use.\n */\n children?: ReactNodeOrFunction<{ month: Date }>\n}\n\nexport const CalendarControl = withContext<\"div\", CalendarControlProps>(\n \"div\",\n \"control\",\n)(undefined, ({ children, ...rest }) => {\n const { month } = useCalendarContext()\n const { controlProps, getStatusProps } = useComponentContext()\n\n const computedChildren = useMemo(() => {\n if (children) return runIfFn(children, { month })\n\n return (\n <>\n <CalendarMonthSelect />\n <CalendarYearSelect />\n </>\n )\n }, [children, month])\n\n return {\n ...mergeProps(controlProps, rest)(),\n children: (\n <>\n {computedChildren}\n <styled.div {...getStatusProps()} />\n </>\n ),\n }\n})\n\nexport interface CalendarPrevButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarPrevButton = withContext<\n \"button\",\n CalendarPrevButtonProps\n>(\"button\", [\"button\", \"prev\"])(\n undefined,\n ({ children = <ChevronLeftIcon />, ...rest }) => {\n const { buttonProps, getPrevButtonProps, prevButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getPrevButtonProps(mergeProps(buttonProps, prevButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarNextButtonProps extends HTMLStyledProps<\"button\"> {}\n\nexport const CalendarNextButton = withContext<\n \"button\",\n CalendarNextButtonProps\n>(\"button\", [\"button\", \"next\"])(\n undefined,\n ({ children = <ChevronRightIcon />, ...rest }) => {\n const { buttonProps, getNextButtonProps, nextButtonProps } =\n useComponentContext()\n\n return {\n children,\n ...getNextButtonProps(mergeProps(buttonProps, nextButtonProps, rest)()),\n }\n },\n)\n\nexport interface CalendarSeparatorProps extends HTMLStyledProps<\"span\"> {}\n\nexport const CalendarSeparator = withContext<\"span\", CalendarSeparatorProps>(\n \"span\",\n \"separator\",\n)({ children: \"/\", role: \"separator\" })\n\nexport interface CalendarYearSelectProps extends Select.RootProps {}\n\nexport const CalendarYearSelect = withContext<\"div\", CalendarYearSelectProps>(\n (props) => {\n const { yearItems, getYearSelectProps, selectProps, yearSelectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n yearSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={yearItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getYearSelectProps(rest)}\n />\n )\n },\n [\"select\", \"years\"],\n)()\n\nexport interface CalendarMonthSelectProps extends Select.RootProps {}\n\nexport const CalendarMonthSelect = withContext<\"div\", CalendarMonthSelectProps>(\n (props) => {\n const { monthItems, getMonthSelectProps, monthSelectProps, selectProps } =\n useComponentContext()\n const { contentProps, rootProps, ...rest } = mergeProps(\n selectProps,\n monthSelectProps,\n props,\n )()\n\n return (\n <Select.Root\n variant=\"plain\"\n items={monthItems}\n minH=\"{cell-size}\"\n contentProps={{ minW: \"{select-content-size}\", ...contentProps }}\n rootProps={{\n fontSize: \"{select-font-size}\",\n w: \"{select-root-size}\",\n ...rootProps,\n }}\n {...resetFieldProps}\n {...getMonthSelectProps(rest)}\n />\n )\n },\n [\"select\", \"months\"],\n)()\n\nexport interface CalendarMonthProps extends Omit<\n HTMLStyledProps<\"table\">,\n \"children\"\n> {\n /**\n * The day component to use.\n */\n day?: ReactNodeOrFunction<{ value: Date }>\n}\n\nexport const CalendarMonth = withContext<\"table\", CalendarMonthProps>(\n \"table\",\n \"month\",\n)(undefined, ({ day: dayProp, ...rest }) => {\n const {\n day,\n monthDays,\n weekdays,\n dayProps,\n getMonthProps,\n getWeekdayProps,\n monthProps,\n weekdayProps,\n weekdaysProps,\n weekProps,\n weeksProps,\n } = useComponentContext()\n\n dayProp ??= day\n\n const children = (\n <>\n <styled.thead aria-hidden>\n <CalendarWeekDays {...weekdaysProps}>\n {weekdays.map(({ label, value }, index) => (\n <CalendarWeekday\n key={index}\n {...getWeekdayProps({ ...weekdayProps, value })}\n >\n {label}\n </CalendarWeekday>\n ))}\n </CalendarWeekDays>\n </styled.thead>\n\n <CalendarWeeks {...weeksProps}>\n {monthDays.map((week, index) => (\n <CalendarWeek key={index} {...weekProps}>\n {week.map(({ label, value }) => (\n <CalendarDay\n key={value.toDateString()}\n {...{ ...dayProps, value }}\n >\n {runIfFn(dayProp, { value }) ?? (\n <styled.span>{label}</styled.span>\n )}\n </CalendarDay>\n ))}\n </CalendarWeek>\n ))}\n </CalendarWeeks>\n </>\n )\n\n return {\n ...getMonthProps(mergeProps(monthProps, rest)()),\n children,\n }\n})\n\nconst CalendarWeekDays = withContext(\"tr\", [\"row\", \"weekdays\"])()\n\nconst CalendarWeekday = withContext(\"th\", [\"cell\", \"weekday\"])()\n\nconst CalendarWeeks = withContext(\"tbody\", \"weeks\")()\n\nconst CalendarWeek = withContext(\"tr\", [\"row\", \"week\"])()\n\ninterface CalendarDayProps\n extends Omit<HTMLStyledProps<\"td\">, \"value\">, UseCalendarDayProps {}\n\nconst CalendarDay = withContext<\"td\", CalendarDayProps>(\"td\", [\"cell\", \"day\"])(\n undefined,\n (props) => {\n const { getDayProps } = useCalendarDay(props)\n\n return getDayProps()\n },\n)\n"],"mappings":";;;;;;;;;;;;;;AAiIA,MAAM,EACJ,kBACA,cAAc,sBACd,qBACA,iBAAiB,yBACjB,aACA,iBACE,oBACF,YACA,cACD;;;;;;AASD,MAAa,eAAe,cACwC,EAChE,UACA,KACA,aACA,cACA,UACA,YACA,kBACA,iBACA,iBACA,iBACA,aACA,cACA,eACA,WACA,YACA,iBACA,GAAG,YACqC;CACxC,MAAM,EACJ,aACA,UACA,YACA,aACA,UACA,QACA,KACA,SACA,SACA,OACA,WACA,YACA,UACA,OACA,gBACA,cACA,OACA,OACA,UACA,aACA,WACA,eACA,qBACA,oBACA,oBACA,oBACA,cACA,gBACA,iBACA,oBACA,UACA,eACA,aACA,gBACE,YAAY,MAAM;CA4GtB,OACE,oBAAC,4BAAD;EAA4B,OAAO;YACjC,oBAAC,iBAAD;GAAiB,OA7GG,eACf;IACL;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,GACD;IACE;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACD,CAiEwC;aACrC,oBAAC,kBAAD;IAAkB,OAhEC,eAChB;KACL;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,GACD;KACE;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACD,CAM4C;cACvC,oBAAC,OAAO,KAAR;KAAY,GAAI,cAAc;eAC3B,YACC,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,oBAAD,EAAsB,CAAA,EACtB,oBAAC,eAAD,EAAiB,CAAA,CAChB,EAAA,CAAA;KAEM,CAA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7C,OAAO,aAAa;EAEvB"}
|
|
@@ -58,10 +58,10 @@ const useCheckboxGroup = (props = {}) => {
|
|
|
58
58
|
"data-checked": (0, utils_exports.dataAttr)(checked),
|
|
59
59
|
"data-disabled": (0, utils_exports.dataAttr)(trulyDisabled),
|
|
60
60
|
checked,
|
|
61
|
-
disabled: trulyDisabled,
|
|
62
61
|
readOnly,
|
|
63
62
|
required,
|
|
64
63
|
...props,
|
|
64
|
+
disabled: Boolean(props.disabled || trulyDisabled),
|
|
65
65
|
onBlur: (0, utils_exports.handlerAll)(props.onBlur, eventProps.onBlur),
|
|
66
66
|
onChange: (0, utils_exports.handlerAll)(props.onChange, onChange),
|
|
67
67
|
onFocus: (0, utils_exports.handlerAll)(props.onFocus, eventProps.onFocus)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-checkbox-group.js","names":["createContext"],"sources":["../../../../src/components/checkbox/use-checkbox-group.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isNumber,\n isObject,\n isString,\n isUndefined,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\ninterface CheckboxGroupContext extends Omit<\n UseCheckboxGroupReturn,\n \"getRootProps\"\n> {}\n\nconst [CheckboxGroupContext, useCheckboxGroupContext] =\n createContext<CheckboxGroupContext>({\n name: \"CheckboxGroupContext\",\n strict: false,\n })\n\nexport { CheckboxGroupContext, useCheckboxGroupContext }\n\nexport interface UseCheckboxGroupProps<Y extends string = string>\n extends Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"value\">, FieldProps {\n /**\n * The initial value of the checkbox group.\n *\n * @default []\n */\n defaultValue?: Y[]\n /**\n * The maximum number of checkboxes that can be checked.\n */\n max?: number\n /**\n * The value of the checkbox group.\n */\n value?: Y[]\n /**\n * The callback fired when any children checkbox is checked or unchecked.\n */\n onChange?: (value: Y[]) => void\n}\n\nexport const useCheckboxGroup = <Y extends string = string>(\n props: UseCheckboxGroupProps<Y> = {},\n) => {\n const {\n context: { labelId } = {},\n props: {\n defaultValue = [],\n disabled,\n max,\n readOnly,\n required,\n value: valueProp,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps: { \"aria-describedby\": ariaDescribedbyProp, ...ariaProps },\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const interactive = !(readOnly || disabled)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n\n const onChange = useCallback(\n (valueOrEv: ChangeEvent<HTMLInputElement> | Y) => {\n if (!interactive) return\n\n if (isObject(valueOrEv)) valueOrEv = valueOrEv.target.value as Y\n\n setValue((prev) => {\n if (prev.includes(valueOrEv)) {\n return prev.filter((prevValue) => prevValue !== valueOrEv)\n } else if (!isNumber(max) || prev.length < max) {\n return [...prev, valueOrEv]\n } else {\n return prev\n }\n })\n },\n [interactive, max, setValue],\n )\n\n const getRootProps: PropGetter = useCallback(\n ({\n ref,\n \"aria-describedby\": ariaDescribedby,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n } = {}) =>\n mergeProps(\n dataProps,\n {\n \"aria-describedby\": cx(ariaDescribedbyProp, ariaDescribedby),\n \"aria-labelledby\": cx(labelId, ariaLabelledby),\n role: \"group\",\n },\n rest,\n props,\n {\n ref,\n },\n )(),\n [ariaDescribedbyProp, dataProps, labelId, rest],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => {\n const checked =\n !isUndefined(value) &&\n (isString(props.value) || isNumber(props.value)) &&\n value.includes(props.value as Y)\n const trulyDisabled = !checked && isNumber(max) && value.length >= max\n\n return {\n ...dataProps,\n ...ariaProps,\n type: \"checkbox\",\n style: visuallyHiddenAttributes.style,\n \"aria-checked\": checked,\n \"aria-disabled\": ariaAttr(trulyDisabled),\n \"data-checked\": dataAttr(checked),\n \"data-disabled\": dataAttr(trulyDisabled),\n checked,\n
|
|
1
|
+
{"version":3,"file":"use-checkbox-group.js","names":["createContext"],"sources":["../../../../src/components/checkbox/use-checkbox-group.ts"],"sourcesContent":["\"use client\"\n\nimport type { ChangeEvent } from \"react\"\nimport type { HTMLProps, PropGetter } from \"../../core\"\nimport type { FieldProps } from \"../field\"\nimport { useCallback } from \"react\"\nimport { mergeProps } from \"../../core\"\nimport { useControllableState } from \"../../hooks/use-controllable-state\"\nimport {\n ariaAttr,\n createContext,\n cx,\n dataAttr,\n handlerAll,\n isNumber,\n isObject,\n isString,\n isUndefined,\n visuallyHiddenAttributes,\n} from \"../../utils\"\nimport { useFieldProps } from \"../field\"\n\ninterface CheckboxGroupContext extends Omit<\n UseCheckboxGroupReturn,\n \"getRootProps\"\n> {}\n\nconst [CheckboxGroupContext, useCheckboxGroupContext] =\n createContext<CheckboxGroupContext>({\n name: \"CheckboxGroupContext\",\n strict: false,\n })\n\nexport { CheckboxGroupContext, useCheckboxGroupContext }\n\nexport interface UseCheckboxGroupProps<Y extends string = string>\n extends Omit<HTMLProps, \"defaultValue\" | \"onChange\" | \"value\">, FieldProps {\n /**\n * The initial value of the checkbox group.\n *\n * @default []\n */\n defaultValue?: Y[]\n /**\n * The maximum number of checkboxes that can be checked.\n */\n max?: number\n /**\n * The value of the checkbox group.\n */\n value?: Y[]\n /**\n * The callback fired when any children checkbox is checked or unchecked.\n */\n onChange?: (value: Y[]) => void\n}\n\nexport const useCheckboxGroup = <Y extends string = string>(\n props: UseCheckboxGroupProps<Y> = {},\n) => {\n const {\n context: { labelId } = {},\n props: {\n defaultValue = [],\n disabled,\n max,\n readOnly,\n required,\n value: valueProp,\n onChange: onChangeProp,\n ...rest\n },\n ariaProps: { \"aria-describedby\": ariaDescribedbyProp, ...ariaProps },\n dataProps,\n eventProps,\n } = useFieldProps(props)\n const interactive = !(readOnly || disabled)\n const [value, setValue] = useControllableState({\n defaultValue,\n value: valueProp,\n onChange: onChangeProp,\n })\n\n const onChange = useCallback(\n (valueOrEv: ChangeEvent<HTMLInputElement> | Y) => {\n if (!interactive) return\n\n if (isObject(valueOrEv)) valueOrEv = valueOrEv.target.value as Y\n\n setValue((prev) => {\n if (prev.includes(valueOrEv)) {\n return prev.filter((prevValue) => prevValue !== valueOrEv)\n } else if (!isNumber(max) || prev.length < max) {\n return [...prev, valueOrEv]\n } else {\n return prev\n }\n })\n },\n [interactive, max, setValue],\n )\n\n const getRootProps: PropGetter = useCallback(\n ({\n ref,\n \"aria-describedby\": ariaDescribedby,\n \"aria-labelledby\": ariaLabelledby,\n ...props\n } = {}) =>\n mergeProps(\n dataProps,\n {\n \"aria-describedby\": cx(ariaDescribedbyProp, ariaDescribedby),\n \"aria-labelledby\": cx(labelId, ariaLabelledby),\n role: \"group\",\n },\n rest,\n props,\n {\n ref,\n },\n )(),\n [ariaDescribedbyProp, dataProps, labelId, rest],\n )\n\n const getInputProps: PropGetter<\"input\"> = useCallback(\n (props = {}) => {\n const checked =\n !isUndefined(value) &&\n (isString(props.value) || isNumber(props.value)) &&\n value.includes(props.value as Y)\n const trulyDisabled = !checked && isNumber(max) && value.length >= max\n\n return {\n ...dataProps,\n ...ariaProps,\n type: \"checkbox\",\n style: visuallyHiddenAttributes.style,\n \"aria-checked\": checked,\n \"aria-disabled\": ariaAttr(trulyDisabled),\n \"data-checked\": dataAttr(checked),\n \"data-disabled\": dataAttr(trulyDisabled),\n checked,\n readOnly,\n required,\n ...props,\n disabled: Boolean(props.disabled || trulyDisabled),\n onBlur: handlerAll(props.onBlur, eventProps.onBlur),\n onChange: handlerAll(props.onChange, onChange),\n onFocus: handlerAll(props.onFocus, eventProps.onFocus),\n }\n },\n [\n ariaProps,\n dataProps,\n eventProps,\n max,\n onChange,\n readOnly,\n required,\n value,\n ],\n )\n\n const getLabelProps: PropGetter<\"label\"> = useCallback(\n (props) => ({\n ...dataProps,\n ...props,\n }),\n [dataProps],\n )\n\n return {\n max,\n value,\n getInputProps,\n getLabelProps,\n getRootProps,\n onChange,\n }\n}\n\nexport type UseCheckboxGroupReturn = ReturnType<typeof useCheckboxGroup>\n"],"mappings":";;;;;;;;;AA2BA,MAAM,CAAC,sBAAsB,2BAC3BA,gBAAoC;CAClC,MAAM;CACN,QAAQ;CACT,CAAC;AA0BJ,MAAa,oBACX,QAAkC,EAAE,KACjC;CACH,MAAM,EACJ,SAAS,EAAE,YAAY,EAAE,EACzB,OAAO,EACL,eAAe,EAAE,EACjB,UACA,KACA,UACA,UACA,OAAO,WACP,UAAU,cACV,GAAG,QAEL,WAAW,EAAE,oBAAoB,qBAAqB,GAAG,aACzD,WACA,eACE,cAAc,MAAM;CACxB,MAAM,cAAc,EAAE,YAAY;CAClC,MAAM,CAAC,OAAO,YAAY,qBAAqB;EAC7C;EACA,OAAO;EACP,UAAU;EACX,CAAC;CAEF,MAAM,WAAW,aACd,cAAiD;EAChD,IAAI,CAAC,aAAa;EAElB,KAAA,GAAA,cAAA,UAAa,UAAU,EAAE,YAAY,UAAU,OAAO;EAEtD,UAAU,SAAS;GACjB,IAAI,KAAK,SAAS,UAAU,EAC1B,OAAO,KAAK,QAAQ,cAAc,cAAc,UAAU;QACrD,IAAI,EAAA,GAAA,cAAA,UAAU,IAAI,IAAI,KAAK,SAAS,KACzC,OAAO,CAAC,GAAG,MAAM,UAAU;QAE3B,OAAO;IAET;IAEJ;EAAC;EAAa;EAAK;EAAS,CAC7B;CAED,MAAM,eAA2B,aAC9B,EACC,KACA,oBAAoB,iBACpB,mBAAmB,gBACnB,GAAG,UACD,EAAE,KACJ,WACE,WACA;EACE,qBAAA,GAAA,cAAA,IAAuB,qBAAqB,gBAAgB;EAC5D,oBAAA,GAAA,cAAA,IAAsB,SAAS,eAAe;EAC9C,MAAM;EACP,EACD,MACA,OACA,EACE,KACD,CACF,EAAE,EACL;EAAC;EAAqB;EAAW;EAAS;EAAK,CAChD;CAiDD,OAAO;EACL;EACA;EACA,eAlDyC,aACxC,QAAQ,EAAE,KAAK;GACd,MAAM,UACJ,EAAA,GAAA,cAAA,aAAa,MAAM,MAAA,GAAA,cAAA,UACT,MAAM,MAAM,KAAA,GAAA,cAAA,UAAa,MAAM,MAAM,KAC/C,MAAM,SAAS,MAAM,MAAW;GAClC,MAAM,gBAAgB,CAAC,YAAA,GAAA,cAAA,UAAoB,IAAI,IAAI,MAAM,UAAU;GAEnE,OAAO;IACL,GAAG;IACH,GAAG;IACH,MAAM;IACN,OAAO,yBAAyB;IAChC,gBAAgB;IAChB,kBAAA,GAAA,cAAA,UAA0B,cAAc;IACxC,iBAAA,GAAA,cAAA,UAAyB,QAAQ;IACjC,kBAAA,GAAA,cAAA,UAA0B,cAAc;IACxC;IACA;IACA;IACA,GAAG;IACH,UAAU,QAAQ,MAAM,YAAY,cAAc;IAClD,SAAA,GAAA,cAAA,YAAmB,MAAM,QAAQ,WAAW,OAAO;IACnD,WAAA,GAAA,cAAA,YAAqB,MAAM,UAAU,SAAS;IAC9C,UAAA,GAAA,cAAA,YAAoB,MAAM,SAAS,WAAW,QAAQ;IACvD;KAEH;GACE;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACD,CAcY;EACb,eAZyC,aACxC,WAAW;GACV,GAAG;GACH,GAAG;GACJ,GACD,CAAC,UAAU,CAOE;EACb;EACA;EACD"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/autocomplete/autocomplete.style.d.ts
|
|
4
|
-
declare const autocompleteStyle: ComponentSlotStyle<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "
|
|
4
|
+
declare const autocompleteStyle: ComponentSlotStyle<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "indicator" | "field" | "empty" | "valueText", CSSPropObject<CSSSlotObject<"input" | "label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "indicator" | "field" | "empty" | "valueText">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
empty: {
|
|
7
7
|
gap: "1.5";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/calendar/calendar.style.d.ts
|
|
4
|
-
declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "
|
|
4
|
+
declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "month" | "week" | "weekday" | "day" | "control" | "months" | "years" | "weeks" | "prev", {
|
|
5
5
|
/**
|
|
6
6
|
* If `true`, the calendar will be fixed rows.
|
|
7
7
|
*
|
|
@@ -73,7 +73,7 @@ declare const calendarStyle: ComponentSlotStyle<"button" | "select" | "cell" | "
|
|
|
73
73
|
"--font-size": "fontSizes.xl";
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
}, CSSModifierObject<CSSSlotObject<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "
|
|
76
|
+
}, CSSModifierObject<CSSSlotObject<"button" | "select" | "cell" | "navigation" | "row" | "separator" | "next" | "root" | "month" | "week" | "weekday" | "day" | "control" | "months" | "years" | "weeks" | "prev">>>;
|
|
77
77
|
type CalendarStyle = typeof calendarStyle;
|
|
78
78
|
//#endregion
|
|
79
79
|
export { CalendarStyle, calendarStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/carousel/carousel.style.d.ts
|
|
4
|
-
declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "item" | "root" | "trigger" | "
|
|
4
|
+
declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "item" | "root" | "trigger" | "indicator" | "indicators" | "prev", CSSPropObject<CSSSlotObject<"list" | "next" | "item" | "root" | "trigger" | "indicator" | "indicators" | "prev">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
root: {
|
|
7
7
|
h: "sm";
|
|
@@ -17,7 +17,7 @@ declare const carouselStyle: ComponentSlotStyle<"list" | "next" | "item" | "root
|
|
|
17
17
|
h: "lg";
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
}, CSSModifierObject<CSSSlotObject<"list" | "next" | "item" | "root" | "trigger" | "
|
|
20
|
+
}, CSSModifierObject<CSSSlotObject<"list" | "next" | "item" | "root" | "trigger" | "indicator" | "indicators" | "prev">>>;
|
|
21
21
|
type CarouselStyle = typeof carouselStyle;
|
|
22
22
|
//#endregion
|
|
23
23
|
export { CarouselStyle, carouselStyle };
|
|
@@ -63,7 +63,7 @@ interface CheckboxCardRootProps<Y extends string = string> extends Merge<HTMLSty
|
|
|
63
63
|
*/
|
|
64
64
|
rootProps?: HTMLStyledProps<"label">;
|
|
65
65
|
}
|
|
66
|
-
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
66
|
+
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
67
67
|
justify: {
|
|
68
68
|
end: {
|
|
69
69
|
addon: {
|
|
@@ -213,7 +213,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
213
213
|
name,
|
|
214
214
|
className,
|
|
215
215
|
...options
|
|
216
|
-
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, CheckboxCardPropsContext: _$react.Context<Partial<CheckboxCardRootProps<string>> | undefined>, useCheckboxCardPropsContext: () => Partial<CheckboxCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
216
|
+
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, CheckboxCardPropsContext: _$react.Context<Partial<CheckboxCardRootProps<string>> | undefined>, useCheckboxCardPropsContext: () => Partial<CheckboxCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
217
217
|
justify: {
|
|
218
218
|
end: {
|
|
219
219
|
addon: {
|
|
@@ -363,7 +363,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
363
363
|
className,
|
|
364
364
|
withContext,
|
|
365
365
|
transferProps
|
|
366
|
-
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "
|
|
366
|
+
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
367
367
|
justify: {
|
|
368
368
|
end: {
|
|
369
369
|
addon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/checkbox-card/checkbox-card.style.d.ts
|
|
3
|
-
declare const checkboxCardStyle: ComponentSlotStyle<"group" | "root" | "
|
|
3
|
+
declare const checkboxCardStyle: ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
4
4
|
/**
|
|
5
5
|
* The justify indicator of the component
|
|
6
6
|
*
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/color-picker/color-picker.style.d.ts
|
|
4
|
-
declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "root" | "
|
|
4
|
+
declare const colorPickerStyle: ComponentSlotStyle<"input" | "content" | "icon" | "root" | "colorSwatch" | "field" | "eyeDropper", CSSPropObject<CSSSlotObject<"input" | "content" | "icon" | "root" | "colorSwatch" | "field" | "eyeDropper">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
field: {
|
|
7
7
|
fontSize: "1em";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/color-selector/color-selector.style.d.ts
|
|
4
|
-
declare const colorSelectorStyle: ComponentSlotStyle<"root" | "hueSlider" | "saturationSlider" | "eyeDropper" | "
|
|
4
|
+
declare const colorSelectorStyle: ComponentSlotStyle<"root" | "hueSlider" | "saturationSlider" | "eyeDropper" | "colorSwatchGroupLabel" | "alphaSlider" | "colorSwatchGroup" | "colorSwatchItem", {
|
|
5
5
|
/**
|
|
6
6
|
* The shape of the thumb and color swatch.
|
|
7
7
|
*
|
|
@@ -22,7 +22,7 @@ declare const colorSelectorStyle: ComponentSlotStyle<"root" | "hueSlider" | "sat
|
|
|
22
22
|
md: {};
|
|
23
23
|
lg: {};
|
|
24
24
|
xl: {};
|
|
25
|
-
}, CSSModifierObject<CSSSlotObject<"root" | "hueSlider" | "saturationSlider" | "eyeDropper" | "
|
|
25
|
+
}, CSSModifierObject<CSSSlotObject<"root" | "hueSlider" | "saturationSlider" | "eyeDropper" | "colorSwatchGroupLabel" | "alphaSlider" | "colorSwatchGroup" | "colorSwatchItem">>>;
|
|
26
26
|
type ColorSelectorStyle = typeof colorSelectorStyle;
|
|
27
27
|
//#endregion
|
|
28
28
|
export { ColorSelectorStyle, colorSelectorStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/drawer/drawer.style.d.ts
|
|
4
|
-
declare const drawerStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "
|
|
4
|
+
declare const drawerStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root" | "dragBar", {
|
|
5
5
|
/**
|
|
6
6
|
* The placement of the drawer.
|
|
7
7
|
*
|
|
@@ -117,7 +117,7 @@ declare const drawerStyle: ComponentSlotStyle<"body" | "footer" | "header" | "ti
|
|
|
117
117
|
rounded: "0";
|
|
118
118
|
};
|
|
119
119
|
};
|
|
120
|
-
}, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "
|
|
120
|
+
}, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root" | "dragBar">>>;
|
|
121
121
|
type DrawerStyle = typeof drawerStyle;
|
|
122
122
|
//#endregion
|
|
123
123
|
export { DrawerStyle, drawerStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/empty-state/empty-state.style.d.ts
|
|
4
|
-
declare const emptyState: ComponentSlotStyle<"title" | "content" | "root" | "
|
|
4
|
+
declare const emptyState: ComponentSlotStyle<"title" | "content" | "root" | "indicator" | "description", CSSPropObject<CSSSlotObject<"title" | "content" | "root" | "indicator" | "description">>, {
|
|
5
5
|
sm: {
|
|
6
6
|
content: {
|
|
7
7
|
gap: "xs";
|
|
@@ -47,7 +47,7 @@ declare const emptyState: ComponentSlotStyle<"title" | "content" | "root" | "des
|
|
|
47
47
|
fontSize: "xl";
|
|
48
48
|
};
|
|
49
49
|
};
|
|
50
|
-
}, CSSModifierObject<CSSSlotObject<"title" | "content" | "root" | "
|
|
50
|
+
}, CSSModifierObject<CSSSlotObject<"title" | "content" | "root" | "indicator" | "description">>>;
|
|
51
51
|
type EmptyState = typeof emptyState;
|
|
52
52
|
//#endregion
|
|
53
53
|
export { EmptyState, emptyState };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/modal/modal.style.d.ts
|
|
4
|
-
declare const modalStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "
|
|
4
|
+
declare const modalStyle: ComponentSlotStyle<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root", {
|
|
5
5
|
/**
|
|
6
6
|
* The placement of the modal.
|
|
7
7
|
*
|
|
@@ -155,7 +155,7 @@ declare const modalStyle: ComponentSlotStyle<"body" | "footer" | "header" | "tit
|
|
|
155
155
|
p: "0";
|
|
156
156
|
};
|
|
157
157
|
};
|
|
158
|
-
}, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "
|
|
158
|
+
}, CSSModifierObject<CSSSlotObject<"body" | "footer" | "header" | "title" | "content" | "overlay" | "closeButton" | "root">>>;
|
|
159
159
|
type ModalStyle = typeof modalStyle;
|
|
160
160
|
//#endregion
|
|
161
161
|
export { ModalStyle, modalStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSModifierObject, CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/notice/notice.style.d.ts
|
|
4
|
-
declare const noticeStyle: ComponentSlotStyle<"content" | "item" | "
|
|
4
|
+
declare const noticeStyle: ComponentSlotStyle<"content" | "item" | "closeButton" | "root", CSSPropObject<CSSSlotObject<"content" | "item" | "closeButton" | "root">>, CSSModifierObject<CSSSlotObject<"content" | "item" | "closeButton" | "root">>, CSSModifierObject<CSSSlotObject<"content" | "item" | "closeButton" | "root">>>;
|
|
5
5
|
type NoticeStyle = typeof noticeStyle;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { NoticeStyle };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
import { CSSPropObject, CSSSlotObject } from "../../core/css/index.types.js";
|
|
3
3
|
//#region src/components/number-input/number-input.style.d.ts
|
|
4
|
-
declare const numberInputStyle: ComponentSlotStyle<"button" | "root" | "
|
|
4
|
+
declare const numberInputStyle: ComponentSlotStyle<"button" | "root" | "field" | "control" | "decrement" | "increment", CSSPropObject<CSSSlotObject<"button" | "root" | "field" | "control" | "decrement" | "increment">>, {
|
|
5
5
|
xs: {
|
|
6
6
|
control: {
|
|
7
7
|
boxSize: "calc({--height} - {spaces.2})";
|
|
@@ -55,7 +55,7 @@ interface RadioCardRootProps<Y extends string = string> extends Merge<HTMLStyled
|
|
|
55
55
|
*/
|
|
56
56
|
rootProps?: HTMLStyledProps<"label">;
|
|
57
57
|
}
|
|
58
|
-
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
58
|
+
declare const component: <H extends "fragment" | As = "div", R extends _$_yamada_ui_utils0.Dict = _$_yamada_ui_utils0.Dict<any>>(el: H | _$react.FC<R>, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
59
59
|
justify: {
|
|
60
60
|
end: {
|
|
61
61
|
addon: {
|
|
@@ -232,7 +232,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
232
232
|
name,
|
|
233
233
|
className,
|
|
234
234
|
...options
|
|
235
|
-
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, RadioCardPropsContext: _$react.Context<Partial<RadioCardRootProps<string>> | undefined>, useRadioCardPropsContext: () => Partial<RadioCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "
|
|
235
|
+
}?: ComponentOptions) => (initialProps?: InitialProps<R>, ...superProps: SuperProps<R>[]) => H extends "fragment" ? _$react.FunctionComponent<R> : Component<Exclude<H, "fragment">, R>, RadioCardPropsContext: _$react.Context<Partial<RadioCardRootProps<string>> | undefined>, useRadioCardPropsContext: () => Partial<RadioCardRootProps<string>> | undefined, useRootComponentProps: <Y extends _$_yamada_ui_utils0.Dict = {}, R extends keyof Y = keyof Y>(props: Y, slot?: ComponentSlot<ComponentSlotName<ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
236
236
|
justify: {
|
|
237
237
|
end: {
|
|
238
238
|
addon: {
|
|
@@ -409,7 +409,7 @@ declare const component: <H extends "fragment" | As = "div", R extends _$_yamada
|
|
|
409
409
|
className,
|
|
410
410
|
withContext,
|
|
411
411
|
transferProps
|
|
412
|
-
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "
|
|
412
|
+
}?: UseComponentPropsOptions<R>) => [CSSSlotObject, Merge<WithoutThemeProps<Y, ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
413
413
|
justify: {
|
|
414
414
|
end: {
|
|
415
415
|
addon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/radio-card/radio-card.style.d.ts
|
|
3
|
-
declare const radioCardStyle: ComponentSlotStyle<"group" | "root" | "
|
|
3
|
+
declare const radioCardStyle: ComponentSlotStyle<"group" | "root" | "indicator" | "description" | "addon", {
|
|
4
4
|
/**
|
|
5
5
|
* The justify indicator of the component
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/select/select.style.d.ts
|
|
3
|
-
declare const selectStyle: ComponentSlotStyle<"label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "
|
|
3
|
+
declare const selectStyle: ComponentSlotStyle<"label" | "option" | "content" | "group" | "separator" | "icon" | "root" | "indicator" | "field" | "valueText", {
|
|
4
4
|
/**
|
|
5
5
|
* If `true`, wrap the value text.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/steps/steps.style.d.ts
|
|
3
|
-
declare const stepsStyle: ComponentSlotStyle<"title" | "list" | "separator" | "item" | "root" | "
|
|
3
|
+
declare const stepsStyle: ComponentSlotStyle<"title" | "list" | "separator" | "item" | "root" | "indicator" | "description", {
|
|
4
4
|
/**
|
|
5
5
|
* The orientation of the steps.
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/tag/tag.style.d.ts
|
|
3
|
-
declare const tagStyle: ComponentSlotStyle<"content" | "icon" | "
|
|
3
|
+
declare const tagStyle: ComponentSlotStyle<"content" | "icon" | "closeButton" | "root" | "endIcon" | "startIcon", {
|
|
4
4
|
/**
|
|
5
5
|
* If `true`, the tag is full rounded. Else, it'll be slightly round.
|
|
6
6
|
*
|
|
@@ -69,7 +69,7 @@ declare const TimelineRoot: Component<({
|
|
|
69
69
|
index,
|
|
70
70
|
items,
|
|
71
71
|
...rest
|
|
72
|
-
}: WithoutThemeProps<TimelineRootProps, ComponentSlotStyle<"title" | "content" | "item" | "root" | "
|
|
72
|
+
}: WithoutThemeProps<TimelineRootProps, ComponentSlotStyle<"title" | "content" | "item" | "root" | "indicator" | "description" | "connector", {
|
|
73
73
|
align: {
|
|
74
74
|
center: {
|
|
75
75
|
content: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ComponentSlotStyle } from "../../core/system/index.types.js";
|
|
2
2
|
//#region src/components/timeline/timeline.style.d.ts
|
|
3
|
-
declare const timelineStyle: ComponentSlotStyle<"title" | "content" | "item" | "root" | "
|
|
3
|
+
declare const timelineStyle: ComponentSlotStyle<"title" | "content" | "item" | "root" | "indicator" | "description" | "connector", {
|
|
4
4
|
/**
|
|
5
5
|
* The alignment of the timeline.
|
|
6
6
|
*
|
|
@@ -134,7 +134,7 @@ declare const I18nContext: _$react.Context<I18nContext<{
|
|
|
134
134
|
readonly toggle: {
|
|
135
135
|
readonly "Toggle button": "Toggle button";
|
|
136
136
|
};
|
|
137
|
-
}, "progress.Loading..." | "progress.{value} percent" | "select.Clear value" | "table.Clear sorting" | "table.Page size" | "table.Select all rows" | "table.Select row" | "table.Sort ascending" | "table.Sort descending" | "toggle.Toggle button" | "slider.Slider thumb" | "modal.Close modal" | "modal.Open modal" | "
|
|
137
|
+
}, "progress.Loading..." | "progress.{value} percent" | "select.Clear value" | "table.Clear sorting" | "table.Page size" | "table.Select all rows" | "table.Select row" | "table.Sort ascending" | "table.Sort descending" | "toggle.Toggle button" | "slider.Slider thumb" | "modal.Close modal" | "modal.Open modal" | "closeButton.Close" | "calendar.Choose the month" | "calendar.Choose the year" | "calendar.Go to the next month" | "calendar.Go to the previous month" | "calendar.Today" | "actionBar.Close action bar" | "actionBar.Open action bar" | "autocomplete.Clear value" | "autocomplete.No results found" | "avatar.Avatar Icon" | "breadcrumb.Breadcrumb" | "breadcrumb.Ellipsis" | "carousel.Go to next slide" | "carousel.Go to previous slide" | "carousel.Go to {page} slide" | "carousel.Slides" | "carousel.{page} of {total}" | "colorPicker.Pick a color" | "colorSelector.Pick a color" | "colorSwatch.Color swatch group" | "datePicker.Clear value" | "hueSlider.Blue" | "hueSlider.Cyan" | "hueSlider.Green" | "hueSlider.Magenta" | "hueSlider.Red" | "hueSlider.Yellow" | "numberInput.Decrease" | "numberInput.Increase" | "pagination.Go to first page" | "pagination.Go to last page" | "pagination.Go to next page" | "pagination.Go to page {value}" | "pagination.Go to previous page" | "pagination.Pagination" | "pagination.{value} / {total}" | "pagination.{value} of {total}" | "passwordInput.Password strength meter" | "passwordInput.Toggle password visibility" | "saturationSlider.Saturation and brightness thumb" | "saturationSlider.Saturation {saturation}%, Brightness {brightness}%" | "sidebar.Close sidebar" | "sidebar.Open sidebar" | "stat.Decreased by" | "stat.Increased by" | "tag.Close tag">>;
|
|
138
138
|
interface I18nProviderProps {
|
|
139
139
|
children?: ReactNode;
|
|
140
140
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yamada-ui/react",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.2.1-dev-
|
|
4
|
+
"version": "2.2.1-dev-20260510113404",
|
|
5
5
|
"description": "React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"yamada",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"scroll-into-view-if-needed": "^3.1.0",
|
|
148
148
|
"sonner": "^2.0.7",
|
|
149
149
|
"uqr": "^0.1.3",
|
|
150
|
-
"@yamada-ui/utils": "2.1.3-dev-
|
|
150
|
+
"@yamada-ui/utils": "2.1.3-dev-20260510113404"
|
|
151
151
|
},
|
|
152
152
|
"devDependencies": {
|
|
153
153
|
"@babel/parser": "^7.29.2",
|