@bikdotai/bik-component-library 0.0.868-beta.7 → 0.0.868-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/agent-builder/constants/tools.js +1 -1
- package/dist/cjs/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/cjs/components/button/themes.js +2 -2
- package/dist/cjs/components/button/themes.js.map +1 -1
- package/dist/cjs/components/schedule-builder/StartDateTimePicker.js +1 -1
- package/dist/cjs/components/schedule-builder/StartDateTimePicker.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/esm/components/agent-builder/constants/tools.d.ts +0 -1
- package/dist/esm/components/agent-builder/constants/tools.js +18 -18
- package/dist/esm/components/agent-builder/constants/tools.js.map +1 -1
- package/dist/esm/components/button/themes.js +2 -1
- package/dist/esm/components/button/themes.js.map +1 -1
- package/dist/esm/components/schedule-builder/StartDateTimePicker.d.ts +7 -0
- package/dist/esm/components/schedule-builder/StartDateTimePicker.js +1 -0
- package/dist/esm/components/schedule-builder/StartDateTimePicker.js.map +1 -1
- package/dist/esm/components/schedule-builder/index.d.ts +1 -0
- package/dist/esm/index.js +198 -196
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartDateTimePicker.js","sources":["../../../../src/components/schedule-builder/StartDateTimePicker.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { ComboBox } from '../combo-box';\nimport { DateButtonType, DatePickerWrapper } from '../datePicker';\nimport { Dropdown, DropdownOption, SingleOption } from '../dropdown';\nimport { BodySecondary } from '../TypographyStyle';\nimport {\n\tDateFieldColumn,\n\tDatePickerSlot,\n\tFieldLabel,\n\tFieldsRow,\n\tMeridiemDropdownSlot,\n\tRequiredMark,\n\tTimeDropdownSlot,\n\tTimeFieldColumn,\n\tTimeInputRow,\n} from './ScheduleBuilder.styled';\n\n/** Step between offered times, in minutes. */\nconst TIME_STEP_MINUTES = 30;\n\n/**\n * Reads a typed 12-hour time.\n *\n * Accepts \"9\", \"9:5\" and \"09:05\" so the merchant can type naturally; am/pm sits\n * on its own dropdown, so only 1-12 is valid here. Returns null while the text is\n * incomplete, which is what keeps the field editable mid-entry.\n */\nexport const parseTimeText = (\n\ttext: string,\n): { hours: string; minutes: string } | null => {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return null;\n\n\tconst match = trimmed.match(/^(\\d{1,2})(?::(\\d{1,2}))?$/);\n\tif (!match) return null;\n\n\tconst hours = Number(match[1]);\n\t// Minutes are optional: \"9\" means 9:00.\n\tconst minutes = match[2] === undefined ? 0 : Number(match[2]);\n\n\tif (hours < 1 || hours > 12) return null;\n\tif (minutes > 59) return null;\n\n\treturn { hours: String(hours), minutes: String(minutes) };\n};\n\nexport interface StartDateTimePickerProps {\n\t/** The chosen date. Time-of-day is carried separately by hours/minutes/isAm. */\n\tdate?: Date;\n\tonDateChange: (date: Date) => void;\n\t/** 12-hour clock, \"1\"–\"12\". Empty string while nothing is chosen. */\n\thours: string;\n\t/** \"0\"–\"59\". Empty string while nothing is chosen. */\n\tminutes: string;\n\tisAm: boolean;\n\t/** Fires only for a parseable time, so partial typing does not clear state. */\n\tonTimeChange: (time: { hours: string; minutes: string }) => void;\n\tonMeridiemChange: (isAm: boolean) => void;\n\t/** Called when focus leaves an unparseable time, for the caller to validate. */\n\tonTimeInvalidBlur?: () => void;\n\t/** Shown under the time field. The caller owns validation. */\n\ttimeErrorMessage?: string;\n\t/** \"Start date\" when a recurrence follows, plain \"Date\" otherwise. */\n\tdateLabel?: string;\n\tminDate?: Date;\n\t'data-test'?: string;\n}\n\n/**\n * The start date and time-of-day row.\n *\n * Date and time are separate props rather than one Date because the time is\n * edited as text and can be mid-entry (\"9:\" is not a time yet) — folding it into\n * a Date would force a guess about what an incomplete entry means.\n */\nexport const StartDateTimePicker: React.FC<StartDateTimePickerProps> = ({\n\tdate,\n\tonDateChange,\n\thours,\n\tminutes,\n\tisAm,\n\tonTimeChange,\n\tonMeridiemChange,\n\tonTimeInvalidBlur,\n\ttimeErrorMessage,\n\tdateLabel = 'Start date',\n\tminDate,\n\t'data-test': dataTest,\n}) => {\n\t/**\n\t * Times offered in the picker, at TIME_STEP_MINUTES steps. 12 leads the day in\n\t * 12-hour time, so it sorts to the front rather than after 11.\n\t */\n\tconst timeOptions = useMemo(() => {\n\t\tconst values: string[] = [];\n\t\tfor (let hour = 1; hour <= 12; hour += 1) {\n\t\t\tfor (let minute = 0; minute < 60; minute += TIME_STEP_MINUTES) {\n\t\t\t\tvalues.push(`${hour}:${String(minute).padStart(2, '0')}`);\n\t\t\t}\n\t\t}\n\t\tconst twelves = values.filter((value) => value.startsWith('12:'));\n\t\treturn [\n\t\t\t...twelves,\n\t\t\t...values.filter((value) => !twelves.includes(value)),\n\t\t].map((value) => ({ value }));\n\t}, []);\n\n\tconst selectedTimeLabel =\n\t\thours !== '' && minutes !== ''\n\t\t\t? `${hours}:${String(minutes).padStart(2, '0')}`\n\t\t\t: undefined;\n\n\tconst meridiemDropdownOptions: SingleOption[] = [\n\t\t{ label: 'AM', value: 'am', selected: isAm },\n\t\t{ label: 'PM', value: 'pm', selected: !isAm },\n\t];\n\n\treturn (\n\t\t<FieldsRow data-test={dataTest}>\n\t\t\t<DateFieldColumn>\n\t\t\t\t<FieldLabel>\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t{dateLabel}\n\t\t\t\t\t\t<RequiredMark> *</RequiredMark>\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</FieldLabel>\n\t\t\t\t<DatePickerSlot>\n\t\t\t\t\t<DatePickerWrapper\n\t\t\t\t\t\tval={date}\n\t\t\t\t\t\tonChange={(value: Date | Date[]) => {\n\t\t\t\t\t\t\tconst dateValue = Array.isArray(value) ? value[0] : value;\n\t\t\t\t\t\t\tif (dateValue) onDateChange(dateValue);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisplayFormat=\"dd MMM yyyy\"\n\t\t\t\t\t\tdateButtonType={DateButtonType.LARGE}\n\t\t\t\t\t\tcalendarProps={{ minDate }}\n\t\t\t\t\t\tpickerStyles={{ top: 8, zIndex: 4 }}\n\t\t\t\t\t/>\n\t\t\t\t</DatePickerSlot>\n\t\t\t</DateFieldColumn>\n\t\t\t<TimeFieldColumn>\n\t\t\t\t<FieldLabel>\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\tTime\n\t\t\t\t\t\t<RequiredMark> *</RequiredMark>\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</FieldLabel>\n\t\t\t\t{/*\n Top-aligned: the time field's error message sits inside its own slot,\n so centring would drop AM/PM as the message appears.\n */}\n\t\t\t\t<TimeInputRow>\n\t\t\t\t\t<TimeDropdownSlot>\n\t\t\t\t\t\t<ComboBox\n\t\t\t\t\t\t\tdata-test=\"recurrence-time\"\n\t\t\t\t\t\t\tvalue={selectedTimeLabel ?? ''}\n\t\t\t\t\t\t\toptions={timeOptions}\n\t\t\t\t\t\t\tplaceholder=\"hh:mm\"\n\t\t\t\t\t\t\terrorMessage={timeErrorMessage || undefined}\n\t\t\t\t\t\t\tvalidate={(text) => !!parseTimeText(text)}\n\t\t\t\t\t\t\tsanitize={(text) => text.replace(/[^\\d:]/g, '').slice(0, 5)}\n\t\t\t\t\t\t\tformat={(text) => {\n\t\t\t\t\t\t\t\tconst parsed = parseTimeText(text);\n\t\t\t\t\t\t\t\tif (!parsed) return text;\n\t\t\t\t\t\t\t\treturn `${parsed.hours}:${parsed.minutes.padStart(2, '0')}`;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonChange={(text) => {\n\t\t\t\t\t\t\t\tconst parsed = parseTimeText(text);\n\t\t\t\t\t\t\t\tif (!parsed) return;\n\t\t\t\t\t\t\t\tonTimeChange(parsed);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonInvalidBlur={onTimeInvalidBlur}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TimeDropdownSlot>\n\t\t\t\t\t<MeridiemDropdownSlot data-test=\"recurrence-meridiem\">\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tsize=\"default\"\n\t\t\t\t\t\t\tisSearchable={false}\n\t\t\t\t\t\t\tisMultiSelect={false}\n\t\t\t\t\t\t\toptions={meridiemDropdownOptions}\n\t\t\t\t\t\t\tvalue={isAm ? 'AM' : 'PM'}\n\t\t\t\t\t\t\tbuttonWidth=\"100%\"\n\t\t\t\t\t\t\twidth=\"84px\"\n\t\t\t\t\t\t\tplaceHolderHeight=\"48px\"\n\t\t\t\t\t\t\tplaceHolder=\"AM\"\n\t\t\t\t\t\t\tonSelect={(\n\t\t\t\t\t\t\t\tselected: DropdownOption | DropdownOption[] | null,\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tconst normalized = (\n\t\t\t\t\t\t\t\t\tArray.isArray(selected) ? selected[0] : selected\n\t\t\t\t\t\t\t\t) as SingleOption | null;\n\t\t\t\t\t\t\t\tonMeridiemChange(normalized?.value !== 'pm');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MeridiemDropdownSlot>\n\t\t\t\t</TimeInputRow>\n\t\t\t</TimeFieldColumn>\n\t\t</FieldsRow>\n\t);\n};\n"],"names":["TIME_STEP_MINUTES","parseTimeText","text","trimmed","match","hours","minutes","StartDateTimePicker","date","onDateChange","isAm","onTimeChange","onMeridiemChange","onTimeInvalidBlur","timeErrorMessage","dateLabel","minDate","dataTest","timeOptions","useMemo","values","hour","minute","twelves","value","selectedTimeLabel","meridiemDropdownOptions","jsxs","FieldsRow","DateFieldColumn","jsx","FieldLabel","BodySecondary","COLORS","RequiredMark","DatePickerSlot","DatePickerWrapper","dateValue","DateButtonType","TimeFieldColumn","TimeInputRow","TimeDropdownSlot","ComboBox","parsed","MeridiemDropdownSlot","Dropdown","selected","normalized"],"mappings":";;;;;;;;;AAmBA,MAAMA,IAAoB,IAS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AA;AAAA,YACA,aAAU;AAAA,YACV,OAAOjB,KAAqB;AAAA,YAC5B,SAASP;AAAA,YACT,aAAY;AAAA,YACZ,cAAcJ,KAAoB;AAAA,YAClC,UAAU,CAACZ,MAAS,CAAC,CAACD,EAAcC,CAAI;AAAA,YACxC,UAAU,CAACA,MAASA,EAAK,QAAQ,WAAW,EAAE,EAAE,MAAM,GAAG,CAAC;AAAA,YAC1D,QAAQ,CAACA,MAAS;AACjB,oBAAMyC,IAAS1C,EAAcC,CAAI;AACjC,qBAAKyC,IACE,GAAGA,EAAO,KAAK,IAAIA,EAAO,QAAQ,SAAS,GAAG,GAAG,CAAC,KADrCzC;AAAA,YAErB;AAAA,YACA,UAAU,CAACA,MAAS;AACnB,oBAAMyC,IAAS1C,EAAcC,CAAI;AACjC,cAAKyC,KACLhC,EAAagC,CAAM;AAAA,YACpB;AAAA,YACA,eAAe9B;AAAA,UAAA;AAAA,QAAA,GAEjB;AAAA,QACA,gBAAAiB,EAACc,GAAA,EAAqB,aAAU,uBAC/B,UAAA,gBAAAd;AAAA,UAACe;AAAA,UAAA;AAAA,YACA,MAAK;AAAA,YACL,cAAc;AAAA,YACd,eAAe;AAAA,YACf,SAASnB;AAAA,YACT,OAAOhB,IAAO,OAAO;AAAA,YACrB,aAAY;AAAA,YACZ,OAAM;AAAA,YACN,mBAAkB;AAAA,YAClB,aAAY;AAAA,YACZ,UAAU,CACToC,MACI;AACJ,oBAAMC,IACL,MAAM,QAAQD,CAAQ,IAAIA,EAAS,CAAC,IAAIA;AAEzC,cAAAlC,EAAiBmC,GAAY,UAAU,IAAI;AAAA,YAC5C;AAAA,UAAA;AAAA,QAAA,EACD,CACD;AAAA,MAAA,EAAA,CACD;AAAA,IAAA,EAAA,CACD;AAAA,EAAA,GACD;AAEF;"}
|
|
1
|
+
{"version":3,"file":"StartDateTimePicker.js","sources":["../../../../src/components/schedule-builder/StartDateTimePicker.tsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { COLORS } from '../../constants/Theme';\nimport { ComboBox } from '../combo-box';\nimport { DateButtonType, DatePickerWrapper } from '../datePicker';\nimport { Dropdown, DropdownOption, SingleOption } from '../dropdown';\nimport { BodySecondary } from '../TypographyStyle';\nimport {\n\tDateFieldColumn,\n\tDatePickerSlot,\n\tFieldLabel,\n\tFieldsRow,\n\tMeridiemDropdownSlot,\n\tRequiredMark,\n\tTimeDropdownSlot,\n\tTimeFieldColumn,\n\tTimeInputRow,\n} from './ScheduleBuilder.styled';\n\n/**\n * Step between offered times, in minutes.\n *\n * Exported because a host seeding a default time has to round onto the same step\n * — otherwise the seeded value is not one of the options the dropdown offers.\n */\nexport const TIME_STEP_MINUTES = 30;\n\n/**\n * Reads a typed 12-hour time.\n *\n * Accepts \"9\", \"9:5\" and \"09:05\" so the merchant can type naturally; am/pm sits\n * on its own dropdown, so only 1-12 is valid here. Returns null while the text is\n * incomplete, which is what keeps the field editable mid-entry.\n */\nexport const parseTimeText = (\n\ttext: string,\n): { hours: string; minutes: string } | null => {\n\tconst trimmed = text.trim();\n\tif (!trimmed) return null;\n\n\tconst match = trimmed.match(/^(\\d{1,2})(?::(\\d{1,2}))?$/);\n\tif (!match) return null;\n\n\tconst hours = Number(match[1]);\n\t// Minutes are optional: \"9\" means 9:00.\n\tconst minutes = match[2] === undefined ? 0 : Number(match[2]);\n\n\tif (hours < 1 || hours > 12) return null;\n\tif (minutes > 59) return null;\n\n\treturn { hours: String(hours), minutes: String(minutes) };\n};\n\nexport interface StartDateTimePickerProps {\n\t/** The chosen date. Time-of-day is carried separately by hours/minutes/isAm. */\n\tdate?: Date;\n\tonDateChange: (date: Date) => void;\n\t/** 12-hour clock, \"1\"–\"12\". Empty string while nothing is chosen. */\n\thours: string;\n\t/** \"0\"–\"59\". Empty string while nothing is chosen. */\n\tminutes: string;\n\tisAm: boolean;\n\t/** Fires only for a parseable time, so partial typing does not clear state. */\n\tonTimeChange: (time: { hours: string; minutes: string }) => void;\n\tonMeridiemChange: (isAm: boolean) => void;\n\t/** Called when focus leaves an unparseable time, for the caller to validate. */\n\tonTimeInvalidBlur?: () => void;\n\t/** Shown under the time field. The caller owns validation. */\n\ttimeErrorMessage?: string;\n\t/** \"Start date\" when a recurrence follows, plain \"Date\" otherwise. */\n\tdateLabel?: string;\n\tminDate?: Date;\n\t'data-test'?: string;\n}\n\n/**\n * The start date and time-of-day row.\n *\n * Date and time are separate props rather than one Date because the time is\n * edited as text and can be mid-entry (\"9:\" is not a time yet) — folding it into\n * a Date would force a guess about what an incomplete entry means.\n */\nexport const StartDateTimePicker: React.FC<StartDateTimePickerProps> = ({\n\tdate,\n\tonDateChange,\n\thours,\n\tminutes,\n\tisAm,\n\tonTimeChange,\n\tonMeridiemChange,\n\tonTimeInvalidBlur,\n\ttimeErrorMessage,\n\tdateLabel = 'Start date',\n\tminDate,\n\t'data-test': dataTest,\n}) => {\n\t/**\n\t * Times offered in the picker, at TIME_STEP_MINUTES steps. 12 leads the day in\n\t * 12-hour time, so it sorts to the front rather than after 11.\n\t */\n\tconst timeOptions = useMemo(() => {\n\t\tconst values: string[] = [];\n\t\tfor (let hour = 1; hour <= 12; hour += 1) {\n\t\t\tfor (let minute = 0; minute < 60; minute += TIME_STEP_MINUTES) {\n\t\t\t\tvalues.push(`${hour}:${String(minute).padStart(2, '0')}`);\n\t\t\t}\n\t\t}\n\t\tconst twelves = values.filter((value) => value.startsWith('12:'));\n\t\treturn [\n\t\t\t...twelves,\n\t\t\t...values.filter((value) => !twelves.includes(value)),\n\t\t].map((value) => ({ value }));\n\t}, []);\n\n\tconst selectedTimeLabel =\n\t\thours !== '' && minutes !== ''\n\t\t\t? `${hours}:${String(minutes).padStart(2, '0')}`\n\t\t\t: undefined;\n\n\tconst meridiemDropdownOptions: SingleOption[] = [\n\t\t{ label: 'AM', value: 'am', selected: isAm },\n\t\t{ label: 'PM', value: 'pm', selected: !isAm },\n\t];\n\n\treturn (\n\t\t<FieldsRow data-test={dataTest}>\n\t\t\t<DateFieldColumn>\n\t\t\t\t<FieldLabel>\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\t{dateLabel}\n\t\t\t\t\t\t<RequiredMark> *</RequiredMark>\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</FieldLabel>\n\t\t\t\t<DatePickerSlot>\n\t\t\t\t\t<DatePickerWrapper\n\t\t\t\t\t\tval={date}\n\t\t\t\t\t\tonChange={(value: Date | Date[]) => {\n\t\t\t\t\t\t\tconst dateValue = Array.isArray(value) ? value[0] : value;\n\t\t\t\t\t\t\tif (dateValue) onDateChange(dateValue);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tdisplayFormat=\"dd MMM yyyy\"\n\t\t\t\t\t\tdateButtonType={DateButtonType.LARGE}\n\t\t\t\t\t\tcalendarProps={{ minDate }}\n\t\t\t\t\t\tpickerStyles={{ top: 8, zIndex: 4 }}\n\t\t\t\t\t/>\n\t\t\t\t</DatePickerSlot>\n\t\t\t</DateFieldColumn>\n\t\t\t<TimeFieldColumn>\n\t\t\t\t<FieldLabel>\n\t\t\t\t\t<BodySecondary color={COLORS.content.primary}>\n\t\t\t\t\t\tTime\n\t\t\t\t\t\t<RequiredMark> *</RequiredMark>\n\t\t\t\t\t</BodySecondary>\n\t\t\t\t</FieldLabel>\n\t\t\t\t{/*\n Top-aligned: the time field's error message sits inside its own slot,\n so centring would drop AM/PM as the message appears.\n */}\n\t\t\t\t<TimeInputRow>\n\t\t\t\t\t<TimeDropdownSlot>\n\t\t\t\t\t\t<ComboBox\n\t\t\t\t\t\t\tdata-test=\"recurrence-time\"\n\t\t\t\t\t\t\tvalue={selectedTimeLabel ?? ''}\n\t\t\t\t\t\t\toptions={timeOptions}\n\t\t\t\t\t\t\tplaceholder=\"hh:mm\"\n\t\t\t\t\t\t\terrorMessage={timeErrorMessage || undefined}\n\t\t\t\t\t\t\tvalidate={(text) => !!parseTimeText(text)}\n\t\t\t\t\t\t\tsanitize={(text) => text.replace(/[^\\d:]/g, '').slice(0, 5)}\n\t\t\t\t\t\t\tformat={(text) => {\n\t\t\t\t\t\t\t\tconst parsed = parseTimeText(text);\n\t\t\t\t\t\t\t\tif (!parsed) return text;\n\t\t\t\t\t\t\t\treturn `${parsed.hours}:${parsed.minutes.padStart(2, '0')}`;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonChange={(text) => {\n\t\t\t\t\t\t\t\tconst parsed = parseTimeText(text);\n\t\t\t\t\t\t\t\tif (!parsed) return;\n\t\t\t\t\t\t\t\tonTimeChange(parsed);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tonInvalidBlur={onTimeInvalidBlur}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</TimeDropdownSlot>\n\t\t\t\t\t<MeridiemDropdownSlot data-test=\"recurrence-meridiem\">\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tsize=\"default\"\n\t\t\t\t\t\t\tisSearchable={false}\n\t\t\t\t\t\t\tisMultiSelect={false}\n\t\t\t\t\t\t\toptions={meridiemDropdownOptions}\n\t\t\t\t\t\t\tvalue={isAm ? 'AM' : 'PM'}\n\t\t\t\t\t\t\tbuttonWidth=\"100%\"\n\t\t\t\t\t\t\twidth=\"84px\"\n\t\t\t\t\t\t\tplaceHolderHeight=\"48px\"\n\t\t\t\t\t\t\tplaceHolder=\"AM\"\n\t\t\t\t\t\t\tonSelect={(\n\t\t\t\t\t\t\t\tselected: DropdownOption | DropdownOption[] | null,\n\t\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\t\tconst normalized = (\n\t\t\t\t\t\t\t\t\tArray.isArray(selected) ? selected[0] : selected\n\t\t\t\t\t\t\t\t) as SingleOption | null;\n\t\t\t\t\t\t\t\tonMeridiemChange(normalized?.value !== 'pm');\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</MeridiemDropdownSlot>\n\t\t\t\t</TimeInputRow>\n\t\t\t</TimeFieldColumn>\n\t\t</FieldsRow>\n\t);\n};\n"],"names":["TIME_STEP_MINUTES","parseTimeText","text","trimmed","match","hours","minutes","StartDateTimePicker","date","onDateChange","isAm","onTimeChange","onMeridiemChange","onTimeInvalidBlur","timeErrorMessage","dateLabel","minDate","dataTest","timeOptions","useMemo","values","hour","minute","twelves","value","selectedTimeLabel","meridiemDropdownOptions","jsxs","FieldsRow","DateFieldColumn","jsx","FieldLabel","BodySecondary","COLORS","RequiredMark","DatePickerSlot","DatePickerWrapper","dateValue","DateButtonType","TimeFieldColumn","TimeInputRow","TimeDropdownSlot","ComboBox","parsed","MeridiemDropdownSlot","Dropdown","selected","normalized"],"mappings":";;;;;;;;;AAwBO,MAAMA,IAAoB,IASpBC,IAAgB,CAC5BC,MAC+C;AAC/C,QAAMC,IAAUD,EAAK,KAAA;AACrB,MAAI,CAACC,EAAS,QAAO;AAErB,QAAMC,IAAQD,EAAQ,MAAM,4BAA4B;AACxD,MAAI,CAACC,EAAO,QAAO;AAEnB,QAAMC,IAAQ,OAAOD,EAAM,CAAC,CAAC,GAEvBE,IAAUF,EAAM,CAAC,MAAM,SAAY,IAAI,OAAOA,EAAM,CAAC,CAAC;AAG5D,SADIC,IAAQ,KAAKA,IAAQ,MACrBC,IAAU,KAAW,OAElB,EAAE,OAAO,OAAOD,CAAK,GAAG,SAAS,OAAOC,CAAO,EAAA;AACvD,GA+BaC,IAA0D,CAAC;AAAA,EACvE,MAAAC;AAAA,EACA,cAAAC;AAAA,EACA,OAAAJ;AAAA,EACA,SAAAC;AAAA,EACA,MAAAI;AAAA,EACA,cAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,mBAAAC;AAAA,EACA,kBAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,SAAAC;AAAA,EACA,aAAaC;AACd,MAAM;AAKL,QAAMC,IAAcC,EAAQ,MAAM;AACjC,UAAMC,IAAmB,CAAA;AACzB,aAASC,IAAO,GAAGA,KAAQ,IAAIA,KAAQ;AACtC,eAASC,IAAS,GAAGA,IAAS,IAAIA,KAAUtB;AAC3C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BAAkB;AAAA,YAClB,aAAY;AAAA,YACZ,UAAU,CACToC,MACI;AACJ,oBAAMC,IACL,MAAM,QAAQD,CAAQ,IAAIA,EAAS,CAAC,IAAIA;AAEzC,cAAAlC,EAAiBmC,GAAY,UAAU,IAAI;AAAA,YAC5C;AAAA,UAAA;AAAA,QAAA,EACD,CACD;AAAA,MAAA,EAAA,CACD;AAAA,IAAA,EAAA,CACD;AAAA,EAAA,GACD;AAEF;"}
|
|
@@ -11,6 +11,7 @@ export * from './ScheduleHelper';
|
|
|
11
11
|
export type { ScheduleBuilderProps } from './ScheduleBuilder';
|
|
12
12
|
export type { SendModeSelectorProps, SendModeItem } from './SendModeSelector';
|
|
13
13
|
export type { StartDateTimePickerProps } from './StartDateTimePicker';
|
|
14
|
+
export { TIME_STEP_MINUTES, parseTimeText } from './StartDateTimePicker';
|
|
14
15
|
export type { ScheduleFrequencyPickerProps } from './ScheduleFrequencyPicker';
|
|
15
16
|
export type { ScheduleEndPickerProps } from './ScheduleEndPicker';
|
|
16
17
|
export type { UpcomingRunsPreviewProps } from './UpcomingRunsPreview';
|