@ensi-platform/admin-ui 0.8.5 → 0.10.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/{Component-ZIAMtMpP.js → Component-BMol_xnR.js} +2 -2
- package/dist/{Component-ZIAMtMpP.js.map → Component-BMol_xnR.js.map} +1 -1
- package/dist/{Component-BnSNDZFt.js → Component-BO5LvfoO.js} +2 -2
- package/dist/{Component-BnSNDZFt.js.map → Component-BO5LvfoO.js.map} +1 -1
- package/dist/{Component-C6mp0LOp.js → Component-BjITARbg.js} +3 -3
- package/dist/{Component-C6mp0LOp.js.map → Component-BjITARbg.js.map} +1 -1
- package/dist/{Component-CBWeJZfB.js → Component-C24OpTxW.js} +2 -2
- package/dist/{Component-CBWeJZfB.js.map → Component-C24OpTxW.js.map} +1 -1
- package/dist/{Component-qJGssCB4.js → Component-CD81ynoG.js} +5 -5
- package/dist/{Component-qJGssCB4.js.map → Component-CD81ynoG.js.map} +1 -1
- package/dist/{Component-CIxKpL6s.js → Component-Cxk1CLsH.js} +2 -2
- package/dist/{Component-CIxKpL6s.js.map → Component-Cxk1CLsH.js.map} +1 -1
- package/dist/{Component-uHkw3SDR.js → Component-CzwTENBM.js} +2 -2
- package/dist/{Component-uHkw3SDR.js.map → Component-CzwTENBM.js.map} +1 -1
- package/dist/{Component-D310jlAj.js → Component-D9cY4WmP.js} +2 -2
- package/dist/{Component-D310jlAj.js.map → Component-D9cY4WmP.js.map} +1 -1
- package/dist/{Component-BPN5FgKq.js → Component-DSAL6avh.js} +2 -2
- package/dist/{Component-BPN5FgKq.js.map → Component-DSAL6avh.js.map} +1 -1
- package/dist/{Component-DU3MeOen.js → Component-DcSDEfYC.js} +2 -2
- package/dist/{Component-DU3MeOen.js.map → Component-DcSDEfYC.js.map} +1 -1
- package/dist/{Component-BRHoDRtF.js → Component-DxkpQKZ9.js} +2 -2
- package/dist/{Component-BRHoDRtF.js.map → Component-DxkpQKZ9.js.map} +1 -1
- package/dist/{Component-B1piMJHv.js → Component-MSGhHMYk.js} +2 -2
- package/dist/{Component-B1piMJHv.js.map → Component-MSGhHMYk.js.map} +1 -1
- package/dist/{Component-B73be-FU.js → Component-c2va6Tzq.js} +2 -2
- package/dist/{Component-B73be-FU.js.map → Component-c2va6Tzq.js.map} +1 -1
- package/dist/Component-uzbYiLD9.js +58 -0
- package/dist/Component-uzbYiLD9.js.map +1 -0
- package/dist/action-popup/index.js +2 -2
- package/dist/arrangement-settings/index.js +3 -3
- package/dist/assets/Component10.css +1 -1
- package/dist/assets/Component11.css +1 -1
- package/dist/assets/Component12.css +1 -1
- package/dist/assets/Component13.css +1 -1
- package/dist/assets/Component14.css +1 -1
- package/dist/assets/Component15.css +1 -1
- package/dist/assets/Component3.css +1 -1
- package/dist/assets/Component4.css +1 -1
- package/dist/assets/Component5.css +1 -1
- package/dist/assets/Component6.css +1 -1
- package/dist/assets/Component7.css +1 -1
- package/dist/assets/Component8.css +1 -1
- package/dist/assets/Component9.css +1 -1
- package/dist/assets/index16.css +1 -1
- package/dist/assets/index17.css +1 -1
- package/dist/assets/index18.css +1 -1
- package/dist/assets/index19.css +1 -1
- package/dist/assets/index20.css +1 -1
- package/dist/assets/index22.css +1 -1
- package/dist/assets/index30.css +1 -1
- package/dist/assets/index4.css +1 -1
- package/dist/assets/index9.css +1 -1
- package/dist/assets/theme2.css +1 -0
- package/dist/autocomplete/index.js +2 -2
- package/dist/autocomplete-async/index.js +2 -2
- package/dist/button/index.js +1 -1
- package/dist/cascade-menu/index.js +2 -2
- package/dist/checkbox/index.js +2 -2
- package/dist/checkbox-group/index.js +1 -1
- package/dist/context-menu/index.js +1 -1
- package/dist/copy-button/index.js +1 -1
- package/dist/data-table/index.js +1 -1
- package/dist/date-picker/index.js +1 -1
- package/dist/date-range-picker/Component.d.ts.map +1 -1
- package/dist/date-range-picker/index.js +207 -179
- package/dist/date-range-picker/index.js.map +1 -1
- package/dist/date-range-picker/utils.d.ts +24 -0
- package/dist/date-range-picker/utils.d.ts.map +1 -0
- package/dist/drawer/index.js +1 -1
- package/dist/field/index.js +1 -1
- package/dist/grid-layout/index.js +1 -1
- package/dist/input/index.js +2 -2
- package/dist/menu-list/index.js +1 -1
- package/dist/modal/index.js +1 -1
- package/dist/multi-autocomplete/index.js +2 -2
- package/dist/multi-autocomplete-async/index.js +2 -2
- package/dist/multi-select/index.js +2 -2
- package/dist/number-input/index.js +2 -2
- package/dist/number-range/index.js +2 -2
- package/dist/select/index.js +2 -2
- package/dist/slider/Component.d.ts.map +1 -1
- package/dist/slider/index.js +110 -107
- package/dist/slider/index.js.map +1 -1
- package/dist/suggest-checklist/Component.d.ts.map +1 -1
- package/dist/suggest-checklist/index.js +78 -67
- package/dist/suggest-checklist/index.js.map +1 -1
- package/dist/switch/index.js +1 -1
- package/dist/table/index.js +1 -1
- package/dist/test/axe.d.ts +16 -0
- package/dist/test/axe.d.ts.map +1 -0
- package/dist/textarea/index.js +2 -2
- package/dist/theme-C-N1qQjF.js +35 -0
- package/dist/theme-C-N1qQjF.js.map +1 -0
- package/dist/time-field/Component.d.ts.map +1 -1
- package/dist/time-field/index.js +122 -107
- package/dist/time-field/index.js.map +1 -1
- package/dist/tooltip/index.js +1 -1
- package/package.json +1 -1
- package/src/date-range-picker/docs/Description.md +2 -0
- package/src/time-field/docs/Description.md +2 -0
- package/dist/Component-u6K-ylDb.js +0 -85
- package/dist/Component-u6K-ylDb.js.map +0 -1
- package/dist/assets/Component16.css +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/calendar/components/ScrollRangeCalendar/index.tsx","../../src/date-range-picker/theme.ts","../../src/date-range-picker/Component.tsx","../../src/date-range-picker/FormDateRangePicker.tsx"],"sourcesContent":["import { useContext, useState } from 'react';\n\nimport { type CalendarDate } from '@internationalized/date';\nimport { DateRangePickerStateContext, RangeCalendarContext, useSlottedContext } from 'react-aria-components';\n\nimport { useCalendarGridKeyboard } from '../../hooks/useCalendarGridKeyboard';\nimport { toCal, useFakeScrollCalendar } from '../../hooks/useFakeScrollCalendar';\nimport { type IScrollCalendarProps } from '../../types';\nimport { MonthList } from '../MonthList';\nimport { MonthView } from '../MonthView';\n\n/** Vertical scroll range calendar for DateRangePicker popover. */\nexport const ScrollRangeCalendar = ({ scrollToDate, className, autoFocusDay = false }: IScrollCalendarProps) => {\n const { months, viewportRef, setMonthEl, scrollToMonth } = useFakeScrollCalendar(scrollToDate);\n const rangeState = useContext(DateRangePickerStateContext);\n const calendarProps = useSlottedContext(RangeCalendarContext);\n const [rangeAnchor, setRangeAnchor] = useState<CalendarDate | null>(null);\n const [hoveredDate, setHoveredDate] = useState<CalendarDate | null>(null);\n\n const value = rangeState?.value ?? calendarProps?.value ?? null;\n const rangeStart = toCal(value?.start ?? null);\n const rangeEnd = toCal(value?.end ?? null);\n const minValue = toCal(calendarProps?.minValue ?? null);\n const maxValue = toCal(calendarProps?.maxValue ?? null);\n const isDisabled = Boolean(calendarProps?.isDisabled);\n const isDateUnavailable = calendarProps?.isDateUnavailable\n ? (date: CalendarDate) =>\n Boolean((calendarProps.isDateUnavailable as ((value: CalendarDate) => boolean) | undefined)?.(date))\n : undefined;\n\n const handleSelect = (date: CalendarDate) => {\n if (!rangeAnchor) {\n setRangeAnchor(date);\n return;\n }\n\n const start = date.compare(rangeAnchor) <= 0 ? date : rangeAnchor;\n const end = date.compare(rangeAnchor) <= 0 ? rangeAnchor : date;\n const next = { start, end };\n setRangeAnchor(null);\n setHoveredDate(null);\n\n if (calendarProps?.onChange) {\n calendarProps.onChange(next);\n return;\n }\n rangeState?.setValue(next);\n rangeState?.close();\n };\n\n const { focusedDate, onDayFocus, onDayBlur, onDayKeyDown, setFocusedDateFromParts, isGridEngaged } =\n useCalendarGridKeyboard({\n viewportRef,\n ensureMonthVisible: scrollToMonth,\n preferredDate: rangeEnd ?? rangeStart ?? toCal(scrollToDate),\n minValue,\n maxValue,\n isDateUnavailable,\n onSelect: handleSelect,\n autoFocusDay,\n });\n\n const handleMonthYearChange = (date: CalendarDate) => {\n scrollToMonth(date);\n setFocusedDateFromParts(date.year, date.month);\n };\n\n return (\n <MonthList months={months} viewportRef={viewportRef} setMonthEl={setMonthEl} className={className}>\n {({ monthKey, top, height }) => (\n <MonthView\n monthKey={monthKey}\n monthTop={top}\n monthHeight={height}\n rangeStart={rangeAnchor ? null : rangeStart}\n rangeEnd={rangeAnchor ? null : rangeEnd}\n rangeAnchor={rangeAnchor}\n hoveredDate={hoveredDate}\n minValue={minValue}\n maxValue={maxValue}\n isDateUnavailable={isDateUnavailable}\n isDisabled={isDisabled}\n onSelect={handleSelect}\n onHoverChange={setHoveredDate}\n onMonthYearChange={handleMonthYearChange}\n focusedDate={focusedDate}\n isGridEngaged={isGridEngaged}\n onFocusDate={onDayFocus}\n onBlurDate={onDayBlur}\n onDayKeyDown={onDayKeyDown}\n />\n )}\n </MonthList>\n );\n};\n\nScrollRangeCalendar.displayName = 'ScrollRangeCalendar';\n","import { cva } from 'class-variance-authority';\nimport cn from 'classnames';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const dateRangePickerGroupVariants = cva(styles.group, {\n variants: {\n size: {\n sm: cn(styles.sm, typographyStyles.bodyS),\n md: cn(styles.md, typographyStyles.bodyS),\n lg: cn(styles.lg, typographyStyles.bodyM),\n },\n variant: {\n primary: styles.primary,\n },\n block: {\n true: styles.block,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n block: true,\n },\n});\n","import { useEffect, useRef, useState } from 'react';\n\nimport { CalendarDate, type DateValue } from '@internationalized/date';\nimport cn from 'classnames';\nimport {\n Button as RacButton,\n DateRangePicker as RacDateRangePicker,\n DateInput,\n DateSegment,\n type DateRange,\n Dialog,\n Group,\n Popover,\n} from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { DEFAULT_YEAR_MAX, DEFAULT_YEAR_MIN, ScrollRangeCalendar } from '@/calendar';\nimport { Calendar, Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { dateRangePickerGroupVariants } from './theme';\nimport { type IDateRangePickerProps } from './types';\n\nimport styles from './styles.module.css';\n\nconst hasRangeValue = (value: DateRange | null | undefined) => value?.start != null || value?.end != null;\n\nconst DEFAULT_MIN_VALUE = new CalendarDate(DEFAULT_YEAR_MIN, 1, 1);\nconst DEFAULT_MAX_VALUE = new CalendarDate(DEFAULT_YEAR_MAX, 12, 31);\n\nconst isDateInBounds = (value: DateValue, minValue: DateValue, maxValue: DateValue) =>\n value.compare(minValue) >= 0 && value.compare(maxValue) <= 0;\n\nconst isValidRangeValue = (\n value: DateRange | null | undefined,\n minValue: DateValue,\n maxValue: DateValue\n): value is DateRange => {\n if (value == null) {\n return true;\n }\n if (value.start == null || value.end == null) {\n return false;\n }\n\n return isDateInBounds(value.start, minValue, maxValue) && isDateInBounds(value.end, minValue, maxValue);\n};\n\nexport const DateRangePicker = supportRef(\n ({\n ref,\n size = 'md',\n variant = 'primary',\n block = true,\n invalid = false,\n disabled = false,\n clear = false,\n value,\n defaultValue,\n onChange,\n onBlur,\n className,\n dataTestId,\n minValue,\n maxValue,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n ...props\n }: IDateRangePickerProps) => {\n const { clear: clearLabel, openCalendar } = useAuiLabels();\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<DateRange | null>(() => defaultValue ?? null);\n const [isOpen, setOpen] = useState(false);\n const currentValue = isControlled ? value : uncontrolledValue;\n const showClear = clear && !disabled && hasRangeValue(currentValue);\n const resolvedMin = minValue ?? DEFAULT_MIN_VALUE;\n const resolvedMax = maxValue ?? DEFAULT_MAX_VALUE;\n const lastValidRef = useRef<DateRange | null>(\n isValidRangeValue(currentValue, resolvedMin, resolvedMax) ? currentValue : null\n );\n const currentValueRef = useRef(currentValue);\n currentValueRef.current = currentValue;\n const openModalityRef = useRef<'pointer' | 'keyboard'>('pointer');\n\n useEffect(() => {\n if (isValidRangeValue(currentValue, resolvedMin, resolvedMax)) {\n lastValidRef.current = currentValue;\n }\n }, [currentValue, resolvedMin, resolvedMax]);\n\n const setValue = (next: DateRange | null) => {\n if (!isControlled) {\n setUncontrolledValue(next);\n }\n if (isValidRangeValue(next, resolvedMin, resolvedMax)) {\n lastValidRef.current = next;\n }\n onChange?.(next);\n };\n\n const handleBlur: NonNullable<IDateRangePickerProps['onBlur']> = event => {\n if (!isValidRangeValue(currentValueRef.current, resolvedMin, resolvedMax)) {\n setValue(lastValidRef.current);\n }\n onBlur?.(event);\n };\n\n const handleOpenChange = (open: boolean) => {\n setOpen(open);\n };\n\n return (\n <RacDateRangePicker\n {...props}\n value={currentValue}\n onChange={setValue}\n isDisabled={disabled}\n isInvalid={invalid}\n isOpen={isOpen}\n onOpenChange={handleOpenChange}\n onBlur={handleBlur}\n minValue={resolvedMin}\n maxValue={resolvedMax}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n className={cn(styles.root, block && styles.block, className)}\n >\n <Group\n ref={ref}\n className={dateRangePickerGroupVariants({ size, variant, block })}\n data-invalid={invalid || undefined}\n data-disabled={disabled || undefined}\n data-test-id={dataTestId}\n >\n <DateInput slot=\"start\" className={styles.input}>\n {segment => <DateSegment segment={segment} className={styles.segment} />}\n </DateInput>\n <span aria-hidden className={styles.separator}>\n –\n </span>\n <DateInput slot=\"end\" className={styles.input}>\n {segment => <DateSegment segment={segment} className={styles.segment} />}\n </DateInput>\n <span className={styles.actions}>\n {showClear ? (\n <RacButton\n slot={null}\n className={styles.clear}\n aria-label={clearLabel}\n data-test-id=\"date-range-picker-clear\"\n excludeFromTabOrder\n onPress={() => setValue(null)}\n >\n <Clear className={styles.icon} />\n </RacButton>\n ) : null}\n <RacButton\n className={styles.iconButton}\n aria-label={openCalendar}\n data-test-id=\"date-range-picker-calendar\"\n onPressStart={event => {\n openModalityRef.current = event.pointerType === 'keyboard' ? 'keyboard' : 'pointer';\n }}\n >\n <Calendar className={styles.icon} />\n </RacButton>\n </span>\n </Group>\n <Popover className={styles.popover} placement=\"bottom start\">\n <Dialog>\n <ScrollRangeCalendar\n scrollToDate={currentValue?.end ?? currentValue?.start ?? null}\n autoFocusDay={isOpen && openModalityRef.current === 'keyboard'}\n />\n </Dialog>\n </Popover>\n </RacDateRangePicker>\n );\n }\n);\n\nDateRangePicker.displayName = 'DateRangePicker';\n","import { type Ref } from 'react';\n\nimport { type DateRange } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { Field, useField } from '@/field';\nimport { useFieldHook } from '@/form/hooks/useFieldHook';\nimport { getError } from '@/form/utils';\n\nimport { DateRangePicker } from './Component';\nimport { type IDateRangePickerProps, type IFormDateRangePickerProps } from './types';\n\ntype TFormDateRangePickerControlProps = Omit<\n IDateRangePickerProps,\n 'size' | 'invalid' | 'disabled' | 'value' | 'onChange'\n> & {\n value: DateRange | null;\n onChange: (value: DateRange | null) => void;\n ref?: Ref<HTMLDivElement>;\n};\n\nconst FormDateRangePickerControl = supportRef(\n ({ ref, value, onChange, onBlur, ...props }: TFormDateRangePickerControlProps) => {\n const { controlProps, size, invalid, disabled } = useField();\n\n return (\n <DateRangePicker\n {...controlProps}\n {...props}\n ref={ref}\n size={size}\n invalid={invalid}\n disabled={disabled}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n />\n );\n }\n);\n\nFormDateRangePickerControl.displayName = 'FormDateRangePickerControl';\n\nexport const FormDateRangePicker = ({\n name,\n label,\n hint,\n size = 'md',\n block = true,\n disabled,\n className,\n dataTestId,\n ...inputProps\n}: IFormDateRangePickerProps) => {\n const { field, fieldState, inputProps: rhfInputProps, onChange, onBlurHandler } = useFieldHook({ name });\n const error = getError(fieldState.error)?.message;\n const isDisabled = disabled ?? rhfInputProps.disabled;\n\n return (\n <Field\n invalid={Boolean(error)}\n disabled={isDisabled}\n size={size}\n block={block}\n className={className}\n dataTestId={dataTestId}\n >\n {label ? <Field.Label>{label}</Field.Label> : null}\n <FormDateRangePickerControl\n {...inputProps}\n block={block}\n ref={field.ref}\n value={field.value ?? null}\n onChange={next => {\n field.onChange(next);\n onChange(name, next as never);\n }}\n onBlur={() => onBlurHandler()}\n />\n {hint ? <Field.Hint>{hint}</Field.Hint> : null}\n <Field.Error>{error}</Field.Error>\n </Field>\n );\n};\n\nFormDateRangePicker.displayName = 'FormDateRangePicker';\n"],"names":["ScrollRangeCalendar","scrollToDate","className","autoFocusDay","months","viewportRef","setMonthEl","scrollToMonth","useFakeScrollCalendar","rangeState","useContext","DateRangePickerStateContext","calendarProps","useSlottedContext","RangeCalendarContext","rangeAnchor","setRangeAnchor","useState","hoveredDate","setHoveredDate","value","rangeStart","toCal","rangeEnd","minValue","maxValue","isDisabled","isDateUnavailable","date","handleSelect","start","end","next","focusedDate","onDayFocus","onDayBlur","onDayKeyDown","setFocusedDateFromParts","isGridEngaged","useCalendarGridKeyboard","handleMonthYearChange","jsx","MonthList","monthKey","top","height","MonthView","dateRangePickerGroupVariants","cva","styles","cn","typographyStyles","hasRangeValue","DEFAULT_MIN_VALUE","CalendarDate","DEFAULT_YEAR_MIN","DEFAULT_MAX_VALUE","DEFAULT_YEAR_MAX","isDateInBounds","isValidRangeValue","DateRangePicker","supportRef","ref","size","variant","block","invalid","disabled","clear","defaultValue","onChange","onBlur","dataTestId","ariaLabel","ariaLabelledby","ariaDescribedby","props","clearLabel","openCalendar","useAuiLabels","isControlled","uncontrolledValue","setUncontrolledValue","isOpen","setOpen","currentValue","showClear","resolvedMin","resolvedMax","lastValidRef","useRef","currentValueRef","openModalityRef","useEffect","setValue","jsxs","RacDateRangePicker","open","event","Group","DateInput","segment","DateSegment","RacButton","Clear","Calendar","Popover","Dialog","FormDateRangePickerControl","controlProps","useField","FormDateRangePicker","name","label","hint","inputProps","field","fieldState","rhfInputProps","onBlurHandler","useFieldHook","error","getError","Field"],"mappings":";;;;;;;;;;;;;;AAYO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AAY,YAAYC,GAAe,UAAAhD,GAAU,eAAAiD,MAAkBC,GAAa,EAAE,MAAAR,GAAM,GACjGS,IAAQC,GAASL,EAAW,KAAK,GAAG,SACpC3F,IAAayC,KAAYmD,EAAc;AAE7C,SACI,gBAAAvB;AAAA,IAAC4B;AAAA,IAAA;AAAA,MACG,SAAS,EAAQF;AAAA,MACjB,UAAU/F;AAAA,MACV,MAAAqC;AAAA,MACA,OAAAE;AAAA,MACA,WAAA/D;AAAA,MACA,YAAAsE;AAAA,MAEC,UAAA;AAAA,QAAAyC,IAAQ,gBAAAxE,EAACkF,EAAM,OAAN,EAAa,aAAM,IAAiB;AAAA,QAC9C,gBAAAlF;AAAA,UAACmE;AAAA,UAAA;AAAA,YACI,GAAGO;AAAA,YACJ,OAAAlD;AAAA,YACA,KAAKmD,EAAM;AAAA,YACX,OAAOA,EAAM,SAAS;AAAA,YACtB,UAAU,CAAApF,MAAQ;AACd,cAAAoF,EAAM,SAASpF,CAAI,GACnBsC,EAAS0C,GAAMhF,CAAa;AAAA,YAChC;AAAA,YACA,QAAQ,MAAMuF,EAAA;AAAA,UAAc;AAAA,QAAA;AAAA,QAE/BL,IAAO,gBAAAzE,EAACkF,EAAM,MAAN,EAAY,aAAK,IAAgB;AAAA,QAC1C,gBAAAlF,EAACkF,EAAM,OAAN,EAAa,UAAAF,EAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGhC;AAEAV,GAAoB,cAAc;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../src/calendar/components/ScrollRangeCalendar/index.tsx","../../src/date-range-picker/theme.ts","../../src/date-range-picker/utils.ts","../../src/date-range-picker/Component.tsx","../../src/date-range-picker/FormDateRangePicker.tsx"],"sourcesContent":["import { useContext, useState } from 'react';\n\nimport { type CalendarDate } from '@internationalized/date';\nimport { DateRangePickerStateContext, RangeCalendarContext, useSlottedContext } from 'react-aria-components';\n\nimport { useCalendarGridKeyboard } from '../../hooks/useCalendarGridKeyboard';\nimport { toCal, useFakeScrollCalendar } from '../../hooks/useFakeScrollCalendar';\nimport { type IScrollCalendarProps } from '../../types';\nimport { MonthList } from '../MonthList';\nimport { MonthView } from '../MonthView';\n\n/** Vertical scroll range calendar for DateRangePicker popover. */\nexport const ScrollRangeCalendar = ({ scrollToDate, className, autoFocusDay = false }: IScrollCalendarProps) => {\n const { months, viewportRef, setMonthEl, scrollToMonth } = useFakeScrollCalendar(scrollToDate);\n const rangeState = useContext(DateRangePickerStateContext);\n const calendarProps = useSlottedContext(RangeCalendarContext);\n const [rangeAnchor, setRangeAnchor] = useState<CalendarDate | null>(null);\n const [hoveredDate, setHoveredDate] = useState<CalendarDate | null>(null);\n\n const value = rangeState?.value ?? calendarProps?.value ?? null;\n const rangeStart = toCal(value?.start ?? null);\n const rangeEnd = toCal(value?.end ?? null);\n const minValue = toCal(calendarProps?.minValue ?? null);\n const maxValue = toCal(calendarProps?.maxValue ?? null);\n const isDisabled = Boolean(calendarProps?.isDisabled);\n const isDateUnavailable = calendarProps?.isDateUnavailable\n ? (date: CalendarDate) =>\n Boolean((calendarProps.isDateUnavailable as ((value: CalendarDate) => boolean) | undefined)?.(date))\n : undefined;\n\n const handleSelect = (date: CalendarDate) => {\n if (!rangeAnchor) {\n setRangeAnchor(date);\n return;\n }\n\n const start = date.compare(rangeAnchor) <= 0 ? date : rangeAnchor;\n const end = date.compare(rangeAnchor) <= 0 ? rangeAnchor : date;\n const next = { start, end };\n setRangeAnchor(null);\n setHoveredDate(null);\n\n if (calendarProps?.onChange) {\n calendarProps.onChange(next);\n return;\n }\n rangeState?.setValue(next);\n rangeState?.close();\n };\n\n const { focusedDate, onDayFocus, onDayBlur, onDayKeyDown, setFocusedDateFromParts, isGridEngaged } =\n useCalendarGridKeyboard({\n viewportRef,\n ensureMonthVisible: scrollToMonth,\n preferredDate: rangeEnd ?? rangeStart ?? toCal(scrollToDate),\n minValue,\n maxValue,\n isDateUnavailable,\n onSelect: handleSelect,\n autoFocusDay,\n });\n\n const handleMonthYearChange = (date: CalendarDate) => {\n scrollToMonth(date);\n setFocusedDateFromParts(date.year, date.month);\n };\n\n return (\n <MonthList months={months} viewportRef={viewportRef} setMonthEl={setMonthEl} className={className}>\n {({ monthKey, top, height }) => (\n <MonthView\n monthKey={monthKey}\n monthTop={top}\n monthHeight={height}\n rangeStart={rangeAnchor ? null : rangeStart}\n rangeEnd={rangeAnchor ? null : rangeEnd}\n rangeAnchor={rangeAnchor}\n hoveredDate={hoveredDate}\n minValue={minValue}\n maxValue={maxValue}\n isDateUnavailable={isDateUnavailable}\n isDisabled={isDisabled}\n onSelect={handleSelect}\n onHoverChange={setHoveredDate}\n onMonthYearChange={handleMonthYearChange}\n focusedDate={focusedDate}\n isGridEngaged={isGridEngaged}\n onFocusDate={onDayFocus}\n onBlurDate={onDayBlur}\n onDayKeyDown={onDayKeyDown}\n />\n )}\n </MonthList>\n );\n};\n\nScrollRangeCalendar.displayName = 'ScrollRangeCalendar';\n","import { cva } from 'class-variance-authority';\nimport cn from 'classnames';\n\nimport { typographyStyles } from '@ds/typography';\n\nimport styles from './styles.module.css';\n\nexport const dateRangePickerGroupVariants = cva(styles.group, {\n variants: {\n size: {\n sm: cn(styles.sm, typographyStyles.bodyS),\n md: cn(styles.md, typographyStyles.bodyS),\n lg: cn(styles.lg, typographyStyles.bodyM),\n },\n variant: {\n primary: styles.primary,\n },\n block: {\n true: styles.block,\n false: null,\n },\n },\n defaultVariants: {\n size: 'md',\n variant: 'primary',\n block: true,\n },\n});\n","import { CalendarDate, type DateValue } from '@internationalized/date';\nimport { type DateRange } from 'react-aria-components';\n\nimport { DEFAULT_YEAR_MAX, DEFAULT_YEAR_MIN } from '@/calendar';\n\n/** Incomplete segment input. RAC types both ends as `DateValue`, but a cleared segment is `null`. */\ninterface IEditableRange {\n start: DateValue | null;\n end: DateValue | null;\n}\n\nexport const DEFAULT_RANGE_MIN_VALUE = new CalendarDate(DEFAULT_YEAR_MIN, 1, 1);\nexport const DEFAULT_RANGE_MAX_VALUE = new CalendarDate(DEFAULT_YEAR_MAX, 12, 31);\n\n/** True when either endpoint is set. */\nexport const hasRangeValue = (value: IEditableRange | null | undefined) => value?.start != null || value?.end != null;\n\nconst sameEndpoint = (left: DateValue | null | undefined, right: DateValue | null | undefined) => {\n if (left == null || right == null) {\n return left == null && right == null;\n }\n\n return left.compare(right) === 0;\n};\n\nconst isDateInBounds = (value: DateValue, minValue: DateValue, maxValue: DateValue) =>\n value.compare(minValue) >= 0 && value.compare(maxValue) <= 0;\n\n/**\n * Empty range is publishable (clear). A range is publishable only when both\n * ends exist, end is not before start, and both ends sit inside bounds.\n */\nexport const isPublishableRange = (\n value: IEditableRange | null | undefined,\n minValue: DateValue,\n maxValue: DateValue\n) => {\n if (value == null) {\n return true;\n }\n if (value.start == null || value.end == null) {\n return false;\n }\n if (value.end.compare(value.start) < 0) {\n return false;\n }\n\n return isDateInBounds(value.start, minValue, maxValue) && isDateInBounds(value.end, minValue, maxValue);\n};\n\n/** Swap only a complete reversed range. Partial ranges stay partial. */\nexport const orderRange = (value: IEditableRange): IEditableRange => {\n if (value.start != null && value.end != null && value.end.compare(value.start) < 0) {\n return { start: value.end, end: value.start };\n }\n\n return value;\n};\n\n/** Compare endpoints. A missing end matches only another missing end. */\nexport const rangesEqual = (left: IEditableRange | null | undefined, right: IEditableRange | null | undefined) => {\n if (left == null || right == null) {\n return left == null && right == null;\n }\n\n return sameEndpoint(left.start, right.start) && sameEndpoint(left.end, right.end);\n};\n\n/** Value committed on blur, Enter, or calendar close. Invalid input falls back to the last publishable range. */\nexport const resolveCommittedRange = (\n raw: IEditableRange | null | undefined,\n lastValid: DateRange | null,\n minValue: DateValue,\n maxValue: DateValue\n): DateRange | null => {\n if (raw?.start != null && raw.end != null) {\n const ordered = orderRange(raw);\n\n if (ordered.start != null && ordered.end != null && isPublishableRange(ordered, minValue, maxValue)) {\n return { start: ordered.start, end: ordered.end };\n }\n\n return lastValid;\n }\n\n return raw == null ? null : lastValid;\n};\n","import { useEffect, useRef, useState } from 'react';\n\nimport cn from 'classnames';\nimport {\n Button as RacButton,\n DateRangePicker as RacDateRangePicker,\n DateInput,\n DateSegment,\n type DateRange,\n Dialog,\n Group,\n Popover,\n} from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { ScrollRangeCalendar } from '@/calendar';\nimport { Calendar, Clear } from '@/icons';\nimport { useAuiLabels } from '@/provider';\n\nimport { dateRangePickerGroupVariants } from './theme';\nimport { type IDateRangePickerProps } from './types';\nimport {\n DEFAULT_RANGE_MAX_VALUE,\n DEFAULT_RANGE_MIN_VALUE,\n hasRangeValue,\n isPublishableRange,\n rangesEqual,\n resolveCommittedRange,\n} from './utils';\n\nimport styles from './styles.module.css';\n\nexport const DateRangePicker = supportRef(\n ({\n ref,\n size = 'md',\n variant = 'primary',\n block = true,\n invalid = false,\n disabled = false,\n clear = false,\n value,\n defaultValue,\n onChange,\n onBlur,\n className,\n dataTestId,\n minValue,\n maxValue,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n 'aria-describedby': ariaDescribedby,\n ...props\n }: IDateRangePickerProps) => {\n const { clear: clearLabel, openCalendar } = useAuiLabels();\n const isControlled = value !== undefined;\n const [uncontrolledValue, setUncontrolledValue] = useState<DateRange | null>(() => defaultValue ?? null);\n const [isOpen, setOpen] = useState(false);\n /** In-progress edit. Keeps segment text while the parent only receives ordered ranges. */\n const [draft, setDraft] = useState<DateRange | null | undefined>(undefined);\n const currentValue = isControlled ? value : uncontrolledValue;\n const displayedValue = draft !== undefined ? draft : currentValue;\n const showClear = clear && !disabled && hasRangeValue(displayedValue);\n const resolvedMin = minValue ?? DEFAULT_RANGE_MIN_VALUE;\n const resolvedMax = maxValue ?? DEFAULT_RANGE_MAX_VALUE;\n const lastValidRef = useRef<DateRange | null>(\n isPublishableRange(currentValue, resolvedMin, resolvedMax) ? (currentValue ?? null) : null\n );\n const lastEmittedRef = useRef<DateRange | null | undefined>(lastValidRef.current);\n const draftRef = useRef(draft);\n draftRef.current = draft;\n const boundsRef = useRef({ min: resolvedMin, max: resolvedMax });\n boundsRef.current = { min: resolvedMin, max: resolvedMax };\n const currentValueRef = useRef(displayedValue);\n currentValueRef.current = displayedValue;\n const openModalityRef = useRef<'pointer' | 'keyboard'>('pointer');\n const seenValueRef = useRef(value);\n\n useEffect(() => {\n if (isPublishableRange(currentValue, resolvedMin, resolvedMax)) {\n lastValidRef.current = currentValue ?? null;\n }\n }, [currentValue, resolvedMin, resolvedMax]);\n\n useEffect(() => {\n if (!isControlled) {\n return;\n }\n if (rangesEqual(value ?? null, seenValueRef.current ?? null)) {\n seenValueRef.current = value;\n return;\n }\n seenValueRef.current = value;\n if (draftRef.current !== undefined && !rangesEqual(value ?? null, draftRef.current)) {\n draftRef.current = undefined;\n setDraft(undefined);\n }\n }, [isControlled, value]);\n\n const emit = (next: DateRange | null) => {\n draftRef.current = undefined;\n setDraft(undefined);\n if (!isControlled) {\n setUncontrolledValue(next);\n }\n if (isPublishableRange(next, boundsRef.current.min, boundsRef.current.max)) {\n lastValidRef.current = next;\n }\n if (rangesEqual(lastEmittedRef.current, next)) {\n return;\n }\n lastEmittedRef.current = next;\n onChange?.(next);\n };\n\n const setValue = (next: DateRange | null) => {\n emit(next);\n };\n\n const commit = () => {\n const raw = draftRef.current !== undefined ? draftRef.current : currentValueRef.current;\n const { min, max } = boundsRef.current;\n\n emit(resolveCommittedRange(raw, lastValidRef.current, min, max));\n };\n\n const handleBlur: NonNullable<IDateRangePickerProps['onBlur']> = event => {\n commit();\n onBlur?.(event);\n };\n\n const handleOpenChange = (open: boolean) => {\n setOpen(open);\n if (!open) {\n commit();\n }\n };\n\n const handleInputChange = (next: DateRange | null) => {\n draftRef.current = next;\n setDraft(next);\n if (!isControlled) {\n setUncontrolledValue(next);\n }\n if (!isPublishableRange(next, boundsRef.current.min, boundsRef.current.max)) {\n return;\n }\n lastValidRef.current = next;\n if (rangesEqual(lastEmittedRef.current, next)) {\n return;\n }\n lastEmittedRef.current = next;\n onChange?.(next);\n };\n\n return (\n <RacDateRangePicker\n {...props}\n value={displayedValue}\n onChange={handleInputChange}\n isDisabled={disabled}\n isInvalid={invalid}\n isOpen={isOpen}\n onOpenChange={handleOpenChange}\n onBlur={handleBlur}\n minValue={resolvedMin}\n maxValue={resolvedMax}\n aria-label={ariaLabel}\n aria-labelledby={ariaLabelledby}\n aria-describedby={ariaDescribedby}\n className={cn(styles.root, block && styles.block, className)}\n >\n <Group\n ref={ref}\n className={dateRangePickerGroupVariants({ size, variant, block })}\n data-invalid={invalid || undefined}\n data-disabled={disabled || undefined}\n data-test-id={dataTestId}\n onKeyDown={event => {\n if (event.key === 'Enter') {\n commit();\n }\n }}\n >\n <DateInput slot=\"start\" className={styles.input}>\n {segment => <DateSegment segment={segment} className={styles.segment} />}\n </DateInput>\n <span aria-hidden className={styles.separator}>\n –\n </span>\n <DateInput slot=\"end\" className={styles.input}>\n {segment => <DateSegment segment={segment} className={styles.segment} />}\n </DateInput>\n <span className={styles.actions}>\n {showClear ? (\n <RacButton\n slot={null}\n className={styles.clear}\n aria-label={clearLabel}\n data-test-id=\"date-range-picker-clear\"\n excludeFromTabOrder\n onPress={() => setValue(null)}\n >\n <Clear className={styles.icon} />\n </RacButton>\n ) : null}\n <RacButton\n className={styles.iconButton}\n aria-label={openCalendar}\n data-test-id=\"date-range-picker-calendar\"\n onPressStart={event => {\n openModalityRef.current = event.pointerType === 'keyboard' ? 'keyboard' : 'pointer';\n }}\n >\n <Calendar className={styles.icon} />\n </RacButton>\n </span>\n </Group>\n <Popover className={styles.popover} placement=\"bottom start\">\n <Dialog>\n <ScrollRangeCalendar\n scrollToDate={displayedValue?.end ?? displayedValue?.start ?? null}\n autoFocusDay={isOpen && openModalityRef.current === 'keyboard'}\n />\n </Dialog>\n </Popover>\n </RacDateRangePicker>\n );\n }\n);\n\nDateRangePicker.displayName = 'DateRangePicker';\n","import { type Ref } from 'react';\n\nimport { type DateRange } from 'react-aria-components';\n\nimport { supportRef } from '@ds/common/support-ref';\n\nimport { Field, useField } from '@/field';\nimport { useFieldHook } from '@/form/hooks/useFieldHook';\nimport { getError } from '@/form/utils';\n\nimport { DateRangePicker } from './Component';\nimport { type IDateRangePickerProps, type IFormDateRangePickerProps } from './types';\n\ntype TFormDateRangePickerControlProps = Omit<\n IDateRangePickerProps,\n 'size' | 'invalid' | 'disabled' | 'value' | 'onChange'\n> & {\n value: DateRange | null;\n onChange: (value: DateRange | null) => void;\n ref?: Ref<HTMLDivElement>;\n};\n\nconst FormDateRangePickerControl = supportRef(\n ({ ref, value, onChange, onBlur, ...props }: TFormDateRangePickerControlProps) => {\n const { controlProps, size, invalid, disabled } = useField();\n\n return (\n <DateRangePicker\n {...controlProps}\n {...props}\n ref={ref}\n size={size}\n invalid={invalid}\n disabled={disabled}\n value={value}\n onChange={onChange}\n onBlur={onBlur}\n />\n );\n }\n);\n\nFormDateRangePickerControl.displayName = 'FormDateRangePickerControl';\n\nexport const FormDateRangePicker = ({\n name,\n label,\n hint,\n size = 'md',\n block = true,\n disabled,\n className,\n dataTestId,\n ...inputProps\n}: IFormDateRangePickerProps) => {\n const { field, fieldState, inputProps: rhfInputProps, onChange, onBlurHandler } = useFieldHook({ name });\n const error = getError(fieldState.error)?.message;\n const isDisabled = disabled ?? rhfInputProps.disabled;\n\n return (\n <Field\n invalid={Boolean(error)}\n disabled={isDisabled}\n size={size}\n block={block}\n className={className}\n dataTestId={dataTestId}\n >\n {label ? <Field.Label>{label}</Field.Label> : null}\n <FormDateRangePickerControl\n {...inputProps}\n block={block}\n ref={field.ref}\n value={field.value ?? null}\n onChange={next => {\n field.onChange(next);\n onChange(name, next as never);\n }}\n onBlur={() => onBlurHandler()}\n />\n {hint ? <Field.Hint>{hint}</Field.Hint> : null}\n <Field.Error>{error}</Field.Error>\n </Field>\n );\n};\n\nFormDateRangePicker.displayName = 'FormDateRangePicker';\n"],"names":["ScrollRangeCalendar","scrollToDate","className","autoFocusDay","months","viewportRef","setMonthEl","scrollToMonth","useFakeScrollCalendar","rangeState","useContext","DateRangePickerStateContext","calendarProps","useSlottedContext","RangeCalendarContext","rangeAnchor","setRangeAnchor","useState","hoveredDate","setHoveredDate","value","rangeStart","toCal","rangeEnd","minValue","maxValue","isDisabled","isDateUnavailable","date","handleSelect","start","end","next","focusedDate","onDayFocus","onDayBlur","onDayKeyDown","setFocusedDateFromParts","isGridEngaged","useCalendarGridKeyboard","handleMonthYearChange","jsx","MonthList","monthKey","top","height","MonthView","dateRangePickerGroupVariants","cva","styles","cn","typographyStyles","DEFAULT_RANGE_MIN_VALUE","CalendarDate","DEFAULT_YEAR_MIN","DEFAULT_RANGE_MAX_VALUE","DEFAULT_YEAR_MAX","hasRangeValue","sameEndpoint","left","right","isDateInBounds","isPublishableRange","orderRange","rangesEqual","resolveCommittedRange","raw","lastValid","ordered","DateRangePicker","supportRef","ref","size","variant","block","invalid","disabled","clear","defaultValue","onChange","onBlur","dataTestId","ariaLabel","ariaLabelledby","ariaDescribedby","props","clearLabel","openCalendar","useAuiLabels","isControlled","uncontrolledValue","setUncontrolledValue","isOpen","setOpen","draft","setDraft","currentValue","displayedValue","showClear","resolvedMin","resolvedMax","lastValidRef","useRef","lastEmittedRef","draftRef","boundsRef","currentValueRef","openModalityRef","seenValueRef","useEffect","emit","setValue","commit","min","max","jsxs","RacDateRangePicker","open","event","Group","DateInput","segment","DateSegment","RacButton","Clear","Calendar","Popover","Dialog","FormDateRangePickerControl","controlProps","useField","FormDateRangePicker","name","label","hint","inputProps","field","fieldState","rhfInputProps","onBlurHandler","useFieldHook","error","getError","Field"],"mappings":";;;;;;;;;;;;;;AAYO,MAAMA,KAAsB,CAAC,EAAE,cAAAC,GAAc,WAAAC,GAAW,cAAAC,IAAe,SAAkC;AAC5G,QAAM,EAAE,QAAAC,GAAQ,aAAAC,GAAa,YAAAC,GAAY,eAAAC,EAAA,IAAkBC,GAAsBP,CAAY,GACvFQ,IAAaC,GAAWC,EAA2B,GACnDC,IAAgBC,GAAk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gBAAAtG;AAAA,UAACuF;AAAA,UAAA;AAAA,YACI,GAAGO;AAAA,YACJ,OAAA7D;AAAA,YACA,KAAK8D,EAAM;AAAA,YACX,OAAOA,EAAM,SAAS;AAAA,YACtB,UAAU,CAAAxG,MAAQ;AACd,cAAAwG,EAAM,SAASxG,CAAI,GACnB+C,EAASqD,GAAMpG,CAAa;AAAA,YAChC;AAAA,YACA,QAAQ,MAAM2G,EAAA;AAAA,UAAc;AAAA,QAAA;AAAA,QAE/BL,IAAO,gBAAA7F,EAACsG,EAAM,MAAN,EAAY,aAAK,IAAgB;AAAA,QAC1C,gBAAAtG,EAACsG,EAAM,OAAN,EAAa,UAAAF,EAAA,CAAM;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGhC;AAEAV,GAAoB,cAAc;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CalendarDate, DateValue } from '@internationalized/date';
|
|
2
|
+
import { DateRange } from 'react-aria-components';
|
|
3
|
+
/** Incomplete segment input. RAC types both ends as `DateValue`, but a cleared segment is `null`. */
|
|
4
|
+
interface IEditableRange {
|
|
5
|
+
start: DateValue | null;
|
|
6
|
+
end: DateValue | null;
|
|
7
|
+
}
|
|
8
|
+
export declare const DEFAULT_RANGE_MIN_VALUE: CalendarDate;
|
|
9
|
+
export declare const DEFAULT_RANGE_MAX_VALUE: CalendarDate;
|
|
10
|
+
/** True when either endpoint is set. */
|
|
11
|
+
export declare const hasRangeValue: (value: IEditableRange | null | undefined) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Empty range is publishable (clear). A range is publishable only when both
|
|
14
|
+
* ends exist, end is not before start, and both ends sit inside bounds.
|
|
15
|
+
*/
|
|
16
|
+
export declare const isPublishableRange: (value: IEditableRange | null | undefined, minValue: DateValue, maxValue: DateValue) => boolean;
|
|
17
|
+
/** Swap only a complete reversed range. Partial ranges stay partial. */
|
|
18
|
+
export declare const orderRange: (value: IEditableRange) => IEditableRange;
|
|
19
|
+
/** Compare endpoints. A missing end matches only another missing end. */
|
|
20
|
+
export declare const rangesEqual: (left: IEditableRange | null | undefined, right: IEditableRange | null | undefined) => boolean;
|
|
21
|
+
/** Value committed on blur, Enter, or calendar close. Invalid input falls back to the last publishable range. */
|
|
22
|
+
export declare const resolveCommittedRange: (raw: IEditableRange | null | undefined, lastValid: DateRange | null, minValue: DateValue, maxValue: DateValue) => DateRange | null;
|
|
23
|
+
export {};
|
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/date-range-picker/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIvD,qGAAqG;AACrG,UAAU,cAAc;IACpB,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC;IACxB,GAAG,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,uBAAuB,cAA2C,CAAC;AAChF,eAAO,MAAM,uBAAuB,cAA6C,CAAC;AAElF,wCAAwC;AACxC,eAAO,MAAM,aAAa,GAAI,OAAO,cAAc,GAAG,IAAI,GAAG,SAAS,YAA+C,CAAC;AAatH;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC3B,OAAO,cAAc,GAAG,IAAI,GAAG,SAAS,EACxC,UAAU,SAAS,EACnB,UAAU,SAAS,YAatB,CAAC;AAEF,wEAAwE;AACxE,eAAO,MAAM,UAAU,GAAI,OAAO,cAAc,KAAG,cAMlD,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,WAAW,GAAI,MAAM,cAAc,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,cAAc,GAAG,IAAI,GAAG,SAAS,YAM5G,CAAC;AAEF,iHAAiH;AACjH,eAAO,MAAM,qBAAqB,GAC9B,KAAK,cAAc,GAAG,IAAI,GAAG,SAAS,EACtC,WAAW,SAAS,GAAG,IAAI,EAC3B,UAAU,SAAS,EACnB,UAAU,SAAS,KACpB,SAAS,GAAG,IAYd,CAAC"}
|
package/dist/drawer/index.js
CHANGED
package/dist/field/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import g from "classnames";
|
|
3
3
|
import { s as _ } from "../index-h8z54aFR.js";
|
|
4
|
-
import '../assets/
|
|
4
|
+
import '../assets/index16.css';const G = (a) => typeof a == "number" ? `repeat(${a}, minmax(0, 1fr))` : a.map((e) => typeof e == "number" ? `${e}fr` : e).join(" "), d = (a) => a === "full" ? "1 / -1" : typeof a == "number" ? `span ${a}` : "auto", L = "aub_styles-module_root_d8095", $ = {
|
|
5
5
|
root: L
|
|
6
6
|
}, m = _(
|
|
7
7
|
({ ref: a, children: e, col: s, className: o, dataTestId: p, style: u, ...r }) => {
|
package/dist/input/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { I as x } from "../Component-
|
|
1
|
+
import { I as x } from "../Component-D9cY4WmP.js";
|
|
2
2
|
import { jsxs as B, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import { s as C } from "../index-h8z54aFR.js";
|
|
5
|
-
import { F as s, u as O } from "../Component-
|
|
5
|
+
import { F as s, u as O } from "../Component-DSAL6avh.js";
|
|
6
6
|
import { u as P, g as j } from "../useFieldHook-Bt9nST7g.js";
|
|
7
7
|
const D = C((i) => {
|
|
8
8
|
const { controlProps: o, size: e, invalid: l, disabled: n } = O();
|
package/dist/menu-list/index.js
CHANGED
package/dist/modal/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { M as v } from "../Component-
|
|
1
|
+
import { M as v } from "../Component-DcSDEfYC.js";
|
|
2
2
|
import { jsxs as A, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
-
import { F as t, u as b } from "../Component-
|
|
4
|
+
import { F as t, u as b } from "../Component-DSAL6avh.js";
|
|
5
5
|
import { u as x, g as B } from "../useFieldHook-Bt9nST7g.js";
|
|
6
6
|
const H = (i) => {
|
|
7
7
|
const { controlProps: o, size: r, invalid: s, disabled: l } = b();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as s, jsxs as h } from "react/jsx-runtime";
|
|
2
2
|
import { s as L } from "../index-h8z54aFR.js";
|
|
3
3
|
import { u as v, a as B, i as E } from "../useAsyncSuggest-DuIolQ3l.js";
|
|
4
|
-
import { M as b } from "../Component-
|
|
4
|
+
import { M as b } from "../Component-DcSDEfYC.js";
|
|
5
5
|
import "react";
|
|
6
|
-
import { F as c, u as x } from "../Component-
|
|
6
|
+
import { F as c, u as x } from "../Component-DSAL6avh.js";
|
|
7
7
|
import { u as C, g as H } from "../useFieldHook-Bt9nST7g.js";
|
|
8
8
|
const f = L(
|
|
9
9
|
({ useSuggest: n, minLength: o = 0, debounceMs: t = 300, disabled: e = !1, ...r }) => {
|
|
@@ -6,9 +6,9 @@ import { s as R } from "../index-h8z54aFR.js";
|
|
|
6
6
|
import { a as j } from "../utils-Dj_u-w0s.js";
|
|
7
7
|
import { C as E } from "../index-CdAE-ZaU.js";
|
|
8
8
|
import { cva as P } from "class-variance-authority";
|
|
9
|
-
import { F as f, u as T } from "../Component-
|
|
9
|
+
import { F as f, u as T } from "../Component-DSAL6avh.js";
|
|
10
10
|
import { u as q, g as w } from "../useFieldHook-Bt9nST7g.js";
|
|
11
|
-
import '../assets/
|
|
11
|
+
import '../assets/index17.css';const z = "aub_styles-module_root_42206", A = "aub_styles-module_block_e0d95", y = {
|
|
12
12
|
root: z,
|
|
13
13
|
block: A
|
|
14
14
|
}, G = P(y.root, {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { N as y } from "../Component-
|
|
1
|
+
import { N as y } from "../Component-BMol_xnR.js";
|
|
2
2
|
import { jsxs as x, jsx as r } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import { s as B } from "../index-h8z54aFR.js";
|
|
5
|
-
import { F as l, u as C } from "../Component-
|
|
5
|
+
import { F as l, u as C } from "../Component-DSAL6avh.js";
|
|
6
6
|
import { u as H, g as P } from "../useFieldHook-Bt9nST7g.js";
|
|
7
7
|
const f = B(
|
|
8
8
|
({ ref: i, value: e, onChange: o, onBlur: t, ...n }) => {
|
|
@@ -2,8 +2,8 @@ import { jsxs as H, jsx as s } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState as L } from "react";
|
|
3
3
|
import U from "classnames";
|
|
4
4
|
import { s as j } from "../index-h8z54aFR.js";
|
|
5
|
-
import { N as B } from "../Component-
|
|
6
|
-
import { F as b, u as $ } from "../Component-
|
|
5
|
+
import { N as B } from "../Component-BMol_xnR.js";
|
|
6
|
+
import { F as b, u as $ } from "../Component-DSAL6avh.js";
|
|
7
7
|
import { u as q, g as w } from "../useFieldHook-Bt9nST7g.js";
|
|
8
8
|
import '../assets/index12.css';const C = (o) => o == null || Number.isNaN(o) ? null : o, D = (o, n, t) => {
|
|
9
9
|
const r = C(o.from), l = C(o.to), e = C(t);
|
package/dist/select/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { S as v } from "../Component-
|
|
1
|
+
import { S as v } from "../Component-BO5LvfoO.js";
|
|
2
2
|
import { jsxs as b, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
|
-
import { F as n, u as x } from "../Component-
|
|
4
|
+
import { F as n, u as x } from "../Component-DSAL6avh.js";
|
|
5
5
|
import { u as B, g as H } from "../useFieldHook-Bt9nST7g.js";
|
|
6
6
|
const j = (s) => {
|
|
7
7
|
const { controlProps: r, size: o, invalid: i, disabled: l } = x();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../src/slider/Component.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAwB5C,eAAO,MAAM,MAAM,0PAwBZ,YAAY;;
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../../src/slider/Component.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAwB5C,eAAO,MAAM,MAAM,0PAwBZ,YAAY;;CAsElB,CAAC"}
|
package/dist/slider/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsxs as h, jsx as
|
|
2
|
-
import { useRef as
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as L, useLayoutEffect as M, useContext as P } from "react";
|
|
3
3
|
import k from "classnames";
|
|
4
|
-
import { Slider as
|
|
5
|
-
import { s as
|
|
4
|
+
import { Slider as $, SliderOutput as x, SliderTrack as O, SliderFill as V, SliderThumb as q, SliderStateContext as w } from "react-aria-components";
|
|
5
|
+
import { s as B } from "../index-h8z54aFR.js";
|
|
6
6
|
import { cva as G } from "class-variance-authority";
|
|
7
7
|
import { typographyStyles as C } from "../typography/index.js";
|
|
8
|
-
import { F as v, u as J } from "../Component-
|
|
8
|
+
import { F as v, u as J } from "../Component-DSAL6avh.js";
|
|
9
9
|
import { u as K, g as Q } from "../useFieldHook-Bt9nST7g.js";
|
|
10
|
-
import '../assets/
|
|
10
|
+
import '../assets/index18.css';const U = "aub_styles-module_root_34a37", W = "aub_styles-module_block_87638", X = "aub_styles-module_readout_b6c80", Y = "aub_styles-module_value_52215", Z = "aub_styles-module_detail_aad13", ee = "aub_styles-module_track_47316", le = "aub_styles-module_rail_fad39", ae = "aub_styles-module_fill_7f0d9", te = "aub_styles-module_ticks_24abe", re = "aub_styles-module_tick_60d62", se = "aub_styles-module_thumb_edd9d", ie = "aub_styles-module_invalid_cb4ec", oe = "aub_styles-module_sm_d6a8a", de = "aub_styles-module_md_f78ab", ue = "aub_styles-module_lg_32e42", a = {
|
|
11
11
|
root: U,
|
|
12
12
|
block: W,
|
|
13
13
|
readout: X,
|
|
@@ -16,14 +16,14 @@ import '../assets/index19.css';const U = "aub_styles-module_root_34a37", W = "au
|
|
|
16
16
|
track: ee,
|
|
17
17
|
rail: le,
|
|
18
18
|
fill: ae,
|
|
19
|
-
ticks:
|
|
20
|
-
tick:
|
|
19
|
+
ticks: te,
|
|
20
|
+
tick: re,
|
|
21
21
|
thumb: se,
|
|
22
22
|
invalid: ie,
|
|
23
23
|
sm: oe,
|
|
24
24
|
md: de,
|
|
25
|
-
lg:
|
|
26
|
-
},
|
|
25
|
+
lg: ue
|
|
26
|
+
}, ne = G(a.root, {
|
|
27
27
|
variants: {
|
|
28
28
|
size: {
|
|
29
29
|
sm: k(a.sm, C.bodyS),
|
|
@@ -43,85 +43,88 @@ import '../assets/index19.css';const U = "aub_styles-module_root_34a37", W = "au
|
|
|
43
43
|
variant: "primary",
|
|
44
44
|
block: !0
|
|
45
45
|
}
|
|
46
|
-
}), ce = (e, l,
|
|
47
|
-
if (!(
|
|
46
|
+
}), ce = (e, l, r) => {
|
|
47
|
+
if (!(r > 0) || l < e) return [];
|
|
48
48
|
if (l === e) return [{ value: e, offset: "0%" }];
|
|
49
|
-
const
|
|
50
|
-
return
|
|
51
|
-
const
|
|
52
|
-
return { value:
|
|
49
|
+
const i = Math.round((l - e) / r) + 1;
|
|
50
|
+
return i > 49 ? [] : Array.from({ length: i }, (c, m) => {
|
|
51
|
+
const o = e + m * r, u = (o - e) / (l - e) * 100;
|
|
52
|
+
return { value: o, offset: `${u}%` };
|
|
53
53
|
});
|
|
54
|
-
},
|
|
54
|
+
}, A = (e, l) => {
|
|
55
55
|
if (typeof e == "function") {
|
|
56
56
|
e(l);
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
59
|
e && (e.current = l);
|
|
60
60
|
}, me = ({ formatDetail: e }) => {
|
|
61
|
-
const l =
|
|
62
|
-
return !e || !l ? null : /* @__PURE__ */
|
|
63
|
-
},
|
|
61
|
+
const l = P(w);
|
|
62
|
+
return !e || !l ? null : /* @__PURE__ */ t("span", { className: a.detail, children: e(l.getThumbValue(0)) });
|
|
63
|
+
}, D = B(
|
|
64
64
|
({
|
|
65
65
|
size: e = "md",
|
|
66
66
|
variant: l = "primary",
|
|
67
|
-
value:
|
|
68
|
-
defaultValue:
|
|
69
|
-
onChange:
|
|
70
|
-
onBlur:
|
|
71
|
-
minValue:
|
|
72
|
-
maxValue:
|
|
73
|
-
step:
|
|
74
|
-
ticks:
|
|
75
|
-
formatValue:
|
|
76
|
-
formatDetail:
|
|
77
|
-
invalid:
|
|
67
|
+
value: r,
|
|
68
|
+
defaultValue: i,
|
|
69
|
+
onChange: c,
|
|
70
|
+
onBlur: m,
|
|
71
|
+
minValue: o = 0,
|
|
72
|
+
maxValue: u = 100,
|
|
73
|
+
step: b = 1,
|
|
74
|
+
ticks: _ = !0,
|
|
75
|
+
formatValue: n,
|
|
76
|
+
formatDetail: f,
|
|
77
|
+
invalid: d = !1,
|
|
78
78
|
disabled: S = !1,
|
|
79
79
|
block: g = !0,
|
|
80
|
-
className:
|
|
80
|
+
className: p,
|
|
81
81
|
dataTestId: N,
|
|
82
82
|
id: F,
|
|
83
|
-
ref:
|
|
84
|
-
"aria-label":
|
|
85
|
-
"aria-labelledby":
|
|
86
|
-
...
|
|
83
|
+
ref: y,
|
|
84
|
+
"aria-label": H,
|
|
85
|
+
"aria-labelledby": j,
|
|
86
|
+
...I
|
|
87
87
|
}) => {
|
|
88
|
-
const T =
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
const T = _ ? ce(o, u, b) : [], R = L(null);
|
|
89
|
+
return M(() => {
|
|
90
|
+
const s = R.current;
|
|
91
|
+
return s && d && s.setAttribute("aria-invalid", "true"), s && !d && s.removeAttribute("aria-invalid"), A(y, s), () => {
|
|
92
|
+
A(y, null);
|
|
93
|
+
};
|
|
94
|
+
}, [d, y]), /* @__PURE__ */ h(
|
|
95
|
+
$,
|
|
93
96
|
{
|
|
94
|
-
...
|
|
95
|
-
className: k(
|
|
96
|
-
value:
|
|
97
|
-
defaultValue:
|
|
98
|
-
onChange:
|
|
99
|
-
minValue:
|
|
100
|
-
maxValue:
|
|
101
|
-
step:
|
|
97
|
+
...I,
|
|
98
|
+
className: k(ne({ size: e, variant: l, block: g }), d && a.invalid, p),
|
|
99
|
+
value: r,
|
|
100
|
+
defaultValue: i,
|
|
101
|
+
onChange: c,
|
|
102
|
+
minValue: o,
|
|
103
|
+
maxValue: u,
|
|
104
|
+
step: b,
|
|
102
105
|
isDisabled: S,
|
|
103
|
-
"aria-label":
|
|
104
|
-
"aria-labelledby":
|
|
105
|
-
"data-invalid":
|
|
106
|
+
"aria-label": H,
|
|
107
|
+
"aria-labelledby": j,
|
|
108
|
+
"data-invalid": d || void 0,
|
|
106
109
|
"data-test-id": N,
|
|
107
110
|
children: [
|
|
108
111
|
/* @__PURE__ */ h("div", { className: a.readout, "aria-hidden": !0, children: [
|
|
109
|
-
/* @__PURE__ */
|
|
110
|
-
const z =
|
|
111
|
-
return
|
|
112
|
+
/* @__PURE__ */ t(x, { className: a.value, children: ({ state: s }) => {
|
|
113
|
+
const z = s.getThumbValue(0);
|
|
114
|
+
return n ? n(z) : z;
|
|
112
115
|
} }),
|
|
113
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ t(me, { formatDetail: f })
|
|
114
117
|
] }),
|
|
115
118
|
/* @__PURE__ */ h(O, { className: a.track, children: [
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
T.length > 0 ? /* @__PURE__ */
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
+
/* @__PURE__ */ t("div", { className: a.rail, children: /* @__PURE__ */ t(V, { className: a.fill }) }),
|
|
120
|
+
T.length > 0 ? /* @__PURE__ */ t("div", { className: a.ticks, "aria-hidden": !0, children: T.map((s) => /* @__PURE__ */ t("span", { className: a.tick, style: { left: s.offset } }, s.value)) }) : null,
|
|
121
|
+
/* @__PURE__ */ t(
|
|
119
122
|
q,
|
|
120
123
|
{
|
|
121
124
|
className: a.thumb,
|
|
122
125
|
id: F,
|
|
123
126
|
inputRef: R,
|
|
124
|
-
onBlur:
|
|
127
|
+
onBlur: m
|
|
125
128
|
}
|
|
126
129
|
)
|
|
127
130
|
] })
|
|
@@ -130,73 +133,73 @@ import '../assets/index19.css';const U = "aub_styles-module_root_34a37", W = "au
|
|
|
130
133
|
);
|
|
131
134
|
}
|
|
132
135
|
);
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
({ ref: e, value: l, onChange:
|
|
136
|
-
const { controlProps:
|
|
137
|
-
id:
|
|
138
|
-
"aria-describedby":
|
|
139
|
-
"aria-invalid":
|
|
140
|
-
"aria-labelledby":
|
|
141
|
-
} =
|
|
142
|
-
return /* @__PURE__ */
|
|
143
|
-
|
|
136
|
+
D.displayName = "Slider";
|
|
137
|
+
const E = B(
|
|
138
|
+
({ ref: e, value: l, onChange: r, "aria-label": i, ...c }) => {
|
|
139
|
+
const { controlProps: m, size: o, invalid: u, disabled: b } = J(), {
|
|
140
|
+
id: _,
|
|
141
|
+
"aria-describedby": n,
|
|
142
|
+
"aria-invalid": f,
|
|
143
|
+
"aria-labelledby": d
|
|
144
|
+
} = m;
|
|
145
|
+
return /* @__PURE__ */ t(
|
|
146
|
+
D,
|
|
144
147
|
{
|
|
145
|
-
...
|
|
148
|
+
...c,
|
|
146
149
|
ref: e,
|
|
147
|
-
id:
|
|
148
|
-
"aria-label":
|
|
149
|
-
"aria-labelledby":
|
|
150
|
-
"aria-describedby":
|
|
151
|
-
"aria-invalid":
|
|
152
|
-
size:
|
|
153
|
-
invalid:
|
|
154
|
-
disabled:
|
|
150
|
+
id: _,
|
|
151
|
+
"aria-label": i,
|
|
152
|
+
"aria-labelledby": i ? void 0 : d,
|
|
153
|
+
"aria-describedby": n,
|
|
154
|
+
"aria-invalid": f,
|
|
155
|
+
size: o,
|
|
156
|
+
invalid: u,
|
|
157
|
+
disabled: b,
|
|
155
158
|
value: l,
|
|
156
|
-
onChange:
|
|
159
|
+
onChange: r
|
|
157
160
|
}
|
|
158
161
|
);
|
|
159
162
|
}
|
|
160
163
|
);
|
|
161
|
-
|
|
164
|
+
E.displayName = "FormSliderControl";
|
|
162
165
|
const be = ({
|
|
163
166
|
name: e,
|
|
164
167
|
label: l,
|
|
165
|
-
hint:
|
|
166
|
-
size:
|
|
167
|
-
block:
|
|
168
|
-
disabled:
|
|
169
|
-
className:
|
|
170
|
-
dataTestId:
|
|
171
|
-
minValue:
|
|
172
|
-
...
|
|
168
|
+
hint: r,
|
|
169
|
+
size: i = "md",
|
|
170
|
+
block: c = !0,
|
|
171
|
+
disabled: m,
|
|
172
|
+
className: o,
|
|
173
|
+
dataTestId: u,
|
|
174
|
+
minValue: b = 0,
|
|
175
|
+
..._
|
|
173
176
|
}) => {
|
|
174
|
-
const { field:
|
|
177
|
+
const { field: n, fieldState: f, inputProps: d, setFieldValue: S, onBlurHandler: g } = K({ name: e }), p = Q(f.error)?.message, N = m ?? d.disabled, F = typeof n.value == "number" ? n.value : b;
|
|
175
178
|
return /* @__PURE__ */ h(
|
|
176
179
|
v,
|
|
177
180
|
{
|
|
178
|
-
invalid: !!
|
|
181
|
+
invalid: !!p,
|
|
179
182
|
disabled: N,
|
|
180
|
-
size:
|
|
181
|
-
block:
|
|
182
|
-
className:
|
|
183
|
-
dataTestId:
|
|
183
|
+
size: i,
|
|
184
|
+
block: c,
|
|
185
|
+
className: o,
|
|
186
|
+
dataTestId: u,
|
|
184
187
|
children: [
|
|
185
|
-
l ? /* @__PURE__ */
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
188
|
+
l ? /* @__PURE__ */ t(v.Label, { children: l }) : null,
|
|
189
|
+
/* @__PURE__ */ t(
|
|
190
|
+
E,
|
|
188
191
|
{
|
|
189
|
-
...
|
|
190
|
-
block:
|
|
191
|
-
minValue:
|
|
192
|
-
ref:
|
|
192
|
+
..._,
|
|
193
|
+
block: c,
|
|
194
|
+
minValue: b,
|
|
195
|
+
ref: n.ref,
|
|
193
196
|
value: F,
|
|
194
|
-
onChange: (
|
|
197
|
+
onChange: (y) => S(y),
|
|
195
198
|
onBlur: () => g()
|
|
196
199
|
}
|
|
197
200
|
),
|
|
198
|
-
|
|
199
|
-
/* @__PURE__ */
|
|
201
|
+
r ? /* @__PURE__ */ t(v.Hint, { children: r }) : null,
|
|
202
|
+
/* @__PURE__ */ t(v.Error, { children: p })
|
|
200
203
|
]
|
|
201
204
|
}
|
|
202
205
|
);
|
|
@@ -204,6 +207,6 @@ const be = ({
|
|
|
204
207
|
be.displayName = "FormSlider";
|
|
205
208
|
export {
|
|
206
209
|
be as FormSlider,
|
|
207
|
-
|
|
210
|
+
D as Slider
|
|
208
211
|
};
|
|
209
212
|
//# sourceMappingURL=index.js.map
|