@dotss/ui 0.0.10 → 0.0.12
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/Accordion/Accordion.cjs +13 -7
- package/Accordion/Accordion.d.ts +2 -0
- package/Accordion/Accordion.es.js +86 -65
- package/Autocomplete/Autocomplete.cjs +1 -1
- package/Autocomplete/Autocomplete.d.ts +1 -1
- package/Autocomplete/Autocomplete.es.js +235 -80
- package/BottomSheet/BottomSheet.cjs +5 -5
- package/BottomSheet/BottomSheet.d.ts +3 -0
- package/BottomSheet/BottomSheet.es.js +88 -70
- package/BottomSheet/BottomSheetText/BottomSheetText.cjs +2 -2
- package/BottomSheet/BottomSheetText/BottomSheetText.es.js +18 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.cjs +6 -6
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.d.ts +2 -1
- package/BottomSheet/BottomSheetTitle/BottomSheetTitle.es.js +26 -15
- package/Button/Button.cjs +6 -6
- package/Button/Button.es.js +35 -29
- package/ChainPicker/ChainPicker.cjs +16 -6
- package/ChainPicker/ChainPicker.d.ts +4 -2
- package/ChainPicker/ChainPicker.es.js +155 -110
- package/ChainPicker/ChainPicker.stories.d.ts +1 -1
- package/Checkbox/Checkbox.cjs +3 -3
- package/Checkbox/Checkbox.es.js +12 -10
- package/CircularProgressIndicator/CircularProgressIndicator.cjs +5 -5
- package/CircularProgressIndicator/CircularProgressIndicator.es.js +25 -22
- package/DatePicker/DatePicker.cjs +37 -20
- package/DatePicker/DatePicker.d.ts +2 -1
- package/DatePicker/DatePicker.es.js +345 -320
- package/DatePicker/DatePicker.stories.d.ts +1 -0
- package/DatePicker/EventDot/EventDot.cjs +8 -0
- package/DatePicker/EventDot/EventDot.d.ts +8 -0
- package/DatePicker/EventDot/EventDot.es.js +19 -0
- package/DatePicker/EventDot/index.cjs +1 -0
- package/DatePicker/EventDot/index.d.ts +3 -0
- package/DatePicker/EventDot/index.es.js +4 -0
- package/DatePicker/EventDotGroup/EventDotGroup.cjs +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.d.ts +8 -0
- package/DatePicker/EventDotGroup/EventDotGroup.es.js +39 -0
- package/DatePicker/EventDotGroup/index.cjs +1 -0
- package/DatePicker/EventDotGroup/index.d.ts +3 -0
- package/DatePicker/EventDotGroup/index.es.js +4 -0
- package/DatePicker/index.cjs +1 -1
- package/DatePicker/index.d.ts +2 -0
- package/DatePicker/index.es.js +6 -2
- package/Dialog/Dialog.cjs +2 -2
- package/Dialog/Dialog.d.ts +2 -0
- package/Dialog/Dialog.es.js +45 -40
- package/Dialog/Dialog.stories.d.ts +10 -0
- package/Dialog/DialogText/DialogText.cjs +1 -1
- package/Dialog/DialogText/DialogText.es.js +1 -1
- package/Dialog/DialogTitle/DialogTitle.cjs +4 -4
- package/Dialog/DialogTitle/DialogTitle.d.ts +2 -1
- package/Dialog/DialogTitle/DialogTitle.es.js +17 -17
- package/FocusBoundary/FocusBoundary.cjs +1 -1
- package/FocusBoundary/FocusBoundary.d.ts +3 -1
- package/FocusBoundary/FocusBoundary.es.js +49 -42
- package/FormControlText/FormControlText.cjs +7 -5
- package/FormControlText/FormControlText.d.ts +2 -0
- package/FormControlText/FormControlText.es.js +50 -40
- package/Icon/Icon.cjs +1 -1
- package/Icon/Icon.es.js +1 -1
- package/IconButton/IconButton.cjs +8 -8
- package/IconButton/IconButton.es.js +32 -25
- package/LineProgressIndicator/LineProgressIndicator.cjs +6 -6
- package/LineProgressIndicator/LineProgressIndicator.es.js +34 -22
- package/Menu/Menu.cjs +16 -16
- package/Menu/Menu.d.ts +3 -2
- package/Menu/Menu.es.js +115 -81
- package/Menu/Menu.stories.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.cjs +14 -7
- package/Menu/MenuBlock/MenuBlock.d.ts +1 -0
- package/Menu/MenuBlock/MenuBlock.es.js +47 -35
- package/Menu/MenuButton/MenuButton.cjs +1 -0
- package/Menu/MenuButton/MenuButton.d.ts +10 -0
- package/Menu/MenuButton/MenuButton.es.js +44 -0
- package/Menu/MenuButton/index.cjs +1 -0
- package/Menu/MenuButton/index.d.ts +3 -0
- package/Menu/MenuButton/index.es.js +4 -0
- package/Menu/index.cjs +1 -1
- package/Menu/index.d.ts +1 -0
- package/Menu/index.es.js +4 -2
- package/NumberKeypad/NumberKeypad.cjs +2 -2
- package/NumberKeypad/NumberKeypad.es.js +18 -16
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.cjs +1 -1
- package/NumberKeypad/NumberKeypadBlock/NumberKeypadBlock.es.js +10 -1
- package/PageControl/PageControl.cjs +16 -5
- package/PageControl/PageControl.d.ts +3 -0
- package/PageControl/PageControl.es.js +77 -24
- package/PageControl/PageControl.stories.d.ts +1 -0
- package/Radio/Radio.cjs +3 -3
- package/Radio/Radio.es.js +22 -20
- package/RadioGroup/RadioGroup.cjs +1 -0
- package/RadioGroup/RadioGroup.d.ts +8 -0
- package/RadioGroup/RadioGroup.es.js +28 -0
- package/RadioGroup/RadioGroup.stories.d.ts +14 -0
- package/RadioGroup/index.cjs +1 -0
- package/RadioGroup/index.d.ts +3 -0
- package/RadioGroup/index.es.js +4 -0
- package/SegmentedButton/SegmentedButton.cjs +14 -3
- package/SegmentedButton/SegmentedButton.es.js +108 -34
- package/Select/Select.cjs +4 -4
- package/Select/Select.es.js +95 -86
- package/Slider/Slider.cjs +27 -12
- package/Slider/Slider.d.ts +1 -0
- package/Slider/Slider.es.js +177 -90
- package/Switch/Switch.cjs +28 -11
- package/Switch/Switch.d.ts +2 -0
- package/Switch/Switch.es.js +185 -65
- package/Switch/Switch.stories.d.ts +1 -0
- package/Tab/Tab.es.js +2 -4
- package/TextArea/TextArea.cjs +42 -34
- package/TextArea/TextArea.es.js +116 -82
- package/TextArea/TextArea.stories.d.ts +1 -1
- package/TextField/TextField.cjs +29 -13
- package/TextField/TextField.d.ts +2 -1
- package/TextField/TextField.es.js +122 -79
- package/TextField/TextField.stories.d.ts +1 -0
- package/Tooltip/Tooltip.cjs +7 -6
- package/Tooltip/Tooltip.d.ts +8 -3
- package/Tooltip/Tooltip.es.js +248 -146
- package/Tooltip/Tooltip.stories.d.ts +1 -0
- package/hooks/index.cjs +1 -1
- package/hooks/index.d.ts +3 -0
- package/hooks/index.es.js +7 -1
- package/hooks/useCheckHasFocus/useCheckHasFocus.cjs +1 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.d.ts +9 -0
- package/hooks/useCheckHasFocus/useCheckHasFocus.es.js +21 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.cjs +1 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.d.ts +4 -0
- package/hooks/useCheckKeyboardMode/useCheckKeyboardMode.es.js +30 -0
- package/hooks/useFocusBoundary/useFocusBoundary.cjs +1 -0
- package/hooks/useFocusBoundary/useFocusBoundary.d.ts +12 -0
- package/hooks/useFocusBoundary/useFocusBoundary.es.js +63 -0
- package/index.cjs +1 -1
- package/index.d.ts +2 -1
- package/index.es.js +97 -90
- package/package.json +3 -3
- package/resources/tictoccroc/icons/fill/certified-fill.svg-B_RVx6K_.cjs +1 -0
- package/resources/tictoccroc/icons/fill/certified-fill.svg-CK7UqYft.js +5 -0
- package/resources/tictoccroc/icons/fill/index.d.ts +3 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-DfSHAnsd.js +5 -0
- package/resources/tictoccroc/icons/fill/location-fill.svg-Die9mxQH.cjs +1 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-CItD_2L1.js +5 -0
- package/resources/tictoccroc/icons/fill/send-fill.svg-D197Lwl0.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-BmqvB_n6.cjs +1 -0
- package/resources/tictoccroc/icons/index.ts-CzTh-XsD.js +228 -0
- package/resources/tictoccroc/icons/line/index.d.ts +4 -0
- package/resources/tictoccroc/icons/line/list-line.svg-r5d5htjN.cjs +1 -0
- package/resources/tictoccroc/icons/line/list-line.svg-yFfhZxUp.js +5 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-BdyaJ1t_.cjs +1 -0
- package/resources/tictoccroc/icons/line/monthly-line.svg-DY5-Xv34.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-B4rfJrsO.js +5 -0
- package/resources/tictoccroc/icons/line/review-line.svg-DYUuUybx.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BCO-LS_a.cjs +1 -0
- package/resources/tictoccroc/icons/line/weekly-line.svg-BUPmmgeE.js +5 -0
- package/utils/getIconLabel/getIconLabel.cjs +1 -1
- package/utils/getIconLabel/getIconLabel.es.js +8 -1
- package/utils/getSibling/getSibling.es.js +1 -2
- package/resources/tictoccroc/icons/index.ts-CarI_z7q.js +0 -214
- package/resources/tictoccroc/icons/index.ts-IVJAK4qr.cjs +0 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@emotion/react/jsx-runtime"),r=require("@emotion/styled"),u=require("../../utils/getPaletteColor/getPaletteColor.cjs"),n=e=>e&&e.__esModule?e:{default:e},l=n(r),d=l.default.span`
|
|
2
|
+
width: 6px;
|
|
3
|
+
min-width: 6px;
|
|
4
|
+
height: 6px;
|
|
5
|
+
min-height: 6px;
|
|
6
|
+
border-radius: 50%;
|
|
7
|
+
background-color: ${({theme:e,color:t="grey.100"})=>u.default(t,{theme:e})};
|
|
8
|
+
`;function i(e){return o.jsx(d,{...e})}exports.default=i;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { Color, GeneralComponentProps } from '../../typings/component';
|
|
3
|
+
|
|
4
|
+
export interface EventDotProps extends GeneralComponentProps<Omit<HTMLAttributes<HTMLSpanElement>, 'color'>> {
|
|
5
|
+
color: Color;
|
|
6
|
+
}
|
|
7
|
+
declare function EventDot(props: EventDotProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default EventDot;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import e from "@emotion/styled";
|
|
3
|
+
import i from "../../utils/getPaletteColor/getPaletteColor.es.js";
|
|
4
|
+
const n = e.span`
|
|
5
|
+
width: 6px;
|
|
6
|
+
min-width: 6px;
|
|
7
|
+
height: 6px;
|
|
8
|
+
min-height: 6px;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
background-color: ${({ theme: t, color: o = "grey.100" }) => i(o, {
|
|
11
|
+
theme: t
|
|
12
|
+
})};
|
|
13
|
+
`;
|
|
14
|
+
function a(t) {
|
|
15
|
+
return /* @__PURE__ */ r(n, { ...t });
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
a as default
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./EventDot.cjs");exports.default=e.default;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("@emotion/react/jsx-runtime"),i=require("react"),a=require("@emotion/styled"),d=require("../EventDot/EventDot.cjs"),f=e=>e&&e.__esModule?e:{default:e},u=f(a),h=u.default.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
gap: ${({theme:{spacing:e}})=>e.content(.5)}px;
|
|
5
|
+
max-height: 6px;
|
|
6
|
+
`,p=u.default.span`
|
|
7
|
+
${({theme:{palette:{grey:e},typography:t}})=>{const{size:o,weight:n,lineHeight:r,letterSpacing:s}=t.c5R;return{fontSize:o,fontWeight:n,lineHeight:r,letterSpacing:s,color:e[50]}}};
|
|
8
|
+
`;function g({children:e,limit:t=4,...o}){const n=i.Children.toArray(e).filter(i.isValidElement).filter(c=>c.type===d.default),r=n.length,s=r>t;return l.jsxs(h,{...o,children:[i.Children.toArray(n).slice(0,t),s&&l.jsxs(p,{children:["+",r-t]})]})}exports.default=g;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { GeneralComponentProps } from '../../typings/component';
|
|
3
|
+
|
|
4
|
+
export interface EventGroupProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
|
+
limit?: number;
|
|
6
|
+
}
|
|
7
|
+
declare function EventGroup({ children, limit, ...props }: EventGroupProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default EventGroup;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsxs as s } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Children as l, isValidElement as a } from "react";
|
|
3
|
+
import c from "@emotion/styled";
|
|
4
|
+
import m from "../EventDot/EventDot.es.js";
|
|
5
|
+
const f = c.div`
|
|
6
|
+
display: flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: ${({ theme: { spacing: t } }) => t.content(0.5)}px;
|
|
9
|
+
max-height: 6px;
|
|
10
|
+
`, h = c.span`
|
|
11
|
+
${({
|
|
12
|
+
theme: {
|
|
13
|
+
palette: { grey: t },
|
|
14
|
+
typography: e
|
|
15
|
+
}
|
|
16
|
+
}) => {
|
|
17
|
+
const { size: r, weight: n, lineHeight: o, letterSpacing: i } = e.c5R;
|
|
18
|
+
return {
|
|
19
|
+
fontSize: r,
|
|
20
|
+
fontWeight: n,
|
|
21
|
+
lineHeight: o,
|
|
22
|
+
letterSpacing: i,
|
|
23
|
+
color: t[50]
|
|
24
|
+
};
|
|
25
|
+
}};
|
|
26
|
+
`;
|
|
27
|
+
function y({ children: t, limit: e = 4, ...r }) {
|
|
28
|
+
const n = l.toArray(t).filter(a).filter((p) => p.type === m), o = n.length, i = o > e;
|
|
29
|
+
return /* @__PURE__ */ s(f, { ...r, children: [
|
|
30
|
+
l.toArray(n).slice(0, e),
|
|
31
|
+
i && /* @__PURE__ */ s(h, { children: [
|
|
32
|
+
"+",
|
|
33
|
+
o - e
|
|
34
|
+
] })
|
|
35
|
+
] });
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
y as default
|
|
39
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./EventDotGroup.cjs");exports.default=e.default;
|
package/DatePicker/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./DatePicker.cjs");exports.default=e.default;
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./DatePicker.cjs"),t=require("./EventDot/EventDot.cjs"),u=require("./EventDotGroup/EventDotGroup.cjs");exports.default=e.default;exports.EventDot=t.default;exports.EventDotGroup=u.default;
|
package/DatePicker/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { DateFormatter, DatePickerValue, DateValue, default as DatePicker } from './DatePicker';
|
|
2
2
|
|
|
3
3
|
export type { DatePickerValue, DateValue, DateFormatter };
|
|
4
|
+
export { default as EventDot } from './EventDot';
|
|
5
|
+
export { default as EventDotGroup } from './EventDotGroup';
|
|
4
6
|
export default DatePicker;
|
package/DatePicker/index.es.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import e from "./DatePicker.es.js";
|
|
2
|
+
import { default as a } from "./EventDot/EventDot.es.js";
|
|
3
|
+
import { default as p } from "./EventDotGroup/EventDotGroup.es.js";
|
|
2
4
|
export {
|
|
3
|
-
|
|
5
|
+
a as EventDot,
|
|
6
|
+
p as EventDotGroup,
|
|
7
|
+
e as default
|
|
4
8
|
};
|
package/Dialog/Dialog.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@emotion/react/jsx-runtime"),t=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("@emotion/react/jsx-runtime"),t=require("react"),O=require("../Backdrop/Backdrop.cjs"),b=require("../Flexbox/Flexbox.cjs"),A=require("../FocusBoundary/FocusBoundary.cjs"),B=require("@emotion/styled"),H=e=>e&&e.__esModule?e:{default:e},L=H(B),P=L.default.div`
|
|
2
2
|
position: absolute;
|
|
3
3
|
top: 50%;
|
|
4
4
|
left: 50%;
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
${({open:e})=>e?{transform:"translate3d(-50%, -50%, 0)"}:{transform:"translate3d(-50%, -50%, 0) scale(0.97)"}};
|
|
18
18
|
|
|
19
19
|
${({fullScreen:e})=>e?{width:"100%",height:"100%",maxWidth:"100%",maxHeight:"100%",borderRadius:0}:null}
|
|
20
|
-
`,
|
|
20
|
+
`,K=t.forwardRef(function({children:h,open:r,onClose:s,transitionDuration:l=200,fullWidth:x=!0,fullScreen:a=!1,maxWidth:p=320,maxHeight:y=438,inlineCSS:v,backdropProps:w,statusBarColor:k="transparent",systemNavigationBarColor:$="#FFFFFF",disableFocusBoundary:q=!1,hideStatusBar:F=!1,hideSystemNavigationBar:R=!1,returnFocus:S=!0,initialFocusId:j,...T},_){var c,f,m,g;const[E,u]=t.useState(!1),d=t.useRef(null),i=t.useRef(),C=n=>n.stopPropagation(),D=((f=(c=d.current)==null?void 0:c.querySelector('[id^="dialog-title"]'))==null?void 0:f.getAttribute("id"))||void 0,I=((g=(m=d.current)==null?void 0:m.querySelector('[id^="dialog-text"]'))==null?void 0:g.getAttribute("id"))||void 0;return t.useEffect(()=>{r?(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{u(!0)},100)):u(!1)},[r]),t.useEffect(()=>{const n=M=>{M.key==="Escape"&&r&&s&&s()};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[r,s]),t.useEffect(()=>()=>{i.current&&clearTimeout(i.current)},[]),o.jsx(O.default,{ref:d,open:r,onClose:s,transitionDuration:l,centered:!a,fullScreen:a,...w,children:o.jsx(P,{ref:_,role:"dialog","aria-modal":"true","aria-labelledby":D,"aria-describedby":I,open:E,transitionDuration:l,fullWidth:x,fullScreen:a,maxWidth:p,maxHeight:y,onClick:C,...T,css:v,children:o.jsxs(A.default,{active:r,disabled:q,returnFocus:S,initialFocusId:j,inlineCSS:{flex:1,overflowY:"auto"},children:[a&&!F&&o.jsx(b.default,{inlineCSS:{minHeight:"var(--status-bar-height, 0px)",backgroundColor:k}}),h,a&&!R&&o.jsx(b.default,{inlineCSS:{minHeight:"var(--system-navigation-bar-height, 0px)",backgroundColor:$}})]})})})});exports.default=K;
|
package/Dialog/Dialog.d.ts
CHANGED
|
@@ -16,6 +16,8 @@ export interface DialogProps extends GeneralComponentProps<HTMLAttributes<HTMLDi
|
|
|
16
16
|
systemNavigationBarColor?: string;
|
|
17
17
|
hideStatusBar?: boolean;
|
|
18
18
|
hideSystemNavigationBar?: boolean;
|
|
19
|
+
returnFocus?: boolean;
|
|
20
|
+
initialFocusId?: string;
|
|
19
21
|
}
|
|
20
22
|
declare const Dialog: import('react').ForwardRefExoticComponent<DialogProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
21
23
|
export default Dialog;
|
package/Dialog/Dialog.es.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as n, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
1
|
+
import { jsx as n, jsxs as L } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as O, useState as K, useRef as h, useEffect as s } from "react";
|
|
3
|
+
import P from "../Backdrop/Backdrop.es.js";
|
|
4
4
|
import g from "../Flexbox/Flexbox.es.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
const
|
|
5
|
+
import Y from "../FocusBoundary/FocusBoundary.es.js";
|
|
6
|
+
import z from "@emotion/styled";
|
|
7
|
+
const G = z.div`
|
|
8
8
|
position: absolute;
|
|
9
9
|
top: 50%;
|
|
10
10
|
left: 50%;
|
|
@@ -37,7 +37,7 @@ const Y = P.div`
|
|
|
37
37
|
maxHeight: "100%",
|
|
38
38
|
borderRadius: 0
|
|
39
39
|
} : null}
|
|
40
|
-
`,
|
|
40
|
+
`, W = O(function({
|
|
41
41
|
children: b,
|
|
42
42
|
open: t,
|
|
43
43
|
onClose: i,
|
|
@@ -45,66 +45,71 @@ const Y = P.div`
|
|
|
45
45
|
fullWidth: x = !0,
|
|
46
46
|
fullScreen: r = !1,
|
|
47
47
|
maxWidth: y = 320,
|
|
48
|
-
maxHeight:
|
|
49
|
-
inlineCSS:
|
|
50
|
-
backdropProps:
|
|
48
|
+
maxHeight: v = 438,
|
|
49
|
+
inlineCSS: w,
|
|
50
|
+
backdropProps: k,
|
|
51
51
|
statusBarColor: $ = "transparent",
|
|
52
52
|
systemNavigationBarColor: F = "#FFFFFF",
|
|
53
|
-
disableFocusBoundary:
|
|
54
|
-
hideStatusBar:
|
|
53
|
+
disableFocusBoundary: S = !1,
|
|
54
|
+
hideStatusBar: T = !1,
|
|
55
55
|
hideSystemNavigationBar: R = !1,
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
returnFocus: C = !0,
|
|
57
|
+
initialFocusId: E,
|
|
58
|
+
...I
|
|
59
|
+
}, j) {
|
|
60
|
+
var c, f, m, p;
|
|
61
|
+
const [q, u] = K(!1), d = h(null), o = h(), A = (a) => a.stopPropagation(), B = ((f = (c = d.current) == null ? void 0 : c.querySelector('[id^="dialog-title"]')) == null ? void 0 : f.getAttribute("id")) || void 0, D = ((p = (m = d.current) == null ? void 0 : m.querySelector('[id^="dialog-text"]')) == null ? void 0 : p.getAttribute("id")) || void 0;
|
|
62
|
+
return s(() => {
|
|
61
63
|
t ? (o.current && clearTimeout(o.current), o.current = setTimeout(() => {
|
|
62
|
-
|
|
63
|
-
}, 100)) :
|
|
64
|
-
}, [t]),
|
|
65
|
-
const a = (
|
|
66
|
-
|
|
64
|
+
u(!0);
|
|
65
|
+
}, 100)) : u(!1);
|
|
66
|
+
}, [t]), s(() => {
|
|
67
|
+
const a = (H) => {
|
|
68
|
+
H.key === "Escape" && t && i && i();
|
|
67
69
|
};
|
|
68
70
|
return document.addEventListener("keydown", a), () => document.removeEventListener("keydown", a);
|
|
69
|
-
}, [t, i]),
|
|
71
|
+
}, [t, i]), s(() => () => {
|
|
70
72
|
o.current && clearTimeout(o.current);
|
|
71
73
|
}, []), /* @__PURE__ */ n(
|
|
72
|
-
|
|
74
|
+
P,
|
|
73
75
|
{
|
|
74
|
-
ref:
|
|
76
|
+
ref: d,
|
|
75
77
|
open: t,
|
|
76
78
|
onClose: i,
|
|
77
79
|
transitionDuration: l,
|
|
78
80
|
centered: !r,
|
|
79
81
|
fullScreen: r,
|
|
80
|
-
...
|
|
82
|
+
...k,
|
|
81
83
|
children: /* @__PURE__ */ n(
|
|
82
|
-
|
|
84
|
+
G,
|
|
83
85
|
{
|
|
84
|
-
ref:
|
|
86
|
+
ref: j,
|
|
85
87
|
role: "dialog",
|
|
86
|
-
"aria-
|
|
87
|
-
"aria-
|
|
88
|
-
|
|
88
|
+
"aria-modal": "true",
|
|
89
|
+
"aria-labelledby": B,
|
|
90
|
+
"aria-describedby": D,
|
|
91
|
+
open: q,
|
|
89
92
|
transitionDuration: l,
|
|
90
93
|
fullWidth: x,
|
|
91
94
|
fullScreen: r,
|
|
92
95
|
maxWidth: y,
|
|
93
|
-
maxHeight:
|
|
94
|
-
onClick:
|
|
95
|
-
...
|
|
96
|
-
css:
|
|
97
|
-
children: /* @__PURE__ */
|
|
98
|
-
|
|
96
|
+
maxHeight: v,
|
|
97
|
+
onClick: A,
|
|
98
|
+
...I,
|
|
99
|
+
css: w,
|
|
100
|
+
children: /* @__PURE__ */ L(
|
|
101
|
+
Y,
|
|
99
102
|
{
|
|
100
103
|
active: t,
|
|
101
|
-
disabled:
|
|
104
|
+
disabled: S,
|
|
105
|
+
returnFocus: C,
|
|
106
|
+
initialFocusId: E,
|
|
102
107
|
inlineCSS: {
|
|
103
108
|
flex: 1,
|
|
104
109
|
overflowY: "auto"
|
|
105
110
|
},
|
|
106
111
|
children: [
|
|
107
|
-
r && !
|
|
112
|
+
r && !T && /* @__PURE__ */ n(
|
|
108
113
|
g,
|
|
109
114
|
{
|
|
110
115
|
inlineCSS: {
|
|
@@ -132,5 +137,5 @@ const Y = P.div`
|
|
|
132
137
|
);
|
|
133
138
|
});
|
|
134
139
|
export {
|
|
135
|
-
|
|
140
|
+
W as default
|
|
136
141
|
};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
text-align: ${({textAlign:e})=>e};
|
|
3
3
|
|
|
4
4
|
${({theme:{palette:{grey:e},typography:{b2R:t,b4R:i}},type:n})=>n==="sub"?{fontSize:i.size,fontWeight:i.weight,lineHeight:i.lineHeight,letterSpacing:i.letterSpacing,color:e[70]}:{fontSize:t.size,fontWeight:t.weight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing}}
|
|
5
|
-
`,h=l.forwardRef(function({children:t,type:i="main",textAlign:n="center",inlineCSS:o,...r},s){const a=l.useId();return u.jsx(f,{ref:s,type:i,textAlign:n
|
|
5
|
+
`,h=l.forwardRef(function({children:t,type:i="main",textAlign:n="center",inlineCSS:o,...r},s){const a=l.useId();return u.jsx(f,{ref:s,type:i,textAlign:n,id:`dialog-text-${a}`,...r,css:o,children:t})});exports.default=h;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@emotion/react/jsx-runtime"),s=require("react"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("@emotion/react/jsx-runtime"),s=require("react"),f=require("../../Icon/Icon.cjs"),g=require("@emotion/styled"),x=e=>e&&e.__esModule?e:{default:e},n=x(g),h=n.default.div`
|
|
2
2
|
position: relative;
|
|
3
3
|
display: flex;
|
|
4
4
|
align-items: center;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
gap: ${({theme:{spacing:e}})=>e.content(2)}px;
|
|
7
7
|
|
|
8
8
|
${({theme:{spacing:e,palette:{grey:o}},fullScreen:l})=>{let i={padding:`${e.content(3)}px ${e.content(4)}px`,borderBottom:`1px solid ${o[10]}`,maxHeight:48};return l&&(i={padding:e.content(4),maxHeight:56}),i}};
|
|
9
|
-
`,m=n.default.
|
|
9
|
+
`,m=n.default.h2`
|
|
10
10
|
flex-grow: 1;
|
|
11
11
|
text-align: center;
|
|
12
12
|
text-overflow: ellipsis;
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
|
|
16
16
|
${({theme:{typography:{h4B:e}}})=>({fontSize:e.size,fontWeight:e.weight,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing})};
|
|
17
|
-
`,
|
|
17
|
+
`,j=n.default.button`
|
|
18
18
|
position: absolute;
|
|
19
19
|
top: 50%;
|
|
20
20
|
right: ${({theme:{spacing:e}})=>e.content(4)}px;
|
|
21
21
|
transform: translateY(-50%);
|
|
22
22
|
`,a=n.default.div`
|
|
23
23
|
min-width: 24px;
|
|
24
|
-
`,
|
|
24
|
+
`,y=s.forwardRef(function({children:o,onClose:l,hideCloseButton:i,inlineCSS:r,tag:c="h2",...d},u){const p=s.useId();return t.jsxs(h,{ref:u,id:`dialog-title-${p}`,...d,css:r,children:[t.jsx(a,{}),t.jsx(m,{as:c,children:o}),t.jsx(a,{}),!i&&t.jsx(j,{type:"button",className:"closeButton",onClick:l,"aria-label":"닫기",children:t.jsx(f.default,{name:"CloseLine"})})]})});exports.default=y;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
1
|
+
import { ElementType, HTMLAttributes } from 'react';
|
|
2
2
|
import { GeneralComponentProps } from '../../typings/component';
|
|
3
3
|
|
|
4
4
|
export interface DialogTitleProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
5
|
onClose?: () => void;
|
|
6
6
|
fullScreen?: boolean;
|
|
7
7
|
hideCloseButton?: boolean;
|
|
8
|
+
tag?: ElementType;
|
|
8
9
|
}
|
|
9
10
|
declare const DialogTitle: import('react').ForwardRefExoticComponent<DialogTitleProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
10
11
|
export default DialogTitle;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const x =
|
|
1
|
+
import { jsxs as m, jsx as e } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef as g, useId as f } from "react";
|
|
3
|
+
import h from "../../Icon/Icon.es.js";
|
|
4
|
+
import i from "@emotion/styled";
|
|
5
|
+
const x = i.div`
|
|
6
6
|
position: relative;
|
|
7
7
|
display: flex;
|
|
8
8
|
align-items: center;
|
|
@@ -16,17 +16,17 @@ const x = o.div`
|
|
|
16
16
|
},
|
|
17
17
|
fullScreen: l
|
|
18
18
|
}) => {
|
|
19
|
-
let
|
|
19
|
+
let o = {
|
|
20
20
|
padding: `${t.content(3)}px ${t.content(4)}px`,
|
|
21
21
|
borderBottom: `1px solid ${n[10]}`,
|
|
22
22
|
maxHeight: 48
|
|
23
23
|
};
|
|
24
|
-
return l && (
|
|
24
|
+
return l && (o = {
|
|
25
25
|
padding: t.content(4),
|
|
26
26
|
maxHeight: 56
|
|
27
|
-
}),
|
|
27
|
+
}), o;
|
|
28
28
|
}};
|
|
29
|
-
`,
|
|
29
|
+
`, u = i.h2`
|
|
30
30
|
flex-grow: 1;
|
|
31
31
|
text-align: center;
|
|
32
32
|
text-overflow: ellipsis;
|
|
@@ -43,22 +43,22 @@ const x = o.div`
|
|
|
43
43
|
lineHeight: t.lineHeight,
|
|
44
44
|
letterSpacing: t.letterSpacing
|
|
45
45
|
})};
|
|
46
|
-
`,
|
|
46
|
+
`, w = i.button`
|
|
47
47
|
position: absolute;
|
|
48
48
|
top: 50%;
|
|
49
49
|
right: ${({ theme: { spacing: t } }) => t.content(4)}px;
|
|
50
50
|
transform: translateY(-50%);
|
|
51
|
-
`, r =
|
|
51
|
+
`, r = i.div`
|
|
52
52
|
min-width: 24px;
|
|
53
|
-
`,
|
|
54
|
-
const
|
|
55
|
-
return /* @__PURE__ */
|
|
53
|
+
`, S = g(function({ children: n, onClose: l, hideCloseButton: o, inlineCSS: s, tag: a = "h2", ...c }, p) {
|
|
54
|
+
const d = f();
|
|
55
|
+
return /* @__PURE__ */ m(x, { ref: p, id: `dialog-title-${d}`, ...c, css: s, children: [
|
|
56
56
|
/* @__PURE__ */ e(r, {}),
|
|
57
|
-
/* @__PURE__ */ e(
|
|
57
|
+
/* @__PURE__ */ e(u, { as: a, children: n }),
|
|
58
58
|
/* @__PURE__ */ e(r, {}),
|
|
59
|
-
!
|
|
59
|
+
!o && /* @__PURE__ */ e(w, { type: "button", className: "closeButton", onClick: l, "aria-label": "닫기", children: /* @__PURE__ */ e(h, { name: "CloseLine" }) })
|
|
60
60
|
] });
|
|
61
61
|
});
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
S as default
|
|
64
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("@emotion/react/jsx-runtime"),o=require("react"),R=require("../Flexbox/Flexbox.cjs");function p({active:l,children:a,inlineCSS:m,returnFocus:d=!0,disabled:b=!1,initialFocusId:x,...E}){const s=o.useRef(null),i=o.useRef(null),n=o.useRef([]),r=o.useRef(-1),y=()=>{s.current&&(n.current=Array.from(s.current.querySelectorAll('a[href]:not([tabindex="-1"]), area[href]:not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), textarea:not([disabled]):not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), iframe:not([tabindex="-1"]), object:not([tabindex="-1"]), embed:not([tabindex="-1"]), *[tabindex]:not([tabindex="-1"]), *[contenteditable]:not([tabindex="-1"])')))},g=t=>{var e;if(t){const u=document.getElementById(t);u&&u.focus();return}if(n.current)for(let u=0;u<n.current.length;u++){const c=n.current[u];if(!((e=c==null?void 0:c.getAttribute("class"))!=null&&e.includes("closeButton"))){c==null||c.focus(),r.current=u;break}}},h=()=>{var e;const t=n.current[r.current+1];if(!t){(e=n.current[0])==null||e.focus(),r.current=0;return}t.focus(),r.current+=1},v=()=>{var e;const t=n.current[r.current-1];if(!t){(e=n.current[n.current.length-1])==null||e.focus(),r.current=n.current.length-1;return}t.focus(),r.current-=1};return o.useEffect(()=>{!l&&i.current&&d&&i.current.focus()},[l,d]),o.useEffect(()=>{const t=e=>{e.key==="Tab"&&(e.preventDefault(),e.shiftKey?v():h())};return i.current=document.activeElement,y(),g(x),document.addEventListener("keydown",t),()=>{document.removeEventListener("keydown",t)}},[x]),f.jsxs(f.Fragment,{children:[b&&a,!b&&f.jsx(R.default,{className:"focus-boundary",ref:s,flexDirection:"column",inlineCSS:{height:"100%",...m},...E,children:a})]})}exports.default=p;
|
|
@@ -4,6 +4,8 @@ import { GeneralComponentProps } from '../typings/component';
|
|
|
4
4
|
export interface FocusBoundaryProps extends GeneralComponentProps<HTMLAttributes<HTMLDivElement>> {
|
|
5
5
|
active?: boolean;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
returnFocus?: boolean;
|
|
8
|
+
initialFocusId?: string;
|
|
7
9
|
}
|
|
8
|
-
declare function FocusBoundary({ active, children, inlineCSS, disabled, ...props }: FocusBoundaryProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare function FocusBoundary({ active, children, inlineCSS, returnFocus, disabled, initialFocusId, ...props }: FocusBoundaryProps): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
9
11
|
export default FocusBoundary;
|
|
@@ -1,73 +1,80 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as u, useEffect as
|
|
3
|
-
import
|
|
4
|
-
function
|
|
5
|
-
active:
|
|
6
|
-
children:
|
|
7
|
-
inlineCSS:
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { jsxs as v, Fragment as k, jsx as F } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useRef as u, useEffect as m } from "react";
|
|
3
|
+
import j from "../Flexbox/Flexbox.es.js";
|
|
4
|
+
function D({
|
|
5
|
+
active: i,
|
|
6
|
+
children: a,
|
|
7
|
+
inlineCSS: x,
|
|
8
|
+
returnFocus: l = !0,
|
|
9
|
+
disabled: d = !1,
|
|
10
|
+
initialFocusId: b,
|
|
11
|
+
...E
|
|
10
12
|
}) {
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const s = u(null), f = u(null), n = u([]), r = u(-1), y = () => {
|
|
14
|
+
s.current && (n.current = Array.from(
|
|
15
|
+
s.current.querySelectorAll(
|
|
16
|
+
'a[href]:not([tabindex="-1"]), area[href]:not([tabindex="-1"]), input:not([disabled]):not([tabindex="-1"]), select:not([disabled]):not([tabindex="-1"]), textarea:not([disabled]):not([tabindex="-1"]), button:not([disabled]):not([tabindex="-1"]), iframe:not([tabindex="-1"]), object:not([tabindex="-1"]), embed:not([tabindex="-1"]), *[tabindex]:not([tabindex="-1"]), *[contenteditable]:not([tabindex="-1"])'
|
|
15
17
|
)
|
|
16
18
|
));
|
|
17
|
-
},
|
|
18
|
-
var
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
}, h = (t) => {
|
|
20
|
+
var e;
|
|
21
|
+
if (t) {
|
|
22
|
+
const o = document.getElementById(t);
|
|
23
|
+
o && o.focus();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (n.current)
|
|
27
|
+
for (let o = 0; o < n.current.length; o++) {
|
|
28
|
+
const c = n.current[o];
|
|
29
|
+
if (!((e = c == null ? void 0 : c.getAttribute("class")) != null && e.includes("closeButton"))) {
|
|
30
|
+
c == null || c.focus(), r.current = o;
|
|
24
31
|
break;
|
|
25
32
|
}
|
|
26
33
|
}
|
|
27
|
-
},
|
|
34
|
+
}, p = () => {
|
|
28
35
|
var e;
|
|
29
|
-
const t =
|
|
36
|
+
const t = n.current[r.current + 1];
|
|
30
37
|
if (!t) {
|
|
31
|
-
(e =
|
|
38
|
+
(e = n.current[0]) == null || e.focus(), r.current = 0;
|
|
32
39
|
return;
|
|
33
40
|
}
|
|
34
|
-
t.focus(),
|
|
35
|
-
},
|
|
41
|
+
t.focus(), r.current += 1;
|
|
42
|
+
}, g = () => {
|
|
36
43
|
var e;
|
|
37
|
-
const t =
|
|
44
|
+
const t = n.current[r.current - 1];
|
|
38
45
|
if (!t) {
|
|
39
|
-
(e =
|
|
46
|
+
(e = n.current[n.current.length - 1]) == null || e.focus(), r.current = n.current.length - 1;
|
|
40
47
|
return;
|
|
41
48
|
}
|
|
42
|
-
t.focus(),
|
|
49
|
+
t.focus(), r.current -= 1;
|
|
43
50
|
};
|
|
44
|
-
return
|
|
45
|
-
!
|
|
46
|
-
}, [
|
|
51
|
+
return m(() => {
|
|
52
|
+
!i && f.current && l && f.current.focus();
|
|
53
|
+
}, [i, l]), m(() => {
|
|
47
54
|
const t = (e) => {
|
|
48
|
-
e.key === "Tab" && (e.preventDefault(), e.shiftKey ?
|
|
55
|
+
e.key === "Tab" && (e.preventDefault(), e.shiftKey ? g() : p());
|
|
49
56
|
};
|
|
50
|
-
return
|
|
57
|
+
return f.current = document.activeElement, y(), h(b), document.addEventListener("keydown", t), () => {
|
|
51
58
|
document.removeEventListener("keydown", t);
|
|
52
59
|
};
|
|
53
|
-
}, []), /* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
!
|
|
56
|
-
|
|
60
|
+
}, [b]), /* @__PURE__ */ v(k, { children: [
|
|
61
|
+
d && a,
|
|
62
|
+
!d && /* @__PURE__ */ F(
|
|
63
|
+
j,
|
|
57
64
|
{
|
|
58
65
|
className: "focus-boundary",
|
|
59
|
-
ref:
|
|
66
|
+
ref: s,
|
|
60
67
|
flexDirection: "column",
|
|
61
68
|
inlineCSS: {
|
|
62
69
|
height: "100%",
|
|
63
|
-
...
|
|
70
|
+
...x
|
|
64
71
|
},
|
|
65
|
-
...
|
|
66
|
-
children:
|
|
72
|
+
...E,
|
|
73
|
+
children: a
|
|
67
74
|
}
|
|
68
75
|
)
|
|
69
76
|
] });
|
|
70
77
|
}
|
|
71
78
|
export {
|
|
72
|
-
|
|
79
|
+
D as default
|
|
73
80
|
};
|