@helpdice/ui 1.7.5 → 1.7.8
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/CurrencyInput/index.js +2981 -0
- package/dist/LinearProgress/index.d.ts +2 -0
- package/dist/{css-baseline → LinearProgress}/index.js +25 -317
- package/dist/LinearProgress/linear-progress.d.ts +9 -0
- package/dist/Loadable/index.js +570 -0
- package/dist/PhoneInput/index.js +2136 -314
- package/dist/Placeholder/index.js +2116 -254
- package/dist/auto-complete/index.js +2145 -652
- package/dist/avatar/index.js +2119 -333
- package/dist/badge/index.js +2117 -331
- package/dist/breadcrumbs/index.js +2126 -340
- package/dist/button/button.compact.d.ts +2 -0
- package/dist/button/index.js +2214 -342
- package/dist/button-dropdown/index.js +2120 -291
- package/dist/button-group/index.js +2117 -331
- package/dist/capacity/index.js +2117 -331
- package/dist/card/index.js +2127 -298
- package/dist/checkbox/index.js +2119 -290
- package/dist/code/index.js +2116 -297
- package/dist/collapse/index.js +2117 -475
- package/dist/description/index.js +2117 -331
- package/dist/display/index.js +2117 -331
- package/dist/divider/index.js +2118 -332
- package/dist/dot/index.js +2117 -331
- package/dist/drawer/index.js +2129 -439
- package/dist/fieldset/index.js +2121 -354
- package/dist/grid/index.js +2119 -333
- package/dist/image/index.js +2122 -336
- package/dist/index.d.ts +2 -14
- package/dist/index.js +3175 -1879
- package/dist/input/index.js +2125 -296
- package/dist/keyboard/index.js +2116 -297
- package/dist/link/index.js +2117 -331
- package/dist/list/index.js +2119 -333
- package/dist/loading/index.js +2117 -331
- package/dist/menu/index.js +77 -45
- package/dist/modal/index.js +2145 -452
- package/dist/note/index.js +2117 -331
- package/dist/page/index.js +2117 -331
- package/dist/pagination/index.js +2118 -351
- package/dist/popover/index.js +2123 -354
- package/dist/progress/index.js +2117 -331
- package/dist/radio/index.js +2120 -334
- package/dist/rating/index.js +2118 -332
- package/dist/row/index.js +2115 -296
- package/dist/select/index.js +2151 -688
- package/dist/slider/index.js +2123 -356
- package/dist/snippet/index.js +2118 -421
- package/dist/spacer/index.js +2115 -296
- package/dist/spinner/index.js +2117 -331
- package/dist/table/index.js +2341 -754
- package/dist/tabs/index.js +2123 -344
- package/dist/tag/index.js +2116 -254
- package/dist/text/index.js +2116 -297
- package/dist/textarea/index.js +2117 -288
- package/dist/toggle/index.js +2117 -331
- package/dist/tooltip/index.js +2120 -351
- package/dist/tree/index.js +2123 -459
- package/dist/use-input/index.js +2122 -24
- package/dist/use-modal/index.js +2122 -24
- package/dist/use-network-status/index.d.ts +2 -0
- package/dist/{use-current-state → use-network-status}/index.js +22 -15
- package/dist/use-network-status/use-netowork-status.d.ts +4 -0
- package/dist/use-scale/index.js +2115 -296
- package/dist/use-tabs/index.js +2122 -24
- package/dist/user/index.js +2123 -337
- package/esm/CurrencyInput/components/CurrencyInput.js +342 -0
- package/esm/CurrencyInput/components/CurrencyInputProps.js +1 -0
- package/esm/CurrencyInput/components/utils/addSeparators.js +7 -0
- package/esm/CurrencyInput/components/utils/cleanValue.js +69 -0
- package/esm/CurrencyInput/components/utils/escapeRegExp.js +8 -0
- package/esm/CurrencyInput/components/utils/fixedDecimalValue.js +29 -0
- package/esm/CurrencyInput/components/utils/formatValue.js +124 -0
- package/esm/CurrencyInput/components/utils/getLocaleConfig.js +47 -0
- package/esm/CurrencyInput/components/utils/getSuffix.js +10 -0
- package/esm/CurrencyInput/components/utils/index.js +8 -0
- package/esm/CurrencyInput/components/utils/isNumber.js +3 -0
- package/esm/CurrencyInput/components/utils/padTrimValue.js +27 -0
- package/esm/CurrencyInput/components/utils/parseAbbrValue.js +43 -0
- package/esm/CurrencyInput/components/utils/removeInvalidChars.js +10 -0
- package/esm/CurrencyInput/components/utils/removeSeparators.js +10 -0
- package/esm/CurrencyInput/components/utils/repositionCursor.js +35 -0
- package/esm/CurrencyInput/index.js +4 -0
- package/esm/LinearProgress/index.d.ts +2 -0
- package/esm/LinearProgress/index.js +2 -0
- package/esm/LinearProgress/linear-progress.d.ts +9 -0
- package/esm/LinearProgress/linear-progress.js +28 -0
- package/esm/Loadable/index.js +2 -0
- package/esm/PhoneInput/phone.js +22 -19
- package/esm/auto-complete/auto-complete-dropdown.js +1 -3
- package/esm/auto-complete/auto-complete-item.js +1 -3
- package/esm/auto-complete/auto-complete-searching.js +1 -1
- package/esm/auto-complete/auto-complete.js +1 -1
- package/esm/avatar/avatar-group.js +1 -2
- package/esm/avatar/avatar.js +1 -2
- package/esm/badge/badge.js +1 -2
- package/esm/breadcrumbs/breadcrumbs-item.js +1 -1
- package/esm/breadcrumbs/breadcrumbs-separator.js +1 -1
- package/esm/breadcrumbs/breadcrumbs.js +1 -1
- package/esm/button/button-icon.js +1 -1
- package/esm/button/button.compact.d.ts +2 -0
- package/esm/button/button.compact.js +94 -50
- package/esm/button/button.js +1 -2
- package/esm/button/utils.js +1 -1
- package/esm/button-dropdown/button-dropdown-item.js +1 -1
- package/esm/button-dropdown/button-dropdown.js +1 -2
- package/esm/button-group/button-group.js +1 -2
- package/esm/capacity/capacity.js +1 -2
- package/esm/card/card-content.js +1 -1
- package/esm/card/card-footer.js +1 -2
- package/esm/card/card.js +1 -2
- package/esm/carousal/Arrow.js +18 -0
- package/esm/carousal/Indicator.js +20 -0
- package/esm/carousal/Thumbs.js +302 -0
- package/esm/carousal/animations.js +162 -0
- package/esm/carousal/index.js +683 -0
- package/esm/carousal/types.js +1 -0
- package/esm/carousal/utils.js +49 -0
- package/esm/checkbox/checkbox-group.js +1 -1
- package/esm/checkbox/checkbox.icon.js +1 -1
- package/esm/checkbox/checkbox.js +1 -2
- package/esm/code/code.js +1 -1
- package/esm/collapse/collapse-group.js +1 -2
- package/esm/collapse/collapse.js +1 -4
- package/esm/description/description.js +1 -2
- package/esm/display/display.js +1 -2
- package/esm/divider/divider.js +1 -2
- package/esm/dot/dot.js +1 -2
- package/esm/drawer/drawer-wrapper.js +1 -3
- package/esm/drawer/drawer.js +1 -1
- package/esm/fieldset/fieldset-content.js +1 -1
- package/esm/fieldset/fieldset-footer.js +1 -1
- package/esm/fieldset/fieldset-group.js +1 -3
- package/esm/fieldset/fieldset-title.js +1 -1
- package/esm/fieldset/fieldset.js +1 -2
- package/esm/grid/basic-item.js +1 -2
- package/esm/grid/grid-container.js +1 -1
- package/esm/grid/grid.js +1 -1
- package/esm/image/image-browser.js +1 -2
- package/esm/image/image.js +1 -2
- package/esm/image/image.skeleton.js +1 -1
- package/esm/index.d.ts +2 -14
- package/esm/index.js +5 -9
- package/esm/input/input-block-label.js +1 -1
- package/esm/input/input-icon-clear.js +1 -2
- package/esm/input/input-label.js +1 -1
- package/esm/input/input.js +1 -2
- package/esm/keyboard/keyboard.js +1 -1
- package/esm/link/link.js +1 -2
- package/esm/list/list-item.js +1 -2
- package/esm/loading/loading.js +1 -2
- package/esm/modal/modal-action.js +1 -2
- package/esm/modal/modal-actions.js +1 -1
- package/esm/modal/modal-content.js +1 -1
- package/esm/modal/modal-subtitle.js +1 -1
- package/esm/modal/modal-title.js +1 -1
- package/esm/modal/modal-wrapper.js +1 -3
- package/esm/modal/modal.js +1 -1
- package/esm/note/note.js +1 -2
- package/esm/page/page-header.js +1 -1
- package/esm/page/page.js +1 -1
- package/esm/pagination/pagination-item.js +1 -2
- package/esm/pagination/pagination.js +1 -1
- package/esm/popover/popover-item.js +1 -2
- package/esm/popover/popover.js +1 -1
- package/esm/progress/progress.js +1 -2
- package/esm/radio/radio-description.js +1 -1
- package/esm/radio/radio-group.js +1 -1
- package/esm/radio/radio.js +1 -2
- package/esm/rating/rating.js +1 -2
- package/esm/row/row.js +1 -1
- package/esm/select/select-dropdown.js +1 -3
- package/esm/select/select-icon-clear.js +1 -1
- package/esm/select/select-multiple-value.js +1 -1
- package/esm/select/select-option.js +1 -3
- package/esm/select/select.js +9 -12
- package/esm/slider/slider-dot.js +1 -2
- package/esm/slider/slider-mark.js +1 -1
- package/esm/slider/slider.js +1 -3
- package/esm/snippet/snippet.js +1 -3
- package/esm/spinner/spinner.js +1 -2
- package/esm/table/table-body.js +1 -2
- package/esm/table/table-head.js +3 -2
- package/esm/tabs/tabs-item.js +1 -2
- package/esm/tabs/tabs.js +1 -3
- package/esm/tag/tag.js +1 -1
- package/esm/text/child.js +1 -1
- package/esm/textarea/textarea.js +1 -2
- package/esm/toggle/toggle.js +1 -2
- package/esm/tooltip/tooltip-content.js +1 -3
- package/esm/tooltip/tooltip-icon.js +1 -1
- package/esm/tooltip/tooltip.js +1 -1
- package/esm/tree/tree-file-icon.js +1 -1
- package/esm/tree/tree-file.js +1 -2
- package/esm/tree/tree-folder-icon.js +1 -1
- package/esm/tree/tree-folder.js +1 -3
- package/esm/tree/tree-status-icon.js +1 -1
- package/esm/tree/tree.js +1 -1
- package/esm/use-input/use-input.js +1 -1
- package/esm/use-modal/use-modal.js +1 -1
- package/esm/use-network-status/index.d.ts +2 -0
- package/esm/use-network-status/index.js +2 -0
- package/esm/use-network-status/use-netowork-status.d.ts +4 -0
- package/esm/use-network-status/use-netowork-status.js +29 -0
- package/esm/use-scale/with-scale.js +1 -1
- package/esm/use-tabs/use-tabs.js +1 -1
- package/esm/user/user.js +1 -2
- package/esm/utils/use-context-state/use-context-state.js +1 -1
- package/esm/utils/use-drag.js +1 -1
- package/package.json +12 -4
- package/dist/css-baseline/css-baseline.d.ts +0 -9
- package/dist/css-baseline/index.d.ts +0 -1
- package/dist/shared/backdrop.d.ts +0 -14
- package/dist/shared/css-transition.d.ts +0 -13
- package/dist/shared/dropdown.d.ts +0 -9
- package/dist/shared/ellipsis.d.ts +0 -6
- package/dist/shared/expand.d.ts +0 -7
- package/dist/shared/highlight.d.ts +0 -13
- package/dist/ui-provider/index.d.ts +0 -3
- package/dist/ui-provider/index.js +0 -2186
- package/dist/ui-provider/theme-provider.d.ts +0 -8
- package/dist/ui-provider/ui-provider.d.ts +0 -8
- package/dist/use-all-themes/all-themes-context.d.ts +0 -7
- package/dist/use-all-themes/index.d.ts +0 -3
- package/dist/use-all-themes/index.js +0 -311
- package/dist/use-classes/index.d.ts +0 -2
- package/dist/use-classes/index.js +0 -48
- package/dist/use-classes/use-classes.d.ts +0 -4
- package/dist/use-current-state/index.d.ts +0 -2
- package/dist/use-current-state/use-current-state.d.ts +0 -4
- package/dist/use-media-query/index.d.ts +0 -3
- package/dist/use-media-query/index.js +0 -444
- package/dist/use-media-query/use-media-query.d.ts +0 -12
- package/dist/use-theme/index.d.ts +0 -2
- package/dist/use-theme/index.js +0 -309
- package/dist/use-theme/theme-context.d.ts +0 -4
- package/dist/use-toasts/helpers.d.ts +0 -18
- package/dist/use-toasts/index.d.ts +0 -3
- package/dist/use-toasts/index.js +0 -204
- package/dist/use-toasts/toast-container.d.ts +0 -3
- package/dist/use-toasts/toast-item.d.ts +0 -8
- package/dist/use-toasts/use-toast.d.ts +0 -40
- package/dist/utils/use-current-state.d.ts +0 -2
- package/dist/utils/use-dom-observer.d.ts +0 -3
- package/dist/utils/use-hd-ui-context.d.ts +0 -16
- package/dist/utils/use-previous.d.ts +0 -2
- package/esm/captcha/index.js +0 -128
- package/esm/css-baseline/css-baseline.d.ts +0 -9
- package/esm/css-baseline/css-baseline.js +0 -23
- package/esm/css-baseline/index.d.ts +0 -1
- package/esm/css-baseline/index.js +0 -2
- package/esm/shared/backdrop.d.ts +0 -14
- package/esm/shared/backdrop.js +0 -66
- package/esm/shared/css-transition.d.ts +0 -13
- package/esm/shared/css-transition.js +0 -65
- package/esm/shared/dropdown.d.ts +0 -9
- package/esm/shared/dropdown.js +0 -99
- package/esm/shared/ellipsis.d.ts +0 -6
- package/esm/shared/ellipsis.js +0 -13
- package/esm/shared/expand.d.ts +0 -7
- package/esm/shared/expand.js +0 -86
- package/esm/shared/highlight.d.ts +0 -13
- package/esm/shared/highlight.js +0 -46
- package/esm/ui-provider/index.d.ts +0 -3
- package/esm/ui-provider/index.js +0 -4
- package/esm/ui-provider/theme-provider.d.ts +0 -8
- package/esm/ui-provider/theme-provider.js +0 -45
- package/esm/ui-provider/ui-provider.d.ts +0 -8
- package/esm/ui-provider/ui-provider.js +0 -55
- package/esm/use-all-themes/all-themes-context.d.ts +0 -7
- package/esm/use-all-themes/all-themes-context.js +0 -11
- package/esm/use-all-themes/index.d.ts +0 -3
- package/esm/use-all-themes/index.js +0 -2
- package/esm/use-classes/index.d.ts +0 -2
- package/esm/use-classes/index.js +0 -2
- package/esm/use-classes/use-classes.d.ts +0 -4
- package/esm/use-classes/use-classes.js +0 -34
- package/esm/use-current-state/index.d.ts +0 -2
- package/esm/use-current-state/index.js +0 -2
- package/esm/use-current-state/use-current-state.d.ts +0 -4
- package/esm/use-current-state/use-current-state.js +0 -23
- package/esm/use-media-query/index.d.ts +0 -3
- package/esm/use-media-query/index.js +0 -2
- package/esm/use-media-query/use-media-query.d.ts +0 -12
- package/esm/use-media-query/use-media-query.js +0 -81
- package/esm/use-theme/index.d.ts +0 -2
- package/esm/use-theme/index.js +0 -2
- package/esm/use-theme/theme-context.d.ts +0 -4
- package/esm/use-theme/theme-context.js +0 -9
- package/esm/use-toasts/helpers.d.ts +0 -18
- package/esm/use-toasts/helpers.js +0 -68
- package/esm/use-toasts/index.d.ts +0 -3
- package/esm/use-toasts/index.js +0 -2
- package/esm/use-toasts/toast-container.d.ts +0 -3
- package/esm/use-toasts/toast-container.js +0 -120
- package/esm/use-toasts/toast-item.d.ts +0 -8
- package/esm/use-toasts/toast-item.js +0 -45
- package/esm/use-toasts/use-toast.d.ts +0 -40
- package/esm/use-toasts/use-toast.js +0 -103
- package/esm/utils/use-current-state.d.ts +0 -2
- package/esm/utils/use-current-state.js +0 -2
- package/esm/utils/use-dom-observer.d.ts +0 -3
- package/esm/utils/use-hd-ui-context.d.ts +0 -16
- package/esm/utils/use-previous.d.ts +0 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
export var padTrimValue = function padTrimValue(value) {
|
|
3
|
+
var decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
|
|
4
|
+
var decimalScale = arguments.length > 2 ? arguments[2] : undefined;
|
|
5
|
+
if (decimalScale === undefined || value === '' || value === undefined) {
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
if (!value.match(/\d/g)) {
|
|
9
|
+
return '';
|
|
10
|
+
}
|
|
11
|
+
var _value$split = value.split(decimalSeparator),
|
|
12
|
+
_value$split2 = _slicedToArray(_value$split, 2),
|
|
13
|
+
_int = _value$split2[0],
|
|
14
|
+
decimals = _value$split2[1];
|
|
15
|
+
if (decimalScale === 0) {
|
|
16
|
+
return _int;
|
|
17
|
+
}
|
|
18
|
+
var newValue = decimals || '';
|
|
19
|
+
if (newValue.length < decimalScale) {
|
|
20
|
+
while (newValue.length < decimalScale) {
|
|
21
|
+
newValue += '0';
|
|
22
|
+
}
|
|
23
|
+
} else {
|
|
24
|
+
newValue = newValue.slice(0, decimalScale);
|
|
25
|
+
}
|
|
26
|
+
return "".concat(_int).concat(decimalSeparator).concat(newValue);
|
|
27
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { escapeRegExp } from './escapeRegExp';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Abbreviate number eg. 1000 = 1k
|
|
6
|
+
*
|
|
7
|
+
* Source: https://stackoverflow.com/a/9345181
|
|
8
|
+
*/
|
|
9
|
+
export var abbrValue = function abbrValue(value) {
|
|
10
|
+
var decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
|
|
11
|
+
var _decimalPlaces = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10;
|
|
12
|
+
if (value > 999) {
|
|
13
|
+
var valueLength = ('' + value).length;
|
|
14
|
+
var p = Math.pow;
|
|
15
|
+
var d = p(10, _decimalPlaces);
|
|
16
|
+
valueLength -= valueLength % 3;
|
|
17
|
+
var _abbrValue = Math.round(value * d / p(10, valueLength)) / d + ' kMGTPE'[valueLength / 3];
|
|
18
|
+
return _abbrValue.replace('.', decimalSeparator);
|
|
19
|
+
}
|
|
20
|
+
return String(value);
|
|
21
|
+
};
|
|
22
|
+
var abbrMap = {
|
|
23
|
+
k: 1000,
|
|
24
|
+
m: 1000000,
|
|
25
|
+
b: 1000000000
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Parse a value with abbreviation e.g 1k = 1000
|
|
30
|
+
*/
|
|
31
|
+
export var parseAbbrValue = function parseAbbrValue(value) {
|
|
32
|
+
var decimalSeparator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '.';
|
|
33
|
+
var reg = new RegExp("(\\d+(".concat(escapeRegExp(decimalSeparator), "\\d*)?)([kmb])$"), 'i');
|
|
34
|
+
var match = value.match(reg);
|
|
35
|
+
if (match) {
|
|
36
|
+
var _match = _slicedToArray(match, 4),
|
|
37
|
+
digits = _match[1],
|
|
38
|
+
abbr = _match[3];
|
|
39
|
+
var multiplier = abbrMap[abbr.toLowerCase()];
|
|
40
|
+
return Number(digits.replace(decimalSeparator, '.')) * multiplier;
|
|
41
|
+
}
|
|
42
|
+
return undefined;
|
|
43
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { escapeRegExp } from './escapeRegExp';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Remove invalid characters
|
|
5
|
+
*/
|
|
6
|
+
export var removeInvalidChars = function removeInvalidChars(value, validChars) {
|
|
7
|
+
var chars = escapeRegExp(validChars.join(''));
|
|
8
|
+
var reg = new RegExp("[^\\d".concat(chars, "]"), 'gi');
|
|
9
|
+
return value.replace(reg, '');
|
|
10
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { escapeRegExp } from './escapeRegExp';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Remove group separator from value eg. 1,000 > 1000
|
|
5
|
+
*/
|
|
6
|
+
export var removeSeparators = function removeSeparators(value) {
|
|
7
|
+
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ',';
|
|
8
|
+
var reg = new RegExp(escapeRegExp(separator), 'g');
|
|
9
|
+
return value.replace(reg, '');
|
|
10
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Based on the last key stroke and the cursor position, update the value
|
|
3
|
+
* and reposition the cursor to the right place
|
|
4
|
+
*/
|
|
5
|
+
export var repositionCursor = function repositionCursor(_ref) {
|
|
6
|
+
var selectionStart = _ref.selectionStart,
|
|
7
|
+
value = _ref.value,
|
|
8
|
+
lastKeyStroke = _ref.lastKeyStroke,
|
|
9
|
+
stateValue = _ref.stateValue,
|
|
10
|
+
groupSeparator = _ref.groupSeparator;
|
|
11
|
+
var cursorPosition = selectionStart;
|
|
12
|
+
var modifiedValue = value;
|
|
13
|
+
if (stateValue && cursorPosition) {
|
|
14
|
+
var splitValue = value.split('');
|
|
15
|
+
// if cursor is to right of groupSeparator and backspace pressed, delete the character to the left of the separator and reposition the cursor
|
|
16
|
+
if (lastKeyStroke === 'Backspace' && stateValue[cursorPosition] === groupSeparator) {
|
|
17
|
+
splitValue.splice(cursorPosition - 1, 1);
|
|
18
|
+
cursorPosition -= 1;
|
|
19
|
+
}
|
|
20
|
+
// if cursor is to left of groupSeparator and delete pressed, delete the character to the right of the separator and reposition the cursor
|
|
21
|
+
if (lastKeyStroke === 'Delete' && stateValue[cursorPosition] === groupSeparator) {
|
|
22
|
+
splitValue.splice(cursorPosition, 1);
|
|
23
|
+
cursorPosition += 1;
|
|
24
|
+
}
|
|
25
|
+
modifiedValue = splitValue.join('');
|
|
26
|
+
return {
|
|
27
|
+
modifiedValue: modifiedValue,
|
|
28
|
+
cursorPosition: cursorPosition
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
return {
|
|
32
|
+
modifiedValue: modifiedValue,
|
|
33
|
+
cursorPosition: selectionStart
|
|
34
|
+
};
|
|
35
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _JSXStyle from "../styled-jsx.es.js";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
var LinearProgress = function LinearProgress(_ref) {
|
|
4
|
+
var _ref$isActive = _ref.isActive,
|
|
5
|
+
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
6
|
+
progress = _ref.progress,
|
|
7
|
+
_ref$color = _ref.color,
|
|
8
|
+
color = _ref$color === void 0 ? '#1976d2' : _ref$color,
|
|
9
|
+
_ref$speed = _ref.speed,
|
|
10
|
+
speed = _ref$speed === void 0 ? 1.5 : _ref$speed;
|
|
11
|
+
if (!isActive) return null;
|
|
12
|
+
var isDeterminate = typeof progress === 'number' && progress >= 0 && progress <= 100;
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: _JSXStyle.dynamic([["2900495535", [color, speed]]]) + " " + "loader-wrapper"
|
|
15
|
+
}, isDeterminate ? /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
style: {
|
|
17
|
+
width: "".concat(progress, "%"),
|
|
18
|
+
backgroundColor: color
|
|
19
|
+
},
|
|
20
|
+
className: _JSXStyle.dynamic([["2900495535", [color, speed]]]) + " " + "determinate-bar"
|
|
21
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
22
|
+
className: _JSXStyle.dynamic([["2900495535", [color, speed]]]) + " " + "indeterminate-loader"
|
|
23
|
+
}), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
24
|
+
id: "2900495535",
|
|
25
|
+
dynamic: [color, speed]
|
|
26
|
+
}, ".loader-wrapper.__jsx-style-dynamic-selector{position:fixed;top:0;left:0;width:100%;height:4px;background:rgba(0,0,0,0.05);z-index:2000;overflow:hidden;}.determinate-bar.__jsx-style-dynamic-selector{height:100%;-webkit-transition:width 0.3s ease;transition:width 0.3s ease;}.indeterminate-loader.__jsx-style-dynamic-selector{width:100%;height:100%;background:linear-gradient( to right, transparent 0%, ".concat(color, " 50%, transparent 100% );background-size:200% 100%;-webkit-animation:slide-__jsx-style-dynamic-selector ").concat(speed, "s linear infinite;animation:slide-__jsx-style-dynamic-selector ").concat(speed, "s linear infinite;}@-webkit-keyframes slide-__jsx-style-dynamic-selector{from{background-position:-100% 0;}to{background-position:100% 0;}}@keyframes slide-__jsx-style-dynamic-selector{from{background-position:-100% 0;}to{background-position:100% 0;}}")));
|
|
27
|
+
};
|
|
28
|
+
export default LinearProgress;
|
package/esm/PhoneInput/phone.js
CHANGED
|
@@ -2,7 +2,7 @@ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
|
2
2
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
3
3
|
import React, { useState, useRef, useEffect, useMemo } from 'react';
|
|
4
4
|
import countries from './countries.json';
|
|
5
|
-
import useTheme from '
|
|
5
|
+
import { useTheme } from '@helpdice/theme';
|
|
6
6
|
import { getColors } from '../input/styles';
|
|
7
7
|
var PhoneInput = function PhoneInput(_ref) {
|
|
8
8
|
var onChange = _ref.onChange,
|
|
@@ -52,7 +52,7 @@ var PhoneInput = function PhoneInput(_ref) {
|
|
|
52
52
|
var handlePhoneChange = function handlePhoneChange(e) {
|
|
53
53
|
var value = e.target.value.replace(/[^\d]/g, '');
|
|
54
54
|
setPhoneNumber(value);
|
|
55
|
-
if (onChange) onChange("".concat(selectedCountry.
|
|
55
|
+
if (onChange) onChange("".concat(selectedCountry.phone, ",").concat(value));
|
|
56
56
|
};
|
|
57
57
|
var handleClickOutside = function handleClickOutside(e) {
|
|
58
58
|
if (dropdownRef.current && !dropdownRef.current.contains(e.target)) {
|
|
@@ -71,21 +71,21 @@ var PhoneInput = function PhoneInput(_ref) {
|
|
|
71
71
|
});
|
|
72
72
|
return /*#__PURE__*/React.createElement("div", {
|
|
73
73
|
ref: dropdownRef,
|
|
74
|
-
className: _JSXStyle.dynamic([["
|
|
74
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input-container ".concat(isFocused ? 'focused' : '')
|
|
75
75
|
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: _JSXStyle.dynamic([["
|
|
76
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "input-wrapper"
|
|
77
77
|
}, /*#__PURE__*/React.createElement("div", {
|
|
78
78
|
onClick: function onClick() {
|
|
79
79
|
return setDropdownOpen(!dropdownOpen);
|
|
80
80
|
},
|
|
81
|
-
className: _JSXStyle.dynamic([["
|
|
81
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-toggle"
|
|
82
82
|
}, /*#__PURE__*/React.createElement("span", {
|
|
83
83
|
style: {
|
|
84
84
|
display: 'flex',
|
|
85
85
|
alignItems: 'center',
|
|
86
86
|
gap: 5
|
|
87
87
|
},
|
|
88
|
-
className: _JSXStyle.dynamic([["
|
|
88
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
89
89
|
}, /*#__PURE__*/React.createElement("img", {
|
|
90
90
|
loading: "lazy",
|
|
91
91
|
width: "23",
|
|
@@ -93,11 +93,14 @@ var PhoneInput = function PhoneInput(_ref) {
|
|
|
93
93
|
src: "https://flagcdn.com/w20/".concat(selectedCountry.code.toLowerCase(), ".png"),
|
|
94
94
|
srcSet: "https://flagcdn.com/w40/".concat(selectedCountry.code.toLowerCase(), ".png 2x"),
|
|
95
95
|
alt: "Flag of ".concat(selectedCountry.label),
|
|
96
|
-
className: _JSXStyle.dynamic([["
|
|
96
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
97
97
|
}), /*#__PURE__*/React.createElement("span", {
|
|
98
|
-
className: _JSXStyle.dynamic([["
|
|
98
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
99
99
|
}, selectedCountry.phone))), /*#__PURE__*/React.createElement("input", {
|
|
100
100
|
type: "tel",
|
|
101
|
+
style: {
|
|
102
|
+
width: '100%'
|
|
103
|
+
},
|
|
101
104
|
placeholder: placeholder,
|
|
102
105
|
value: phoneNumber,
|
|
103
106
|
onChange: handlePhoneChange,
|
|
@@ -107,9 +110,9 @@ var PhoneInput = function PhoneInput(_ref) {
|
|
|
107
110
|
onBlur: function onBlur() {
|
|
108
111
|
return setIsFocused(false);
|
|
109
112
|
},
|
|
110
|
-
className: _JSXStyle.dynamic([["
|
|
113
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "phone-input"
|
|
111
114
|
})), dropdownOpen && /*#__PURE__*/React.createElement("div", {
|
|
112
|
-
className: _JSXStyle.dynamic([["
|
|
115
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown"
|
|
113
116
|
}, /*#__PURE__*/React.createElement("input", {
|
|
114
117
|
type: "text",
|
|
115
118
|
placeholder: "Search country...",
|
|
@@ -117,23 +120,23 @@ var PhoneInput = function PhoneInput(_ref) {
|
|
|
117
120
|
onChange: function onChange(e) {
|
|
118
121
|
return setSearchTerm(e.target.value);
|
|
119
122
|
},
|
|
120
|
-
className: _JSXStyle.dynamic([["
|
|
123
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "search-input"
|
|
121
124
|
}), /*#__PURE__*/React.createElement("div", {
|
|
122
|
-
className: _JSXStyle.dynamic([["
|
|
125
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "country-list"
|
|
123
126
|
}, filteredCountries.length > 0 ? filteredCountries.map(function (c) {
|
|
124
127
|
return /*#__PURE__*/React.createElement("div", {
|
|
125
128
|
key: c.code,
|
|
126
129
|
onClick: function onClick() {
|
|
127
130
|
return handleSelectCountry(c);
|
|
128
131
|
},
|
|
129
|
-
className: _JSXStyle.dynamic([["
|
|
132
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item"
|
|
130
133
|
}, /*#__PURE__*/React.createElement("span", {
|
|
131
134
|
style: {
|
|
132
135
|
display: 'flex',
|
|
133
136
|
alignItems: 'center',
|
|
134
137
|
gap: 5
|
|
135
138
|
},
|
|
136
|
-
className: _JSXStyle.dynamic([["
|
|
139
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
137
140
|
}, /*#__PURE__*/React.createElement("img", {
|
|
138
141
|
loading: "lazy",
|
|
139
142
|
width: "23",
|
|
@@ -141,18 +144,18 @@ var PhoneInput = function PhoneInput(_ref) {
|
|
|
141
144
|
src: "https://flagcdn.com/w20/".concat(c.code.toLowerCase(), ".png"),
|
|
142
145
|
srcSet: "https://flagcdn.com/w40/".concat(c.code.toLowerCase(), ".png 2x"),
|
|
143
146
|
alt: "Flag of ".concat(c.label),
|
|
144
|
-
className: _JSXStyle.dynamic([["
|
|
147
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
145
148
|
}), c.phone, " ", /*#__PURE__*/React.createElement("span", {
|
|
146
149
|
style: {
|
|
147
150
|
color: 'grey'
|
|
148
151
|
},
|
|
149
|
-
className: _JSXStyle.dynamic([["
|
|
152
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]])
|
|
150
153
|
}, c.label)));
|
|
151
154
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
152
|
-
className: _JSXStyle.dynamic([["
|
|
155
|
+
className: _JSXStyle.dynamic([["1313692390", [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']]]) + " " + "dropdown-item disabled"
|
|
153
156
|
}, "No results"))), /*#__PURE__*/React.createElement(_JSXStyle, {
|
|
154
|
-
id: "
|
|
157
|
+
id: "1313692390",
|
|
155
158
|
dynamic: [hoverBorder, borderColor, borderColor, theme.type == 'dark' ? 'black' : 'white', borderColor, borderColor, theme.type == 'dark' ? '#3a3d3d' : '#efefef']
|
|
156
|
-
}, ".phone-input-container.__jsx-style-dynamic-selector{position:relative;
|
|
159
|
+
}, ".phone-input-container.__jsx-style-dynamic-selector{position:relative;min-width:200px;width:auto;}.phone-input-container.focused.__jsx-style-dynamic-selector{outline:1px solid ".concat(hoverBorder, ";border-radius:6px;}.input-wrapper.__jsx-style-dynamic-selector{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;border:1px solid ").concat(borderColor, ";border-radius:6px;overflow:hidden;}.dropdown-toggle.__jsx-style-dynamic-selector{padding:7px 12px;border-radius:6px 0px 0px 6px;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-size:14px;border-right:1px solid ").concat(borderColor, ";}.phone-input.__jsx-style-dynamic-selector{-webkit-flex:1;-ms-flex:1;flex:1;padding:5px 10px;height:35px;background-color:transparent;font-size:14px;border:none;}.phone-input.__jsx-style-dynamic-selector:focus{outline:none;}.dropdown.__jsx-style-dynamic-selector{position:absolute;top:100%;left:0;width:100%;background:").concat(theme.type == 'dark' ? 'black' : 'white', ";border:1px solid ").concat(borderColor, ";border-radius:6px;margin-top:4px;z-index:999;box-shadow:0 4px 10px rgba(0,0,0,0.1);}.search-input.__jsx-style-dynamic-selector{width:100%;padding:8px 10px;border:none;background-color:transparent;border-bottom:1px solid ").concat(borderColor, ";font-size:14px;}.search-input.__jsx-style-dynamic-selector:focus{outline:none;}.country-list.__jsx-style-dynamic-selector{max-height:200px;overflow-y:auto;}.dropdown-item.__jsx-style-dynamic-selector{padding:10px;cursor:pointer;font-size:14px;}.dropdown-item.__jsx-style-dynamic-selector:hover{background:").concat(theme.type == 'dark' ? '#3a3d3d' : '#efefef', ";}.dropdown-item.disabled.__jsx-style-dynamic-selector{color:#888;cursor:default;}")));
|
|
157
160
|
};
|
|
158
161
|
export default PhoneInput;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import useTheme from '../use-theme';
|
|
4
3
|
import { useAutoCompleteContext } from './auto-complete-context';
|
|
5
|
-
import Dropdown from '
|
|
6
|
-
import useClasses from '../use-classes';
|
|
4
|
+
import { useClasses, Dropdown, useTheme } from '@helpdice/theme';
|
|
7
5
|
var AutoCompleteDropdown = function AutoCompleteDropdown(_ref) {
|
|
8
6
|
var children = _ref.children,
|
|
9
7
|
visible = _ref.visible,
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import _JSXStyle from "../styled-jsx.es.js";
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
3
|
import React, { useMemo } from 'react';
|
|
4
|
-
import useTheme from '
|
|
4
|
+
import { useTheme, Ellipsis, useClasses } from '@helpdice/theme';
|
|
5
5
|
import { useAutoCompleteContext } from './auto-complete-context';
|
|
6
|
-
import Ellipsis from '../shared/ellipsis';
|
|
7
6
|
import useScale from '../use-scale';
|
|
8
|
-
import useClasses from '../use-classes';
|
|
9
7
|
|
|
10
8
|
// interface Props
|
|
11
9
|
|
|
@@ -14,7 +14,7 @@ import AutoCompleteEmpty from './auto-complete-empty';
|
|
|
14
14
|
import { AutoCompleteContext } from './auto-complete-context';
|
|
15
15
|
import Loading from '../loading';
|
|
16
16
|
import { pickChild } from '../utils/collections';
|
|
17
|
-
import useCurrentState from '
|
|
17
|
+
import { useCurrentState } from '@helpdice/theme';
|
|
18
18
|
import useScale, { withScale } from '../use-scale';
|
|
19
19
|
import { ArrowRight } from '@helpdice/icons';
|
|
20
20
|
var childrenToOptionsNode = function childrenToOptionsNode(options) {
|
|
@@ -2,9 +2,8 @@ import _JSXStyle from "../styled-jsx.es.js";
|
|
|
2
2
|
/* "use client" */
|
|
3
3
|
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import useTheme from '
|
|
5
|
+
import { useTheme, useClasses } from '@helpdice/theme';
|
|
6
6
|
import useScale, { withScale } from '../use-scale';
|
|
7
|
-
import useClasses from '../use-classes';
|
|
8
7
|
var AvatarGroupComponent = function AvatarGroupComponent(_ref) {
|
|
9
8
|
var count = _ref.count,
|
|
10
9
|
_ref$className = _ref.className,
|
package/esm/avatar/avatar.js
CHANGED
|
@@ -5,9 +5,8 @@ import _JSXStyle from "../styled-jsx.es.js";
|
|
|
5
5
|
/* "use client" */
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import useTheme from '
|
|
8
|
+
import { useTheme, useClasses } from '@helpdice/theme';
|
|
9
9
|
import useScale, { withScale } from '../use-scale';
|
|
10
|
-
import useClasses from '../use-classes';
|
|
11
10
|
|
|
12
11
|
// type NativeAttrs = Omit<
|
|
13
12
|
// Partial<React.ImgHTMLAttributes<any> & React.HTMLAttributes<any>>,
|
package/esm/badge/badge.js
CHANGED
|
@@ -5,9 +5,8 @@ import _JSXStyle from "../styled-jsx.es.js";
|
|
|
5
5
|
/* "use client" */
|
|
6
6
|
|
|
7
7
|
import React, { useMemo } from 'react';
|
|
8
|
-
import useTheme from '
|
|
8
|
+
import { useTheme, useClasses } from '@helpdice/theme';
|
|
9
9
|
import useScale, { withScale } from '../use-scale';
|
|
10
|
-
import useClasses from '../use-classes';
|
|
11
10
|
var getBgColor = function getBgColor(type, palette) {
|
|
12
11
|
var colors = {
|
|
13
12
|
"default": palette.foreground,
|
|
@@ -8,7 +8,7 @@ import Link from '../link';
|
|
|
8
8
|
import React, { useMemo } from 'react';
|
|
9
9
|
import { pickChild } from '../utils/collections';
|
|
10
10
|
import BreadcrumbsSeparator from './breadcrumbs-separator';
|
|
11
|
-
import useClasses from '
|
|
11
|
+
import { useClasses } from '@helpdice/theme';
|
|
12
12
|
var BreadcrumbsItem = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
13
13
|
var href = _ref.href,
|
|
14
14
|
_ref$nextLink = _ref.nextLink,
|
|
@@ -3,7 +3,7 @@ import _JSXStyle from "../styled-jsx.es.js";
|
|
|
3
3
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import useScale, { withScale } from '../use-scale';
|
|
6
|
-
import useClasses from '
|
|
6
|
+
import { useClasses } from '@helpdice/theme';
|
|
7
7
|
var Separator = function Separator(_ref) {
|
|
8
8
|
var children = _ref.children,
|
|
9
9
|
_ref$className = _ref.className,
|
|
@@ -2,7 +2,7 @@ import _JSXStyle from "../styled-jsx.es.js";
|
|
|
2
2
|
/* "use client" */
|
|
3
3
|
|
|
4
4
|
import React, { useMemo } from 'react';
|
|
5
|
-
import useTheme from '
|
|
5
|
+
import { useTheme } from '@helpdice/theme';
|
|
6
6
|
import BreadcrumbsSeparator from './breadcrumbs-separator';
|
|
7
7
|
import { addColorAlpha } from '../utils/color';
|
|
8
8
|
import useScale, { withScale } from '../use-scale';
|
|
@@ -5,7 +5,7 @@ import _JSXStyle from "../styled-jsx.es.js";
|
|
|
5
5
|
/* "use client" */
|
|
6
6
|
|
|
7
7
|
import React from 'react';
|
|
8
|
-
import useClasses from '
|
|
8
|
+
import { useClasses } from '@helpdice/theme';
|
|
9
9
|
var ButtonIcon = function ButtonIcon(_ref) {
|
|
10
10
|
var _ref$isRight = _ref.isRight,
|
|
11
11
|
isRight = _ref$isRight === void 0 ? false : _ref$isRight,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { CSSProperties } from 'react';
|
|
2
|
+
import { ButtonTypes } from 'components/button-group';
|
|
2
3
|
type CompactButtonProps = {
|
|
3
4
|
children?: React.ReactNode;
|
|
4
5
|
iconRight?: React.ReactNode;
|
|
@@ -9,6 +10,7 @@ type CompactButtonProps = {
|
|
|
9
10
|
style?: CSSProperties;
|
|
10
11
|
a?: boolean;
|
|
11
12
|
target?: string;
|
|
13
|
+
color?: ButtonTypes;
|
|
12
14
|
onClick?: () => void;
|
|
13
15
|
};
|
|
14
16
|
declare const _default: React.NamedExoticComponent<CompactButtonProps>;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import React, { memo } from 'react';
|
|
2
2
|
import Button from './button';
|
|
3
|
+
// import { useTheme } from '@helpdice/theme';
|
|
4
|
+
// import { getButtonColors } from './styles';
|
|
5
|
+
|
|
6
|
+
// import useScale from 'components/use-scale';
|
|
7
|
+
|
|
3
8
|
var CompactButton = function CompactButton(_ref) {
|
|
4
|
-
var _ref$
|
|
9
|
+
var _ref$color = _ref.color,
|
|
10
|
+
_color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
11
|
+
_ref$to = _ref.to,
|
|
5
12
|
to = _ref$to === void 0 ? '/' : _ref$to,
|
|
6
13
|
children = _ref.children,
|
|
7
14
|
iconRight = _ref.iconRight,
|
|
@@ -13,57 +20,94 @@ var CompactButton = function CompactButton(_ref) {
|
|
|
13
20
|
a = _ref.a,
|
|
14
21
|
target = _ref.target,
|
|
15
22
|
onClick = _ref.onClick;
|
|
23
|
+
// const theme = useTheme();
|
|
24
|
+
// const { SCALES } = useScale();
|
|
25
|
+
// const [paddingLeft, paddingRight] = [
|
|
26
|
+
// auto ? SCALES.pl(1.15) : SCALES.pl(1.375),
|
|
27
|
+
// auto ? SCALES.pr(1.15) : SCALES.pr(1.375),
|
|
28
|
+
// ]
|
|
29
|
+
// const { bg, border, color } = useMemo(
|
|
30
|
+
// () => getButtonColors(theme.palette, {
|
|
31
|
+
// color: _color
|
|
32
|
+
// }),
|
|
33
|
+
// [theme.palette],
|
|
34
|
+
// )
|
|
16
35
|
if (a) {
|
|
17
|
-
return /*#__PURE__*/React.createElement(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
fontWeight: '400',
|
|
24
|
-
fontSize: 'calc(0.875* 16px)',
|
|
25
|
-
textAlign: 'center',
|
|
26
|
-
whiteSpace: 'nowrap',
|
|
27
|
-
position: 'relative',
|
|
28
|
-
overflow: 'hidden',
|
|
29
|
-
color: '#666',
|
|
30
|
-
backgroundColor: '#fff',
|
|
31
|
-
cursor: 'pointer',
|
|
32
|
-
minWidth: 'min-content',
|
|
33
|
-
width: 'auto',
|
|
34
|
-
height: 'calc(2.5* 16px)',
|
|
35
|
-
padding: '0 calc(0.69* 16px) 0 calc(0.69* 16px)',
|
|
36
|
-
margin: 0,
|
|
37
|
-
'--helpdice-ui-button-height': 'calc(2.5* 16px)',
|
|
38
|
-
'--helpdice-ui-button-icon-padding': 'calc(0.4362* 16px)'
|
|
36
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
37
|
+
icon: icon,
|
|
38
|
+
style: style,
|
|
39
|
+
type: type,
|
|
40
|
+
onClick: function onClick() {
|
|
41
|
+
return window.open(to, target);
|
|
39
42
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
43
|
+
auto: true,
|
|
44
|
+
scale: scale,
|
|
45
|
+
px: 0.6,
|
|
46
|
+
iconRight: iconRight
|
|
47
|
+
}, children)
|
|
48
|
+
// <a
|
|
49
|
+
// style={
|
|
50
|
+
// {
|
|
51
|
+
// all: 'unset',
|
|
52
|
+
// boxSizing: 'border-box',
|
|
53
|
+
// display: 'inline-block',
|
|
54
|
+
// lineHeight: 'calc(2.5* 16px)',
|
|
55
|
+
// fontWeight: '400',
|
|
56
|
+
// fontSize: 'calc(0.875* 16px)',
|
|
57
|
+
// textAlign: 'center',
|
|
58
|
+
// whiteSpace: 'nowrap',
|
|
59
|
+
// position: 'relative',
|
|
60
|
+
// overflow: 'hidden',
|
|
61
|
+
// color: color,
|
|
62
|
+
// backgroundColor: bg,
|
|
63
|
+
// border: `1px solid ${border}`,
|
|
64
|
+
// cursor: 'pointer',
|
|
65
|
+
// '--helpdice-ui-button-icon-padding': `${SCALES.pl(0.727)}`,
|
|
66
|
+
// '--helpdice-ui-button-height': `${SCALES.height(2.5)}`,
|
|
67
|
+
// '--helpdice-ui-button-color':`${color}`,
|
|
68
|
+
// '--helpdice-ui-button-bg': `${bg}`,
|
|
69
|
+
// minWidth: `${auto ? 'min-content' : SCALES.width(10.5)}`,
|
|
70
|
+
// width: `${auto ? 'auto' : 'initial'}`,
|
|
71
|
+
// height: `${SCALES.height(2.5)}`,
|
|
72
|
+
// padding:` ${SCALES.pt(0)} ${paddingRight} ${SCALES.pb(0)} ${paddingLeft}`,
|
|
73
|
+
// margin: `${SCALES.mt(0)} ${SCALES.mr(0)} ${SCALES.mb(0)} ${SCALES.ml(0)}`
|
|
74
|
+
// } as React.CSSProperties
|
|
75
|
+
// }
|
|
76
|
+
// href={to}
|
|
77
|
+
// target={target}
|
|
78
|
+
// >
|
|
79
|
+
// <span
|
|
80
|
+
// style={{
|
|
81
|
+
// position: 'absolute',
|
|
82
|
+
// right: 'auto',
|
|
83
|
+
// left: 'var(--helpdice-ui-button-icon-padding)',
|
|
84
|
+
// top: '50%',
|
|
85
|
+
// transform: 'translateY(-50%)',
|
|
86
|
+
// display: 'flex',
|
|
87
|
+
// justifyContent: 'center',
|
|
88
|
+
// alignItems: 'center',
|
|
89
|
+
// color: 'var(--helpdice-ui-button-color)',
|
|
90
|
+
// zIndex: 1
|
|
91
|
+
// }}
|
|
92
|
+
// >
|
|
93
|
+
// {icon}
|
|
94
|
+
// </span>
|
|
95
|
+
// <div
|
|
96
|
+
// style={{
|
|
97
|
+
// display: 'inline-flex',
|
|
98
|
+
// position: 'relative',
|
|
99
|
+
// zIndex: 1,
|
|
100
|
+
// justifyContent: 'center',
|
|
101
|
+
// alignItems: 'center',
|
|
102
|
+
// textAlign: 'center',
|
|
103
|
+
// lineHeight: 'inherit',
|
|
104
|
+
// paddingLeft: icon ? 'calc(var(--helpdice-ui-button-height) / 2 + var(--helpdice-ui-button-icon-padding)* .5)' : 0
|
|
105
|
+
// }}
|
|
106
|
+
// >
|
|
107
|
+
// {children}
|
|
108
|
+
// </div>
|
|
109
|
+
// </a>
|
|
110
|
+
;
|
|
67
111
|
}
|
|
68
112
|
return /*#__PURE__*/React.createElement(Button, {
|
|
69
113
|
icon: icon,
|