smarthr-ui 47.0.0 → 48.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/components/Base/Base.js +4 -1
- package/esm/components/Base/Base.js.map +1 -1
- package/esm/components/Dialog/DialogContentInner.js +3 -3
- package/esm/components/Dialog/DialogContentInner.js.map +1 -1
- package/esm/components/Dialog/useBodyScrollLock.d.ts +1 -0
- package/esm/components/Dialog/useBodyScrollLock.js +28 -0
- package/esm/components/Dialog/useBodyScrollLock.js.map +1 -0
- package/esm/components/Dropdown/SortDropdown/SortDropdown.js +1 -1
- package/esm/components/Dropdown/SortDropdown/SortDropdown.js.map +1 -1
- package/esm/components/Fieldset/Fieldset.d.ts +3 -0
- package/esm/components/Fieldset/Fieldset.js +4 -0
- package/esm/components/Fieldset/Fieldset.js.map +1 -0
- package/esm/components/Fieldset/index.js.map +1 -0
- package/esm/components/FlashMessage/FlashMessage.d.ts +66 -8
- package/esm/components/FlashMessage/FlashMessage.js +40 -98
- package/esm/components/FlashMessage/FlashMessage.js.map +1 -1
- package/esm/components/FlashMessage/FlashMessageList/useFlashMessageList.d.ts +1 -2
- package/esm/components/FormControl/FormControl.d.ts +35 -4
- package/esm/components/FormControl/FormControl.js +163 -4
- package/esm/components/FormControl/FormControl.js.map +1 -1
- package/esm/components/Icon/Icon.d.ts +28 -2
- package/esm/components/Icon/Icon.js +29 -3
- package/esm/components/Icon/Icon.js.map +1 -1
- package/esm/components/SectioningContent/SectioningContent.d.ts +1 -0
- package/esm/components/SectioningContent/SectioningContent.js +2 -0
- package/esm/components/SectioningContent/SectioningContent.js.map +1 -1
- package/esm/components/Table/BulkActionRow.js +4 -1
- package/esm/components/Table/BulkActionRow.js.map +1 -1
- package/esm/hooks/useTailwindTheme.d.ts +17 -0
- package/esm/index.d.ts +1 -3
- package/esm/index.js +1 -3
- package/esm/index.js.map +1 -1
- package/esm/smarthr-ui-preset.d.ts +17 -0
- package/esm/smarthr-ui-preset.js +17 -0
- package/esm/smarthr-ui-preset.js.map +1 -1
- package/lib/components/Base/Base.js +4 -1
- package/lib/components/Base/Base.js.map +1 -1
- package/lib/components/Dialog/DialogContentInner.js +3 -3
- package/lib/components/Dialog/DialogContentInner.js.map +1 -1
- package/lib/components/Dialog/useBodyScrollLock.d.ts +1 -0
- package/lib/components/Dialog/useBodyScrollLock.js +32 -0
- package/lib/components/Dialog/useBodyScrollLock.js.map +1 -0
- package/lib/components/Dropdown/SortDropdown/SortDropdown.js +2 -2
- package/lib/components/Dropdown/SortDropdown/SortDropdown.js.map +1 -1
- package/lib/components/Fieldset/Fieldset.d.ts +3 -0
- package/lib/components/{NewFieldset → Fieldset}/Fieldset.js +2 -2
- package/lib/components/Fieldset/Fieldset.js.map +1 -0
- package/lib/components/Fieldset/index.js.map +1 -0
- package/lib/components/FlashMessage/FlashMessage.d.ts +66 -8
- package/lib/components/FlashMessage/FlashMessage.js +39 -97
- package/lib/components/FlashMessage/FlashMessage.js.map +1 -1
- package/lib/components/FlashMessage/FlashMessageList/useFlashMessageList.d.ts +1 -2
- package/lib/components/FormControl/FormControl.d.ts +35 -4
- package/lib/components/FormControl/FormControl.js +188 -5
- package/lib/components/FormControl/FormControl.js.map +1 -1
- package/lib/components/Icon/Icon.d.ts +28 -2
- package/lib/components/Icon/Icon.js +32 -6
- package/lib/components/Icon/Icon.js.map +1 -1
- package/lib/components/SectioningContent/SectioningContent.d.ts +1 -0
- package/lib/components/SectioningContent/SectioningContent.js +2 -0
- package/lib/components/SectioningContent/SectioningContent.js.map +1 -1
- package/lib/components/Table/BulkActionRow.js +4 -1
- package/lib/components/Table/BulkActionRow.js.map +1 -1
- package/lib/hooks/useTailwindTheme.d.ts +17 -0
- package/lib/index.d.ts +1 -3
- package/lib/index.js +5 -9
- package/lib/index.js.map +1 -1
- package/lib/smarthr-ui-preset.d.ts +17 -0
- package/lib/smarthr-ui-preset.js +17 -0
- package/lib/smarthr-ui-preset.js.map +1 -1
- package/package.json +9 -9
- package/smarthr-ui.css +70 -3
- package/esm/components/Dialog/BodyScrollSuppressor.d.ts +0 -2
- package/esm/components/Dialog/BodyScrollSuppressor.js +0 -30
- package/esm/components/Dialog/BodyScrollSuppressor.js.map +0 -1
- package/esm/components/FieldSet/FieldSet.d.ts +0 -23
- package/esm/components/FieldSet/FieldSet.js +0 -70
- package/esm/components/FieldSet/FieldSet.js.map +0 -1
- package/esm/components/FieldSet/index.d.ts +0 -1
- package/esm/components/FieldSet/index.js +0 -2
- package/esm/components/FieldSet/index.js.map +0 -1
- package/esm/components/FieldSet/useClassNames.d.ts +0 -11
- package/esm/components/FieldSet/useClassNames.js +0 -18
- package/esm/components/FieldSet/useClassNames.js.map +0 -1
- package/esm/components/FlashMessage/useClassNames.d.ts +0 -5
- package/esm/components/FlashMessage/useClassNames.js +0 -12
- package/esm/components/FlashMessage/useClassNames.js.map +0 -1
- package/esm/components/FormGroup/FormGroup.d.ts +0 -38
- package/esm/components/FormGroup/FormGroup.js +0 -166
- package/esm/components/FormGroup/FormGroup.js.map +0 -1
- package/esm/components/FormGroup/index.d.ts +0 -1
- package/esm/components/FormGroup/index.js +0 -2
- package/esm/components/FormGroup/index.js.map +0 -1
- package/esm/components/NewFieldset/Fieldset.d.ts +0 -3
- package/esm/components/NewFieldset/Fieldset.js +0 -4
- package/esm/components/NewFieldset/Fieldset.js.map +0 -1
- package/esm/components/NewFieldset/index.js.map +0 -1
- package/lib/components/Dialog/BodyScrollSuppressor.d.ts +0 -2
- package/lib/components/Dialog/BodyScrollSuppressor.js +0 -57
- package/lib/components/Dialog/BodyScrollSuppressor.js.map +0 -1
- package/lib/components/FieldSet/FieldSet.d.ts +0 -23
- package/lib/components/FieldSet/FieldSet.js +0 -100
- package/lib/components/FieldSet/FieldSet.js.map +0 -1
- package/lib/components/FieldSet/index.d.ts +0 -1
- package/lib/components/FieldSet/index.js +0 -18
- package/lib/components/FieldSet/index.js.map +0 -1
- package/lib/components/FieldSet/useClassNames.d.ts +0 -11
- package/lib/components/FieldSet/useClassNames.js +0 -22
- package/lib/components/FieldSet/useClassNames.js.map +0 -1
- package/lib/components/FlashMessage/useClassNames.d.ts +0 -5
- package/lib/components/FlashMessage/useClassNames.js +0 -16
- package/lib/components/FlashMessage/useClassNames.js.map +0 -1
- package/lib/components/FormGroup/FormGroup.d.ts +0 -38
- package/lib/components/FormGroup/FormGroup.js +0 -193
- package/lib/components/FormGroup/FormGroup.js.map +0 -1
- package/lib/components/FormGroup/index.d.ts +0 -1
- package/lib/components/FormGroup/index.js +0 -6
- package/lib/components/FormGroup/index.js.map +0 -1
- package/lib/components/NewFieldset/Fieldset.d.ts +0 -3
- package/lib/components/NewFieldset/Fieldset.js.map +0 -1
- package/lib/components/NewFieldset/index.js.map +0 -1
- /package/esm/components/{NewFieldset → Fieldset}/index.d.ts +0 -0
- /package/esm/components/{NewFieldset → Fieldset}/index.js +0 -0
- /package/lib/components/{NewFieldset → Fieldset}/index.d.ts +0 -0
- /package/lib/components/{NewFieldset → Fieldset}/index.js +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { forwardRef, useMemo } from 'react';
|
|
2
2
|
import { tv } from 'tailwind-variants';
|
|
3
|
+
import { useSectionWrapper } from '../SectioningContent/useSectioningWrapper';
|
|
3
4
|
const base = tv({
|
|
4
5
|
base: 'smarthr-ui-Base shr-bg-white forced-colors:shr-border-shorthand contrast-more:shr-border-high-contrast',
|
|
5
6
|
variants: {
|
|
@@ -101,6 +102,8 @@ export const Base = forwardRef(({ padding, radius = 'm', overflow, layer = 1, as
|
|
|
101
102
|
className,
|
|
102
103
|
});
|
|
103
104
|
}, [className, layer, overflow, padding, radius]);
|
|
104
|
-
|
|
105
|
+
const Wrapper = useSectionWrapper(Component);
|
|
106
|
+
return (React.createElement(Wrapper, null,
|
|
107
|
+
React.createElement(Component, { ...props, ref: ref, className: styles })));
|
|
105
108
|
});
|
|
106
109
|
//# sourceMappingURL=Base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../src/components/Base/Base.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4C,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC5F,OAAO,EAAgB,EAAE,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"Base.js","sourceRoot":"","sources":["../../../src/components/Base/Base.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4C,UAAU,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC5F,OAAO,EAAgB,EAAE,EAAE,MAAM,mBAAmB,CAAA;AAEpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAA;AAI7E,MAAM,IAAI,GAAG,EAAE,CAAC;IACd,IAAI,EAAE,wGAAwG;IAC9G,QAAQ,EAAE;QACR,YAAY,EAAE;YACZ,CAAC,EAAE,UAAU;YACb,IAAI,EAAE,aAAa;YACnB,GAAG,EAAE,YAAY;YACjB,IAAI,EAAE,aAAa;YACnB,CAAC,EAAE,UAAU;YACb,IAAI,EAAE,aAAa;YACnB,GAAG,EAAE,YAAY;YACjB,CAAC,EAAE,UAAU;YACb,GAAG,EAAE,YAAY;YACjB,CAAC,EAAE,UAAU;YACb,GAAG,EAAE,YAAY;YACjB,CAAC,EAAE,UAAU;YACb,CAAC,EAAE,UAAU;YACb,GAAG,EAAE,aAAa;YAClB,GAAG,EAAE,YAAY;YACjB,EAAE,EAAE,UAAU;YACd,CAAC,EAAE,YAAY;YACf,CAAC,EAAE,UAAU;YACb,CAAC,EAAE,YAAY;YACf,EAAE,EAAE,UAAU;YACd,GAAG,EAAE,YAAY;YACjB,GAAG,EAAE,UAAU;SACY;QAC7B,aAAa,EAAE;YACb,CAAC,EAAE,UAAU;YACb,IAAI,EAAE,aAAa;YACnB,GAAG,EAAE,YAAY;YACjB,IAAI,EAAE,aAAa;YACnB,CAAC,EAAE,UAAU;YACb,IAAI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AAE,KAAK,GAAG,CAAC,EAAE,EAAE,EAAE,SAAS,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAC1F,GAAG,EACH,EAAE;IACF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,MAAM,YAAY,GAAG,OAAO,YAAY,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAA;QACxE,MAAM,aAAa,GAAG,OAAO,YAAY,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAA;QAE1E,MAAM,aAAa,GAAG,QAAQ,YAAY,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;QACxE,MAAM,cAAc,GAAG,QAAQ,YAAY,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;QAEzE,OAAO,IAAI,CAAC;YACV,YAAY;YACZ,aAAa;YACb,MAAM;YACN,aAAa;YACb,cAAc;YACd,KAAK;YACL,SAAS;SACV,CAAC,CAAA;IACJ,CAAC,EAAE,CAAC,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAA;IAEjD,MAAM,OAAO,GAAG,iBAAiB,CAAC,SAAS,CAAC,CAAA;IAE5C,OAAO,CACL,oBAAC,OAAO;QACN,oBAAC,SAAS,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,GAAI,CAC7C,CACX,CAAA;AACH,CAAC,CACF,CAAA"}
|
|
@@ -2,10 +2,10 @@ import React, { useCallback, useMemo, useRef, } from 'react';
|
|
|
2
2
|
import { tv } from 'tailwind-variants';
|
|
3
3
|
import { useHandleEscape } from '../../hooks/useHandleEscape';
|
|
4
4
|
import { useTheme } from '../../hooks/useTailwindTheme';
|
|
5
|
-
import { BodyScrollSuppressor } from './BodyScrollSuppressor';
|
|
6
5
|
import { DialogOverlap } from './DialogOverlap';
|
|
7
6
|
import { DialogPositionProvider } from './DialogPositionProvider';
|
|
8
7
|
import { FocusTrap } from './FocusTrap';
|
|
8
|
+
import { useBodyScrollLock } from './useBodyScrollLock';
|
|
9
9
|
function exist(value) {
|
|
10
10
|
return value !== undefined && value !== null;
|
|
11
11
|
}
|
|
@@ -59,12 +59,12 @@ export const DialogContentInner = ({ onClickOverlay, onPressEscape = () => {
|
|
|
59
59
|
}
|
|
60
60
|
onClickOverlay && onClickOverlay();
|
|
61
61
|
}, [isOpen, onClickOverlay]);
|
|
62
|
+
useBodyScrollLock(isOpen);
|
|
62
63
|
return (React.createElement(DialogPositionProvider, { top: top, bottom: bottom },
|
|
63
64
|
React.createElement(DialogOverlap, { isOpen: isOpen },
|
|
64
65
|
React.createElement("div", { className: layoutStyle, id: id },
|
|
65
66
|
React.createElement("div", { onClick: handleClickOverlay, className: backgroundStyle, role: "presentation" }),
|
|
66
67
|
React.createElement("div", { ...props, ...innerStyleProps, ref: innerRef, role: "dialog", "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, "aria-modal": "true" },
|
|
67
|
-
React.createElement(FocusTrap, { firstFocusTarget: firstFocusTarget }, children))
|
|
68
|
-
React.createElement(BodyScrollSuppressor, null)))));
|
|
68
|
+
React.createElement(FocusTrap, { firstFocusTarget: firstFocusTarget }, children))))));
|
|
69
69
|
};
|
|
70
70
|
//# sourceMappingURL=DialogContentInner.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogContentInner.js","sourceRoot":"","sources":["../../../src/components/Dialog/DialogContentInner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAEvD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"DialogContentInner.js","sourceRoot":"","sources":["../../../src/components/Dialog/DialogContentInner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAKZ,WAAW,EACX,OAAO,EACP,MAAM,GACP,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,EAAE,EAAE,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAA;AAEvD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AAsDvD,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAA;AAC9C,CAAC;AAED,MAAM,kBAAkB,GAAG,EAAE,CAAC;IAC5B,KAAK,EAAE;QACL,MAAM,EAAE,iDAAiD;QACzD,KAAK,EACH,uJAAuJ;QACzJ,UAAU,EAAE,iEAAiE;KAC9E;CACF,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAA+C,CAAC,EAC7E,cAAc,EACd,aAAa,GAAG,GAAG,EAAE;IACnB,UAAU;AACZ,CAAC,EACD,MAAM,EACN,EAAE,EACF,KAAK,EACL,GAAG,EACH,KAAK,EACL,MAAM,EACN,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,cAAc,EACd,QAAQ,EACR,SAAS,EACT,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,EAAE,CAAA;IAC9B,MA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;gBAEjC,6BAAK,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,eAAe,EAAE,IAAI,EAAC,cAAc,GAAG;gBACpF,gCACM,KAAK,KACL,eAAe,EACnB,GAAG,EAAE,QAAQ,EACb,IAAI,EAAC,QAAQ,gBACD,SAAS,qBACJ,cAAc,gBACpB,MAAM;oBAEjB,oBAAC,SAAS,IAAC,gBAAgB,EAAE,gBAAgB,IAAG,QAAQ,CAAa,CACjE,CACF,CACQ,CACO,CAC1B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useBodyScrollLock: (isOpen: boolean) => void;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
export const useBodyScrollLock = (isOpen) => {
|
|
3
|
+
const [scrollBarWidth, setScrollBarWidth] = useState(null);
|
|
4
|
+
const [paddingRight, setPaddingRight] = useState(null);
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
setScrollBarWidth(window.innerWidth - document.body.clientWidth);
|
|
7
|
+
}, []);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (scrollBarWidth === null) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const originalPaddingRight = getComputedStyle(document.body).getPropertyValue('padding-right');
|
|
13
|
+
setPaddingRight(scrollBarWidth + parseInt(originalPaddingRight, 10));
|
|
14
|
+
}, [scrollBarWidth]);
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (!isOpen)
|
|
17
|
+
return;
|
|
18
|
+
if (paddingRight !== null) {
|
|
19
|
+
document.body.style.paddingInlineEnd = `${paddingRight}px`;
|
|
20
|
+
}
|
|
21
|
+
document.body.style.overflow = 'hidden';
|
|
22
|
+
return () => {
|
|
23
|
+
document.body.style.paddingInlineEnd = '';
|
|
24
|
+
document.body.style.overflow = '';
|
|
25
|
+
};
|
|
26
|
+
}, [isOpen, paddingRight]);
|
|
27
|
+
};
|
|
28
|
+
//# sour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AAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,GAAG,EAAE,CAAA;YACzC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,EAAE,CAAA;QACnC,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAA;AAC5B,CAAC,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Button } from '../../Button';
|
|
3
|
+
import { Fieldset } from '../../Fieldset';
|
|
3
4
|
import { FormControl } from '../../FormControl';
|
|
4
5
|
import { Cluster, Stack } from '../../Layout';
|
|
5
|
-
import { Fieldset } from '../../NewFieldset';
|
|
6
6
|
import { RadioButton } from '../../RadioButton';
|
|
7
7
|
import { Select } from '../../Select';
|
|
8
8
|
import { Dropdown } from '../Dropdown';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SortDropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/SortDropdown/SortDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAA;AAGpE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SortDropdown.js","sourceRoot":"","sources":["../../../../src/components/Dropdown/SortDropdown/SortDropdown.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAA;AAGpE,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AACrC,OAAO,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UAAU,GAAG,CAC/C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Fieldset/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ComponentPropsWithoutRef, FC, ReactNode } from 'react';
|
|
2
|
+
import { VariantProps } from 'tailwind-variants';
|
|
2
3
|
export declare const messageTypes: readonly ["success", "info", "warning", "error"];
|
|
3
|
-
export declare const animationTypes: readonly ["bounce", "fade", "none"];
|
|
4
4
|
export declare const roles: readonly ["alert", "status"];
|
|
5
5
|
export type Props = {
|
|
6
6
|
/** true のときに FlashMessage を表示する */
|
|
@@ -9,18 +9,76 @@ export type Props = {
|
|
|
9
9
|
type: (typeof messageTypes)[number];
|
|
10
10
|
/** メッセージの内容 */
|
|
11
11
|
text: ReactNode;
|
|
12
|
-
/** アニメーションのタイプ */
|
|
13
|
-
animation?: (typeof animationTypes)[number];
|
|
14
12
|
/** コンポーネントに適用する role 属性 */
|
|
15
13
|
role?: (typeof roles)[number];
|
|
16
|
-
/** コンポーネントに適用するクラス名 */
|
|
17
|
-
className?: string;
|
|
18
14
|
/** 閉じるボタンを押下、または表示してから8秒後に発火するコールバック関数 */
|
|
19
15
|
onClose: () => void;
|
|
20
16
|
/** FlashMessage が表示されてから一定時間後に自動で閉じるかどうか */
|
|
21
17
|
autoClose?: boolean;
|
|
22
|
-
}
|
|
23
|
-
type ElementProps = Omit<
|
|
18
|
+
} & VariantProps<typeof flashMessage>;
|
|
19
|
+
type ElementProps = Omit<ComponentPropsWithoutRef<'div'>, keyof Props>;
|
|
20
|
+
declare const flashMessage: import("tailwind-variants").TVReturnType<{
|
|
21
|
+
animation: {
|
|
22
|
+
bounce: {
|
|
23
|
+
wrapper: string[];
|
|
24
|
+
};
|
|
25
|
+
none: {};
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
wrapper: string[];
|
|
29
|
+
responseMessage: string[];
|
|
30
|
+
closeButton: string[];
|
|
31
|
+
}, undefined, import("tailwind-variants/dist/config").TVConfig<{
|
|
32
|
+
animation: {
|
|
33
|
+
bounce: {
|
|
34
|
+
wrapper: string[];
|
|
35
|
+
};
|
|
36
|
+
none: {};
|
|
37
|
+
};
|
|
38
|
+
}, {
|
|
39
|
+
animation: {
|
|
40
|
+
bounce: {
|
|
41
|
+
wrapper: string[];
|
|
42
|
+
};
|
|
43
|
+
none: {};
|
|
44
|
+
};
|
|
45
|
+
}>, {
|
|
46
|
+
animation: {
|
|
47
|
+
bounce: {
|
|
48
|
+
wrapper: string[];
|
|
49
|
+
};
|
|
50
|
+
none: {};
|
|
51
|
+
};
|
|
52
|
+
}, {
|
|
53
|
+
wrapper: string[];
|
|
54
|
+
responseMessage: string[];
|
|
55
|
+
closeButton: string[];
|
|
56
|
+
}, import("tailwind-variants").TVReturnType<{
|
|
57
|
+
animation: {
|
|
58
|
+
bounce: {
|
|
59
|
+
wrapper: string[];
|
|
60
|
+
};
|
|
61
|
+
none: {};
|
|
62
|
+
};
|
|
63
|
+
}, {
|
|
64
|
+
wrapper: string[];
|
|
65
|
+
responseMessage: string[];
|
|
66
|
+
closeButton: string[];
|
|
67
|
+
}, undefined, import("tailwind-variants/dist/config").TVConfig<{
|
|
68
|
+
animation: {
|
|
69
|
+
bounce: {
|
|
70
|
+
wrapper: string[];
|
|
71
|
+
};
|
|
72
|
+
none: {};
|
|
73
|
+
};
|
|
74
|
+
}, {
|
|
75
|
+
animation: {
|
|
76
|
+
bounce: {
|
|
77
|
+
wrapper: string[];
|
|
78
|
+
};
|
|
79
|
+
none: {};
|
|
80
|
+
};
|
|
81
|
+
}>, unknown, unknown, undefined>>;
|
|
24
82
|
/**
|
|
25
83
|
* @deprecated `FlashMessage` は気づきにくいため、安易な使用はお勧めしません。`NotificationBar` や `Dialog` の使用を検討してください。
|
|
26
84
|
*/
|
|
@@ -1,20 +1,39 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { useTheme } from '../../hooks/useTheme';
|
|
1
|
+
import React, { useEffect, useMemo } from 'react';
|
|
2
|
+
import { tv } from 'tailwind-variants';
|
|
4
3
|
import { Button } from '../Button';
|
|
5
|
-
import {
|
|
4
|
+
import { FaXmarkIcon } from '../Icon';
|
|
6
5
|
import { ResponseMessage } from '../ResponseMessage';
|
|
7
|
-
import { useClassNames } from './useClassNames';
|
|
8
6
|
export const messageTypes = ['success', 'info', 'warning', 'error'];
|
|
9
|
-
export const animationTypes = ['bounce', 'fade', 'none'];
|
|
10
7
|
export const roles = ['alert', 'status'];
|
|
11
8
|
const REMOVE_DELAY = 8000;
|
|
9
|
+
const flashMessage = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
wrapper: [
|
|
12
|
+
'smarthr-ui-FlashMessage',
|
|
13
|
+
'shr-border-shorthand shr-fixed shr-bottom-0.5 shr-left-0.5 shr-z-flash-message shr-flex shr-items-center shr-gap-0.5 shr-rounded-m shr-bg-white shr-p-1 shr-shadow-layer-4',
|
|
14
|
+
'[&_.smarthr-ui-Icon-withText]:-shr-my-0.25 [&_.smarthr-ui-Icon-withText]:shr-grow',
|
|
15
|
+
/* Icon + margin + 8文字 + margin + Button(border + padding + fontSize) */
|
|
16
|
+
'shr-min-w-[calc(1em+theme(spacing[0.5])+8em+theme(spacing[0.5])+(theme(borderWidth.DEFAULT)*2)+(theme(spacing[0.5])*2)+theme(fontSize.sm))]',
|
|
17
|
+
],
|
|
18
|
+
responseMessage: ['smarthr-ui-FlashMessage-icon', ''],
|
|
19
|
+
closeButton: ['smarthr-ui-FlashMessage-button', '-shr-my-0.5 -shr-mr-0.5'],
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
animation: {
|
|
23
|
+
bounce: {
|
|
24
|
+
wrapper: [
|
|
25
|
+
'shr-animate-[flash-message-bounce_1s_0s_both]',
|
|
26
|
+
'motion-reduce:shr-animate-none',
|
|
27
|
+
],
|
|
28
|
+
},
|
|
29
|
+
none: {},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
12
33
|
/**
|
|
13
34
|
* @deprecated `FlashMessage` は気づきにくいため、安易な使用はお勧めしません。`NotificationBar` や `Dialog` の使用を検討してください。
|
|
14
35
|
*/
|
|
15
|
-
export const FlashMessage = ({ visible, type, text, animation = 'bounce', role = 'alert', className
|
|
16
|
-
const theme = useTheme();
|
|
17
|
-
const classNames = useClassNames();
|
|
36
|
+
export const FlashMessage = ({ visible, type, text, animation = 'bounce', role = 'alert', className, onClose, autoClose = true, ...rest }) => {
|
|
18
37
|
useEffect(() => {
|
|
19
38
|
if (!visible || !autoClose) {
|
|
20
39
|
return;
|
|
@@ -24,96 +43,19 @@ export const FlashMessage = ({ visible, type, text, animation = 'bounce', role =
|
|
|
24
43
|
clearTimeout(timerId);
|
|
25
44
|
};
|
|
26
45
|
}, [autoClose, onClose, visible]);
|
|
46
|
+
const { wrapperStyle, responseMessageStyle, closeButtonStyle } = useMemo(() => {
|
|
47
|
+
const { wrapper, responseMessage, closeButton } = flashMessage();
|
|
48
|
+
return {
|
|
49
|
+
wrapperStyle: wrapper({ animation, className }),
|
|
50
|
+
responseMessageStyle: responseMessage(),
|
|
51
|
+
closeButtonStyle: closeButton(),
|
|
52
|
+
};
|
|
53
|
+
}, [animation, className]);
|
|
27
54
|
if (!visible)
|
|
28
55
|
return null;
|
|
29
|
-
return (React.createElement(
|
|
30
|
-
React.createElement(ResponseMessage, { type: type, iconGap: 0.5, className:
|
|
31
|
-
React.createElement(
|
|
32
|
-
React.createElement(
|
|
56
|
+
return (React.createElement("div", { ...rest, className: wrapperStyle, role: role },
|
|
57
|
+
React.createElement(ResponseMessage, { type: type, iconGap: 0.5, className: responseMessageStyle }, text),
|
|
58
|
+
React.createElement(Button, { className: closeButtonStyle, onClick: onClose, size: "s", square: true },
|
|
59
|
+
React.createElement(FaXmarkIcon, { alt: "\u9589\u3058\u308B" }))));
|
|
33
60
|
};
|
|
34
|
-
const bounceAnimation = keyframes `
|
|
35
|
-
from,
|
|
36
|
-
20%,
|
|
37
|
-
53%,
|
|
38
|
-
80%,
|
|
39
|
-
to {
|
|
40
|
-
animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
|
|
41
|
-
transform: translate3d(0, 0, 0);
|
|
42
|
-
}
|
|
43
|
-
40%,
|
|
44
|
-
43% {
|
|
45
|
-
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
|
46
|
-
transform: translate3d(0, -30px, 0);
|
|
47
|
-
}
|
|
48
|
-
70% {
|
|
49
|
-
animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
|
|
50
|
-
transform: translate3d(0, -15px, 0);
|
|
51
|
-
}
|
|
52
|
-
90% {
|
|
53
|
-
transform: translate3d(0, -4px, 0);
|
|
54
|
-
}
|
|
55
|
-
`;
|
|
56
|
-
const fadeAnimation = keyframes `
|
|
57
|
-
from {
|
|
58
|
-
opacity: 0;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
to {
|
|
62
|
-
opacity: 1;
|
|
63
|
-
}
|
|
64
|
-
`;
|
|
65
|
-
const Wrapper = styled.div `
|
|
66
|
-
${({ themes, animation }) => {
|
|
67
|
-
const { border, fontSize, space, radius, color, zIndex, shadow } = themes;
|
|
68
|
-
let keyframe = bounceAnimation;
|
|
69
|
-
switch (animation) {
|
|
70
|
-
case 'bounce':
|
|
71
|
-
keyframe = bounceAnimation;
|
|
72
|
-
break;
|
|
73
|
-
case 'fade':
|
|
74
|
-
keyframe = fadeAnimation;
|
|
75
|
-
break;
|
|
76
|
-
case 'none':
|
|
77
|
-
keyframe = fadeAnimation;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
return css `
|
|
81
|
-
z-index: ${zIndex.FLASH_MESSAGE};
|
|
82
|
-
position: fixed;
|
|
83
|
-
bottom: ${space(0.5)};
|
|
84
|
-
left: ${space(0.5)};
|
|
85
|
-
|
|
86
|
-
display: flex;
|
|
87
|
-
align-items: center;
|
|
88
|
-
gap: ${space(0.5)};
|
|
89
|
-
|
|
90
|
-
box-shadow: ${shadow.LAYER4};
|
|
91
|
-
border: ${border.shorthand};
|
|
92
|
-
border-radius: ${radius.m};
|
|
93
|
-
background-color: ${color.WHITE};
|
|
94
|
-
padding: ${space(1)};
|
|
95
|
-
|
|
96
|
-
/* Icon + margin + 8文字 + margin + Button(border + padding + fontSize) */
|
|
97
|
-
min-width: calc(
|
|
98
|
-
1em + ${space(0.5)} + 8em + ${space(0.5)} + (${border.lineWidth} * 2) + (${space(0.5)} * 2) +
|
|
99
|
-
${fontSize.S}
|
|
100
|
-
);
|
|
101
|
-
animation: ${keyframe} ${animation === 'none' ? '0.01s' : '1s'} 0s both;
|
|
102
|
-
|
|
103
|
-
@media (prefers-reduced-motion) {
|
|
104
|
-
animation-duration: 0.01s;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.smarthr-ui-Icon-withText {
|
|
108
|
-
flex-grow: 1;
|
|
109
|
-
|
|
110
|
-
margin-block: ${space(-0.25)};
|
|
111
|
-
}
|
|
112
|
-
`;
|
|
113
|
-
}}
|
|
114
|
-
`;
|
|
115
|
-
const CloseButton = styled(Button)(({ themes: { space } }) => css `
|
|
116
|
-
margin-block: ${space(-0.5)};
|
|
117
|
-
margin-inline-end: ${space(-0.5)};
|
|
118
|
-
`);
|
|
119
61
|
//# sourceMappingURL=FlashMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlashMessage.js","sourceRoot":"","sources":["../../../src/components/FlashMessage/FlashMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"FlashMessage.js","sourceRoot":"","sources":["../../../src/components/FlashMessage/FlashMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA2C,SAAS,EAA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,EAAE,YAAY,CAAC,CAAA;QAEjD,OAAO,GAAG,EAAE;YACV,YAAY,CAAC,OAAO,CAAC,CAAA;QACvB,CAAC,CAAA;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAA;IAEjC,MAAM,EAAE,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,GAAG,OAAO,CAAC,GAAG,EAAE;QAC5E,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,GAAG,YAAY,EAAE,CAAA;QAChE,OAAO;YACL,YAAY,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;YAC/C,oBAAoB,EAAE,eAAe,EAAE;YACvC,gBAAgB,EAAE,WAAW,EAAE;SAChC,CAAA;IACH,CAAC,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,CAAA;IAE1B,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IAEzB,OAAO,CACL,gCAAS,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,IAAI;QAChD,oBAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,oBAAoB,IACvE,IAAI,CACW;QAClB,oBAAC,MAAM,IAAC,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,GAAG,EAAC,MAAM;YACpE,oBAAC,WAAW,IAAC,GAAG,EAAC,oBAAK,GAAG,CAClB,CACL,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
export declare function useFlashMessageList(): {
|
|
6
6
|
enqueueMessage: (message: {
|
|
7
7
|
type: "error" | "success" | "warning" | "info";
|
|
8
|
-
animation?: "none" | "bounce" |
|
|
8
|
+
animation?: "none" | "bounce" | undefined;
|
|
9
9
|
text: import("react").ReactNode;
|
|
10
|
-
className?: string | undefined;
|
|
11
10
|
role?: "status" | "alert" | undefined;
|
|
12
11
|
autoClose?: boolean | undefined;
|
|
13
12
|
}) => void;
|
|
@@ -1,5 +1,36 @@
|
|
|
1
|
-
import React, { ComponentProps } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import React, { ComponentProps, ComponentPropsWithoutRef, PropsWithChildren, ReactNode } from 'react';
|
|
2
|
+
import { HeadingTypes } from '../Heading';
|
|
3
|
+
import { StatusLabel } from '../StatusLabel';
|
|
4
|
+
import type { Gap } from '../../types';
|
|
5
|
+
type StatusLabelProps = ComponentProps<typeof StatusLabel>;
|
|
6
|
+
type Props = PropsWithChildren<{
|
|
7
|
+
/** グループのタイトル名 */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** タイトルの見出しのタイプ */
|
|
10
|
+
titleType?: HeadingTypes;
|
|
11
|
+
/** タイトルの見出しを視覚的に隠すかどうか */
|
|
12
|
+
dangerouslyTitleHidden?: boolean;
|
|
13
|
+
/** label 要素に適用する `htmlFor` 値 */
|
|
14
|
+
htmlFor?: string;
|
|
15
|
+
/** label 要素に適用する `id` 値 */
|
|
16
|
+
labelId?: string;
|
|
17
|
+
/** タイトル群と子要素の間の間隔調整用(基本的には不要) */
|
|
18
|
+
innerMargin?: Gap;
|
|
19
|
+
/** タイトルの隣に表示する `StatusLabel` の Props の配列 */
|
|
20
|
+
statusLabelProps?: StatusLabelProps | StatusLabelProps[];
|
|
21
|
+
/** タイトルの下に表示するヘルプメッセージ */
|
|
22
|
+
helpMessage?: ReactNode;
|
|
23
|
+
/** タイトルの下に表示する入力例 */
|
|
24
|
+
exampleMessage?: ReactNode;
|
|
25
|
+
/** タイトルの下に表示するエラーメッセージ */
|
|
26
|
+
errorMessages?: ReactNode | ReactNode[];
|
|
27
|
+
/** フォームコントロールの下に表示する補足メッセージ */
|
|
28
|
+
supplementaryMessage?: ReactNode;
|
|
29
|
+
/** `true` のとき、文字色を `TEXT_DISABLED` にする */
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
as?: string | React.ComponentType<any>;
|
|
32
|
+
}>;
|
|
33
|
+
type ElementProps = Omit<ComponentPropsWithoutRef<'div'>, keyof Props | 'aria-labelledby'>;
|
|
34
|
+
export declare const ActualFormControl: React.FC<Props & ElementProps>;
|
|
35
|
+
export declare const FormControl: React.FC<Omit<Props & ElementProps, 'as'>>;
|
|
5
36
|
export {};
|