@launchpad-ui/drawer 0.9.20 → 0.9.22

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.
@@ -0,0 +1,3 @@
1
+ declare const Progress: () => import("react/jsx-runtime").JSX.Element;
2
+ export { Progress };
3
+ //# sourceMappingURL=Progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Progress.d.ts","sourceRoot":"","sources":["../src/Progress.tsx"],"names":[],"mappings":"AAaA,QAAA,MAAM,QAAQ,+CA6Bb,CAAC;AAEF,OAAO,EAAE,QAAQ,EAAE,CAAC"}
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import './style.css';
2
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import { useRef, useState, useEffect, Suspense } from "react";
4
4
  import { useFocusWithin } from "react-aria/useFocusWithin";
5
5
  import { usePreventScroll } from "react-aria/usePreventScroll";
@@ -9,17 +9,65 @@ import { IconButton } from "@launchpad-ui/button";
9
9
  import { FocusTrap } from "@launchpad-ui/focus-trap";
10
10
  import { Icon } from "@launchpad-ui/icons";
11
11
  import { Portal } from "@launchpad-ui/portal";
12
- import { Progress } from "@launchpad-ui/progress";
13
12
  const DRAWER_LABELLED_BY = "drawer-title";
14
- const closeButton = "_kZABG_closeButton";
15
- const content = "_kZABG_content";
16
- const drawer = "_kZABG_drawer";
17
- const full = "_kZABG_full";
18
- const large = "_kZABG_large";
19
- const medium = "_kZABG_medium";
20
- const overlay$1 = "_kZABG_overlay";
21
- const small = "_kZABG_small";
22
- const xLarge = "_kZABG_xLarge";
13
+ const Progress$1 = "N80__q_Progress";
14
+ const styles$1 = {
15
+ Progress: Progress$1,
16
+ "Progress--indeterminate": "N80__q_Progress--indeterminate",
17
+ "Progress-head": "N80__q_Progress-head",
18
+ "Progress-track": "N80__q_Progress-track"
19
+ };
20
+ const DIAMETER = 16;
21
+ const STROKE_WIDTH = DIAMETER * 0.1;
22
+ const RADIUS = DIAMETER * 0.5 - STROKE_WIDTH * 0.5;
23
+ const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
24
+ const Progress = () => /* @__PURE__ */ jsxs(
25
+ "svg",
26
+ {
27
+ className: cx(styles$1.Progress, styles$1["Progress--indeterminate"]),
28
+ width: DIAMETER,
29
+ height: DIAMETER,
30
+ viewBox: `0 0 ${DIAMETER} ${DIAMETER}`,
31
+ "data-test-id": "progress",
32
+ role: "progressbar",
33
+ "aria-valuemin": 0,
34
+ "aria-valuetext": "loading",
35
+ "aria-valuemax": 100,
36
+ children: [
37
+ /* @__PURE__ */ jsx(
38
+ "circle",
39
+ {
40
+ className: styles$1["Progress-track"],
41
+ cx: DIAMETER / 2,
42
+ cy: DIAMETER / 2,
43
+ r: RADIUS,
44
+ strokeWidth: STROKE_WIDTH
45
+ }
46
+ ),
47
+ /* @__PURE__ */ jsx(
48
+ "circle",
49
+ {
50
+ className: styles$1["Progress-head"],
51
+ cx: DIAMETER / 2,
52
+ cy: DIAMETER / 2,
53
+ r: RADIUS,
54
+ strokeWidth: STROKE_WIDTH,
55
+ strokeDasharray: CIRCUMFERENCE,
56
+ strokeDashoffset: CIRCUMFERENCE * 0.75
57
+ }
58
+ )
59
+ ]
60
+ }
61
+ );
62
+ const closeButton = "nI2R0W_closeButton";
63
+ const content = "nI2R0W_content";
64
+ const drawer = "nI2R0W_drawer";
65
+ const full = "nI2R0W_full";
66
+ const large = "nI2R0W_large";
67
+ const medium = "nI2R0W_medium";
68
+ const overlay$1 = "nI2R0W_overlay";
69
+ const small = "nI2R0W_small";
70
+ const xLarge = "nI2R0W_xLarge";
23
71
  const styles = {
24
72
  closeButton,
25
73
  content,
@@ -1 +1 @@
1
- {"version":3,"file":"index.es.js","sources":["../src/constants.ts","../src/Drawer.tsx","../src/DrawerHeader.tsx"],"sourcesContent":["export const DRAWER_LABELLED_BY = 'drawer-title';\n","import type { MouseEvent, ReactNode } from 'react';\nimport { Suspense, useEffect, useRef, useState } from 'react';\nimport { useFocusWithin } from 'react-aria/useFocusWithin';\nimport { usePreventScroll } from 'react-aria/usePreventScroll';\nimport { cx } from 'classix';\nimport type { Variants } from 'framer-motion';\nimport { LazyMotion, m } from 'framer-motion';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { FocusTrap } from '@launchpad-ui/focus-trap';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Portal } from '@launchpad-ui/portal';\nimport { Progress } from '@launchpad-ui/progress';\n\nimport { DRAWER_LABELLED_BY } from './constants';\n\nimport styles from './styles/Drawer.module.css';\n\nconst overlay: Variants = {\n\tvisible: { opacity: 1, transition: { duration: 0.15 } },\n\thidden: { opacity: 0 },\n};\n\nconst slideRight: Variants = {\n\thidden: { opacity: 0, x: '25%' },\n\tvisible: {\n\t\topacity: 1,\n\t\tx: '0%',\n\t\ttransition: { type: 'spring', delay: 0.15, duration: 0.2, bounce: 0 },\n\t},\n};\n\nconst loadFeatures = () =>\n\timport(\n\t\t/* webpackChunkName: \"lp-drawer-framer-features\" */\n\t\t/* webpackExports: \"domAnimation\" */\n\t\t'framer-motion'\n\t).then((res) => res.domAnimation);\n\ntype DrawerProps = {\n\tchildren?: ReactNode;\n\tclassName?: string;\n\tonCancel?(): void;\n\t'data-test-id'?: string;\n\tsize?: 'small' | 'medium' | 'large' | 'xLarge' | 'full';\n\ttheme?: 'dark' | 'default';\n\thideCancel?: boolean;\n};\n\n/**\n * @deprecated use `Modal` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-overlays-modal--docs#drawer\n */\nconst Drawer = (props: DrawerProps) => (\n\t<Portal>\n\t\t<DrawerContainer {...props} />\n\t</Portal>\n);\n\nconst DrawerContainer = ({\n\tclassName,\n\tchildren,\n\tonCancel,\n\tsize = 'small',\n\t'data-test-id': testId = 'drawer',\n\ttheme,\n\thideCancel = false,\n}: DrawerProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [isFocusWithin, setIsFocusWithin] = useState(false);\n\tconst { focusWithinProps } = useFocusWithin({\n\t\tonFocusWithinChange: (focusWithin) => setIsFocusWithin(focusWithin),\n\t});\n\n\tusePreventScroll();\n\n\tuseEffect(() => {\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tconst latest = [...document.querySelectorAll('[data-drawer]')].pop();\n\t\t\tif (event.key === 'Escape' && latest === ref.current && isFocusWithin) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t};\n\n\t\tconst addOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.add('has-overlay');\n\t\t\tdocument.addEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst removeOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.remove('has-overlay');\n\t\t\tdocument.removeEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst close = () => {\n\t\t\tonCancel?.();\n\t\t};\n\n\t\tif (isFocusWithin) {\n\t\t\taddOverlayAndEventHandler();\n\t\t}\n\n\t\tif (!isFocusWithin) {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t}\n\n\t\treturn () => {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t};\n\t}, [onCancel, isFocusWithin]);\n\n\tconst handleOverlayClick = (event: MouseEvent<HTMLDivElement>) => {\n\t\tif (event.target === event.currentTarget) {\n\t\t\tonCancel?.();\n\t\t}\n\t};\n\n\treturn (\n\t\t<LazyMotion strict features={loadFeatures}>\n\t\t\t<div\n\t\t\t\t{...focusWithinProps}\n\t\t\t\tclassName={cx(styles.drawer, styles[size], className)}\n\t\t\t\tdata-drawer\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<m.div\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\tvariants={overlay}\n\t\t\t\t\ttransition={{ duration: 0.15 }}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName={styles.overlay}\n\t\t\t\t\tonMouseDown={handleOverlayClick}\n\t\t\t\t>\n\t\t\t\t\t<FocusTrap autoFocus restoreFocus>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\tvariants={slideRight}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-labelledby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-describedby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-modal\n\t\t\t\t\t\t\tclassName={styles.content}\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t{...(theme ? { 'data-theme': theme } : {})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!hideCancel && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\taria-label=\"close\"\n\t\t\t\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"medium\" />}\n\t\t\t\t\t\t\t\t\tclassName={styles.closeButton}\n\t\t\t\t\t\t\t\t\tonClick={onCancel}\n\t\t\t\t\t\t\t\t\tdata-test-id=\"drawer-close-button\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Suspense fallback={<Progress />}>{children}</Suspense>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</FocusTrap>\n\t\t\t\t</m.div>\n\t\t\t</div>\n\t\t</LazyMotion>\n\t);\n};\n\nexport { Drawer };\nexport type { DrawerProps };\n","import type { ComponentProps } from 'react';\n\nimport { DRAWER_LABELLED_BY } from './constants';\n\ntype DrawerHeaderProps = ComponentProps<'div'> & {\n\tcloseable?: boolean;\n\ttitleID?: string;\n\ttitleClassName?: string;\n\tonClose?(): void;\n\t'data-test-id'?: string;\n};\n\nconst DrawerHeader = ({\n\tclassName,\n\tchildren,\n\ttitleID,\n\ttitleClassName,\n\t'data-test-id': testId = 'drawer-header',\n\t...rest\n}: DrawerHeaderProps) => {\n\treturn (\n\t\t<div data-test-id={testId} className={className} {...rest}>\n\t\t\t<h2 id={DRAWER_LABELLED_BY} className={titleClassName}>\n\t\t\t\t{children}\n\t\t\t</h2>\n\t\t</div>\n\t);\n};\n\nexport { DrawerHeader };\nexport type { DrawerHeaderProps };\n"],"names":[],"mappings":";;;;;;;;;;;AAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;ACkBlC,MAAM,UAAoB;AAAA,EACzB,SAAS,EAAE,SAAS,GAAG,YAAY,EAAE,UAAU,OAAK;AAAA,EACpD,QAAQ,EAAE,SAAS,EAAA;AACpB;AAEA,MAAM,aAAuB;AAAA,EAC5B,QAAQ,EAAE,SAAS,GAAG,GAAG,MAAA;AAAA,EACzB,SAAS;AAAA,IACR,SAAS;AAAA,IACT,GAAG;AAAA,IACH,YAAY,EAAE,MAAM,UAAU,OAAO,MAAM,UAAU,KAAK,QAAQ,EAAA;AAAA,EAAE;AAEtE;AAEA,MAAM,eAAe,MACpB;AAAA;AAAA;AAAA,EAGC;AACD,EAAE,KAAK,CAAC,QAAQ,IAAI,YAAY;AAiBjC,MAAM,SAAS,CAAC,UACf,oBAAC,UACA,UAAA,oBAAC,iBAAA,EAAiB,GAAG,MAAA,CAAO,EAAA,CAC7B;AAGD,MAAM,kBAAkB,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA,OAAO;AAAA,EACP,gBAAgB,SAAS;AAAA,EACzB;AAAA,EACA,aAAa;AACd,MAAmB;AAClB,QAAM,MAAM,OAAuB,IAAI;AACvC,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,KAAK;AACxD,QAAM,EAAE,iBAAA,IAAqB,eAAe;AAAA,IAC3C,qBAAqB,CAAC,gBAAgB,iBAAiB,WAAW;AAAA,EAAA,CAClE;AAED,mBAAA;AAEA,YAAU,MAAM;AACf,UAAM,eAAe,CAAC,UAAyB;AAC9C,YAAM,yBAA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cACR,SAAQ;AAAA,cACR,UAAU;AAAA,cACV,MAAK;AAAA,cACL,mBAAiB;AAAA,cACjB,oBAAkB;AAAA,cAClB,cAAU;AAAA,cACV,WAAW,OAAO;AAAA,cAClB,UAAU;AAAA,cACT,GAAI,QAAQ,EAAE,cAAc,MAAA,IAAU,CAAA;AAAA,cAEtC,UAAA;AAAA,gBAAA,CAAC,cACD;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACA,cAAW;AAAA,oBACX,MAAM,oBAAC,MAAA,EAAK,MAAK,UAAS,MAAK,UAAS;AAAA,oBACxC,WAAW,OAAO;AAAA,oBAClB,SAAS;AAAA,oBACT,gBAAa;AAAA,kBAAA;AAAA,gBAAA;AAAA,oCAGd,UAAA,EAAS,UAAU,oBAAC,UAAA,CAAA,CAAS,GAAK,SAAA,CAAS;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,EAC7C,CACD;AAAA,QAAA;AAAA,MAAA;AAAA,IACD;AAAA,EAAA,GAEF;AAEF;AC1JA,MAAM,eAAe,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB,SAAS;AAAA,EACzB,GAAG;AACJ,MAAyB;AACxB,SACC,oBAAC,OAAA,EAAI,gBAAc,QAAQ,WAAuB,GAAG,MACpD,UAAA,oBAAC,MAAA,EAAG,IAAI,oBAAoB,WAAW,gBACrC,UACF,GACD;AAEF;"}
1
+ {"version":3,"file":"index.es.js","sources":["../src/constants.ts","../src/Progress.tsx","../src/Drawer.tsx","../src/DrawerHeader.tsx"],"sourcesContent":["export const DRAWER_LABELLED_BY = 'drawer-title';\n","import { cx } from 'classix';\n\nimport styles from './styles/Progress.module.css';\n\n// The small indeterminate spinner the drawer shows while suspended content\n// loads. It previously came from `@launchpad-ui/progress`, which is deprecated\n// and is no longer part of this workspace, so the markup and styles live here\n// unchanged. Only the drawer's usage is kept: no value, no size, no delay.\nconst DIAMETER = 16;\nconst STROKE_WIDTH = DIAMETER * 0.1;\nconst RADIUS = DIAMETER * 0.5 - STROKE_WIDTH * 0.5;\nconst CIRCUMFERENCE = 2 * Math.PI * RADIUS;\n\nconst Progress = () => (\n\t<svg\n\t\tclassName={cx(styles.Progress, styles['Progress--indeterminate'])}\n\t\twidth={DIAMETER}\n\t\theight={DIAMETER}\n\t\tviewBox={`0 0 ${DIAMETER} ${DIAMETER}`}\n\t\tdata-test-id=\"progress\"\n\t\trole=\"progressbar\"\n\t\taria-valuemin={0}\n\t\taria-valuetext=\"loading\"\n\t\taria-valuemax={100}\n\t>\n\t\t<circle\n\t\t\tclassName={styles['Progress-track']}\n\t\t\tcx={DIAMETER / 2}\n\t\t\tcy={DIAMETER / 2}\n\t\t\tr={RADIUS}\n\t\t\tstrokeWidth={STROKE_WIDTH}\n\t\t/>\n\t\t<circle\n\t\t\tclassName={styles['Progress-head']}\n\t\t\tcx={DIAMETER / 2}\n\t\t\tcy={DIAMETER / 2}\n\t\t\tr={RADIUS}\n\t\t\tstrokeWidth={STROKE_WIDTH}\n\t\t\tstrokeDasharray={CIRCUMFERENCE}\n\t\t\tstrokeDashoffset={CIRCUMFERENCE * 0.75}\n\t\t/>\n\t</svg>\n);\n\nexport { Progress };\n","import type { MouseEvent, ReactNode } from 'react';\nimport { Suspense, useEffect, useRef, useState } from 'react';\nimport { useFocusWithin } from 'react-aria/useFocusWithin';\nimport { usePreventScroll } from 'react-aria/usePreventScroll';\nimport { cx } from 'classix';\nimport type { Variants } from 'framer-motion';\nimport { LazyMotion, m } from 'framer-motion';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { FocusTrap } from '@launchpad-ui/focus-trap';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Portal } from '@launchpad-ui/portal';\n\nimport { DRAWER_LABELLED_BY } from './constants';\nimport { Progress } from './Progress';\n\nimport styles from './styles/Drawer.module.css';\n\nconst overlay: Variants = {\n\tvisible: { opacity: 1, transition: { duration: 0.15 } },\n\thidden: { opacity: 0 },\n};\n\nconst slideRight: Variants = {\n\thidden: { opacity: 0, x: '25%' },\n\tvisible: {\n\t\topacity: 1,\n\t\tx: '0%',\n\t\ttransition: { type: 'spring', delay: 0.15, duration: 0.2, bounce: 0 },\n\t},\n};\n\nconst loadFeatures = () =>\n\timport(\n\t\t/* webpackChunkName: \"lp-drawer-framer-features\" */\n\t\t/* webpackExports: \"domAnimation\" */\n\t\t'framer-motion'\n\t).then((res) => res.domAnimation);\n\ntype DrawerProps = {\n\tchildren?: ReactNode;\n\tclassName?: string;\n\tonCancel?(): void;\n\t'data-test-id'?: string;\n\tsize?: 'small' | 'medium' | 'large' | 'xLarge' | 'full';\n\ttheme?: 'dark' | 'default';\n\thideCancel?: boolean;\n};\n\n/**\n * @deprecated use `Modal` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-overlays-modal--docs#drawer\n */\nconst Drawer = (props: DrawerProps) => (\n\t<Portal>\n\t\t<DrawerContainer {...props} />\n\t</Portal>\n);\n\nconst DrawerContainer = ({\n\tclassName,\n\tchildren,\n\tonCancel,\n\tsize = 'small',\n\t'data-test-id': testId = 'drawer',\n\ttheme,\n\thideCancel = false,\n}: DrawerProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [isFocusWithin, setIsFocusWithin] = useState(false);\n\tconst { focusWithinProps } = useFocusWithin({\n\t\tonFocusWithinChange: (focusWithin) => setIsFocusWithin(focusWithin),\n\t});\n\n\tusePreventScroll();\n\n\tuseEffect(() => {\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tconst latest = [...document.querySelectorAll('[data-drawer]')].pop();\n\t\t\tif (event.key === 'Escape' && latest === ref.current && isFocusWithin) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t};\n\n\t\tconst addOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.add('has-overlay');\n\t\t\tdocument.addEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst removeOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.remove('has-overlay');\n\t\t\tdocument.removeEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst close = () => {\n\t\t\tonCancel?.();\n\t\t};\n\n\t\tif (isFocusWithin) {\n\t\t\taddOverlayAndEventHandler();\n\t\t}\n\n\t\tif (!isFocusWithin) {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t}\n\n\t\treturn () => {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t};\n\t}, [onCancel, isFocusWithin]);\n\n\tconst handleOverlayClick = (event: MouseEvent<HTMLDivElement>) => {\n\t\tif (event.target === event.currentTarget) {\n\t\t\tonCancel?.();\n\t\t}\n\t};\n\n\treturn (\n\t\t<LazyMotion strict features={loadFeatures}>\n\t\t\t<div\n\t\t\t\t{...focusWithinProps}\n\t\t\t\tclassName={cx(styles.drawer, styles[size], className)}\n\t\t\t\tdata-drawer\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<m.div\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\tvariants={overlay}\n\t\t\t\t\ttransition={{ duration: 0.15 }}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName={styles.overlay}\n\t\t\t\t\tonMouseDown={handleOverlayClick}\n\t\t\t\t>\n\t\t\t\t\t<FocusTrap autoFocus restoreFocus>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\tvariants={slideRight}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-labelledby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-describedby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-modal\n\t\t\t\t\t\t\tclassName={styles.content}\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t{...(theme ? { 'data-theme': theme } : {})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!hideCancel && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\taria-label=\"close\"\n\t\t\t\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"medium\" />}\n\t\t\t\t\t\t\t\t\tclassName={styles.closeButton}\n\t\t\t\t\t\t\t\t\tonClick={onCancel}\n\t\t\t\t\t\t\t\t\tdata-test-id=\"drawer-close-button\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Suspense fallback={<Progress />}>{children}</Suspense>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</FocusTrap>\n\t\t\t\t</m.div>\n\t\t\t</div>\n\t\t</LazyMotion>\n\t);\n};\n\nexport { Drawer };\nexport type { DrawerProps };\n","import type { ComponentProps } from 'react';\n\nimport { DRAWER_LABELLED_BY } from './constants';\n\ntype DrawerHeaderProps = ComponentProps<'div'> & {\n\tcloseable?: boolean;\n\ttitleID?: string;\n\ttitleClassName?: string;\n\tonClose?(): void;\n\t'data-test-id'?: string;\n};\n\nconst DrawerHeader = ({\n\tclassName,\n\tchildren,\n\ttitleID,\n\ttitleClassName,\n\t'data-test-id': testId = 'drawer-header',\n\t...rest\n}: DrawerHeaderProps) => {\n\treturn (\n\t\t<div data-test-id={testId} className={className} {...rest}>\n\t\t\t<h2 id={DRAWER_LABELLED_BY} className={titleClassName}>\n\t\t\t\t{children}\n\t\t\t</h2>\n\t\t</div>\n\t);\n};\n\nexport { DrawerHeader };\nexport type { DrawerHeaderProps };\n"],"names":["styles"],"mappings":";;;;;;;;;;AAAO,MAAM,qBAAqB;;;;;;;;ACQlC,MAAM,WAAW;AACjB,MAAM,eAAe,WAAW;AAChC,MAAM,SAAS,WAAW,MAAM,eAAe;AAC/C,MAAM,gBAAgB,IAAI,KAAK,KAAK;AAEpC,MAAM,WAAW,MAChB;AAAA,EAAC;AAAA,EAAA;AAAA,IACA,W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oB,WAAW,gBACrC,UACF,GACD;AAEF;"}
package/dist/index.js CHANGED
@@ -33,17 +33,65 @@ const button = require("@launchpad-ui/button");
33
33
  const focusTrap = require("@launchpad-ui/focus-trap");
34
34
  const icons = require("@launchpad-ui/icons");
35
35
  const portal = require("@launchpad-ui/portal");
36
- const progress = require("@launchpad-ui/progress");
37
36
  const DRAWER_LABELLED_BY = "drawer-title";
38
- const closeButton = "_kZABG_closeButton";
39
- const content = "_kZABG_content";
40
- const drawer = "_kZABG_drawer";
41
- const full = "_kZABG_full";
42
- const large = "_kZABG_large";
43
- const medium = "_kZABG_medium";
44
- const overlay$1 = "_kZABG_overlay";
45
- const small = "_kZABG_small";
46
- const xLarge = "_kZABG_xLarge";
37
+ const Progress$1 = "N80__q_Progress";
38
+ const styles$1 = {
39
+ Progress: Progress$1,
40
+ "Progress--indeterminate": "N80__q_Progress--indeterminate",
41
+ "Progress-head": "N80__q_Progress-head",
42
+ "Progress-track": "N80__q_Progress-track"
43
+ };
44
+ const DIAMETER = 16;
45
+ const STROKE_WIDTH = DIAMETER * 0.1;
46
+ const RADIUS = DIAMETER * 0.5 - STROKE_WIDTH * 0.5;
47
+ const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
48
+ const Progress = () => /* @__PURE__ */ jsxRuntime.jsxs(
49
+ "svg",
50
+ {
51
+ className: classix.cx(styles$1.Progress, styles$1["Progress--indeterminate"]),
52
+ width: DIAMETER,
53
+ height: DIAMETER,
54
+ viewBox: `0 0 ${DIAMETER} ${DIAMETER}`,
55
+ "data-test-id": "progress",
56
+ role: "progressbar",
57
+ "aria-valuemin": 0,
58
+ "aria-valuetext": "loading",
59
+ "aria-valuemax": 100,
60
+ children: [
61
+ /* @__PURE__ */ jsxRuntime.jsx(
62
+ "circle",
63
+ {
64
+ className: styles$1["Progress-track"],
65
+ cx: DIAMETER / 2,
66
+ cy: DIAMETER / 2,
67
+ r: RADIUS,
68
+ strokeWidth: STROKE_WIDTH
69
+ }
70
+ ),
71
+ /* @__PURE__ */ jsxRuntime.jsx(
72
+ "circle",
73
+ {
74
+ className: styles$1["Progress-head"],
75
+ cx: DIAMETER / 2,
76
+ cy: DIAMETER / 2,
77
+ r: RADIUS,
78
+ strokeWidth: STROKE_WIDTH,
79
+ strokeDasharray: CIRCUMFERENCE,
80
+ strokeDashoffset: CIRCUMFERENCE * 0.75
81
+ }
82
+ )
83
+ ]
84
+ }
85
+ );
86
+ const closeButton = "nI2R0W_closeButton";
87
+ const content = "nI2R0W_content";
88
+ const drawer = "nI2R0W_drawer";
89
+ const full = "nI2R0W_full";
90
+ const large = "nI2R0W_large";
91
+ const medium = "nI2R0W_medium";
92
+ const overlay$1 = "nI2R0W_overlay";
93
+ const small = "nI2R0W_small";
94
+ const xLarge = "nI2R0W_xLarge";
47
95
  const styles = {
48
96
  closeButton,
49
97
  content,
@@ -164,7 +212,7 @@ const DrawerContainer = ({
164
212
  "data-test-id": "drawer-close-button"
165
213
  }
166
214
  ),
167
- /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(progress.Progress, {}), children })
215
+ /* @__PURE__ */ jsxRuntime.jsx(react.Suspense, { fallback: /* @__PURE__ */ jsxRuntime.jsx(Progress, {}), children })
168
216
  ]
169
217
  }
170
218
  ) })
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/constants.ts","../src/Drawer.tsx","../src/DrawerHeader.tsx"],"sourcesContent":["export const DRAWER_LABELLED_BY = 'drawer-title';\n","import type { MouseEvent, ReactNode } from 'react';\nimport { Suspense, useEffect, useRef, useState } from 'react';\nimport { useFocusWithin } from 'react-aria/useFocusWithin';\nimport { usePreventScroll } from 'react-aria/usePreventScroll';\nimport { cx } from 'classix';\nimport type { Variants } from 'framer-motion';\nimport { LazyMotion, m } from 'framer-motion';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { FocusTrap } from '@launchpad-ui/focus-trap';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Portal } from '@launchpad-ui/portal';\nimport { Progress } from '@launchpad-ui/progress';\n\nimport { DRAWER_LABELLED_BY } from './constants';\n\nimport styles from './styles/Drawer.module.css';\n\nconst overlay: Variants = {\n\tvisible: { opacity: 1, transition: { duration: 0.15 } },\n\thidden: { opacity: 0 },\n};\n\nconst slideRight: Variants = {\n\thidden: { opacity: 0, x: '25%' },\n\tvisible: {\n\t\topacity: 1,\n\t\tx: '0%',\n\t\ttransition: { type: 'spring', delay: 0.15, duration: 0.2, bounce: 0 },\n\t},\n};\n\nconst loadFeatures = () =>\n\timport(\n\t\t/* webpackChunkName: \"lp-drawer-framer-features\" */\n\t\t/* webpackExports: \"domAnimation\" */\n\t\t'framer-motion'\n\t).then((res) => res.domAnimation);\n\ntype DrawerProps = {\n\tchildren?: ReactNode;\n\tclassName?: string;\n\tonCancel?(): void;\n\t'data-test-id'?: string;\n\tsize?: 'small' | 'medium' | 'large' | 'xLarge' | 'full';\n\ttheme?: 'dark' | 'default';\n\thideCancel?: boolean;\n};\n\n/**\n * @deprecated use `Modal` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-overlays-modal--docs#drawer\n */\nconst Drawer = (props: DrawerProps) => (\n\t<Portal>\n\t\t<DrawerContainer {...props} />\n\t</Portal>\n);\n\nconst DrawerContainer = ({\n\tclassName,\n\tchildren,\n\tonCancel,\n\tsize = 'small',\n\t'data-test-id': testId = 'drawer',\n\ttheme,\n\thideCancel = false,\n}: DrawerProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [isFocusWithin, setIsFocusWithin] = useState(false);\n\tconst { focusWithinProps } = useFocusWithin({\n\t\tonFocusWithinChange: (focusWithin) => setIsFocusWithin(focusWithin),\n\t});\n\n\tusePreventScroll();\n\n\tuseEffect(() => {\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tconst latest = [...document.querySelectorAll('[data-drawer]')].pop();\n\t\t\tif (event.key === 'Escape' && latest === ref.current && isFocusWithin) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t};\n\n\t\tconst addOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.add('has-overlay');\n\t\t\tdocument.addEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst removeOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.remove('has-overlay');\n\t\t\tdocument.removeEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst close = () => {\n\t\t\tonCancel?.();\n\t\t};\n\n\t\tif (isFocusWithin) {\n\t\t\taddOverlayAndEventHandler();\n\t\t}\n\n\t\tif (!isFocusWithin) {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t}\n\n\t\treturn () => {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t};\n\t}, [onCancel, isFocusWithin]);\n\n\tconst handleOverlayClick = (event: MouseEvent<HTMLDivElement>) => {\n\t\tif (event.target === event.currentTarget) {\n\t\t\tonCancel?.();\n\t\t}\n\t};\n\n\treturn (\n\t\t<LazyMotion strict features={loadFeatures}>\n\t\t\t<div\n\t\t\t\t{...focusWithinProps}\n\t\t\t\tclassName={cx(styles.drawer, styles[size], className)}\n\t\t\t\tdata-drawer\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<m.div\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\tvariants={overlay}\n\t\t\t\t\ttransition={{ duration: 0.15 }}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName={styles.overlay}\n\t\t\t\t\tonMouseDown={handleOverlayClick}\n\t\t\t\t>\n\t\t\t\t\t<FocusTrap autoFocus restoreFocus>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\tvariants={slideRight}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-labelledby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-describedby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-modal\n\t\t\t\t\t\t\tclassName={styles.content}\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t{...(theme ? { 'data-theme': theme } : {})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!hideCancel && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\taria-label=\"close\"\n\t\t\t\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"medium\" />}\n\t\t\t\t\t\t\t\t\tclassName={styles.closeButton}\n\t\t\t\t\t\t\t\t\tonClick={onCancel}\n\t\t\t\t\t\t\t\t\tdata-test-id=\"drawer-close-button\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Suspense fallback={<Progress />}>{children}</Suspense>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</FocusTrap>\n\t\t\t\t</m.div>\n\t\t\t</div>\n\t\t</LazyMotion>\n\t);\n};\n\nexport { Drawer };\nexport type { DrawerProps };\n","import type { ComponentProps } from 'react';\n\nimport { DRAWER_LABELLED_BY } from './constants';\n\ntype DrawerHeaderProps = ComponentProps<'div'> & {\n\tcloseable?: boolean;\n\ttitleID?: string;\n\ttitleClassName?: string;\n\tonClose?(): void;\n\t'data-test-id'?: string;\n};\n\nconst DrawerHeader = ({\n\tclassName,\n\tchildren,\n\ttitleID,\n\ttitleClassName,\n\t'data-test-id': testId = 'drawer-header',\n\t...rest\n}: DrawerHeaderProps) => {\n\treturn (\n\t\t<div data-test-id={testId} className={className} {...rest}>\n\t\t\t<h2 id={DRAWER_LABELLED_BY} className={titleClassName}>\n\t\t\t\t{children}\n\t\t\t</h2>\n\t\t</div>\n\t);\n};\n\nexport { DrawerHeader };\nexport type { DrawerHeaderProps };\n"],"names":["jsx","Portal","useRef","useState","use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AAQ;AAAA,cACR,SAAQ;AAAA,cACR,UAAU;AAAA,cACV,MAAK;AAAA,cACL,mBAAiB;AAAA,cACjB,oBAAkB;AAAA,cAClB,cAAU;AAAA,cACV,WAAW,OAAO;AAAA,cAClB,UAAU;AAAA,cACT,GAAI,QAAQ,EAAE,cAAc,MAAA,IAAU,CAAA;AAAA,cAEtC,UAAA;AAAA,gBAAA,CAAC,cACDT,2BAAAA;AAAAA,kBAACY,OAAAA;AAAAA,kBAAA;AAAA,oBACA,cAAW;AAAA,oBACX,MAAMZ,2BAAAA,IAACa,YAAA,EAAK,MAAK,UAAS,MAAK,UAAS;AAAA,oBACxC,WAAW,OAAO;AAAA,oBAClB,SAAS;AAAA,oBACT,gBAAa;AAAA,kBAAA;AAAA,gBAAA;AAAA,+CAGdC,MAAAA,UAAA,EAAS,UAAUd,2BAAAA,IAACe,mBAAA,CAAA,CAAS,GAAK,SAAA,CAAS;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,EAC7C,CACD;AAAA,QAAA;AAAA,MAAA;AAAA,IACD;AAAA,EAAA,GAEF;AAEF;AC1JA,MAAM,eAAe,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB,SAAS;AAAA,EACzB,GAAG;AACJ,MAAyB;AACxB,SACCf,2BAAAA,IAAC,OAAA,EAAI,gBAAc,QAAQ,WAAuB,GAAG,MACpD,UAAAA,2BAAAA,IAAC,MAAA,EAAG,IAAI,oBAAoB,WAAW,gBACrC,UACF,GACD;AAEF;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/constants.ts","../src/Progress.tsx","../src/Drawer.tsx","../src/DrawerHeader.tsx"],"sourcesContent":["export const DRAWER_LABELLED_BY = 'drawer-title';\n","import { cx } from 'classix';\n\nimport styles from './styles/Progress.module.css';\n\n// The small indeterminate spinner the drawer shows while suspended content\n// loads. It previously came from `@launchpad-ui/progress`, which is deprecated\n// and is no longer part of this workspace, so the markup and styles live here\n// unchanged. Only the drawer's usage is kept: no value, no size, no delay.\nconst DIAMETER = 16;\nconst STROKE_WIDTH = DIAMETER * 0.1;\nconst RADIUS = DIAMETER * 0.5 - STROKE_WIDTH * 0.5;\nconst CIRCUMFERENCE = 2 * Math.PI * RADIUS;\n\nconst Progress = () => (\n\t<svg\n\t\tclassName={cx(styles.Progress, styles['Progress--indeterminate'])}\n\t\twidth={DIAMETER}\n\t\theight={DIAMETER}\n\t\tviewBox={`0 0 ${DIAMETER} ${DIAMETER}`}\n\t\tdata-test-id=\"progress\"\n\t\trole=\"progressbar\"\n\t\taria-valuemin={0}\n\t\taria-valuetext=\"loading\"\n\t\taria-valuemax={100}\n\t>\n\t\t<circle\n\t\t\tclassName={styles['Progress-track']}\n\t\t\tcx={DIAMETER / 2}\n\t\t\tcy={DIAMETER / 2}\n\t\t\tr={RADIUS}\n\t\t\tstrokeWidth={STROKE_WIDTH}\n\t\t/>\n\t\t<circle\n\t\t\tclassName={styles['Progress-head']}\n\t\t\tcx={DIAMETER / 2}\n\t\t\tcy={DIAMETER / 2}\n\t\t\tr={RADIUS}\n\t\t\tstrokeWidth={STROKE_WIDTH}\n\t\t\tstrokeDasharray={CIRCUMFERENCE}\n\t\t\tstrokeDashoffset={CIRCUMFERENCE * 0.75}\n\t\t/>\n\t</svg>\n);\n\nexport { Progress };\n","import type { MouseEvent, ReactNode } from 'react';\nimport { Suspense, useEffect, useRef, useState } from 'react';\nimport { useFocusWithin } from 'react-aria/useFocusWithin';\nimport { usePreventScroll } from 'react-aria/usePreventScroll';\nimport { cx } from 'classix';\nimport type { Variants } from 'framer-motion';\nimport { LazyMotion, m } from 'framer-motion';\n\nimport { IconButton } from '@launchpad-ui/button';\nimport { FocusTrap } from '@launchpad-ui/focus-trap';\nimport { Icon } from '@launchpad-ui/icons';\nimport { Portal } from '@launchpad-ui/portal';\n\nimport { DRAWER_LABELLED_BY } from './constants';\nimport { Progress } from './Progress';\n\nimport styles from './styles/Drawer.module.css';\n\nconst overlay: Variants = {\n\tvisible: { opacity: 1, transition: { duration: 0.15 } },\n\thidden: { opacity: 0 },\n};\n\nconst slideRight: Variants = {\n\thidden: { opacity: 0, x: '25%' },\n\tvisible: {\n\t\topacity: 1,\n\t\tx: '0%',\n\t\ttransition: { type: 'spring', delay: 0.15, duration: 0.2, bounce: 0 },\n\t},\n};\n\nconst loadFeatures = () =>\n\timport(\n\t\t/* webpackChunkName: \"lp-drawer-framer-features\" */\n\t\t/* webpackExports: \"domAnimation\" */\n\t\t'framer-motion'\n\t).then((res) => res.domAnimation);\n\ntype DrawerProps = {\n\tchildren?: ReactNode;\n\tclassName?: string;\n\tonCancel?(): void;\n\t'data-test-id'?: string;\n\tsize?: 'small' | 'medium' | 'large' | 'xLarge' | 'full';\n\ttheme?: 'dark' | 'default';\n\thideCancel?: boolean;\n};\n\n/**\n * @deprecated use `Modal` from `@launchpad-ui/components` instead\n *\n * https://launchpad.launchdarkly.com/?path=/docs/components-overlays-modal--docs#drawer\n */\nconst Drawer = (props: DrawerProps) => (\n\t<Portal>\n\t\t<DrawerContainer {...props} />\n\t</Portal>\n);\n\nconst DrawerContainer = ({\n\tclassName,\n\tchildren,\n\tonCancel,\n\tsize = 'small',\n\t'data-test-id': testId = 'drawer',\n\ttheme,\n\thideCancel = false,\n}: DrawerProps) => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [isFocusWithin, setIsFocusWithin] = useState(false);\n\tconst { focusWithinProps } = useFocusWithin({\n\t\tonFocusWithinChange: (focusWithin) => setIsFocusWithin(focusWithin),\n\t});\n\n\tusePreventScroll();\n\n\tuseEffect(() => {\n\t\tconst handleEscape = (event: KeyboardEvent) => {\n\t\t\tevent.stopImmediatePropagation();\n\t\t\tconst latest = [...document.querySelectorAll('[data-drawer]')].pop();\n\t\t\tif (event.key === 'Escape' && latest === ref.current && isFocusWithin) {\n\t\t\t\tclose();\n\t\t\t}\n\t\t};\n\n\t\tconst addOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.add('has-overlay');\n\t\t\tdocument.addEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst removeOverlayAndEventHandler = () => {\n\t\t\tdocument.body.classList.remove('has-overlay');\n\t\t\tdocument.removeEventListener('keydown', handleEscape);\n\t\t};\n\n\t\tconst close = () => {\n\t\t\tonCancel?.();\n\t\t};\n\n\t\tif (isFocusWithin) {\n\t\t\taddOverlayAndEventHandler();\n\t\t}\n\n\t\tif (!isFocusWithin) {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t}\n\n\t\treturn () => {\n\t\t\tremoveOverlayAndEventHandler();\n\t\t};\n\t}, [onCancel, isFocusWithin]);\n\n\tconst handleOverlayClick = (event: MouseEvent<HTMLDivElement>) => {\n\t\tif (event.target === event.currentTarget) {\n\t\t\tonCancel?.();\n\t\t}\n\t};\n\n\treturn (\n\t\t<LazyMotion strict features={loadFeatures}>\n\t\t\t<div\n\t\t\t\t{...focusWithinProps}\n\t\t\t\tclassName={cx(styles.drawer, styles[size], className)}\n\t\t\t\tdata-drawer\n\t\t\t\tdata-test-id={testId}\n\t\t\t\tref={ref}\n\t\t\t>\n\t\t\t\t<m.div\n\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\tvariants={overlay}\n\t\t\t\t\ttransition={{ duration: 0.15 }}\n\t\t\t\t\trole=\"presentation\"\n\t\t\t\t\tclassName={styles.overlay}\n\t\t\t\t\tonMouseDown={handleOverlayClick}\n\t\t\t\t>\n\t\t\t\t\t<FocusTrap autoFocus restoreFocus>\n\t\t\t\t\t\t<m.div\n\t\t\t\t\t\t\tinitial=\"hidden\"\n\t\t\t\t\t\t\tanimate=\"visible\"\n\t\t\t\t\t\t\tvariants={slideRight}\n\t\t\t\t\t\t\trole=\"dialog\"\n\t\t\t\t\t\t\taria-labelledby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-describedby={DRAWER_LABELLED_BY}\n\t\t\t\t\t\t\taria-modal\n\t\t\t\t\t\t\tclassName={styles.content}\n\t\t\t\t\t\t\ttabIndex={-1}\n\t\t\t\t\t\t\t{...(theme ? { 'data-theme': theme } : {})}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{!hideCancel && (\n\t\t\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t\t\taria-label=\"close\"\n\t\t\t\t\t\t\t\t\ticon={<Icon name=\"cancel\" size=\"medium\" />}\n\t\t\t\t\t\t\t\t\tclassName={styles.closeButton}\n\t\t\t\t\t\t\t\t\tonClick={onCancel}\n\t\t\t\t\t\t\t\t\tdata-test-id=\"drawer-close-button\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Suspense fallback={<Progress />}>{children}</Suspense>\n\t\t\t\t\t\t</m.div>\n\t\t\t\t\t</FocusTrap>\n\t\t\t\t</m.div>\n\t\t\t</div>\n\t\t</LazyMotion>\n\t);\n};\n\nexport { Drawer };\nexport type { DrawerProps };\n","import type { ComponentProps } from 'react';\n\nimport { DRAWER_LABELLED_BY } from './constants';\n\ntype DrawerHeaderProps = ComponentProps<'div'> & {\n\tcloseable?: boolean;\n\ttitleID?: string;\n\ttitleClassName?: string;\n\tonClose?(): void;\n\t'data-test-id'?: string;\n};\n\nconst DrawerHeader = ({\n\tclassName,\n\tchildren,\n\ttitleID,\n\ttitleClassName,\n\t'data-test-id': testId = 'drawer-header',\n\t...rest\n}: DrawerHeaderProps) => {\n\treturn (\n\t\t<div data-test-id={testId} className={className} {...rest}>\n\t\t\t<h2 id={DRAWER_LABELLED_BY} className={titleClassName}>\n\t\t\t\t{children}\n\t\t\t</h2>\n\t\t</div>\n\t);\n};\n\nexport { DrawerHeader };\nexport type { DrawerHeaderProps };\n"],"names":["jsxs","cx","styles","jsx","Portal","useRef","useState","useFocusWithin","usePreventScroll","useEffect","LazyMotion","m","FocusTrap","IconButton","Icon","Suspense"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAO,MAAM,qBA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GdC,MAAAA,UAAA,EAAS,UAAUZ,2BAAAA,IAAC,UAAA,CAAA,CAAS,GAAK,SAAA,CAAS;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA,EAC7C,CACD;AAAA,QAAA;AAAA,MAAA;AAAA,IACD;AAAA,EAAA,GAEF;AAEF;AC1JA,MAAM,eAAe,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,gBAAgB,SAAS;AAAA,EACzB,GAAG;AACJ,MAAyB;AACxB,SACCA,2BAAAA,IAAC,OAAA,EAAI,gBAAc,QAAQ,WAAuB,GAAG,MACpD,UAAAA,2BAAAA,IAAC,MAAA,EAAG,IAAI,oBAAoB,WAAW,gBACrC,UACF,GACD;AAEF;;;"}
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- :root,[data-theme=default]{--lp-component-drawer-color-bg-overlay:#28282880}[data-theme=dark]{--lp-component-drawer-color-bg-overlay:#191919bf}._kZABG_drawer{--page-gutter-width:.625rem;z-index:var(--lp-z-index-400);position:fixed;inset:0;transform:translateZ(0)}@media screen and (min-width:46.25rem){._kZABG_drawer{--page-gutter-width:2.5rem}}.has-overlay{overflow:hidden}._kZABG_overlay{background-color:var(--lp-component-drawer-color-bg-overlay);position:fixed;inset:0}._kZABG_content{background-color:var(--lp-color-bg-ui-primary);width:100vw;max-width:100vw;color:var(--lp-color-text-ui-secondary);box-shadow:-1px 0 4px var(--lp-color-shadow-ui-primary);position:absolute;top:0;bottom:0;right:0;overflow:auto}@media screen and (min-width:46.25rem){._kZABG_small ._kZABG_content{width:28.125rem}._kZABG_medium ._kZABG_content{width:40.625rem}._kZABG_large ._kZABG_content{width:50rem}._kZABG_xLarge ._kZABG_content{width:75rem}._kZABG_full ._kZABG_content{width:100%;max-width:unset}}._kZABG_content section{padding:2rem var(--page-gutter-width)}._kZABG_content section+section{border-top:1px dotted var(--lp-color-gray-100)}._kZABG_closeButton{position:absolute;top:.625rem;right:.625rem}
1
+ @keyframes N80__q_indeterminate{0%{transform:rotate(0)}to{transform:rotate(359deg)}}.N80__q_Progress{vertical-align:middle;display:inline-block;transform:rotate(-90deg)}.N80__q_Progress--indeterminate{animation-name:N80__q_indeterminate;animation-duration:var(--lp-duration-350);animation-timing-function:linear;animation-iteration-count:infinite}.N80__q_Progress-track{fill:none;stroke:var(--lp-color-gray-50)}.N80__q_Progress-head{transition:stroke-dashoffset var(--lp-duration-350);fill:none;stroke:var(--lp-color-gray-500)}:root,[data-theme=default]{--lp-component-drawer-color-bg-overlay:#28282880}[data-theme=dark]{--lp-component-drawer-color-bg-overlay:#191919bf}.nI2R0W_drawer{--page-gutter-width:.625rem;z-index:var(--lp-z-index-400);position:fixed;inset:0;transform:translateZ(0)}@media screen and (min-width:46.25rem){.nI2R0W_drawer{--page-gutter-width:2.5rem}}.has-overlay{overflow:hidden}.nI2R0W_overlay{background-color:var(--lp-component-drawer-color-bg-overlay);position:fixed;inset:0}.nI2R0W_content{background-color:var(--lp-color-bg-ui-primary);width:100vw;max-width:100vw;color:var(--lp-color-text-ui-secondary);box-shadow:-1px 0 4px var(--lp-color-shadow-ui-primary);position:absolute;top:0;bottom:0;right:0;overflow:auto}@media screen and (min-width:46.25rem){.nI2R0W_small .nI2R0W_content{width:28.125rem}.nI2R0W_medium .nI2R0W_content{width:40.625rem}.nI2R0W_large .nI2R0W_content{width:50rem}.nI2R0W_xLarge .nI2R0W_content{width:75rem}.nI2R0W_full .nI2R0W_content{width:100%;max-width:unset}}.nI2R0W_content section{padding:2rem var(--page-gutter-width)}.nI2R0W_content section+section{border-top:1px dotted var(--lp-color-gray-100)}.nI2R0W_closeButton{position:absolute;top:.625rem;right:.625rem}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@launchpad-ui/drawer",
3
- "version": "0.9.20",
3
+ "version": "0.9.22",
4
4
  "description": "A partial overlay that appears from the right side of the screen.",
5
5
  "repository": "launchdarkly/launchpad-ui",
6
6
  "license": "Apache-2.0",
@@ -19,19 +19,20 @@
19
19
  "**/*.css"
20
20
  ],
21
21
  "dependencies": {
22
- "@launchpad-ui/progress": "0.5.57",
23
22
  "classix": "2.2.0",
24
23
  "framer-motion": "12.23.22",
25
- "@launchpad-ui/button": "~0.15.21",
26
- "@launchpad-ui/focus-trap": "~0.5.5",
27
- "@launchpad-ui/icons": "~0.26.6",
28
- "@launchpad-ui/portal": "~0.4.4",
29
- "@launchpad-ui/tokens": "~0.18.0"
24
+ "@launchpad-ui/button": "~0.15.22",
25
+ "@launchpad-ui/focus-trap": "~0.5.6",
26
+ "@launchpad-ui/icons": "~0.26.7",
27
+ "@launchpad-ui/portal": "~0.4.5",
28
+ "@launchpad-ui/tokens": "~0.19.0"
30
29
  },
31
30
  "devDependencies": {
32
31
  "react": "19.2.8",
33
32
  "react-aria": "3.50.0",
34
- "react-dom": "19.2.8"
33
+ "react-dom": "19.2.8",
34
+ "@launchpad-ui/test-utils": "~0.0.0",
35
+ "@launchpad-ui/tooltip": "~0.12.9"
35
36
  },
36
37
  "peerDependencies": {
37
38
  "react": "^19",