@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
package/esm/note/note.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "type", "label", "filled", "className"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
import useTheme from '../use-theme';
|
|
7
|
+
import useScale, { withScale } from '../use-scale';
|
|
8
|
+
import useClasses from '../use-classes';
|
|
9
|
+
|
|
10
|
+
var getStatusColor = function getStatusColor(type, filled, theme) {
|
|
11
|
+
var colors = {
|
|
12
|
+
"default": theme.palette.accents_6,
|
|
13
|
+
primary: theme.palette.primary,
|
|
14
|
+
secondary: theme.palette.secondary,
|
|
15
|
+
success: theme.palette.success,
|
|
16
|
+
warning: theme.palette.warning,
|
|
17
|
+
error: theme.palette.error,
|
|
18
|
+
info: theme.palette.info
|
|
19
|
+
};
|
|
20
|
+
var statusColor = colors[type];
|
|
21
|
+
if (!filled) return {
|
|
22
|
+
color: statusColor || theme.palette.foreground,
|
|
23
|
+
borderColor: statusColor || theme.palette.border,
|
|
24
|
+
bgColor: theme.palette.background
|
|
25
|
+
};
|
|
26
|
+
var filledColor = statusColor ? 'white' : theme.palette.background;
|
|
27
|
+
return {
|
|
28
|
+
color: filledColor,
|
|
29
|
+
borderColor: statusColor || theme.palette.foreground,
|
|
30
|
+
bgColor: statusColor || theme.palette.foreground
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function NoteComponent(_ref) {
|
|
35
|
+
var children = _ref.children,
|
|
36
|
+
_ref$type = _ref.type,
|
|
37
|
+
type = _ref$type === void 0 ? 'default' : _ref$type,
|
|
38
|
+
_ref$label = _ref.label,
|
|
39
|
+
label = _ref$label === void 0 ? 'note' : _ref$label,
|
|
40
|
+
_ref$filled = _ref.filled,
|
|
41
|
+
filled = _ref$filled === void 0 ? false : _ref$filled,
|
|
42
|
+
_ref$className = _ref.className,
|
|
43
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
44
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
45
|
+
|
|
46
|
+
var theme = useTheme();
|
|
47
|
+
|
|
48
|
+
var _useScale = useScale(),
|
|
49
|
+
SCALES = _useScale.SCALES;
|
|
50
|
+
|
|
51
|
+
var _useMemo = useMemo(function () {
|
|
52
|
+
return getStatusColor(type, filled, theme);
|
|
53
|
+
}, [type, filled, theme]),
|
|
54
|
+
color = _useMemo.color,
|
|
55
|
+
borderColor = _useMemo.borderColor,
|
|
56
|
+
bgColor = _useMemo.bgColor;
|
|
57
|
+
|
|
58
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, props, {
|
|
59
|
+
className: _JSXStyle.dynamic([["114493384", [borderColor, color, bgColor, theme.layout.radius, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0.667), SCALES.pr(1.32), SCALES.pb(0.667), SCALES.pl(1.32), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || useClasses('note', className) || "")
|
|
60
|
+
}), label && /*#__PURE__*/React.createElement("span", {
|
|
61
|
+
className: _JSXStyle.dynamic([["114493384", [borderColor, color, bgColor, theme.layout.radius, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0.667), SCALES.pr(1.32), SCALES.pb(0.667), SCALES.pl(1.32), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + "label"
|
|
62
|
+
}, /*#__PURE__*/React.createElement("b", {
|
|
63
|
+
className: _JSXStyle.dynamic([["114493384", [borderColor, color, bgColor, theme.layout.radius, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0.667), SCALES.pr(1.32), SCALES.pb(0.667), SCALES.pl(1.32), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]])
|
|
64
|
+
}, label, ":")), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
65
|
+
id: "114493384",
|
|
66
|
+
dynamic: [borderColor, color, bgColor, theme.layout.radius, SCALES.font(0.875), SCALES.width(1, 'auto'), SCALES.height(1, 'auto'), SCALES.pt(0.667), SCALES.pr(1.32), SCALES.pb(0.667), SCALES.pl(1.32), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
67
|
+
}, ".note.__jsx-style-dynamic-selector{line-height:1.8;border:1px solid ".concat(borderColor, ";color:").concat(color, ";background-color:").concat(bgColor, ";border-radius:").concat(theme.layout.radius, ";font-size:").concat(SCALES.font(0.875), ";width:").concat(SCALES.width(1, 'auto'), ";height:").concat(SCALES.height(1, 'auto'), ";padding:").concat(SCALES.pt(0.667), " ").concat(SCALES.pr(1.32), " ").concat(SCALES.pb(0.667), " ").concat(SCALES.pl(1.32), ";margin:").concat(SCALES.mt(0), " ").concat(SCALES.mr(0), " ").concat(SCALES.mb(0), " ").concat(SCALES.ml(0), ";}.note.__jsx-style-dynamic-selector p{margin:0;}.label.__jsx-style-dynamic-selector{text-transform:uppercase;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:1.5;padding-right:0.38em;}")));
|
|
68
|
+
}
|
|
69
|
+
NoteComponent.displayName = 'BolioUINote';
|
|
70
|
+
var Note = withScale(NoteComponent);
|
|
71
|
+
export default Note;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Note from '.';
|
|
2
|
+
import Grid from '../grid';
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Feedback/Note',
|
|
5
|
+
component: Note
|
|
6
|
+
};
|
|
7
|
+
export var Default = function Default() {
|
|
8
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
9
|
+
gap: 2
|
|
10
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, null, "Check payment pending.")));
|
|
11
|
+
};
|
|
12
|
+
export var Types = function Types() {
|
|
13
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
14
|
+
gap: 2
|
|
15
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, null, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
16
|
+
type: "primary"
|
|
17
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
18
|
+
type: "secondary"
|
|
19
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
20
|
+
type: "success"
|
|
21
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
22
|
+
type: "warning"
|
|
23
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
24
|
+
type: "error"
|
|
25
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
26
|
+
type: "info"
|
|
27
|
+
}, "Check payment pending.")));
|
|
28
|
+
};
|
|
29
|
+
export var HiddenLabel = function HiddenLabel() {
|
|
30
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
31
|
+
gap: 2
|
|
32
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
33
|
+
label: false
|
|
34
|
+
}, "Demo note!")));
|
|
35
|
+
};
|
|
36
|
+
export var CustomLabel = function CustomLabel() {
|
|
37
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
38
|
+
gap: 2
|
|
39
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
40
|
+
label: "custom"
|
|
41
|
+
}, "Customize a note.")));
|
|
42
|
+
};
|
|
43
|
+
export var FilledVariant = function FilledVariant() {
|
|
44
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
45
|
+
gap: 2
|
|
46
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
47
|
+
label: "custom",
|
|
48
|
+
filled: true
|
|
49
|
+
}, "Customize a note.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
50
|
+
label: false,
|
|
51
|
+
filled: true
|
|
52
|
+
}, "Demo note!")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
53
|
+
type: "success",
|
|
54
|
+
label: "success",
|
|
55
|
+
filled: true
|
|
56
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
57
|
+
type: "warning",
|
|
58
|
+
label: "warning",
|
|
59
|
+
filled: true
|
|
60
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
61
|
+
type: "error",
|
|
62
|
+
label: "error",
|
|
63
|
+
filled: true
|
|
64
|
+
}, "Check payment pending.")), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Note, {
|
|
65
|
+
type: "secondary",
|
|
66
|
+
filled: true
|
|
67
|
+
}, "Check payment pending.")));
|
|
68
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import Page from './page';
|
|
2
|
+
import PageHeader from './page-header';
|
|
3
|
+
import PageContent from './page-content';
|
|
4
|
+
import PageFooter from './page-footer';
|
|
5
|
+
Page.Header = PageHeader;
|
|
6
|
+
Page.Content = PageContent;
|
|
7
|
+
Page.Body = PageContent;
|
|
8
|
+
Page.Footer = PageFooter;
|
|
9
|
+
export default Page;
|
|
@@ -0,0 +1,26 @@
|
|
|
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
|
+
|
|
8
|
+
function PageContentComponent(_ref) {
|
|
9
|
+
var className = _ref.className,
|
|
10
|
+
children = _ref.children,
|
|
11
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
+
|
|
13
|
+
var _useScale = useScale(),
|
|
14
|
+
SCALES = _useScale.SCALES;
|
|
15
|
+
|
|
16
|
+
return /*#__PURE__*/React.createElement("main", _extends({}, props, {
|
|
17
|
+
className: _JSXStyle.dynamic([["1765662596", [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
18
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
19
|
+
id: "1765662596",
|
|
20
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), SCALES.height(1, '100%'), SCALES.pt(0), SCALES.pr(0), SCALES.pb(0), SCALES.pl(0), SCALES.mt(0), SCALES.mr(0), SCALES.mb(0), SCALES.ml(0)]
|
|
21
|
+
}, "main.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";height:").concat(SCALES.height(1, '100%'), ";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), ";}")));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
PageContentComponent.displayName = 'BolioUIPageContent';
|
|
25
|
+
var PageContent = withScale(PageContentComponent);
|
|
26
|
+
export default PageContent;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import useScale, { withScale } from '../use-scale';
|
|
7
|
+
|
|
8
|
+
function PageFooterComponent(_ref) {
|
|
9
|
+
var children = _ref.children,
|
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
|
|
12
|
+
var _useScale = useScale(),
|
|
13
|
+
SCALES = _useScale.SCALES;
|
|
14
|
+
|
|
15
|
+
return /*#__PURE__*/React.createElement("footer", _extends({}, props, {
|
|
16
|
+
className: _JSXStyle.dynamic([["4216345865", [SCALES.font(1), SCALES.width(1, '100%'), 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)]]]) + " " + (props && props.className != null && props.className || "")
|
|
17
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
18
|
+
id: "4216345865",
|
|
19
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), 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)]
|
|
20
|
+
}, "footer.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";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), ";}")));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
PageFooterComponent.displayName = 'BolioUIPageFooter';
|
|
24
|
+
var PageFooter = withScale(PageFooterComponent);
|
|
25
|
+
export default PageFooter;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children", "center", "className"];
|
|
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 PageHeaderComponent(_ref) {
|
|
10
|
+
var children = _ref.children,
|
|
11
|
+
_ref$center = _ref.center,
|
|
12
|
+
center = _ref$center === void 0 ? false : _ref$center,
|
|
13
|
+
_ref$className = _ref.className,
|
|
14
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
|
|
17
|
+
var _useScale = useScale(),
|
|
18
|
+
SCALES = _useScale.SCALES;
|
|
19
|
+
|
|
20
|
+
var classes = useClasses({
|
|
21
|
+
center: center
|
|
22
|
+
}, className);
|
|
23
|
+
return /*#__PURE__*/React.createElement("header", _extends({}, props, {
|
|
24
|
+
className: _JSXStyle.dynamic([["3497030820", [SCALES.font(1), SCALES.width(1, '100%'), 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)]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
25
|
+
}), children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
26
|
+
id: "3497030820",
|
|
27
|
+
dynamic: [SCALES.font(1), SCALES.width(1, '100%'), 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)]
|
|
28
|
+
}, "header.__jsx-style-dynamic-selector{font-size:".concat(SCALES.font(1), ";width:").concat(SCALES.width(1, '100%'), ";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), ";}.center.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}")));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
PageHeaderComponent.displayName = 'BolioUIPageHeader';
|
|
32
|
+
var PageHeader = withScale(PageHeaderComponent);
|
|
33
|
+
export default PageHeader;
|
package/esm/page/page.js
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
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", "render", "dotBackdrop", "className", "dotSize", "dotSpace"];
|
|
5
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
7
|
+
import { tuple } from '../utils/prop-types';
|
|
8
|
+
import useTheme from '../use-theme';
|
|
9
|
+
import PageContent from './page-content';
|
|
10
|
+
import { hasChild } from '../utils/collections';
|
|
11
|
+
import useScale, { withScale } from '../use-scale';
|
|
12
|
+
var renderMode = tuple('default', 'effect', 'effect-seo');
|
|
13
|
+
|
|
14
|
+
var DotStyles = function DotStyles(_ref) {
|
|
15
|
+
var dotSpace = _ref.dotSpace,
|
|
16
|
+
dotSize = _ref.dotSize;
|
|
17
|
+
var background = useMemo(function () {
|
|
18
|
+
return {
|
|
19
|
+
position: "calc(".concat(dotSpace, " * 25px)"),
|
|
20
|
+
size: "calc(".concat(dotSpace, " * 50px)")
|
|
21
|
+
};
|
|
22
|
+
}, [dotSpace]);
|
|
23
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
24
|
+
className: _JSXStyle.dynamic([["2593286177", [dotSize, dotSize, background.position, background.position, background.size, background.size]]])
|
|
25
|
+
}, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
26
|
+
id: "2593286177",
|
|
27
|
+
dynamic: [dotSize, dotSize, background.position, background.position, background.size, background.size]
|
|
28
|
+
}, "body{background-image:radial-gradient(#e3e3e3 ".concat(dotSize, ",transparent 0), radial-gradient(#e3e3e3 ").concat(dotSize, ",transparent 0);background-position:0 0, ").concat(background.position, " ").concat(background.position, ";background-attachment:fixed;background-size:").concat(background.size, " ").concat(background.size, ";}")));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
function PageComponent(_ref2) {
|
|
32
|
+
var children = _ref2.children,
|
|
33
|
+
_ref2$render = _ref2.render,
|
|
34
|
+
render = _ref2$render === void 0 ? 'default' : _ref2$render,
|
|
35
|
+
_ref2$dotBackdrop = _ref2.dotBackdrop,
|
|
36
|
+
dotBackdrop = _ref2$dotBackdrop === void 0 ? false : _ref2$dotBackdrop,
|
|
37
|
+
className = _ref2.className,
|
|
38
|
+
_ref2$dotSize = _ref2.dotSize,
|
|
39
|
+
dotSize = _ref2$dotSize === void 0 ? '1px' : _ref2$dotSize,
|
|
40
|
+
_ref2$dotSpace = _ref2.dotSpace,
|
|
41
|
+
dotSpace = _ref2$dotSpace === void 0 ? 1 : _ref2$dotSpace,
|
|
42
|
+
props = _objectWithoutProperties(_ref2, _excluded);
|
|
43
|
+
|
|
44
|
+
var theme = useTheme();
|
|
45
|
+
|
|
46
|
+
var _useScale = useScale(),
|
|
47
|
+
SCALES = _useScale.SCALES;
|
|
48
|
+
|
|
49
|
+
var showDot = useMemo(function () {
|
|
50
|
+
if (theme.type === 'dark') return false;
|
|
51
|
+
return dotBackdrop;
|
|
52
|
+
}, [dotBackdrop, theme.type]);
|
|
53
|
+
|
|
54
|
+
var _useState = useState(render !== 'default'),
|
|
55
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
56
|
+
preventRender = _useState2[0],
|
|
57
|
+
setPreventRender = _useState2[1];
|
|
58
|
+
|
|
59
|
+
useEffect(function () {
|
|
60
|
+
setPreventRender(false);
|
|
61
|
+
}, []);
|
|
62
|
+
|
|
63
|
+
if (preventRender) {
|
|
64
|
+
var renderSEO = render === 'effect-seo';
|
|
65
|
+
if (!renderSEO) return null;
|
|
66
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
67
|
+
"aria-hidden": "true",
|
|
68
|
+
className: "jsx-3942095687" + " " + "hidden"
|
|
69
|
+
}, children, /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
70
|
+
id: "3942095687"
|
|
71
|
+
}, ".hidden.jsx-3942095687{opacity:0;display:none;}"));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
var hasContent = hasChild(children, PageContent);
|
|
75
|
+
return /*#__PURE__*/React.createElement("section", _extends({}, props, {
|
|
76
|
+
className: _JSXStyle.dynamic([["2892125839", [SCALES.font(1), SCALES.width(1, 'calc(100% - 100pt)'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(1.34), SCALES.pb(0), SCALES.pl(1.34), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto')]]]) + " " + (props && props.className != null && props.className || className || "")
|
|
77
|
+
}), hasContent ? children : /*#__PURE__*/React.createElement(PageContent, null, children), showDot && /*#__PURE__*/React.createElement(DotStyles, {
|
|
78
|
+
dotSize: dotSize,
|
|
79
|
+
dotSpace: dotSpace
|
|
80
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
81
|
+
id: "2892125839",
|
|
82
|
+
dynamic: [SCALES.font(1), SCALES.width(1, 'calc(100% - 100pt)'), SCALES.height(1, 'auto'), SCALES.pt(0), SCALES.pr(1.34), SCALES.pb(0), SCALES.pl(1.34), SCALES.mt(0), SCALES.mr(0, 'auto'), SCALES.mb(0), SCALES.ml(0, 'auto')]
|
|
83
|
+
}, "section.__jsx-style-dynamic-selector{max-width:100vw;min-height:100vh;box-sizing:border-box;position:relative;font-size:".concat(SCALES.font(1), ";height:").concat(SCALES.height(1, 'auto'), ";-webkit-align-content:space-between;-ms-flex-line-pack:space-between;align-content:space-between;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;position:relative;min-height:100vh;}")));
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
PageComponent.displayName = 'BolioUIPage';
|
|
87
|
+
var Page = withScale(PageComponent);
|
|
88
|
+
export default Page;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import Page from '.';
|
|
4
|
+
import Button from '../button';
|
|
5
|
+
import Grid from '../grid';
|
|
6
|
+
import MockPage from '../mdx-widgets/mock-page';
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Layout/Page',
|
|
9
|
+
component: Page
|
|
10
|
+
};
|
|
11
|
+
export var Default = function Default() {
|
|
12
|
+
var Child = function Child() {
|
|
13
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("h2", null, "Hi my dear!"), /*#__PURE__*/React.createElement("p", null, "This is an example to show the body of a page."));
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var _useState = useState(false),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
visible = _useState2[0],
|
|
19
|
+
setVisible = _useState2[1];
|
|
20
|
+
|
|
21
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
22
|
+
gap: 2
|
|
23
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
onClick: function onClick() {
|
|
25
|
+
return setVisible(true);
|
|
26
|
+
},
|
|
27
|
+
auto: true
|
|
28
|
+
}, "View Page"), /*#__PURE__*/React.createElement(MockPage, {
|
|
29
|
+
visible: visible,
|
|
30
|
+
onClose: function onClose() {
|
|
31
|
+
return setVisible(false);
|
|
32
|
+
}
|
|
33
|
+
}, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(Child, null)))));
|
|
34
|
+
};
|
|
35
|
+
export var Content = function Content() {
|
|
36
|
+
var _React$useState = React.useState(false),
|
|
37
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
38
|
+
visible = _React$useState2[0],
|
|
39
|
+
setVisible = _React$useState2[1];
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/React.createElement(Grid.Container, {
|
|
42
|
+
gap: 2
|
|
43
|
+
}, /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Button, {
|
|
44
|
+
onClick: function onClick() {
|
|
45
|
+
return setVisible(true);
|
|
46
|
+
},
|
|
47
|
+
auto: true
|
|
48
|
+
}, "Header, Body and Footer"), /*#__PURE__*/React.createElement(MockPage, {
|
|
49
|
+
visible: visible,
|
|
50
|
+
onClose: function onClose() {
|
|
51
|
+
return setVisible(false);
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(Page.Header, null, /*#__PURE__*/React.createElement("h2", null, "Header")), /*#__PURE__*/React.createElement(Page.Content, null, /*#__PURE__*/React.createElement("h2", null, "Hi my dear!"), /*#__PURE__*/React.createElement("p", null, "This is an example to show the body of a page.")), /*#__PURE__*/React.createElement(Page.Footer, null, /*#__PURE__*/React.createElement("h2", null, "Footer"))))));
|
|
54
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { tuple } from '../utils/prop-types';
|
|
3
|
+
var paginationUpdateTypes = tuple('prev', 'next', 'click');
|
|
4
|
+
var defaultContext = {};
|
|
5
|
+
export var PaginationContext = /*#__PURE__*/React.createContext(defaultContext);
|
|
6
|
+
export var usePaginationContext = function usePaginationContext() {
|
|
7
|
+
return React.useContext(PaginationContext);
|
|
8
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import PaginationItem from './pagination-item';
|
|
5
|
+
|
|
6
|
+
function PaginationEllipsis(_ref) {
|
|
7
|
+
var isBefore = _ref.isBefore,
|
|
8
|
+
_onClick = _ref.onClick;
|
|
9
|
+
|
|
10
|
+
var _useState = useState(false),
|
|
11
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
12
|
+
showMore = _useState2[0],
|
|
13
|
+
setShowMore = _useState2[1];
|
|
14
|
+
|
|
15
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
16
|
+
onClick: function onClick(e) {
|
|
17
|
+
return _onClick && _onClick(e);
|
|
18
|
+
},
|
|
19
|
+
onMouseEnter: function onMouseEnter() {
|
|
20
|
+
return setShowMore(true);
|
|
21
|
+
},
|
|
22
|
+
onMouseLeave: function onMouseLeave() {
|
|
23
|
+
return setShowMore(false);
|
|
24
|
+
}
|
|
25
|
+
}, showMore ? /*#__PURE__*/React.createElement("svg", {
|
|
26
|
+
viewBox: "0 0 24 24",
|
|
27
|
+
stroke: "currentColor",
|
|
28
|
+
strokeWidth: "1.5",
|
|
29
|
+
strokeLinecap: "round",
|
|
30
|
+
strokeLinejoin: "round",
|
|
31
|
+
fill: "none",
|
|
32
|
+
shapeRendering: "geometricPrecision",
|
|
33
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]]) + " " + "more"
|
|
34
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
35
|
+
d: "M13 17l5-5-5-5",
|
|
36
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
37
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
38
|
+
d: "M6 17l5-5-5-5",
|
|
39
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
40
|
+
})) : /*#__PURE__*/React.createElement("svg", {
|
|
41
|
+
viewBox: "0 0 24 24",
|
|
42
|
+
strokeWidth: "1.5",
|
|
43
|
+
strokeLinecap: "round",
|
|
44
|
+
strokeLinejoin: "round",
|
|
45
|
+
fill: "none",
|
|
46
|
+
shapeRendering: "geometricPrecision",
|
|
47
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
48
|
+
}, /*#__PURE__*/React.createElement("circle", {
|
|
49
|
+
cx: "12",
|
|
50
|
+
cy: "12",
|
|
51
|
+
r: "1",
|
|
52
|
+
fill: "currentColor",
|
|
53
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
54
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
55
|
+
cx: "19",
|
|
56
|
+
cy: "12",
|
|
57
|
+
r: "1",
|
|
58
|
+
fill: "currentColor",
|
|
59
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
60
|
+
}), /*#__PURE__*/React.createElement("circle", {
|
|
61
|
+
cx: "5",
|
|
62
|
+
cy: "12",
|
|
63
|
+
r: "1",
|
|
64
|
+
fill: "currentColor",
|
|
65
|
+
className: _JSXStyle.dynamic([["2928474255", [isBefore ? '180deg' : '0deg']]])
|
|
66
|
+
})), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
67
|
+
id: "2928474255",
|
|
68
|
+
dynamic: [isBefore ? '180deg' : '0deg']
|
|
69
|
+
}, "svg.__jsx-style-dynamic-selector{color:currentColor;stroke:currentColor;width:1em;height:1em;}.more.__jsx-style-dynamic-selector{-webkit-transform:rotate(".concat(isBefore ? '180deg' : '0deg', ");-ms-transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");transform:rotate(").concat(isBefore ? '180deg' : '0deg', ");}")));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
PaginationEllipsis.displayName = 'BolioUIPaginationEllipsis';
|
|
73
|
+
export default PaginationEllipsis;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 = ["active", "children", "disabled", "onClick"];
|
|
5
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
6
|
+
import React, { useMemo } from 'react';
|
|
7
|
+
import useTheme from '../use-theme';
|
|
8
|
+
import { addColorAlpha } from '../utils/color';
|
|
9
|
+
import useClasses from '../use-classes';
|
|
10
|
+
|
|
11
|
+
function PaginationItem(_ref) {
|
|
12
|
+
var active = _ref.active,
|
|
13
|
+
children = _ref.children,
|
|
14
|
+
disabled = _ref.disabled,
|
|
15
|
+
onClick = _ref.onClick,
|
|
16
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
|
+
|
|
18
|
+
var theme = useTheme();
|
|
19
|
+
|
|
20
|
+
var _useMemo = useMemo(function () {
|
|
21
|
+
return [addColorAlpha(theme.palette.primary, 0.1), addColorAlpha(theme.palette.primary, 0.8)];
|
|
22
|
+
}, [theme.palette.primary]),
|
|
23
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
24
|
+
hover = _useMemo2[0],
|
|
25
|
+
activeHover = _useMemo2[1];
|
|
26
|
+
|
|
27
|
+
var classes = useClasses({
|
|
28
|
+
active: active,
|
|
29
|
+
disabled: disabled
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
var clickHandler = function clickHandler(event) {
|
|
33
|
+
if (disabled) return;
|
|
34
|
+
onClick && onClick(event);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
38
|
+
className: _JSXStyle.dynamic([["32129165", [theme.palette.primary, theme.layout.radius, theme.palette.background, hover, theme.palette.primary, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]])
|
|
39
|
+
}, /*#__PURE__*/React.createElement("button", _extends({
|
|
40
|
+
onClick: clickHandler
|
|
41
|
+
}, props, {
|
|
42
|
+
className: _JSXStyle.dynamic([["32129165", [theme.palette.primary, theme.layout.radius, theme.palette.background, hover, theme.palette.primary, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]]]) + " " + (props && props.className != null && props.className || classes || "")
|
|
43
|
+
}), children), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
44
|
+
id: "32129165",
|
|
45
|
+
dynamic: [theme.palette.primary, theme.layout.radius, theme.palette.background, hover, theme.palette.primary, theme.palette.background, theme.expressiveness.shadowSmall, activeHover, theme.expressiveness.shadowMedium, theme.palette.accents_4, theme.palette.accents_2]
|
|
46
|
+
}, "li.__jsx-style-dynamic-selector{margin-right:0.428em;display:inline-block;}button.__jsx-style-dynamic-selector{border:none;display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;box-sizing:border-box;text-transform:capitalize;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;text-align:center;vertical-align:middle;box-shadow:none;outline:none;height:var(--pagination-size);min-width:var(--pagination-size);font-size:inherit;cursor:pointer;color:".concat(theme.palette.primary, ";border-radius:").concat(theme.layout.radius, ";background-color:").concat(theme.palette.background, ";-webkit-transition:all linear 200ms 0ms;transition:all linear 200ms 0ms;}button.__jsx-style-dynamic-selector:hover{background-color:").concat(hover, ";}.active.__jsx-style-dynamic-selector{font-weight:bold;background-color:").concat(theme.palette.primary, ";color:").concat(theme.palette.background, ";box-shadow:").concat(theme.expressiveness.shadowSmall, ";}.active.__jsx-style-dynamic-selector:hover{background-color:").concat(activeHover, ";box-shadow:").concat(theme.expressiveness.shadowMedium, ";}.disabled.__jsx-style-dynamic-selector{color:").concat(theme.palette.accents_4, ";cursor:not-allowed;}.disabled.__jsx-style-dynamic-selector:hover{background-color:").concat(theme.palette.accents_2, ";}button.__jsx-style-dynamic-selector svg{width:1.3em;height:1.3em;}")));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
PaginationItem.displayName = 'BolioUIPaginationItem';
|
|
50
|
+
export default PaginationItem;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["children"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import PaginationItem from './pagination-item';
|
|
6
|
+
import { usePaginationContext } from './pagination-context';
|
|
7
|
+
|
|
8
|
+
function PaginationNext(_ref) {
|
|
9
|
+
var children = _ref.children,
|
|
10
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
11
|
+
|
|
12
|
+
var _usePaginationContext = usePaginationContext(),
|
|
13
|
+
update = _usePaginationContext.update,
|
|
14
|
+
isLast = _usePaginationContext.isLast;
|
|
15
|
+
|
|
16
|
+
return /*#__PURE__*/React.createElement(PaginationItem, _extends({
|
|
17
|
+
onClick: function onClick() {
|
|
18
|
+
return update && update('next');
|
|
19
|
+
},
|
|
20
|
+
disabled: isLast
|
|
21
|
+
}, props), children);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
PaginationNext.displayName = 'BolioUIPaginationNext';
|
|
25
|
+
export default PaginationNext;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
3
|
+
import React, { useCallback, useMemo } from 'react';
|
|
4
|
+
import PaginationItem from './pagination-item';
|
|
5
|
+
import PaginationEllipsis from './pagination-ellipsis';
|
|
6
|
+
|
|
7
|
+
function PaginationPages(_ref) {
|
|
8
|
+
var limit = _ref.limit,
|
|
9
|
+
count = _ref.count,
|
|
10
|
+
current = _ref.current,
|
|
11
|
+
setPage = _ref.setPage;
|
|
12
|
+
var showPages = useMemo(function () {
|
|
13
|
+
var oddLimit = limit % 2 === 0 ? limit - 1 : limit;
|
|
14
|
+
return oddLimit - 2;
|
|
15
|
+
}, [limit]);
|
|
16
|
+
var middleNumber = (showPages + 1) / 2;
|
|
17
|
+
|
|
18
|
+
var _useMemo = useMemo(function () {
|
|
19
|
+
var showEllipsis = count > limit;
|
|
20
|
+
return [showEllipsis && current > middleNumber + 1, showEllipsis && current < count - middleNumber];
|
|
21
|
+
}, [current, middleNumber, count, limit]),
|
|
22
|
+
_useMemo2 = _slicedToArray(_useMemo, 2),
|
|
23
|
+
showBeforeEllipsis = _useMemo2[0],
|
|
24
|
+
showAfterEllipsis = _useMemo2[1];
|
|
25
|
+
|
|
26
|
+
var pagesArray = useMemo(function () {
|
|
27
|
+
return _toConsumableArray(new Array(showPages));
|
|
28
|
+
}, [showPages]);
|
|
29
|
+
var renderItem = useCallback(function (value, active) {
|
|
30
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
31
|
+
key: "pagination-item-".concat(value),
|
|
32
|
+
active: value === active,
|
|
33
|
+
onClick: function onClick() {
|
|
34
|
+
return setPage(value);
|
|
35
|
+
}
|
|
36
|
+
}, value);
|
|
37
|
+
}, [setPage]);
|
|
38
|
+
var startPages = pagesArray.map(function (_, index) {
|
|
39
|
+
var value = index + 2;
|
|
40
|
+
return renderItem(value, current);
|
|
41
|
+
});
|
|
42
|
+
var middlePages = pagesArray.map(function (_, index) {
|
|
43
|
+
var middleIndexNumber = middleNumber - (index + 1);
|
|
44
|
+
var value = current - middleIndexNumber;
|
|
45
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
46
|
+
key: "pagination-middle-".concat(index),
|
|
47
|
+
active: index + 1 === middleNumber,
|
|
48
|
+
onClick: function onClick() {
|
|
49
|
+
return setPage(value);
|
|
50
|
+
}
|
|
51
|
+
}, value);
|
|
52
|
+
});
|
|
53
|
+
var endPages = pagesArray.map(function (_, index) {
|
|
54
|
+
var value = count - (showPages - index);
|
|
55
|
+
return renderItem(value, current);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
if (count <= limit) {
|
|
59
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, _toConsumableArray(new Array(count)).map(function (_, index) {
|
|
60
|
+
var value = index + 1;
|
|
61
|
+
return /*#__PURE__*/React.createElement(PaginationItem, {
|
|
62
|
+
key: "pagination-item-".concat(value),
|
|
63
|
+
active: value === current,
|
|
64
|
+
onClick: function onClick() {
|
|
65
|
+
return setPage(value);
|
|
66
|
+
}
|
|
67
|
+
}, value);
|
|
68
|
+
}));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, renderItem(1, current), showBeforeEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
72
|
+
key: "pagination-ellipsis-before",
|
|
73
|
+
isBefore: true,
|
|
74
|
+
onClick: function onClick() {
|
|
75
|
+
return setPage(function (last) {
|
|
76
|
+
return last - 5 >= 1 ? last - 5 : 1;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}), showBeforeEllipsis && showAfterEllipsis ? middlePages : showBeforeEllipsis ? endPages : startPages, showAfterEllipsis && /*#__PURE__*/React.createElement(PaginationEllipsis, {
|
|
80
|
+
key: "pagination-ellipsis-after",
|
|
81
|
+
onClick: function onClick() {
|
|
82
|
+
return setPage(function (last) {
|
|
83
|
+
return last + 5 <= count ? last + 5 : count;
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}), renderItem(count, current));
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
PaginationPages.displayName = 'BolioUIPaginationPages';
|
|
90
|
+
export default PaginationPages;
|