@bolio-ui/core 1.0.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/LICENSE +21 -0
- package/README.md +71 -0
- package/dist/avatar/index.js +901 -0
- package/dist/badge/index.js +899 -0
- package/dist/bolio-ui-provider/index.js +1883 -0
- package/dist/breadcrumbs/index.js +985 -0
- package/dist/button/index.js +1358 -0
- package/dist/button-dropdown/index.js +1111 -0
- package/dist/button-group/index.js +782 -0
- package/dist/capacity/index.js +780 -0
- package/dist/card/index.js +1275 -0
- package/dist/checkbox/index.js +1042 -0
- package/dist/code/index.js +803 -0
- package/dist/col/index.js +90 -0
- package/dist/collapse/index.js +1158 -0
- package/dist/container/index.js +444 -0
- package/dist/css-baseline/index.js +348 -0
- package/dist/description/index.js +741 -0
- package/dist/display/index.js +745 -0
- package/dist/divider/index.js +767 -0
- package/dist/dot/index.js +755 -0
- package/dist/drawer/index.js +1513 -0
- package/dist/fieldset/index.js +1089 -0
- package/dist/grid/index.js +870 -0
- package/dist/image/index.js +1094 -0
- package/dist/index.js +9970 -0
- package/dist/input/index.js +1275 -0
- package/dist/keyboard/index.js +711 -0
- package/dist/link/index.js +863 -0
- package/dist/loading/index.js +765 -0
- package/dist/mdx-widgets/index.js +438 -0
- package/dist/modal/index.js +2220 -0
- package/dist/note/index.js +773 -0
- package/dist/page/index.js +928 -0
- package/dist/pagination/index.js +1201 -0
- package/dist/popover/index.js +1502 -0
- package/dist/progress/index.js +804 -0
- package/dist/radio/index.js +1028 -0
- package/dist/rating/index.js +912 -0
- package/dist/row/index.js +442 -0
- package/dist/section/index.js +733 -0
- package/dist/select/index.js +1865 -0
- package/dist/slider/index.js +1097 -0
- package/dist/snippet/index.js +1207 -0
- package/dist/spacer/index.js +692 -0
- package/dist/spinner/index.js +763 -0
- package/dist/styled-jsx.cjs.js +766 -0
- package/dist/tabs/index.js +1125 -0
- package/dist/tag/index.js +749 -0
- package/dist/text/index.js +830 -0
- package/dist/textarea/index.js +915 -0
- package/dist/themes/index.js +319 -0
- package/dist/toggle/index.js +852 -0
- package/dist/tooltip/index.js +1353 -0
- package/dist/use-all-themes/index.js +335 -0
- package/dist/use-body-scroll/index.js +173 -0
- package/dist/use-classes/index.js +55 -0
- package/dist/use-click-away/index.js +28 -0
- package/dist/use-clipboard/index.js +188 -0
- package/dist/use-current-state/index.js +90 -0
- package/dist/use-input/index.js +129 -0
- package/dist/use-keyboard/index.js +214 -0
- package/dist/use-media-query/index.js +495 -0
- package/dist/use-modal/index.js +114 -0
- package/dist/use-scale/index.js +673 -0
- package/dist/use-tabs/index.js +112 -0
- package/dist/use-theme/index.js +333 -0
- package/dist/use-toasts/index.js +236 -0
- package/esm/avatar/avatar-group.js +29 -0
- package/esm/avatar/avatar.js +107 -0
- package/esm/avatar/avatar.skeleton.js +21 -0
- package/esm/avatar/helpers.js +16 -0
- package/esm/avatar/index.js +4 -0
- package/esm/avatar/stories.js +113 -0
- package/esm/badge/badge-anchor.js +70 -0
- package/esm/badge/badge.js +58 -0
- package/esm/badge/index.js +4 -0
- package/esm/badge/stories.js +92 -0
- package/esm/bolio-ui-provider/bolio-ui-provider.js +62 -0
- package/esm/bolio-ui-provider/index.js +2 -0
- package/esm/bolio-ui-provider/theme-provider.js +47 -0
- package/esm/breadcrumbs/breadcrumbs-item.js +49 -0
- package/esm/breadcrumbs/breadcrumbs-separator.js +25 -0
- package/esm/breadcrumbs/breadcrumbs.js +47 -0
- package/esm/breadcrumbs/index.js +6 -0
- package/esm/breadcrumbs/stories.js +51 -0
- package/esm/button/button-icon.js +29 -0
- package/esm/button/button-loading.js +17 -0
- package/esm/button/button.drip.js +57 -0
- package/esm/button/button.js +146 -0
- package/esm/button/index.js +2 -0
- package/esm/button/stories.js +221 -0
- package/esm/button/styles.js +232 -0
- package/esm/button/utils.js +46 -0
- package/esm/button-dropdown/button-dropdown-context.js +11 -0
- package/esm/button-dropdown/button-dropdown-item.js +52 -0
- package/esm/button-dropdown/button-dropdown.js +111 -0
- package/esm/button-dropdown/icon.js +30 -0
- package/esm/button-dropdown/index.js +4 -0
- package/esm/button-dropdown/stories.js +92 -0
- package/esm/button-dropdown/styles.js +60 -0
- package/esm/button-group/button-group-context.js +9 -0
- package/esm/button-group/button-group.js +75 -0
- package/esm/button-group/index.js +2 -0
- package/esm/button-group/stories.js +66 -0
- package/esm/capacity/capacity.js +52 -0
- package/esm/capacity/index.js +2 -0
- package/esm/capacity/stories.js +55 -0
- package/esm/card/card-content.js +28 -0
- package/esm/card/card-footer.js +36 -0
- package/esm/card/card.js +68 -0
- package/esm/card/index.js +8 -0
- package/esm/card/stories.js +126 -0
- package/esm/card/styles.js +45 -0
- package/esm/checkbox/checkbox-context.js +10 -0
- package/esm/checkbox/checkbox-group.js +70 -0
- package/esm/checkbox/checkbox.icon.js +50 -0
- package/esm/checkbox/checkbox.js +114 -0
- package/esm/checkbox/index.js +4 -0
- package/esm/checkbox/stories.js +84 -0
- package/esm/checkbox/styles.js +34 -0
- package/esm/code/code.js +57 -0
- package/esm/code/index.js +2 -0
- package/esm/code/stories.js +53 -0
- package/esm/col/col.js +29 -0
- package/esm/col/index.js +2 -0
- package/esm/collapse/collapse-context.js +8 -0
- package/esm/collapse/collapse-group.js +75 -0
- package/esm/collapse/collapse-icon.js +28 -0
- package/esm/collapse/collapse.js +93 -0
- package/esm/collapse/index.js +4 -0
- package/esm/collapse/stories.js +48 -0
- package/esm/container/container.js +62 -0
- package/esm/container/index.js +2 -0
- package/esm/css-baseline/css-baseline.js +18 -0
- package/esm/css-baseline/index.js +1 -0
- package/esm/description/description.js +39 -0
- package/esm/description/index.js +2 -0
- package/esm/description/stories.js +23 -0
- package/esm/display/display.js +43 -0
- package/esm/display/index.js +2 -0
- package/esm/divider/divider.js +65 -0
- package/esm/divider/index.js +2 -0
- package/esm/divider/stories.js +41 -0
- package/esm/dot/dot.js +53 -0
- package/esm/dot/index.js +2 -0
- package/esm/dot/stories.js +40 -0
- package/esm/drawer/drawer-wrapper.js +86 -0
- package/esm/drawer/drawer.js +77 -0
- package/esm/drawer/helper.js +27 -0
- package/esm/drawer/index.js +8 -0
- package/esm/drawer/stories.js +79 -0
- package/esm/fieldset/fieldset-content.js +29 -0
- package/esm/fieldset/fieldset-context.js +9 -0
- package/esm/fieldset/fieldset-footer.js +30 -0
- package/esm/fieldset/fieldset-group.js +88 -0
- package/esm/fieldset/fieldset-subtitle.js +21 -0
- package/esm/fieldset/fieldset-title.js +23 -0
- package/esm/fieldset/fieldset.js +96 -0
- package/esm/fieldset/index.js +13 -0
- package/esm/fieldset/stories.js +72 -0
- package/esm/grid/basic-item.js +96 -0
- package/esm/grid/grid-container.js +46 -0
- package/esm/grid/grid-types.js +6 -0
- package/esm/grid/grid.js +37 -0
- package/esm/grid/index.js +4 -0
- package/esm/grid/stories.js +212 -0
- package/esm/icon/stories.js +36 -0
- package/esm/image/helpers.js +16 -0
- package/esm/image/image-browser-https-icon.js +23 -0
- package/esm/image/image-browser.js +86 -0
- package/esm/image/image.js +91 -0
- package/esm/image/image.skeleton.js +21 -0
- package/esm/image/index.js +4 -0
- package/esm/image/stories.js +73 -0
- package/esm/image/styles.js +15 -0
- package/esm/index.js +69 -0
- package/esm/input/index.js +6 -0
- package/esm/input/input-block-label.js +18 -0
- package/esm/input/input-icon-clear.js +47 -0
- package/esm/input/input-icon.js +19 -0
- package/esm/input/input-label.js +18 -0
- package/esm/input/input-props.js +12 -0
- package/esm/input/input.js +179 -0
- package/esm/input/password-icon.js +30 -0
- package/esm/input/password.js +66 -0
- package/esm/input/stories.js +113 -0
- package/esm/input/styles.js +41 -0
- package/esm/keyboard/index.js +2 -0
- package/esm/keyboard/keyboard.js +48 -0
- package/esm/keyboard/stories.js +43 -0
- package/esm/link/icon.js +30 -0
- package/esm/link/index.js +2 -0
- package/esm/link/link.js +50 -0
- package/esm/link/stories.js +59 -0
- package/esm/loading/index.js +2 -0
- package/esm/loading/loading.js +63 -0
- package/esm/loading/stories.js +75 -0
- package/esm/mdx-widgets/index.js +2 -0
- package/esm/mdx-widgets/mock-page.js +37 -0
- package/esm/mdx-widgets/parsed-codes/index.js +1 -0
- package/esm/mdx-widgets/parsed-codes/wait-time.js +13 -0
- package/esm/modal/index.js +10 -0
- package/esm/modal/modal-action.js +76 -0
- package/esm/modal/modal-actions.js +39 -0
- package/esm/modal/modal-content.js +28 -0
- package/esm/modal/modal-context.js +6 -0
- package/esm/modal/modal-subtitle.js +30 -0
- package/esm/modal/modal-title.js +30 -0
- package/esm/modal/modal-wrapper.js +80 -0
- package/esm/modal/modal.js +104 -0
- package/esm/modal/stories.js +165 -0
- package/esm/note/index.js +2 -0
- package/esm/note/note.js +71 -0
- package/esm/note/stories.js +68 -0
- package/esm/page/index.js +9 -0
- package/esm/page/page-content.js +26 -0
- package/esm/page/page-footer.js +25 -0
- package/esm/page/page-header.js +33 -0
- package/esm/page/page.js +88 -0
- package/esm/page/stories.js +54 -0
- package/esm/pagination/index.js +6 -0
- package/esm/pagination/pagination-context.js +8 -0
- package/esm/pagination/pagination-ellipsis.js +73 -0
- package/esm/pagination/pagination-item.js +50 -0
- package/esm/pagination/pagination-next.js +25 -0
- package/esm/pagination/pagination-pages.js +90 -0
- package/esm/pagination/pagination-previous.js +25 -0
- package/esm/pagination/pagination.js +105 -0
- package/esm/pagination/stories.js +49 -0
- package/esm/popover/index.js +5 -0
- package/esm/popover/popover-context.js +9 -0
- package/esm/popover/popover-item.js +65 -0
- package/esm/popover/popover.js +83 -0
- package/esm/popover/stories.js +84 -0
- package/esm/progress/index.js +2 -0
- package/esm/progress/progress.js +76 -0
- package/esm/progress/stories.js +114 -0
- package/esm/radio/index.js +7 -0
- package/esm/radio/radio-context.js +9 -0
- package/esm/radio/radio-description.js +30 -0
- package/esm/radio/radio-group.js +61 -0
- package/esm/radio/radio.js +123 -0
- package/esm/radio/stories.js +98 -0
- package/esm/radio/styles.js +41 -0
- package/esm/rating/index.js +2 -0
- package/esm/rating/rating-icon.js +20 -0
- package/esm/rating/rating.js +115 -0
- package/esm/rating/stories.js +72 -0
- package/esm/row/index.js +2 -0
- package/esm/row/row.js +60 -0
- package/esm/section/index.js +2 -0
- package/esm/section/section.js +30 -0
- package/esm/select/index.js +4 -0
- package/esm/select/select-context.js +9 -0
- package/esm/select/select-dropdown.js +41 -0
- package/esm/select/select-icon-clear.js +41 -0
- package/esm/select/select-icon.js +23 -0
- package/esm/select/select-input.js +34 -0
- package/esm/select/select-multiple-value.js +23 -0
- package/esm/select/select-option.js +100 -0
- package/esm/select/select.js +244 -0
- package/esm/select/stories.js +239 -0
- package/esm/select/styles.js +48 -0
- package/esm/shared/backdrop.js +77 -0
- package/esm/shared/css-transition.js +71 -0
- package/esm/shared/dropdown.js +109 -0
- package/esm/shared/ellipsis.js +15 -0
- package/esm/shared/expand.js +95 -0
- package/esm/shared/highlight.js +47 -0
- package/esm/slider/index.js +2 -0
- package/esm/slider/slider-dot.js +27 -0
- package/esm/slider/slider-mark.js +38 -0
- package/esm/slider/slider.js +163 -0
- package/esm/slider/stories.js +134 -0
- package/esm/slider/styles.js +27 -0
- package/esm/snippet/index.js +2 -0
- package/esm/snippet/snippet-icon.js +27 -0
- package/esm/snippet/snippet.js +100 -0
- package/esm/snippet/stories.js +133 -0
- package/esm/snippet/styles.js +58 -0
- package/esm/spacer/index.js +2 -0
- package/esm/spacer/spacer.js +28 -0
- package/esm/spacer/stories.js +54 -0
- package/esm/spinner/index.js +2 -0
- package/esm/spinner/spinner.js +46 -0
- package/esm/spinner/stories.js +13 -0
- package/esm/styled-jsx-server.es.js +5 -0
- package/esm/styled-jsx.es.js +757 -0
- package/esm/tabs/index.js +5 -0
- package/esm/tabs/stories.js +92 -0
- package/esm/tabs/tabs-context.js +8 -0
- package/esm/tabs/tabs-item.js +80 -0
- package/esm/tabs/tabs.js +151 -0
- package/esm/tag/index.js +2 -0
- package/esm/tag/stories.js +58 -0
- package/esm/tag/tag.js +86 -0
- package/esm/text/child.js +78 -0
- package/esm/text/index.js +2 -0
- package/esm/text/stories.js +104 -0
- package/esm/text/text.js +94 -0
- package/esm/textarea/index.js +2 -0
- package/esm/textarea/stories.js +104 -0
- package/esm/textarea/textarea.js +116 -0
- package/esm/themes/index.js +2 -0
- package/esm/themes/presets/dark.js +67 -0
- package/esm/themes/presets/default.js +67 -0
- package/esm/themes/presets/index.js +1 -0
- package/esm/themes/presets/shared.js +42 -0
- package/esm/themes/themes.js +89 -0
- package/esm/toggle/index.js +2 -0
- package/esm/toggle/stories.js +55 -0
- package/esm/toggle/styles.js +27 -0
- package/esm/toggle/toggle.js +82 -0
- package/esm/tooltip/helper.js +21 -0
- package/esm/tooltip/index.js +2 -0
- package/esm/tooltip/placement.js +160 -0
- package/esm/tooltip/stories.js +183 -0
- package/esm/tooltip/styles.js +18 -0
- package/esm/tooltip/tooltip-content.js +83 -0
- package/esm/tooltip/tooltip-icon.js +32 -0
- package/esm/tooltip/tooltip.js +132 -0
- package/esm/use-all-themes/all-themes-context.js +9 -0
- package/esm/use-all-themes/index.js +2 -0
- package/esm/use-body-scroll/index.js +2 -0
- package/esm/use-body-scroll/use-body-scroll.js +70 -0
- package/esm/use-classes/index.js +2 -0
- package/esm/use-classes/use-classes.js +41 -0
- package/esm/use-click-away/index.js +2 -0
- package/esm/use-click-away/use-click-away.js +22 -0
- package/esm/use-clipboard/index.js +2 -0
- package/esm/use-clipboard/use-clipboard.js +46 -0
- package/esm/use-current-state/index.js +2 -0
- package/esm/use-current-state/use-current-state.js +26 -0
- package/esm/use-input/index.js +2 -0
- package/esm/use-input/use-input.js +32 -0
- package/esm/use-keyboard/codes.js +97 -0
- package/esm/use-keyboard/helper.js +26 -0
- package/esm/use-keyboard/index.js +4 -0
- package/esm/use-keyboard/use-keyboard.js +79 -0
- package/esm/use-media-query/index.js +2 -0
- package/esm/use-media-query/use-media-query.js +90 -0
- package/esm/use-modal/index.js +2 -0
- package/esm/use-modal/use-modal.js +26 -0
- package/esm/use-scale/index.js +6 -0
- package/esm/use-scale/scale-context.js +37 -0
- package/esm/use-scale/utils.js +62 -0
- package/esm/use-scale/with-scale.js +114 -0
- package/esm/use-tabs/index.js +2 -0
- package/esm/use-tabs/use-tabs.js +24 -0
- package/esm/use-theme/index.js +2 -0
- package/esm/use-theme/theme-context.js +7 -0
- package/esm/use-toasts/helpers.js +72 -0
- package/esm/use-toasts/index.js +2 -0
- package/esm/use-toasts/toast-container.js +127 -0
- package/esm/use-toasts/toast-item.js +48 -0
- package/esm/use-toasts/use-toast.js +124 -0
- package/esm/utils/calculations.js +27 -0
- package/esm/utils/collections.js +138 -0
- package/esm/utils/color.js +43 -0
- package/esm/utils/layouts.js +82 -0
- package/esm/utils/prop-types.js +22 -0
- package/esm/utils/types.js +1 -0
- package/esm/utils/use-body-scroll.js +2 -0
- package/esm/utils/use-bolio-ui-context.js +27 -0
- package/esm/utils/use-click-anywhere.js +16 -0
- package/esm/utils/use-click-away.js +2 -0
- package/esm/utils/use-clipboard.js +2 -0
- package/esm/utils/use-context-state/create-bolio-ui-context.js +57 -0
- package/esm/utils/use-context-state/use-context-state.js +44 -0
- package/esm/utils/use-current-state.js +2 -0
- package/esm/utils/use-default-props.js +22 -0
- package/esm/utils/use-dom-observer.js +28 -0
- package/esm/utils/use-drag.js +75 -0
- package/esm/utils/use-portal.js +40 -0
- package/esm/utils/use-previous.js +11 -0
- package/esm/utils/use-real-shape.js +53 -0
- package/esm/utils/use-resize.js +21 -0
- package/esm/utils/use-ssr.js +20 -0
- package/esm/utils/use-warning.js +17 -0
- package/package.json +140 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["disabled", "type", "ghost", "vertical", "children", "className"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import useTheme from '../use-theme';
|
|
7
|
+
import { ButtonGroupContext } from './button-group-context';
|
|
8
|
+
import useScale, { withScale } from '../use-scale';
|
|
9
|
+
import useClasses from '../use-classes';
|
|
10
|
+
var defaultProps = {
|
|
11
|
+
disabled: false,
|
|
12
|
+
vertical: false,
|
|
13
|
+
ghost: false,
|
|
14
|
+
type: 'default',
|
|
15
|
+
className: ''
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var getGroupBorderColors = function getGroupBorderColors(palette, props) {
|
|
19
|
+
var ghost = props.ghost,
|
|
20
|
+
type = props.type;
|
|
21
|
+
if (!ghost && type !== 'default') return palette.background;
|
|
22
|
+
var colors = {
|
|
23
|
+
"default": palette.border,
|
|
24
|
+
success: palette.success,
|
|
25
|
+
secondary: palette.secondary,
|
|
26
|
+
error: palette.error,
|
|
27
|
+
warning: palette.warning
|
|
28
|
+
};
|
|
29
|
+
var withoutLightType = type === null || type === void 0 ? void 0 : type.replace('-light', '');
|
|
30
|
+
return colors[withoutLightType] || colors["default"];
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
function ButtonGroupComponent(groupProps) {
|
|
34
|
+
var theme = useTheme();
|
|
35
|
+
|
|
36
|
+
var _useScale = useScale(),
|
|
37
|
+
SCALES = _useScale.SCALES;
|
|
38
|
+
|
|
39
|
+
var disabled = groupProps.disabled,
|
|
40
|
+
type = groupProps.type,
|
|
41
|
+
ghost = groupProps.ghost,
|
|
42
|
+
vertical = groupProps.vertical,
|
|
43
|
+
children = groupProps.children,
|
|
44
|
+
className = groupProps.className,
|
|
45
|
+
props = _objectWithoutProperties(groupProps, _excluded);
|
|
46
|
+
|
|
47
|
+
var initialValue = useMemo(function () {
|
|
48
|
+
return {
|
|
49
|
+
disabled: disabled,
|
|
50
|
+
type: type,
|
|
51
|
+
ghost: ghost,
|
|
52
|
+
isButtonGroup: true
|
|
53
|
+
};
|
|
54
|
+
}, [disabled, ghost, type]);
|
|
55
|
+
var border = useMemo(function () {
|
|
56
|
+
return getGroupBorderColors(theme.palette, groupProps);
|
|
57
|
+
}, [theme.palette, groupProps]);
|
|
58
|
+
var classes = useClasses('btn-group', {
|
|
59
|
+
vertical: vertical,
|
|
60
|
+
horizontal: !vertical
|
|
61
|
+
}, className);
|
|
62
|
+
return /*#__PURE__*/React.createElement(ButtonGroupContext.Provider, {
|
|
63
|
+
value: initialValue
|
|
64
|
+
}, /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
65
|
+
className: _JSXStyle.dynamic([["3583665674", [theme.layout.radius, border, SCALES.width(1, 'auto'), SCALES.height(1, 'min-content'), SCALES.mt(0.313), SCALES.mr(0.313), SCALES.mb(0.313), SCALES.ml(0.313), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), border, border]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
66
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
67
|
+
id: "3583665674",
|
|
68
|
+
dynamic: [theme.layout.radius, border, SCALES.width(1, 'auto'), SCALES.height(1, 'min-content'), SCALES.mt(0.313), SCALES.mr(0.313), SCALES.mb(0.313), SCALES.ml(0.313), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), border, border]
|
|
69
|
+
}, ".btn-group.__jsx-style-dynamic-selector{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;border-radius:".concat(theme.layout.radius, ";border:1px solid ").concat(border, ";background-color:transparent;overflow:hidden;width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'min-content'), ";margin:").concat(SCALES.mt(0.313), " ").concat(SCALES.mr(0.313), " ").concat(SCALES.mb(0.313), " ").concat(SCALES.ml(0.313), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";}.vertical.__jsx-style-dynamic-selector{-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;}.btn-group.__jsx-style-dynamic-selector .btn{border:none;}.btn-group.__jsx-style-dynamic-selector .btn .text{top:0;}.horizontal.__jsx-style-dynamic-selector .btn:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0;border-left:1px solid ").concat(border, ";}.horizontal.__jsx-style-dynamic-selector .btn:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0;}.vertical.__jsx-style-dynamic-selector .btn:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-top:1px solid ").concat(border, ";}.vertical.__jsx-style-dynamic-selector .btn:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;}"))));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
ButtonGroupComponent.defaultProps = defaultProps;
|
|
73
|
+
ButtonGroupComponent.displayName = 'BolioUIButtonGroup';
|
|
74
|
+
var ButtonGroup = withScale(ButtonGroupComponent);
|
|
75
|
+
export default ButtonGroup;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import ButtonGroup from '.';
|
|
2
|
+
import Button from '../button';
|
|
3
|
+
import Grid from '../grid';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Data Entry/ButtonGroup',
|
|
6
|
+
component: ButtonGroup
|
|
7
|
+
};
|
|
8
|
+
export var Default = function Default() {
|
|
9
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
10
|
+
gap: 2
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(Button, null, "One"), /*#__PURE__*/React.createElement(Button, null, "Two"), /*#__PURE__*/React.createElement(Button, null, "Three"))));
|
|
12
|
+
};
|
|
13
|
+
export var Variant = function Variant() {
|
|
14
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
15
|
+
gap: 2
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
17
|
+
type: "success"
|
|
18
|
+
}, /*#__PURE__*/React.createElement(Button, null, "One"), /*#__PURE__*/React.createElement(Button, null, "Two"), /*#__PURE__*/React.createElement(Button, null, "Three"))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
19
|
+
type: "abort"
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Action1"), /*#__PURE__*/React.createElement(Button, null, "Action2"))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
21
|
+
type: "warning",
|
|
22
|
+
ghost: true
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Button, null, "Action1"), /*#__PURE__*/React.createElement(Button, null, "Action2"))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
24
|
+
type: "success-light"
|
|
25
|
+
}, /*#__PURE__*/React.createElement(Button, null, "One"), /*#__PURE__*/React.createElement(Button, null, "Two"), /*#__PURE__*/React.createElement(Button, null, "Three"))));
|
|
26
|
+
};
|
|
27
|
+
export var Sizes = function Sizes() {
|
|
28
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
29
|
+
gap: 2
|
|
30
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
31
|
+
scale: 2 / 3
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
33
|
+
scale: 2 / 3
|
|
34
|
+
}, "One"), /*#__PURE__*/React.createElement(Button, {
|
|
35
|
+
scale: 2 / 3
|
|
36
|
+
}, "Two"), /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
scale: 2 / 3
|
|
38
|
+
}, "Three"))), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
39
|
+
scale: 1 / 3
|
|
40
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
41
|
+
scale: 1 / 3
|
|
42
|
+
}, "Action1"), /*#__PURE__*/React.createElement(Button, {
|
|
43
|
+
scale: 1 / 3
|
|
44
|
+
}, "Action2"))));
|
|
45
|
+
};
|
|
46
|
+
export var Vertical = function Vertical() {
|
|
47
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
48
|
+
gap: 2
|
|
49
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
50
|
+
vertical: true
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Button, null, "One"), /*#__PURE__*/React.createElement(Button, null, "Two"), /*#__PURE__*/React.createElement(Button, null, "Three"), /*#__PURE__*/React.createElement(Button, null, "Four"))));
|
|
52
|
+
};
|
|
53
|
+
export var Disabled = function Disabled() {
|
|
54
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
55
|
+
gap: 2
|
|
56
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(ButtonGroup, {
|
|
57
|
+
scale: 0.5,
|
|
58
|
+
disabled: true
|
|
59
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
60
|
+
scale: 0.5
|
|
61
|
+
}, "One"), /*#__PURE__*/React.createElement(Button, {
|
|
62
|
+
scale: 0.5
|
|
63
|
+
}, "Two"), /*#__PURE__*/React.createElement(Button, {
|
|
64
|
+
scale: 0.5
|
|
65
|
+
}, "Three"))));
|
|
66
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["value", "limit", "color", "className"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import useTheme from '../use-theme';
|
|
7
|
+
import { useProportions } from '../utils/calculations';
|
|
8
|
+
import useScale, { withScale } from '../use-scale';
|
|
9
|
+
import useClasses from '../use-classes';
|
|
10
|
+
|
|
11
|
+
var getColor = function getColor(val, palette) {
|
|
12
|
+
if (val < 33) return palette.info;
|
|
13
|
+
if (val < 66) return palette.warning;
|
|
14
|
+
return palette.errorDark;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
function CapacityComponent(_ref) {
|
|
18
|
+
var _ref$value = _ref.value,
|
|
19
|
+
value = _ref$value === void 0 ? 0 : _ref$value,
|
|
20
|
+
_ref$limit = _ref.limit,
|
|
21
|
+
limit = _ref$limit === void 0 ? 100 : _ref$limit,
|
|
22
|
+
userColor = _ref.color,
|
|
23
|
+
_ref$className = _ref.className,
|
|
24
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
25
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
26
|
+
|
|
27
|
+
var theme = useTheme();
|
|
28
|
+
|
|
29
|
+
var _useScale = useScale(),
|
|
30
|
+
SCALES = _useScale.SCALES;
|
|
31
|
+
|
|
32
|
+
var percentValue = useProportions(value, limit);
|
|
33
|
+
var classes = useClasses('capacity', className);
|
|
34
|
+
var color = useMemo(function () {
|
|
35
|
+
if (userColor && userColor !== '') return userColor;
|
|
36
|
+
return getColor(percentValue, theme.palette);
|
|
37
|
+
}, [userColor, percentValue, theme.palette]);
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
39
|
+
title: "".concat(percentValue, "%")
|
|
40
|
+
}, props, {
|
|
41
|
+
className: _JSXStyle.dynamic([["3589142679", [SCALES.width(3.125), SCALES.height(0.625), theme.layout.radius, theme.palette.accents_2, SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), percentValue, color]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
42
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
43
|
+
className: _JSXStyle.dynamic([["3589142679", [SCALES.width(3.125), SCALES.height(0.625), theme.layout.radius, theme.palette.accents_2, SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), percentValue, color]]])
|
|
44
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
45
|
+
id: "3589142679",
|
|
46
|
+
dynamic: [SCALES.width(3.125), SCALES.height(0.625), theme.layout.radius, theme.palette.accents_2, SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), percentValue, color]
|
|
47
|
+
}, ".capacity.__jsx-style-dynamic-selector{width:".concat(SCALES.width(3.125), ";height:").concat(SCALES.height(0.625), ";border-radius:").concat(theme.layout.radius, ";overflow:hidden;background-color:").concat(theme.palette.accents_2, ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}span.__jsx-style-dynamic-selector{width:").concat(percentValue, "%;background-color:").concat(color, ";height:100%;margin:0;padding:0;display:block;}")));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
CapacityComponent.displayName = 'BolioUICapacity';
|
|
51
|
+
var Capacity = withScale(CapacityComponent);
|
|
52
|
+
export default Capacity;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import useTheme from '../use-theme';
|
|
2
|
+
import Capacity from '.';
|
|
3
|
+
import Grid from '../grid';
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Data Display/Capacity',
|
|
6
|
+
component: Capacity
|
|
7
|
+
};
|
|
8
|
+
export var Default = function Default() {
|
|
9
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
10
|
+
gap: 2
|
|
11
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
12
|
+
value: 15,
|
|
13
|
+
width: "200px"
|
|
14
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
15
|
+
value: 45,
|
|
16
|
+
width: "200px"
|
|
17
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
18
|
+
value: 95,
|
|
19
|
+
width: "200px"
|
|
20
|
+
})));
|
|
21
|
+
};
|
|
22
|
+
export var FixedColor = function FixedColor() {
|
|
23
|
+
var theme = useTheme();
|
|
24
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
25
|
+
gap: 2
|
|
26
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
27
|
+
value: 75,
|
|
28
|
+
color: theme.palette.foreground,
|
|
29
|
+
width: "200px"
|
|
30
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
31
|
+
value: 75,
|
|
32
|
+
color: theme.palette.primary,
|
|
33
|
+
width: "200px"
|
|
34
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
35
|
+
value: 75,
|
|
36
|
+
color: theme.palette.secondary,
|
|
37
|
+
width: "200px"
|
|
38
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
39
|
+
value: 75,
|
|
40
|
+
color: theme.palette.success,
|
|
41
|
+
width: "200px"
|
|
42
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
43
|
+
value: 75,
|
|
44
|
+
color: theme.palette.warning,
|
|
45
|
+
width: "200px"
|
|
46
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
47
|
+
value: 75,
|
|
48
|
+
color: theme.palette.error,
|
|
49
|
+
width: "200px"
|
|
50
|
+
})), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Capacity, {
|
|
51
|
+
value: 75,
|
|
52
|
+
color: theme.palette.info,
|
|
53
|
+
width: "200px"
|
|
54
|
+
})));
|
|
55
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["className", "children"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import useScale, { withScale } from '../use-scale';
|
|
7
|
+
import useClasses from '../use-classes';
|
|
8
|
+
|
|
9
|
+
function CardContentComponent(_ref) {
|
|
10
|
+
var _ref$className = _ref.className,
|
|
11
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
12
|
+
children = _ref.children,
|
|
13
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
|
|
15
|
+
var _useScale = useScale(),
|
|
16
|
+
SCALES = _useScale.SCALES;
|
|
17
|
+
|
|
18
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
19
|
+
className: _JSXStyle.dynamic([["3819126313", [SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(1), SCALES.pr(1), SCALES.pb(1), SCALES.pl(1), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || useClasses('content', className) || "")
|
|
20
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
21
|
+
id: "3819126313",
|
|
22
|
+
dynamic: [SCALES.width(1, '100%'), SCALES.height(1, 'auto'), SCALES.pt(1), SCALES.pr(1), SCALES.pb(1), SCALES.pl(1), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
23
|
+
}, ".content.__jsx-style-dynamic-selector{width:".concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(1), " ").concat(SCALES.pr(1), " ").concat(SCALES.pb(1), " ").concat(SCALES.pl(1), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.content.__jsx-style-dynamic-selector>p:first-child{margin-top:0;}.content.__jsx-style-dynamic-selector>p:last-child{margin-bottom:0;}")));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
CardContentComponent.displayName = 'BolioUICardContent';
|
|
27
|
+
var CardContent = withScale(CardContentComponent);
|
|
28
|
+
export default CardContent;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "className", "disableAutoMargin"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import useTheme from '../use-theme';
|
|
7
|
+
import useScale, { withScale } from '../use-scale';
|
|
8
|
+
import useClasses from '../use-classes';
|
|
9
|
+
|
|
10
|
+
function CardFooterComponent(_ref) {
|
|
11
|
+
var children = _ref.children,
|
|
12
|
+
_ref$className = _ref.className,
|
|
13
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
14
|
+
_ref$disableAutoMargi = _ref.disableAutoMargin,
|
|
15
|
+
disableAutoMargin = _ref$disableAutoMargi === void 0 ? false : _ref$disableAutoMargi,
|
|
16
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
|
|
18
|
+
var theme = useTheme();
|
|
19
|
+
|
|
20
|
+
var _useScale = useScale(),
|
|
21
|
+
SCALES = _useScale.SCALES;
|
|
22
|
+
|
|
23
|
+
var classes = useClasses({
|
|
24
|
+
'auto-margin': !disableAutoMargin
|
|
25
|
+
}, className);
|
|
26
|
+
return /*#__PURE__*/React.createElement("footer", _extends({}, props, {
|
|
27
|
+
className: _JSXStyle.dynamic([["2898207213", [SCALES.py(0.66), SCALES.px(1.31), SCALES.font(0.875), theme.palette.border, theme.layout.radius, theme.layout.radius, SCALES.height(3.3), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.layout.gapQuarter]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
28
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
29
|
+
id: "2898207213",
|
|
30
|
+
dynamic: [SCALES.py(0.66), SCALES.px(1.31), SCALES.font(0.875), theme.palette.border, theme.layout.radius, theme.layout.radius, SCALES.height(3.3), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), theme.layout.gapQuarter]
|
|
31
|
+
}, "footer.__jsx-style-dynamic-selector{padding:".concat(SCALES.py(0.66), " ").concat(SCALES.px(1.31), ";display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;overflow:hidden;color:inherit;background-color:inherit;font-size:").concat(SCALES.font(0.875), ";border-top:1px solid ").concat(theme.palette.border, ";border-bottom-left-radius:").concat(theme.layout.radius, ";border-bottom-right-radius:").concat(theme.layout.radius, ";min-height:").concat(SCALES.height(3.3), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.auto-margin.__jsx-style-dynamic-selector *{margin-top:0;margin-bottom:0;margin-right:").concat(theme.layout.gapQuarter, ";}")));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
CardFooterComponent.displayName = 'BolioUICardFooter';
|
|
35
|
+
var CardFooter = withScale(CardFooterComponent);
|
|
36
|
+
export default CardFooter;
|
package/esm/card/card.js
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
var _excluded = ["children", "hoverable", "className", "shadow", "type"];
|
|
5
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import useTheme from '../use-theme';
|
|
8
|
+
import { getStyles } from './styles';
|
|
9
|
+
import CardFooter from './card-footer';
|
|
10
|
+
import CardContent from './card-content';
|
|
11
|
+
import Image from '../image';
|
|
12
|
+
import { hasChild, pickChild } from '../utils/collections';
|
|
13
|
+
import useScale, { withScale } from '../use-scale';
|
|
14
|
+
import useClasses from '../use-classes';
|
|
15
|
+
|
|
16
|
+
function CardComponent(_ref) {
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
_ref$hoverable = _ref.hoverable,
|
|
19
|
+
hoverable = _ref$hoverable === void 0 ? false : _ref$hoverable,
|
|
20
|
+
_ref$className = _ref.className,
|
|
21
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
22
|
+
_ref$shadow = _ref.shadow,
|
|
23
|
+
shadow = _ref$shadow === void 0 ? false : _ref$shadow,
|
|
24
|
+
_ref$type = _ref.type,
|
|
25
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
26
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
27
|
+
|
|
28
|
+
var theme = useTheme();
|
|
29
|
+
|
|
30
|
+
var _useScale = useScale(),
|
|
31
|
+
SCALES = _useScale.SCALES;
|
|
32
|
+
|
|
33
|
+
var hoverShadow = useMemo(function () {
|
|
34
|
+
if (shadow) return theme.expressiveness.shadowMedium;
|
|
35
|
+
return hoverable ? theme.expressiveness.shadowSmall : 'none';
|
|
36
|
+
}, [hoverable, shadow, theme.expressiveness]);
|
|
37
|
+
|
|
38
|
+
var _useMemo = useMemo(function () {
|
|
39
|
+
return getStyles(type, theme.palette, shadow);
|
|
40
|
+
}, [type, theme.palette, shadow]),
|
|
41
|
+
color = _useMemo.color,
|
|
42
|
+
bgColor = _useMemo.bgColor,
|
|
43
|
+
borderColor = _useMemo.borderColor;
|
|
44
|
+
|
|
45
|
+
var _pickChild = pickChild(children, CardFooter),
|
|
46
|
+
_pickChild2 = _slicedToArray(_pickChild, 2),
|
|
47
|
+
withoutFooterChildren = _pickChild2[0],
|
|
48
|
+
footerChildren = _pickChild2[1];
|
|
49
|
+
|
|
50
|
+
var _pickChild3 = pickChild(withoutFooterChildren, Image),
|
|
51
|
+
_pickChild4 = _slicedToArray(_pickChild3, 2),
|
|
52
|
+
withoutImageChildren = _pickChild4[0],
|
|
53
|
+
imageChildren = _pickChild4[1];
|
|
54
|
+
|
|
55
|
+
var hasContent = hasChild(withoutImageChildren, CardContent);
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
57
|
+
className: _JSXStyle.dynamic([["1458732320", [theme.layout.radius, shadow ? theme.expressiveness.shadowSmall : 'none', color, bgColor, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverShadow]]]) + " " + (props && props.className != null && props.className || useClasses('card', className) || "")
|
|
58
|
+
}), imageChildren, hasContent ? withoutImageChildren : /*#__PURE__*/React.createElement(CardContent, {
|
|
59
|
+
className: "card"
|
|
60
|
+
}, withoutImageChildren), footerChildren, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
61
|
+
id: "1458732320",
|
|
62
|
+
dynamic: [theme.layout.radius, shadow ? theme.expressiveness.shadowSmall : 'none', color, bgColor, SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0), hoverShadow]
|
|
63
|
+
}, ".card.__jsx-style-dynamic-selector{-webkit-transition:all 0.2s ease;transition:all 0.2s ease;border-radius:".concat(theme.layout.radius, ";box-shadow:").concat(shadow ? theme.expressiveness.shadowSmall : 'none', ";box-sizing:border-box;color:").concat(color, ";background-color:").concat(bgColor, ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0), " ").concat(SCALES.pr(0), " ").concat(SCALES.pb(0), " ").concat(SCALES.pl(0), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.card.__jsx-style-dynamic-selector:hover{box-shadow:").concat(hoverShadow, ";}.card.__jsx-style-dynamic-selector img{width:100%;}.card.__jsx-style-dynamic-selector .image{border-bottom-left-radius:0;border-bottom-right-radius:0;}")));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
CardComponent.displayName = 'BolioUICard';
|
|
67
|
+
var Card = withScale(CardComponent);
|
|
68
|
+
export default Card;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import Card from '.';
|
|
2
|
+
import Text from '../text';
|
|
3
|
+
import Grid from '../grid';
|
|
4
|
+
import Link from '../link';
|
|
5
|
+
import Image from '../image';
|
|
6
|
+
import Code from '../code';
|
|
7
|
+
import Divider from '../divider';
|
|
8
|
+
export default {
|
|
9
|
+
title: 'Surface/Card',
|
|
10
|
+
component: Card
|
|
11
|
+
};
|
|
12
|
+
export var Default = function Default() {
|
|
13
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
14
|
+
gap: 2
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Card, null, "A default card.")));
|
|
16
|
+
};
|
|
17
|
+
export var Hover = function Hover() {
|
|
18
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
19
|
+
gap: 2
|
|
20
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Card, {
|
|
21
|
+
hoverable: true
|
|
22
|
+
}, "A hover default card.")));
|
|
23
|
+
};
|
|
24
|
+
export var Shadow = function Shadow() {
|
|
25
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
26
|
+
gap: 2
|
|
27
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Card, {
|
|
28
|
+
shadow: true
|
|
29
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
30
|
+
h4: true,
|
|
31
|
+
my: 0
|
|
32
|
+
}, "React is declarative"), /*#__PURE__*/React.createElement(Text, null, "React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes."), /*#__PURE__*/React.createElement(Text, null, "Declarative views make your code more predictable and easier to debug."))));
|
|
33
|
+
};
|
|
34
|
+
export var Variants = function Variants() {
|
|
35
|
+
var tuple = function tuple() {
|
|
36
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
+
args[_key] = arguments[_key];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return args;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var types = tuple('default', 'primary', 'secondary', 'success', 'warning', 'error', 'dark', 'lite', 'info');
|
|
44
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
45
|
+
gap: 2
|
|
46
|
+
}, types.map(function (type) {
|
|
47
|
+
return /*#__PURE__*/React.createElement(Grid, {
|
|
48
|
+
xs: 6,
|
|
49
|
+
md: 4,
|
|
50
|
+
key: type
|
|
51
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
52
|
+
type: type,
|
|
53
|
+
width: "100%"
|
|
54
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
55
|
+
h4: true,
|
|
56
|
+
my: 0,
|
|
57
|
+
style: {
|
|
58
|
+
textTransform: 'uppercase'
|
|
59
|
+
}
|
|
60
|
+
}, type), /*#__PURE__*/React.createElement(Text, null, type)));
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
export var WithFooter = function WithFooter() {
|
|
64
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
65
|
+
gap: 2
|
|
66
|
+
}, /*#__PURE__*/React.createElement(Grid, {
|
|
67
|
+
xs: 12,
|
|
68
|
+
justify: "center"
|
|
69
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
70
|
+
width: "100%"
|
|
71
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
72
|
+
h4: true,
|
|
73
|
+
my: 0
|
|
74
|
+
}, "Bolio UI"), /*#__PURE__*/React.createElement(Text, null, "More creative and fun with amazing features for React."), /*#__PURE__*/React.createElement(Card.Footer, null, /*#__PURE__*/React.createElement(Link, {
|
|
75
|
+
color: true,
|
|
76
|
+
target: "_blank",
|
|
77
|
+
href: "https://github.com/bolio-ui/bolio-ui"
|
|
78
|
+
}, "Visit source code on GitHub.")))), /*#__PURE__*/React.createElement(Grid, {
|
|
79
|
+
xs: 12,
|
|
80
|
+
justify: "center"
|
|
81
|
+
}, /*#__PURE__*/React.createElement(Card, {
|
|
82
|
+
width: "100%",
|
|
83
|
+
type: "dark"
|
|
84
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
85
|
+
h4: true,
|
|
86
|
+
my: 0
|
|
87
|
+
}, "Bolio UI"), /*#__PURE__*/React.createElement(Text, null, "More creative and fun with amazing features for React."), /*#__PURE__*/React.createElement(Card.Footer, null, /*#__PURE__*/React.createElement(Link, {
|
|
88
|
+
target: "_blank",
|
|
89
|
+
href: "https://github.com/bolio-ui/bolio-ui"
|
|
90
|
+
}, "Visit source code on GitHub.")))));
|
|
91
|
+
};
|
|
92
|
+
export var WithImage = function WithImage() {
|
|
93
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
94
|
+
gap: 2
|
|
95
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Card, {
|
|
96
|
+
width: "350px"
|
|
97
|
+
}, /*#__PURE__*/React.createElement(Image, {
|
|
98
|
+
src: "https://images.pexels.com/photos/1779487/pexels-photo-1779487.jpeg",
|
|
99
|
+
width: "350px",
|
|
100
|
+
draggable: false
|
|
101
|
+
}), /*#__PURE__*/React.createElement(Text, {
|
|
102
|
+
h4: true,
|
|
103
|
+
mb: 0,
|
|
104
|
+
mt: 0
|
|
105
|
+
}, "Bolio UI"), /*#__PURE__*/React.createElement(Text, {
|
|
106
|
+
type: "secondary",
|
|
107
|
+
small: true
|
|
108
|
+
}, "More creative and fun with amazing features for React."), /*#__PURE__*/React.createElement(Card.Footer, null, /*#__PURE__*/React.createElement(Link, {
|
|
109
|
+
block: true,
|
|
110
|
+
target: "_blank",
|
|
111
|
+
href: "https://github.com/bolio-ui/bolio-ui"
|
|
112
|
+
}, "Visit source code on GitHub.")))));
|
|
113
|
+
};
|
|
114
|
+
export var WithDivider = function WithDivider() {
|
|
115
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
116
|
+
gap: 2
|
|
117
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Card, {
|
|
118
|
+
width: "400px"
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Card.Content, null, /*#__PURE__*/React.createElement(Text, {
|
|
120
|
+
b: true,
|
|
121
|
+
my: 0
|
|
122
|
+
}, "A Simple Component")), /*#__PURE__*/React.createElement(Divider, {
|
|
123
|
+
h: "1px",
|
|
124
|
+
my: 0
|
|
125
|
+
}), /*#__PURE__*/React.createElement(Card.Content, null, /*#__PURE__*/React.createElement(Text, null, "React components implement a ", /*#__PURE__*/React.createElement(Code, null, "render()"), " method that takes input data and returns what to display. This example uses an XML-like syntax called JSX. Input data that is passed into the component can be accessed by ", /*#__PURE__*/React.createElement(Code, null, "render()"), " via", ' ', /*#__PURE__*/React.createElement(Code, null, "this.props"), ".")))));
|
|
126
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
export var getStyles = function getStyles(type, palette, isShadow) {
|
|
3
|
+
var colors = {
|
|
4
|
+
"default": {
|
|
5
|
+
color: palette.foreground,
|
|
6
|
+
bgColor: palette.accents_1
|
|
7
|
+
},
|
|
8
|
+
dark: {
|
|
9
|
+
color: palette.background,
|
|
10
|
+
bgColor: palette.foreground
|
|
11
|
+
},
|
|
12
|
+
primary: {
|
|
13
|
+
color: palette.background,
|
|
14
|
+
bgColor: palette.primary
|
|
15
|
+
},
|
|
16
|
+
secondary: {
|
|
17
|
+
color: palette.background,
|
|
18
|
+
bgColor: palette.secondary
|
|
19
|
+
},
|
|
20
|
+
success: {
|
|
21
|
+
color: palette.background,
|
|
22
|
+
bgColor: palette.success
|
|
23
|
+
},
|
|
24
|
+
warning: {
|
|
25
|
+
color: palette.background,
|
|
26
|
+
bgColor: palette.warning
|
|
27
|
+
},
|
|
28
|
+
error: {
|
|
29
|
+
color: palette.background,
|
|
30
|
+
bgColor: palette.error
|
|
31
|
+
},
|
|
32
|
+
lite: {
|
|
33
|
+
color: palette.foreground,
|
|
34
|
+
bgColor: palette.background
|
|
35
|
+
},
|
|
36
|
+
info: {
|
|
37
|
+
color: palette.background,
|
|
38
|
+
bgColor: palette.info
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
var showBorder = type === 'default' && !isShadow;
|
|
42
|
+
return _extends({}, colors[type], {
|
|
43
|
+
borderColor: showBorder ? palette.border : 'transparent'
|
|
44
|
+
});
|
|
45
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var defaultContext = {
|
|
3
|
+
disabledAll: false,
|
|
4
|
+
inGroup: false,
|
|
5
|
+
values: []
|
|
6
|
+
};
|
|
7
|
+
export var CheckboxContext = /*#__PURE__*/React.createContext(defaultContext);
|
|
8
|
+
export var useCheckbox = function useCheckbox() {
|
|
9
|
+
return React.useContext(CheckboxContext);
|
|
10
|
+
};
|