@geneui/components 3.0.0-next-06dadf3-29102024 → 3.0.0-next-48d0ef7-31102024
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/Avatar.js +63 -0
- package/Divider.js +23 -0
- package/{GeneUIProvider/index.js → GeneUIProvider.js} +51 -64
- package/HelperText.js +69 -0
- package/Info.js +64 -0
- package/Label.js +38 -0
- package/Loader.js +21 -0
- package/Pill.js +64 -0
- package/TextLink.js +20 -0
- package/{index-c7646e48.js → Tooltip.js} +101 -79
- package/{lib → components}/atoms/Avatar/Avatar.d.ts +7 -6
- package/components/atoms/Avatar/index.d.ts +1 -0
- package/{lib → components}/atoms/Divider/Divider.d.ts +5 -5
- package/components/atoms/Divider/index.d.ts +1 -0
- package/{lib → components}/atoms/HelperText/HelperText.d.ts +6 -5
- package/components/atoms/HelperText/index.d.ts +1 -0
- package/{lib → components}/atoms/Info/Info.d.ts +5 -5
- package/components/atoms/Info/index.d.ts +1 -0
- package/{lib → components}/atoms/Label/Label.d.ts +3 -3
- package/components/atoms/Label/index.d.ts +1 -0
- package/{lib → components}/atoms/Loader/Loader.d.ts +5 -5
- package/components/atoms/Loader/index.d.ts +1 -0
- package/{lib → components}/atoms/Pill/Pill.d.ts +7 -6
- package/components/atoms/Pill/index.d.ts +1 -0
- package/{lib → components}/atoms/TextLink/TextLink.d.ts +5 -5
- package/components/atoms/TextLink/index.d.ts +1 -0
- package/{lib → components}/molecules/Tooltip/Tooltip.d.ts +26 -21
- package/components/molecules/Tooltip/index.d.ts +1 -0
- package/components/providers/GeneUIProvider/GeneUIProvider.d.ts +30 -0
- package/components/providers/GeneUIProvider/index.d.ts +1 -0
- package/hooks/index.d.ts +2 -20
- package/hooks/useDebounceCallback/index.d.ts +1 -0
- package/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
- package/hooks/useEllipsisDetection/index.d.ts +1 -1
- package/hooks/useEllipsisDetection/useEllipsisDetection.d.ts +2 -2
- package/{index-031ff73c.js → index-ce02421b.js} +4 -4
- package/index.d.ts +11 -121
- package/index.js +12 -159
- package/package.json +24 -43
- package/tokens-0abb4e1b.js +6 -0
- package/types/index.d.ts +0 -3
- package/useEllipsisDetection-46d712b6.js +34 -0
- package/ActionableList/index.js +0 -1694
- package/AdvancedSearch/index.js +0 -892
- package/Alert/index.js +0 -98
- package/Avatar/index.js +0 -58
- package/Badge/index.js +0 -29
- package/Breadcrumb/index.js +0 -130
- package/BusyLoader/index.js +0 -31
- package/Button/index.js +0 -30
- package/Card/index.js +0 -502
- package/CardList/index.js +0 -662
- package/CellMeasurerCache-26f3693c.js +0 -229
- package/Charts/index.js +0 -17662
- package/Checkbox/index.js +0 -229
- package/CheckboxGroup/index.js +0 -203
- package/CheckboxGroupWithSearch/index.js +0 -280
- package/Collapse/index.js +0 -195
- package/ColorPicker/index.js +0 -210
- package/ComboBox/index.js +0 -524
- package/Copy/index.js +0 -56
- package/Counter/index.js +0 -312
- package/DateFilter/index.js +0 -183
- package/DatePicker/index.js +0 -1229
- package/DatePickerInput/index.js +0 -883
- package/Divider/index.js +0 -23
- package/Drawer/index.js +0 -261
- package/Dropdown/index.js +0 -43
- package/Editor/index.js +0 -22975
- package/Empty/index.js +0 -76
- package/ExtendedInput/index.js +0 -590
- package/Form/index.js +0 -85
- package/FormContainer/index.js +0 -189
- package/FormableCheckbox/index.js +0 -24
- package/FormableDatePicker/index.js +0 -43
- package/FormableDropdown/index.js +0 -50
- package/FormableEditor/index.js +0 -26
- package/FormableHOC-85f89a81.js +0 -83
- package/FormableMultiSelectDropdown/index.js +0 -50
- package/FormableNumberInput/index.js +0 -34
- package/FormableRadio/index.js +0 -22
- package/FormableSwitcher/index.js +0 -22
- package/FormableTextInput/index.js +0 -34
- package/FormableUploader/index.js +0 -44
- package/Grid/index.js +0 -167
- package/HelperText/index.js +0 -86
- package/Holder/index.js +0 -261
- package/Icon/index.js +0 -62
- package/Image/index.js +0 -45
- package/ImagePreview/index.js +0 -217
- package/Info/index.js +0 -41
- package/InfoOutline-dd2e89d9.js +0 -29
- package/InteractiveWidget/index.js +0 -78
- package/KeyValue/index.js +0 -22
- package/Label/index.js +0 -48
- package/LinkButton/index.js +0 -34
- package/Loader/index.js +0 -23
- package/Menu/index.js +0 -281
- package/MobileNavigation/index.js +0 -94
- package/MobilePopup/index.js +0 -182
- package/Modal/index.js +0 -251
- package/ModuleTitle/index.js +0 -141
- package/NavigationMenu/index.js +0 -222
- package/Notification/index.js +0 -120
- package/Option/index.js +0 -184
- package/Overlay/index.js +0 -187
- package/Overspread/index.js +0 -291
- package/Pagination/index.js +0 -261
- package/Paper/index.js +0 -96
- package/Pill/index.js +0 -67
- package/Popover/index.js +0 -725
- package/PopoverV2/index.js +0 -19
- package/Portal/index.js +0 -58
- package/Products/index.js +0 -115
- package/Profile/index.js +0 -589
- package/Progress/index.js +0 -200
- package/QRCode/index.js +0 -814
- package/Radio/index.js +0 -151
- package/RadioGroup/index.js +0 -104
- package/Range/index.js +0 -191
- package/Rating/index.js +0 -174
- package/RichEditor/index.js +0 -13
- package/RichEditor-6ca8346f.js +0 -228
- package/Scrollbar/index.js +0 -1585
- package/Search/index.js +0 -75
- package/SearchWithDropdown/index.js +0 -140
- package/Section/index.js +0 -61
- package/SkeletonLoader/index.js +0 -81
- package/Slider/index.js +0 -261
- package/Status/index.js +0 -97
- package/Steps/index.js +0 -314
- package/SuggestionList/index.js +0 -385
- package/Switcher/index.js +0 -193
- package/Table/index.js +0 -57
- package/TableCompositions/index.js +0 -16995
- package/Tabs/index.js +0 -235
- package/Tag/index.js +0 -102
- package/TextLink/index.js +0 -20
- package/Textarea/index.js +0 -242
- package/Time/index.js +0 -62
- package/TimePicker/index.js +0 -575
- package/Timeline/index.js +0 -113
- package/Title/index.js +0 -65
- package/Toaster/index.js +0 -116
- package/Tooltip/index.js +0 -6
- package/TransferList/index.js +0 -493
- package/Uploader/index.js +0 -992
- package/ValidatableCheckbox/index.js +0 -123
- package/ValidatableDatePicker/index.js +0 -316
- package/ValidatableDropdown/index.js +0 -141
- package/ValidatableElements/index.js +0 -67
- package/ValidatableMultiSelectDropdown/index.js +0 -152
- package/ValidatableNumberInput/index.js +0 -204
- package/ValidatableRadio/index.js +0 -116
- package/ValidatableSwitcher/index.js +0 -93
- package/ValidatableTextInput/index.js +0 -167
- package/ValidatableTimeInput/index.js +0 -174
- package/ValidatableUploader/index.js +0 -98
- package/Widget/index.js +0 -225
- package/_commonjsHelpers-24198af3.js +0 -35
- package/_rollupPluginBabelHelpers-a83240e1.js +0 -11
- package/callAfterDelay-7272faca.js +0 -12
- package/checkTimeValidation-e56771be.js +0 -16
- package/checkboxRadioSwitcher-5b69d7bd.js +0 -4
- package/clsx.m-2bb6df4b.js +0 -3
- package/config-1053d64d.js +0 -20
- package/configs-00612ce0.js +0 -103
- package/configs.js +0 -111
- package/dateValidation-67caec66.js +0 -225
- package/debounce-4419bc2f.js +0 -17
- package/guid-8ddf77b3.js +0 -16
- package/hooks/useBodyScroll.js +0 -16
- package/hooks/useClick.js +0 -18
- package/hooks/useClickOutside.js +0 -25
- package/hooks/useDebounce.js +0 -28
- package/hooks/useDeviceType.js +0 -17
- package/hooks/useDidMount.js +0 -15
- package/hooks/useForceUpdate.js +0 -8
- package/hooks/useHover.js +0 -20
- package/hooks/useImgDownload.js +0 -18
- package/hooks/useKeyDown.js +0 -21
- package/hooks/useMount.js +0 -13
- package/hooks/useMutationObserver.js +0 -21
- package/hooks/usePrevious.js +0 -10
- package/hooks/useThrottle.js +0 -16
- package/hooks/useToggle.js +0 -11
- package/hooks/useUpdatableRef.js +0 -14
- package/hooks/useUpdate.js +0 -10
- package/hooks/useWidth.js +0 -16
- package/hooks/useWindowSize.js +0 -40
- package/index-122432cd.js +0 -270
- package/index-262edd7a.js +0 -77
- package/index-3188e46e.js +0 -1940
- package/index-45eafea6.js +0 -90
- package/index-5f37f281.js +0 -168
- package/index-ce12e4a9.js +0 -10032
- package/index-d0ecb950.js +0 -6483
- package/index-fcbae78d.js +0 -4
- package/index.mobile.d.ts +0 -14
- package/lib/atoms/Avatar/index.d.ts +0 -1
- package/lib/atoms/Badge/Badge.d.ts +0 -36
- package/lib/atoms/Badge/index.d.ts +0 -1
- package/lib/atoms/BusyLoader/BusyLoader.d.ts +0 -32
- package/lib/atoms/BusyLoader/BusyLoaderHolderHOC.d.ts +0 -8
- package/lib/atoms/BusyLoader/index.d.ts +0 -1
- package/lib/atoms/Button/Button.d.ts +0 -70
- package/lib/atoms/Button/index.d.ts +0 -1
- package/lib/atoms/Divider/index.d.ts +0 -1
- package/lib/atoms/Empty/Empty.d.ts +0 -39
- package/lib/atoms/Empty/index.d.ts +0 -1
- package/lib/atoms/Empty/utils.d.ts +0 -9
- package/lib/atoms/HelperText/index.d.ts +0 -1
- package/lib/atoms/Image/Image.d.ts +0 -51
- package/lib/atoms/Image/index.d.ts +0 -1
- package/lib/atoms/ImagePreview/ImagePreview.d.ts +0 -56
- package/lib/atoms/ImagePreview/ImagePreviewHOC.d.ts +0 -4
- package/lib/atoms/ImagePreview/Magnifier.d.ts +0 -40
- package/lib/atoms/ImagePreview/index.d.ts +0 -1
- package/lib/atoms/Info/index.d.ts +0 -1
- package/lib/atoms/KeyValue/KeyValue.d.ts +0 -29
- package/lib/atoms/KeyValue/index.d.ts +0 -1
- package/lib/atoms/Label/index.d.ts +0 -1
- package/lib/atoms/LinkButton/LinkButton.d.ts +0 -46
- package/lib/atoms/LinkButton/index.d.ts +0 -1
- package/lib/atoms/Loader/index.d.ts +0 -1
- package/lib/atoms/Pill/index.d.ts +0 -1
- package/lib/atoms/Rating/DefaultSvg.d.ts +0 -3
- package/lib/atoms/Rating/Rating.d.ts +0 -49
- package/lib/atoms/Rating/index.d.ts +0 -1
- package/lib/atoms/TextLink/index.d.ts +0 -1
- package/lib/molecules/Copy/Copy.d.ts +0 -38
- package/lib/molecules/Copy/index.d.ts +0 -1
- package/lib/molecules/InteractiveWidget/InteractiveWidget.d.ts +0 -70
- package/lib/molecules/InteractiveWidget/InteractiveWidgetIcon.d.ts +0 -8
- package/lib/molecules/InteractiveWidget/index.d.ts +0 -1
- package/lib/molecules/Tooltip/index.d.ts +0 -1
- package/lib/providers/GeneUIProvider/GeneUIProvider.d.ts +0 -30
- package/lib/providers/GeneUIProvider/index.d.ts +0 -1
- package/localization-4ba17032.js +0 -46
- package/objectWithoutPropertiesLoose-e1596bdb.js +0 -62
- package/rangeAndSlider-740a236c.js +0 -8676
- package/react-beautiful-dnd.esm-8c7b5a83.js +0 -10116
- package/react-lifecycles-compat.es-6e1f3768.js +0 -158
- package/redux-e591c1b8.js +0 -536
- package/tokens-8ab1179c.js +0 -6
- package/tslib.es6-f211516f.js +0 -35
- package/useEllipsisDetection-c1c9ad94.js +0 -38
package/Avatar.js
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import React__default, { useState, useEffect } from 'react';
|
|
2
|
+
import { c as classNames } from './index-ce02421b.js';
|
|
3
|
+
import { _ as _objectWithoutProperties, a as _extends } from './ArrowLeft-b88e2ba8.js';
|
|
4
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
5
|
+
|
|
6
|
+
var _excluded = ["size", "color"];
|
|
7
|
+
var SvgSquare = function SvgSquare(_ref) {
|
|
8
|
+
var _ref$size = _ref.size,
|
|
9
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
10
|
+
_ref$color = _ref.color,
|
|
11
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
+
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
14
|
+
width: size,
|
|
15
|
+
height: size,
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: color,
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
19
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
20
|
+
d: "M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-14a2 2 0 0 1-2-2v-14Z",
|
|
21
|
+
fill: color
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var css_248z = ".avatar{align-items:center;border-radius:var(--guit-ref-radius-full);display:flex;justify-content:center;overflow:hidden;position:relative;-webkit-user-select:none;user-select:none}.avatar_size_6Xlarge{font-family:var(--guit-sem-font-heading-medium-semibold-font-family);font-size:var(--guit-sem-font-heading-medium-semibold-font-size);font-weight:var(--guit-sem-font-heading-medium-semibold-font-weight);height:var(--guit-sem-dimension-height-6xlarge);line-height:var(--guit-sem-font-heading-medium-semibold-line-height);width:var(--guit-sem-dimension-width-6xlarge)}.avatar_size_large{height:var(--guit-sem-dimension-height-large);width:var(--guit-sem-dimension-width-large)}.avatar_size_large,.avatar_size_medium{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family);font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.avatar_size_medium{height:var(--guit-sem-dimension-height-medium);width:var(--guit-sem-dimension-width-medium)}.avatar_size_small{font-family:var(--guit-sem-font-label-small-default-medium-font-family);font-size:var(--guit-sem-font-label-small-default-medium-font-size);font-weight:var(--guit-sem-font-label-small-default-medium-font-weight);height:var(--guit-sem-dimension-height-small);line-height:var(--guit-sem-font-label-small-default-medium-line-height);width:var(--guit-sem-dimension-width-small)}.avatar_color_neutral{background-color:var(--guit-sem-color-background-neutral-2);color:var(--guit-sem-color-foreground-neutral-2)}.avatar_color_blue{background-color:var(--guit-sem-color-background-accent-blue-1);color:var(--guit-sem-color-foreground-accent-blue)}.avatar_color_red{background-color:var(--guit-sem-color-background-accent-red-1);color:var(--guit-sem-color-foreground-accent-red)}.avatar_color_green{background-color:var(--guit-sem-color-background-accent-green-1);color:var(--guit-sem-color-foreground-accent-green)}.avatar_color_orange{background-color:var(--guit-sem-color-background-accent-orange-1);color:var(--guit-sem-color-foreground-accent-orange)}.avatar_color_purple{background-color:var(--guit-sem-color-background-accent-purple-1);color:var(--guit-sem-color-foreground-accent-purple)}.avatar_color_lagoon{background-color:var(--guit-sem-color-background-accent-lagoon-1);color:var(--guit-sem-color-foreground-accent-lagoon)}.avatar_color_magenta{background-color:var(--guit-sem-color-background-accent-magenta-1);color:var(--guit-sem-color-foreground-accent-magenta)}.avatar_color_slate{background-color:var(--guit-sem-color-background-accent-slate-1);color:var(--guit-sem-color-foreground-accent-slate)}.avatar:active:before,.avatar:hover:before,.avatar_disabled:before{content:\"\";display:block;height:100%;left:0;position:absolute;top:0;width:100%;z-index:1}.avatar_disabled{pointer-events:none}.avatar_disabled:before{background-color:var(--guit-sem-color-background-transparent-inverse-disabled)}.avatar_button{cursor:pointer}.avatar_button:hover:before{background-color:var(--guit-sem-color-background-transparent-1-hover)}.avatar_button:active:before{background-color:var(--guit-sem-color-background-transparent-1-pressed)}.avatar__image{display:block;height:100%;object-fit:cover;object-position:center;width:100%}.avatar__text{color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;line-height:inherit;text-transform:uppercase}";
|
|
26
|
+
styleInject(css_248z);
|
|
27
|
+
|
|
28
|
+
const iconSizes = {
|
|
29
|
+
small: 16,
|
|
30
|
+
large: 20,
|
|
31
|
+
medium: 20,
|
|
32
|
+
"6Xlarge": 48
|
|
33
|
+
};
|
|
34
|
+
const AvatarWrapper = ({ onClick, children, parentClass, isDisabled }) => {
|
|
35
|
+
return onClick ? (React__default.createElement("button", { type: "button", onClick: onClick, className: `${parentClass} avatar_button`, disabled: isDisabled }, children)) : (React__default.createElement("div", { className: parentClass }, children));
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* An avatar is a graphical representation of a user, typically displayed as a small image or icon. It can be a photo, illustration, or initials, and is used to personalize the user experience by visually identifying the user in interfaces such as profiles, comment sections, and messaging apps.
|
|
39
|
+
*/
|
|
40
|
+
const Avatar = ({ size = "medium", color = "magenta", fullName = "", src, onClick, isDisabled, isLoading, Icon = SvgSquare, // todo need to change to User icon after releasing icons
|
|
41
|
+
className }) => {
|
|
42
|
+
const [proceedFullName, setProceedFullName] = useState(fullName);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const [firstName = "", lastName = ""] = fullName.split(" ");
|
|
45
|
+
const [firstNameFirstLetter] = firstName;
|
|
46
|
+
const [lastNameFirstLetter] = lastName || "";
|
|
47
|
+
setProceedFullName(firstNameFirstLetter
|
|
48
|
+
? `${firstNameFirstLetter}${!!lastNameFirstLetter && (size === "6Xlarge" || size === "large") ? ` ${lastNameFirstLetter}` : ""}`
|
|
49
|
+
: ``);
|
|
50
|
+
}, [fullName, size]);
|
|
51
|
+
let content = React__default.createElement(Icon, { className: "avatar__icon", size: iconSizes[size] });
|
|
52
|
+
if (src) {
|
|
53
|
+
content = React__default.createElement("img", { className: "avatar__image", alt: "avatar", src: src });
|
|
54
|
+
}
|
|
55
|
+
else if (proceedFullName) {
|
|
56
|
+
content = React__default.createElement("span", { className: "avatar__text" }, proceedFullName);
|
|
57
|
+
}
|
|
58
|
+
return isLoading ? (React__default.createElement("span", null, "skeleton")) : (React__default.createElement(AvatarWrapper, { parentClass: classNames(`avatar avatar_size_${size} avatar_color_${color}`, className, {
|
|
59
|
+
avatar_disabled: isDisabled
|
|
60
|
+
}), onClick: onClick, isDisabled: isDisabled }, content));
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export { Avatar as default };
|
package/Divider.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { c as classNames } from './index-ce02421b.js';
|
|
3
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
4
|
+
|
|
5
|
+
var css_248z = ".divider{display:inline-flex;gap:var(--guit-ref-spacing-xsmall);overflow:hidden}.divider:before{content:\"\";display:block;flex:1;pointer-events:none}.divider_horizontal{align-items:center;width:100%}.divider_horizontal.divider:after,.divider_horizontal.divider:before{border-block-start:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid);min-width:var(--guit-sem-dimension-width-medium)}.divider_horizontal.divider_inset{padding-inline:var(--guit-ref-spacing-large)}.divider_horizontal.divider:empty:after{display:none}.divider_vertical{align-items:center;flex-direction:column;height:100%}.divider_vertical.divider:before{border-inline-start:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid)}.divider_vertical.divider:after{display:none}.divider_vertical.divider_inset{padding-block:var(--guit-ref-spacing-large)}.divider_color_default .divider__icon,.divider_color_default .divider__text,.divider_color_strong .divider__icon,.divider_color_strong .divider__text{color:var(--guit-sem-color-foreground-neutral-1)}.divider_color_default.divider:after,.divider_color_default.divider:before{border-block-color:var(--guit-sem-color-border-neutral-2);border-inline-color:var(--guit-sem-color-border-neutral-2)}.divider_color_strong.divider:after,.divider_color_strong.divider:before{border-block-color:var(--guit-sem-color-border-neutral-3);border-inline-color:var(--guit-sem-color-border-neutral-3)}.divider_color_brand.divider:after,.divider_color_brand.divider:before{border-block-color:var(--guit-sem-color-border-brand);border-inline-color:var(--guit-sem-color-border-brand)}.divider_color_brand .divider__icon,.divider_color_brand .divider__text{color:var(--guit-sem-color-foreground-brand)}.divider_color_inverse.divider:after,.divider_color_inverse.divider:before{border-block-color:var(--guit-sem-color-border-inverse);border-inline-color:var(--guit-sem-color-border-inverse)}.divider_color_inverse .divider__icon,.divider_color_inverse .divider__text{color:var(--guit-sem-color-foreground-inverse)}.divider_withLabel_before.divider:before{display:none}.divider_withLabel_before.divider:after,.divider_withLabel_center.divider:after{content:\"\";flex:1}.divider_withLabel_center .divider__element{max-width:calc(100% - var(--guit-sem-dimension-width-medium)*4)}.divider_withLabel_after.divider:before{flex:1}.divider_withLabel_after .divider__element,.divider_withLabel_before .divider__element{max-width:calc(100% - var(--guit-sem-dimension-width-medium)*2.8)}.divider__label{align-items:center;display:flex;gap:var(--guit-ref-spacing-3xsmall);overflow:hidden}.divider__text{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family);font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.divider__icon{flex:0 0 auto}.divider__element{display:flex;flex:0 0 auto;min-width:0;order:1}";
|
|
6
|
+
styleInject(css_248z);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* A divider separates sections of content to establish visual rhythm and hierarchy. Combine dividers with appropriate spacing and text hierarchy to effectively organize content within your layout.
|
|
10
|
+
*/
|
|
11
|
+
const Divider = ({ appearance = "default", Icon, vertical, label, labelPosition = "before", content, inset = false, className }) => {
|
|
12
|
+
return (React__default.createElement("div", { className: classNames(`divider divider_${inset ? "inset" : "block"} divider_color_${appearance} `, className, {
|
|
13
|
+
divider_horizontal: !vertical,
|
|
14
|
+
divider_vertical: vertical,
|
|
15
|
+
[` divider_withLabel_${labelPosition}`]: (label || Icon) && !vertical
|
|
16
|
+
}) }, !vertical && (React__default.createElement(React__default.Fragment, null,
|
|
17
|
+
content && React__default.createElement("div", { className: "divider__element" }, content),
|
|
18
|
+
(label || Icon) && (React__default.createElement("div", { className: "divider__label" },
|
|
19
|
+
label && React__default.createElement("span", { className: "divider__text ellipsis-text" }, label),
|
|
20
|
+
Icon && React__default.createElement(Icon, { className: "divider__icon", size: 20 })))))));
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export { Divider as default };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import React__default, { createContext, useRef, useState, useEffect } from 'react';
|
|
2
|
-
import { s as styleInject } from '
|
|
1
|
+
import React__default, { createContext, useRef, useState, useMemo, useEffect } from 'react';
|
|
2
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Do not edit directly
|
|
6
|
-
* Generated on Thu,
|
|
6
|
+
* Generated on Thu, 24 Oct 2024 17:13:23 GMT
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
const GuitRefColorNeutral800base = "#141414";
|
|
@@ -193,6 +193,7 @@ const GuitRefShadowBlur2xsmall = "0.2rem";
|
|
|
193
193
|
const GuitRefShadowBlurXsmall = "0.4rem";
|
|
194
194
|
const GuitRefShadowBlurSmall = "0.6rem";
|
|
195
195
|
const GuitRefShadowBlurMedium = "0.8rem";
|
|
196
|
+
const GuitRefShadowSpreadNegativeXsmall = "-0.4rem";
|
|
196
197
|
const GuitRefShadowSpreadNone = "0rem";
|
|
197
198
|
const GuitRefShadowSpread2xsmall = "0.2rem";
|
|
198
199
|
const GuitRefShadowSpreadXsmall = "0.4rem";
|
|
@@ -442,7 +443,7 @@ const GuitSemShadowFloating2PositionY1 = "0.4rem";
|
|
|
442
443
|
const GuitSemShadowFloating1PositionX2 = "0rem";
|
|
443
444
|
const GuitSemShadowFloating1PositionY2 = "0rem";
|
|
444
445
|
const GuitSemShadowFloating1Blur2 = "0.2rem";
|
|
445
|
-
const GuitSemShadowFloating1Spread2 = "
|
|
446
|
+
const GuitSemShadowFloating1Spread2 = "-0.4rem";
|
|
446
447
|
const GuitSemShadowFloating2Blur1 = "0.6rem";
|
|
447
448
|
const GuitSemShadowFloating2Spread1 = "0.4rem";
|
|
448
449
|
const GuitSemShadowFloating3PositionX1 = "0rem";
|
|
@@ -450,13 +451,13 @@ const GuitSemShadowFloating3PositionY1 = "0.6rem";
|
|
|
450
451
|
const GuitSemShadowFloating2PositionX2 = "0rem";
|
|
451
452
|
const GuitSemShadowFloating2PositionY2 = "-0.2rem";
|
|
452
453
|
const GuitSemShadowFloating2Blur2 = "0.4rem";
|
|
453
|
-
const GuitSemShadowFloating2Spread2 = "0.
|
|
454
|
+
const GuitSemShadowFloating2Spread2 = "-0.4rem";
|
|
454
455
|
const GuitSemShadowFloating3Blur1 = "0.8rem";
|
|
455
456
|
const GuitSemShadowFloating3Spread1 = "0.4rem";
|
|
456
457
|
const GuitSemShadowFloating3PositionX2 = "0rem";
|
|
457
458
|
const GuitSemShadowFloating3PositionY2 = "-0.2rem";
|
|
458
459
|
const GuitSemShadowFloating3Blur2 = "0.6rem";
|
|
459
|
-
const GuitSemShadowFloating3Spread2 = "0.
|
|
460
|
+
const GuitSemShadowFloating3Spread2 = "-0.4rem";
|
|
460
461
|
const GuitSemShadowRaisedTopPositionX = "0rem";
|
|
461
462
|
const GuitSemShadowRaisedTopPositionY = "-0.2rem";
|
|
462
463
|
const GuitSemShadowRaisedTopBlur = "0.6rem";
|
|
@@ -491,10 +492,10 @@ const GuitSemColorForegroundBrand = "light-dark(#1473E6, #95C0F4)";
|
|
|
491
492
|
const GuitSemColorForegroundBrandHover = "light-dark(#105EBC, #C3DBF9)";
|
|
492
493
|
const GuitSemColorForegroundBrandPressed = "light-dark(#0A3B75, #E8F1FD)";
|
|
493
494
|
const GuitSemColorBackgroundNeutral2 = "light-dark(#F5F5F5, #262627)";
|
|
494
|
-
const GuitSemColorBackgroundNeutral2Hover = "light-dark(#E8E8E8, #323234)";
|
|
495
495
|
const GuitSemColorForegroundError = "light-dark(#98332F, #F8CBC9)";
|
|
496
|
-
const
|
|
496
|
+
const GuitSemColorBackgroundNeutral2Hover = "light-dark(#E8E8E8, #323234)";
|
|
497
497
|
const GuitSemColorForegroundSuccess = "light-dark(#18714C, #B6ECD5)";
|
|
498
|
+
const GuitSemColorBackgroundNeutral2Pressed = "light-dark(#D3D3D4, #1c1c1c)";
|
|
498
499
|
const GuitSemColorBackgroundNeutral3 = "light-dark(#E8E8E8, #323234)";
|
|
499
500
|
const GuitSemColorForegroundWarning = "light-dark(#7E6030, #F0D09D)";
|
|
500
501
|
const GuitSemColorForegroundRecommendation = "light-dark(#553EB7, #D7CFF7)";
|
|
@@ -514,12 +515,13 @@ const GuitSemColorForegroundInverse = "light-dark(#FFFFFF, #262627)";
|
|
|
514
515
|
const GuitSemColorForegroundInverseHover = "light-dark(#F5F5F5, #323234)";
|
|
515
516
|
const GuitSemColorForegroundInversePressed = "light-dark(#E8E8E8, #1c1c1c)";
|
|
516
517
|
const GuitSemColorForegroundInverseDisabled = "light-dark(#B7B7B9, #646468)";
|
|
517
|
-
const GuitSemColorForegroundDisabled = "light-dark(#929295, #646468)";
|
|
518
518
|
const GuitSemColorBackgroundError1Pressed = "light-dark(#F2A09C, #61211E)";
|
|
519
|
+
const GuitSemColorForegroundDisabled = "light-dark(#929295, #646468)";
|
|
519
520
|
const GuitSemColorForegroundAccentBlue = "light-dark(#105EBC, #C3DBF9)";
|
|
520
521
|
const GuitSemColorForegroundAccentRed = "light-dark(#98332F, #F8CBC9)";
|
|
521
522
|
const GuitSemColorForegroundAccentGreen = "light-dark(#18714C, #B6ECD5)";
|
|
522
|
-
const
|
|
523
|
+
const GuitSemColorForegroundAccentOrange1 = "light-dark(#E6AF57, #BA8B40)";
|
|
524
|
+
const GuitSemColorForegroundAccentOrange2 = "light-dark(#684F27, #F7E4C7)";
|
|
523
525
|
const GuitSemColorForegroundAccentPurple = "light-dark(#553EB7, #D7CFF7)";
|
|
524
526
|
const GuitSemColorForegroundAccentLagoon = "light-dark(#23636C, #C8DCDF)";
|
|
525
527
|
const GuitSemColorForegroundAccentMagenta = "light-dark(#A60063, #EDCADF)";
|
|
@@ -779,6 +781,7 @@ var jsTokens = /*#__PURE__*/Object.freeze({
|
|
|
779
781
|
GuitRefShadowPositioningSmall: GuitRefShadowPositioningSmall,
|
|
780
782
|
GuitRefShadowPositioningXsmall: GuitRefShadowPositioningXsmall,
|
|
781
783
|
GuitRefShadowSpread2xsmall: GuitRefShadowSpread2xsmall,
|
|
784
|
+
GuitRefShadowSpreadNegativeXsmall: GuitRefShadowSpreadNegativeXsmall,
|
|
782
785
|
GuitRefShadowSpreadNone: GuitRefShadowSpreadNone,
|
|
783
786
|
GuitRefShadowSpreadXsmall: GuitRefShadowSpreadXsmall,
|
|
784
787
|
GuitRefSizing2xlarge: GuitRefSizing2xlarge,
|
|
@@ -937,7 +940,8 @@ var jsTokens = /*#__PURE__*/Object.freeze({
|
|
|
937
940
|
GuitSemColorForegroundAccentGreen: GuitSemColorForegroundAccentGreen,
|
|
938
941
|
GuitSemColorForegroundAccentLagoon: GuitSemColorForegroundAccentLagoon,
|
|
939
942
|
GuitSemColorForegroundAccentMagenta: GuitSemColorForegroundAccentMagenta,
|
|
940
|
-
|
|
943
|
+
GuitSemColorForegroundAccentOrange1: GuitSemColorForegroundAccentOrange1,
|
|
944
|
+
GuitSemColorForegroundAccentOrange2: GuitSemColorForegroundAccentOrange2,
|
|
941
945
|
GuitSemColorForegroundAccentPurple: GuitSemColorForegroundAccentPurple,
|
|
942
946
|
GuitSemColorForegroundAccentRed: GuitSemColorForegroundAccentRed,
|
|
943
947
|
GuitSemColorForegroundAccentSlate: GuitSemColorForegroundAccentSlate,
|
|
@@ -1216,7 +1220,7 @@ var jsTokens = /*#__PURE__*/Object.freeze({
|
|
|
1216
1220
|
});
|
|
1217
1221
|
|
|
1218
1222
|
const bootstrap = () => {
|
|
1219
|
-
import('
|
|
1223
|
+
import('./tokens-0abb4e1b.js');
|
|
1220
1224
|
return jsTokens;
|
|
1221
1225
|
};
|
|
1222
1226
|
|
|
@@ -1243,7 +1247,7 @@ var typings = "index.d.ts";
|
|
|
1243
1247
|
var scripts = {
|
|
1244
1248
|
start: "npm run test && storybook dev -p 6006",
|
|
1245
1249
|
dev: "concurrently --kill-others -g \"npm:test:watch\" \"npm:start\"",
|
|
1246
|
-
test: "jest --
|
|
1250
|
+
test: "jest --config ./configs/jest.config.js --rootDir ./ --coverage --json --outputFile=./coverage/.jest-test-results.json",
|
|
1247
1251
|
"test:watch": "npm run test -- --watchAll --json",
|
|
1248
1252
|
"test-report": "babel-node --config-file ./configs/.babelrc ./scripts/testReport.js",
|
|
1249
1253
|
build: "babel-node --config-file ./configs/.babelrc ./scripts/build.js",
|
|
@@ -1283,8 +1287,6 @@ var devDependencies = {
|
|
|
1283
1287
|
"@commitlint/cli": "^17.1.2",
|
|
1284
1288
|
"@commitlint/config-conventional": "^17.1.0",
|
|
1285
1289
|
"@faker-js/faker": "^7.6.0",
|
|
1286
|
-
"@rollup/plugin-alias": "^4.0.2",
|
|
1287
|
-
"@rollup/plugin-babel": "^6.0.0",
|
|
1288
1290
|
"@rollup/plugin-commonjs": "^23.0.0",
|
|
1289
1291
|
"@rollup/plugin-image": "^3.0.1",
|
|
1290
1292
|
"@rollup/plugin-json": "^6.0.0",
|
|
@@ -1306,8 +1308,13 @@ var devDependencies = {
|
|
|
1306
1308
|
"@storybook/react-docgen-typescript-plugin": "^1.0.6--canary.9.0c3f3b7.0",
|
|
1307
1309
|
"@storybook/react-webpack5": "^7.6.15",
|
|
1308
1310
|
"@storybook/theming": "^7.6.15",
|
|
1311
|
+
"@types/enzyme": "^3.10.18",
|
|
1309
1312
|
"@types/enzyme-adapter-react-16": "^1.0.9",
|
|
1310
1313
|
"@types/jest": "^29.5.11",
|
|
1314
|
+
"@types/react-dom": "^18.3.1",
|
|
1315
|
+
"@types/react-is": "^18.3.0",
|
|
1316
|
+
"@typescript-eslint/eslint-plugin": "^8.11.0",
|
|
1317
|
+
"@typescript-eslint/parser": "^8.11.0",
|
|
1311
1318
|
autoprefixer: "^10.4.13",
|
|
1312
1319
|
"babel-jest": "^29.7.0",
|
|
1313
1320
|
"babel-loader": "^8.2.5",
|
|
@@ -1319,16 +1326,19 @@ var devDependencies = {
|
|
|
1319
1326
|
"cross-env": "^7.0.3",
|
|
1320
1327
|
"css-loader": "^6.7.3",
|
|
1321
1328
|
"cz-conventional-changelog": "^3.3.0",
|
|
1329
|
+
dayjs: "^1.11.13",
|
|
1322
1330
|
enzyme: "^3.11.0",
|
|
1323
1331
|
"enzyme-adapter-react-16": "^1.15.7",
|
|
1324
1332
|
"enzyme-to-json": "^3.6.2",
|
|
1325
|
-
eslint: "^8.
|
|
1333
|
+
eslint: "^8.57.1",
|
|
1326
1334
|
"eslint-config-airbnb": "^19.0.4",
|
|
1327
|
-
"eslint-config-prettier": "^
|
|
1328
|
-
"eslint-
|
|
1329
|
-
"eslint-plugin-
|
|
1330
|
-
"eslint-plugin-
|
|
1331
|
-
"eslint-plugin-
|
|
1335
|
+
"eslint-config-prettier": "^9.1.0",
|
|
1336
|
+
"eslint-import-resolver-typescript": "^3.6.3",
|
|
1337
|
+
"eslint-plugin-import": "^2.31.0",
|
|
1338
|
+
"eslint-plugin-jsx-a11y": "^6.10.1",
|
|
1339
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
1340
|
+
"eslint-plugin-react": "^7.37.1",
|
|
1341
|
+
"eslint-plugin-react-hooks": "^4.6.2",
|
|
1332
1342
|
figlet: "^1.5.2",
|
|
1333
1343
|
"file-loader": "^6.2.0",
|
|
1334
1344
|
"git-cz": "^4.9.0",
|
|
@@ -1347,12 +1357,11 @@ var devDependencies = {
|
|
|
1347
1357
|
postcss: "^8.4.31",
|
|
1348
1358
|
"postcss-prefix-selector": "^1.16.0",
|
|
1349
1359
|
"postcss-url": "^10.1.3",
|
|
1350
|
-
prettier: "^
|
|
1360
|
+
prettier: "^3.3.3",
|
|
1351
1361
|
react: "^16.8.1",
|
|
1352
1362
|
"react-dom": "^16.8.1",
|
|
1353
1363
|
"react-test-renderer": "^16.12.0",
|
|
1354
1364
|
rollup: "^3.1.0",
|
|
1355
|
-
"rollup-plugin-peer-deps-external": "^2.2.0",
|
|
1356
1365
|
"rollup-plugin-postcss": "^4.0.0",
|
|
1357
1366
|
"rollup-plugin-scss": "^4.0.0",
|
|
1358
1367
|
"rollup-plugin-svg": "^1.0.1",
|
|
@@ -1377,42 +1386,18 @@ var devDependencies = {
|
|
|
1377
1386
|
yargs: "^17.7.2"
|
|
1378
1387
|
};
|
|
1379
1388
|
var dependencies = {
|
|
1380
|
-
"@
|
|
1381
|
-
"@geneui/tokens": "^1.6.0-beta",
|
|
1389
|
+
"@floating-ui/core": "^1.6.8",
|
|
1382
1390
|
"@floating-ui/react": "^0.26.16",
|
|
1391
|
+
"@floating-ui/react-dom": "^2.1.2",
|
|
1392
|
+
"@floating-ui/utils": "^0.2.8",
|
|
1393
|
+
"@geneui/icons": "^1.0.4",
|
|
1394
|
+
"@geneui/tokens": "^1.8.0-beta",
|
|
1383
1395
|
classnames: "^2.3.2",
|
|
1384
|
-
|
|
1385
|
-
"draft-js": "^0.11.7",
|
|
1386
|
-
"draftjs-to-html": "^0.9.1",
|
|
1387
|
-
"file-saver": "^2.0.5",
|
|
1388
|
-
highcharts: "^10.2.1",
|
|
1389
|
-
"highcharts-react-official": "^3.1.0",
|
|
1390
|
-
"html-to-draftjs": "^1.5.0",
|
|
1391
|
-
i: "^0.3.7",
|
|
1392
|
-
immer: "^9.0.18",
|
|
1393
|
-
"jodit-react": "^1.3.23",
|
|
1394
|
-
"pure-react-carousel": "^1.30.1",
|
|
1395
|
-
"qrcode.react": "^3.1.0",
|
|
1396
|
-
"rc-slider": "^8.6.9",
|
|
1397
|
-
"react-beautiful-dnd": "^13.1.1",
|
|
1398
|
-
"react-colorful": "^5.6.1",
|
|
1399
|
-
"react-custom-scrollbars": "^4.2.1",
|
|
1400
|
-
"react-dnd": "^16.0.1",
|
|
1401
|
-
"react-dnd-html5-backend": "^16.0.1",
|
|
1402
|
-
"react-draft-wysiwyg": "^1.15.0",
|
|
1403
|
-
"react-fast-compare": "^3.2.0",
|
|
1404
|
-
"react-is": "^17.0.2",
|
|
1405
|
-
"react-loading-skeleton": "^1.1.1",
|
|
1406
|
-
"react-swipeable": "^7.0.0",
|
|
1407
|
-
"react-tiny-popover": "^3.4.5",
|
|
1408
|
-
"react-tiny-popover-latest": "npm:react-tiny-popover@^6.0.4",
|
|
1409
|
-
"react-virtualized": "^9.21.1",
|
|
1410
|
-
"resize-observer-polyfill": "^1.5.1",
|
|
1411
|
-
xlsx: "^0.18.5"
|
|
1396
|
+
"react-is": "^17.0.2"
|
|
1412
1397
|
};
|
|
1413
1398
|
var husky = {
|
|
1414
1399
|
hooks: {
|
|
1415
|
-
"pre-commit": "lint-staged --config ./configs/.lintstagedrc.json",
|
|
1400
|
+
"pre-commit": "lint-staged --concurrent false --config ./configs/.lintstagedrc.json",
|
|
1416
1401
|
"commit-msg": "commitlint --config ./configs/commitlint.config.js -E HUSKY_GIT_PARAMS"
|
|
1417
1402
|
}
|
|
1418
1403
|
};
|
|
@@ -1449,30 +1434,32 @@ var pgk = {
|
|
|
1449
1434
|
license: license
|
|
1450
1435
|
};
|
|
1451
1436
|
|
|
1452
|
-
var css_248z$1 = "
|
|
1437
|
+
var css_248z$1 = "a,abbr,acronym,address,applet,b,big,blockquote,body,caption,center,cite,code,dd,del,dfn,div,dl,dt,em,fieldset,font,form,h1,h2,h3,h4,h5,h6,header,html,i,iframe,img,ins,kbd,label,legend,li,main,object,ol,p,pre,q,s,samp,small,span,strike,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var{border:0;box-sizing:border-box;margin:0;padding:0;vertical-align:initial}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:\"\";content:none;font-family:Arial,Helvetica,sans-serif}:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}input::-ms-clear{display:none}::-moz-focus-inner{border:0;padding:0}a{text-decoration:none}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{box-sizing:border-box;font-family:inherit;font-size:100%;margin:0;padding:0}button,select{background:none;padding:0;text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[role=button],button{background-color:initial;border:none;color:inherit;cursor:pointer;font:inherit;margin:0}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:initial}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;height:auto}[type=search]{-webkit-appearance:textfield}[type=search]::-webkit-search-decoration{-webkit-appearance:none}[type=number]{-moz-appearance:textfield}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}select::-ms-expand{display:none}:after,:before{box-sizing:border-box}";
|
|
1453
1438
|
styleInject(css_248z$1);
|
|
1454
1439
|
|
|
1455
|
-
var css_248z = ".ellipsis-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:focus-visible{outline:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid) var(--guit-sem-color-border-focus);outline-offset:var(--guit-ref-border-width-thin)}";
|
|
1440
|
+
var css_248z = "@import \"https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap\";html{font-size:10px}.ellipsis-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:focus-visible{outline:var(--guit-ref-border-width-thin) var(--guit-ref-border-style-solid) var(--guit-sem-color-border-focus);outline-offset:var(--guit-ref-border-width-thin)}";
|
|
1456
1441
|
styleInject(css_248z);
|
|
1457
1442
|
|
|
1458
1443
|
const GeneUIDesignSystemContext = createContext({
|
|
1459
|
-
theme:
|
|
1444
|
+
theme: "light",
|
|
1460
1445
|
tokens: {},
|
|
1461
1446
|
geneUIProviderRef: { current: null }
|
|
1462
1447
|
});
|
|
1463
|
-
|
|
1448
|
+
function GeneUIProvider({ children, tokens = null, theme = "light" }) {
|
|
1464
1449
|
const geneUIProviderRef = useRef(null);
|
|
1465
1450
|
const [isRefExist, setIsRefExist] = useState(false);
|
|
1466
|
-
const contextValue = {
|
|
1451
|
+
const contextValue = useMemo(() => ({
|
|
1467
1452
|
theme,
|
|
1468
|
-
tokens: tokens
|
|
1453
|
+
tokens: tokens || bootstrap(),
|
|
1469
1454
|
geneUIProviderRef
|
|
1470
|
-
};
|
|
1455
|
+
}), [theme, tokens, geneUIProviderRef]);
|
|
1471
1456
|
useEffect(() => {
|
|
1472
|
-
geneUIProviderRef.current && !isRefExist
|
|
1457
|
+
if (geneUIProviderRef.current && !isRefExist) {
|
|
1458
|
+
setIsRefExist(true);
|
|
1459
|
+
}
|
|
1473
1460
|
}, [geneUIProviderRef.current]);
|
|
1474
1461
|
return (React__default.createElement(GeneUIDesignSystemContext.Provider, { value: contextValue },
|
|
1475
|
-
React__default.createElement("div", { "data-gene-ui-version": pgk.version, ref: geneUIProviderRef, style: { height:
|
|
1476
|
-
}
|
|
1462
|
+
React__default.createElement("div", { "data-gene-ui-version": pgk.version, ref: geneUIProviderRef, style: { height: "100%" } }, isRefExist && children)));
|
|
1463
|
+
}
|
|
1477
1464
|
|
|
1478
1465
|
export { GeneUIDesignSystemContext, GeneUIProvider as default };
|
package/HelperText.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { _ as _objectWithoutProperties, a as _extends } from './ArrowLeft-b88e2ba8.js';
|
|
3
|
+
import { c as classNames } from './index-ce02421b.js';
|
|
4
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
5
|
+
|
|
6
|
+
var _excluded$1 = ["size", "color"];
|
|
7
|
+
var SvgErrorAlertFill = function SvgErrorAlertFill(_ref) {
|
|
8
|
+
var _ref$size = _ref.size,
|
|
9
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
10
|
+
_ref$color = _ref.color,
|
|
11
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded$1);
|
|
13
|
+
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
14
|
+
width: size,
|
|
15
|
+
height: size,
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
fill: color,
|
|
18
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
19
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
20
|
+
d: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm-.75 5.758a.75.75 0 1 1 1.5 0v5.243a.75.75 0 1 1-1.5 0v-5.243Zm.75 9.235a.915.915 0 1 1 0-1.83.915.915 0 0 1 0 1.83Z",
|
|
21
|
+
fill: color
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
var _excluded = ["size", "color"];
|
|
26
|
+
var SvgWarningFill = function SvgWarningFill(_ref) {
|
|
27
|
+
var _ref$size = _ref.size,
|
|
28
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
29
|
+
_ref$color = _ref.color,
|
|
30
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
31
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
32
|
+
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
33
|
+
width: size,
|
|
34
|
+
height: size,
|
|
35
|
+
viewBox: "0 0 24 24",
|
|
36
|
+
fill: color,
|
|
37
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
38
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
39
|
+
fillRule: "evenodd",
|
|
40
|
+
clipRule: "evenodd",
|
|
41
|
+
d: "m2.13 19.503 9.075-15.997a1 1 0 0 1 1.375-.368 1 1 0 0 1 .365.375l8.928 15.996a1.004 1.004 0 0 1-.375 1.358.997.997 0 0 1-.497.133h-18.002a.997.997 0 0 1-.999-.997c0-.175.044-.348.13-.5Zm9.33-5.035a.748.748 0 0 0 1.278-.531v-5.254a.753.753 0 0 0-.749-.751.748.748 0 0 0-.749.751v5.254c0 .199.08.39.22.531Zm1.442 2.552a.915.915 0 0 1-.913.917.915.915 0 0 1-.914-.917.915.915 0 1 1 1.827 0Z",
|
|
42
|
+
fill: color
|
|
43
|
+
}));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var css_248z = ".helperText{display:inline-flex;gap:var(--guit-ref-spacing-3xsmall);max-width:100%}.helperText_size_medium .helperText__text{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family);font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.helperText_size_small .helperText__text{font-family:var(--guit-sem-font-label-small-default-medium-font-family);font-size:var(--guit-sem-font-label-small-default-medium-font-size);font-weight:var(--guit-sem-font-label-small-default-medium-font-weight);line-height:var(--guit-sem-font-label-small-default-medium-line-height)}.helperText_type_rest{color:var(--guit-sem-color-foreground-neutral-2)}.helperText_type_danger{color:var(--guit-sem-color-foreground-error)}.helperText_type_warning{color:var(--guit-sem-color-foreground-neutral-2)}.helperText_type_warning .helperText__icon{color:var(--guit-sem-color-foreground-warning)}.helperText_disabled,.helperText_disabled .helperText__icon{color:var(--guit-sem-color-foreground-disabled)}.helperText__icon{flex:0 0 auto}";
|
|
47
|
+
styleInject(css_248z);
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The Helper Text provides users with additional information or guidance related to a specific input field in a form. This text helps users understand the expected format, requirements, or purpose of the input, thereby improving form completion accuracy and user confidence.
|
|
51
|
+
*/
|
|
52
|
+
const HelperText = ({ size = "medium", type = "rest", text, Icon, isDisabled, isLoading, className }) => {
|
|
53
|
+
const iconSize = {
|
|
54
|
+
small: 16,
|
|
55
|
+
medium: 20
|
|
56
|
+
};
|
|
57
|
+
const iconMap = {
|
|
58
|
+
danger: React__default.createElement(SvgErrorAlertFill, { size: iconSize[size] }),
|
|
59
|
+
warning: React__default.createElement(SvgWarningFill, { size: iconSize[size] }),
|
|
60
|
+
rest: Icon && React__default.createElement(Icon, { size: iconSize[size] })
|
|
61
|
+
};
|
|
62
|
+
return (React__default.createElement("div", { className: classNames(`helperText helperText_type_${type} helperText_size_${size}`, className, {
|
|
63
|
+
helperText_disabled: isDisabled
|
|
64
|
+
}) }, isLoading ? ("skeleton") : (React__default.createElement(React__default.Fragment, null,
|
|
65
|
+
iconMap[type] && React__default.createElement("div", { className: "helperText__icon" }, iconMap[type]),
|
|
66
|
+
React__default.createElement("p", { className: "helperText__text" }, text)))));
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export { HelperText as default };
|
package/Info.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React__default, { useState, useMemo } from 'react';
|
|
2
|
+
import { c as classNames } from './index-ce02421b.js';
|
|
3
|
+
import { _ as _objectWithoutProperties, a as _extends } from './ArrowLeft-b88e2ba8.js';
|
|
4
|
+
import Tooltip from './Tooltip.js';
|
|
5
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
6
|
+
import 'react-dom';
|
|
7
|
+
import './GeneUIProvider.js';
|
|
8
|
+
|
|
9
|
+
var _excluded = ["size", "color"];
|
|
10
|
+
var SvgInfoOutline = function SvgInfoOutline(_ref) {
|
|
11
|
+
var _ref$size = _ref.size,
|
|
12
|
+
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
13
|
+
_ref$color = _ref.color,
|
|
14
|
+
color = _ref$color === void 0 ? "currentColor" : _ref$color,
|
|
15
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
16
|
+
return /*#__PURE__*/React__default.createElement("svg", _extends({
|
|
17
|
+
width: size,
|
|
18
|
+
height: size,
|
|
19
|
+
viewBox: "0 0 24 24",
|
|
20
|
+
fill: color,
|
|
21
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
22
|
+
}, props), /*#__PURE__*/React__default.createElement("path", {
|
|
23
|
+
d: "M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18.5a8.5 8.5 0 1 1 8.5-8.5 8.51 8.51 0 0 1-8.5 8.5Z",
|
|
24
|
+
fill: color
|
|
25
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
26
|
+
d: "M11.97 10.237a.75.75 0 0 0-.75.75v5.243a.75.75 0 0 0 1.5 0v-5.243a.75.75 0 0 0-.75-.75Z",
|
|
27
|
+
fill: color
|
|
28
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
29
|
+
d: "M11.969 6.995a.914.914 0 1 0 0 1.829.914.914 0 0 0 0-1.829Z",
|
|
30
|
+
fill: color
|
|
31
|
+
}));
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
var css_248z = ".info{border-radius:var(--guit-ref-radius-3xsmall);line-height:0}.info_appearance_default{color:var(--guit-sem-color-foreground-neutral-2)}.info_appearance_brand{color:var(--guit-sem-color-foreground-brand)}.info_appearance_inverse{color:var(--guit-sem-color-foreground-inverse)}.info_disabled{color:var(--guit-sem-color-foreground-disabled);pointer-events:none}";
|
|
35
|
+
styleInject(css_248z);
|
|
36
|
+
|
|
37
|
+
const iconSizes = {
|
|
38
|
+
small: 24,
|
|
39
|
+
smallNudge: 20,
|
|
40
|
+
XSmall: 16
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Info icon component used to provide additional contextual information to users. It appears as a small icon, and is placed near elements where further explanation or clarification is useful.
|
|
44
|
+
*/
|
|
45
|
+
const Info = ({ infoText, disabled, size = "smallNudge", appearance = "default", className }) => {
|
|
46
|
+
const [alwaysShow, setAlwaysShow] = useState(false);
|
|
47
|
+
const keyDownHandler = (event) => {
|
|
48
|
+
if (disabled)
|
|
49
|
+
return;
|
|
50
|
+
if (event.key === "Enter") {
|
|
51
|
+
setAlwaysShow((prev) => !prev);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const handleBlur = () => !disabled && alwaysShow && setAlwaysShow(false);
|
|
55
|
+
const buttonClassNames = useMemo(() => classNames("info", className, {
|
|
56
|
+
[`info_appearance_${appearance}`]: appearance,
|
|
57
|
+
info_disabled: disabled
|
|
58
|
+
}), [appearance, className, disabled]);
|
|
59
|
+
return (React__default.createElement(Tooltip, { text: infoText, alwaysShow: alwaysShow, appearance: appearance === "inverse" ? "inverse" : "default" },
|
|
60
|
+
React__default.createElement("button", { type: "button", disabled: disabled, "aria-pressed": alwaysShow, className: buttonClassNames, onKeyDown: keyDownHandler, onBlur: handleBlur },
|
|
61
|
+
React__default.createElement(SvgInfoOutline, { className: "info__icon", size: iconSizes[size] }))));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export { Info as default };
|
package/Label.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import React__default, { useRef } from 'react';
|
|
2
|
+
import { c as classNames } from './index-ce02421b.js';
|
|
3
|
+
import Tooltip from './Tooltip.js';
|
|
4
|
+
import { a as useEllipsisDetection } from './useEllipsisDetection-46d712b6.js';
|
|
5
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
6
|
+
import Info from './Info.js';
|
|
7
|
+
import 'react-dom';
|
|
8
|
+
import './GeneUIProvider.js';
|
|
9
|
+
import './ArrowLeft-b88e2ba8.js';
|
|
10
|
+
|
|
11
|
+
var css_248z = ".label{display:inline-flex;max-width:100%}.label,.label__container{align-items:center;min-width:0}.label__container{display:flex;gap:var(--guit-ref-spacing-3xsmall);width:100%}.label__container-inner{align-items:center;display:flex;gap:var(--guit-ref-spacing-4xsmall);max-width:100%}.label__asterisk,.label__text{color:var(--guit-sem-color-foreground-neutral-2)}.label__asterisk_size_medium,.label__text_size_medium{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family);font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.label__asterisk_size_small,.label__text_size_small{font-family:var(--guit-sem-font-label-small-default-medium-font-family);font-size:var(--guit-sem-font-label-small-default-medium-font-size);font-weight:var(--guit-sem-font-label-small-default-medium-font-weight);line-height:var(--guit-sem-font-label-small-default-medium-line-height)}.label__asterisk_disabled,.label__text_disabled{color:var(--guit-sem-color-foreground-disabled);pointer-events:none}";
|
|
12
|
+
styleInject(css_248z);
|
|
13
|
+
|
|
14
|
+
const iconSizes = {
|
|
15
|
+
small: "XSmall",
|
|
16
|
+
medium: "smallNudge"
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Labels identify a component or group of components. Use them with elements such as checkboxes and input fields to guide users in providing specific information, or with plain text to organize information.
|
|
20
|
+
*/
|
|
21
|
+
const Label = ({ size = "medium", labelText, disabled, required, infoText, isLoading, className, children }) => {
|
|
22
|
+
const labelRef = useRef(null);
|
|
23
|
+
const isTruncated = useEllipsisDetection(labelRef);
|
|
24
|
+
return (React__default.createElement("label", { className: classNames(`label`, className) },
|
|
25
|
+
children,
|
|
26
|
+
isLoading ? (React__default.createElement("span", null, "skeleton")) : (React__default.createElement("span", { className: "label__container" },
|
|
27
|
+
React__default.createElement("div", { className: "label__container-inner" },
|
|
28
|
+
React__default.createElement(Tooltip, { text: labelText, isVisible: isTruncated },
|
|
29
|
+
React__default.createElement("span", { ref: labelRef, className: classNames(`ellipsis-text label__text label__text_size_${size}`, {
|
|
30
|
+
label__text_disabled: disabled
|
|
31
|
+
}) }, labelText)),
|
|
32
|
+
required && (React__default.createElement("span", { className: classNames(`label__asterisk label__text_size_${size} `, {
|
|
33
|
+
label__text_disabled: disabled
|
|
34
|
+
}) }, "*"))),
|
|
35
|
+
infoText && React__default.createElement(Info, { infoText: infoText, disabled: disabled, size: iconSizes[size] })))));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export { Label as default };
|
package/Loader.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
import { s as styleInject } from './style-inject.es-746bb8ed.js';
|
|
3
|
+
|
|
4
|
+
var css_248z = ".loader{align-items:center;display:inline-flex;justify-content:center}.loader_direction_below{flex-direction:column;text-align:center}.loader_size_2xLarge,.loader_size_xLarge{font-family:var(--guit-sem-font-label-large-default-medium-font-family);font-size:var(--guit-sem-font-label-large-default-semibold-font-size);font-weight:var(--guit-sem-font-label-large-default-medium-font-weight);line-height:var(--guit-sem-font-label-large-default-semibold-line-height)}.loader_size_large,.loader_size_medium,.loader_size_small,.loader_size_smallNudge{font-family:var(--guit-sem-font-label-medium-default-semibold-font-family);font-size:var(--guit-sem-font-label-medium-default-semibold-font-size);font-weight:var(--guit-sem-font-label-medium-default-medium-font-weight);line-height:var(--guit-sem-font-label-medium-default-semibold-line-height)}.loader_size_small,.loader_size_smallNudge{gap:var(--guit-ref-spacing-xsmall)}.loader_size_2xLarge{gap:var(--guit-ref-spacing-2xlarge)}.loader_size_2xLarge .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-2xlarge);width:var(--guit-sem-dimension-width-2xlarge)}.loader_size_xLarge{gap:var(--guit-ref-spacing-xlarge)}.loader_size_xLarge .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-xlarge);width:var(--guit-sem-dimension-width-xlarge)}.loader_size_large{gap:var(--guit-ref-spacing-large)}.loader_size_large .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-large);width:var(--guit-sem-dimension-width-large)}.loader_size_medium{gap:var(--guit-ref-spacing-medium)}.loader_size_medium .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-medium);width:var(--guit-sem-dimension-width-medium)}.loader_size_small .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-small);width:var(--guit-sem-dimension-width-small)}.loader_size_smallNudge .loader__spinnerWrapper{height:var(--guit-sem-dimension-height-small-nudge);width:var(--guit-sem-dimension-width-small-nudge)}.loader_color_brand .loader__text,.loader_color_neutral .loader__text{color:var(--guit-sem-color-foreground-neutral-1)}.loader_color_brand .loader__spinnerPath{stroke:var(--guit-sem-color-foreground-brand)}.loader_color_neutral .loader__spinnerPath{stroke:var(--guit-sem-color-foreground-neutral-2)}.loader_color_inverse .loader__spinnerPath{stroke:var(--guit-sem-color-foreground-inverse)}.loader_color_inverse .loader__text{color:var(--guit-sem-color-foreground-inverse)}.loader__spinnerWrapper{flex:0 0 auto;padding:var(--guit-ref-spacing-4xsmall)}.loader__spinner{animation:loader-rotate 2s linear infinite;height:100%;width:100%}.loader__spinnerPath{stroke-linecap:round;animation:loader-dash 1.5s ease-in-out infinite;transform:translateZ(0)}.loader__text{font-size:inherit;font-weight:inherit;line-height:inherit;text-transform:capitalize}@keyframes loader-rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes loader-dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}to{stroke-dasharray:90,150;stroke-dashoffset:-136}}";
|
|
5
|
+
styleInject(css_248z);
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
*Loading spinner is a visual indicator that informs users an operation is in progress. Typically displayed as a rotating icon or circular animation, it signals that the system is working on a task, such as loading data or processing a request, and that the user should wait until the process is complete.
|
|
9
|
+
*/
|
|
10
|
+
const Loader = ({ isLoading = true, text, textPosition = "after", size = "medium", appearance = "brand", children = null }) => {
|
|
11
|
+
if (isLoading) {
|
|
12
|
+
return (React__default.createElement("span", { className: `loader loader_direction_${textPosition} loader_size_${size} loader_color_${appearance}` },
|
|
13
|
+
React__default.createElement("span", { className: "loader__spinnerWrapper" },
|
|
14
|
+
React__default.createElement("svg", { className: "loader__spinner", viewBox: "0 0 50 50" },
|
|
15
|
+
React__default.createElement("circle", { className: "loader__spinnerPath", cx: "25", cy: "25", r: "22", fill: "none", strokeWidth: "5" }))),
|
|
16
|
+
text && React__default.createElement("span", { className: `loader__text loader__textColor_${appearance}` }, text)));
|
|
17
|
+
}
|
|
18
|
+
return children;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { Loader as default };
|