@databricks/design-system 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.pkgr-sources-hash +1 -1
- package/dist/cjs/index.js +71 -21
- package/dist/cjs/index.js.map +1 -1
- package/dist/design-system/Hooks/index.d.ts +1 -0
- package/dist/design-system/Hooks/useThemedStyles.d.ts +28 -0
- package/dist/index-dark.css +294 -294
- package/dist/index.css +294 -294
- package/dist/index.js +70 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -52373,15 +52373,15 @@ const antdGeneralVariables = {
|
|
|
52373
52373
|
};
|
|
52374
52374
|
var generalVariables = antdGeneralVariables;
|
|
52375
52375
|
|
|
52376
|
-
const FONT_SIZE_BASE =
|
|
52376
|
+
const FONT_SIZE_BASE = 13; // Less variables that are used by AntD
|
|
52377
52377
|
|
|
52378
52378
|
const antdTypography = {
|
|
52379
|
-
fontSizeSm:
|
|
52379
|
+
fontSizeSm: FONT_SIZE_BASE - 2,
|
|
52380
52380
|
fontSizeBase: FONT_SIZE_BASE,
|
|
52381
52381
|
fontSizeMd: FONT_SIZE_BASE,
|
|
52382
|
-
fontSizeLg:
|
|
52383
|
-
fontSizeXl:
|
|
52384
|
-
fontSizeXxl:
|
|
52382
|
+
fontSizeLg: FONT_SIZE_BASE + 6,
|
|
52383
|
+
fontSizeXl: FONT_SIZE_BASE + 8,
|
|
52384
|
+
fontSizeXxl: FONT_SIZE_BASE + 18,
|
|
52385
52385
|
lineHeightSm: '16px',
|
|
52386
52386
|
lineHeightBase: '20px',
|
|
52387
52387
|
lineHeightMd: '20px',
|
|
@@ -52453,6 +52453,43 @@ function WithDesignSystemThemeHoc(Component) {
|
|
|
52453
52453
|
};
|
|
52454
52454
|
}
|
|
52455
52455
|
|
|
52456
|
+
/**
|
|
52457
|
+
* A helper hook that allows quick creation of theme-dependent styles.
|
|
52458
|
+
* Results in more compact code than using useMemo and
|
|
52459
|
+
* useDesignSystemTheme separately.
|
|
52460
|
+
*
|
|
52461
|
+
* @example
|
|
52462
|
+
* const styles = useThemedStyles((theme) => ({
|
|
52463
|
+
* overlay: {
|
|
52464
|
+
* backgroundColor: theme.colors.backgroundPrimary,
|
|
52465
|
+
* borderRadius: theme.borders.borderRadiusMd,
|
|
52466
|
+
* },
|
|
52467
|
+
* wrapper: {
|
|
52468
|
+
* display: 'flex',
|
|
52469
|
+
* gap: theme.spacing.md,
|
|
52470
|
+
* },
|
|
52471
|
+
* }));
|
|
52472
|
+
|
|
52473
|
+
* <div css={styles.overlay}>...</div>
|
|
52474
|
+
*
|
|
52475
|
+
* @param styleFactory Factory function that accepts theme object as a parameter and returns
|
|
52476
|
+
* the style object. **Note**: factory function body is being memoized internally and is intended
|
|
52477
|
+
* to be used only for simple style objects that depend solely on the theme. If you want to use
|
|
52478
|
+
* styles that change depending on external values (state, props etc.) you should use
|
|
52479
|
+
* `useDesignSystemTheme` directly with your own reaction mechanism.
|
|
52480
|
+
* @returns The constructed style object
|
|
52481
|
+
*/
|
|
52482
|
+
|
|
52483
|
+
const useThemedStyles = styleFactory => {
|
|
52484
|
+
const {
|
|
52485
|
+
theme
|
|
52486
|
+
} = useDesignSystemTheme(); // We can assume that the factory function won't change and we're
|
|
52487
|
+
// observing theme changes only.
|
|
52488
|
+
|
|
52489
|
+
const styleFactoryRef = useRef(styleFactory);
|
|
52490
|
+
return useMemo$1(() => styleFactoryRef.current(theme), [theme]);
|
|
52491
|
+
};
|
|
52492
|
+
|
|
52456
52493
|
const DuboisContextDefaults = {
|
|
52457
52494
|
enableAnimation: false,
|
|
52458
52495
|
theme: 'default',
|
|
@@ -53296,6 +53333,12 @@ function getCollapseEmotionStyles(clsPrefix, theme) {
|
|
|
53296
53333
|
[classContentBox]: {
|
|
53297
53334
|
padding: '8px 16px 16px'
|
|
53298
53335
|
},
|
|
53336
|
+
...(theme.options.isCompact && {
|
|
53337
|
+
["& > ".concat(classItem, " > ").concat(classHeader)]: {
|
|
53338
|
+
padding: '6px 44px 6px 0',
|
|
53339
|
+
lineHeight: theme.typography.lineHeightBase
|
|
53340
|
+
}
|
|
53341
|
+
}),
|
|
53299
53342
|
...getAnimationCss(theme.options.enableAnimation)
|
|
53300
53343
|
};
|
|
53301
53344
|
return /*#__PURE__*/css$1(styles, process.env.NODE_ENV === "production" ? "" : ";label:getCollapseEmotionStyles;");
|
|
@@ -53917,7 +53960,7 @@ var DropdownMenu = /*#__PURE__*/Object.freeze({
|
|
|
53917
53960
|
IconWrapper: IconWrapper
|
|
53918
53961
|
});
|
|
53919
53962
|
|
|
53920
|
-
const
|
|
53963
|
+
const getFormItemEmotionStyles = _ref => {
|
|
53921
53964
|
let {
|
|
53922
53965
|
theme,
|
|
53923
53966
|
clsPrefix
|
|
@@ -53931,7 +53974,8 @@ const getFormEmotionStyles = _ref => {
|
|
|
53931
53974
|
lineHeight: theme.typography.lineHeightBase
|
|
53932
53975
|
},
|
|
53933
53976
|
[clsFormItemExplain]: {
|
|
53934
|
-
fontSize: theme.typography.fontSizeSm
|
|
53977
|
+
fontSize: theme.typography.fontSizeSm,
|
|
53978
|
+
margin: 0
|
|
53935
53979
|
},
|
|
53936
53980
|
[clsFormItemInputControl]: {
|
|
53937
53981
|
minHeight: theme.options.isCompact ? theme.general.heightSm : theme.general.heightBase
|
|
@@ -53940,7 +53984,7 @@ const getFormEmotionStyles = _ref => {
|
|
|
53940
53984
|
border: 'none'
|
|
53941
53985
|
},
|
|
53942
53986
|
...getAnimationCss(theme.options.enableAnimation)
|
|
53943
|
-
}, process.env.NODE_ENV === "production" ? "" : ";label:
|
|
53987
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:getFormItemEmotionStyles;");
|
|
53944
53988
|
};
|
|
53945
53989
|
|
|
53946
53990
|
const FormDubois = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
@@ -53948,26 +53992,28 @@ const FormDubois = /*#__PURE__*/forwardRef(function Form(_ref2, ref) {
|
|
|
53948
53992
|
dangerouslySetAntdProps,
|
|
53949
53993
|
...props
|
|
53950
53994
|
} = _ref2;
|
|
53951
|
-
const {
|
|
53952
|
-
theme,
|
|
53953
|
-
classNamePrefix
|
|
53954
|
-
} = useDesignSystemTheme();
|
|
53955
53995
|
const mergedProps = { ...props,
|
|
53956
53996
|
layout: props.layout || 'vertical',
|
|
53957
53997
|
requiredMark: props.requiredMark || false
|
|
53958
53998
|
};
|
|
53959
53999
|
return jsx(AntDForm, { ...mergedProps,
|
|
53960
54000
|
ref: ref,
|
|
53961
|
-
css: getFormEmotionStyles({
|
|
53962
|
-
theme,
|
|
53963
|
-
clsPrefix: classNamePrefix
|
|
53964
|
-
}),
|
|
53965
54001
|
...dangerouslySetAntdProps
|
|
53966
54002
|
});
|
|
53967
54003
|
});
|
|
53968
54004
|
|
|
53969
|
-
const FormItem = props =>
|
|
53970
|
-
|
|
54005
|
+
const FormItem = props => {
|
|
54006
|
+
const {
|
|
54007
|
+
theme,
|
|
54008
|
+
classNamePrefix
|
|
54009
|
+
} = useDesignSystemTheme();
|
|
54010
|
+
return jsx(AntDForm.Item, { ...props,
|
|
54011
|
+
css: getFormItemEmotionStyles({
|
|
54012
|
+
theme,
|
|
54013
|
+
clsPrefix: classNamePrefix
|
|
54014
|
+
})
|
|
54015
|
+
});
|
|
54016
|
+
};
|
|
53971
54017
|
|
|
53972
54018
|
const FormNamespace = Object.assign(FormDubois, {
|
|
53973
54019
|
Item: FormItem,
|
|
@@ -54336,7 +54382,6 @@ const getModalEmotionStyles = args => {
|
|
|
54336
54382
|
const bodyMaxHeight = "calc(".concat(modalMaxHeight, " - ").concat(headerHeight, "px - ").concat(footerHeight, "px - ").concat(contentBottomPadding, "px)");
|
|
54337
54383
|
return /*#__PURE__*/css$1({
|
|
54338
54384
|
[classNameHeader]: {
|
|
54339
|
-
height: headerHeight,
|
|
54340
54385
|
paddingTop: theme.options.isCompact ? theme.spacing.md : MODAL_PADDING$1,
|
|
54341
54386
|
paddingLeft: theme.options.isCompact ? theme.spacing.lg : MODAL_PADDING$1,
|
|
54342
54387
|
paddingRight: theme.options.isCompact ? theme.spacing.md : MODAL_PADDING$1,
|
|
@@ -54391,9 +54436,10 @@ const getModalEmotionStyles = args => {
|
|
|
54391
54436
|
fontSize: theme.typography.fontSizeXl,
|
|
54392
54437
|
lineHeight: theme.typography.lineHeightXl,
|
|
54393
54438
|
fontWeight: theme.typography.typographyBoldFontWeight,
|
|
54439
|
+
paddingRight: MODAL_PADDING$1,
|
|
54394
54440
|
// Don't impact regular size
|
|
54395
54441
|
...(theme.options.isCompact && {
|
|
54396
|
-
|
|
54442
|
+
minHeight: headerHeight / 2,
|
|
54397
54443
|
display: 'flex',
|
|
54398
54444
|
alignItems: 'center'
|
|
54399
54445
|
})
|
|
@@ -54402,7 +54448,9 @@ const getModalEmotionStyles = args => {
|
|
|
54402
54448
|
maxHeight: modalMaxHeight,
|
|
54403
54449
|
height: maxedOutHeight ? modalMaxHeight : '',
|
|
54404
54450
|
overflow: 'hidden',
|
|
54405
|
-
paddingBottom: contentBottomPadding
|
|
54451
|
+
paddingBottom: contentBottomPadding,
|
|
54452
|
+
display: 'flex',
|
|
54453
|
+
flexDirection: 'column'
|
|
54406
54454
|
},
|
|
54407
54455
|
[classNameBody]: {
|
|
54408
54456
|
overflowY: 'auto',
|
|
@@ -56412,5 +56460,5 @@ Typography.Title = Title;
|
|
|
56412
56460
|
Typography.Paragraph = Paragraph;
|
|
56413
56461
|
Typography.Link = AntDTypography.Link;
|
|
56414
56462
|
|
|
56415
|
-
export { AIcon, Alert, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ApplyCompactDesignSystemTheme, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowsUpDownIcon, AutoComplete, BarChartIcon, BeakerIcon, BookIcon, BookmarkBorderIcon, BookmarkFillIcon, Breadcrumb, BriefcaseFillIcon, BriefcaseIcon, Button, CalendarEventIcon, CalendarIcon, CaretDownSquareIcon, CaretUpSquareIcon, CheckCircleBorderIcon, CheckCircleFillIcon, CheckIcon, CheckLineIcon, Checkbox, ChecklistIcon, ChevronDoubleDownIcon, ChevronDoubleLeftIcon, ChevronDoubleRightIcon, ChevronDoubleUpIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardIcon, Clock1Icon, ClockIcon, CloseIcon, CloudDownloadIcon, CloudIcon, CloudOffIcon, CloudUploadIcon, ClusterIcon, ClustersIcon, CodeIcon, Col, Collapse, CollapsePanel, CopyIcon, DIcon, DangerModal, DashIcon, DashboardIcon, DataIcon, DatabaseIcon, DesignSystemContext, DesignSystemProvider, DownloadIcon, DragIcon, Dropdown, DropdownMenu, DuboisDatePicker, ErrorBorderIcon, ErrorFillIcon, ExpandLessIcon, ExpandMoreIcon, ExperimentIcon, FeatureStoreIcon, FileCodeIcon, FileDocumentIcon, FileIcon, FileImageIcon, FileModelIcon, FilterIcon, Folder1Icon, FolderIcon, ForkIcon, Form, FormDubois, FullscreenExitIcon, FullscreenIcon, Gear1Icon, GearIcon, GridDashIcon, GridIcon, H1Icon, H2Icon, H3Icon, Header$1 as Header, HistoryIcon, HomeIcon, Icon, ImageIcon, IndentDecreaseIcon, IndentIncreaseIcon, InfoBorderIcon, InfoFillIcon, Input, KeyboardIcon, LayerIcon, Layout, LegacyDatePicker, LifesaverIcon, LightningIcon, LinkIcon, LinkRemoveIcon, ListBorderIcon, ListIcon, LoadingIcon, LockBorderIcon, LockFillIcon, LockUnlockedIcon, MIcon, Menu, MinusBoxIcon, MinusCircleBorderIcon, MinusCircleFillIcon, Modal, ModelsIcon, NewWindowIcon, NoIcon, NotebookIcon, NotificationIcon, NotificationsIcon, OfficeIcon, Option, OverflowIcon, PageBottomIcon, PageFirstIcon, PageLastIcon, PageTopIcon, PageWrapper, Pagination, PencilIcon, PinBorderIcon, PinCancelIcon, PinFillIcon, PinXIcon, PlayCircleBorderIcon, PlayCircleFillIcon, PlayIcon, PlusCircleBorderIcon, PlusCircleFillIcon, PlusIcon, PlusSquareIcon, Popover, QueryEditorIcon, QueryIcon, QueryListViewIcon, QueryNavIcon, QuestionMarkBorderIcon, QuestionMarkFillIcon, ROW_GUTTER_SIZE, Radio, ReaderModeIcon, ReposIcon, Row, SchoolIcon, Search1Icon, SearchIcon, SecurityIcon, SegmentedControlButton, SegmentedControlGroup, Select, ShareIcon, SidebarAutoIcon, SidebarCollapseIcon, SidebarExpandIcon, SidebarIcon, Skeleton, Space, Spacer, SpeechBubbleIcon, SpeechBubblePlusIcon, Spinner, SplitButton, StarBorderIcon, StarFillIcon, StopCircleBorderIcon, StopCricleFillIcon, StopIcon, StreamIcon, Switch, SyncIcon, TabPane, Table, TableIcon, Tabs, Tag, Tooltip, TrashIcon, Tree, TreeIcon, Typography, UploadIcon, UsbIcon, UserBadgeIcon, UserCircleIcon, UserGroupIcon, UserIcon, VideosIcon, WarningBorderIcon, WarningFillIcon, WithDesignSystemThemeHoc, XCircleBorderIcon, XCircleFillIcon, ZoomInIcon, ZoomOutIcon, __INTERNAL_DO_NOT_USE__FormItem, __INTERNAL_DO_NOT_USE__Group, __INTERNAL_DO_NOT_USE__HorizontalGroup, __INTERNAL_DO_NOT_USE__Option, __INTERNAL_DO_NOT_USE__Password, __INTERNAL_DO_NOT_USE__TextArea, __INTERNAL_DO_NOT_USE__VerticalGroup, getAnimationCss, getButtonEmotionStyles, getPaginationEmotionStyles, getTabEmotionStyles, useDesignSystemTheme, useNotification };
|
|
56463
|
+
export { AIcon, Alert, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ApplyCompactDesignSystemTheme, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowsUpDownIcon, AutoComplete, BarChartIcon, BeakerIcon, BookIcon, BookmarkBorderIcon, BookmarkFillIcon, Breadcrumb, BriefcaseFillIcon, BriefcaseIcon, Button, CalendarEventIcon, CalendarIcon, CaretDownSquareIcon, CaretUpSquareIcon, CheckCircleBorderIcon, CheckCircleFillIcon, CheckIcon, CheckLineIcon, Checkbox, ChecklistIcon, ChevronDoubleDownIcon, ChevronDoubleLeftIcon, ChevronDoubleRightIcon, ChevronDoubleUpIcon, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CircleIcon, ClipboardIcon, Clock1Icon, ClockIcon, CloseIcon, CloudDownloadIcon, CloudIcon, CloudOffIcon, CloudUploadIcon, ClusterIcon, ClustersIcon, CodeIcon, Col, Collapse, CollapsePanel, CopyIcon, DIcon, DangerModal, DashIcon, DashboardIcon, DataIcon, DatabaseIcon, DesignSystemContext, DesignSystemProvider, DownloadIcon, DragIcon, Dropdown, DropdownMenu, DuboisDatePicker, ErrorBorderIcon, ErrorFillIcon, ExpandLessIcon, ExpandMoreIcon, ExperimentIcon, FeatureStoreIcon, FileCodeIcon, FileDocumentIcon, FileIcon, FileImageIcon, FileModelIcon, FilterIcon, Folder1Icon, FolderIcon, ForkIcon, Form, FormDubois, FullscreenExitIcon, FullscreenIcon, Gear1Icon, GearIcon, GridDashIcon, GridIcon, H1Icon, H2Icon, H3Icon, Header$1 as Header, HistoryIcon, HomeIcon, Icon, ImageIcon, IndentDecreaseIcon, IndentIncreaseIcon, InfoBorderIcon, InfoFillIcon, Input, KeyboardIcon, LayerIcon, Layout, LegacyDatePicker, LifesaverIcon, LightningIcon, LinkIcon, LinkRemoveIcon, ListBorderIcon, ListIcon, LoadingIcon, LockBorderIcon, LockFillIcon, LockUnlockedIcon, MIcon, Menu, MinusBoxIcon, MinusCircleBorderIcon, MinusCircleFillIcon, Modal, ModelsIcon, NewWindowIcon, NoIcon, NotebookIcon, NotificationIcon, NotificationsIcon, OfficeIcon, Option, OverflowIcon, PageBottomIcon, PageFirstIcon, PageLastIcon, PageTopIcon, PageWrapper, Pagination, PencilIcon, PinBorderIcon, PinCancelIcon, PinFillIcon, PinXIcon, PlayCircleBorderIcon, PlayCircleFillIcon, PlayIcon, PlusCircleBorderIcon, PlusCircleFillIcon, PlusIcon, PlusSquareIcon, Popover, QueryEditorIcon, QueryIcon, QueryListViewIcon, QueryNavIcon, QuestionMarkBorderIcon, QuestionMarkFillIcon, ROW_GUTTER_SIZE, Radio, ReaderModeIcon, ReposIcon, Row, SchoolIcon, Search1Icon, SearchIcon, SecurityIcon, SegmentedControlButton, SegmentedControlGroup, Select, ShareIcon, SidebarAutoIcon, SidebarCollapseIcon, SidebarExpandIcon, SidebarIcon, Skeleton, Space, Spacer, SpeechBubbleIcon, SpeechBubblePlusIcon, Spinner, SplitButton, StarBorderIcon, StarFillIcon, StopCircleBorderIcon, StopCricleFillIcon, StopIcon, StreamIcon, Switch, SyncIcon, TabPane, Table, TableIcon, Tabs, Tag, Tooltip, TrashIcon, Tree, TreeIcon, Typography, UploadIcon, UsbIcon, UserBadgeIcon, UserCircleIcon, UserGroupIcon, UserIcon, VideosIcon, WarningBorderIcon, WarningFillIcon, WithDesignSystemThemeHoc, XCircleBorderIcon, XCircleFillIcon, ZoomInIcon, ZoomOutIcon, __INTERNAL_DO_NOT_USE__FormItem, __INTERNAL_DO_NOT_USE__Group, __INTERNAL_DO_NOT_USE__HorizontalGroup, __INTERNAL_DO_NOT_USE__Option, __INTERNAL_DO_NOT_USE__Password, __INTERNAL_DO_NOT_USE__TextArea, __INTERNAL_DO_NOT_USE__VerticalGroup, getAnimationCss, getButtonEmotionStyles, getPaginationEmotionStyles, getTabEmotionStyles, useDesignSystemTheme, useNotification, useThemedStyles };
|
|
56416
56464
|
//# sourceMappingURL=index.js.map
|