@raystack/apsara 0.46.0-rc.5 → 0.46.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.
Files changed (41) hide show
  1. package/dist/style.css +1 -1
  2. package/dist/v1/components/icon-button/icon-button.cjs +8 -7
  3. package/dist/v1/components/icon-button/icon-button.cjs.map +1 -1
  4. package/dist/v1/components/icon-button/icon-button.d.ts +1 -1
  5. package/dist/v1/components/icon-button/icon-button.d.ts.map +1 -1
  6. package/dist/v1/components/icon-button/icon-button.js +8 -7
  7. package/dist/v1/components/icon-button/icon-button.js.map +1 -1
  8. package/dist/v1/components/sidebar/sidebar.cjs +26 -26
  9. package/dist/v1/components/sidebar/sidebar.cjs.map +1 -1
  10. package/dist/v1/components/sidebar/sidebar.d.ts +8 -8
  11. package/dist/v1/components/sidebar/sidebar.d.ts.map +1 -1
  12. package/dist/v1/components/sidebar/sidebar.js +26 -26
  13. package/dist/v1/components/sidebar/sidebar.js.map +1 -1
  14. package/dist/v1/components/tooltip/tooltip.cjs +20 -6
  15. package/dist/v1/components/tooltip/tooltip.cjs.map +1 -1
  16. package/dist/v1/components/tooltip/tooltip.d.ts +13 -7
  17. package/dist/v1/components/tooltip/tooltip.d.ts.map +1 -1
  18. package/dist/v1/components/tooltip/tooltip.js +21 -7
  19. package/dist/v1/components/tooltip/tooltip.js.map +1 -1
  20. package/dist/v1/components/tooltip/tooltip.module.css.cjs +1 -1
  21. package/dist/v1/components/tooltip/tooltip.module.css.js +1 -1
  22. package/dist/v1/components/tooltip/utils.cjs +30 -0
  23. package/dist/v1/components/tooltip/utils.cjs.map +1 -0
  24. package/dist/v1/components/tooltip/utils.d.ts +10 -0
  25. package/dist/v1/components/tooltip/utils.d.ts.map +1 -0
  26. package/dist/v1/components/tooltip/utils.js +28 -0
  27. package/dist/v1/components/tooltip/utils.js.map +1 -0
  28. package/dist/v1/hooks/index.cjs +2 -0
  29. package/dist/v1/hooks/index.cjs.map +1 -1
  30. package/dist/v1/hooks/index.d.ts +2 -1
  31. package/dist/v1/hooks/index.d.ts.map +1 -1
  32. package/dist/v1/hooks/index.js +1 -0
  33. package/dist/v1/hooks/index.js.map +1 -1
  34. package/dist/v1/hooks/useMouse.cjs +53 -0
  35. package/dist/v1/hooks/useMouse.cjs.map +1 -0
  36. package/dist/v1/hooks/useMouse.d.ts +20 -0
  37. package/dist/v1/hooks/useMouse.d.ts.map +1 -0
  38. package/dist/v1/hooks/useMouse.js +51 -0
  39. package/dist/v1/hooks/useMouse.js.map +1 -0
  40. package/dist/v1/style.css +1 -1
  41. package/package.json +1 -1
@@ -3,22 +3,23 @@
3
3
  var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.cjs');
4
4
  var index = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
5
5
  var React = require('react');
6
+ var flex = require('../flex/flex.cjs');
6
7
  var iconButton_module = require('./icon-button.module.css.cjs');
7
8
 
8
9
  const iconButton = index.cva(iconButton_module.default.iconButton, {
9
10
  variants: {
10
11
  size: {
11
- 1: iconButton_module.default["iconButton-size-1"],
12
- 2: iconButton_module.default["iconButton-size-2"],
13
- 3: iconButton_module.default["iconButton-size-3"],
14
- 4: iconButton_module.default["iconButton-size-4"],
12
+ 1: iconButton_module.default['iconButton-size-1'],
13
+ 2: iconButton_module.default['iconButton-size-2'],
14
+ 3: iconButton_module.default['iconButton-size-3'],
15
+ 4: iconButton_module.default['iconButton-size-4']
15
16
  }
16
17
  },
17
18
  defaultVariants: {
18
- size: 2,
19
- },
19
+ size: 2
20
+ }
20
21
  });
21
- const IconButton = React.forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type: "button", "aria-label": ariaLabel, "aria-disabled": disabled, style: style, ...props, children: jsxRuntime.jsxRuntimeExports.jsx("div", { "aria-hidden": "true", children: children }) })));
22
+ const IconButton = React.forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type: 'button', "aria-label": ariaLabel, "aria-disabled": disabled, style: style, ...props, children: jsxRuntime.jsxRuntimeExports.jsx(flex.Flex, { "aria-hidden": 'true', align: 'center', justify: 'center', children: children }) })));
22
23
  IconButton.displayName = 'IconButton';
23
24
 
24
25
  exports.IconButton = IconButton;
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.cjs","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import { cva, VariantProps } from \"class-variance-authority\";\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef } from \"react\";\n\nimport styles from './icon-button.module.css';\n\nconst iconButton = cva(styles.iconButton, {\n variants: {\n size: {\n 1: styles[\"iconButton-size-1\"],\n 2: styles[\"iconButton-size-2\"],\n 3: styles[\"iconButton-size-3\"],\n 4: styles[\"iconButton-size-4\"],\n }\n },\n defaultVariants: {\n size: 2,\n },\n});\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n size?: 1 | 2 | 3 | 4;\n 'aria-label'?: string;\n}\n\nexport const IconButton = forwardRef<ElementRef<\"button\">, IconButtonProps>(\n ({ \n className, \n size, \n disabled, \n children, \n 'aria-label': ariaLabel,\n style,\n ...props \n }, ref) => (\n <button\n ref={ref}\n className={iconButton({ size, className })}\n disabled={disabled}\n type=\"button\"\n aria-label={ariaLabel}\n aria-disabled={disabled}\n style={style}\n {...props}\n >\n <div aria-hidden=\"true\">\n {children}\n </div>\n </button>\n )\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["cva","styles","forwardRef","_jsx"],"mappings":";;;;;;;AAKA,MAAM,UAAU,GAAGA,SAAG,CAACC,yBAAM,CAAC,UAAU,EAAE;AACxC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC/B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,CAAC;AACR,KAAA;AACF,CAAA,CAAC,CAAC;AASI,MAAM,UAAU,GAAGC,gBAAU,CAClC,CAAC,EACC,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,GAAG,MACJC,gCACE,CAAA,QAAA,EAAA,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC1C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,EAAA,YAAA,EACD,SAAS,EAAA,eAAA,EACN,QAAQ,EACvB,KAAK,EAAE,KAAK,KACR,KAAK,EAAA,QAAA,EAETA,gCAAiB,CAAA,KAAA,EAAA,EAAA,aAAA,EAAA,MAAM,YACpB,QAAQ,EAAA,CACL,EACC,CAAA,CACV,EACD;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"icon-button.cjs","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import { VariantProps, cva } from 'class-variance-authority';\nimport { ElementRef, forwardRef } from 'react';\nimport { Flex } from '../flex';\n\nimport styles from './icon-button.module.css';\n\nconst iconButton = cva(styles.iconButton, {\n variants: {\n size: {\n 1: styles['iconButton-size-1'],\n 2: styles['iconButton-size-2'],\n 3: styles['iconButton-size-3'],\n 4: styles['iconButton-size-4']\n }\n },\n defaultVariants: {\n size: 2\n }\n});\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n size?: 1 | 2 | 3 | 4;\n 'aria-label'?: string;\n}\n\nexport const IconButton = forwardRef<ElementRef<'button'>, IconButtonProps>(\n (\n {\n className,\n size,\n disabled,\n children,\n 'aria-label': ariaLabel,\n style,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={iconButton({ size, className })}\n disabled={disabled}\n type='button'\n aria-label={ariaLabel}\n aria-disabled={disabled}\n style={style}\n {...props}\n >\n <Flex aria-hidden='true' align='center' justify='center'>\n {children}\n </Flex>\n </button>\n )\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["cva","styles","forwardRef","_jsx","Flex"],"mappings":";;;;;;;;AAMA,MAAM,UAAU,GAAGA,SAAG,CAACC,yBAAM,CAAC,UAAU,EAAE;AACxC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAEA,yBAAM,CAAC,mBAAmB,CAAC;AAC/B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,CAAC;AACR,KAAA;AACF,CAAA,CAAC,CAAC;AASU,MAAA,UAAU,GAAGC,gBAAU,CAClC,CACE,EACE,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHC,gCAAA,CAAA,QAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC1C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,gBACD,SAAS,EAAA,eAAA,EACN,QAAQ,EACvB,KAAK,EAAE,KAAK,EAAA,GACR,KAAK,EAAA,QAAA,EAETA,iCAACC,SAAI,EAAA,EAAA,aAAA,EAAa,MAAM,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EACrD,QAAA,EAAA,QAAQ,GACJ,EACA,CAAA,CACV,EACD;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
@@ -1,4 +1,4 @@
1
- import { VariantProps } from "class-variance-authority";
1
+ import { VariantProps } from 'class-variance-authority';
2
2
  declare const iconButton: (props?: ({
3
3
  size?: 1 | 2 | 3 | 4 | null | undefined;
4
4
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAK7D,QAAA,MAAM,UAAU;;8EAYd,CAAC;AAEH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,UAAU,CAAC;IACjC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,+GAyBtB,CAAC"}
1
+ {"version":3,"file":"icon-button.d.ts","sourceRoot":"","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAO,MAAM,0BAA0B,CAAC;AAM7D,QAAA,MAAM,UAAU;;8EAYd,CAAC;AAEH,MAAM,WAAW,eACf,SAAQ,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EACnD,YAAY,CAAC,OAAO,UAAU,CAAC;IACjC,IAAI,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,+GA4BtB,CAAC"}
@@ -1,22 +1,23 @@
1
1
  import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js';
2
2
  import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
3
3
  import { forwardRef } from 'react';
4
+ import { Flex } from '../flex/flex.js';
4
5
  import styles from './icon-button.module.css.js';
5
6
 
6
7
  const iconButton = cva(styles.iconButton, {
7
8
  variants: {
8
9
  size: {
9
- 1: styles["iconButton-size-1"],
10
- 2: styles["iconButton-size-2"],
11
- 3: styles["iconButton-size-3"],
12
- 4: styles["iconButton-size-4"],
10
+ 1: styles['iconButton-size-1'],
11
+ 2: styles['iconButton-size-2'],
12
+ 3: styles['iconButton-size-3'],
13
+ 4: styles['iconButton-size-4']
13
14
  }
14
15
  },
15
16
  defaultVariants: {
16
- size: 2,
17
- },
17
+ size: 2
18
+ }
18
19
  });
19
- const IconButton = forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type: "button", "aria-label": ariaLabel, "aria-disabled": disabled, style: style, ...props, children: jsxRuntimeExports.jsx("div", { "aria-hidden": "true", children: children }) })));
20
+ const IconButton = forwardRef(({ className, size, disabled, children, 'aria-label': ariaLabel, style, ...props }, ref) => (jsxRuntimeExports.jsx("button", { ref: ref, className: iconButton({ size, className }), disabled: disabled, type: 'button', "aria-label": ariaLabel, "aria-disabled": disabled, style: style, ...props, children: jsxRuntimeExports.jsx(Flex, { "aria-hidden": 'true', align: 'center', justify: 'center', children: children }) })));
20
21
  IconButton.displayName = 'IconButton';
21
22
 
22
23
  export { IconButton };
@@ -1 +1 @@
1
- {"version":3,"file":"icon-button.js","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import { cva, VariantProps } from \"class-variance-authority\";\nimport { ComponentPropsWithoutRef, ElementRef, forwardRef } from \"react\";\n\nimport styles from './icon-button.module.css';\n\nconst iconButton = cva(styles.iconButton, {\n variants: {\n size: {\n 1: styles[\"iconButton-size-1\"],\n 2: styles[\"iconButton-size-2\"],\n 3: styles[\"iconButton-size-3\"],\n 4: styles[\"iconButton-size-4\"],\n }\n },\n defaultVariants: {\n size: 2,\n },\n});\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n size?: 1 | 2 | 3 | 4;\n 'aria-label'?: string;\n}\n\nexport const IconButton = forwardRef<ElementRef<\"button\">, IconButtonProps>(\n ({ \n className, \n size, \n disabled, \n children, \n 'aria-label': ariaLabel,\n style,\n ...props \n }, ref) => (\n <button\n ref={ref}\n className={iconButton({ size, className })}\n disabled={disabled}\n type=\"button\"\n aria-label={ariaLabel}\n aria-disabled={disabled}\n style={style}\n {...props}\n >\n <div aria-hidden=\"true\">\n {children}\n </div>\n </button>\n )\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["_jsx"],"mappings":";;;;;AAKA,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE;AACxC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC/B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,CAAC;AACR,KAAA;AACF,CAAA,CAAC,CAAC;AASI,MAAM,UAAU,GAAG,UAAU,CAClC,CAAC,EACC,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,GAAG,KAAK,EACT,EAAE,GAAG,MACJA,qBACE,CAAA,QAAA,EAAA,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC1C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,EAAA,YAAA,EACD,SAAS,EAAA,eAAA,EACN,QAAQ,EACvB,KAAK,EAAE,KAAK,KACR,KAAK,EAAA,QAAA,EAETA,qBAAiB,CAAA,KAAA,EAAA,EAAA,aAAA,EAAA,MAAM,YACpB,QAAQ,EAAA,CACL,EACC,CAAA,CACV,EACD;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"icon-button.js","sources":["../../../../v1/components/icon-button/icon-button.tsx"],"sourcesContent":["import { VariantProps, cva } from 'class-variance-authority';\nimport { ElementRef, forwardRef } from 'react';\nimport { Flex } from '../flex';\n\nimport styles from './icon-button.module.css';\n\nconst iconButton = cva(styles.iconButton, {\n variants: {\n size: {\n 1: styles['iconButton-size-1'],\n 2: styles['iconButton-size-2'],\n 3: styles['iconButton-size-3'],\n 4: styles['iconButton-size-4']\n }\n },\n defaultVariants: {\n size: 2\n }\n});\n\nexport interface IconButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof iconButton> {\n size?: 1 | 2 | 3 | 4;\n 'aria-label'?: string;\n}\n\nexport const IconButton = forwardRef<ElementRef<'button'>, IconButtonProps>(\n (\n {\n className,\n size,\n disabled,\n children,\n 'aria-label': ariaLabel,\n style,\n ...props\n },\n ref\n ) => (\n <button\n ref={ref}\n className={iconButton({ size, className })}\n disabled={disabled}\n type='button'\n aria-label={ariaLabel}\n aria-disabled={disabled}\n style={style}\n {...props}\n >\n <Flex aria-hidden='true' align='center' justify='center'>\n {children}\n </Flex>\n </button>\n )\n);\n\nIconButton.displayName = 'IconButton';\n"],"names":["_jsx"],"mappings":";;;;;;AAMA,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE;AACxC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC9B,YAAA,CAAC,EAAE,MAAM,CAAC,mBAAmB,CAAC;AAC/B,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,CAAC;AACR,KAAA;AACF,CAAA,CAAC,CAAC;AASU,MAAA,UAAU,GAAG,UAAU,CAClC,CACE,EACE,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,YAAY,EAAE,SAAS,EACvB,KAAK,EACL,GAAG,KAAK,EACT,EACD,GAAG,MAEHA,qBAAA,CAAA,QAAA,EAAA,EACE,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,EAC1C,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAC,QAAQ,gBACD,SAAS,EAAA,eAAA,EACN,QAAQ,EACvB,KAAK,EAAE,KAAK,EAAA,GACR,KAAK,EAAA,QAAA,EAETA,sBAAC,IAAI,EAAA,EAAA,aAAA,EAAa,MAAM,EAAC,KAAK,EAAC,QAAQ,EAAC,OAAO,EAAC,QAAQ,EACrD,QAAA,EAAA,QAAQ,GACJ,EACA,CAAA,CACV,EACD;AAEF,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
@@ -4,58 +4,58 @@ var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/rea
4
4
  var index = require('../../node_modules/.pnpm/@radix-ui_react-collapsible@1.1.2_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18._hjslo7xm5vmo3b4sx344jkbtcq/node_modules/@radix-ui/react-collapsible/dist/index.cjs');
5
5
  var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
6
6
  var React = require('react');
7
+ var clsx = require('../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.cjs');
7
8
  var tooltip = require('../tooltip/tooltip.cjs');
8
9
  var sidebar_module = require('./sidebar.module.css.cjs');
9
- var clsx = require('../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.cjs');
10
10
 
11
11
  const SidebarContext = React.createContext({
12
- isCollapsed: false,
12
+ isCollapsed: false
13
13
  });
14
14
  const root = index$1.cva(sidebar_module.default.root);
15
- const SidebarRoot = React.forwardRef(({ className, position = "left", open, onOpenChange, hideCollapsedItemTooltip, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx(SidebarContext.Provider, { value: { isCollapsed: !open, hideCollapsedItemTooltip }, children: jsxRuntime.jsxRuntimeExports.jsx(tooltip.TooltipProvider, { children: jsxRuntime.jsxRuntimeExports.jsx(index.Root, { ref: ref, className: root({ className }), "data-position": position, "data-state": open ? "expanded" : "collapsed", open: open, onOpenChange: onOpenChange, "aria-label": "Navigation Sidebar", "aria-expanded": open, role: "navigation", ...props, asChild: true, children: jsxRuntime.jsxRuntimeExports.jsxs("aside", { children: [jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: open ? "Click to collapse" : "Click to expand", side: position === "left" ? "right" : "left", asChild: true, children: jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default.resizeHandle, onClick: () => onOpenChange?.(!open), role: "button", tabIndex: 0, "aria-label": open ? "Collapse sidebar" : "Expand sidebar", onKeyDown: e => {
16
- if (e.key === "Enter" || e.key === " ") {
15
+ const SidebarRoot = React.forwardRef(({ className, position = 'left', open, onOpenChange, hideCollapsedItemTooltip, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx(SidebarContext.Provider, { value: { isCollapsed: !open, hideCollapsedItemTooltip }, children: jsxRuntime.jsxRuntimeExports.jsx(tooltip.TooltipProvider, { children: jsxRuntime.jsxRuntimeExports.jsx(index.Root, { ref: ref, className: root({ className }), "data-position": position, "data-state": open ? 'expanded' : 'collapsed', open: open, onOpenChange: onOpenChange, "aria-label": 'Navigation Sidebar', "aria-expanded": open, role: 'navigation', ...props, asChild: true, children: jsxRuntime.jsxRuntimeExports.jsxs("aside", { children: [jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: open ? 'Click to collapse' : 'Click to expand', side: position === 'left' ? 'right' : 'left', asChild: true, followCursor: true, children: jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default.resizeHandle, onClick: () => onOpenChange?.(!open), role: 'button', tabIndex: 0, "aria-label": open ? 'Collapse sidebar' : 'Expand sidebar', onKeyDown: e => {
16
+ if (e.key === 'Enter' || e.key === ' ') {
17
17
  e.preventDefault();
18
18
  onOpenChange?.(!open);
19
19
  }
20
20
  } }) }), children] }) }) }) })));
21
- const SidebarHeader = React.forwardRef(({ className, logo, title, onLogoClick, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs("div", { ref: ref, className: sidebar_module.default.header, role: "banner", ...props, children: [jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default.logo, onClick: onLogoClick, role: onLogoClick ? "button" : undefined, tabIndex: onLogoClick ? 0 : undefined, onKeyDown: e => {
22
- if (onLogoClick && (e.key === "Enter" || e.key === " ")) {
21
+ const SidebarHeader = React.forwardRef(({ className, logo, title, onLogoClick, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs("div", { ref: ref, className: sidebar_module.default.header, role: 'banner', ...props, children: [jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default.logo, onClick: onLogoClick, role: onLogoClick ? 'button' : undefined, tabIndex: onLogoClick ? 0 : undefined, onKeyDown: e => {
22
+ if (onLogoClick && (e.key === 'Enter' || e.key === ' ')) {
23
23
  e.preventDefault();
24
24
  onLogoClick();
25
25
  }
26
- }, style: { cursor: onLogoClick ? "pointer" : undefined }, children: logo }), jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default.title, role: "heading", "aria-level": 1, children: title })] })));
27
- const SidebarMain = React.forwardRef(({ className, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: sidebar_module.default.main, role: "group", "aria-label": "Main navigation", ...props, children: children })));
28
- const SidebarFooter = React.forwardRef(({ className, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: sidebar_module.default.footer, role: "group", "aria-label": "Footer navigation", ...props, children: children })));
26
+ }, style: { cursor: onLogoClick ? 'pointer' : undefined }, children: logo }), jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default.title, role: 'heading', "aria-level": 1, children: title })] })));
27
+ const SidebarMain = React.forwardRef(({ className, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: sidebar_module.default.main, role: 'group', "aria-label": 'Main navigation', ...props, children: children })));
28
+ const SidebarFooter = React.forwardRef(({ className, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: sidebar_module.default.footer, role: 'group', "aria-label": 'Footer navigation', ...props, children: children })));
29
29
  const SidebarItem = React.forwardRef(({ classNames, icon, children, active, disabled, as = jsxRuntime.jsxRuntimeExports.jsx("a", {}), ...props }, ref) => {
30
30
  const { isCollapsed, hideCollapsedItemTooltip } = React.useContext(SidebarContext); // To prevent prop drillng
31
31
  const content = React.cloneElement(as, {
32
32
  ref,
33
- className: clsx.clsx(sidebar_module.default["nav-item"], classNames?.root),
34
- "data-active": active,
35
- "data-disabled": disabled,
36
- role: "menuitem",
37
- "aria-current": active ? "page" : undefined,
38
- "aria-disabled": disabled,
39
- ...props,
40
- }, jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [jsxRuntime.jsxRuntimeExports.jsx("span", { className: clsx.clsx(sidebar_module.default["nav-icon"], classNames?.icon), "aria-hidden": "true", children: icon }), !isCollapsed && jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidebar_module.default["nav-text"], children: children })] }));
33
+ className: clsx.clsx(sidebar_module.default['nav-item'], classNames?.root),
34
+ 'data-active': active,
35
+ 'data-disabled': disabled,
36
+ role: 'menuitem',
37
+ 'aria-current': active ? 'page' : undefined,
38
+ 'aria-disabled': disabled,
39
+ ...props
40
+ }, jsxRuntime.jsxRuntimeExports.jsxs(jsxRuntime.jsxRuntimeExports.Fragment, { children: [jsxRuntime.jsxRuntimeExports.jsx("span", { className: clsx.clsx(sidebar_module.default['nav-icon'], classNames?.icon), "aria-hidden": 'true', children: icon }), !isCollapsed && jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidebar_module.default['nav-text'], children: children })] }));
41
41
  if (isCollapsed && !hideCollapsedItemTooltip) {
42
- return (jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: children, side: "right", children: content }));
42
+ return (jsxRuntime.jsxRuntimeExports.jsx(tooltip.Tooltip, { message: children, side: 'right', children: content }));
43
43
  }
44
44
  return content;
45
45
  });
46
- const SidebarNavigationGroup = React.forwardRef(({ className, name, icon, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs("section", { ref: ref, className: className, "aria-label": name, ...props, children: [jsxRuntime.jsxRuntimeExports.jsxs("div", { className: sidebar_module.default["nav-group-header"], children: [icon && jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidebar_module.default["nav-icon"], children: icon }), jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidebar_module.default["nav-group-name"], children: name })] }), jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default["nav-group-items"], role: "list", children: children })] })));
47
- SidebarRoot.displayName = "Sidebar.Root";
48
- SidebarHeader.displayName = "Sidebar.Header";
49
- SidebarMain.displayName = "Sidebar.Main";
50
- SidebarFooter.displayName = "Sidebar.Footer";
51
- SidebarItem.displayName = "Sidebar.Item";
52
- SidebarNavigationGroup.displayName = "Sidebar.Group";
46
+ const SidebarNavigationGroup = React.forwardRef(({ className, name, icon, children, ...props }, ref) => (jsxRuntime.jsxRuntimeExports.jsxs("section", { ref: ref, className: className, "aria-label": name, ...props, children: [jsxRuntime.jsxRuntimeExports.jsxs("div", { className: sidebar_module.default['nav-group-header'], children: [icon && jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidebar_module.default['nav-icon'], children: icon }), jsxRuntime.jsxRuntimeExports.jsx("span", { className: sidebar_module.default['nav-group-name'], children: name })] }), jsxRuntime.jsxRuntimeExports.jsx("div", { className: sidebar_module.default['nav-group-items'], role: 'list', children: children })] })));
47
+ SidebarRoot.displayName = 'Sidebar.Root';
48
+ SidebarHeader.displayName = 'Sidebar.Header';
49
+ SidebarMain.displayName = 'Sidebar.Main';
50
+ SidebarFooter.displayName = 'Sidebar.Footer';
51
+ SidebarItem.displayName = 'Sidebar.Item';
52
+ SidebarNavigationGroup.displayName = 'Sidebar.Group';
53
53
  const Sidebar = Object.assign(SidebarRoot, {
54
54
  Header: SidebarHeader,
55
55
  Main: SidebarMain,
56
56
  Footer: SidebarFooter,
57
57
  Item: SidebarItem,
58
- Group: SidebarNavigationGroup,
58
+ Group: SidebarNavigationGroup
59
59
  });
60
60
 
61
61
  exports.Sidebar = Sidebar;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.cjs","sources":["../../../../v1/components/sidebar/sidebar.tsx"],"sourcesContent":["import * as Collapsible from \"@radix-ui/react-collapsible\";\nimport { cva } from \"class-variance-authority\";\nimport {\n ComponentPropsWithoutRef,\n ComponentRef,\n forwardRef,\n ReactNode,\n createContext,\n useContext,\n ReactElement,\n cloneElement,\n} from \"react\";\n\nimport { Tooltip, TooltipProvider } from \"../tooltip\";\nimport styles from \"./sidebar.module.css\";\nimport clsx from \"clsx\";\n\ninterface SidebarContextValue {\n isCollapsed: boolean;\n hideCollapsedItemTooltip?: boolean;\n}\n\nconst SidebarContext = createContext<SidebarContextValue>({\n isCollapsed: false,\n});\n\nconst root = cva(styles.root);\n\ninterface SidebarProps\n extends ComponentPropsWithoutRef<typeof Collapsible.Root> {\n position?: \"left\" | \"right\";\n hideCollapsedItemTooltip?: boolean;\n}\n\ninterface SidebarHeaderProps extends ComponentPropsWithoutRef<\"div\"> {\n logo: ReactNode;\n title: string;\n onLogoClick?: () => void;\n}\n\ninterface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n icon: ReactNode;\n active?: boolean;\n disabled?: boolean;\n as?: ReactElement;\n classNames?: {\n root?: string;\n icon?: string;\n text?: string;\n };\n}\n\ninterface SidebarFooterProps extends ComponentPropsWithoutRef<\"div\"> {}\n\ninterface SidebarNavigationGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string;\n icon?: ReactNode;\n}\n\nconst SidebarRoot = forwardRef<\n ComponentRef<typeof Collapsible.Root>,\n SidebarProps\n>(\n (\n {\n className,\n position = \"left\",\n open,\n onOpenChange,\n hideCollapsedItemTooltip,\n children,\n ...props\n },\n ref,\n ) => (\n <SidebarContext.Provider\n value={{ isCollapsed: !open, hideCollapsedItemTooltip }}>\n <TooltipProvider>\n <Collapsible.Root\n ref={ref}\n className={root({ className })}\n data-position={position}\n data-state={open ? \"expanded\" : \"collapsed\"}\n open={open}\n onOpenChange={onOpenChange}\n aria-label=\"Navigation Sidebar\"\n aria-expanded={open}\n role=\"navigation\"\n {...props}\n asChild>\n <aside>\n <Tooltip\n message={open ? \"Click to collapse\" : \"Click to expand\"}\n side={position === \"left\" ? \"right\" : \"left\"}\n asChild>\n <div\n className={styles.resizeHandle}\n onClick={() => onOpenChange?.(!open)}\n role=\"button\"\n tabIndex={0}\n aria-label={open ? \"Collapse sidebar\" : \"Expand sidebar\"}\n onKeyDown={e => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onOpenChange?.(!open);\n }\n }}\n />\n </Tooltip>\n {children}\n </aside>\n </Collapsible.Root>\n </TooltipProvider>\n </SidebarContext.Provider>\n ),\n);\n\nconst SidebarHeader = forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, logo, title, onLogoClick, ...props }, ref) => (\n <div ref={ref} className={styles.header} role=\"banner\" {...props}>\n <div\n className={styles.logo}\n onClick={onLogoClick}\n role={onLogoClick ? \"button\" : undefined}\n tabIndex={onLogoClick ? 0 : undefined}\n onKeyDown={e => {\n if (onLogoClick && (e.key === \"Enter\" || e.key === \" \")) {\n e.preventDefault();\n onLogoClick();\n }\n }}\n style={{ cursor: onLogoClick ? \"pointer\" : undefined }}>\n {logo}\n </div>\n <div className={styles.title} role=\"heading\" aria-level={1}>\n {title}\n </div>\n </div>\n ),\n);\n\nconst SidebarMain = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<\"div\">>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.main}\n role=\"group\"\n aria-label=\"Main navigation\"\n {...props}>\n {children}\n </div>\n ),\n);\n\nconst SidebarFooter = forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.footer}\n role=\"group\"\n aria-label=\"Footer navigation\"\n {...props}>\n {children}\n </div>\n ),\n);\n\nconst SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(\n (\n { classNames, icon, children, active, disabled, as = <a />, ...props },\n ref,\n ) => {\n const { isCollapsed, hideCollapsedItemTooltip } =\n useContext(SidebarContext); // To prevent prop drillng\n\n const content = cloneElement(\n as,\n {\n ref,\n className: clsx(styles[\"nav-item\"], classNames?.root),\n \"data-active\": active,\n \"data-disabled\": disabled,\n role: \"menuitem\",\n \"aria-current\": active ? \"page\" : undefined,\n \"aria-disabled\": disabled,\n ...props,\n },\n <>\n <span\n className={clsx(styles[\"nav-icon\"], classNames?.icon)}\n aria-hidden=\"true\">\n {icon}\n </span>\n {!isCollapsed && <span className={styles[\"nav-text\"]}>{children}</span>}\n </>,\n );\n\n if (isCollapsed && !hideCollapsedItemTooltip) {\n return (\n <Tooltip message={children} side=\"right\">\n {content}\n </Tooltip>\n );\n }\n\n return content;\n },\n);\n\nconst SidebarNavigationGroup = forwardRef<\n HTMLElement,\n SidebarNavigationGroupProps\n>(({ className, name, icon, children, ...props }, ref) => (\n <section ref={ref} className={className} aria-label={name} {...props}>\n <div className={styles[\"nav-group-header\"]}>\n {icon && <span className={styles[\"nav-icon\"]}>{icon}</span>}\n <span className={styles[\"nav-group-name\"]}>{name}</span>\n </div>\n <div className={styles[\"nav-group-items\"]} role=\"list\">\n {children}\n </div>\n </section>\n));\n\nSidebarRoot.displayName = \"Sidebar.Root\";\nSidebarHeader.displayName = \"Sidebar.Header\";\nSidebarMain.displayName = \"Sidebar.Main\";\nSidebarFooter.displayName = \"Sidebar.Footer\";\nSidebarItem.displayName = \"Sidebar.Item\";\nSidebarNavigationGroup.displayName = \"Sidebar.Group\";\n\nexport const Sidebar = Object.assign(SidebarRoot, {\n Header: SidebarHeader,\n Main: SidebarMain,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Group: SidebarNavigationGroup,\n});\n"],"names":["createContext","cva","styles","forwardRef","_jsx","TooltipProvider","Collapsible.Root","_jsxs","Tooltip","useContext","cloneElement","clsx"],"mappings":";;;;;;;;;;AAsBA,MAAM,cAAc,GAAGA,mBAAa,CAAsB;AACxD,IAAA,WAAW,EAAE,KAAK;AACnB,CAAA,CAAC,CAAC;AAEH,MAAM,IAAI,GAAGC,WAAG,CAACC,sBAAM,CAAC,IAAI,CAAC,CAAC;AAiC9B,MAAM,WAAW,GAAGC,gBAAU,CAI5B,CACE,EACE,SAAS,EACT,QAAQ,GAAG,MAAM,EACjB,IAAI,EACJ,YAAY,EACZ,wBAAwB,EACxB,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,MAEHC,gCAAA,CAAC,cAAc,CAAC,QAAQ,EACtB,EAAA,KAAK,EAAE,EAA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AC7C,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AACzC,sBAAsB,CAAC,WAAW,GAAG,eAAe,CAAC;MAExC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;AAChD,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,KAAK,EAAE,sBAAsB;AAC9B,CAAA;;;;"}
1
+ {"version":3,"file":"sidebar.cjs","sources":["../../../../v1/components/sidebar/sidebar.tsx"],"sourcesContent":["import * as Collapsible from '@radix-ui/react-collapsible';\nimport { cva } from 'class-variance-authority';\nimport {\n ComponentPropsWithoutRef,\n ComponentRef,\n ReactElement,\n ReactNode,\n cloneElement,\n createContext,\n forwardRef,\n useContext\n} from 'react';\n\nimport clsx from 'clsx';\nimport { Tooltip, TooltipProvider } from '../tooltip';\nimport styles from './sidebar.module.css';\n\ninterface SidebarContextValue {\n isCollapsed: boolean;\n hideCollapsedItemTooltip?: boolean;\n}\n\nconst SidebarContext = createContext<SidebarContextValue>({\n isCollapsed: false\n});\n\nconst root = cva(styles.root);\n\ninterface SidebarProps\n extends ComponentPropsWithoutRef<typeof Collapsible.Root> {\n position?: 'left' | 'right';\n hideCollapsedItemTooltip?: boolean;\n}\n\ninterface SidebarHeaderProps extends ComponentPropsWithoutRef<'div'> {\n logo: ReactNode;\n title: string;\n onLogoClick?: () => void;\n}\n\ninterface SidebarItemProps extends ComponentPropsWithoutRef<'a'> {\n icon?: ReactNode;\n active?: boolean;\n disabled?: boolean;\n as?: ReactElement;\n classNames?: {\n root?: string;\n icon?: string;\n text?: string;\n };\n}\n\ninterface SidebarFooterProps extends ComponentPropsWithoutRef<'div'> {}\n\ninterface SidebarNavigationGroupProps extends ComponentPropsWithoutRef<'div'> {\n name: string;\n icon?: ReactNode;\n}\n\nconst SidebarRoot = forwardRef<\n ComponentRef<typeof Collapsible.Root>,\n SidebarProps\n>(\n (\n {\n className,\n position = 'left',\n open,\n onOpenChange,\n hideCollapsedItemTooltip,\n children,\n ...props\n },\n ref\n ) => (\n <SidebarContext.Provider\n value={{ isCollapsed: !open, hideCollapsedItemTooltip }}\n >\n <TooltipProvider>\n <Collapsible.Root\n ref={ref}\n className={root({ className })}\n data-position={position}\n data-state={open ? 'expanded' : 'collapsed'}\n open={open}\n onOpenChange={onOpenChange}\n aria-label='Navigation Sidebar'\n aria-expanded={open}\n role='navigation'\n {...props}\n asChild\n >\n <aside>\n <Tooltip\n message={open ? 'Click to collapse' : 'Click to expand'}\n side={position === 'left' ? 'right' : 'left'}\n asChild\n followCursor\n >\n <div\n className={styles.resizeHandle}\n onClick={() => onOpenChange?.(!open)}\n role='button'\n tabIndex={0}\n aria-label={open ? 'Collapse sidebar' : 'Expand sidebar'}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onOpenChange?.(!open);\n }\n }}\n />\n </Tooltip>\n {children}\n </aside>\n </Collapsible.Root>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n);\n\nconst SidebarHeader = forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, logo, title, onLogoClick, ...props }, ref) => (\n <div ref={ref} className={styles.header} role='banner' {...props}>\n <div\n className={styles.logo}\n onClick={onLogoClick}\n role={onLogoClick ? 'button' : undefined}\n tabIndex={onLogoClick ? 0 : undefined}\n onKeyDown={e => {\n if (onLogoClick && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n onLogoClick();\n }\n }}\n style={{ cursor: onLogoClick ? 'pointer' : undefined }}\n >\n {logo}\n </div>\n <div className={styles.title} role='heading' aria-level={1}>\n {title}\n </div>\n </div>\n )\n);\n\nconst SidebarMain = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<'div'>>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.main}\n role='group'\n aria-label='Main navigation'\n {...props}\n >\n {children}\n </div>\n )\n);\n\nconst SidebarFooter = forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.footer}\n role='group'\n aria-label='Footer navigation'\n {...props}\n >\n {children}\n </div>\n )\n);\n\nconst SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(\n (\n { classNames, icon, children, active, disabled, as = <a />, ...props },\n ref\n ) => {\n const { isCollapsed, hideCollapsedItemTooltip } =\n useContext(SidebarContext); // To prevent prop drillng\n\n const content = cloneElement(\n as,\n {\n ref,\n className: clsx(styles['nav-item'], classNames?.root),\n 'data-active': active,\n 'data-disabled': disabled,\n role: 'menuitem',\n 'aria-current': active ? 'page' : undefined,\n 'aria-disabled': disabled,\n ...props\n },\n <>\n <span\n className={clsx(styles['nav-icon'], classNames?.icon)}\n aria-hidden='true'\n >\n {icon}\n </span>\n {!isCollapsed && <span className={styles['nav-text']}>{children}</span>}\n </>\n );\n\n if (isCollapsed && !hideCollapsedItemTooltip) {\n return (\n <Tooltip message={children} side='right'>\n {content}\n </Tooltip>\n );\n }\n\n return content;\n }\n);\n\nconst SidebarNavigationGroup = forwardRef<\n HTMLElement,\n SidebarNavigationGroupProps\n>(({ className, name, icon, children, ...props }, ref) => (\n <section ref={ref} className={className} aria-label={name} {...props}>\n <div className={styles['nav-group-header']}>\n {icon && <span className={styles['nav-icon']}>{icon}</span>}\n <span className={styles['nav-group-name']}>{name}</span>\n </div>\n <div className={styles['nav-group-items']} role='list'>\n {children}\n </div>\n </section>\n));\n\nSidebarRoot.displayName = 'Sidebar.Root';\nSidebarHeader.displayName = 'Sidebar.Header';\nSidebarMain.displayName = 'Sidebar.Main';\nSidebarFooter.displayName = 'Sidebar.Footer';\nSidebarItem.displayName = 'Sidebar.Item';\nSidebarNavigationGroup.displayName = 'Sidebar.Group';\n\nexport const Sidebar = Object.assign(SidebarRoot, {\n Header: SidebarHeader,\n Main: SidebarMain,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Group: SidebarNavigationGroup\n});\n"],"names":["createContext","cva","styles","forwardRef","_jsx","TooltipProvider","Collapsible.Root","_jsxs","Tooltip","useContext","cloneElement","clsx"],"mappings":";;;;;;;;;;AAsBA,MAAM,cAAc,GAAGA,mBAAa,CAAsB;AACxD,IAAA,WAAW,EAAE,KAAK;AACnB,CAAA,CAAC,CAAC;AAEH,MAAM,IAAI,GAAGC,WAAG,CAACC,sBAAM,CAAC,IAAI,CAAC,CAAC;AAiC9B,MAAM,WAAW,GAAGC,gBAAU,CAI5B,CACE,EACE,SAAS,EACT,QAAQ,GAAG,MAAM,EACjB,IAAI,EACJ,YAAY,EACZ,wBAAwB,EACxB,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,MAEHC,gCAAC,CAAA,cAAc,CAAC,QAAQ,IACtB,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,YAEvDA,gCAAC,CAAAC,uBAAe,cACdD,gCAAC,CAAAE,UAAgB,EAAA,EACf,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,EAAA,eAAA,EACf,QAAQ,EACX,YAAA,EAAA,IAAI,GAAG,UAAU,GAAG,WAAW,EAC3C,IAAI,EAAE,IAAI,EACV,YAAY,EAAE,YAAY,EAAA,YAAA,EACf,oBAAoB,EAAA,eAAA,EAChB,IAAI,EACnB,IAAI,EAAC,YAAY,EAAA,GACb,KAAK,EACT,OAAO,EAEP,IAAA,EAAA,QAAA,EAAAC,iCAAA,CAAA,OAAA,EAAA,EAAA,QAAA,EAAA,CACEH,iCAACI,eAAO,EAAA,EACN,OAAO,EAAE,IAAI,GAAG,mBAAmB,GAAG,iBAAiB,EACvD,IAAI,EAAE,QAAQ,KAAK,MAAM,GAAG,OAAO,GAAG,MAAM,EAC5C,OAAO,EAAA,IAAA,EACP,YAAY,EAAA,IAAA,EAAA,QAAA,EAEZJ,0CACE,SAAS,EAAEF,sBAAM,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gCAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAEF,sBAAM,CAAC,UAAU,CAAC,EAAA,QAAA,EAAG,IAAI,EAAA,CAAQ,EAC3DE,gCAAM,CAAA,MAAA,EAAA,EAAA,SAAS,EAAEF,sBAAM,CAAC,gBAAgB,CAAC,EAAA,QAAA,EAAG,IAAI,EAAA,CAAQ,IACpD,EACNE,gCAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEF,sBAAM,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAC,MAAM,EACnD,QAAA,EAAA,QAAQ,GACL,CACE,EAAA,CAAA,CACX,CAAC,CAAC;AAEH,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AACzC,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC7C,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AACzC,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC7C,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AACzC,sBAAsB,CAAC,WAAW,GAAG,eAAe,CAAC;MAExC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;AAChD,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,KAAK,EAAE,sBAAsB;AAC9B,CAAA;;;;"}
@@ -1,16 +1,16 @@
1
- import * as Collapsible from "@radix-ui/react-collapsible";
2
- import { ComponentPropsWithoutRef, ReactNode, ReactElement } from "react";
1
+ import * as Collapsible from '@radix-ui/react-collapsible';
2
+ import { ComponentPropsWithoutRef, ReactElement, ReactNode } from 'react';
3
3
  interface SidebarProps extends ComponentPropsWithoutRef<typeof Collapsible.Root> {
4
- position?: "left" | "right";
4
+ position?: 'left' | 'right';
5
5
  hideCollapsedItemTooltip?: boolean;
6
6
  }
7
- interface SidebarHeaderProps extends ComponentPropsWithoutRef<"div"> {
7
+ interface SidebarHeaderProps extends ComponentPropsWithoutRef<'div'> {
8
8
  logo: ReactNode;
9
9
  title: string;
10
10
  onLogoClick?: () => void;
11
11
  }
12
- interface SidebarItemProps extends ComponentPropsWithoutRef<"a"> {
13
- icon: ReactNode;
12
+ interface SidebarItemProps extends ComponentPropsWithoutRef<'a'> {
13
+ icon?: ReactNode;
14
14
  active?: boolean;
15
15
  disabled?: boolean;
16
16
  as?: ReactElement;
@@ -20,9 +20,9 @@ interface SidebarItemProps extends ComponentPropsWithoutRef<"a"> {
20
20
  text?: string;
21
21
  };
22
22
  }
23
- interface SidebarFooterProps extends ComponentPropsWithoutRef<"div"> {
23
+ interface SidebarFooterProps extends ComponentPropsWithoutRef<'div'> {
24
24
  }
25
- interface SidebarNavigationGroupProps extends ComponentPropsWithoutRef<"div"> {
25
+ interface SidebarNavigationGroupProps extends ComponentPropsWithoutRef<'div'> {
26
26
  name: string;
27
27
  icon?: ReactNode;
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../../v1/components/sidebar/sidebar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,WAAW,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EACL,wBAAwB,EAGxB,SAAS,EAGT,YAAY,EAEb,MAAM,OAAO,CAAC;AAiBf,UAAU,YACR,SAAQ,wBAAwB,CAAC,OAAO,WAAW,CAAC,IAAI,CAAC;IACzD,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,wBAAwB,CAAC,EAAE,OAAO,CAAC;CACpC;AAED,UAAU,kBAAmB,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IAClE,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AAED,UAAU,gBAAiB,SAAQ,wBAAwB,CAAC,GAAG,CAAC;IAC9D,IAAI,EAAE,SAAS,CAAC;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AAC,EAAE;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC;CACH;AAED,UAAU,kBAAmB,SAAQ,wBAAwB,CAAC,KAAK,CAAC;CAAG;AAEvE,UAAU,2BAA4B,SAAQ,wBAAwB,CAAC,KAAK,CAAC;IAC3E,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAsLD,eAAO,MAAM,OAAO;;;;;;CAMlB,CAAC"}
@@ -2,58 +2,58 @@ import { j as jsxRuntimeExports } from '../../node_modules/.pnpm/react@18.2.0/no
2
2
  import { Root } from '../../node_modules/.pnpm/@radix-ui_react-collapsible@1.1.2_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18._hjslo7xm5vmo3b4sx344jkbtcq/node_modules/@radix-ui/react-collapsible/dist/index.js';
3
3
  import { cva } from '../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js';
4
4
  import { createContext, forwardRef, useContext, cloneElement } from 'react';
5
+ import { clsx } from '../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js';
5
6
  import { TooltipProvider, Tooltip } from '../tooltip/tooltip.js';
6
7
  import styles from './sidebar.module.css.js';
7
- import { clsx } from '../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.js';
8
8
 
9
9
  const SidebarContext = createContext({
10
- isCollapsed: false,
10
+ isCollapsed: false
11
11
  });
12
12
  const root = cva(styles.root);
13
- const SidebarRoot = forwardRef(({ className, position = "left", open, onOpenChange, hideCollapsedItemTooltip, children, ...props }, ref) => (jsxRuntimeExports.jsx(SidebarContext.Provider, { value: { isCollapsed: !open, hideCollapsedItemTooltip }, children: jsxRuntimeExports.jsx(TooltipProvider, { children: jsxRuntimeExports.jsx(Root, { ref: ref, className: root({ className }), "data-position": position, "data-state": open ? "expanded" : "collapsed", open: open, onOpenChange: onOpenChange, "aria-label": "Navigation Sidebar", "aria-expanded": open, role: "navigation", ...props, asChild: true, children: jsxRuntimeExports.jsxs("aside", { children: [jsxRuntimeExports.jsx(Tooltip, { message: open ? "Click to collapse" : "Click to expand", side: position === "left" ? "right" : "left", asChild: true, children: jsxRuntimeExports.jsx("div", { className: styles.resizeHandle, onClick: () => onOpenChange?.(!open), role: "button", tabIndex: 0, "aria-label": open ? "Collapse sidebar" : "Expand sidebar", onKeyDown: e => {
14
- if (e.key === "Enter" || e.key === " ") {
13
+ const SidebarRoot = forwardRef(({ className, position = 'left', open, onOpenChange, hideCollapsedItemTooltip, children, ...props }, ref) => (jsxRuntimeExports.jsx(SidebarContext.Provider, { value: { isCollapsed: !open, hideCollapsedItemTooltip }, children: jsxRuntimeExports.jsx(TooltipProvider, { children: jsxRuntimeExports.jsx(Root, { ref: ref, className: root({ className }), "data-position": position, "data-state": open ? 'expanded' : 'collapsed', open: open, onOpenChange: onOpenChange, "aria-label": 'Navigation Sidebar', "aria-expanded": open, role: 'navigation', ...props, asChild: true, children: jsxRuntimeExports.jsxs("aside", { children: [jsxRuntimeExports.jsx(Tooltip, { message: open ? 'Click to collapse' : 'Click to expand', side: position === 'left' ? 'right' : 'left', asChild: true, followCursor: true, children: jsxRuntimeExports.jsx("div", { className: styles.resizeHandle, onClick: () => onOpenChange?.(!open), role: 'button', tabIndex: 0, "aria-label": open ? 'Collapse sidebar' : 'Expand sidebar', onKeyDown: e => {
14
+ if (e.key === 'Enter' || e.key === ' ') {
15
15
  e.preventDefault();
16
16
  onOpenChange?.(!open);
17
17
  }
18
18
  } }) }), children] }) }) }) })));
19
- const SidebarHeader = forwardRef(({ className, logo, title, onLogoClick, ...props }, ref) => (jsxRuntimeExports.jsxs("div", { ref: ref, className: styles.header, role: "banner", ...props, children: [jsxRuntimeExports.jsx("div", { className: styles.logo, onClick: onLogoClick, role: onLogoClick ? "button" : undefined, tabIndex: onLogoClick ? 0 : undefined, onKeyDown: e => {
20
- if (onLogoClick && (e.key === "Enter" || e.key === " ")) {
19
+ const SidebarHeader = forwardRef(({ className, logo, title, onLogoClick, ...props }, ref) => (jsxRuntimeExports.jsxs("div", { ref: ref, className: styles.header, role: 'banner', ...props, children: [jsxRuntimeExports.jsx("div", { className: styles.logo, onClick: onLogoClick, role: onLogoClick ? 'button' : undefined, tabIndex: onLogoClick ? 0 : undefined, onKeyDown: e => {
20
+ if (onLogoClick && (e.key === 'Enter' || e.key === ' ')) {
21
21
  e.preventDefault();
22
22
  onLogoClick();
23
23
  }
24
- }, style: { cursor: onLogoClick ? "pointer" : undefined }, children: logo }), jsxRuntimeExports.jsx("div", { className: styles.title, role: "heading", "aria-level": 1, children: title })] })));
25
- const SidebarMain = forwardRef(({ className, children, ...props }, ref) => (jsxRuntimeExports.jsx("div", { ref: ref, className: styles.main, role: "group", "aria-label": "Main navigation", ...props, children: children })));
26
- const SidebarFooter = forwardRef(({ className, children, ...props }, ref) => (jsxRuntimeExports.jsx("div", { ref: ref, className: styles.footer, role: "group", "aria-label": "Footer navigation", ...props, children: children })));
24
+ }, style: { cursor: onLogoClick ? 'pointer' : undefined }, children: logo }), jsxRuntimeExports.jsx("div", { className: styles.title, role: 'heading', "aria-level": 1, children: title })] })));
25
+ const SidebarMain = forwardRef(({ className, children, ...props }, ref) => (jsxRuntimeExports.jsx("div", { ref: ref, className: styles.main, role: 'group', "aria-label": 'Main navigation', ...props, children: children })));
26
+ const SidebarFooter = forwardRef(({ className, children, ...props }, ref) => (jsxRuntimeExports.jsx("div", { ref: ref, className: styles.footer, role: 'group', "aria-label": 'Footer navigation', ...props, children: children })));
27
27
  const SidebarItem = forwardRef(({ classNames, icon, children, active, disabled, as = jsxRuntimeExports.jsx("a", {}), ...props }, ref) => {
28
28
  const { isCollapsed, hideCollapsedItemTooltip } = useContext(SidebarContext); // To prevent prop drillng
29
29
  const content = cloneElement(as, {
30
30
  ref,
31
- className: clsx(styles["nav-item"], classNames?.root),
32
- "data-active": active,
33
- "data-disabled": disabled,
34
- role: "menuitem",
35
- "aria-current": active ? "page" : undefined,
36
- "aria-disabled": disabled,
37
- ...props,
38
- }, jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { className: clsx(styles["nav-icon"], classNames?.icon), "aria-hidden": "true", children: icon }), !isCollapsed && jsxRuntimeExports.jsx("span", { className: styles["nav-text"], children: children })] }));
31
+ className: clsx(styles['nav-item'], classNames?.root),
32
+ 'data-active': active,
33
+ 'data-disabled': disabled,
34
+ role: 'menuitem',
35
+ 'aria-current': active ? 'page' : undefined,
36
+ 'aria-disabled': disabled,
37
+ ...props
38
+ }, jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("span", { className: clsx(styles['nav-icon'], classNames?.icon), "aria-hidden": 'true', children: icon }), !isCollapsed && jsxRuntimeExports.jsx("span", { className: styles['nav-text'], children: children })] }));
39
39
  if (isCollapsed && !hideCollapsedItemTooltip) {
40
- return (jsxRuntimeExports.jsx(Tooltip, { message: children, side: "right", children: content }));
40
+ return (jsxRuntimeExports.jsx(Tooltip, { message: children, side: 'right', children: content }));
41
41
  }
42
42
  return content;
43
43
  });
44
- const SidebarNavigationGroup = forwardRef(({ className, name, icon, children, ...props }, ref) => (jsxRuntimeExports.jsxs("section", { ref: ref, className: className, "aria-label": name, ...props, children: [jsxRuntimeExports.jsxs("div", { className: styles["nav-group-header"], children: [icon && jsxRuntimeExports.jsx("span", { className: styles["nav-icon"], children: icon }), jsxRuntimeExports.jsx("span", { className: styles["nav-group-name"], children: name })] }), jsxRuntimeExports.jsx("div", { className: styles["nav-group-items"], role: "list", children: children })] })));
45
- SidebarRoot.displayName = "Sidebar.Root";
46
- SidebarHeader.displayName = "Sidebar.Header";
47
- SidebarMain.displayName = "Sidebar.Main";
48
- SidebarFooter.displayName = "Sidebar.Footer";
49
- SidebarItem.displayName = "Sidebar.Item";
50
- SidebarNavigationGroup.displayName = "Sidebar.Group";
44
+ const SidebarNavigationGroup = forwardRef(({ className, name, icon, children, ...props }, ref) => (jsxRuntimeExports.jsxs("section", { ref: ref, className: className, "aria-label": name, ...props, children: [jsxRuntimeExports.jsxs("div", { className: styles['nav-group-header'], children: [icon && jsxRuntimeExports.jsx("span", { className: styles['nav-icon'], children: icon }), jsxRuntimeExports.jsx("span", { className: styles['nav-group-name'], children: name })] }), jsxRuntimeExports.jsx("div", { className: styles['nav-group-items'], role: 'list', children: children })] })));
45
+ SidebarRoot.displayName = 'Sidebar.Root';
46
+ SidebarHeader.displayName = 'Sidebar.Header';
47
+ SidebarMain.displayName = 'Sidebar.Main';
48
+ SidebarFooter.displayName = 'Sidebar.Footer';
49
+ SidebarItem.displayName = 'Sidebar.Item';
50
+ SidebarNavigationGroup.displayName = 'Sidebar.Group';
51
51
  const Sidebar = Object.assign(SidebarRoot, {
52
52
  Header: SidebarHeader,
53
53
  Main: SidebarMain,
54
54
  Footer: SidebarFooter,
55
55
  Item: SidebarItem,
56
- Group: SidebarNavigationGroup,
56
+ Group: SidebarNavigationGroup
57
57
  });
58
58
 
59
59
  export { Sidebar };
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.js","sources":["../../../../v1/components/sidebar/sidebar.tsx"],"sourcesContent":["import * as Collapsible from \"@radix-ui/react-collapsible\";\nimport { cva } from \"class-variance-authority\";\nimport {\n ComponentPropsWithoutRef,\n ComponentRef,\n forwardRef,\n ReactNode,\n createContext,\n useContext,\n ReactElement,\n cloneElement,\n} from \"react\";\n\nimport { Tooltip, TooltipProvider } from \"../tooltip\";\nimport styles from \"./sidebar.module.css\";\nimport clsx from \"clsx\";\n\ninterface SidebarContextValue {\n isCollapsed: boolean;\n hideCollapsedItemTooltip?: boolean;\n}\n\nconst SidebarContext = createContext<SidebarContextValue>({\n isCollapsed: false,\n});\n\nconst root = cva(styles.root);\n\ninterface SidebarProps\n extends ComponentPropsWithoutRef<typeof Collapsible.Root> {\n position?: \"left\" | \"right\";\n hideCollapsedItemTooltip?: boolean;\n}\n\ninterface SidebarHeaderProps extends ComponentPropsWithoutRef<\"div\"> {\n logo: ReactNode;\n title: string;\n onLogoClick?: () => void;\n}\n\ninterface SidebarItemProps extends ComponentPropsWithoutRef<\"a\"> {\n icon: ReactNode;\n active?: boolean;\n disabled?: boolean;\n as?: ReactElement;\n classNames?: {\n root?: string;\n icon?: string;\n text?: string;\n };\n}\n\ninterface SidebarFooterProps extends ComponentPropsWithoutRef<\"div\"> {}\n\ninterface SidebarNavigationGroupProps extends ComponentPropsWithoutRef<\"div\"> {\n name: string;\n icon?: ReactNode;\n}\n\nconst SidebarRoot = forwardRef<\n ComponentRef<typeof Collapsible.Root>,\n SidebarProps\n>(\n (\n {\n className,\n position = \"left\",\n open,\n onOpenChange,\n hideCollapsedItemTooltip,\n children,\n ...props\n },\n ref,\n ) => (\n <SidebarContext.Provider\n value={{ isCollapsed: !open, hideCollapsedItemTooltip }}>\n <TooltipProvider>\n <Collapsible.Root\n ref={ref}\n className={root({ className })}\n data-position={position}\n data-state={open ? \"expanded\" : \"collapsed\"}\n open={open}\n onOpenChange={onOpenChange}\n aria-label=\"Navigation Sidebar\"\n aria-expanded={open}\n role=\"navigation\"\n {...props}\n asChild>\n <aside>\n <Tooltip\n message={open ? \"Click to collapse\" : \"Click to expand\"}\n side={position === \"left\" ? \"right\" : \"left\"}\n asChild>\n <div\n className={styles.resizeHandle}\n onClick={() => onOpenChange?.(!open)}\n role=\"button\"\n tabIndex={0}\n aria-label={open ? \"Collapse sidebar\" : \"Expand sidebar\"}\n onKeyDown={e => {\n if (e.key === \"Enter\" || e.key === \" \") {\n e.preventDefault();\n onOpenChange?.(!open);\n }\n }}\n />\n </Tooltip>\n {children}\n </aside>\n </Collapsible.Root>\n </TooltipProvider>\n </SidebarContext.Provider>\n ),\n);\n\nconst SidebarHeader = forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, logo, title, onLogoClick, ...props }, ref) => (\n <div ref={ref} className={styles.header} role=\"banner\" {...props}>\n <div\n className={styles.logo}\n onClick={onLogoClick}\n role={onLogoClick ? \"button\" : undefined}\n tabIndex={onLogoClick ? 0 : undefined}\n onKeyDown={e => {\n if (onLogoClick && (e.key === \"Enter\" || e.key === \" \")) {\n e.preventDefault();\n onLogoClick();\n }\n }}\n style={{ cursor: onLogoClick ? \"pointer\" : undefined }}>\n {logo}\n </div>\n <div className={styles.title} role=\"heading\" aria-level={1}>\n {title}\n </div>\n </div>\n ),\n);\n\nconst SidebarMain = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<\"div\">>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.main}\n role=\"group\"\n aria-label=\"Main navigation\"\n {...props}>\n {children}\n </div>\n ),\n);\n\nconst SidebarFooter = forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.footer}\n role=\"group\"\n aria-label=\"Footer navigation\"\n {...props}>\n {children}\n </div>\n ),\n);\n\nconst SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(\n (\n { classNames, icon, children, active, disabled, as = <a />, ...props },\n ref,\n ) => {\n const { isCollapsed, hideCollapsedItemTooltip } =\n useContext(SidebarContext); // To prevent prop drillng\n\n const content = cloneElement(\n as,\n {\n ref,\n className: clsx(styles[\"nav-item\"], classNames?.root),\n \"data-active\": active,\n \"data-disabled\": disabled,\n role: \"menuitem\",\n \"aria-current\": active ? \"page\" : undefined,\n \"aria-disabled\": disabled,\n ...props,\n },\n <>\n <span\n className={clsx(styles[\"nav-icon\"], classNames?.icon)}\n aria-hidden=\"true\">\n {icon}\n </span>\n {!isCollapsed && <span className={styles[\"nav-text\"]}>{children}</span>}\n </>,\n );\n\n if (isCollapsed && !hideCollapsedItemTooltip) {\n return (\n <Tooltip message={children} side=\"right\">\n {content}\n </Tooltip>\n );\n }\n\n return content;\n },\n);\n\nconst SidebarNavigationGroup = forwardRef<\n HTMLElement,\n SidebarNavigationGroupProps\n>(({ className, name, icon, children, ...props }, ref) => (\n <section ref={ref} className={className} aria-label={name} {...props}>\n <div className={styles[\"nav-group-header\"]}>\n {icon && <span className={styles[\"nav-icon\"]}>{icon}</span>}\n <span className={styles[\"nav-group-name\"]}>{name}</span>\n </div>\n <div className={styles[\"nav-group-items\"]} role=\"list\">\n {children}\n </div>\n </section>\n));\n\nSidebarRoot.displayName = \"Sidebar.Root\";\nSidebarHeader.displayName = \"Sidebar.Header\";\nSidebarMain.displayName = \"Sidebar.Main\";\nSidebarFooter.displayName = \"Sidebar.Footer\";\nSidebarItem.displayName = \"Sidebar.Item\";\nSidebarNavigationGroup.displayName = \"Sidebar.Group\";\n\nexport const Sidebar = Object.assign(SidebarRoot, {\n Header: SidebarHeader,\n Main: SidebarMain,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Group: SidebarNavigationGroup,\n});\n"],"names":["_jsx","Collapsible.Root","_jsxs"],"mappings":";;;;;;;;AAsBA,MAAM,cAAc,GAAG,aAAa,CAAsB;AACxD,IAAA,WAAW,EAAE,KAAK;AACnB,CAAA,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAiC9B,MAAM,WAAW,GAAG,UAAU,CAI5B,CACE,EACE,SAAS,EACT,QAAQ,GAAG,MAAM,EACjB,IAAI,EACJ,YAAY,EACZ,wBAAwB,EACxB,QAAQ,EACR,GAAG,KAAK,EACT,EACD,GAAG,MAEHA,qBAAA,CAAC,cAAc,CAAC,QAAQ,EACtB,EAAA,KAAK,EAAE,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,wBAAwB,EAAE,EACvD,QAAA,EAAAA,qBAAA,CAAC,eAAe,EACd,EAAA,QAAA,EAAAA,qBAAA,CAACC,IAAgB,EACf,EAAA,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,IAAI,CAAC,EAAE,SAAS,EAAE,CAAC,mBACf,QAAQ,EAAA,YAAA,EACX,IAAI,GAAG,UAAU,GAA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
+ {"version":3,"file":"sidebar.js","sources":["../../../../v1/components/sidebar/sidebar.tsx"],"sourcesContent":["import * as Collapsible from '@radix-ui/react-collapsible';\nimport { cva } from 'class-variance-authority';\nimport {\n ComponentPropsWithoutRef,\n ComponentRef,\n ReactElement,\n ReactNode,\n cloneElement,\n createContext,\n forwardRef,\n useContext\n} from 'react';\n\nimport clsx from 'clsx';\nimport { Tooltip, TooltipProvider } from '../tooltip';\nimport styles from './sidebar.module.css';\n\ninterface SidebarContextValue {\n isCollapsed: boolean;\n hideCollapsedItemTooltip?: boolean;\n}\n\nconst SidebarContext = createContext<SidebarContextValue>({\n isCollapsed: false\n});\n\nconst root = cva(styles.root);\n\ninterface SidebarProps\n extends ComponentPropsWithoutRef<typeof Collapsible.Root> {\n position?: 'left' | 'right';\n hideCollapsedItemTooltip?: boolean;\n}\n\ninterface SidebarHeaderProps extends ComponentPropsWithoutRef<'div'> {\n logo: ReactNode;\n title: string;\n onLogoClick?: () => void;\n}\n\ninterface SidebarItemProps extends ComponentPropsWithoutRef<'a'> {\n icon?: ReactNode;\n active?: boolean;\n disabled?: boolean;\n as?: ReactElement;\n classNames?: {\n root?: string;\n icon?: string;\n text?: string;\n };\n}\n\ninterface SidebarFooterProps extends ComponentPropsWithoutRef<'div'> {}\n\ninterface SidebarNavigationGroupProps extends ComponentPropsWithoutRef<'div'> {\n name: string;\n icon?: ReactNode;\n}\n\nconst SidebarRoot = forwardRef<\n ComponentRef<typeof Collapsible.Root>,\n SidebarProps\n>(\n (\n {\n className,\n position = 'left',\n open,\n onOpenChange,\n hideCollapsedItemTooltip,\n children,\n ...props\n },\n ref\n ) => (\n <SidebarContext.Provider\n value={{ isCollapsed: !open, hideCollapsedItemTooltip }}\n >\n <TooltipProvider>\n <Collapsible.Root\n ref={ref}\n className={root({ className })}\n data-position={position}\n data-state={open ? 'expanded' : 'collapsed'}\n open={open}\n onOpenChange={onOpenChange}\n aria-label='Navigation Sidebar'\n aria-expanded={open}\n role='navigation'\n {...props}\n asChild\n >\n <aside>\n <Tooltip\n message={open ? 'Click to collapse' : 'Click to expand'}\n side={position === 'left' ? 'right' : 'left'}\n asChild\n followCursor\n >\n <div\n className={styles.resizeHandle}\n onClick={() => onOpenChange?.(!open)}\n role='button'\n tabIndex={0}\n aria-label={open ? 'Collapse sidebar' : 'Expand sidebar'}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onOpenChange?.(!open);\n }\n }}\n />\n </Tooltip>\n {children}\n </aside>\n </Collapsible.Root>\n </TooltipProvider>\n </SidebarContext.Provider>\n )\n);\n\nconst SidebarHeader = forwardRef<HTMLDivElement, SidebarHeaderProps>(\n ({ className, logo, title, onLogoClick, ...props }, ref) => (\n <div ref={ref} className={styles.header} role='banner' {...props}>\n <div\n className={styles.logo}\n onClick={onLogoClick}\n role={onLogoClick ? 'button' : undefined}\n tabIndex={onLogoClick ? 0 : undefined}\n onKeyDown={e => {\n if (onLogoClick && (e.key === 'Enter' || e.key === ' ')) {\n e.preventDefault();\n onLogoClick();\n }\n }}\n style={{ cursor: onLogoClick ? 'pointer' : undefined }}\n >\n {logo}\n </div>\n <div className={styles.title} role='heading' aria-level={1}>\n {title}\n </div>\n </div>\n )\n);\n\nconst SidebarMain = forwardRef<HTMLDivElement, ComponentPropsWithoutRef<'div'>>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.main}\n role='group'\n aria-label='Main navigation'\n {...props}\n >\n {children}\n </div>\n )\n);\n\nconst SidebarFooter = forwardRef<HTMLDivElement, SidebarFooterProps>(\n ({ className, children, ...props }, ref) => (\n <div\n ref={ref}\n className={styles.footer}\n role='group'\n aria-label='Footer navigation'\n {...props}\n >\n {children}\n </div>\n )\n);\n\nconst SidebarItem = forwardRef<HTMLAnchorElement, SidebarItemProps>(\n (\n { classNames, icon, children, active, disabled, as = <a />, ...props },\n ref\n ) => {\n const { isCollapsed, hideCollapsedItemTooltip } =\n useContext(SidebarContext); // To prevent prop drillng\n\n const content = cloneElement(\n as,\n {\n ref,\n className: clsx(styles['nav-item'], classNames?.root),\n 'data-active': active,\n 'data-disabled': disabled,\n role: 'menuitem',\n 'aria-current': active ? 'page' : undefined,\n 'aria-disabled': disabled,\n ...props\n },\n <>\n <span\n className={clsx(styles['nav-icon'], classNames?.icon)}\n aria-hidden='true'\n >\n {icon}\n </span>\n {!isCollapsed && <span className={styles['nav-text']}>{children}</span>}\n </>\n );\n\n if (isCollapsed && !hideCollapsedItemTooltip) {\n return (\n <Tooltip message={children} side='right'>\n {content}\n </Tooltip>\n );\n }\n\n return content;\n }\n);\n\nconst SidebarNavigationGroup = forwardRef<\n HTMLElement,\n SidebarNavigationGroupProps\n>(({ className, name, icon, children, ...props }, ref) => (\n <section ref={ref} className={className} aria-label={name} {...props}>\n <div className={styles['nav-group-header']}>\n {icon && <span className={styles['nav-icon']}>{icon}</span>}\n <span className={styles['nav-group-name']}>{name}</span>\n </div>\n <div className={styles['nav-group-items']} role='list'>\n {children}\n </div>\n </section>\n));\n\nSidebarRoot.displayName = 'Sidebar.Root';\nSidebarHeader.displayName = 'Sidebar.Header';\nSidebarMain.displayName = 'Sidebar.Main';\nSidebarFooter.displayName = 'Sidebar.Footer';\nSidebarItem.displayName = 'Sidebar.Item';\nSidebarNavigationGroup.displayName = 'Sidebar.Group';\n\nexport const Sidebar = Object.assign(SidebarRoot, {\n Header: SidebarHeader,\n Main: SidebarMain,\n Footer: SidebarFooter,\n Item: SidebarItem,\n Group: SidebarNavigationGroup\n});\n"],"names":["_jsx","Collapsible.Root","_jsxs"],"mappings":";;;;;;;;AAsBA,MAAM,cAAc,GAAG,aAAa,CAAsB;AACxD,IAAA,WAAW,EAAE,KAAK;AACnB,CAAA,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAiC9B,MAAM,WAAW,GAAG,UAAU,CAI5B,CACE,EACE,SAAS,EACT,QAAQ,GAAG,MAAM,EACjB,IA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,CAAC;AACzC,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC7C,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AACzC,aAAa,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAC7C,WAAW,CAAC,WAAW,GAAG,cAAc,CAAC;AACzC,sBAAsB,CAAC,WAAW,GAAG,eAAe,CAAC;MAExC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;AAChD,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,MAAM,EAAE,aAAa;AACrB,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,KAAK,EAAE,sBAAsB;AAC9B,CAAA;;;;"}
@@ -4,8 +4,10 @@ var jsxRuntime = require('../../node_modules/.pnpm/react@18.2.0/node_modules/rea
4
4
  var index = require('../../node_modules/.pnpm/@radix-ui_react-tooltip@1.0.7_@types_react-dom@18.0.11_@types_react@18.2.12_react-dom@18.3.1_react@18.2.0__react@18.2.0/node_modules/@radix-ui/react-tooltip/dist/index.cjs');
5
5
  var index$1 = require('../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.cjs');
6
6
  var React = require('react');
7
+ var useMouse = require('../../hooks/useMouse.cjs');
7
8
  var text = require('../text/text.cjs');
8
9
  var tooltip_module = require('./tooltip.module.css.cjs');
10
+ var utils = require('./utils.cjs');
9
11
 
10
12
  const tooltip = index$1.cva(tooltip_module.default.content, {
11
13
  variants: {
@@ -24,16 +26,28 @@ const tooltip = index$1.cva(tooltip_module.default.content, {
24
26
  side: 'top'
25
27
  }
26
28
  });
27
- const Tooltip = ({ children, message, disabled, side = 'top', classNames, triggerStyle, contentStyle, delayDuration = 200, skipDelayDuration = 200, 'aria-label': ariaLabel, asChild = true, showArrow = true, id }) => {
29
+ const Tooltip = ({ children, message, disabled, side = 'top', classNames, triggerStyle, contentStyle, delayDuration = 200, skipDelayDuration = 200, 'aria-label': ariaLabel, asChild = true, showArrow = true, id, followCursor = false, sideOffset = 4, alignOffset = 0 }) => {
28
30
  const generatedId = React.useId();
29
31
  const tooltipId = id ?? generatedId;
32
+ const { ref, value: mouseValue, reset } = useMouse.useMouse({
33
+ resetOnExit: false,
34
+ enabled: followCursor
35
+ });
36
+ const computedSide = React.useMemo(() => (side?.split('-')[0] || 'top'), [side]);
37
+ const computedAlign = React.useMemo(() => (side?.includes('-')
38
+ ? side.split('-')[1] === 'left'
39
+ ? 'start'
40
+ : 'end'
41
+ : 'center'), [side]);
30
42
  if (disabled)
31
43
  return children;
32
- return (jsxRuntime.jsxRuntimeExports.jsx(index.Provider, { delayDuration: delayDuration, skipDelayDuration: skipDelayDuration, children: jsxRuntime.jsxRuntimeExports.jsxs(index.Root, { children: [jsxRuntime.jsxRuntimeExports.jsx(index.Trigger, { "aria-describedby": tooltipId, asChild: asChild, children: jsxRuntime.jsxRuntimeExports.jsx("div", { className: index$1.cx(tooltip_module.default.trigger, classNames?.trigger), style: triggerStyle, children: children }) }), jsxRuntime.jsxRuntimeExports.jsx(index.Portal, { children: jsxRuntime.jsxRuntimeExports.jsxs(index.Content, { id: tooltipId, role: 'tooltip', "aria-label": ariaLabel || (typeof message === 'string' ? message : undefined), side: side?.split('-')[0] || 'top', align: (side?.includes('-')
33
- ? side.split('-')[1] === 'left'
34
- ? 'start'
35
- : 'end'
36
- : 'center'), sideOffset: 4, className: tooltip({ side, className: classNames?.content }), style: contentStyle, children: [typeof message === 'string' ? jsxRuntime.jsxRuntimeExports.jsx(text.Text, { children: message }) : message, showArrow && (jsxRuntime.jsxRuntimeExports.jsx(index.Arrow, { className: index$1.cx(tooltip_module.default.arrow, classNames?.arrow), width: 7, height: 7 }))] }) })] }) }));
44
+ return (jsxRuntime.jsxRuntimeExports.jsx(index.Provider, { delayDuration: delayDuration, skipDelayDuration: skipDelayDuration, children: jsxRuntime.jsxRuntimeExports.jsxs(index.Root, { children: [jsxRuntime.jsxRuntimeExports.jsx(index.Trigger, { "aria-describedby": tooltipId, asChild: asChild, onFocus: followCursor ? reset : undefined, children: jsxRuntime.jsxRuntimeExports.jsx("div", { ref: ref, className: index$1.cx(tooltip_module.default.trigger, classNames?.trigger), style: triggerStyle, children: children }) }), jsxRuntime.jsxRuntimeExports.jsx(index.Portal, { children: jsxRuntime.jsxRuntimeExports.jsxs(index.Content, { id: tooltipId, role: 'tooltip', "aria-label": ariaLabel || (typeof message === 'string' ? message : undefined), side: computedSide, align: computedAlign, alignOffset: alignOffset, sideOffset: sideOffset, className: tooltip({ side, className: classNames?.content }), "data-follow-cursor": followCursor, style: {
45
+ ...contentStyle,
46
+ pointerEvents: followCursor ? 'none' : undefined,
47
+ transform: followCursor && mouseValue
48
+ ? utils.getTransformForPlacement(computedSide, computedAlign, mouseValue)
49
+ : undefined
50
+ }, children: [typeof message === 'string' ? jsxRuntime.jsxRuntimeExports.jsx(text.Text, { children: message }) : message, showArrow && (jsxRuntime.jsxRuntimeExports.jsx(index.Arrow, { className: index$1.cx(tooltip_module.default.arrow, classNames?.arrow), width: 7, height: 7 }))] }) })] }) }));
37
51
  };
38
52
  Tooltip.displayName = 'Tooltip';
39
53
  const TooltipProvider = index.Provider;
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.cjs","sources":["../../../../v1/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport React, { useId } from 'react';\nimport { Text } from '../text';\nimport styles from './tooltip.module.css';\n\nconst tooltip = cva(styles.content, {\n variants: {\n side: {\n top: styles['side-top'],\n right: styles['side-right'],\n bottom: styles['side-bottom'],\n left: styles['side-left'],\n 'top-left': styles['side-top-left'],\n 'top-right': styles['side-top-right'],\n 'bottom-left': styles['side-bottom-left'],\n 'bottom-right': styles['side-bottom-right']\n }\n },\n defaultVariants: {\n side: 'top'\n }\n});\n\ninterface TooltipProps extends VariantProps<typeof tooltip> {\n disabled?: boolean;\n children: React.ReactNode;\n message: React.ReactNode;\n classNames?: {\n trigger?: string;\n content?: string;\n arrow?: string;\n };\n triggerStyle?: React.CSSProperties;\n contentStyle?: React.CSSProperties;\n delayDuration?: number;\n skipDelayDuration?: number;\n 'aria-label'?: string;\n asChild?: boolean;\n id?: string;\n showArrow?: boolean;\n}\n\nexport const Tooltip: React.FC<TooltipProps> = ({\n children,\n message,\n disabled,\n side = 'top',\n classNames,\n triggerStyle,\n contentStyle,\n delayDuration = 200,\n skipDelayDuration = 200,\n 'aria-label': ariaLabel,\n asChild = true,\n showArrow = true,\n id\n}) => {\n const generatedId = useId();\n const tooltipId = id ?? generatedId;\n\n if (disabled) return children;\n\n return (\n <TooltipPrimitive.Provider\n delayDuration={delayDuration}\n skipDelayDuration={skipDelayDuration}\n >\n <TooltipPrimitive.Root>\n <TooltipPrimitive.Trigger\n aria-describedby={tooltipId}\n asChild={asChild}\n >\n <div\n className={cx(styles.trigger, classNames?.trigger)}\n style={triggerStyle}\n >\n {children}\n </div>\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n id={tooltipId}\n role='tooltip'\n aria-label={\n ariaLabel || (typeof message === 'string' ? message : undefined)\n }\n side={\n (side?.split(\n '-'\n )[0] as TooltipPrimitive.TooltipContentProps['side']) || 'top'\n }\n align={\n (side?.includes('-')\n ? side.split('-')[1] === 'left'\n ? 'start'\n : 'end'\n : 'center') satisfies 'start' | 'end' | 'center'\n }\n sideOffset={4}\n className={tooltip({ side, className: classNames?.content })}\n style={contentStyle}\n >\n {typeof message === 'string' ? <Text>{message}</Text> : message}\n {showArrow && (\n <TooltipPrimitive.Arrow\n className={cx(styles.arrow, classNames?.arrow)}\n width={7}\n height={7}\n />\n )}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.Provider>\n );\n};\n\nTooltip.displayName = 'Tooltip';\n\nexport const TooltipProvider = TooltipPrimitive.Provider;\n"],"names":["cva","styles","useId","_jsx","TooltipPrimitive.Provider","_jsxs","TooltipPrimitive.Root","TooltipPrimitive.Trigger","cx","TooltipPrimitive.Portal","TooltipPrimitive.Content","Text","TooltipPrimitive.Arrow"],"mappings":";;;;;;;;;AAMA,MAAM,OAAO,GAAGA,WAAG,CAACC,sBAAM,CAAC,OAAO,EAAE;AAClC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,GAAG,EAAEA,sBAAM,CAAC,UAAU,CAAC;AACvB,YAAA,KAAK,EAAEA,sBAAM,CAAC,YAAY,CAAC;AAC3B,YAAA,MAAM,EAAEA,sBAAM,CAAC,aAAa,CAAC;AAC7B,YAAA,IAAI,EAAEA,sBAAM,CAAC,WAAW,CAAC;AACzB,YAAA,UAAU,EAAEA,sBAAM,CAAC,eAAe,CAAC;AACnC,YAAA,WAAW,EAAEA,sBAAM,CAAC,gBAAgB,CAAC;AACrC,YAAA,aAAa,EAAEA,sBAAM,CAAC,kBAAkB,CAAC;AACzC,YAAA,cAAc,EAAEA,sBAAM,CAAC,mBAAmB,CAAC;AAC5C,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,KAAK;AACZ,KAAA;AACF,CAAA,CAAC,CAAC;MAqBU,OAAO,GAA2B,CAAC,EAC9C,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,IAAI,GAAG,KAAK,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,GAAG,GAAG,EACnB,iBAAiB,GAAG,GAAG,EACvB,YAAY,EAAE,SAAS,EACvB,OAAO,GAAG,IAAI,EACd,SAAS,GAAG,IAAI,EAChB,EAAE,EACH,KAAI;AACH,IAAA,MAAM,WAAW,GAAGC,WAAK,EAAE,CAAC;AAC5B,IAAA,MAAM,SAAS,GAAG,EAAE,IAAI,WAAW,CAAC;AAEpC,IAAA,IAAI,QAAQ;AAAE,QAAA,OAAO,QAAQ,CAAC;IAE9B,QACEC,gCAAC,C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EAAE,UAAU,EAAE,KAAK,CAAC,EAC9C,KAAK,EAAE,CAAC,EACR,MAAM,EAAE,CAAC,GACT,CACH,CAAA,EAAA,CACwB,GACH,CACJ,EAAA,CAAA,EAAA,CACE,EAC5B;AACJ,EAAE;AAEF,OAAO,CAAC,WAAW,GAAG,SAAS,CAAC;AAEnB,MAAA,eAAe,GAAGG;;;;;"}
1
+ {"version":3,"file":"tooltip.cjs","sources":["../../../../v1/components/tooltip/tooltip.tsx"],"sourcesContent":["import * as TooltipPrimitive from '@radix-ui/react-tooltip';\nimport { VariantProps, cva, cx } from 'class-variance-authority';\nimport { CSSProperties, ReactNode, useId, useMemo } from 'react';\nimport { useMouse } from '~/v1/hooks';\nimport { Text } from '../text';\nimport styles from './tooltip.module.css';\nimport { getTransformForPlacement } from './utils';\n\nconst tooltip = cva(styles.content, {\n variants: {\n side: {\n top: styles['side-top'],\n right: styles['side-right'],\n bottom: styles['side-bottom'],\n left: styles['side-left'],\n 'top-left': styles['side-top-left'],\n 'top-right': styles['side-top-right'],\n 'bottom-left': styles['side-bottom-left'],\n 'bottom-right': styles['side-bottom-right']\n }\n },\n defaultVariants: {\n side: 'top'\n }\n});\n\ninterface TooltipProps extends VariantProps<typeof tooltip> {\n disabled?: boolean;\n children: ReactNode;\n message: ReactNode;\n classNames?: {\n trigger?: string;\n content?: string;\n arrow?: string;\n };\n triggerStyle?: CSSProperties;\n contentStyle?: CSSProperties;\n delayDuration?: number;\n skipDelayDuration?: number;\n 'aria-label'?: string;\n asChild?: boolean;\n id?: string;\n showArrow?: boolean;\n followCursor?: boolean;\n sideOffset?: number;\n alignOffset?: number;\n}\ntype TooltipSide = NonNullable<TooltipPrimitive.TooltipContentProps['side']>;\ntype TooltipAlign = NonNullable<TooltipPrimitive.TooltipContentProps['align']>;\n\nexport const Tooltip = ({\n children,\n message,\n disabled,\n side = 'top',\n classNames,\n triggerStyle,\n contentStyle,\n delayDuration = 200,\n skipDelayDuration = 200,\n 'aria-label': ariaLabel,\n asChild = true,\n showArrow = true,\n id,\n followCursor = false,\n sideOffset = 4,\n alignOffset = 0\n}: TooltipProps) => {\n const generatedId = useId();\n const tooltipId = id ?? generatedId;\n const {\n ref,\n value: mouseValue,\n reset\n } = useMouse<HTMLDivElement>({\n resetOnExit: false,\n enabled: followCursor\n });\n\n const computedSide = useMemo(\n () => (side?.split('-')[0] || 'top') as TooltipSide,\n [side]\n );\n const computedAlign = useMemo(\n () =>\n (side?.includes('-')\n ? side.split('-')[1] === 'left'\n ? 'start'\n : 'end'\n : 'center') as TooltipAlign,\n [side]\n );\n\n if (disabled) return children;\n\n return (\n <TooltipPrimitive.Provider\n delayDuration={delayDuration}\n skipDelayDuration={skipDelayDuration}\n >\n <TooltipPrimitive.Root>\n <TooltipPrimitive.Trigger\n aria-describedby={tooltipId}\n asChild={asChild}\n onFocus={followCursor ? reset : undefined}\n >\n <div\n ref={ref}\n className={cx(styles.trigger, classNames?.trigger)}\n style={triggerStyle}\n >\n {children}\n </div>\n </TooltipPrimitive.Trigger>\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n id={tooltipId}\n role='tooltip'\n aria-label={\n ariaLabel || (typeof message === 'string' ? message : undefined)\n }\n side={computedSide}\n align={computedAlign}\n alignOffset={alignOffset}\n sideOffset={sideOffset}\n className={tooltip({ side, className: classNames?.content })}\n data-follow-cursor={followCursor}\n style={{\n ...contentStyle,\n pointerEvents: followCursor ? 'none' : undefined,\n transform:\n followCursor && mouseValue\n ? getTransformForPlacement(\n computedSide,\n computedAlign,\n mouseValue\n )\n : undefined\n }}\n >\n {typeof message === 'string' ? <Text>{message}</Text> : message}\n {showArrow && (\n <TooltipPrimitive.Arrow\n className={cx(styles.arrow, classNames?.arrow)}\n width={7}\n height={7}\n />\n )}\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n </TooltipPrimitive.Root>\n </TooltipPrimitive.Provider>\n );\n};\n\nTooltip.displayName = 'Tooltip';\n\nexport const TooltipProvider = TooltipPrimitive.Provider;\n"],"names":["cva","styles","useId","useMouse","useMemo","_jsx","TooltipPrimitive.Provider","_jsxs","TooltipPrimitive.Root","TooltipPrimitive.Trigger","cx","TooltipPrimitive.Portal","TooltipPrimitive.Content","getTransformForPlacement","Text","TooltipPrimitive.Arrow"],"mappings":";;;;;;;;;;;AAQA,MAAM,OAAO,GAAGA,WAAG,CAACC,sBAAM,CAAC,OAAO,EAAE;AAClC,IAAA,QAAQ,EAAE;AACR,QAAA,IAAI,EAAE;AACJ,YAAA,GAAG,EAAEA,sBAAM,CAAC,UAAU,CAAC;AACvB,YAAA,KAAK,EAAEA,sBAAM,CAAC,YAAY,CAAC;AAC3B,YAAA,MAAM,EAAEA,sBAAM,CAAC,aAAa,CAAC;AAC7B,YAAA,IAAI,EAAEA,sBAAM,CAAC,WAAW,CAAC;AACzB,YAAA,UAAU,EAAEA,sBAAM,CAAC,eAAe,CAAC;AACnC,YAAA,WAAW,EAAEA,sBAAM,CAAC,gBAAgB,CAAC;AACrC,YAAA,aAAa,EAAEA,sBAAM,CAAC,kBAAkB,CAAC;AACzC,YAAA,cAAc,EAAEA,sBAAM,CAAC,mBAAmB,CAAC;AAC5C,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,IAAI,EAAE,KAAK;AACZ,KAAA;AACF,CAAA,CAAC,CAAC;AA0BU,MAAA,OAAO,GAAG,CAAC,EACtB,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,IAAI,GAAG,KAAK,EACZ,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,aAAa,GAAG,GAAG,EACnB,iBAAiB,GAAG,GAAG,EACvB,YAAY,EAAE,SAAS,EACvB,OAAO,GAAG,IAAI,EACd,SAAS,GAAG,IAAI,EAChB,EAAE,EACF,YAAY,GAAG,KAAK,EACpB,UAAU,GAAG,CAAC,EACd,WAAW,GAAG,CAAC,EACF,KAAI;AACjB,IAAA,MAAM,WAAW,GAAGC,WAAK,EAAE,CAAC;AAC5B,IAAA,MAAM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