@pega/cosmos-react-core 3.0.0-dev.27.1 → 3.0.0-dev.29.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/lib/components/AppShell/AppShellList.d.ts +2 -2
- package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
- package/lib/components/AppShell/AppShellList.js.map +1 -1
- package/lib/components/Badges/Count.d.ts.map +1 -1
- package/lib/components/Badges/Count.js +37 -1
- package/lib/components/Badges/Count.js.map +1 -1
- package/lib/components/Badges/Keyboard.d.ts +2 -2
- package/lib/components/Badges/Keyboard.d.ts.map +1 -1
- package/lib/components/Badges/Keyboard.js +1 -0
- package/lib/components/Badges/Keyboard.js.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts +1 -1
- package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
- package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
- package/lib/components/DateTime/DateTime.types.d.ts +13 -9
- package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
- package/lib/components/DateTime/DateTime.types.js.map +1 -1
- package/lib/components/DateTime/Input/DateInput.d.ts +6 -2
- package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateInput.js +11 -10
- package/lib/components/DateTime/Input/DateInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.d.ts +16 -29
- package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateRangeInput.js +95 -82
- package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/DateTimeInput.js +3 -2
- package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
- package/lib/components/DateTime/Input/TimeInput.js +3 -2
- package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts +46 -0
- package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -0
- package/lib/components/DateTime/Input/TimeRangeInput.js +74 -0
- package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -0
- package/lib/components/DateTime/Input/WeekInput.js +2 -2
- package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
- package/lib/components/DateTime/Picker/Calendar.js +1 -1
- package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -1
- package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
- package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
- package/lib/components/DateTime/index.d.ts +2 -0
- package/lib/components/DateTime/index.d.ts.map +1 -1
- package/lib/components/DateTime/index.js +1 -0
- package/lib/components/DateTime/index.js.map +1 -1
- package/lib/components/FieldValueList/FieldValueList.js +1 -1
- package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
- package/lib/components/File/utils.d.ts +1 -1
- package/lib/components/File/utils.d.ts.map +1 -1
- package/lib/components/File/utils.js.map +1 -1
- package/lib/components/Flex/Flex.d.ts +11 -10
- package/lib/components/Flex/Flex.d.ts.map +1 -1
- package/lib/components/Flex/Flex.js.map +1 -1
- package/lib/components/Grid/Grid.d.ts +1 -1
- package/lib/components/Grid/Grid.d.ts.map +1 -1
- package/lib/components/Grid/Grid.types.d.ts +11 -10
- package/lib/components/Grid/Grid.types.d.ts.map +1 -1
- package/lib/components/Grid/Grid.types.js.map +1 -1
- package/lib/components/HTML/HTML.d.ts.map +1 -1
- package/lib/components/HTML/HTML.js +8 -2
- package/lib/components/HTML/HTML.js.map +1 -1
- package/lib/components/Input/Input.styles.d.ts +1 -0
- package/lib/components/Input/Input.styles.d.ts.map +1 -1
- package/lib/components/Input/Input.styles.js +31 -0
- package/lib/components/Input/Input.styles.js.map +1 -1
- package/lib/components/Link/Link.d.ts +4 -1
- package/lib/components/Link/Link.d.ts.map +1 -1
- package/lib/components/Link/Link.js +37 -9
- package/lib/components/Link/Link.js.map +1 -1
- package/lib/components/List/List.d.ts +1 -1
- package/lib/components/List/List.d.ts.map +1 -1
- package/lib/components/List/List.js.map +1 -1
- package/lib/components/Location/LocationInput.d.ts +1 -1
- package/lib/components/Location/LocationInput.d.ts.map +1 -1
- package/lib/components/Location/LocationInput.js.map +1 -1
- package/lib/components/Location/LocationView.d.ts +1 -1
- package/lib/components/Location/LocationView.d.ts.map +1 -1
- package/lib/components/Location/LocationView.js +16 -10
- package/lib/components/Location/LocationView.js.map +1 -1
- package/lib/components/Location/utils.d.ts +3 -2
- package/lib/components/Location/utils.d.ts.map +1 -1
- package/lib/components/Location/utils.js +17 -9
- package/lib/components/Location/utils.js.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +1 -2
- package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -1
- package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -1
- package/lib/components/Number/NumberInput.d.ts +1 -1
- package/lib/components/Number/NumberInput.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.js +4 -4
- package/lib/components/Number/NumberInput.js.map +1 -1
- package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.styles.js +2 -0
- package/lib/components/Number/NumberInput.styles.js.map +1 -1
- package/lib/components/Number/NumberInput.types.d.ts +54 -20
- package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
- package/lib/components/Number/NumberInput.types.js.map +1 -1
- package/lib/components/Number/NumberRangeInput.d.ts +6 -0
- package/lib/components/Number/NumberRangeInput.d.ts.map +1 -0
- package/lib/components/Number/NumberRangeInput.js +30 -0
- package/lib/components/Number/NumberRangeInput.js.map +1 -0
- package/lib/components/Number/index.d.ts +3 -2
- package/lib/components/Number/index.d.ts.map +1 -1
- package/lib/components/Number/index.js +1 -0
- package/lib/components/Number/index.js.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.d.ts +3 -3
- package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +1 -2
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +1 -0
- package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
- package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
- package/lib/components/RadioCheckGroup/index.d.ts +1 -1
- package/lib/components/RadioCheckGroup/index.d.ts.map +1 -1
- package/lib/components/RadioCheckGroup/index.js +1 -1
- package/lib/components/RadioCheckGroup/index.js.map +1 -1
- package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
- package/lib/components/SearchInput/SearchInput.js +13 -8
- package/lib/components/SearchInput/SearchInput.js.map +1 -1
- package/lib/components/Slider/Slider.styles.d.ts +1 -1
- package/lib/components/SummaryItem/SummaryItem.d.ts +2 -2
- package/lib/components/Tabs/Tabs.d.ts.map +1 -1
- package/lib/components/Tabs/Tabs.js +1 -1
- package/lib/components/Tabs/Tabs.js.map +1 -1
- package/lib/hooks/useI18n.d.ts +15 -1
- package/lib/hooks/useI18n.d.ts.map +1 -1
- package/lib/hooks/useOS.d.ts.map +1 -1
- package/lib/hooks/useOS.js +1 -2
- package/lib/hooks/useOS.js.map +1 -1
- package/lib/i18n/default.d.ts +15 -1
- package/lib/i18n/default.d.ts.map +1 -1
- package/lib/i18n/default.js +18 -2
- package/lib/i18n/default.js.map +1 -1
- package/lib/i18n/i18n.d.ts +15 -1
- package/lib/i18n/i18n.d.ts.map +1 -1
- package/lib/theme/themes/buildTheme.json +0 -3
- package/lib/theme/themes/legacyBuildTheme.json +0 -3
- package/lib/types/types.d.ts +3 -0
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/package.json +2 -2
- package/lib/components/DateTime/types.d.ts +0 -9
- package/lib/components/DateTime/types.d.ts.map +0 -1
- package/lib/components/DateTime/types.js +0 -2
- package/lib/components/DateTime/types.js.map +0 -1
|
@@ -3,6 +3,7 @@ export { default as WeekInput } from './Input/WeekInput';
|
|
|
3
3
|
export { default as MonthInput } from './Input/MonthInput';
|
|
4
4
|
export { default as TimeInput } from './Input/TimeInput';
|
|
5
5
|
export { default as DateRangeInput } from './Input/DateRangeInput';
|
|
6
|
+
export { default as TimeRangeInput } from './Input/TimeRangeInput';
|
|
6
7
|
export { default as DurationInput } from './Input/Duration/DurationInput';
|
|
7
8
|
export { Format } from './Input/Duration/DurationInput.types';
|
|
8
9
|
export { default as DateTimeInput } from './Input/DateTimeInput';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default as DateInput } from './Input/DateInput';\nexport type { DateInputProps } from './Input/DateInput';\nexport { default as WeekInput } from './Input/WeekInput';\nexport type { WeekInputProps } from './Input/WeekInput';\nexport { default as MonthInput } from './Input/MonthInput';\nexport type { MonthInputProps } from './Input/MonthInput';\nexport { default as TimeInput } from './Input/TimeInput';\nexport type { TimeInputProps } from './Input/TimeInput';\nexport { default as DateRangeInput } from './Input/DateRangeInput';\nexport type { DateRangeInputProps } from './Input/DateRangeInput';\nexport { default as DurationInput } from './Input/Duration/DurationInput';\nexport type { default as DurationInputProps } from './Input/Duration/DurationInput.types';\nexport { Format } from './Input/Duration/DurationInput.types';\nexport { default as DateTimeInput } from './Input/DateTimeInput';\nexport type { DateTimeInputProps } from './Input/DateTimeInput';\nexport { default as DayOfWeekInput } from './Input/DayOfWeekInput';\nexport type { DayOfWeekInputProps } from './Input/DayOfWeekInput';\nexport { default as QuarterInput } from './Input/QuarterInput';\nexport type { QuarterInputProps } from './Input/QuarterInput';\n\nexport { default as TimePicker } from './Picker/TimePicker';\nexport type { TimePickerProps } from './Picker/TimePicker';\nexport { default as DatePicker } from './Picker/DatePicker';\nexport type { default as DatePickerProps } from './Picker/DatePicker.types';\n\nexport { default as DateTimeDisplay } from './DateTimeDisplay';\nexport type { DateTimeDisplayProps } from './DateTimeDisplay';\nexport { default as DurationDisplay } from './DurationDisplay';\nexport type { DurationDisplayProps } from './DurationDisplay';\nexport { formatDateTime, formatDuration } from './utils';\nexport { parseToDate } from './Input/utils';\nexport { isValidDate } from './Picker/utils';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateTime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEzD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAE1E,OAAO,EAAE,MAAM,EAAE,MAAM,sCAAsC,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAEnE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAG/D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE5D,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAG5D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC","sourcesContent":["export { default as DateInput } from './Input/DateInput';\nexport type { DateInputProps } from './Input/DateInput';\nexport { default as WeekInput } from './Input/WeekInput';\nexport type { WeekInputProps } from './Input/WeekInput';\nexport { default as MonthInput } from './Input/MonthInput';\nexport type { MonthInputProps } from './Input/MonthInput';\nexport { default as TimeInput } from './Input/TimeInput';\nexport type { TimeInputProps } from './Input/TimeInput';\nexport { default as DateRangeInput } from './Input/DateRangeInput';\nexport type { DateRangeInputProps } from './Input/DateRangeInput';\nexport { default as TimeRangeInput } from './Input/TimeRangeInput';\nexport type { TimeRangeInputProps } from './Input/TimeRangeInput';\nexport { default as DurationInput } from './Input/Duration/DurationInput';\nexport type { default as DurationInputProps } from './Input/Duration/DurationInput.types';\nexport { Format } from './Input/Duration/DurationInput.types';\nexport { default as DateTimeInput } from './Input/DateTimeInput';\nexport type { DateTimeInputProps } from './Input/DateTimeInput';\nexport { default as DayOfWeekInput } from './Input/DayOfWeekInput';\nexport type { DayOfWeekInputProps } from './Input/DayOfWeekInput';\nexport { default as QuarterInput } from './Input/QuarterInput';\nexport type { QuarterInputProps } from './Input/QuarterInput';\n\nexport { default as TimePicker } from './Picker/TimePicker';\nexport type { TimePickerProps } from './Picker/TimePicker';\nexport { default as DatePicker } from './Picker/DatePicker';\nexport type { default as DatePickerProps } from './Picker/DatePicker.types';\n\nexport { default as DateTimeDisplay } from './DateTimeDisplay';\nexport type { DateTimeDisplayProps } from './DateTimeDisplay';\nexport { default as DurationDisplay } from './DurationDisplay';\nexport type { DurationDisplayProps } from './DurationDisplay';\nexport { formatDateTime, formatDuration } from './utils';\nexport { parseToDate } from './Input/utils';\nexport { isValidDate } from './Picker/utils';\n"]}
|
|
@@ -68,7 +68,7 @@ const DynamicHeightValue = ({ children }) => {
|
|
|
68
68
|
observer.disconnect();
|
|
69
69
|
};
|
|
70
70
|
}, [textRef.current, maxTextHeight]);
|
|
71
|
-
return (_jsxs(_Fragment, { children: [_jsx(ExpandCollapse, { collapsed: collapsed, min: exceedsMaxHeight ? `${maxTextHeight}px` : 'max-content', children: _jsx(
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(ExpandCollapse, { collapsed: collapsed, min: exceedsMaxHeight ? `${maxTextHeight}px` : 'max-content', children: _jsx("div", { ref: textRef, children: _jsx("span", { children: children }) }) }), exceedsMaxHeight && (_jsx(Button, { variant: 'link', onClick: () => setCollapsed(current => !current), children: collapsed ? t('show_more') : t('show_less') }))] }));
|
|
72
72
|
};
|
|
73
73
|
export const FieldValueItem = ({ name, value, variant = 'inline' }) => {
|
|
74
74
|
const Wrapper = variant === 'stacked' ? StyledStackedFieldValue : Fragment;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldValueList.js","sourceRoot":"","sources":["../../../src/components/FieldValueList/FieldValueList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAEL,QAAQ,EAER,QAAQ,EACR,eAAe,EACf,MAAM,EACN,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAqB/C,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,EAAE,CAAA;;CAEvC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,EAAE,CAAA;;;CAGxC,CAAC;AAIF,M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AG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE;YACzD,MAAM,UAAU,GAAG,YAAY,IAAI,OAAO,CAAC;YAC3C,OAAO,CACL,KAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,IACnD,EAAE,IAAI,IAAI,CACf,CACH,CAAC;QACJ,CAAC,CAAC,GACG,CACR,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,cAAc,CAAC","sourcesContent":["import {\n ReactNode,\n Fragment,\n FunctionComponent,\n useState,\n useLayoutEffect,\n useRef,\n useMemo\n} from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport Button from '../Button';\nimport ExpandCollapse from '../ExpandCollapse';\nimport Grid from '../Grid';\nimport { StyledLabel } from '../Label';\nimport { useI18n } from '../../hooks';\nimport { windowIsAvailable } from '../../utils';\nimport { defaultThemeProp } from '../../theme';\n\nexport type FieldValueVariant = 'inline' | 'stacked';\n\nexport interface FieldValueListItemProps {\n id?: string;\n name: string;\n value?: ReactNode;\n variant?: FieldValueVariant;\n}\n\nexport interface FieldValueListProps extends BaseProps, NoChildrenProp {\n /** The set of field values to render in the list. */\n fields: FieldValueListItemProps[];\n /**\n * Determines if the field and values should be displayed on the same line, or stacked with the field above the value.\n * @default \"inline\"\n */\n variant?: FieldValueVariant | 'value-comparison';\n}\n\nexport const StyledFieldName = styled.dt`\n word-break: break-word;\n`;\n\nexport const StyledFieldValue = styled.dd`\n word-break: break-word;\n overflow: auto;\n`;\n\nexport type StyledFieldValueListProps = Pick<FieldValueListProps, 'variant'>;\n\nexport const StyledFieldValueList = styled.dl<StyledFieldValueListProps>(({ variant, theme }) => {\n return css`\n width: 100%;\n\n ${variant === 'value-comparison' &&\n css`\n dt {\n width: 100%;\n }\n dd {\n text-align: end;\n padding-inline-start: calc(2 * ${theme.base.spacing});\n }\n ${StyledLabel} {\n max-width: unset;\n }\n dd:not(:last-of-type),\n dt:not(:last-of-type) {\n border-bottom: 0.0625rem solid ${theme.base.palette['border-line']};\n padding-bottom: calc(0.5 * ${theme.base.spacing});\n }\n `}\n `;\n});\n\nStyledFieldValueList.defaultProps = defaultThemeProp;\n\nexport const StyledStackedFieldValue = styled.div``;\n\nconst DynamicHeightValue = ({ children }: { children: ReactNode }): JSX.Element => {\n const [collapsed, setCollapsed] = useState(true);\n const [exceedsMaxHeight, setExceedsMaxHeight] = useState(false);\n const textRef = useRef<HTMLDivElement>(null);\n const t = useI18n();\n\n const maxTextHeight = useMemo(() => {\n if (!windowIsAvailable) return Infinity;\n\n const computedLineHeight =\n Number.parseInt(\n window.getComputedStyle(document.documentElement).getPropertyValue('font-size'),\n 10\n ) * 1.25;\n\n return 3 * computedLineHeight;\n }, []);\n\n useLayoutEffect(() => {\n if (!textRef.current) return;\n\n const observer = new ResizeObserver(entries => {\n const exceedsHeight = entries.some(({ target, contentRect }) => {\n if (target !== textRef.current) return;\n\n return contentRect.height > maxTextHeight;\n });\n\n setExceedsMaxHeight(exceedsHeight);\n });\n\n observer.observe(textRef.current);\n\n return () => {\n observer.disconnect();\n };\n }, [textRef.current, maxTextHeight]);\n\n return (\n <>\n <ExpandCollapse\n collapsed={collapsed}\n min={exceedsMaxHeight ? `${maxTextHeight}px` : 'max-content'}\n >\n <div ref={textRef}>\n <span>{children}</span>\n </div>\n </ExpandCollapse>\n {exceedsMaxHeight && (\n <Button variant='link' onClick={() => setCollapsed(current => !current)}>\n {collapsed ? t('show_more') : t('show_less')}\n </Button>\n )}\n </>\n );\n};\n\nexport const FieldValueItem = ({ name, value, variant = 'inline' }: FieldValueListItemProps) => {\n const Wrapper = variant === 'stacked' ? StyledStackedFieldValue : Fragment;\n const displayValue =\n typeof value === 'string' ? <DynamicHeightValue>{value}</DynamicHeightValue> : value;\n\n return (\n <Wrapper>\n <StyledLabel as={StyledFieldName}>{name}</StyledLabel>\n <StyledFieldValue>\n {value ? displayValue : <span aria-hidden='true'>––</span>}\n </StyledFieldValue>\n </Wrapper>\n );\n};\n\nconst FieldValueList: FunctionComponent<FieldValueListProps & ForwardProps> = ({\n fields,\n variant = 'inline',\n ...restProps\n}: FieldValueListProps) => {\n return (\n <Grid\n {...restProps}\n container={{\n cols: ['inline', 'value-comparison'].includes(variant)\n ? '16ch minmax(0, 1fr)'\n : 'minmax(0, 1fr)',\n colGap: variant !== 'value-comparison' ? 2 : 0,\n rowGap: variant !== 'value-comparison' ? 1 : 0.5\n }}\n as={StyledFieldValueList}\n variant={variant}\n >\n {fields.map(({ id, name, value, variant: fieldVariant }) => {\n const useVariant = fieldVariant ?? variant;\n return (\n <FieldValueItem\n name={name}\n value={value}\n variant={useVariant === 'stacked' ? 'stacked' : 'inline'}\n key={id ?? name}\n />\n );\n })}\n </Grid>\n );\n};\n\nexport default FieldValueList;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare type AttachmentType = 'generic' | 'image' | 'video' | 'audio' | 'pdf' | 'archive' | 'text' | 'message' | 'link' | '
|
|
1
|
+
export declare type AttachmentType = 'generic' | 'image' | 'video' | 'audio' | 'pdf' | 'archive' | 'text' | 'message' | 'link' | 'database' | 'document' | 'spreadsheet' | 'presentation';
|
|
2
2
|
/**
|
|
3
3
|
* Returns approximately correct mime type for given file based upon the extension. Only few extensions are recognized.
|
|
4
4
|
* @param fileName file name or url to discover the mime type from.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/File/utils.ts"],"names":[],"mappings":"AAEA,oBAAY,cAAc,GACtB,SAAS,GACT,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,SAAS,GACT,MAAM,GACN,SAAS,GACT,MAAM,GACN,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/File/utils.ts"],"names":[],"mappings":"AAEA,oBAAY,cAAc,GACtB,SAAS,GACT,OAAO,GACP,OAAO,GACP,OAAO,GACP,KAAK,GACL,SAAS,GACT,MAAM,GACN,SAAS,GACT,MAAM,GACN,UAAU,GACV,UAAU,GACV,aAAa,GACb,cAAc,CAAC;AAEnB;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,aAAc,MAAM,KAAG,MAAM,GAAG,SAG/D,CAAC;AAEF,eAAO,MAAM,mBAAmB,aAAc,MAAM,KAAG,cActD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/File/utils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/components/File/utils.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AAiBzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAsB,EAAE;IAC1E,MAAM,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,IAAI,QAAQ,CAAC;IACtD,OAAQ,SAAoC,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAgB,EAAkB,EAAE;IACtE,IAAI,IAAI,GAAmB,SAAS,CAAC;IACrC,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,IAAI,GAAG,OAAO,CAAC;IAClD,IAAI,QAAQ,CAAC,UAAU,CAAC,OAAO,CAAC;QAAE,IAAI,GAAG,MAAM,CAAC;IAChD,IAAI,QAAQ,CAAC,UAAU,CAAC,UAAU,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC;IACtD,IAAI,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,IAAI,GAAG,KAAK,CAAC;IAC5C,IAAI,QAAQ,CAAC,KAAK,CAAC,iCAAiC,CAAC;QAAE,IAAI,GAAG,cAAc,CAAC;IAC7E,IAAI,QAAQ,CAAC,KAAK,CAAC,wBAAwB,CAAC;QAAE,IAAI,GAAG,aAAa,CAAC;IACnE,IAAI,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC;QAAE,IAAI,GAAG,UAAU,CAAC;IAC1D,IAAI,QAAQ,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAAE,IAAI,GAAG,UAAU,CAAC;IACzD,IAAI,QAAQ,CAAC,KAAK,CAAC,YAAY,CAAC;QAAE,IAAI,GAAG,SAAS,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC,CAAC","sourcesContent":["import mimeTypes from './mimeTypes.json';\n\nexport type AttachmentType =\n | 'generic'\n | 'image'\n | 'video'\n | 'audio'\n | 'pdf'\n | 'archive'\n | 'text'\n | 'message'\n | 'link'\n | 'database'\n | 'document'\n | 'spreadsheet'\n | 'presentation';\n\n/**\n * Returns approximately correct mime type for given file based upon the extension. Only few extensions are recognized.\n * @param fileName file name or url to discover the mime type from.\n * @returns mime type associated to the file.\n */\nexport const getMimeTypeFromFile = (fileName: string): string | undefined => {\n const fileExt = fileName.split('.').pop() ?? fileName;\n return (mimeTypes as Record<string, string>)[fileExt.toLowerCase()];\n};\n\nexport const getKindFromMimeType = (mimeType: string): AttachmentType => {\n let type: AttachmentType = 'generic';\n if (mimeType.startsWith('video/')) type = 'video';\n if (mimeType.startsWith('audio/')) type = 'audio';\n if (mimeType.startsWith('image/')) type = 'image';\n if (mimeType.startsWith('text/')) type = 'text';\n if (mimeType.startsWith('message/')) type = 'message';\n if (mimeType.endsWith('/pdf')) type = 'pdf';\n if (mimeType.match(/powerpoint|presentation|impress/)) type = 'presentation';\n if (mimeType.match(/excel|spreadsheet|calc/)) type = 'spreadsheet';\n if (mimeType.match(/word|writer|text/)) type = 'document';\n if (mimeType.match(/access|database/)) type = 'database';\n if (mimeType.match(/zip|rar|7z/)) type = 'archive';\n return type;\n};\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent, Ref, ReactNode } from 'react';
|
|
2
|
-
import { ForwardProps, BaseProps, AsProp } from '../../types';
|
|
2
|
+
import { ForwardProps, BaseProps, AsProp, RequireAtLeastOne } from '../../types';
|
|
3
3
|
export interface FlexContainerProps {
|
|
4
4
|
/** Display as inline-flex. */
|
|
5
5
|
inline?: boolean;
|
|
@@ -46,27 +46,28 @@ export interface FlexItemProps {
|
|
|
46
46
|
/** [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/) */
|
|
47
47
|
basis?: string;
|
|
48
48
|
}
|
|
49
|
-
interface BaseFlexProps {
|
|
49
|
+
export interface BaseFlexProps {
|
|
50
50
|
container?: FlexContainerProps | true;
|
|
51
51
|
item?: FlexItemProps;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
declare type BreakpointFlexProps = RequireAtLeastOne<BaseFlexProps, 'container' | 'item'>;
|
|
54
|
+
export declare type FlexProps = RequireAtLeastOne<BaseFlexProps & BaseProps & AsProp & {
|
|
54
55
|
/** Content for either a container or item. */
|
|
55
56
|
children?: ReactNode;
|
|
56
57
|
/** Ref for the flex element. */
|
|
57
58
|
ref?: Ref<Element>;
|
|
58
59
|
/** Override props at extra small screen sizes and above. */
|
|
59
|
-
xs?:
|
|
60
|
+
xs?: BreakpointFlexProps;
|
|
60
61
|
/** Override props at small screen sizes and above. */
|
|
61
|
-
sm?:
|
|
62
|
+
sm?: BreakpointFlexProps;
|
|
62
63
|
/** Override props at medium screen sizes and above. */
|
|
63
|
-
md?:
|
|
64
|
+
md?: BreakpointFlexProps;
|
|
64
65
|
/** Override props at large screen sizes and above. */
|
|
65
|
-
lg?:
|
|
66
|
+
lg?: BreakpointFlexProps;
|
|
66
67
|
/** Override props at extra large screen sizes and above. */
|
|
67
|
-
xl?:
|
|
68
|
-
}
|
|
69
|
-
export declare const StyledFlex: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, FlexProps, never>;
|
|
68
|
+
xl?: BreakpointFlexProps;
|
|
69
|
+
}, 'container' | 'item' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'>;
|
|
70
|
+
export declare const StyledFlex: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {} & FlexProps, never>;
|
|
70
71
|
declare const Flex: FunctionComponent<FlexProps & ForwardProps>;
|
|
71
72
|
export default Flex;
|
|
72
73
|
//# sourceMappingURL=Flex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Flex.d.ts","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,GAAG,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGjF,MAAM,WAAW,kBAAkB;IACjC,8BAA8B;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yHAAyH;IACzH,GAAG,CAAC,EACA,MAAM,GACN,CAAC,kBAAkB,EAAE,MAAM,CAAC,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,CAAC,EAAE,SAAS,CAAC;gBACtD,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC;;WAEjD,CACJ;KACF,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,IAAI,GAAgD,UAAU,CAClE,CAAC,KAAiC,EAAE,GAAqB,EAAE,EAAE;IAC3D,OAAO,KAAC,UAAU,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,GAAI,CAAC;AAC7C,CAAC,CACF,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import { FunctionComponent, forwardRef, PropsWithoutRef, Ref, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { ForwardProps, BaseProps, AsProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface FlexContainerProps {\n /** Display as inline-flex. */\n inline?: boolean;\n /** Padding on the container represented as a multiplier or set of multipliers to the base spacing value in the theme. */\n pad?:\n | number\n | [topRightBottomLeft: number]\n | [topBottom: number, rightLeft: number]\n | [top: number, rightLeft: number, bottom: number]\n | [top: number, right: number, bottom: number, left: number];\n /** [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/) */\n direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';\n /** [justify-content](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch';\n /** [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/) */\n wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';\n /** [align-items](https://css-tricks.com/almanac/properties/a/align-items/). */\n alignItems?: 'stretch' | 'start' | 'end' | 'center' | 'baseline';\n /** [align-content](https://css-tricks.com/almanac/properties/a/align-content/) */\n alignContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'stretch';\n /**\n * Defines how much equal space to place between items represented as a multiplier to the base spacing value in the theme.\n * @deprecated\n */\n itemGap?: number;\n /**\n * Defines how much equal space to place between columns represented as a multiplier to the base spacing value in the theme.\n * [column-gap](https://css-tricks.com/almanac/properties/c/column-gap/)\n */\n colGap?: number;\n /**\n * Defines how much equal space to place between rows represented as a multiplier to the base spacing value in the theme.\n * [row-gap](https://css-tricks.com/almanac/properties/r/row-gap/)\n */\n rowGap?: number;\n /**\n * Defines how much equal space to place between both rows and columns represented as a multiplier to the base spacing value in the theme.\n * [gap](https://css-tricks.com/almanac/properties/g/gap/)\n */\n gap?: number;\n}\n\nexport interface FlexItemProps {\n /** [align-self](https://css-tricks.com/almanac/properties/a/align-self/) */\n alignSelf?: 'auto' | 'start' | 'end' | 'baseline' | 'center' | 'stretch';\n /** [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/) */\n grow?: number;\n /** [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/) */\n shrink?: number;\n /** [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/) */\n basis?: string;\n}\n\ninterface BaseFlexProps {\n container?: FlexContainerProps | true;\n item?: FlexItemProps;\n}\n\nexport interface FlexProps extends BaseFlexProps, BaseProps, AsProp {\n /** Content for either a container or item. */\n children?: ReactNode;\n /** Ref for the flex element. */\n ref?: Ref<Element>;\n /** Override props at extra small screen sizes and above. */\n xs?: BaseFlexProps;\n /** Override props at small screen sizes and above. */\n sm?: BaseFlexProps;\n /** Override props at medium screen sizes and above. */\n md?: BaseFlexProps;\n /** Override props at large screen sizes and above. */\n lg?: BaseFlexProps;\n /** Override props at extra large screen sizes and above. */\n xl?: BaseFlexProps;\n}\n\nconst prefix = (value: string) => {\n if (['between', 'around', 'evenly'].includes(value)) return `space-${value}`;\n if (['start', 'end'].includes(value)) return `flex-${value}`;\n return value;\n};\n\nconst getContainerStyles = (container: FlexProps['container']) => {\n if (!container) return '';\n\n if (container === true) {\n return css`\n display: flex;\n `;\n }\n\n if (container && typeof container === 'object') {\n const isRow = !container.direction || container.direction.includes('row');\n const isReverse = container.direction && container.direction.includes('reverse');\n\n return css`\n display: ${container.inline ? 'inline-flex' : 'flex'};\n\n ${container.pad !== undefined &&\n css`\n /* stylelint-disable function-name-case, function-whitespace-after */\n padding: ${({\n theme: {\n base: { spacing }\n }\n }) =>\n (Array.isArray(container.pad) ? container.pad : [container.pad])\n .map(p => `calc(${p} * ${spacing})`)\n .join(' ')};\n\n /* stylelint-enable function-name-case, function-whitespace-after */\n `}\n\n ${container.direction &&\n css`\n flex-direction: ${container.direction};\n `}\n\n ${container.justify &&\n css`\n justify-content: ${prefix(container.justify)};\n `}\n\n ${container.wrap &&\n css`\n flex-wrap: ${container.wrap};\n `}\n\n ${container.alignItems &&\n css`\n align-items: ${prefix(container.alignItems)};\n `}\n\n ${container.alignContent &&\n css`\n align-content: ${prefix(container.alignContent)};\n `}\n\n ${container.itemGap &&\n css`\n > * {\n margin-${isRow ? 'inline-start' : 'block-start'}: calc(${container.itemGap} * ${props =>\n props.theme.base.spacing});\n ${isReverse ? ':last-child' : ':first-child'} {\n margin-${isRow ? 'inline-start' : 'block-start'}: 0;\n }\n }\n `}\n\n ${container.gap !== undefined &&\n css`\n gap: calc(${container.gap} * ${props => props.theme.base.spacing});\n `}\n\n ${container.colGap !== undefined &&\n css`\n column-gap: calc(${container.colGap} * ${props => props.theme.base.spacing});\n `}\n\n ${container.rowGap !== undefined &&\n css`\n row-gap: calc(${container.rowGap} * ${props => props.theme.base.spacing});\n `}\n `;\n }\n};\n\nconst getItemStyles = (item: FlexProps['item']) => {\n return css`\n ${item &&\n css`\n max-width: 100%;\n min-width: 0;\n\n ${item.grow !== undefined &&\n css`\n flex-grow: ${item.grow};\n `}\n\n ${item.shrink !== undefined &&\n css`\n flex-shrink: ${item.shrink};\n `}\n\n ${item.alignSelf &&\n css`\n align-self: ${prefix(item.alignSelf)};\n `}\n\n ${item.basis &&\n css`\n flex-basis: ${item.basis};\n `}\n `}\n `;\n};\n\nconst breakpointOrder = ['xs', 'sm', 'md', 'lg', 'xl'] as const;\n\nexport const StyledFlex = styled.div<FlexProps>(\n ({\n container,\n item,\n theme: {\n base: { breakpoints: themeBreakpoints }\n },\n xs,\n sm,\n md,\n lg,\n xl\n }) => {\n const breakpoints = {\n xs,\n sm,\n md,\n lg,\n xl\n };\n\n return css`\n ${getContainerStyles(container)}\n ${getItemStyles(item)}\n\n ${breakpointOrder.map(\n breakpoint =>\n breakpoints[breakpoint] &&\n css`\n @media screen and (min-width: ${themeBreakpoints[breakpoint]}) {\n ${getContainerStyles(breakpoints[breakpoint]?.container)}\n ${getItemStyles(breakpoints[breakpoint]?.item)}\n }\n `\n )}\n `;\n }\n);\n\nStyledFlex.defaultProps = defaultThemeProp;\n\nconst Flex: FunctionComponent<FlexProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<FlexProps>, ref: FlexProps['ref']) => {\n return <StyledFlex {...props} ref={ref} />;\n }\n);\n\nexport default Flex;\n"]}
|
|
1
|
+
{"version":3,"file":"Flex.js","sourceRoot":"","sources":["../../../src/components/Flex/Flex.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqB,UAAU,EAAmC,MAAM,OAAO,CAAC;AACvF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAoF/C,MAAM,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE;IAC/B,IAAI,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,KAAK,EAAE,CAAC;IAC7E,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,QAAQ,KAAK,EAAE,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,SAAiC,EAAE,EAAE;IAC/D,IAAI,CAAC,SAAS;QAAE,OAAO,EAAE,C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sWithoutRef, Ref, ReactNode } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { ForwardProps, BaseProps, AsProp, RequireAtLeastOne } from '../../types';\nimport { defaultThemeProp } from '../../theme';\n\nexport interface FlexContainerProps {\n /** Display as inline-flex. */\n inline?: boolean;\n /** Padding on the container represented as a multiplier or set of multipliers to the base spacing value in the theme. */\n pad?:\n | number\n | [topRightBottomLeft: number]\n | [topBottom: number, rightLeft: number]\n | [top: number, rightLeft: number, bottom: number]\n | [top: number, right: number, bottom: number, left: number];\n /** [flex-direction](https://css-tricks.com/almanac/properties/f/flex-direction/) */\n direction?: 'row' | 'row-reverse' | 'column' | 'column-reverse';\n /** [justify-content](https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content) */\n justify?: 'start' | 'end' | 'center' | 'between' | 'around' | 'evenly' | 'stretch';\n /** [flex-wrap](https://css-tricks.com/almanac/properties/f/flex-wrap/) */\n wrap?: 'wrap' | 'nowrap' | 'wrap-reverse';\n /** [align-items](https://css-tricks.com/almanac/properties/a/align-items/). */\n alignItems?: 'stretch' | 'start' | 'end' | 'center' | 'baseline';\n /** [align-content](https://css-tricks.com/almanac/properties/a/align-content/) */\n alignContent?: 'start' | 'end' | 'center' | 'between' | 'around' | 'stretch';\n /**\n * Defines how much equal space to place between items represented as a multiplier to the base spacing value in the theme.\n * @deprecated\n */\n itemGap?: number;\n /**\n * Defines how much equal space to place between columns represented as a multiplier to the base spacing value in the theme.\n * [column-gap](https://css-tricks.com/almanac/properties/c/column-gap/)\n */\n colGap?: number;\n /**\n * Defines how much equal space to place between rows represented as a multiplier to the base spacing value in the theme.\n * [row-gap](https://css-tricks.com/almanac/properties/r/row-gap/)\n */\n rowGap?: number;\n /**\n * Defines how much equal space to place between both rows and columns represented as a multiplier to the base spacing value in the theme.\n * [gap](https://css-tricks.com/almanac/properties/g/gap/)\n */\n gap?: number;\n}\n\nexport interface FlexItemProps {\n /** [align-self](https://css-tricks.com/almanac/properties/a/align-self/) */\n alignSelf?: 'auto' | 'start' | 'end' | 'baseline' | 'center' | 'stretch';\n /** [flex-grow](https://css-tricks.com/almanac/properties/f/flex-grow/) */\n grow?: number;\n /** [flex-shrink](https://css-tricks.com/almanac/properties/f/flex-shrink/) */\n shrink?: number;\n /** [flex-basis](https://css-tricks.com/almanac/properties/f/flex-basis/) */\n basis?: string;\n}\n\nexport interface BaseFlexProps {\n container?: FlexContainerProps | true;\n item?: FlexItemProps;\n}\n\ntype BreakpointFlexProps = RequireAtLeastOne<BaseFlexProps, 'container' | 'item'>;\n\nexport type FlexProps = RequireAtLeastOne<\n BaseFlexProps &\n BaseProps &\n AsProp & {\n /** Content for either a container or item. */\n children?: ReactNode;\n /** Ref for the flex element. */\n ref?: Ref<Element>;\n /** Override props at extra small screen sizes and above. */\n xs?: BreakpointFlexProps;\n /** Override props at small screen sizes and above. */\n sm?: BreakpointFlexProps;\n /** Override props at medium screen sizes and above. */\n md?: BreakpointFlexProps;\n /** Override props at large screen sizes and above. */\n lg?: BreakpointFlexProps;\n /** Override props at extra large screen sizes and above. */\n xl?: BreakpointFlexProps;\n },\n 'container' | 'item' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n>;\n\nconst prefix = (value: string) => {\n if (['between', 'around', 'evenly'].includes(value)) return `space-${value}`;\n if (['start', 'end'].includes(value)) return `flex-${value}`;\n return value;\n};\n\nconst getContainerStyles = (container: FlexProps['container']) => {\n if (!container) return '';\n\n if (container === true) {\n return css`\n display: flex;\n `;\n }\n\n if (container && typeof container === 'object') {\n const isRow = !container.direction || container.direction.includes('row');\n const isReverse = container.direction && container.direction.includes('reverse');\n\n return css`\n display: ${container.inline ? 'inline-flex' : 'flex'};\n\n ${container.pad !== undefined &&\n css`\n /* stylelint-disable function-name-case, function-whitespace-after */\n padding: ${({\n theme: {\n base: { spacing }\n }\n }) =>\n (Array.isArray(container.pad) ? container.pad : [container.pad])\n .map(p => `calc(${p} * ${spacing})`)\n .join(' ')};\n\n /* stylelint-enable function-name-case, function-whitespace-after */\n `}\n\n ${container.direction &&\n css`\n flex-direction: ${container.direction};\n `}\n\n ${container.justify &&\n css`\n justify-content: ${prefix(container.justify)};\n `}\n\n ${container.wrap &&\n css`\n flex-wrap: ${container.wrap};\n `}\n\n ${container.alignItems &&\n css`\n align-items: ${prefix(container.alignItems)};\n `}\n\n ${container.alignContent &&\n css`\n align-content: ${prefix(container.alignContent)};\n `}\n\n ${container.itemGap &&\n css`\n > * {\n margin-${isRow ? 'inline-start' : 'block-start'}: calc(${container.itemGap} * ${props =>\n props.theme.base.spacing});\n ${isReverse ? ':last-child' : ':first-child'} {\n margin-${isRow ? 'inline-start' : 'block-start'}: 0;\n }\n }\n `}\n\n ${container.gap !== undefined &&\n css`\n gap: calc(${container.gap} * ${props => props.theme.base.spacing});\n `}\n\n ${container.colGap !== undefined &&\n css`\n column-gap: calc(${container.colGap} * ${props => props.theme.base.spacing});\n `}\n\n ${container.rowGap !== undefined &&\n css`\n row-gap: calc(${container.rowGap} * ${props => props.theme.base.spacing});\n `}\n `;\n }\n};\n\nconst getItemStyles = (item: FlexProps['item']) => {\n return css`\n ${item &&\n css`\n max-width: 100%;\n min-width: 0;\n\n ${item.grow !== undefined &&\n css`\n flex-grow: ${item.grow};\n `}\n\n ${item.shrink !== undefined &&\n css`\n flex-shrink: ${item.shrink};\n `}\n\n ${item.alignSelf &&\n css`\n align-self: ${prefix(item.alignSelf)};\n `}\n\n ${item.basis &&\n css`\n flex-basis: ${item.basis};\n `}\n `}\n `;\n};\n\nconst breakpointOrder = ['xs', 'sm', 'md', 'lg', 'xl'] as const;\n\nexport const StyledFlex = styled.div<FlexProps>(\n ({\n container,\n item,\n theme: {\n base: { breakpoints: themeBreakpoints }\n },\n xs,\n sm,\n md,\n lg,\n xl\n }) => {\n const breakpoints = {\n xs,\n sm,\n md,\n lg,\n xl\n };\n\n return css`\n ${getContainerStyles(container)}\n ${getItemStyles(item)}\n\n ${breakpointOrder.map(\n breakpoint =>\n breakpoints[breakpoint] &&\n css`\n @media screen and (min-width: ${themeBreakpoints[breakpoint]}) {\n ${getContainerStyles(breakpoints[breakpoint]?.container)}\n ${getItemStyles(breakpoints[breakpoint]?.item)}\n }\n `\n )}\n `;\n }\n);\n\nStyledFlex.defaultProps = defaultThemeProp;\n\nconst Flex: FunctionComponent<FlexProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<FlexProps>, ref: FlexProps['ref']) => {\n return <StyledFlex {...props} ref={ref} />;\n }\n);\n\nexport default Flex;\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { ForwardProps } from '../../types';
|
|
3
3
|
import GridProps from './Grid.types';
|
|
4
|
-
export declare const StyledGrid: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, GridProps, never>;
|
|
4
|
+
export declare const StyledGrid: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {} & GridProps, never>;
|
|
5
5
|
declare const Grid: FunctionComponent<GridProps & ForwardProps>;
|
|
6
6
|
export default Grid;
|
|
7
7
|
//# sourceMappingURL=Grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,SAAS,MAAM,cAAc,CAAC;AA2LrC,eAAO,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"Grid.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAc,iBAAiB,EAAmB,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,OAAO,SAAS,MAAM,cAAc,CAAC;AA2LrC,eAAO,MAAM,UAAU,qHAqCtB,CAAC;AAIF,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,CAIrD,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode, Ref } from 'react';
|
|
2
|
-
import { BaseProps, AsProp } from '../../types';
|
|
2
|
+
import { BaseProps, AsProp, RequireAtLeastOne } from '../../types';
|
|
3
3
|
export interface GridContainerProps {
|
|
4
4
|
/**
|
|
5
5
|
* Display the grid as an inline-grid.
|
|
@@ -84,27 +84,28 @@ export interface GridItemProps {
|
|
|
84
84
|
*/
|
|
85
85
|
alignSelf?: 'stretch' | 'start' | 'end' | 'center';
|
|
86
86
|
}
|
|
87
|
-
interface BaseGridProps {
|
|
87
|
+
export interface BaseGridProps {
|
|
88
88
|
/** Creates a [grid container.](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-display) */
|
|
89
89
|
container?: GridContainerProps | true;
|
|
90
90
|
/** Designate as a Grid item to leverage grid item props. */
|
|
91
91
|
item?: GridItemProps;
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
declare type BreakpointGridProps = RequireAtLeastOne<BaseGridProps, 'container' | 'item'>;
|
|
94
|
+
declare type GridProps = RequireAtLeastOne<BaseGridProps & BaseProps & AsProp & {
|
|
94
95
|
/** Any ReactNode to use as grid items. To leverage item based props, use Grid with "item" prop. */
|
|
95
96
|
children?: ReactNode;
|
|
96
97
|
/** Ref for the grid element. */
|
|
97
98
|
ref?: Ref<Element>;
|
|
98
99
|
/** Override props for the grid at extra small screen size. */
|
|
99
|
-
xs?:
|
|
100
|
+
xs?: BreakpointGridProps;
|
|
100
101
|
/** Override props for the grid at small screen size. */
|
|
101
|
-
sm?:
|
|
102
|
+
sm?: BreakpointGridProps;
|
|
102
103
|
/** Override props for the grid at medium screen size. */
|
|
103
|
-
md?:
|
|
104
|
+
md?: BreakpointGridProps;
|
|
104
105
|
/** Override props for the grid at large screen size. */
|
|
105
|
-
lg?:
|
|
106
|
+
lg?: BreakpointGridProps;
|
|
106
107
|
/** Override props for the grid at extra large screen size. */
|
|
107
|
-
xl?:
|
|
108
|
-
}
|
|
109
|
-
export
|
|
108
|
+
xl?: BreakpointGridProps;
|
|
109
|
+
}, 'container' | 'item' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'>;
|
|
110
|
+
export default GridProps;
|
|
110
111
|
//# sourceMappingURL=Grid.types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.types.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Grid.types.d.ts","sourceRoot":"","sources":["../../../src/components/Grid/Grid.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAEnE,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,yHAAyH;IACzH,GAAG,CAAC,EACA,MAAM,GACN,CAAC,kBAAkB,EAAE,MAAM,CAAC,GAC5B,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,GACtC,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,GAChD,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAC/D,wHAAwH;IACxH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gHAAgH;IAChH,QAAQ,CAAC,EAAE,MAA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,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;IACrD;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAC;CACpD;AAED,MAAM,WAAW,aAAa;IAC5B,yGAAyG;IACzG,SAAS,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACtC,4DAA4D;IAC5D,IAAI,CAAC,EAAE,aAAa,CAAC;CACtB;AAED,aAAK,mBAAmB,GAAG,iBAAiB,CAAC,aAAa,EAAE,WAAW,GAAG,MAAM,CAAC,CAAC;AAElF,aAAK,SAAS,GAAG,iBAAiB,CAChC,aAAa,GACX,SAAS,GACT,MAAM,GAAG;IACP,mGAAmG;IACnG,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,gCAAgC;IAChC,GAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACnB,8DAA8D;IAC9D,EAAE,CAAC,EAAE,mBAAmB,CAAC;IACzB,wDAAwD;IACxD,EAAE,CAAC,EAAE,mBAAmB,CAAC;IACzB,yDAAyD;IACzD,EAAE,CAAC,EAAE,mBAAmB,CAAC;IACzB,wDAAwD;IACxD,EAAE,CAAC,EAAE,mBAAmB,CAAC;IACzB,8DAA8D;IAC9D,EAAE,CAAC,EAAE,mBAAmB,CAAC;CAC1B,EACH,WAAW,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CACxD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Grid.types.js","sourceRoot":"","sources":["../../../src/components/Grid/Grid.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref } from 'react';\n\nimport { BaseProps, AsProp } from '../../types';\n\nexport interface GridContainerProps {\n /**\n * Display the grid as an inline-grid.\n * @default false\n */\n inline?: boolean;\n /** Padding on the container represented as a multiplier or set of multipliers to the base spacing value in the theme. */\n pad?:\n | number\n | [topRightBottomLeft: number]\n | [topBottom: number, rightLeft: number]\n | [top: number, rightLeft: number, bottom: number]\n | [top: number, right: number, bottom: number, left: number];\n /** [grid-template-columns](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template-columns-rows) */\n cols?: string;\n /** [grid-auto-columns](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-auto-columns-rows) */\n autoCols?: string;\n /** [grid-template-rows](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template-columns-rows) */\n rows?: string;\n /** [grid-auto-rows](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-auto-columns-rows) */\n autoRows?: string;\n /** [grid-auto-flow](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-auto-flow) */\n autoFlow?: 'row' | 'column' | 'row dense' | 'column dense';\n /** [grid-template-area](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template-areas) */\n areas?: string;\n /** [grid-template](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template) */\n template?: string;\n /**\n * Defines how much equal space to place between columns represented as a multiplier to the base spacing value in the theme.\n * [column-gap](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-gap)\n */\n colGap?: number;\n /**\n * Defines how much equal space to place between rows represented as a multiplier to the base spacing value in the theme.\n * [row-gap](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-gap)\n */\n rowGap?: number;\n /**\n * Defines how much equal space to place between both rows and columns represented as a multiplier to the base spacing value in the theme.\n * [gap](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-gap)\n */\n gap?: number;\n /**\n * [justify-items](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-justify-items)\n * @default \"stretch\"\n */\n justifyItems?: 'start' | 'end' | 'center' | 'stretch';\n /**\n * [justify-content](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-justify-content)\n * @default \"start\"\n */\n justifyContent?: 'start' | 'end' | 'center' | 'stretch' | 'around' | 'between' | 'evenly';\n /**\n * [align-items](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-align-items)\n * @default \"stretch\"\n */\n alignItems?: 'stretch' | 'start' | 'end' | 'center';\n /**\n * [align-content](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-align-content)\n * @default \"start\"\n */\n alignContent?: 'start' | 'end' | 'center' | 'stretch' | 'around' | 'between' | 'evenly';\n}\n\nexport interface GridItemProps {\n /** [grid-column-start](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n colStart?: string;\n /** [grid-column-end](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n colEnd?: string;\n /** [grid-column](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row) */\n colStartEnd?: string;\n /** [grid-row-start](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n rowStart?: string;\n /** [grid-row-end](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n rowEnd?: string;\n /** [grid-row](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row) */\n rowStartEnd?: string;\n /** [grid-area](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-area) */\n area?: string;\n /**\n * [justify-self](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-justify-self)\n * @default \"stretch\"\n */\n justifySelf?: 'start' | 'end' | 'center' | 'stretch';\n /**\n * [align-self](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-align-self)\n * @default \"stretch\"\n */\n alignSelf?: 'stretch' | 'start' | 'end' | 'center';\n}\n\
|
|
1
|
+
{"version":3,"file":"Grid.types.js","sourceRoot":"","sources":["../../../src/components/Grid/Grid.types.ts"],"names":[],"mappings":"","sourcesContent":["import { ReactNode, Ref } from 'react';\n\nimport { BaseProps, AsProp, RequireAtLeastOne } from '../../types';\n\nexport interface GridContainerProps {\n /**\n * Display the grid as an inline-grid.\n * @default false\n */\n inline?: boolean;\n /** Padding on the container represented as a multiplier or set of multipliers to the base spacing value in the theme. */\n pad?:\n | number\n | [topRightBottomLeft: number]\n | [topBottom: number, rightLeft: number]\n | [top: number, rightLeft: number, bottom: number]\n | [top: number, right: number, bottom: number, left: number];\n /** [grid-template-columns](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template-columns-rows) */\n cols?: string;\n /** [grid-auto-columns](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-auto-columns-rows) */\n autoCols?: string;\n /** [grid-template-rows](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template-columns-rows) */\n rows?: string;\n /** [grid-auto-rows](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-auto-columns-rows) */\n autoRows?: string;\n /** [grid-auto-flow](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-auto-flow) */\n autoFlow?: 'row' | 'column' | 'row dense' | 'column dense';\n /** [grid-template-area](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template-areas) */\n areas?: string;\n /** [grid-template](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-template) */\n template?: string;\n /**\n * Defines how much equal space to place between columns represented as a multiplier to the base spacing value in the theme.\n * [column-gap](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-gap)\n */\n colGap?: number;\n /**\n * Defines how much equal space to place between rows represented as a multiplier to the base spacing value in the theme.\n * [row-gap](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-gap)\n */\n rowGap?: number;\n /**\n * Defines how much equal space to place between both rows and columns represented as a multiplier to the base spacing value in the theme.\n * [gap](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-gap)\n */\n gap?: number;\n /**\n * [justify-items](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-justify-items)\n * @default \"stretch\"\n */\n justifyItems?: 'start' | 'end' | 'center' | 'stretch';\n /**\n * [justify-content](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-justify-content)\n * @default \"start\"\n */\n justifyContent?: 'start' | 'end' | 'center' | 'stretch' | 'around' | 'between' | 'evenly';\n /**\n * [align-items](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-align-items)\n * @default \"stretch\"\n */\n alignItems?: 'stretch' | 'start' | 'end' | 'center';\n /**\n * [align-content](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-align-content)\n * @default \"start\"\n */\n alignContent?: 'start' | 'end' | 'center' | 'stretch' | 'around' | 'between' | 'evenly';\n}\n\nexport interface GridItemProps {\n /** [grid-column-start](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n colStart?: string;\n /** [grid-column-end](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n colEnd?: string;\n /** [grid-column](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row) */\n colStartEnd?: string;\n /** [grid-row-start](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n rowStart?: string;\n /** [grid-row-end](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row-start-end) */\n rowEnd?: string;\n /** [grid-row](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-column-row) */\n rowStartEnd?: string;\n /** [grid-area](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-grid-area) */\n area?: string;\n /**\n * [justify-self](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-justify-self)\n * @default \"stretch\"\n */\n justifySelf?: 'start' | 'end' | 'center' | 'stretch';\n /**\n * [align-self](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-align-self)\n * @default \"stretch\"\n */\n alignSelf?: 'stretch' | 'start' | 'end' | 'center';\n}\n\nexport interface BaseGridProps {\n /** Creates a [grid container.](https://css-tricks.com/snippets/css/complete-guide-grid/#prop-display) */\n container?: GridContainerProps | true;\n /** Designate as a Grid item to leverage grid item props. */\n item?: GridItemProps;\n}\n\ntype BreakpointGridProps = RequireAtLeastOne<BaseGridProps, 'container' | 'item'>;\n\ntype GridProps = RequireAtLeastOne<\n BaseGridProps &\n BaseProps &\n AsProp & {\n /** Any ReactNode to use as grid items. To leverage item based props, use Grid with \"item\" prop. */\n children?: ReactNode;\n /** Ref for the grid element. */\n ref?: Ref<Element>;\n /** Override props for the grid at extra small screen size. */\n xs?: BreakpointGridProps;\n /** Override props for the grid at small screen size. */\n sm?: BreakpointGridProps;\n /** Override props for the grid at medium screen size. */\n md?: BreakpointGridProps;\n /** Override props for the grid at large screen size. */\n lg?: BreakpointGridProps;\n /** Override props for the grid at extra large screen size. */\n xl?: BreakpointGridProps;\n },\n 'container' | 'item' | 'xs' | 'sm' | 'md' | 'lg' | 'xl'\n>;\n\nexport default GridProps;\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTML.d.ts","sourceRoot":"","sources":["../../../src/components/HTML/HTML.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AACf,OAAe,EAAO,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM9D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGtE,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,cAAc;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU,wDA2CtB,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,YAAY,2DA2BjD,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,YAAY,WAwDhD,CAAC;AAEF,eAAO,MAAM,UAAU,6EAmBrB,CAAC;AAIH,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,
|
|
1
|
+
{"version":3,"file":"HTML.d.ts","sourceRoot":"","sources":["../../../src/components/HTML/HTML.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAEjB,GAAG,EAIJ,MAAM,OAAO,CAAC;AACf,OAAe,EAAO,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAM9D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGtE,MAAM,WAAW,SAAU,SAAQ,SAAS,EAAE,cAAc;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,UAAU,wDA2CtB,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,YAAY,2DA2BjD,CAAC;AAEF,eAAO,MAAM,aAAa,UAAW,YAAY,WAwDhD,CAAC;AAEF,eAAO,MAAM,UAAU,6EAmBrB,CAAC;AAIH,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,GAAG,YAAY,CAmCrD,CAAC;AAEF,eAAe,IAAI,CAAC"}
|
|
@@ -160,9 +160,16 @@ const HTML = forwardRef(({ content, ...restProps }, ref) => {
|
|
|
160
160
|
}, [content, mounted]);
|
|
161
161
|
useEffect(() => {
|
|
162
162
|
dompurify.addHook('uponSanitizeAttribute', node => {
|
|
163
|
+
node.removeAttribute('class');
|
|
163
164
|
const href = node.getAttribute('href');
|
|
164
165
|
if (node.tagName === 'A' && href) {
|
|
165
|
-
|
|
166
|
+
let fullURL;
|
|
167
|
+
try {
|
|
168
|
+
fullURL = new URL(/^[a-z][a-z0-9.+-]*:/i.test(href) ? href : `https:${href}`);
|
|
169
|
+
}
|
|
170
|
+
catch (e) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
166
173
|
if (!sameOrigin(window.location, fullURL)) {
|
|
167
174
|
node.setAttribute('target', '_blank');
|
|
168
175
|
node.setAttribute('rel', 'noopener');
|
|
@@ -171,7 +178,6 @@ const HTML = forwardRef(({ content, ...restProps }, ref) => {
|
|
|
171
178
|
node.removeAttribute('target');
|
|
172
179
|
}
|
|
173
180
|
}
|
|
174
|
-
node.removeAttribute('class');
|
|
175
181
|
});
|
|
176
182
|
setMounted(true);
|
|
177
183
|
}, []);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTML.js","sourceRoot":"","sources":["../../../src/components/HTML/HTML.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EAIV,QAAQ,EACR,SAAS,EACT,OAAO,EACR,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,EAAE,EAAE,GAAG,EAAgB,MAAM,mBAAmB,CAAC;AAC9D,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAY,MAAM,cAAc,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAOzC,MAAM,CAAC,MAAM,UAAU,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2C5B,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAmB,EAAE,EAAE,CAAC,GAAG,CAAA;;;;8BAI5B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;;;;;;;;;;;;;;;;;;;;;;;CAuB9D,CAAC;AAEF,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAmB,EAAE,EAAE;IACnD,MAAM,EACJ,IAAI,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,aAAa,EAAE,OAAO,EAAE,EACzE,UAAU,EAAE,EAAE,IAAI,EAAE,EACrB,GAAG,KAAK,CAAC;IACV,MAAM,QAAQ,GAAG,iBAAiB,CAAC,YAAY,EAAE,aAAa,CAAC,C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CAAC","sourcesContent":["import {\n forwardRef,\n FunctionComponent,\n PropsWithoutRef,\n Ref,\n useState,\n useEffect,\n useMemo\n} from 'react';\nimport styled, { css, DefaultTheme } from 'styled-components';\nimport dompurify from 'dompurify';\n\nimport { StyledPopover } from '../Popover';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize, FontSize } from '../../styles';\nimport { BaseProps, ForwardProps, NoChildrenProp } from '../../types';\nimport { sameOrigin } from '../../utils';\n\nexport interface HTMLProps extends BaseProps, NoChildrenProp {\n content: string;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const listStyles = css`\n ul,\n ol {\n padding-inline-start: 2.5rem;\n }\n\n li {\n margin: 0.5rem 0;\n }\n\n ul li {\n ul {\n margin-inline-start: 1rem;\n list-style-type: circle;\n }\n\n ul ul {\n margin-inline-start: 2rem;\n list-style-type: square;\n }\n\n ul ul ul {\n margin-inline-start: 3rem;\n list-style-type: disc;\n }\n }\n\n ol li {\n ol {\n margin-inline-start: 1rem;\n list-style-type: lower-alpha;\n }\n\n ol ol {\n margin-inline-start: 2rem;\n list-style-type: lower-roman;\n }\n\n ol ol ol {\n margin-inline-start: 3rem;\n list-style-type: decimal;\n }\n }\n`;\n\nexport const getTableStyles = (theme: DefaultTheme) => css`\n border-collapse: collapse;\n\n td {\n border: 0.0625rem solid ${theme.base.palette['border-line']};\n min-width: 6.25rem;\n }\n\n tr:first-child {\n td:first-child {\n border-top-left-radius: 0.125rem;\n }\n\n td:last-child {\n border-top-right-radius: 0.125rem;\n }\n }\n\n tr:last-child {\n td:first-child {\n border-bottom-left-radius: 0.125rem;\n }\n\n td:last-child {\n border-bottom-right-radius: 0.125rem;\n }\n }\n`;\n\nexport const getHtmlStyles = (theme: DefaultTheme) => {\n const {\n base: { 'font-size': baseFontSize, 'font-scale': baseFontScale, palette },\n components: { text }\n } = theme;\n const fontSize = calculateFontSize(baseFontSize, baseFontScale);\n return `\n ${listStyles}\n table {\n ${getTableStyles(theme)}\n }\n img {\n max-width: 100%;\n height: auto;\n border-radius: 0.25rem;\n }\n a {\n color: ${palette.interactive};\n }\n pre {\n white-space: break-spaces;\n }\n p {\n min-height: ${fontSize[text.primary['font-size'] as FontSize]};\n }\n h1 {\n font-size: ${fontSize[text.h1['font-size'] as FontSize]};\n font-weight: ${text.h1['font-weight']};\n min-height: ${fontSize[text.h1['font-size'] as FontSize]};\n }\n h2 {\n font-size: ${fontSize[text.h2['font-size'] as FontSize]};\n font-weight: ${text.h2['font-weight']};\n min-height: ${fontSize[text.h2['font-size'] as FontSize]};\n }\n h3 {\n font-size: ${fontSize[text.h3['font-size'] as FontSize]};\n font-weight: ${text.h3['font-weight']};\n min-height: ${fontSize[text.h3['font-size'] as FontSize]};\n }\n h4 {\n font-size: ${fontSize[text.h4['font-size'] as FontSize]};\n font-weight: ${text.h4['font-weight']};\n min-height: ${fontSize[text.h4['font-size'] as FontSize]};\n }\n h5 {\n font-size: ${fontSize[text.h5['font-size'] as FontSize]};\n font-weight: ${text.h5['font-weight']};\n min-height: ${fontSize[text.h5['font-size'] as FontSize]};\n }\n h6 {\n font-size: ${fontSize[text.h6['font-size'] as FontSize]};\n font-weight: ${text.h6['font-weight']};\n min-height: ${fontSize[text.h6['font-size'] as FontSize]};\n }\n `;\n};\n\nexport const StyledHTML = styled.div(({ theme }) => {\n return css`\n width: 100%;\n overflow-x: auto;\n ${getHtmlStyles(theme)}\n\n ${StyledPopover} ul {\n ul {\n padding-inline-start: 0;\n }\n ol {\n padding-inline-start: 0;\n }\n }\n\n ${StyledPopover} li {\n margin: 0;\n }\n `;\n});\n\nStyledHTML.defaultProps = defaultThemeProp;\n\nconst HTML: FunctionComponent<HTMLProps & ForwardProps> = forwardRef(\n ({ content, ...restProps }: PropsWithoutRef<HTMLProps>, ref: HTMLProps['ref']) => {\n const [mounted, setMounted] = useState(false);\n const sanitizedHtml = useMemo(() => {\n return mounted ? dompurify.sanitize(content) : '';\n }, [content, mounted]);\n\n useEffect(() => {\n dompurify.addHook('uponSanitizeAttribute', node => {\n node.removeAttribute('class');\n const href = node.getAttribute('href');\n if (node.tagName === 'A' && href) {\n let fullURL: URL;\n try {\n fullURL = new URL(/^[a-z][a-z0-9.+-]*:/i.test(href) ? href : `https:${href}`);\n } catch (e) {\n return;\n }\n\n if (!sameOrigin(window.location, fullURL)) {\n node.setAttribute('target', '_blank');\n node.setAttribute('rel', 'noopener');\n } else {\n node.removeAttribute('target');\n }\n }\n });\n\n setMounted(true);\n }, []);\n\n return sanitizedHtml ? (\n <StyledHTML dangerouslySetInnerHTML={{ __html: sanitizedHtml }} ref={ref} {...restProps} />\n ) : null;\n }\n);\n\nexport default HTML;\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export declare const StyledRangeInputContainer: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
1
2
|
declare const StyledInput: import("styled-components").StyledComponent<"input", import("styled-components").DefaultTheme, {}, never>;
|
|
2
3
|
export default StyledInput;
|
|
3
4
|
//# sourceMappingURL=Input.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Input.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.styles.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,yBAAyB,yGA4BrC,CAAC;AAIF,QAAA,MAAM,WAAW,2GAcf,CAAC;AAIH,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,36 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { defaultThemeProp } from '../../theme';
|
|
3
|
+
import { StyledFormControl } from '../FormControl';
|
|
4
|
+
export const StyledRangeInputContainer = styled.div `
|
|
5
|
+
gap: 1rem;
|
|
6
|
+
|
|
7
|
+
${StyledFormControl} {
|
|
8
|
+
position: relative;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
> :first-child {
|
|
12
|
+
> ${StyledFormControl}:after {
|
|
13
|
+
content: '-';
|
|
14
|
+
position: absolute;
|
|
15
|
+
width: 1rem;
|
|
16
|
+
inset-inline-end: -1rem;
|
|
17
|
+
text-align: center;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
> ${StyledFormControl}:first-child:after {
|
|
22
|
+
content: '-';
|
|
23
|
+
position: absolute;
|
|
24
|
+
width: 1rem;
|
|
25
|
+
inset-inline-end: -1rem;
|
|
26
|
+
text-align: center;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
> * {
|
|
30
|
+
flex-grow: 1;
|
|
31
|
+
}
|
|
32
|
+
`;
|
|
33
|
+
StyledRangeInputContainer.defaultProps = defaultThemeProp;
|
|
3
34
|
const StyledInput = styled.input(({ theme: { base, components } }) => {
|
|
4
35
|
return css `
|
|
5
36
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.styles.js","sourceRoot":"","sources":["../../../src/components/Input/Input.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"Input.styles.js","sourceRoot":"","sources":["../../../src/components/Input/Input.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC,GAAG,CAAA;;;IAG/C,iBAAiB;;;;;QAKb,iBAAiB;;;;;;;;;MASnB,iBAAiB;;;;;;;;;;;CAWtB,CAAC;AAEF,yBAAyB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE1D,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE;IACnE,OAAO,GAAG,CAAA;;cAEE,UAAU,CAAC,KAAK,CAAC,MAAM;kBACnB,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,CAAC;iBAC9B,UAAU,CAAC,KAAK,CAAC,OAAO;;;;;;oBAMrB,IAAI,CAAC,UAAU,CAAC,CAAC,YAAY,CAAC;;GAE/C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,WAAW,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE5C,eAAe,WAAW,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport { StyledFormControl } from '../FormControl';\n\nexport const StyledRangeInputContainer = styled.div`\n gap: 1rem;\n\n ${StyledFormControl} {\n position: relative;\n }\n\n > :first-child {\n > ${StyledFormControl}:after {\n content: '-';\n position: absolute;\n width: 1rem;\n inset-inline-end: -1rem;\n text-align: center;\n }\n }\n\n > ${StyledFormControl}:first-child:after {\n content: '-';\n position: absolute;\n width: 1rem;\n inset-inline-end: -1rem;\n text-align: center;\n }\n\n > * {\n flex-grow: 1;\n }\n`;\n\nStyledRangeInputContainer.defaultProps = defaultThemeProp;\n\nconst StyledInput = styled.input(({ theme: { base, components } }) => {\n return css`\n width: 100%;\n height: ${components.input.height};\n min-height: ${base['hit-area']['mouse-min']};\n padding: 0 ${components.input.padding};\n appearance: none;\n -webkit-appearance: none;\n text-align: inherit;\n\n @media (pointer: coarse) {\n min-height: ${base['hit-area']['finger-min']};\n }\n `;\n});\n\nStyledInput.defaultProps = defaultThemeProp;\n\nexport default StyledInput;\n"]}
|
|
@@ -27,8 +27,11 @@ export interface LinkProps extends BaseProps {
|
|
|
27
27
|
/** Ref for the wrapping element. */
|
|
28
28
|
ref?: Ref<HTMLAnchorElement>;
|
|
29
29
|
}
|
|
30
|
-
export declare const StyledLinkPopover: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
30
|
+
export declare const StyledLinkPopover: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
31
|
+
preview: boolean;
|
|
32
|
+
}, never>;
|
|
31
33
|
export declare const StyledLinkPopoverBtn: import("styled-components").StyledComponent<FunctionComponent<import("../Button/BareButton").BareButtonProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
34
|
+
export declare const StyledLinkPreviewPopoverBtn: import("styled-components").StyledComponent<FunctionComponent<import("../Button/BareButton").BareButtonProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
32
35
|
export declare const StyledLink: import("styled-components").StyledComponent<FunctionComponent<ButtonProps & ForwardProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
33
36
|
declare const Link: FunctionComponent<LinkProps & ForwardProps>;
|
|
34
37
|
export default Link;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../../src/components/Link/Link.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,iBAAiB,EACjB,GAAG,EAMJ,MAAM,OAAO,CAAC;AAIf,OAAe,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAkBtD,MAAM,WAAW,SAAU,SAAQ,SAAS;IAC1C,oCAAoC;IACpC,QAAQ,EAAE,SAAS,CAAC;IACpB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC,SAAS,CAAC,CAAC;IACjC;;;OAGG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IAC3B,mFAAmF;IACnF,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,iFAAiF;IACjF,SAAS,CAAC,E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