@raystack/apsara 0.41.2 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/v1/components/calendar/range-picker.cjs +2 -2
- package/dist/v1/components/calendar/range-picker.cjs.map +1 -1
- package/dist/v1/components/calendar/range-picker.d.ts +5 -2
- package/dist/v1/components/calendar/range-picker.d.ts.map +1 -1
- package/dist/v1/components/calendar/range-picker.js +2 -2
- package/dist/v1/components/calendar/range-picker.js.map +1 -1
- package/dist/v1/components/select/select.cjs +25 -8
- package/dist/v1/components/select/select.cjs.map +1 -1
- package/dist/v1/components/select/select.d.ts +11 -3
- package/dist/v1/components/select/select.d.ts.map +1 -1
- package/dist/v1/components/select/select.js +26 -9
- package/dist/v1/components/select/select.js.map +1 -1
- package/dist/v1/components/select/select.module.css.cjs +1 -1
- package/dist/v1/components/select/select.module.css.js +1 -1
- package/dist/v1/node_modules/.pnpm/@radix-ui_react-select@2.1.1_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.cjs +10 -10
- package/dist/v1/style.css +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@ var textfield = require('../textfield/textfield.cjs');
|
|
|
10
10
|
var calendar = require('./calendar.cjs');
|
|
11
11
|
var calendar_module = require('./calendar.module.css.cjs');
|
|
12
12
|
|
|
13
|
-
function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY",
|
|
13
|
+
function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldsProps = {}, placeholders, calendarProps, onSelect = () => { }, value = {
|
|
14
14
|
to: new Date(),
|
|
15
15
|
from: new Date(),
|
|
16
16
|
}, pickerGroupClassName, children, showCalendarIcon = true, footer, }) {
|
|
@@ -59,7 +59,7 @@ function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps,
|
|
|
59
59
|
function onOpenChange(open) {
|
|
60
60
|
setShowCalendar(Boolean(open));
|
|
61
61
|
}
|
|
62
|
-
const defaultTrigger = (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { gap: "medium", className: pickerGroupClassName, children: [jsxRuntime.jsxRuntimeExports.jsx(textfield.TextField, { value: startDate, trailing: showCalendarIcon ? jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CalendarIcon, {}) : undefined, className: calendar_module.default.datePickerInput, readOnly: true, ...
|
|
62
|
+
const defaultTrigger = (jsxRuntime.jsxRuntimeExports.jsxs(flex.Flex, { gap: "medium", className: pickerGroupClassName, children: [jsxRuntime.jsxRuntimeExports.jsx(textfield.TextField, { value: startDate, trailing: showCalendarIcon ? jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CalendarIcon, {}) : undefined, className: calendar_module.default.datePickerInput, readOnly: true, ...(textFieldsProps.startDate ?? {}), placeholder: placeholders?.startDate || "Select start date" }), jsxRuntime.jsxRuntimeExports.jsx(textfield.TextField, { value: endDate, trailing: showCalendarIcon ? jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.CalendarIcon, {}) : undefined, className: calendar_module.default.datePickerInput, readOnly: true, ...(textFieldsProps.endDate ?? {}), placeholder: placeholders?.endDate || "Select end date" })] }));
|
|
63
63
|
const trigger = typeof children === 'function'
|
|
64
64
|
? children({ startDate, endDate })
|
|
65
65
|
: children || defaultTrigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-picker.cjs","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n
|
|
1
|
+
{"version":3,"file":"range-picker.cjs","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldsProps?: { startDate?: TextfieldProps, endDate?: TextfieldProps };\n placeholders?: { startDate?: string; endDate?: string };\n calendarProps?: PropsRangeRequired & PropsBase;\n onSelect?: (date: DateRange) => void;\n pickerGroupClassName?: string;\n value?: DateRange;\n children?: React.ReactNode | ((props: { startDate: string; endDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n footer?: React.ReactNode;\n}\n\ntype RangeFields = keyof DateRange;\n\nexport function RangePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n textFieldsProps = {},\n placeholders,\n calendarProps,\n onSelect = () => {},\n value = {\n to: new Date(),\n from: new Date(),\n },\n pickerGroupClassName,\n children,\n showCalendarIcon = true,\n footer,\n}: RangePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [currentRangeField, setCurrentRangeField] = useState<RangeFields>(\"from\");\n const [selectedRange, setSelectedRange] = useState(value);\n\n const startDate = selectedRange.from ? dayjs(selectedRange.from).format(dateFormat) : '';\n const endDate = selectedRange.to ? dayjs(selectedRange.to).format(dateFormat) : '';\n\n // 1st click will select the start date.\n // 2nd click will select the end date.\n // 3rd click will select the start date again.\n const handleSelect = (range: DateRange, selectedDay: Date) => {\n const from = selectedRange?.from || range?.from;\n let newRange: DateRange;\n if (currentRangeField === \"to\") {\n if (dayjs(selectedDay).isSame(dayjs(from), 'day')) {\n // If same date is clicked twice, set end date to the same date for UI\n newRange = {\n from,\n to: selectedDay\n };\n } else if (dayjs(selectedDay).isAfter(dayjs(from))) {\n // If different date is selected and it's after start date\n newRange = { from, to: selectedDay };\n } else {\n // If selected date is before start date, reset and select start day\n newRange = { from: selectedDay };\n }\n setCurrentRangeField(\"from\");\n } else {\n // Reset the range and select start day\n newRange = { from: selectedDay };\n setCurrentRangeField(\"to\");\n }\n setSelectedRange(newRange);\n // Return the range with +1 day for the end date in the callback\n const callbackRange = {\n from: newRange.from,\n to: newRange.to ? dayjs(newRange.to).add(1, 'day').toDate() : undefined\n };\n onSelect(callbackRange);\n };\n\n function onOpenChange(open?: boolean) {\n setShowCalendar(Boolean(open));\n }\n\n const defaultTrigger = (\n <Flex gap={\"medium\"} className={pickerGroupClassName}>\n <TextField\n value={startDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...(textFieldsProps.startDate ?? {})}\n placeholder={placeholders?.startDate || \"Select start date\"}\n />\n <TextField\n value={endDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...(textFieldsProps.endDate ?? {})}\n placeholder={placeholders?.endDate || \"Select end date\"}\n />\n </Flex>\n );\n\n const trigger = typeof children === 'function'\n ? children({ startDate, endDate })\n : children || defaultTrigger;\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger asChild>\n {trigger}\n </Popover.Trigger>\n <Popover.Content side={side} className={styles.calendarPopover}>\n <Calendar\n showOutsideDays={false}\n numberOfMonths={2}\n defaultMonth={selectedRange.from}\n required={true}\n {...calendarProps}\n mode=\"range\"\n selected={selectedRange}\n onSelect={handleSelect}\n />\n {footer && (\n <Flex align=\"center\" justify=\"center\" className={styles.calendarFooter}>\n {footer}\n </Flex>\n )}\n </Popover.Content>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AC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAEI,uBAAM,CAAC,cAAc,EACnE,QAAA,EAAA,MAAM,GACF,CACR,CAAA,EAAA,CACe,CACV,EAAA,CAAA,EACV;AACJ;;;;"}
|
|
@@ -3,7 +3,10 @@ import { TextfieldProps } from "../textfield/textfield";
|
|
|
3
3
|
interface RangePickerProps {
|
|
4
4
|
side?: "top" | "right" | "bottom" | "left";
|
|
5
5
|
dateFormat?: string;
|
|
6
|
-
|
|
6
|
+
textFieldsProps?: {
|
|
7
|
+
startDate?: TextfieldProps;
|
|
8
|
+
endDate?: TextfieldProps;
|
|
9
|
+
};
|
|
7
10
|
placeholders?: {
|
|
8
11
|
startDate?: string;
|
|
9
12
|
endDate?: string;
|
|
@@ -19,6 +22,6 @@ interface RangePickerProps {
|
|
|
19
22
|
showCalendarIcon?: boolean;
|
|
20
23
|
footer?: React.ReactNode;
|
|
21
24
|
}
|
|
22
|
-
export declare function RangePicker({ side, dateFormat,
|
|
25
|
+
export declare function RangePicker({ side, dateFormat, textFieldsProps, placeholders, calendarProps, onSelect, value, pickerGroupClassName, children, showCalendarIcon, footer, }: RangePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
23
26
|
export {};
|
|
24
27
|
//# sourceMappingURL=range-picker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-picker.d.ts","sourceRoot":"","sources":["../../../../v1/components/calendar/range-picker.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAK5E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAIxD,UAAU,gBAAgB;IACxB,IAAI,CAAC,EAAE,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,cAAc,CAAC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"}
|
|
@@ -8,7 +8,7 @@ import { TextField } from '../textfield/textfield.js';
|
|
|
8
8
|
import { Calendar } from './calendar.js';
|
|
9
9
|
import styles from './calendar.module.css.js';
|
|
10
10
|
|
|
11
|
-
function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY",
|
|
11
|
+
function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldsProps = {}, placeholders, calendarProps, onSelect = () => { }, value = {
|
|
12
12
|
to: new Date(),
|
|
13
13
|
from: new Date(),
|
|
14
14
|
}, pickerGroupClassName, children, showCalendarIcon = true, footer, }) {
|
|
@@ -57,7 +57,7 @@ function RangePicker({ side = "top", dateFormat = "DD/MM/YYYY", textFieldProps,
|
|
|
57
57
|
function onOpenChange(open) {
|
|
58
58
|
setShowCalendar(Boolean(open));
|
|
59
59
|
}
|
|
60
|
-
const defaultTrigger = (jsxRuntimeExports.jsxs(Flex, { gap: "medium", className: pickerGroupClassName, children: [jsxRuntimeExports.jsx(TextField, { value: startDate, trailing: showCalendarIcon ? jsxRuntimeExports.jsx(CalendarIcon, {}) : undefined, className: styles.datePickerInput, readOnly: true, ...
|
|
60
|
+
const defaultTrigger = (jsxRuntimeExports.jsxs(Flex, { gap: "medium", className: pickerGroupClassName, children: [jsxRuntimeExports.jsx(TextField, { value: startDate, trailing: showCalendarIcon ? jsxRuntimeExports.jsx(CalendarIcon, {}) : undefined, className: styles.datePickerInput, readOnly: true, ...(textFieldsProps.startDate ?? {}), placeholder: placeholders?.startDate || "Select start date" }), jsxRuntimeExports.jsx(TextField, { value: endDate, trailing: showCalendarIcon ? jsxRuntimeExports.jsx(CalendarIcon, {}) : undefined, className: styles.datePickerInput, readOnly: true, ...(textFieldsProps.endDate ?? {}), placeholder: placeholders?.endDate || "Select end date" })] }));
|
|
61
61
|
const trigger = typeof children === 'function'
|
|
62
62
|
? children({ startDate, endDate })
|
|
63
63
|
: children || defaultTrigger;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"range-picker.js","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n
|
|
1
|
+
{"version":3,"file":"range-picker.js","sources":["../../../../v1/components/calendar/range-picker.tsx"],"sourcesContent":["import { CalendarIcon } from \"@radix-ui/react-icons\";\nimport dayjs from \"dayjs\";\nimport { useState } from \"react\";\nimport { DateRange, PropsBase, PropsRangeRequired } from \"react-day-picker\";\n\nimport { Flex } from \"../flex\";\nimport { Popover } from \"../popover\";\nimport { TextField } from \"../textfield\";\nimport { TextfieldProps } from \"../textfield/textfield\";\nimport { Calendar } from \"./calendar\";\nimport styles from \"./calendar.module.css\";\n\ninterface RangePickerProps {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\";\n dateFormat?: string;\n textFieldsProps?: { startDate?: TextfieldProps, endDate?: TextfieldProps };\n placeholders?: { startDate?: string; endDate?: string };\n calendarProps?: PropsRangeRequired & PropsBase;\n onSelect?: (date: DateRange) => void;\n pickerGroupClassName?: string;\n value?: DateRange;\n children?: React.ReactNode | ((props: { startDate: string; endDate: string }) => React.ReactNode);\n showCalendarIcon?: boolean;\n footer?: React.ReactNode;\n}\n\ntype RangeFields = keyof DateRange;\n\nexport function RangePicker({\n side = \"top\",\n dateFormat = \"DD/MM/YYYY\",\n textFieldsProps = {},\n placeholders,\n calendarProps,\n onSelect = () => {},\n value = {\n to: new Date(),\n from: new Date(),\n },\n pickerGroupClassName,\n children,\n showCalendarIcon = true,\n footer,\n}: RangePickerProps) {\n const [showCalendar, setShowCalendar] = useState(false);\n const [currentRangeField, setCurrentRangeField] = useState<RangeFields>(\"from\");\n const [selectedRange, setSelectedRange] = useState(value);\n\n const startDate = selectedRange.from ? dayjs(selectedRange.from).format(dateFormat) : '';\n const endDate = selectedRange.to ? dayjs(selectedRange.to).format(dateFormat) : '';\n\n // 1st click will select the start date.\n // 2nd click will select the end date.\n // 3rd click will select the start date again.\n const handleSelect = (range: DateRange, selectedDay: Date) => {\n const from = selectedRange?.from || range?.from;\n let newRange: DateRange;\n if (currentRangeField === \"to\") {\n if (dayjs(selectedDay).isSame(dayjs(from), 'day')) {\n // If same date is clicked twice, set end date to the same date for UI\n newRange = {\n from,\n to: selectedDay\n };\n } else if (dayjs(selectedDay).isAfter(dayjs(from))) {\n // If different date is selected and it's after start date\n newRange = { from, to: selectedDay };\n } else {\n // If selected date is before start date, reset and select start day\n newRange = { from: selectedDay };\n }\n setCurrentRangeField(\"from\");\n } else {\n // Reset the range and select start day\n newRange = { from: selectedDay };\n setCurrentRangeField(\"to\");\n }\n setSelectedRange(newRange);\n // Return the range with +1 day for the end date in the callback\n const callbackRange = {\n from: newRange.from,\n to: newRange.to ? dayjs(newRange.to).add(1, 'day').toDate() : undefined\n };\n onSelect(callbackRange);\n };\n\n function onOpenChange(open?: boolean) {\n setShowCalendar(Boolean(open));\n }\n\n const defaultTrigger = (\n <Flex gap={\"medium\"} className={pickerGroupClassName}>\n <TextField\n value={startDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...(textFieldsProps.startDate ?? {})}\n placeholder={placeholders?.startDate || \"Select start date\"}\n />\n <TextField\n value={endDate}\n trailing={showCalendarIcon ? <CalendarIcon /> : undefined}\n className={styles.datePickerInput}\n readOnly\n {...(textFieldsProps.endDate ?? {})}\n placeholder={placeholders?.endDate || \"Select end date\"}\n />\n </Flex>\n );\n\n const trigger = typeof children === 'function'\n ? children({ startDate, endDate })\n : children || defaultTrigger;\n\n return (\n <Popover open={showCalendar} onOpenChange={onOpenChange}>\n <Popover.Trigger asChild>\n {trigger}\n </Popover.Trigger>\n <Popover.Content side={side} className={styles.calendarPopover}>\n <Calendar\n showOutsideDays={false}\n numberOfMonths={2}\n defaultMonth={selectedRange.from}\n required={true}\n {...calendarProps}\n mode=\"range\"\n selected={selectedRange}\n onSelect={handleSelect}\n />\n {footer && (\n <Flex align=\"center\" justify=\"center\" className={styles.calendarFooter}>\n {footer}\n </Flex>\n )}\n </Popover.Content>\n </Popover>\n );\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;;;;;;AA4BgB,SAAA,WAAW,CAAC,EAC1B,IAAI,GAAG,KAAK,EACZ,UAAU,GAAG,YAAY,EACzB,eAAe,GAAG,EAAE,EACpB,YAAY,EACZ,aAAa,EACb,QAAQ,GAAG,MAAO,GAAC,EACnB,KAAK,GAAG;IACN,EAAE,EAAE,IAAI,IAAI,EAAE;IACd,IAAI,EAAE,IAAI,IAAI,EAAE;CACjB,EACD,oBAAoB,EACpB,QAAQ,EACR,gBAAgB,GAAG,IAAI,EACvB,MAAM,GACW,EAAA;IACjB,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACxD,MAAM,CAAC,iBAAiB,EAAE,oBAAoB,CAAC,GAAG,QAAQ,CAAc,MAAM,CAAC,CAAC;IAChF,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE1D,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;IACzF,MAAM,OAAO,GAAG,aAAa,CAAC,EAAE,GAAG,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC;;;;AAKnF,IAAA,MAAM,YAAY,GAA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ACtB,cAAc,EAAE,CAAC,EACjB,YAAY,EAAE,aAAa,CAAC,IAAI,EAChC,QAAQ,EAAE,IAAI,EAAA,GACV,aAAa,EACjB,IAAI,EAAC,OAAO,EACZ,QAAQ,EAAE,aAAa,EACvB,QAAQ,EAAE,YAAY,EACtB,CAAA,EACD,MAAM,KACLA,qBAAC,CAAA,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EAAC,SAAS,EAAE,MAAM,CAAC,cAAc,EACnE,QAAA,EAAA,MAAM,GACF,CACR,CAAA,EAAA,CACe,CACV,EAAA,CAAA,EACV;AACJ;;;;"}
|
|
@@ -34,20 +34,24 @@ const trigger = index$1.cva(select_module.default.trigger, {
|
|
|
34
34
|
medium: select_module.default["trigger-medium"],
|
|
35
35
|
},
|
|
36
36
|
variant: {
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
outline: select_module.default["trigger-outline"],
|
|
38
|
+
text: select_module.default["trigger-text"],
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
defaultVariants: {
|
|
42
42
|
size: "medium",
|
|
43
|
-
variant: "
|
|
43
|
+
variant: "outline",
|
|
44
44
|
},
|
|
45
45
|
});
|
|
46
|
-
const SelectTrigger = React__namespace.forwardRef(({ size, variant, className, children, iconProps = {}, 'aria-label': ariaLabel, style, stopPropagation = false, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs(index.Trigger, { ref: ref, className: trigger({ size, variant, className }), "aria-label": ariaLabel || 'Select option', role: "combobox", style:
|
|
46
|
+
const SelectTrigger = React__namespace.forwardRef(({ size, variant, className, children, iconProps = {}, 'aria-label': ariaLabel, style, stopPropagation = false, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs(index.Trigger, { ref: ref, className: trigger({ size, variant, className }), "aria-label": ariaLabel || 'Select option', role: "combobox", style: {
|
|
47
|
+
...style,
|
|
48
|
+
display: 'flex',
|
|
49
|
+
justifyContent: 'space-between'
|
|
50
|
+
}, onPointerDown: (e) => {
|
|
47
51
|
if (stopPropagation) {
|
|
48
52
|
e.stopPropagation();
|
|
49
53
|
}
|
|
50
|
-
}, ...props, children: [
|
|
54
|
+
}, ...props, children: [jsxRuntime.jsxRuntimeExports.jsx("div", { className: select_module.default.triggerContent, children: children }), jsxRuntime.jsxRuntimeExports.jsx(index.Icon, { asChild: true, children: jsxRuntime.jsxRuntimeExports.jsx(reactIcons_esm.ChevronDownIcon, { className: select_module.default.triggerIcon, "aria-hidden": "true", ...iconProps }) })] })));
|
|
51
55
|
SelectTrigger.displayName = index.Trigger.displayName;
|
|
52
56
|
const content = index$1.cva(select_module.default.content);
|
|
53
57
|
const SelectContent = React__namespace.forwardRef(({ className, children, position = "popper", ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx(index.Portal, { children: jsxRuntime.jsxRuntimeExports.jsx(index.Content, { ref: ref, className: content({ className }), position: position, role: "listbox", onPointerDownOutside: (e) => {
|
|
@@ -55,14 +59,27 @@ const SelectContent = React__namespace.forwardRef(({ className, children, positi
|
|
|
55
59
|
}, ...props, children: children }) })));
|
|
56
60
|
SelectContent.displayName = index.Content.displayName;
|
|
57
61
|
const menuitem = index$1.cva(select_module.default.menuitem);
|
|
58
|
-
const
|
|
62
|
+
const SelectIconContext = React__namespace.createContext({
|
|
63
|
+
icons: {},
|
|
64
|
+
registerIcon: () => { }
|
|
65
|
+
});
|
|
66
|
+
const SelectRoot = ({ children, disabled, ...props }) => {
|
|
67
|
+
const [icons, setIcons] = React__namespace.useState({});
|
|
68
|
+
const registerIcon = React__namespace.useCallback((value, icon) => {
|
|
69
|
+
setIcons(prev => ({ ...prev, [value]: icon }));
|
|
70
|
+
}, []);
|
|
71
|
+
return (jsxRuntime.jsxRuntimeExports.jsx(SelectIconContext.Provider, { value: { icons, registerIcon }, children: jsxRuntime.jsxRuntimeExports.jsx(index.Root, { disabled: disabled, ...props, children: children }) }));
|
|
72
|
+
};
|
|
73
|
+
const SelectItem = React__namespace.forwardRef(({ className, textProps = {}, children, leadingIcon, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs(index.Item, { ref: ref, className: menuitem({ className }), role: "option", ...props, children: [leadingIcon && jsxRuntime.jsxRuntimeExports.jsx("div", { className: select_module.default.itemIcon, children: leadingIcon }), jsxRuntime.jsxRuntimeExports.jsx(index.ItemText, { children: jsxRuntime.jsxRuntimeExports.jsx(text.Text, { ...textProps, children: children }) })] })));
|
|
59
74
|
SelectItem.displayName = index.Item.displayName;
|
|
60
75
|
const separator = index$1.cva(select_module.default.separator);
|
|
61
76
|
const SelectSeparator = React__namespace.forwardRef(({ className, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx(index.Separator, { ref: ref, className: separator({ className }), ...props })));
|
|
62
77
|
SelectSeparator.displayName = index.Separator.displayName;
|
|
63
|
-
const
|
|
78
|
+
const SelectValue = React__namespace.forwardRef(({ leadingIcon, children, placeholder, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx(index.Value, { ref: ref, placeholder: placeholder, ...props, children: jsxRuntime.jsxRuntimeExports.jsxs("div", { className: select_module.default.valueContent, title: typeof children === 'string' ? children : undefined, children: [leadingIcon && jsxRuntime.jsxRuntimeExports.jsx("div", { className: select_module.default.leadingIcon, children: leadingIcon }), children] }) })));
|
|
79
|
+
SelectValue.displayName = index.Value.displayName;
|
|
80
|
+
const Select = Object.assign(SelectRoot, {
|
|
64
81
|
Group: index.Group,
|
|
65
|
-
Value:
|
|
82
|
+
Value: SelectValue,
|
|
66
83
|
ScrollUpButton: index.ScrollDownButton,
|
|
67
84
|
ScrollDownButton: index.ScrollDownButton,
|
|
68
85
|
Viewport: index.Viewport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.cjs","sources":["../../../../v1/components/select/select.tsx"],"sourcesContent":["import { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { Text } from \"../text\";\nimport { TextProps } from \"../text/text\";\nimport styles from \"./select.module.css\";\n\ninterface AriaProps {\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n 'aria-required'?: boolean;\n 'aria-invalid'?: boolean;\n}\n\ninterface TriggerStyleProps {\n style?: React.CSSProperties;\n className?: string;\n stopPropagation?: boolean;\n}\n\nexport interface IconProps extends React.SVGAttributes<SVGElement> {\n children?: never;\n color?: string;\n}\n\nconst trigger = cva(styles.trigger, {\n variants: {\n size: {\n small: styles[\"trigger-small\"],\n medium: styles[\"trigger-medium\"],\n },\n variant: {\n default: \"\",\n filter: styles[\"trigger-filter\"],\n }\n },\n defaultVariants: {\n size: \"medium\",\n variant: \"default\",\n },\n});\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &\n React.PropsWithChildren<VariantProps<typeof trigger>> & {\n iconProps?: IconProps;\n } &\n AriaProps &\n TriggerStyleProps\n>(({ \n size, \n variant, \n className, \n children, \n iconProps = {}, \n 'aria-label': ariaLabel,\n style,\n stopPropagation = false,\n ...props \n}, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={trigger({ size, variant, className })}\n aria-label={ariaLabel || 'Select option'}\n role=\"combobox\"\n style={style}\n onPointerDown={(e) => {\n if (stopPropagation) {\n e.stopPropagation();\n }\n }}\n {...props}\n >\n {children}\n {variant !== 'filter' && (\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon \n className={styles.triggerIcon} \n aria-hidden=\"true\"\n {...iconProps} \n />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst content = cva(styles.content);\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &\n React.PropsWithChildren<VariantProps<typeof content>>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={content({ className })}\n position={position}\n role=\"listbox\"\n onPointerDownOutside={(e) => {\n e.stopPropagation();\n }}\n {...props}\n >\n {children}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst menuitem = cva(styles.menuitem);\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n textProps?: TextProps;\n }\n>(({ className, textProps = {}, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={menuitem({ className })}\n role=\"option\"\n {...props}\n >\n <SelectPrimitive.ItemText>\n <Text {...textProps}>{children}</Text>\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst separator = cva(styles.separator);\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={separator({ className })}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport const Select = Object.assign(SelectPrimitive.Root, {\n Group: SelectPrimitive.Group,\n Value: SelectPrimitive.Value,\n ScrollUpButton: SelectPrimitive.ScrollDownButton,\n ScrollDownButton: SelectPrimitive.ScrollDownButton,\n Viewport: SelectPrimitive.Viewport,\n Trigger: SelectTrigger,\n Content: SelectContent,\n Item: SelectItem,\n Separator: SelectSeparator,\n});\n"],"names":["cva","styles","React","_jsxs","SelectPrimitive.Trigger","_jsx","SelectPrimitive.Icon","ChevronDownIcon","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Item","SelectPrimitive.ItemText","Text","SelectPrimitive.Separator","SelectPrimit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,IAAI,EAAC,QAAQ,KACT,KAAK,EAAA,QAAA,EAETL,gCAAC,CAAAM,cAAwB,EACvB,EAAA,QAAA,EAAAN,gCAAA,CAACO,SAAI,EAAK,EAAA,GAAA,SAAS,EAAG,QAAA,EAAA,QAAQ,EAAQ,CAAA,EAAA,CACb,EACN,CAAA,CACxB,CAAC,CAAC;AACH,UAAU,CAAC,WAAW,GAAGF,UAAoB,CAAC,WAAW,CAAC;AAE1D,MAAM,SAAS,GAAGV,WAAG,CAACC,qBAAM,CAAC,SAAS,CAAC,CAAC;AACxC,MAAM,eAAe,GAAGC,gBAAK,CAAC,UAAU,CAGtC,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,MAC7BG,gCAAA,CAACQ,eAAyB,EACxB,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,SAAS,CAAC,EAAE,SAAS,EAAE,CAAC,EAAA,GAC/B,KAAK,EACT,CAAA,CACH,CAAC,CAAC;AACH,eAAe,CAAC,WAAW,GAAGA,eAAyB,CAAC,WAAW,CAAC;AAEvD,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAACC,UAAoB,EAAE;IACxD,KAAK,EAAEC,WAAqB;IAC5B,KAAK,EAAEC,WAAqB;IAC5B,cAAc,EAAEC,sBAAgC;IAChD,gBAAgB,EAAEA,sBAAgC;IAClD,QAAQ,EAAEC,cAAwB;AAClC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,SAAS,EAAE,eAAe;AAC3B,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"select.cjs","sources":["../../../../v1/components/select/select.tsx"],"sourcesContent":["import { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { Text } from \"../text\";\nimport { TextProps } from \"../text/text\";\nimport styles from \"./select.module.css\";\n\ninterface AriaProps {\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n 'aria-required'?: boolean;\n 'aria-invalid'?: boolean;\n}\n\ninterface TriggerStyleProps {\n style?: React.CSSProperties;\n className?: string;\n stopPropagation?: boolean;\n}\n\nexport interface IconProps extends React.SVGAttributes<SVGElement> {\n children?: never;\n color?: string;\n}\n\ninterface SelectValueProps extends SelectPrimitive.SelectValueProps {\n leadingIcon?: React.ReactNode;\n placeholder?: string;\n}\n\nconst trigger = cva(styles.trigger, {\n variants: {\n size: {\n small: styles[\"trigger-small\"],\n medium: styles[\"trigger-medium\"],\n },\n variant: {\n outline: styles[\"trigger-outline\"],\n text: styles[\"trigger-text\"],\n }\n },\n defaultVariants: {\n size: \"medium\",\n variant: \"outline\",\n },\n});\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &\n React.PropsWithChildren<VariantProps<typeof trigger>> & {\n iconProps?: IconProps;\n } &\n AriaProps &\n TriggerStyleProps\n>(({ \n size, \n variant, \n className, \n children, \n iconProps = {}, \n 'aria-label': ariaLabel,\n style,\n stopPropagation = false,\n ...props \n}, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={trigger({ size, variant, className })}\n aria-label={ariaLabel || 'Select option'}\n role=\"combobox\"\n style={{\n ...style,\n display: 'flex',\n justifyContent: 'space-between'\n }}\n onPointerDown={(e) => {\n if (stopPropagation) {\n e.stopPropagation();\n }\n }}\n {...props}\n >\n <div className={styles.triggerContent}>\n {children}\n </div>\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon \n className={styles.triggerIcon} \n aria-hidden=\"true\"\n {...iconProps} \n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst content = cva(styles.content);\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &\n React.PropsWithChildren<VariantProps<typeof content>>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={content({ className })}\n position={position}\n role=\"listbox\"\n onPointerDownOutside={(e) => {\n e.stopPropagation();\n }}\n {...props}\n >\n {children}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst menuitem = cva(styles.menuitem);\n\nconst SelectIconContext = React.createContext<{\n icons: Record<string, React.ReactNode>;\n registerIcon: (value: string, icon: React.ReactNode) => void;\n}>({\n icons: {},\n registerIcon: () => {}\n});\n\ninterface SelectRootProps extends SelectPrimitive.SelectProps {\n disabled?: boolean;\n}\n\nconst SelectRoot = ({ children, disabled, ...props }: SelectRootProps) => {\n const [icons, setIcons] = React.useState<Record<string, React.ReactNode>>({});\n \n const registerIcon = React.useCallback((value: string, icon: React.ReactNode) => {\n setIcons(prev => ({ ...prev, [value]: icon }));\n }, []);\n \n return (\n <SelectIconContext.Provider value={{ icons, registerIcon }}>\n <SelectPrimitive.Root disabled={disabled} {...props}>\n {children}\n </SelectPrimitive.Root>\n </SelectIconContext.Provider>\n );\n};\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n textProps?: TextProps;\n leadingIcon?: React.ReactNode;\n }\n>(({ className, textProps = {}, children, leadingIcon, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={menuitem({ className })}\n role=\"option\"\n {...props}\n >\n {leadingIcon && <div className={styles.itemIcon}>{leadingIcon}</div>}\n <SelectPrimitive.ItemText>\n <Text {...textProps}>{children}</Text>\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst separator = cva(styles.separator);\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={separator({ className })}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nconst SelectValue = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Value>,\n SelectValueProps\n>(({ leadingIcon, children, placeholder, ...props }, ref) => (\n <SelectPrimitive.Value \n ref={ref} \n placeholder={placeholder}\n {...props}\n >\n <div \n className={styles.valueContent}\n title={typeof children === 'string' ? children : undefined}\n >\n {leadingIcon && <div className={styles.leadingIcon}>{leadingIcon}</div>}\n {children}\n </div>\n </SelectPrimitive.Value>\n));\nSelectValue.displayName = SelectPrimitive.Value.displayName;\n\nexport const Select = Object.assign(SelectRoot, {\n Group: SelectPrimitive.Group,\n Value: SelectValue,\n ScrollUpButton: SelectPrimitive.ScrollDownButton,\n ScrollDownButton: SelectPrimitive.ScrollDownButton,\n Viewport: SelectPrimitive.Viewport,\n Trigger: SelectTrigger,\n Content: SelectContent,\n Item: SelectItem,\n Separator: SelectSeparator,\n});\n"],"names":["cva","styles","React","_jsxs","SelectPrimitive.Trigger","_jsx","SelectPrimitive.Icon","ChevronDownIcon","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Root","SelectPrimitive.Item","SelectPrimitive.ItemText","Text","SelectPrimitive.Separator","SelectPrimitive.Value","SelectPrimitive.Group","SelectPrimitive.ScrollDownButton","SelectPrimitive.Viewport"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAM,OAAO,GAAGA,WAAG,CAACC,qBAAM,CAAC,OAAO,EAAE;AAClC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAEA,qBAAM,CAAC,eAAe,CAAC;AAC9B,YAAA,MAAM,EAAEA,qBAA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GAttributes<SVGElement> {
|
|
|
16
16
|
children?: never;
|
|
17
17
|
color?: string;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
interface SelectValueProps extends SelectPrimitive.SelectValueProps {
|
|
20
|
+
leadingIcon?: React.ReactNode;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
}
|
|
23
|
+
interface SelectRootProps extends SelectPrimitive.SelectProps {
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare const Select: (({ children, disabled, ...props }: SelectRootProps) => import("react/jsx-runtime").JSX.Element) & {
|
|
20
27
|
Group: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
21
|
-
Value: React.ForwardRefExoticComponent<
|
|
28
|
+
Value: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
22
29
|
ScrollUpButton: React.ForwardRefExoticComponent<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
23
30
|
ScrollDownButton: React.ForwardRefExoticComponent<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
31
|
Viewport: React.ForwardRefExoticComponent<SelectPrimitive.SelectViewportProps & React.RefAttributes<HTMLDivElement>>;
|
|
25
32
|
Trigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
|
|
26
33
|
size?: "small" | "medium" | null | undefined;
|
|
27
|
-
variant?: "
|
|
34
|
+
variant?: "text" | "outline" | null | undefined;
|
|
28
35
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & {
|
|
29
36
|
children?: React.ReactNode;
|
|
30
37
|
} & {
|
|
@@ -35,6 +42,7 @@ export declare const Select: React.FC<SelectPrimitive.SelectProps> & {
|
|
|
35
42
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
36
43
|
Item: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
|
|
37
44
|
textProps?: any;
|
|
45
|
+
leadingIcon?: React.ReactNode;
|
|
38
46
|
} & React.RefAttributes<HTMLDivElement>>;
|
|
39
47
|
Separator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
40
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../v1/components/select/select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,SAAS;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IAChE,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"select.d.ts","sourceRoot":"","sources":["../../../../v1/components/select/select.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,UAAU,SAAS;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,UAAU,iBAAiB;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,SAAU,SAAQ,KAAK,CAAC,aAAa,CAAC,UAAU,CAAC;IAChE,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,gBAAiB,SAAQ,eAAe,CAAC,gBAAgB;IACjE,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAuGD,UAAU,eAAgB,SAAQ,eAAe,CAAC,WAAW;IAC3D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAwED,eAAO,MAAM,MAAM,sCAtEmC,eAAe;;;;;;;;;;;;;;;;;;;sBAoBnD,MAAM,SAAS;;;CA4D/B,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
|
|
2
2
|
import { ChevronDownIcon } from '../../node_modules/.pnpm/@radix-ui_react-icons@1.3.0_react@18.2.0/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js';
|
|
3
|
-
import { Trigger, Icon, Portal, Content as Content2, Item, ItemText, Separator,
|
|
3
|
+
import { Trigger, Icon, Portal, Content as Content2, Item, ItemText, Separator, Value, Group, ScrollDownButton, Viewport, Root as Root2 } from '../../node_modules/.pnpm/@radix-ui_react-select@2.1.1_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-select/dist/index.js';
|
|
4
4
|
import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
|
|
5
5
|
import * as React from 'react';
|
|
6
6
|
import { Text } from '../text/text.js';
|
|
@@ -13,20 +13,24 @@ const trigger = cva(styles.trigger, {
|
|
|
13
13
|
medium: styles["trigger-medium"],
|
|
14
14
|
},
|
|
15
15
|
variant: {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
outline: styles["trigger-outline"],
|
|
17
|
+
text: styles["trigger-text"],
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
defaultVariants: {
|
|
21
21
|
size: "medium",
|
|
22
|
-
variant: "
|
|
22
|
+
variant: "outline",
|
|
23
23
|
},
|
|
24
24
|
});
|
|
25
|
-
const SelectTrigger = React.forwardRef(({ size, variant, className, children, iconProps = {}, 'aria-label': ariaLabel, style, stopPropagation = false, ...props }, ref) => (jsxRuntimeExports.jsxs(Trigger, { ref: ref, className: trigger({ size, variant, className }), "aria-label": ariaLabel || 'Select option', role: "combobox", style:
|
|
25
|
+
const SelectTrigger = React.forwardRef(({ size, variant, className, children, iconProps = {}, 'aria-label': ariaLabel, style, stopPropagation = false, ...props }, ref) => (jsxRuntimeExports.jsxs(Trigger, { ref: ref, className: trigger({ size, variant, className }), "aria-label": ariaLabel || 'Select option', role: "combobox", style: {
|
|
26
|
+
...style,
|
|
27
|
+
display: 'flex',
|
|
28
|
+
justifyContent: 'space-between'
|
|
29
|
+
}, onPointerDown: (e) => {
|
|
26
30
|
if (stopPropagation) {
|
|
27
31
|
e.stopPropagation();
|
|
28
32
|
}
|
|
29
|
-
}, ...props, children: [
|
|
33
|
+
}, ...props, children: [jsxRuntimeExports.jsx("div", { className: styles.triggerContent, children: children }), jsxRuntimeExports.jsx(Icon, { asChild: true, children: jsxRuntimeExports.jsx(ChevronDownIcon, { className: styles.triggerIcon, "aria-hidden": "true", ...iconProps }) })] })));
|
|
30
34
|
SelectTrigger.displayName = Trigger.displayName;
|
|
31
35
|
const content = cva(styles.content);
|
|
32
36
|
const SelectContent = React.forwardRef(({ className, children, position = "popper", ...props }, ref) => (jsxRuntimeExports.jsx(Portal, { children: jsxRuntimeExports.jsx(Content2, { ref: ref, className: content({ className }), position: position, role: "listbox", onPointerDownOutside: (e) => {
|
|
@@ -34,14 +38,27 @@ const SelectContent = React.forwardRef(({ className, children, position = "poppe
|
|
|
34
38
|
}, ...props, children: children }) })));
|
|
35
39
|
SelectContent.displayName = Content2.displayName;
|
|
36
40
|
const menuitem = cva(styles.menuitem);
|
|
37
|
-
const
|
|
41
|
+
const SelectIconContext = React.createContext({
|
|
42
|
+
icons: {},
|
|
43
|
+
registerIcon: () => { }
|
|
44
|
+
});
|
|
45
|
+
const SelectRoot = ({ children, disabled, ...props }) => {
|
|
46
|
+
const [icons, setIcons] = React.useState({});
|
|
47
|
+
const registerIcon = React.useCallback((value, icon) => {
|
|
48
|
+
setIcons(prev => ({ ...prev, [value]: icon }));
|
|
49
|
+
}, []);
|
|
50
|
+
return (jsxRuntimeExports.jsx(SelectIconContext.Provider, { value: { icons, registerIcon }, children: jsxRuntimeExports.jsx(Root2, { disabled: disabled, ...props, children: children }) }));
|
|
51
|
+
};
|
|
52
|
+
const SelectItem = React.forwardRef(({ className, textProps = {}, children, leadingIcon, ...props }, ref) => (jsxRuntimeExports.jsxs(Item, { ref: ref, className: menuitem({ className }), role: "option", ...props, children: [leadingIcon && jsxRuntimeExports.jsx("div", { className: styles.itemIcon, children: leadingIcon }), jsxRuntimeExports.jsx(ItemText, { children: jsxRuntimeExports.jsx(Text, { ...textProps, children: children }) })] })));
|
|
38
53
|
SelectItem.displayName = Item.displayName;
|
|
39
54
|
const separator = cva(styles.separator);
|
|
40
55
|
const SelectSeparator = React.forwardRef(({ className, ...props }, ref) => (jsxRuntimeExports.jsx(Separator, { ref: ref, className: separator({ className }), ...props })));
|
|
41
56
|
SelectSeparator.displayName = Separator.displayName;
|
|
42
|
-
const
|
|
57
|
+
const SelectValue = React.forwardRef(({ leadingIcon, children, placeholder, ...props }, ref) => (jsxRuntimeExports.jsx(Value, { ref: ref, placeholder: placeholder, ...props, children: jsxRuntimeExports.jsxs("div", { className: styles.valueContent, title: typeof children === 'string' ? children : undefined, children: [leadingIcon && jsxRuntimeExports.jsx("div", { className: styles.leadingIcon, children: leadingIcon }), children] }) })));
|
|
58
|
+
SelectValue.displayName = Value.displayName;
|
|
59
|
+
const Select = Object.assign(SelectRoot, {
|
|
43
60
|
Group: Group,
|
|
44
|
-
Value:
|
|
61
|
+
Value: SelectValue,
|
|
45
62
|
ScrollUpButton: ScrollDownButton,
|
|
46
63
|
ScrollDownButton: ScrollDownButton,
|
|
47
64
|
Viewport: Viewport,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sources":["../../../../v1/components/select/select.tsx"],"sourcesContent":["import { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { Text } from \"../text\";\nimport { TextProps } from \"../text/text\";\nimport styles from \"./select.module.css\";\n\ninterface AriaProps {\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n 'aria-required'?: boolean;\n 'aria-invalid'?: boolean;\n}\n\ninterface TriggerStyleProps {\n style?: React.CSSProperties;\n className?: string;\n stopPropagation?: boolean;\n}\n\nexport interface IconProps extends React.SVGAttributes<SVGElement> {\n children?: never;\n color?: string;\n}\n\nconst trigger = cva(styles.trigger, {\n variants: {\n size: {\n small: styles[\"trigger-small\"],\n medium: styles[\"trigger-medium\"],\n },\n variant: {\n default: \"\",\n filter: styles[\"trigger-filter\"],\n }\n },\n defaultVariants: {\n size: \"medium\",\n variant: \"default\",\n },\n});\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &\n React.PropsWithChildren<VariantProps<typeof trigger>> & {\n iconProps?: IconProps;\n } &\n AriaProps &\n TriggerStyleProps\n>(({ \n size, \n variant, \n className, \n children, \n iconProps = {}, \n 'aria-label': ariaLabel,\n style,\n stopPropagation = false,\n ...props \n}, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={trigger({ size, variant, className })}\n aria-label={ariaLabel || 'Select option'}\n role=\"combobox\"\n style={style}\n onPointerDown={(e) => {\n if (stopPropagation) {\n e.stopPropagation();\n }\n }}\n {...props}\n >\n {children}\n {variant !== 'filter' && (\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon \n className={styles.triggerIcon} \n aria-hidden=\"true\"\n {...iconProps} \n />\n </SelectPrimitive.Icon>\n )}\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst content = cva(styles.content);\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &\n React.PropsWithChildren<VariantProps<typeof content>>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={content({ className })}\n position={position}\n role=\"listbox\"\n onPointerDownOutside={(e) => {\n e.stopPropagation();\n }}\n {...props}\n >\n {children}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst menuitem = cva(styles.menuitem);\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n textProps?: TextProps;\n }\n>(({ className, textProps = {}, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={menuitem({ className })}\n role=\"option\"\n {...props}\n >\n <SelectPrimitive.ItemText>\n <Text {...textProps}>{children}</Text>\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst separator = cva(styles.separator);\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={separator({ className })}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nexport const Select = Object.assign(SelectPrimitive.Root, {\n Group: SelectPrimitive.Group,\n Value: SelectPrimitive.Value,\n ScrollUpButton: SelectPrimitive.ScrollDownButton,\n ScrollDownButton: SelectPrimitive.ScrollDownButton,\n Viewport: SelectPrimitive.Viewport,\n Trigger: SelectTrigger,\n Content: SelectContent,\n Item: SelectItem,\n Separator: SelectSeparator,\n});\n"],"names":["_jsxs","SelectPrimitive.Trigger","_jsx","SelectPrimitive.Icon","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Item","SelectPrimitive.ItemText","SelectPrimitive.Separator","SelectPrimitive.Root","SelectPrimitive.Group","SelectPrimitive.Value","SelectPrimitive.ScrollDownButton","SelectPrimitive.Viewport"],"mappings":";;;;;;;;AA2BA,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE;AAClC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC;AAC9B,YAAA,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC;AACjC,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,EAAE;AACX,YAAA,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC;AACjC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA,CAAC,CAAC;AAEH,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AAe,CAAC,WAAW,GAAGA,SAAyB,CAAC,WAAW,CAAC;AAEvD,MAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAACC,KAAoB,EAAE;IACxD,KAAK,EAAEC,KAAqB;IAC5B,KAAK,EAAEC,KAAqB;IAC5B,cAAc,EAAEC,gBAAgC;IAChD,gBAAgB,EAAEA,gBAAgC;IAClD,QAAQ,EAAEC,QAAwB;AAClC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,SAAS,EAAE,eAAe;AAC3B,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"select.js","sources":["../../../../v1/components/select/select.tsx"],"sourcesContent":["import { ChevronDownIcon } from \"@radix-ui/react-icons\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { cva, VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { Text } from \"../text\";\nimport { TextProps } from \"../text/text\";\nimport styles from \"./select.module.css\";\n\ninterface AriaProps {\n 'aria-label'?: string;\n 'aria-describedby'?: string;\n 'aria-required'?: boolean;\n 'aria-invalid'?: boolean;\n}\n\ninterface TriggerStyleProps {\n style?: React.CSSProperties;\n className?: string;\n stopPropagation?: boolean;\n}\n\nexport interface IconProps extends React.SVGAttributes<SVGElement> {\n children?: never;\n color?: string;\n}\n\ninterface SelectValueProps extends SelectPrimitive.SelectValueProps {\n leadingIcon?: React.ReactNode;\n placeholder?: string;\n}\n\nconst trigger = cva(styles.trigger, {\n variants: {\n size: {\n small: styles[\"trigger-small\"],\n medium: styles[\"trigger-medium\"],\n },\n variant: {\n outline: styles[\"trigger-outline\"],\n text: styles[\"trigger-text\"],\n }\n },\n defaultVariants: {\n size: \"medium\",\n variant: \"outline\",\n },\n});\n\nconst SelectTrigger = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger> &\n React.PropsWithChildren<VariantProps<typeof trigger>> & {\n iconProps?: IconProps;\n } &\n AriaProps &\n TriggerStyleProps\n>(({ \n size, \n variant, \n className, \n children, \n iconProps = {}, \n 'aria-label': ariaLabel,\n style,\n stopPropagation = false,\n ...props \n}, ref) => (\n <SelectPrimitive.Trigger\n ref={ref}\n className={trigger({ size, variant, className })}\n aria-label={ariaLabel || 'Select option'}\n role=\"combobox\"\n style={{\n ...style,\n display: 'flex',\n justifyContent: 'space-between'\n }}\n onPointerDown={(e) => {\n if (stopPropagation) {\n e.stopPropagation();\n }\n }}\n {...props}\n >\n <div className={styles.triggerContent}>\n {children}\n </div>\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon \n className={styles.triggerIcon} \n aria-hidden=\"true\"\n {...iconProps} \n />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nconst content = cva(styles.content);\n\nconst SelectContent = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> &\n React.PropsWithChildren<VariantProps<typeof content>>\n>(({ className, children, position = \"popper\", ...props }, ref) => (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n ref={ref}\n className={content({ className })}\n position={position}\n role=\"listbox\"\n onPointerDownOutside={(e) => {\n e.stopPropagation();\n }}\n {...props}\n >\n {children}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nconst menuitem = cva(styles.menuitem);\n\nconst SelectIconContext = React.createContext<{\n icons: Record<string, React.ReactNode>;\n registerIcon: (value: string, icon: React.ReactNode) => void;\n}>({\n icons: {},\n registerIcon: () => {}\n});\n\ninterface SelectRootProps extends SelectPrimitive.SelectProps {\n disabled?: boolean;\n}\n\nconst SelectRoot = ({ children, disabled, ...props }: SelectRootProps) => {\n const [icons, setIcons] = React.useState<Record<string, React.ReactNode>>({});\n \n const registerIcon = React.useCallback((value: string, icon: React.ReactNode) => {\n setIcons(prev => ({ ...prev, [value]: icon }));\n }, []);\n \n return (\n <SelectIconContext.Provider value={{ icons, registerIcon }}>\n <SelectPrimitive.Root disabled={disabled} {...props}>\n {children}\n </SelectPrimitive.Root>\n </SelectIconContext.Provider>\n );\n};\n\nconst SelectItem = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item> & {\n textProps?: TextProps;\n leadingIcon?: React.ReactNode;\n }\n>(({ className, textProps = {}, children, leadingIcon, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={menuitem({ className })}\n role=\"option\"\n {...props}\n >\n {leadingIcon && <div className={styles.itemIcon}>{leadingIcon}</div>}\n <SelectPrimitive.ItemText>\n <Text {...textProps}>{children}</Text>\n </SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n\nconst separator = cva(styles.separator);\nconst SelectSeparator = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator\n ref={ref}\n className={separator({ className })}\n {...props}\n />\n));\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName;\n\nconst SelectValue = React.forwardRef<\n React.ElementRef<typeof SelectPrimitive.Value>,\n SelectValueProps\n>(({ leadingIcon, children, placeholder, ...props }, ref) => (\n <SelectPrimitive.Value \n ref={ref} \n placeholder={placeholder}\n {...props}\n >\n <div \n className={styles.valueContent}\n title={typeof children === 'string' ? children : undefined}\n >\n {leadingIcon && <div className={styles.leadingIcon}>{leadingIcon}</div>}\n {children}\n </div>\n </SelectPrimitive.Value>\n));\nSelectValue.displayName = SelectPrimitive.Value.displayName;\n\nexport const Select = Object.assign(SelectRoot, {\n Group: SelectPrimitive.Group,\n Value: SelectValue,\n ScrollUpButton: SelectPrimitive.ScrollDownButton,\n ScrollDownButton: SelectPrimitive.ScrollDownButton,\n Viewport: SelectPrimitive.Viewport,\n Trigger: SelectTrigger,\n Content: SelectContent,\n Item: SelectItem,\n Separator: SelectSeparator,\n});\n"],"names":["_jsxs","SelectPrimitive.Trigger","_jsx","SelectPrimitive.Icon","SelectPrimitive.Portal","SelectPrimitive.Content","SelectPrimitive.Root","SelectPrimitive.Item","SelectPrimitive.ItemText","SelectPrimitive.Separator","SelectPrimitive.Value","SelectPrimitive.Group","SelectPrimitive.ScrollDownButton","SelectPrimitive.Viewport"],"mappings":";;;;;;;;AAgCA,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,OAAO,EAAE;AAClC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,MAAM,CAAC,eAAe,CAAC;AAC9B,YAAA,MAAM,EAAE,MAAM,CAAC,gBAAgB,CAAC;AACjC,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA,OAAO,EAAE,MAAM,CAAC,iBAAiB,CAAC;AAClC,YAAA,IAAI,EAAE,MAAM,CAAC,cAAc,CAAC;AAC7B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,OAAO,EAAE,SAAS;AACnB,KAAA;AACF,CAAA,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAQpC,CAAC,EACD,IAAI,EACJ,OAAO,EACP,SAAS,EACT,QAAQ,EACR,SAAS,GAAG,EAAE,EACd,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,eAAe,GAAG,KAAK,EACvB,GAAG,KAAK,EACT,EAAE,GAAG,MACJA,sBAAC,CAAAC,OAAuB,EAAA,EACtB,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,EACpC,YAAA,EAAA,SAAS,IAA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A,EAAA,WAAW,GAAO,EACtE,QAAQ,IACL,EACgB,CAAA,CACzB,CAAC,CAAC;AACH,WAAW,CAAC,WAAW,GAAGQ,KAAqB,CAAC,WAAW,CAAC;MAE/C,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE;IAC9C,KAAK,EAAEC,KAAqB;AAC5B,IAAA,KAAK,EAAE,WAAW;IAClB,cAAc,EAAEC,gBAAgC;IAChD,gBAAgB,EAAEA,gBAAgC;IAClD,QAAQ,EAAEC,QAAwB;AAClC,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,IAAI,EAAE,UAAU;AAChB,IAAA,SAAS,EAAE,eAAe;AAC3B,CAAA;;;;"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var styles = {"content":"select-module_content__wLQoN","menuitem":"select-module_menuitem__BTQat","separator":"select-module_separator__7YD2G","menugroup":"select-module_menugroup__h7nP9","trigger":"select-module_trigger__8XPsA","trigger-small":"select-module_trigger-small__krYBJ","trigger-medium":"select-module_trigger-medium__0vmIM","triggerIcon":"select-module_triggerIcon__cZGjN","
|
|
5
|
+
var styles = {"content":"select-module_content__wLQoN","menuitem":"select-module_menuitem__BTQat","separator":"select-module_separator__7YD2G","menugroup":"select-module_menugroup__h7nP9","trigger":"select-module_trigger__8XPsA","trigger-outline":"select-module_trigger-outline__FIv-z","trigger-text":"select-module_trigger-text__QHQ4b","trigger-small":"select-module_trigger-small__krYBJ","triggerContent":"select-module_triggerContent__P35Y0","trigger-medium":"select-module_trigger-medium__0vmIM","triggerIcon":"select-module_triggerIcon__cZGjN","valueContent":"select-module_valueContent__KFsoy","itemIcon":"select-module_itemIcon__Nnej1","placeholder":"select-module_placeholder__Lepbs","leadingIcon":"select-module_leadingIcon__PTDA9","trigger___outline":"select-module_trigger-outline__FIv-z","trigger___text":"select-module_trigger-text__QHQ4b","trigger___small":"select-module_trigger-small__krYBJ","trigger___medium":"select-module_trigger-medium__0vmIM"};
|
|
6
6
|
|
|
7
7
|
exports.default = styles;
|
|
8
8
|
//# sourceMappingURL=select.module.css.cjs.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var styles = {"content":"select-module_content__wLQoN","menuitem":"select-module_menuitem__BTQat","separator":"select-module_separator__7YD2G","menugroup":"select-module_menugroup__h7nP9","trigger":"select-module_trigger__8XPsA","trigger-small":"select-module_trigger-small__krYBJ","trigger-medium":"select-module_trigger-medium__0vmIM","triggerIcon":"select-module_triggerIcon__cZGjN","
|
|
1
|
+
var styles = {"content":"select-module_content__wLQoN","menuitem":"select-module_menuitem__BTQat","separator":"select-module_separator__7YD2G","menugroup":"select-module_menugroup__h7nP9","trigger":"select-module_trigger__8XPsA","trigger-outline":"select-module_trigger-outline__FIv-z","trigger-text":"select-module_trigger-text__QHQ4b","trigger-small":"select-module_trigger-small__krYBJ","triggerContent":"select-module_triggerContent__P35Y0","trigger-medium":"select-module_trigger-medium__0vmIM","triggerIcon":"select-module_triggerIcon__cZGjN","valueContent":"select-module_valueContent__KFsoy","itemIcon":"select-module_itemIcon__Nnej1","placeholder":"select-module_placeholder__Lepbs","leadingIcon":"select-module_leadingIcon__PTDA9","trigger___outline":"select-module_trigger-outline__FIv-z","trigger___text":"select-module_trigger-text__QHQ4b","trigger___small":"select-module_trigger-small__krYBJ","trigger___medium":"select-module_trigger-medium__0vmIM"};
|
|
2
2
|
|
|
3
3
|
export { styles as default };
|
|
4
4
|
//# sourceMappingURL=select.module.css.js.map
|
|
@@ -2,22 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var ReactDOM = require('react-dom');
|
|
5
|
-
var index$
|
|
5
|
+
var index$h = require('../../../../../@radix-ui_number@1.1.0/node_modules/@radix-ui/number/dist/index.cjs');
|
|
6
6
|
var index$5 = require('../../../../../@radix-ui_primitive@1.1.0/node_modules/@radix-ui/primitive/dist/index.cjs');
|
|
7
7
|
var index = require('../../../../../@radix-ui_react-collection@1.1.0_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3_o7ts2nnlvhh77fzdn2oqk6h3ou/node_modules/@radix-ui/react-collection/dist/index.cjs');
|
|
8
8
|
var index$3 = require('../../../../../@radix-ui_react-compose-refs@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.cjs');
|
|
9
9
|
var index$1 = require('../../../../../@radix-ui_react-context@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.cjs');
|
|
10
|
-
var index$
|
|
10
|
+
var index$i = require('../../../../../@radix-ui_react-direction@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.cjs');
|
|
11
11
|
var index$b = require('../../../../../@radix-ui_react-dismissable-layer@1.1.0_@types_react-dom@18.0.11_@types_react@18.2.12_react-d_ssbz7ct4j4dovku4cnjdinfvbi/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs');
|
|
12
12
|
var index$8 = require('../../../../../@radix-ui_react-focus-guards@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-focus-guards/dist/index.cjs');
|
|
13
13
|
var index$a = require('../../../../../@radix-ui_react-focus-scope@1.1.0_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18._2iqg6di5glihcqy5icb35vajxy/node_modules/@radix-ui/react-focus-scope/dist/index.cjs');
|
|
14
14
|
var index$c = require('../../../../../@radix-ui_react-id@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.cjs');
|
|
15
15
|
var index$2 = require('../../../../../@radix-ui_react-popper@1.2.0_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-popper/dist/index.cjs');
|
|
16
|
-
var index$
|
|
16
|
+
var index$g = require('../../../../../@radix-ui_react-portal@1.1.1_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-portal/dist/index.cjs');
|
|
17
17
|
var index$4 = require('../../../../../@radix-ui_react-primitive@2.0.0_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3._3zmfwjcm3t5zu55yjfddt34hay/node_modules/@radix-ui/react-primitive/dist/index.cjs');
|
|
18
18
|
var index$9 = require('../../../../../@radix-ui_react-slot@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.cjs');
|
|
19
19
|
var index$f = require('../../../../../@radix-ui_react-use-callback-ref@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs');
|
|
20
|
-
var index$
|
|
20
|
+
var index$j = require('../../../../../@radix-ui_react-use-controllable-state@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs');
|
|
21
21
|
var index$6 = require('../../../../../@radix-ui_react-use-layout-effect@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs');
|
|
22
22
|
var index$d = require('../../../../../@radix-ui_react-use-previous@1.1.0_@types_react@18.2.12_react@18.2.0/node_modules/@radix-ui/react-use-previous/dist/index.cjs');
|
|
23
23
|
var index$e = require('../../../../../@radix-ui_react-visually-hidden@1.1.0_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom_d6t4kabnj7swqvo5hbk4mjb3nm/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs');
|
|
@@ -76,13 +76,13 @@ var Select = (props) => {
|
|
|
76
76
|
const [trigger, setTrigger] = React__namespace.useState(null);
|
|
77
77
|
const [valueNode, setValueNode] = React__namespace.useState(null);
|
|
78
78
|
const [valueNodeHasChildren, setValueNodeHasChildren] = React__namespace.useState(false);
|
|
79
|
-
const direction = index$
|
|
80
|
-
const [open = false, setOpen] = index$
|
|
79
|
+
const direction = index$i.useDirection(dir);
|
|
80
|
+
const [open = false, setOpen] = index$j.useControllableState({
|
|
81
81
|
prop: openProp,
|
|
82
82
|
defaultProp: defaultOpen,
|
|
83
83
|
onChange: onOpenChange
|
|
84
84
|
});
|
|
85
|
-
const [value, setValue] = index$
|
|
85
|
+
const [value, setValue] = index$j.useControllableState({
|
|
86
86
|
prop: valueProp,
|
|
87
87
|
defaultProp: defaultValue,
|
|
88
88
|
onChange: onValueChange
|
|
@@ -255,7 +255,7 @@ var SelectIcon = React__namespace.forwardRef(
|
|
|
255
255
|
SelectIcon.displayName = ICON_NAME;
|
|
256
256
|
var PORTAL_NAME = "SelectPortal";
|
|
257
257
|
var SelectPortal = (props) => {
|
|
258
|
-
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index$
|
|
258
|
+
return /* @__PURE__ */ jsxRuntime.jsxRuntimeExports.jsx(index$g.Portal, { asChild: true, ...props });
|
|
259
259
|
};
|
|
260
260
|
SelectPortal.displayName = PORTAL_NAME;
|
|
261
261
|
var CONTENT_NAME = "SelectContent";
|
|
@@ -538,7 +538,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
|
538
538
|
const minContentWidth = triggerRect.width + leftDelta;
|
|
539
539
|
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
540
540
|
const rightEdge = window.innerWidth - CONTENT_MARGIN;
|
|
541
|
-
const clampedLeft = index$
|
|
541
|
+
const clampedLeft = index$h.clamp(left, [CONTENT_MARGIN, rightEdge - contentWidth]);
|
|
542
542
|
contentWrapper.style.minWidth = minContentWidth + "px";
|
|
543
543
|
contentWrapper.style.left = clampedLeft + "px";
|
|
544
544
|
} else {
|
|
@@ -548,7 +548,7 @@ var SelectItemAlignedPosition = React__namespace.forwardRef((props, forwardedRef
|
|
|
548
548
|
const minContentWidth = triggerRect.width + rightDelta;
|
|
549
549
|
const contentWidth = Math.max(minContentWidth, contentRect.width);
|
|
550
550
|
const leftEdge = window.innerWidth - CONTENT_MARGIN;
|
|
551
|
-
const clampedRight = index$
|
|
551
|
+
const clampedRight = index$h.clamp(right, [CONTENT_MARGIN, leftEdge - contentWidth]);
|
|
552
552
|
contentWrapper.style.minWidth = minContentWidth + "px";
|
|
553
553
|
contentWrapper.style.right = clampedRight + "px";
|
|
554
554
|
}
|