@autoguru/overdrive 4.33.1 → 4.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Alert/Alert.js +1 -2
- package/dist/components/Anchor/Anchor.js +3 -4
- package/dist/components/AutoSuggest/AutoSuggest.css.js +3 -3
- package/dist/components/AutoSuggest/AutoSuggest.d.ts.map +1 -1
- package/dist/components/AutoSuggest/AutoSuggest.js +8 -9
- package/dist/components/Box/Box.js +2 -2
- package/dist/components/Box/argTypes.d.ts.map +1 -1
- package/dist/components/Box/argTypes.js +2 -2
- package/dist/components/Box/useBoxStyles.css.d.ts +1 -1
- package/dist/components/Box/useBoxStyles.css.d.ts.map +1 -1
- package/dist/components/Box/useBoxStyles.css.js +5 -11
- package/dist/components/BulletList/Bullet.css.js +3 -3
- package/dist/components/BulletList/Bullet.d.ts.map +1 -1
- package/dist/components/BulletList/Bullet.js +12 -4
- package/dist/components/BulletText/BulletText.js +1 -2
- package/dist/components/Button/Button.css.js +21 -21
- package/dist/components/Button/Button.js +3 -5
- package/dist/components/CheckBox/CheckBox.css.js +3 -3
- package/dist/components/CheckBox/CheckBox.js +1 -2
- package/dist/components/ColourInput/ColourInput.css.js +2 -2
- package/dist/components/ColourInput/ColourInput.js +3 -4
- package/dist/components/Columns/Column.css.js +1 -1
- package/dist/components/Columns/Column.js +2 -2
- package/dist/components/Columns/Columns.js +2 -2
- package/dist/components/DateInput/DateInput.js +2 -2
- package/dist/components/DatePicker/DatePicker.js +3 -4
- package/dist/components/DividerLine/DividerLine.d.ts +1 -1
- package/dist/components/DividerLine/DividerLine.d.ts.map +1 -1
- package/dist/components/DividerLine/DividerLine.js +1 -1
- package/dist/components/DropDown/DropDown.js +3 -5
- package/dist/components/DropDown/DropDownOption.css.js +2 -2
- package/dist/components/DropDown/DropDownOption.js +3 -4
- package/dist/components/EditableText/EditableText.css.js +1 -1
- package/dist/components/EditableText/EditableText.d.ts.map +1 -1
- package/dist/components/EditableText/EditableText.js +5 -6
- package/dist/components/FillHeightBox/FillHeightBox.js +2 -2
- package/dist/components/Flyout/Flyout.js +2 -2
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.css.js +1 -1
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts +1 -1
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.d.ts.map +1 -1
- package/dist/components/HorizontalAutoScroller/HorizontalAutoScroller.js +5 -7
- package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.d.ts.map +1 -1
- package/dist/components/HorizontalAutoScroller/useHorizontalAutoScroller.js +5 -9
- package/dist/components/Image/Image.js +2 -2
- package/dist/components/Image/ImageServerProvider.js +9 -8
- package/dist/components/Image/ResponsiveImage.js +2 -2
- package/dist/components/Image/SimpleImage.js +2 -2
- package/dist/components/Inline/Inline.js +1 -3
- package/dist/components/LoadingBox/LoadingBox.js +3 -3
- package/dist/components/Meta/Meta.js +2 -3
- package/dist/components/MinimalModal/MinimalModal.js +2 -2
- package/dist/components/Modal/Modal.css.js +1 -1
- package/dist/components/Modal/Modal.d.ts.map +1 -1
- package/dist/components/Modal/Modal.js +16 -9
- package/dist/components/NumberBubble/NumberBubble.js +2 -2
- package/dist/components/NumberInput/NumberInput.js +3 -3
- package/dist/components/OrderedList/OrderedList.css.js +1 -1
- package/dist/components/OutsideClick/OutsideClick.js +1 -1
- package/dist/components/Pagination/Pagination.css.js +6 -6
- package/dist/components/Pagination/Pagination.js +1 -2
- package/dist/components/Positioner/Positioner.d.ts.map +1 -1
- package/dist/components/Positioner/Positioner.js +17 -7
- package/dist/components/Positioner/alignment.js +3 -3
- package/dist/components/ProgressBar/ProgressBar.css.js +1 -1
- package/dist/components/ProgressBar/ProgressBar.js +1 -1
- package/dist/components/ProgressBarGroup/ProgressBarGroup.css.js +1 -1
- package/dist/components/ProgressBarGroup/ProgressBarGroup.js +2 -3
- package/dist/components/Radio/Radio.css.js +4 -4
- package/dist/components/Radio/Radio.js +1 -2
- package/dist/components/ScrollPane/ScrollPane.css.js +3 -3
- package/dist/components/ScrollPane/ScrollPane.js +2 -2
- package/dist/components/SelectInput/SelectInput.css.js +3 -3
- package/dist/components/SelectInput/SelectInput.d.ts +1 -1
- package/dist/components/SelectInput/SelectInput.d.ts.map +1 -1
- package/dist/components/SelectInput/SelectInput.js +5 -5
- package/dist/components/SimplePagination/SimplePagination.js +4 -5
- package/dist/components/SliderProgress/ProgressStep.js +1 -2
- package/dist/components/SliderProgress/SliderProgress.css.js +1 -1
- package/dist/components/SliderProgress/SliderProgress.js +1 -1
- package/dist/components/Stack/Divider.css.js +1 -1
- package/dist/components/Stack/Stack.js +1 -3
- package/dist/components/StandardModal/StandardModal.css.js +8 -8
- package/dist/components/StandardModal/StandardModal.js +4 -5
- package/dist/components/StarRating/StarRating.js +7 -8
- package/dist/components/Stepper/Stepper.css.js +4 -4
- package/dist/components/Stepper/Stepper.d.ts.map +1 -1
- package/dist/components/Stepper/Stepper.js +19 -10
- package/dist/components/StickyBox/StickyBox.css.js +4 -4
- package/dist/components/StickyBox/StickyBox.js +3 -3
- package/dist/components/Switch/Switch.css.js +18 -18
- package/dist/components/Switch/Switch.js +4 -5
- package/dist/components/Table/TableCell.css.js +1 -1
- package/dist/components/Table/TableHeadCell.css.js +5 -5
- package/dist/components/Table/TableHeadCell.js +1 -2
- package/dist/components/Tabs/Tab.css.js +4 -4
- package/dist/components/Tabs/Tab.js +2 -3
- package/dist/components/Tabs/TabList.css.js +1 -1
- package/dist/components/Tabs/TabList.js +1 -2
- package/dist/components/Tabs/TabPane.js +1 -1
- package/dist/components/Text/useTextStyles.css.js +2 -2
- package/dist/components/TextAreaInput/TextAreaInput.js +2 -2
- package/dist/components/TextBubble/TextBubble.d.ts.map +1 -1
- package/dist/components/TextBubble/TextBubble.js +14 -6
- package/dist/components/TextContainer/TextContainer.js +1 -2
- package/dist/components/TextInput/TextInput.js +2 -2
- package/dist/components/TextLink/TextLink.css.js +4 -4
- package/dist/components/TextLink/TextLink.js +3 -4
- package/dist/components/ThemeOverrideProvider/ThemeOverrideDebugger.js +1 -2
- package/dist/components/ThemeOverrideProvider/ThemeOverrideProvider.js +2 -2
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.d.ts.map +1 -1
- package/dist/components/ThemeOverrideProvider/useBuildThemeOverrides.js +5 -3
- package/dist/components/Toaster/Toast.css.js +1 -1
- package/dist/components/Toaster/Toast.d.ts.map +1 -1
- package/dist/components/Toaster/Toast.js +24 -20
- package/dist/components/Tooltip/Tooltip.css.js +2 -2
- package/dist/components/Tooltip/Tooltip.js +1 -3
- package/dist/components/private/CheckableBase/CheckableBase.css.js +8 -8
- package/dist/components/private/CheckableBase/CheckableBase.js +1 -2
- package/dist/components/private/InputBase/HintText.css.js +1 -1
- package/dist/components/private/InputBase/NotchedBase.css.js +20 -20
- package/dist/components/private/InputBase/NotchedBase.js +1 -2
- package/dist/components/private/InputBase/withEnhancedInput.css.js +16 -16
- package/dist/components/private/InputBase/withEnhancedInput.d.ts.map +1 -1
- package/dist/components/private/InputBase/withEnhancedInput.js +3 -4
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.d.ts +1 -1
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.d.ts.map +1 -1
- package/dist/hooks/useAttachedBoxes/useAttachedBoxes.js +5 -5
- package/dist/hooks/useMedia/useMedia.js +4 -4
- package/dist/hooks/useNegativeMargin/useNegativeMarginLeft.css.js +2 -2
- package/dist/hooks/useNegativeMargin/useNegativeMarginTop.css.js +1 -1
- package/dist/hooks/useNullCheck/useNullCheck.js +1 -1
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.d.ts.map +1 -1
- package/dist/hooks/useWindowHeightFill/useWindowHeightFill.js +4 -3
- package/dist/reset/globalFonts.css.js +3 -3
- package/dist/reset/reset.css.js +2 -2
- package/dist/themes/base/tokens.js +3 -3
- package/dist/themes/flat_red/tokens.js +2 -2
- package/dist/themes/helpers.d.ts.map +1 -1
- package/dist/themes/helpers.js +2 -2
- package/dist/themes/makeTheme.js +3 -3
- package/dist/themes/neutral/tokens.js +3 -3
- package/dist/themes/theme.css.js +2 -2
- package/dist/utils/css.js +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -5
- package/dist/utils/mapTokenToProperty.js +2 -2
- package/dist/utils/number.js +1 -1
- package/dist/utils/responsiveProps.css.d.ts.map +1 -1
- package/dist/utils/responsiveProps.css.js +2 -2
- package/dist/utils/responsiveStyle.js +3 -3
- package/package.json +118 -26
- package/dist/components/Actions/stories.js +0 -53
- package/dist/components/Alert/stories.js +0 -106
- package/dist/components/Anchor/stories.js +0 -65
- package/dist/components/AutoSuggest/stories.js +0 -213
- package/dist/components/Badge/stories.js +0 -64
- package/dist/components/Box/stories.js +0 -43
- package/dist/components/BulletList/stories.js +0 -72
- package/dist/components/BulletText/stories.js +0 -88
- package/dist/components/Button/stories.js +0 -291
- package/dist/components/CheckBox/stories.js +0 -206
- package/dist/components/ColourInput/stories.js +0 -173
- package/dist/components/Columns/stories.js +0 -209
- package/dist/components/DateInput/stories.js +0 -181
- package/dist/components/DatePicker/stories.js +0 -89
- package/dist/components/DividerLine/stories.js +0 -117
- package/dist/components/DropDown/stories.js +0 -117
- package/dist/components/EditableText/stories.js +0 -84
- package/dist/components/FillHeightBox/stories.js +0 -47
- package/dist/components/Flyout/stories.js +0 -88
- package/dist/components/Heading/stories.js +0 -127
- package/dist/components/HorizontalAutoScroller/stories.js +0 -88
- package/dist/components/Icon/stories.js +0 -62
- package/dist/components/Image/stories.js +0 -183
- package/dist/components/Inline/stories.js +0 -122
- package/dist/components/IntentStripe/stories.js +0 -76
- package/dist/components/LinearProgressIndicator/stories.js +0 -26
- package/dist/components/LoadingBox/stories.js +0 -41
- package/dist/components/Meta/stories.js +0 -45
- package/dist/components/MinimalModal/stories.js +0 -83
- package/dist/components/Modal/stories.js +0 -52
- package/dist/components/NumberBubble/stories.js +0 -23
- package/dist/components/NumberInput/stories.js +0 -218
- package/dist/components/OrderedList/stories.js +0 -58
- package/dist/components/OutsideClick/stories.js +0 -39
- package/dist/components/Pagination/stories.js +0 -112
- package/dist/components/Portal/stories.js +0 -72
- package/dist/components/Positioner/stories.js +0 -124
- package/dist/components/ProgressBar/stories.js +0 -44
- package/dist/components/ProgressBarGroup/stories.js +0 -21
- package/dist/components/ProgressSpinner/stories.js +0 -36
- package/dist/components/Radio/stories.js +0 -215
- package/dist/components/ScrollPane/stories.js +0 -55
- package/dist/components/Section/stories.js +0 -43
- package/dist/components/SelectInput/stories.js +0 -188
- package/dist/components/SimplePagination/stories.js +0 -42
- package/dist/components/SliderProgress/stories.js +0 -44
- package/dist/components/Stack/stories.js +0 -75
- package/dist/components/StandardModal/stories.js +0 -62
- package/dist/components/StarRating/stories.js +0 -50
- package/dist/components/Stepper/stories.js +0 -61
- package/dist/components/StickyBox/stories.js +0 -70
- package/dist/components/Switch/stories.js +0 -42
- package/dist/components/Table/stories.js +0 -302
- package/dist/components/Tabs/stories.js +0 -253
- package/dist/components/Text/stories.js +0 -154
- package/dist/components/TextAreaInput/stories.js +0 -129
- package/dist/components/TextBubble/stories.js +0 -30
- package/dist/components/TextContainer/stories.js +0 -128
- package/dist/components/TextInput/stories.js +0 -260
- package/dist/components/TextLink/stories.js +0 -111
- package/dist/components/Toaster/stories.js +0 -59
- package/dist/components/Tooltip/stories.js +0 -90
- package/dist/components/VisuallyHidden/stories.js +0 -36
- package/dist/hooks/useAttachedBoxes/stories.js +0 -94
- package/dist/hooks/useMedia/stories.js +0 -46
- package/dist/hooks/useResponsiveValue/stories.js +0 -38
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
5
|
-
const _excluded = ["value", "onChange"];
|
|
6
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
7
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
8
|
-
import { AccountEditIcon, AlertCircleIcon, CalendarIcon, CarIcon, CarMultipleIcon, CheckIcon, CurrencyUsdIcon, PlusIcon, StarIcon } from '@autoguru/icons';
|
|
9
|
-
import { action } from '@storybook/addon-actions';
|
|
10
|
-
import isChromatic from 'chromatic/isChromatic';
|
|
11
|
-
import * as React from 'react';
|
|
12
|
-
import { NumberInput } from "./index.js";
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
const meta = {
|
|
15
|
-
title: 'Components/Inputs/Number',
|
|
16
|
-
component: NumberInput,
|
|
17
|
-
parameters: {
|
|
18
|
-
chromatic: {}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
export default meta;
|
|
22
|
-
const defaultValue = isChromatic() ? '42' : Math.round(Math.random() * 100).toString();
|
|
23
|
-
const defaultPlaceholder = 'How many?';
|
|
24
|
-
const iconOptions = {
|
|
25
|
-
CalendarIcon,
|
|
26
|
-
AccountEditIcon,
|
|
27
|
-
AlertCircleIcon,
|
|
28
|
-
CarMultipleIcon,
|
|
29
|
-
CurrencyUsdIcon,
|
|
30
|
-
PlusIcon,
|
|
31
|
-
StarIcon,
|
|
32
|
-
CheckIcon
|
|
33
|
-
};
|
|
34
|
-
const attachOptions = {
|
|
35
|
-
NONE: 'NONE',
|
|
36
|
-
TOP: 'TOP',
|
|
37
|
-
RIGHT: 'RIGHT',
|
|
38
|
-
LEFT: 'LEFT',
|
|
39
|
-
BOTTOM: 'BOTTOM',
|
|
40
|
-
ALL: 'ALL'
|
|
41
|
-
};
|
|
42
|
-
const argTypes = {
|
|
43
|
-
prefixIcon: {
|
|
44
|
-
defaultValue: null,
|
|
45
|
-
description: 'Input prefix Icon',
|
|
46
|
-
options: iconOptions,
|
|
47
|
-
control: {
|
|
48
|
-
type: 'select'
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
attach: {
|
|
52
|
-
defaultValue: 'NONE',
|
|
53
|
-
description: 'Input attach',
|
|
54
|
-
options: attachOptions,
|
|
55
|
-
control: {
|
|
56
|
-
type: 'select'
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
suffixIcon: {
|
|
60
|
-
defaultValue: null,
|
|
61
|
-
description: 'Input suffix Icon',
|
|
62
|
-
options: iconOptions,
|
|
63
|
-
control: {
|
|
64
|
-
type: 'select'
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
maxLength: {
|
|
68
|
-
defaultValue: null,
|
|
69
|
-
description: 'Set the max length of the number',
|
|
70
|
-
control: {
|
|
71
|
-
type: 'number'
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const Template = _ref => {
|
|
76
|
-
let {
|
|
77
|
-
value: initialValue,
|
|
78
|
-
onChange: incomingOnChange
|
|
79
|
-
} = _ref,
|
|
80
|
-
args = _objectWithoutProperties(_ref, _excluded);
|
|
81
|
-
const [value, setValue] = React.useState(initialValue);
|
|
82
|
-
return _jsx(NumberInput, _objectSpread(_objectSpread({}, args), {}, {
|
|
83
|
-
value: value,
|
|
84
|
-
onChange: e => {
|
|
85
|
-
setValue(e.currentTarget.value);
|
|
86
|
-
incomingOnChange(e);
|
|
87
|
-
}
|
|
88
|
-
}));
|
|
89
|
-
};
|
|
90
|
-
const sharedProps = {
|
|
91
|
-
disabled: false,
|
|
92
|
-
name: 'number',
|
|
93
|
-
value: '',
|
|
94
|
-
placeholder: defaultPlaceholder,
|
|
95
|
-
isValid: false,
|
|
96
|
-
isTouched: false,
|
|
97
|
-
isLoading: false,
|
|
98
|
-
isFocused: false,
|
|
99
|
-
reserveHintSpace: false,
|
|
100
|
-
hintText: '',
|
|
101
|
-
notch: true,
|
|
102
|
-
preventMouseWheel: true,
|
|
103
|
-
prefixIcon: null,
|
|
104
|
-
onChange: action('onChange'),
|
|
105
|
-
onFocus: action('onFocus'),
|
|
106
|
-
onBlur: action('onBlur')
|
|
107
|
-
};
|
|
108
|
-
const standardProps = sharedProps;
|
|
109
|
-
const withAValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
110
|
-
value: defaultValue,
|
|
111
|
-
placeholder: defaultPlaceholder
|
|
112
|
-
});
|
|
113
|
-
const withHintTextProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
114
|
-
hintText: 'Hint Text',
|
|
115
|
-
placeholder: defaultPlaceholder
|
|
116
|
-
});
|
|
117
|
-
const withPrefixIconProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
118
|
-
prefixIcon: CalendarIcon
|
|
119
|
-
});
|
|
120
|
-
const withSuffixIconProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
121
|
-
suffixIcon: AccountEditIcon
|
|
122
|
-
});
|
|
123
|
-
const withBothIconsProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
124
|
-
prefixIcon: CalendarIcon,
|
|
125
|
-
suffixIcon: AccountEditIcon
|
|
126
|
-
});
|
|
127
|
-
const disabledProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
128
|
-
value: defaultValue,
|
|
129
|
-
placeholder: defaultPlaceholder,
|
|
130
|
-
disabled: true
|
|
131
|
-
});
|
|
132
|
-
const validProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
133
|
-
value: defaultValue,
|
|
134
|
-
placeholder: defaultPlaceholder,
|
|
135
|
-
isTouched: true,
|
|
136
|
-
isValid: true
|
|
137
|
-
});
|
|
138
|
-
const invalidProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
139
|
-
value: '99',
|
|
140
|
-
placeholder: defaultPlaceholder,
|
|
141
|
-
isTouched: true,
|
|
142
|
-
isValid: false,
|
|
143
|
-
hintText: 'Required litres of oil is not valid'
|
|
144
|
-
});
|
|
145
|
-
const noNotchProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
146
|
-
placeholder: defaultPlaceholder,
|
|
147
|
-
notch: false
|
|
148
|
-
});
|
|
149
|
-
const noNotchWithValueProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
150
|
-
value: defaultValue,
|
|
151
|
-
placeholder: defaultPlaceholder,
|
|
152
|
-
notch: false
|
|
153
|
-
});
|
|
154
|
-
const loadingProps = _objectSpread(_objectSpread({}, sharedProps), {}, {
|
|
155
|
-
isLoading: true
|
|
156
|
-
});
|
|
157
|
-
export const standard = Template.bind(standardProps);
|
|
158
|
-
standard.args = standardProps;
|
|
159
|
-
standard.argTypes = argTypes;
|
|
160
|
-
export const withAValue = Template.bind(withAValueProps);
|
|
161
|
-
withAValue.args = withAValueProps;
|
|
162
|
-
withAValue.argTypes = argTypes;
|
|
163
|
-
export const withHintText = Template.bind(withHintTextProps);
|
|
164
|
-
withHintText.args = withHintTextProps;
|
|
165
|
-
withHintText.argTypes = argTypes;
|
|
166
|
-
export const notchDisabled = Template.bind(noNotchProps);
|
|
167
|
-
notchDisabled.args = noNotchProps;
|
|
168
|
-
notchDisabled.argTypes = argTypes;
|
|
169
|
-
export const notchDisabledWithValue = Template.bind(noNotchWithValueProps);
|
|
170
|
-
notchDisabledWithValue.args = noNotchWithValueProps;
|
|
171
|
-
notchDisabledWithValue.argTypes = argTypes;
|
|
172
|
-
export const withPrefixIcon = Template.bind(withPrefixIconProps);
|
|
173
|
-
withPrefixIcon.args = withPrefixIconProps;
|
|
174
|
-
withPrefixIcon.argTypes = argTypes;
|
|
175
|
-
export const withSuffixIcon = Template.bind(withSuffixIconProps);
|
|
176
|
-
withSuffixIcon.args = withSuffixIconProps;
|
|
177
|
-
withSuffixIcon.argTypes = argTypes;
|
|
178
|
-
export const withBothIcons = Template.bind(withBothIconsProps);
|
|
179
|
-
withBothIcons.args = withBothIconsProps;
|
|
180
|
-
withBothIcons.argTypes = argTypes;
|
|
181
|
-
export const disabled = Template.bind(disabledProps);
|
|
182
|
-
disabled.args = disabledProps;
|
|
183
|
-
disabled.argTypes = argTypes;
|
|
184
|
-
export const valid = Template.bind(validProps);
|
|
185
|
-
valid.args = validProps;
|
|
186
|
-
valid.argTypes = argTypes;
|
|
187
|
-
export const invalid = Template.bind(invalidProps);
|
|
188
|
-
invalid.args = invalidProps;
|
|
189
|
-
invalid.argTypes = argTypes;
|
|
190
|
-
export const loading = Template.bind(loadingProps);
|
|
191
|
-
loading.args = loadingProps;
|
|
192
|
-
loading.argTypes = argTypes;
|
|
193
|
-
const smallProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
194
|
-
size: 'small'
|
|
195
|
-
});
|
|
196
|
-
export const small = Template.bind(smallProps);
|
|
197
|
-
small.args = smallProps;
|
|
198
|
-
small.argTypes = argTypes;
|
|
199
|
-
const withValueSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
|
|
200
|
-
size: 'small'
|
|
201
|
-
});
|
|
202
|
-
export const withValueSmall = Template.bind(withValueSmallProps);
|
|
203
|
-
withValueSmall.args = withValueSmallProps;
|
|
204
|
-
withValueSmall.argTypes = argTypes;
|
|
205
|
-
const withIconSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
|
|
206
|
-
prefixIcon: CarIcon,
|
|
207
|
-
size: 'small'
|
|
208
|
-
});
|
|
209
|
-
export const withIconSmall = Template.bind(withIconSmallProps);
|
|
210
|
-
withIconSmall.args = withIconSmallProps;
|
|
211
|
-
withIconSmall.argTypes = argTypes;
|
|
212
|
-
const loadingSmallProps = _objectSpread(_objectSpread({}, withAValueProps), {}, {
|
|
213
|
-
isLoading: true,
|
|
214
|
-
size: 'small'
|
|
215
|
-
});
|
|
216
|
-
export const loadingSmall = Template.bind(loadingSmallProps);
|
|
217
|
-
loadingSmall.args = loadingSmallProps;
|
|
218
|
-
loadingSmall.argTypes = argTypes;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import { Text } from "../Text/index.js";
|
|
8
|
-
import { OrderedList } from "./index.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export default {
|
|
12
|
-
title: 'Foundation/List/OrderedList',
|
|
13
|
-
component: OrderedList
|
|
14
|
-
};
|
|
15
|
-
const Template = args => _jsxs(OrderedList, _objectSpread(_objectSpread({}, args), {}, {
|
|
16
|
-
children: [_jsx(OrderedList.Item, {
|
|
17
|
-
children: _jsx(Text, {
|
|
18
|
-
children: "Strawberry"
|
|
19
|
-
})
|
|
20
|
-
}), _jsxs(OrderedList.Item, {
|
|
21
|
-
children: [_jsx(Text, {
|
|
22
|
-
children: "Watermelon"
|
|
23
|
-
}), _jsxs(OrderedList, {
|
|
24
|
-
children: [_jsx(OrderedList.Item, {
|
|
25
|
-
children: _jsx(Text, {
|
|
26
|
-
children: "Mango"
|
|
27
|
-
})
|
|
28
|
-
}), _jsx(OrderedList.Item, {
|
|
29
|
-
children: _jsx(Text, {
|
|
30
|
-
children: "Banana"
|
|
31
|
-
})
|
|
32
|
-
}), _jsxs(OrderedList.Item, {
|
|
33
|
-
children: [_jsx(Text, {
|
|
34
|
-
children: "Apple"
|
|
35
|
-
}), _jsxs(OrderedList, {
|
|
36
|
-
children: [_jsx(OrderedList.Item, {
|
|
37
|
-
children: _jsx(Text, {
|
|
38
|
-
children: "Grape"
|
|
39
|
-
})
|
|
40
|
-
}), _jsx(OrderedList.Item, {
|
|
41
|
-
children: _jsx(Text, {
|
|
42
|
-
children: "Orange"
|
|
43
|
-
})
|
|
44
|
-
})]
|
|
45
|
-
})]
|
|
46
|
-
}), _jsx(OrderedList.Item, {
|
|
47
|
-
children: _jsx(Text, {
|
|
48
|
-
children: "Pineapple"
|
|
49
|
-
})
|
|
50
|
-
})]
|
|
51
|
-
})]
|
|
52
|
-
}), _jsx(OrderedList.Item, {
|
|
53
|
-
children: _jsx(Text, {
|
|
54
|
-
children: "Pear"
|
|
55
|
-
})
|
|
56
|
-
})]
|
|
57
|
-
}));
|
|
58
|
-
export const standard = Template.bind({});
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
import { action } from '@storybook/addon-actions';
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import { Button } from "../Button/index.js";
|
|
9
|
-
import { OutsideClick } from "./index.js";
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
export default {
|
|
12
|
-
title: 'Utility/OutsideClick',
|
|
13
|
-
component: OutsideClick,
|
|
14
|
-
parameters: {
|
|
15
|
-
chromatic: {
|
|
16
|
-
disable: true
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
argTypes: {
|
|
20
|
-
children: {
|
|
21
|
-
control: {
|
|
22
|
-
disable: true
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
const Template = args => _jsx(OutsideClick, _objectSpread(_objectSpread({}, args), {}, {
|
|
28
|
-
children: _jsx(Button, {
|
|
29
|
-
children: "Click anywhere but here"
|
|
30
|
-
})
|
|
31
|
-
}));
|
|
32
|
-
const standardProps = {
|
|
33
|
-
onOutsideClick() {
|
|
34
|
-
action('onOutsideClick');
|
|
35
|
-
alert('clicking outside');
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export const standard = Template.bind(standardProps);
|
|
39
|
-
standard.args = standardProps;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
import { action } from '@storybook/addon-actions';
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import { Box } from "../Box/index.js";
|
|
9
|
-
import { Pagination } from "./index.js";
|
|
10
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
-
export default {
|
|
12
|
-
title: 'Components/Pagination/Numbered',
|
|
13
|
-
component: Pagination
|
|
14
|
-
};
|
|
15
|
-
const Template = args => _jsx(Box, {
|
|
16
|
-
style: {
|
|
17
|
-
height: '100vh',
|
|
18
|
-
width: '100vw',
|
|
19
|
-
maxHeight: '350px'
|
|
20
|
-
},
|
|
21
|
-
display: "flex",
|
|
22
|
-
alignItems: "center",
|
|
23
|
-
justifyContent: "center",
|
|
24
|
-
children: _jsx(Pagination, _objectSpread({}, args))
|
|
25
|
-
});
|
|
26
|
-
const standardProps = {
|
|
27
|
-
activePage: 5,
|
|
28
|
-
total: 100,
|
|
29
|
-
pageSize: 10,
|
|
30
|
-
numPagesDisplayed: 5,
|
|
31
|
-
loading: false,
|
|
32
|
-
onChange: action('onChange')
|
|
33
|
-
};
|
|
34
|
-
export const standard = Template.bind(standardProps);
|
|
35
|
-
standard.args = standardProps;
|
|
36
|
-
const loadingProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
37
|
-
loading: true
|
|
38
|
-
});
|
|
39
|
-
export const loading = Template.bind(loadingProps);
|
|
40
|
-
loading.args = loadingProps;
|
|
41
|
-
const lessThanMaxPagesProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
42
|
-
activePage: 1,
|
|
43
|
-
total: 20,
|
|
44
|
-
pageSize: 10,
|
|
45
|
-
numPagesDisplayed: 5
|
|
46
|
-
});
|
|
47
|
-
export const lessThanMaxPages = Template.bind(lessThanMaxPagesProps);
|
|
48
|
-
lessThanMaxPages.args = lessThanMaxPagesProps;
|
|
49
|
-
const allPagesFitProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
50
|
-
activePage: 1,
|
|
51
|
-
total: 45,
|
|
52
|
-
pageSize: 10,
|
|
53
|
-
numPagesDisplayed: 5
|
|
54
|
-
});
|
|
55
|
-
export const allPagesFit = Template.bind(allPagesFitProps);
|
|
56
|
-
allPagesFit.args = allPagesFitProps;
|
|
57
|
-
const jumpForwardStartProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
58
|
-
activePage: 1,
|
|
59
|
-
total: 638,
|
|
60
|
-
pageSize: 10,
|
|
61
|
-
numPagesDisplayed: 5
|
|
62
|
-
});
|
|
63
|
-
export const jumpForwardStart = Template.bind(jumpForwardStartProps);
|
|
64
|
-
jumpForwardStart.args = jumpForwardStartProps;
|
|
65
|
-
const jumpForwardMiddleProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
66
|
-
activePage: 4,
|
|
67
|
-
total: 638,
|
|
68
|
-
pageSize: 10,
|
|
69
|
-
numPagesDisplayed: 5
|
|
70
|
-
});
|
|
71
|
-
export const jumpForwardMiddle = Template.bind(jumpForwardMiddleProps);
|
|
72
|
-
jumpForwardMiddle.args = jumpForwardMiddleProps;
|
|
73
|
-
const lastChunkStartProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
74
|
-
activePage: 60,
|
|
75
|
-
total: 638,
|
|
76
|
-
pageSize: 10,
|
|
77
|
-
numPagesDisplayed: 5
|
|
78
|
-
});
|
|
79
|
-
export const lastChunkStart = Template.bind(lastChunkStartProps);
|
|
80
|
-
lastChunkStart.args = lastChunkStartProps;
|
|
81
|
-
const lastChunkMiddleProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
82
|
-
activePage: 61,
|
|
83
|
-
total: 638,
|
|
84
|
-
pageSize: 10,
|
|
85
|
-
numPagesDisplayed: 5
|
|
86
|
-
});
|
|
87
|
-
export const lastChunkMiddle = Template.bind(lastChunkMiddleProps);
|
|
88
|
-
lastChunkMiddle.args = lastChunkMiddleProps;
|
|
89
|
-
const jumpBackStartProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
90
|
-
activePage: 62,
|
|
91
|
-
total: 638,
|
|
92
|
-
pageSize: 10,
|
|
93
|
-
numPagesDisplayed: 5
|
|
94
|
-
});
|
|
95
|
-
export const jumpBackStart = Template.bind(jumpBackStartProps);
|
|
96
|
-
jumpBackStart.args = lastChunkMiddleProps;
|
|
97
|
-
const jumpBackMiddleProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
98
|
-
activePage: 63,
|
|
99
|
-
total: 638,
|
|
100
|
-
pageSize: 10,
|
|
101
|
-
numPagesDisplayed: 5
|
|
102
|
-
});
|
|
103
|
-
export const jumpBackMiddle = Template.bind(jumpBackMiddleProps);
|
|
104
|
-
jumpBackMiddle.args = jumpBackMiddleProps;
|
|
105
|
-
const jumpBackEndProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
106
|
-
activePage: 64,
|
|
107
|
-
total: 638,
|
|
108
|
-
pageSize: 10,
|
|
109
|
-
numPagesDisplayed: 5
|
|
110
|
-
});
|
|
111
|
-
export const jumpBackEnd = Template.bind(jumpBackEndProps);
|
|
112
|
-
jumpBackEnd.args = jumpBackEndProps;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
var _document;
|
|
5
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import { Heading } from "../Heading/index.js";
|
|
9
|
-
import { Stack } from "../Stack/index.js";
|
|
10
|
-
import { Text } from "../Text/index.js";
|
|
11
|
-
import { Portal } from "./index.js";
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
export default {
|
|
15
|
-
title: 'Utility/Portal',
|
|
16
|
-
component: Portal,
|
|
17
|
-
parameters: {
|
|
18
|
-
chromatic: {
|
|
19
|
-
disable: true
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
children: {
|
|
24
|
-
control: {
|
|
25
|
-
disable: true
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
container: {
|
|
29
|
-
control: {
|
|
30
|
-
disable: true
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
const StandardTemplate = function () {
|
|
36
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
-
args[_key] = arguments[_key];
|
|
38
|
-
}
|
|
39
|
-
return _jsx(Portal, _objectSpread(_objectSpread({}, args), {}, {
|
|
40
|
-
children: _jsx(Text, {
|
|
41
|
-
colour: "primary",
|
|
42
|
-
children: "Im in a portal at the root."
|
|
43
|
-
})
|
|
44
|
-
}));
|
|
45
|
-
};
|
|
46
|
-
const NestedTemplate = function () {
|
|
47
|
-
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
48
|
-
args[_key2] = arguments[_key2];
|
|
49
|
-
}
|
|
50
|
-
return _jsx(Portal, _objectSpread(_objectSpread({}, args), {}, {
|
|
51
|
-
children: _jsxs(Stack, {
|
|
52
|
-
space: "5",
|
|
53
|
-
children: [_jsx(Heading, {
|
|
54
|
-
is: "h3",
|
|
55
|
-
colour: "information",
|
|
56
|
-
children: "test child 1"
|
|
57
|
-
}), _jsx(Portal, _objectSpread(_objectSpread({}, args), {}, {
|
|
58
|
-
children: _jsx(Text, {
|
|
59
|
-
colour: "primary",
|
|
60
|
-
children: "test child 2"
|
|
61
|
-
})
|
|
62
|
-
}))]
|
|
63
|
-
})
|
|
64
|
-
}));
|
|
65
|
-
};
|
|
66
|
-
const standardProps = {
|
|
67
|
-
container: (_document = document) === null || _document === void 0 ? void 0 : _document.getElementsByTagName('body')[0]
|
|
68
|
-
};
|
|
69
|
-
export const standard = StandardTemplate.bind(standardProps);
|
|
70
|
-
standard.args = standardProps;
|
|
71
|
-
export const nested = NestedTemplate.bind(standardProps);
|
|
72
|
-
nested.args = standardProps;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
import isChromatic from 'chromatic/isChromatic';
|
|
7
|
-
import * as React from 'react';
|
|
8
|
-
import { useRef } from 'react';
|
|
9
|
-
import { Box } from "../Box/index.js";
|
|
10
|
-
import { Button } from "../Button/index.js";
|
|
11
|
-
import { Text } from "../Text/index.js";
|
|
12
|
-
import { EAlignment } from "./alignment.js";
|
|
13
|
-
import { Positioner } from "./index.js";
|
|
14
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
15
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
export default {
|
|
17
|
-
title: 'Utility/Positioner',
|
|
18
|
-
component: Positioner,
|
|
19
|
-
parameters: {
|
|
20
|
-
chromatic: {}
|
|
21
|
-
},
|
|
22
|
-
argTypes: {
|
|
23
|
-
alignment: {
|
|
24
|
-
options: EAlignment,
|
|
25
|
-
defaultValue: EAlignment.BOTTOM_LEFT,
|
|
26
|
-
control: {
|
|
27
|
-
type: 'select'
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
triggerOffset: {
|
|
31
|
-
control: {
|
|
32
|
-
type: 'range',
|
|
33
|
-
min: 0,
|
|
34
|
-
max: 400
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const Template = args => {
|
|
40
|
-
const triggerRef = useRef(null);
|
|
41
|
-
return _jsxs("div", {
|
|
42
|
-
children: [_jsx(Button, {
|
|
43
|
-
ref: triggerRef,
|
|
44
|
-
size: "small",
|
|
45
|
-
children: "Open me"
|
|
46
|
-
}), _jsx(Positioner, _objectSpread(_objectSpread({}, args), {}, {
|
|
47
|
-
triggerRef: triggerRef,
|
|
48
|
-
children: _jsx(Box, {
|
|
49
|
-
boxShadow: 1,
|
|
50
|
-
backgroundColour: "white",
|
|
51
|
-
borderRadius: "1",
|
|
52
|
-
borderWidth: "1",
|
|
53
|
-
borderColour: "gray",
|
|
54
|
-
padding: "2",
|
|
55
|
-
children: _jsxs(Text, {
|
|
56
|
-
is: "p",
|
|
57
|
-
children: ["Hello im from the consumer:", ' ', isChromatic() ? '999' : Math.ceil(Math.random() * 100)]
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
}))]
|
|
61
|
-
});
|
|
62
|
-
};
|
|
63
|
-
const WithScrollTemplate = args => {
|
|
64
|
-
const triggerRef = useRef(null);
|
|
65
|
-
return _jsx("div", {
|
|
66
|
-
style: {
|
|
67
|
-
height: '100%',
|
|
68
|
-
width: '100%'
|
|
69
|
-
},
|
|
70
|
-
children: _jsxs("div", {
|
|
71
|
-
style: {
|
|
72
|
-
height: 'calc(100vh*5)',
|
|
73
|
-
width: 'calc(100vw*5)'
|
|
74
|
-
},
|
|
75
|
-
children: [_jsx("div", {
|
|
76
|
-
style: {
|
|
77
|
-
paddingTop: 'calc((100vh*5) / 2)',
|
|
78
|
-
paddingLeft: 'calc((100vw*5) / 2)'
|
|
79
|
-
},
|
|
80
|
-
children: _jsx(Button, {
|
|
81
|
-
ref: triggerRef,
|
|
82
|
-
size: "small",
|
|
83
|
-
children: "I'm the trigger"
|
|
84
|
-
})
|
|
85
|
-
}), _jsx(Positioner, _objectSpread(_objectSpread({}, args), {}, {
|
|
86
|
-
triggerRef: triggerRef,
|
|
87
|
-
children: _jsx(Box, {
|
|
88
|
-
boxShadow: 1,
|
|
89
|
-
backgroundColour: "white",
|
|
90
|
-
borderRadius: "1",
|
|
91
|
-
borderWidth: "1",
|
|
92
|
-
borderColour: "gray",
|
|
93
|
-
padding: "2",
|
|
94
|
-
children: _jsxs(Text, {
|
|
95
|
-
is: "p",
|
|
96
|
-
children: ["Hello im from the consumer:", ' ', Math.ceil(Math.random() * 100)]
|
|
97
|
-
})
|
|
98
|
-
})
|
|
99
|
-
}))]
|
|
100
|
-
})
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
const standardProps = {
|
|
104
|
-
alignment: EAlignment.BOTTOM_LEFT,
|
|
105
|
-
isOpen: false,
|
|
106
|
-
triggerOffset: 12
|
|
107
|
-
};
|
|
108
|
-
export const closed = Template.bind(standardProps);
|
|
109
|
-
closed.args = standardProps;
|
|
110
|
-
const openProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
111
|
-
isOpen: true
|
|
112
|
-
});
|
|
113
|
-
export const open = Template.bind(openProps);
|
|
114
|
-
open.args = openProps;
|
|
115
|
-
const illustrateAScrollProps = _objectSpread(_objectSpread({}, standardProps), {}, {
|
|
116
|
-
isOpen: true
|
|
117
|
-
});
|
|
118
|
-
export const illustrateAScroll = WithScrollTemplate.bind(illustrateAScrollProps);
|
|
119
|
-
illustrateAScroll.args = openProps;
|
|
120
|
-
illustrateAScroll.parameters = {
|
|
121
|
-
chromatic: {
|
|
122
|
-
disableSnapshot: true
|
|
123
|
-
}
|
|
124
|
-
};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
4
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
6
|
-
import * as React from 'react';
|
|
7
|
-
import { Stack } from "../Stack/index.js";
|
|
8
|
-
import { ProgressBar } from "./index.js";
|
|
9
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
10
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
|
-
export default {
|
|
12
|
-
title: 'Components/Progress/ProgressBar',
|
|
13
|
-
component: ProgressBar
|
|
14
|
-
};
|
|
15
|
-
const Template = args => _jsx(ProgressBar, _objectSpread({}, args));
|
|
16
|
-
const AllColoursTemplate = args => _jsxs(Stack, {
|
|
17
|
-
space: "2",
|
|
18
|
-
children: [_jsx(ProgressBar, _objectSpread({
|
|
19
|
-
value: 0.5,
|
|
20
|
-
colour: "green"
|
|
21
|
-
}, args)), _jsx(ProgressBar, _objectSpread({
|
|
22
|
-
value: 0.4,
|
|
23
|
-
colour: "blue"
|
|
24
|
-
}, args)), _jsx(ProgressBar, _objectSpread({
|
|
25
|
-
value: 0.1,
|
|
26
|
-
colour: "neutral"
|
|
27
|
-
}, args)), _jsx(ProgressBar, _objectSpread({
|
|
28
|
-
value: 15,
|
|
29
|
-
colour: "red"
|
|
30
|
-
}, args)), _jsx(ProgressBar, _objectSpread({
|
|
31
|
-
value: 0.156,
|
|
32
|
-
colour: "yellow"
|
|
33
|
-
}, args))]
|
|
34
|
-
});
|
|
35
|
-
const standardProps = {};
|
|
36
|
-
export const standard = Template.bind(standardProps);
|
|
37
|
-
standard.args = standardProps;
|
|
38
|
-
const withValueProps = {
|
|
39
|
-
value: 0.3
|
|
40
|
-
};
|
|
41
|
-
export const withValue = Template.bind(withValueProps);
|
|
42
|
-
withValue.args = withValueProps;
|
|
43
|
-
export const allColours = AllColoursTemplate.bind(standardProps);
|
|
44
|
-
allColours.args = standardProps;
|