@synnaxlabs/pluto 0.21.4 → 0.21.5

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 (105) hide show
  1. package/dist/{Keyboard-D_LUXnG3.js → Keyboard-BqO4SYSr.js} +2 -2
  2. package/dist/{Keyboard-D_LUXnG3.js.map → Keyboard-BqO4SYSr.js.map} +1 -1
  3. package/dist/{Keyboard-_Wf2jKAo.cjs → Keyboard-CsgjS96C.cjs} +2 -2
  4. package/dist/{Keyboard-_Wf2jKAo.cjs.map → Keyboard-CsgjS96C.cjs.map} +1 -1
  5. package/dist/{Link-Bur1Sx4G.cjs → Link-B6B7MB7O.cjs} +2 -2
  6. package/dist/{Link-Bur1Sx4G.cjs.map → Link-B6B7MB7O.cjs.map} +1 -1
  7. package/dist/{Link-BZVCNXMe.js → Link-BaPpY2rf.js} +2 -2
  8. package/dist/{Link-BZVCNXMe.js.map → Link-BaPpY2rf.js.map} +1 -1
  9. package/dist/{List-DMxpm9SJ.cjs → List-J5T88ynF.cjs} +2 -2
  10. package/dist/{List-DMxpm9SJ.cjs.map → List-J5T88ynF.cjs.map} +1 -1
  11. package/dist/{List-T419F-at.js → List-aJEsDHql.js} +2 -2
  12. package/dist/{List-T419F-at.js.map → List-aJEsDHql.js.map} +1 -1
  13. package/dist/{Toggle-CUvIChUA.cjs → Toggle-CAW20E9V.cjs} +52 -19
  14. package/dist/Toggle-CAW20E9V.cjs.map +1 -0
  15. package/dist/{Toggle-Cwf_871b.js → Toggle-DcOiWiHG.js} +52 -19
  16. package/dist/Toggle-DcOiWiHG.js.map +1 -0
  17. package/dist/button.cjs +1 -1
  18. package/dist/button.js +1 -1
  19. package/dist/color.cjs +1 -1
  20. package/dist/color.js +1 -1
  21. package/dist/dropdown.cjs +1 -1
  22. package/dist/dropdown.js +1 -1
  23. package/dist/{external-CxczeLHs.js → external-B695Iunb.js} +2 -2
  24. package/dist/{external-CxczeLHs.js.map → external-B695Iunb.js.map} +1 -1
  25. package/dist/{external-BaTq0TIF.js → external-B6yW9yjs.js} +2 -2
  26. package/dist/external-B6yW9yjs.js.map +1 -0
  27. package/dist/{external-CnYZqepA.cjs → external-BGl-cQCe.cjs} +4 -4
  28. package/dist/{external-CnYZqepA.cjs.map → external-BGl-cQCe.cjs.map} +1 -1
  29. package/dist/{external-CV3EI18V.js → external-Bn7V_LTL.js} +3 -3
  30. package/dist/{external-CV3EI18V.js.map → external-Bn7V_LTL.js.map} +1 -1
  31. package/dist/{external-CIJhv8Z5.cjs → external-BoNCimxR.cjs} +2 -2
  32. package/dist/external-BoNCimxR.cjs.map +1 -0
  33. package/dist/{external-BsEirr1J.js → external-Brr6przd.js} +2 -2
  34. package/dist/{external-BsEirr1J.js.map → external-Brr6przd.js.map} +1 -1
  35. package/dist/{external-BkcEPxt6.js → external-CPB95nWX.js} +2 -2
  36. package/dist/{external-BkcEPxt6.js.map → external-CPB95nWX.js.map} +1 -1
  37. package/dist/{external-DmQm9Kms.cjs → external-CYRIymJR.cjs} +2 -2
  38. package/dist/{external-DmQm9Kms.cjs.map → external-CYRIymJR.cjs.map} +1 -1
  39. package/dist/{external-0PKoDC49.cjs → external-CZli69bF.cjs} +2 -2
  40. package/dist/{external-0PKoDC49.cjs.map → external-CZli69bF.cjs.map} +1 -1
  41. package/dist/{external-qoMZSyXU.js → external-CflFsngP.js} +3 -3
  42. package/dist/external-CflFsngP.js.map +1 -0
  43. package/dist/{external-yhENQ6vv.js → external-CtH30naU.js} +2 -2
  44. package/dist/{external-yhENQ6vv.js.map → external-CtH30naU.js.map} +1 -1
  45. package/dist/{external-BZja6sct.js → external-D8uwkCSk.js} +3 -3
  46. package/dist/{external-BZja6sct.js.map → external-D8uwkCSk.js.map} +1 -1
  47. package/dist/{external-CtwpWOgf.cjs → external-DL9-TJzC.cjs} +4 -4
  48. package/dist/{external-CtwpWOgf.cjs.map → external-DL9-TJzC.cjs.map} +1 -1
  49. package/dist/{external-DqPvOVf5.cjs → external-DnojrP1p.cjs} +7 -7
  50. package/dist/{external-DqPvOVf5.cjs.map → external-DnojrP1p.cjs.map} +1 -1
  51. package/dist/{external-C28OmNbm.js → external-Doprw1Uu.js} +4 -4
  52. package/dist/{external-C28OmNbm.js.map → external-Doprw1Uu.js.map} +1 -1
  53. package/dist/{external-CliDurA-.cjs → external-Dpr-yBfa.cjs} +3 -3
  54. package/dist/external-Dpr-yBfa.cjs.map +1 -0
  55. package/dist/{external-C8o-dk-q.cjs → external-Drem1ngI.cjs} +2 -2
  56. package/dist/{external-C8o-dk-q.cjs.map → external-Drem1ngI.cjs.map} +1 -1
  57. package/dist/{external-CXq4moKA.cjs → external-axSECIuu.cjs} +3 -3
  58. package/dist/{external-CXq4moKA.cjs.map → external-axSECIuu.cjs.map} +1 -1
  59. package/dist/{external-CtX7LOQJ.cjs → external-kZAfJn1X.cjs} +3 -3
  60. package/dist/{external-CtX7LOQJ.cjs.map → external-kZAfJn1X.cjs.map} +1 -1
  61. package/dist/{external-DqKZO_FH.cjs → external-p8bRcctL.cjs} +2 -2
  62. package/dist/{external-DqKZO_FH.cjs.map → external-p8bRcctL.cjs.map} +1 -1
  63. package/dist/{external-BbY0o_d-.js → external-wfv-EKsR.js} +4 -4
  64. package/dist/{external-BbY0o_d-.js.map → external-wfv-EKsR.js.map} +1 -1
  65. package/dist/{external-CaIFl1Z9.js → external-yv4F8ndX.js} +7 -7
  66. package/dist/{external-CaIFl1Z9.js.map → external-yv4F8ndX.js.map} +1 -1
  67. package/dist/header.cjs +1 -1
  68. package/dist/header.js +1 -1
  69. package/dist/index.cjs +25 -13
  70. package/dist/index.cjs.map +1 -1
  71. package/dist/index.js +33 -21
  72. package/dist/index.js.map +1 -1
  73. package/dist/input.cjs +1 -1
  74. package/dist/input.js +1 -1
  75. package/dist/list.cjs +1 -1
  76. package/dist/list.js +1 -1
  77. package/dist/menu.cjs +1 -1
  78. package/dist/menu.js +1 -1
  79. package/dist/src/form/Form.d.ts +1 -0
  80. package/dist/src/form/Form.d.ts.map +1 -1
  81. package/dist/src/hooks/useTransforms.d.ts.map +1 -1
  82. package/dist/src/list/Column.d.ts +1 -1
  83. package/dist/src/list/Column.d.ts.map +1 -1
  84. package/dist/src/list/Core.d.ts.map +1 -1
  85. package/dist/src/list/Data.d.ts +2 -0
  86. package/dist/src/list/Data.d.ts.map +1 -1
  87. package/dist/src/list/types.d.ts +1 -0
  88. package/dist/src/list/types.d.ts.map +1 -1
  89. package/dist/tabs.cjs +1 -1
  90. package/dist/tabs.js +1 -1
  91. package/dist/text.cjs +2 -2
  92. package/dist/text.js +2 -2
  93. package/dist/theming.cjs +2 -2
  94. package/dist/theming.js +2 -2
  95. package/dist/tree.cjs +1 -1
  96. package/dist/tree.js +1 -1
  97. package/dist/triggers.cjs +1 -1
  98. package/dist/triggers.js +1 -1
  99. package/package.json +5 -5
  100. package/dist/Toggle-CUvIChUA.cjs.map +0 -1
  101. package/dist/Toggle-Cwf_871b.js.map +0 -1
  102. package/dist/external-BaTq0TIF.js.map +0 -1
  103. package/dist/external-CIJhv8Z5.cjs.map +0 -1
  104. package/dist/external-CliDurA-.cjs.map +0 -1
  105. package/dist/external-qoMZSyXU.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"external-C8o-dk-q.cjs","sources":["../src/header/Header.tsx","../src/header/Actions.tsx","../src/header/ButtonTitle.tsx","../src/header/Title.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n createContext,\n type ReactElement,\n type ReactNode,\n useContext as reactUseContext,\n} from \"react\";\n\nimport { Align } from \"@/align\";\nimport { CSS } from \"@/css\";\nimport { type Text } from \"@/text\";\n\nimport \"@/header/Header.css\";\n\nexport interface HeaderProps extends Omit<Align.SpaceProps, \"children\" | \"el\"> {\n level?: Text.Level;\n divided?: boolean;\n children: ReactNode | [ReactNode, ReactNode];\n}\n\nexport interface ContextValue {\n divided: boolean;\n level: Text.Level;\n}\n\nconst Context = createContext<ContextValue>({\n divided: false,\n level: \"h1\",\n});\n\nexport const useContext = (): ContextValue => reactUseContext(Context);\n\n/**\n * The container for a module header.\n *\n * @param props - The component props. All unused props will be passed down to the\n * {@link Space} containing the header.\n * @param props.level - The font level for the header. See the {@link Typography.Text}\n * component for all possible levels. Default is \"h1.\"\n * @param props.icon - An optional icon to add add before the start of the header text.\n * @param props.actions - A list of actions to be rendered on the right side ofthe header.\n * If the action is a JSX element, it will be rendered directly, and if its of type\n * ButtonIconProps, a ButtonIconOnly will be rendered using the given props.\n * @param props.divided - If true, creates a divider between the start icon, header text,\n * and each action. Default is false.\n */\nexport const Header = ({\n children,\n className,\n level = \"h1\",\n divided = false,\n ...props\n}: HeaderProps): ReactElement => (\n <Context.Provider value={{ level, divided }}>\n <Align.Space\n el=\"header\"\n direction=\"x\"\n justify=\"spaceBetween\"\n className={CSS(\n CSS.B(\"header\"),\n CSS.bordered(\"bottom\"),\n divided && CSS.BM(\"header\", \"divided\"),\n className,\n )}\n {...props}\n >\n {children}\n </Align.Space>\n </Context.Provider>\n);\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { Fragment, isValidElement, type ReactElement } from \"react\";\n\nimport { toArray } from \"@synnaxlabs/x\";\n\nimport { Align } from \"@/align\";\nimport { Button } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { Divider } from \"@/divider\";\nimport { useContext } from \"@/header/Header\";\nimport { Text } from \"@/text\";\n\nexport type ActionSpec = Button.IconProps | ReactElement;\n\nexport interface ActionsProps {\n children?: ActionSpec | ActionSpec[];\n}\n\n/**\n * Custom actions to render on the right side of the header.\n *\n * @param children - The actions to render. If the action is of type\n * {@link ButtonIconProps}, a correectly sized {@link ButtonIconOnly} is rendered\n * using the given props. If the action is a JSX element, it is renderered directly.\n * It's a good idea to prefer the latter in almost all cases for simplicity.\n */\nexport const Actions = ({ children = [] }: ActionsProps): ReactElement => {\n const { level, divided } = useContext();\n return (\n <Align.Space\n direction=\"x\"\n size=\"small\"\n align=\"center\"\n className={CSS.BE(\"header\", \"actions\")}\n >\n {toArray(children).map((action, i) => (\n <Action key={i} index={i} level={level} divided={divided}>\n {action}\n </Action>\n ))}\n </Align.Space>\n );\n};\n\ninterface ActionProps {\n index: number;\n level: Text.Level;\n children: ReactElement | Button.IconProps;\n divided: boolean;\n}\n\nconst Action = ({ index, level, children, divided }: ActionProps): ReactElement => {\n let content: ReactElement = children as ReactElement;\n if (!isValidElement(children)) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const props = children as Button.IconProps;\n content = (\n <Button.Icon\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n props.onClick?.(e);\n }}\n key={index}\n size={Text.LevelComponentSizes[level]}\n {...props}\n />\n );\n }\n return (\n <Fragment key={index}>\n {divided && <Divider.Divider />}\n {content}\n </Fragment>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { Button } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { useContext } from \"@/header/Header\";\nimport { Text } from \"@/text\";\n\nexport interface ButtonTitleProps\n extends Omit<Button.ButtonProps, \"variant\" | \"size\"> {}\n\n/**\n * Header.Title.Use renders a clickable header title.\n *\n * @param props - The comonent props. The props for this component are identical\n * to {@link Button}, except the variant is always 'outlined' and that the component size\n * is automatically inferred from the 'level' prop passsed to the parent {@link Header}\n * component.\n */\nexport const ButtonTitle = ({\n children = \"\",\n className,\n onClick,\n ...props\n}: ButtonTitleProps): ReactElement => {\n const { level } = useContext();\n return (\n <Button.Button\n variant=\"text\"\n size={Text.LevelComponentSizes[level]}\n onClick={onClick}\n className={CSS(CSS.B(\"header-button-title\"), className)}\n sharp\n {...props}\n >\n {children}\n </Button.Button>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { CSS } from \"@/css\";\nimport { useContext } from \"@/header/Header\";\nimport { Text } from \"@/text\";\n\nexport interface TitleProps extends Omit<Text.WithIconProps, \"divided\" | \"level\"> {\n level?: Text.Level;\n}\n\n/**\n * Renders the title for the header component.\n *\n * @param props - The component props. The props for this component are identical\n * to the {@link Typography.TextWithIcon} component, except that the 'level', and\n * 'divider' props are inherited from the parent {@link Header} component.\n */\nexport const Title = ({\n className,\n level: propsLevel,\n ...props\n}: TitleProps): ReactElement => {\n const { level, divided } = useContext();\n return (\n <Text.WithIcon\n className={CSS(CSS.BE(\"header\", \"text\"), className)}\n level={propsLevel ?? level}\n divided={divided}\n size={1.5}\n {...props}\n />\n );\n};\n"],"names":["createContext","reactUseContext","jsx","Align.Space","CSS","toArray","isValidElement","Button.Icon","Text.LevelComponentSizes","Fragment","Divider.Divider","Button.Button","Text.WithIcon"],"mappings":";;;;;;;AAiCA,MAAM,UAAUA,MAAAA,cAA4B;AAAA,EAC1C,SAAS;AAAA,EACT,OAAO;AACT,CAAC;AAEY,MAAA,aAAa,MAAoBC,iBAAgB,OAAO;AAgB9D,MAAM,SAAS,CAAC;AAAA,EACrB;AAAA,EACA;AAAA,EACA,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,GAAG;AACL,MACEC,2BAAA,kBAAA,IAAC,QAAQ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AAA;AAAA,IAAW,WAAAP,2BAAAA,kBAAAA,IAACQ,OAAQ,SAAR,EAAgB;AAAA,IAC5B;AAAA,EAAA,EAAA,GAFY,KAGf;AAEJ;ACxDO,MAAM,cAAc,CAAC;AAAA,EAC1B,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAsC;AAC9B,QAAA,EAAE,UAAU;AAEhB,SAAAR,2BAAA,kBAAA;AAAA,IAACS,OAAO;AAAA,IAAP;AAAA,MACC,SAAQ;AAAA,MACR,MAAMH,WAAK,oBAAoB,KAAK;AAAA,MACpC;AAAA,MACA,WAAWJ,IAAI,IAAAA,IAAA,IAAI,EAAE,qBAAqB,GAAG,SAAS;AAAA,MACtD,OAAK;AAAA,MACJ,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;ACpBO,MAAM,QAAQ,CAAC;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAgC;AAC9B,QAAM,EAAE,OAAO,QAAQ,IAAI,WAAW;AAEpC,SAAAF,2BAAA,kBAAA;AAAA,IAACU,OAAK;AAAA,IAAL;AAAA,MACC,WAAWR,IAAI,IAAAA,QAAI,GAAG,UAAU,MAAM,GAAG,SAAS;AAAA,MAClD,OAAO,cAAc;AAAA,MACrB;AAAA,MACA,MAAM;AAAA,MACL,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"external-Drem1ngI.cjs","sources":["../src/header/Header.tsx","../src/header/Actions.tsx","../src/header/ButtonTitle.tsx","../src/header/Title.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n createContext,\n type ReactElement,\n type ReactNode,\n useContext as reactUseContext,\n} from \"react\";\n\nimport { Align } from \"@/align\";\nimport { CSS } from \"@/css\";\nimport { type Text } from \"@/text\";\n\nimport \"@/header/Header.css\";\n\nexport interface HeaderProps extends Omit<Align.SpaceProps, \"children\" | \"el\"> {\n level?: Text.Level;\n divided?: boolean;\n children: ReactNode | [ReactNode, ReactNode];\n}\n\nexport interface ContextValue {\n divided: boolean;\n level: Text.Level;\n}\n\nconst Context = createContext<ContextValue>({\n divided: false,\n level: \"h1\",\n});\n\nexport const useContext = (): ContextValue => reactUseContext(Context);\n\n/**\n * The container for a module header.\n *\n * @param props - The component props. All unused props will be passed down to the\n * {@link Space} containing the header.\n * @param props.level - The font level for the header. See the {@link Typography.Text}\n * component for all possible levels. Default is \"h1.\"\n * @param props.icon - An optional icon to add add before the start of the header text.\n * @param props.actions - A list of actions to be rendered on the right side ofthe header.\n * If the action is a JSX element, it will be rendered directly, and if its of type\n * ButtonIconProps, a ButtonIconOnly will be rendered using the given props.\n * @param props.divided - If true, creates a divider between the start icon, header text,\n * and each action. Default is false.\n */\nexport const Header = ({\n children,\n className,\n level = \"h1\",\n divided = false,\n ...props\n}: HeaderProps): ReactElement => (\n <Context.Provider value={{ level, divided }}>\n <Align.Space\n el=\"header\"\n direction=\"x\"\n justify=\"spaceBetween\"\n className={CSS(\n CSS.B(\"header\"),\n CSS.bordered(\"bottom\"),\n divided && CSS.BM(\"header\", \"divided\"),\n className,\n )}\n {...props}\n >\n {children}\n </Align.Space>\n </Context.Provider>\n);\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { Fragment, isValidElement, type ReactElement } from \"react\";\n\nimport { toArray } from \"@synnaxlabs/x\";\n\nimport { Align } from \"@/align\";\nimport { Button } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { Divider } from \"@/divider\";\nimport { useContext } from \"@/header/Header\";\nimport { Text } from \"@/text\";\n\nexport type ActionSpec = Button.IconProps | ReactElement;\n\nexport interface ActionsProps {\n children?: ActionSpec | ActionSpec[];\n}\n\n/**\n * Custom actions to render on the right side of the header.\n *\n * @param children - The actions to render. If the action is of type\n * {@link ButtonIconProps}, a correectly sized {@link ButtonIconOnly} is rendered\n * using the given props. If the action is a JSX element, it is renderered directly.\n * It's a good idea to prefer the latter in almost all cases for simplicity.\n */\nexport const Actions = ({ children = [] }: ActionsProps): ReactElement => {\n const { level, divided } = useContext();\n return (\n <Align.Space\n direction=\"x\"\n size=\"small\"\n align=\"center\"\n className={CSS.BE(\"header\", \"actions\")}\n >\n {toArray(children).map((action, i) => (\n <Action key={i} index={i} level={level} divided={divided}>\n {action}\n </Action>\n ))}\n </Align.Space>\n );\n};\n\ninterface ActionProps {\n index: number;\n level: Text.Level;\n children: ReactElement | Button.IconProps;\n divided: boolean;\n}\n\nconst Action = ({ index, level, children, divided }: ActionProps): ReactElement => {\n let content: ReactElement = children as ReactElement;\n if (!isValidElement(children)) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n const props = children as Button.IconProps;\n content = (\n <Button.Icon\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n props.onClick?.(e);\n }}\n key={index}\n size={Text.LevelComponentSizes[level]}\n {...props}\n />\n );\n }\n return (\n <Fragment key={index}>\n {divided && <Divider.Divider />}\n {content}\n </Fragment>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { Button } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { useContext } from \"@/header/Header\";\nimport { Text } from \"@/text\";\n\nexport interface ButtonTitleProps\n extends Omit<Button.ButtonProps, \"variant\" | \"size\"> {}\n\n/**\n * Header.Title.Use renders a clickable header title.\n *\n * @param props - The comonent props. The props for this component are identical\n * to {@link Button}, except the variant is always 'outlined' and that the component size\n * is automatically inferred from the 'level' prop passsed to the parent {@link Header}\n * component.\n */\nexport const ButtonTitle = ({\n children = \"\",\n className,\n onClick,\n ...props\n}: ButtonTitleProps): ReactElement => {\n const { level } = useContext();\n return (\n <Button.Button\n variant=\"text\"\n size={Text.LevelComponentSizes[level]}\n onClick={onClick}\n className={CSS(CSS.B(\"header-button-title\"), className)}\n sharp\n {...props}\n >\n {children}\n </Button.Button>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { CSS } from \"@/css\";\nimport { useContext } from \"@/header/Header\";\nimport { Text } from \"@/text\";\n\nexport interface TitleProps extends Omit<Text.WithIconProps, \"divided\" | \"level\"> {\n level?: Text.Level;\n}\n\n/**\n * Renders the title for the header component.\n *\n * @param props - The component props. The props for this component are identical\n * to the {@link Typography.TextWithIcon} component, except that the 'level', and\n * 'divider' props are inherited from the parent {@link Header} component.\n */\nexport const Title = ({\n className,\n level: propsLevel,\n ...props\n}: TitleProps): ReactElement => {\n const { level, divided } = useContext();\n return (\n <Text.WithIcon\n className={CSS(CSS.BE(\"header\", \"text\"), className)}\n level={propsLevel ?? level}\n divided={divided}\n size={1.5}\n {...props}\n />\n );\n};\n"],"names":["createContext","reactUseContext","jsx","Align.Space","CSS","toArray","isValidElement","Button.Icon","Text.LevelComponentSizes","Fragment","Divider.Divider","Button.Button","Text.WithIcon"],"mappings":";;;;;;;AAiCA,MAAM,UAAUA,MAAAA,cAA4B;AAAA,EAC1C,SAAS;AAAA,EACT,OAAO;AACT,CAAC;AAEY,MAAA,aAAa,MAAoBC,iBAAgB,OAAO;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,QAClB;AAAA,QAEA,MAAMC,WAAK,oBAAoB,KAAK;AAAA,QACnC,GAAG;AAAA,MAAA;AAAA,MAFC;AAAA,IAAA;AAAA,EAKX;AACA,2DACGC,gBACE,EAAA,UAAA;AAAA,IAAW,WAAAP,2BAAAA,kBAAAA,IAACQ,OAAQ,SAAR,EAAgB;AAAA,IAC5B;AAAA,EAAA,EAAA,GAFY,KAGf;AAEJ;ACxDO,MAAM,cAAc,CAAC;AAAA,EAC1B,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAsC;AAC9B,QAAA,EAAE,UAAU;AAEhB,SAAAR,2BAAA,kBAAA;AAAA,IAACS,OAAO;AAAA,IAAP;AAAA,MACC,SAAQ;AAAA,MACR,MAAMH,WAAK,oBAAoB,KAAK;AAAA,MACpC;AAAA,MACA,WAAWJ,IAAI,IAAAA,IAAA,IAAI,EAAE,qBAAqB,GAAG,SAAS;AAAA,MACtD,OAAK;AAAA,MACJ,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;ACpBO,MAAM,QAAQ,CAAC;AAAA,EACpB;AAAA,EACA,OAAO;AAAA,EACP,GAAG;AACL,MAAgC;AAC9B,QAAM,EAAE,OAAO,QAAQ,IAAI,WAAW;AAEpC,SAAAF,2BAAA,kBAAA;AAAA,IAACU,OAAK;AAAA,IAAL;AAAA,MACC,WAAWR,IAAI,IAAAA,QAAI,GAAG,UAAU,MAAM,GAAG,SAAS;AAAA,MAClD,OAAO,cAAc;AAAA,MACrB;AAAA,MACA,MAAM;AAAA,MACL,GAAG;AAAA,IAAA;AAAA,EAAA;AAGV;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const jsxRuntime = require("./jsx-runtime-B3vWrP5x.cjs");
3
- const Toggle = require("./Toggle-CUvIChUA.cjs");
4
- const Link = require("./Link-Bur1Sx4G.cjs");
3
+ const Toggle = require("./Toggle-CAW20E9V.cjs");
4
+ const Link = require("./Link-B6B7MB7O.cjs");
5
5
  const css = require("./css-Pf9qxhQ4.cjs");
6
6
  const React = require("react");
7
7
  const MenuContext = React.createContext({
@@ -74,4 +74,4 @@ const external = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
74
74
  useMenuContext
75
75
  }, Symbol.toStringTag, { value: "Module" }));
76
76
  exports.external = external;
77
- //# sourceMappingURL=external-CXq4moKA.cjs.map
77
+ //# sourceMappingURL=external-axSECIuu.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-CXq4moKA.cjs","sources":["../src/menu/Menu.tsx","../src/menu/Item.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n createContext,\n type PropsWithChildren,\n type ReactElement,\n useContext,\n} from \"react\";\n\nimport { type Input } from \"@/input\";\nimport { type Text } from \"@/text\";\nimport { type ComponentSize } from \"@/util/component\";\n\ninterface MenuContextValue {\n onClick: (key: string) => void;\n selected: string;\n level?: Text.Level;\n iconSpacing?: ComponentSize;\n}\n\nexport const MenuContext = createContext<MenuContextValue>({\n onClick: () => {},\n selected: \"\",\n});\n\nexport interface MenuProps\n extends Partial<Input.Control<string>>,\n PropsWithChildren,\n Pick<MenuContextValue, \"level\" | \"iconSpacing\"> {}\n\nexport const useMenuContext = (): MenuContextValue => useContext(MenuContext);\n\n/**\n * Menu is a modular component that allows you to create a menu with a list of items.\n * It satisfies the InputControl string interface, so it's selected value can be\n * controlled.\n *\n * @param props - Props for the component. All unlisted props will be spread to the\n * underlying Space component acting as the root element.\n * @param props.onChange - Callback executed when the selected item changes.\n * @param props.value - The selected item.\n */\nexport const Menu = ({\n children,\n onChange,\n level,\n iconSpacing,\n value = \"\",\n}: MenuProps): ReactElement => {\n const handleClick: MenuProps[\"onChange\"] = (key) => onChange?.(key);\n return (\n <MenuContext.Provider\n value={{ onClick: handleClick, selected: value, level, iconSpacing }}\n >\n {children}\n </MenuContext.Provider>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type FunctionComponent, type ReactElement } from \"react\";\n\nimport { Button } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { useMenuContext } from \"@/menu/Menu\";\n\nimport \"@/menu/Item.css\";\n\nconst menuItemFactory =\n <E extends Pick<Button.ButtonProps, \"className\" | \"onClick\" | \"size\">>(\n Base: FunctionComponent<E>,\n defaultProps?: Partial<E>,\n ): FunctionComponent<E & { itemKey: string }> =>\n // eslint-disable-next-line react/display-name\n (props): ReactElement => {\n const { itemKey, className, onClick, size, ...rest } = {\n ...defaultProps,\n ...props,\n };\n\n const { onClick: ctxOnClick, selected, level, iconSpacing } = useMenuContext();\n\n const handleClick: Button.ButtonProps[\"onClick\"] = (e) => {\n ctxOnClick(itemKey);\n onClick?.(e);\n };\n const _selected = selected === itemKey;\n return (\n // @ts-expect-error\n <Base\n level={level}\n {...rest}\n onClick={handleClick}\n variant=\"text\"\n className={CSS(CSS.B(\"menu-item\"), CSS.selected(_selected), className)}\n size={size ?? iconSpacing}\n />\n );\n };\n\nexport interface ItemProps extends Button.ButtonProps {\n itemKey: string;\n}\nexport const CoreItem = menuItemFactory(Button.Button, { noWrap: true });\n\nexport interface ItemIconProps extends Button.IconProps {\n itemKey: string;\n}\nconst ItemIcon = menuItemFactory(Button.Icon);\n\nconst ItemLink = menuItemFactory(Button.Link, { noWrap: true });\nexport interface MenuItemLinkProps extends Button.LinkProps {\n itemKey: string;\n}\n\ntype CoreItemType = typeof CoreItem;\n\nexport interface ItemType extends CoreItemType {\n Icon: typeof ItemIcon;\n Link: typeof ItemLink;\n}\n\n/**\n * Menu.Item renders a menu item.\n *\n * @param props - Props for the component. Identical props to those of Use except\n * for the ones listed below.\n * @param props.itemKey - The key of the item. This is used to identify the item and\n * is passed to the onChange callback of the Menu.\n */\nexport const Item = CoreItem as ItemType;\nItem.Icon = ItemIcon;\nItem.Link = ItemLink;\n"],"names":["createContext","useContext","jsx","CSS","Button.Button","Button.Icon","Button.Link"],"mappings":";;;;;;AA2BO,MAAM,cAAcA,MAAAA,cAAgC;AAAA,EACzD,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,UAAU;AACZ,CAAC;AAOY,MAAA,iBAAiB,MAAwBC,iBAAW,WAAW;AAYrE,MAAM,OAAO,CAAC;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,MAA+B;AAC7B,QAAM,cAAqC,CAAC,QAAQ,qCAAW;AAE7D,SAAAC,2BAAA,kBAAA;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACC,OAAO,EAAE,SAAS,aAAa,UAAU,OAAO,OAAO,YAAY;AAAA,MAElE;AAAA,IAAA;AAAA,EAAA;AAGP;AC/CA,MAAM,kBACJ,CACE,MACA;AAAA;AAAA,EAGF,CAAC,UAAwB;AACvB,UAAM,EAAE,SAAS,WAAW,SAAS,MAAM,GAAG,SAAS;AAAA,MACrD,GAAG;AAAA,MACH,GAAG;AAAA,IAAA;AAGL,UAAM,EAAE,SAAS,YAAY,UAAU,OAAO,YAAA,IAAgB;AAExD,UAAA,cAA6C,CAAC,MAAM;AACxD,iBAAW,OAAO;AAClB,yCAAU;AAAA,IAAC;AAEb,UAAM,YAAY,aAAa;AAC/B;AAAA;AAAA,MAEEA,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACC,GAAG;AAAA,UACJ,SAAS;AAAA,UACT,SAAQ;AAAA,UACR,WAAWC,IAAAA,IAAIA,IAAA,IAAI,EAAE,WAAW,GAAGA,IAAAA,IAAI,SAAS,SAAS,GAAG,SAAS;AAAA,UACrE,MAAM,QAAQ;AAAA,QAAA;AAAA,MAChB;AAAA;AAAA,EAEJ;AAAA;AAKK,MAAM,WAAW,gBAAgBC,eAAe,EAAE,QAAQ,KAAM,CAAA;AAKvE,MAAM,WAAW,gBAAgBC,OAAAA,IAAW;AAE5C,MAAM,WAAW,gBAAgBC,WAAa,EAAE,QAAQ,KAAM,CAAA;AAoBvD,MAAM,OAAO;AACpB,KAAK,OAAO;AACZ,KAAK,OAAO;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"external-axSECIuu.cjs","sources":["../src/menu/Menu.tsx","../src/menu/Item.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n createContext,\n type PropsWithChildren,\n type ReactElement,\n useContext,\n} from \"react\";\n\nimport { type Input } from \"@/input\";\nimport { type Text } from \"@/text\";\nimport { type ComponentSize } from \"@/util/component\";\n\ninterface MenuContextValue {\n onClick: (key: string) => void;\n selected: string;\n level?: Text.Level;\n iconSpacing?: ComponentSize;\n}\n\nexport const MenuContext = createContext<MenuContextValue>({\n onClick: () => {},\n selected: \"\",\n});\n\nexport interface MenuProps\n extends Partial<Input.Control<string>>,\n PropsWithChildren,\n Pick<MenuContextValue, \"level\" | \"iconSpacing\"> {}\n\nexport const useMenuContext = (): MenuContextValue => useContext(MenuContext);\n\n/**\n * Menu is a modular component that allows you to create a menu with a list of items.\n * It satisfies the InputControl string interface, so it's selected value can be\n * controlled.\n *\n * @param props - Props for the component. All unlisted props will be spread to the\n * underlying Space component acting as the root element.\n * @param props.onChange - Callback executed when the selected item changes.\n * @param props.value - The selected item.\n */\nexport const Menu = ({\n children,\n onChange,\n level,\n iconSpacing,\n value = \"\",\n}: MenuProps): ReactElement => {\n const handleClick: MenuProps[\"onChange\"] = (key) => onChange?.(key);\n return (\n <MenuContext.Provider\n value={{ onClick: handleClick, selected: value, level, iconSpacing }}\n >\n {children}\n </MenuContext.Provider>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type FunctionComponent, type ReactElement } from \"react\";\n\nimport { Button } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { useMenuContext } from \"@/menu/Menu\";\n\nimport \"@/menu/Item.css\";\n\nconst menuItemFactory =\n <E extends Pick<Button.ButtonProps, \"className\" | \"onClick\" | \"size\">>(\n Base: FunctionComponent<E>,\n defaultProps?: Partial<E>,\n ): FunctionComponent<E & { itemKey: string }> =>\n // eslint-disable-next-line react/display-name\n (props): ReactElement => {\n const { itemKey, className, onClick, size, ...rest } = {\n ...defaultProps,\n ...props,\n };\n\n const { onClick: ctxOnClick, selected, level, iconSpacing } = useMenuContext();\n\n const handleClick: Button.ButtonProps[\"onClick\"] = (e) => {\n ctxOnClick(itemKey);\n onClick?.(e);\n };\n const _selected = selected === itemKey;\n return (\n // @ts-expect-error\n <Base\n level={level}\n {...rest}\n onClick={handleClick}\n variant=\"text\"\n className={CSS(CSS.B(\"menu-item\"), CSS.selected(_selected), className)}\n size={size ?? iconSpacing}\n />\n );\n };\n\nexport interface ItemProps extends Button.ButtonProps {\n itemKey: string;\n}\nexport const CoreItem = menuItemFactory(Button.Button, { noWrap: true });\n\nexport interface ItemIconProps extends Button.IconProps {\n itemKey: string;\n}\nconst ItemIcon = menuItemFactory(Button.Icon);\n\nconst ItemLink = menuItemFactory(Button.Link, { noWrap: true });\nexport interface MenuItemLinkProps extends Button.LinkProps {\n itemKey: string;\n}\n\ntype CoreItemType = typeof CoreItem;\n\nexport interface ItemType extends CoreItemType {\n Icon: typeof ItemIcon;\n Link: typeof ItemLink;\n}\n\n/**\n * Menu.Item renders a menu item.\n *\n * @param props - Props for the component. Identical props to those of Use except\n * for the ones listed below.\n * @param props.itemKey - The key of the item. This is used to identify the item and\n * is passed to the onChange callback of the Menu.\n */\nexport const Item = CoreItem as ItemType;\nItem.Icon = ItemIcon;\nItem.Link = ItemLink;\n"],"names":["createContext","useContext","jsx","CSS","Button.Button","Button.Icon","Button.Link"],"mappings":";;;;;;AA2BO,MAAM,cAAcA,MAAAA,cAAgC;AAAA,EACzD,SAAS,MAAM;AAAA,EAAC;AAAA,EAChB,UAAU;AACZ,CAAC;AAOY,MAAA,iBAAiB,MAAwBC,iBAAW,WAAW;AAYrE,MAAM,OAAO,CAAC;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACV,MAA+B;AAC7B,QAAM,cAAqC,CAAC,QAAQ,qCAAW;AAE7D,SAAAC,2BAAA,kBAAA;AAAA,IAAC,YAAY;AAAA,IAAZ;AAAA,MACC,OAAO,EAAE,SAAS,aAAa,UAAU,OAAO,OAAO,YAAY;AAAA,MAElE;AAAA,IAAA;AAAA,EAAA;AAGP;AC/CA,MAAM,kBACJ,CACE,MACA;AAAA;AAAA,EAGF,CAAC,UAAwB;AACvB,UAAM,EAAE,SAAS,WAAW,SAAS,MAAM,GAAG,SAAS;AAAA,MACrD,GAAG;AAAA,MACH,GAAG;AAAA,IAAA;AAGL,UAAM,EAAE,SAAS,YAAY,UAAU,OAAO,YAAA,IAAgB;AAExD,UAAA,cAA6C,CAAC,MAAM;AACxD,iBAAW,OAAO;AAClB,yCAAU;AAAA,IAAC;AAEb,UAAM,YAAY,aAAa;AAC/B;AAAA;AAAA,MAEEA,2BAAA,kBAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC;AAAA,UACC,GAAG;AAAA,UACJ,SAAS;AAAA,UACT,SAAQ;AAAA,UACR,WAAWC,IAAAA,IAAIA,IAAA,IAAI,EAAE,WAAW,GAAGA,IAAAA,IAAI,SAAS,SAAS,GAAG,SAAS;AAAA,UACrE,MAAM,QAAQ;AAAA,QAAA;AAAA,MAChB;AAAA;AAAA,EAEJ;AAAA;AAKK,MAAM,WAAW,gBAAgBC,eAAe,EAAE,QAAQ,KAAM,CAAA;AAKvE,MAAM,WAAW,gBAAgBC,OAAAA,IAAW;AAE5C,MAAM,WAAW,gBAAgBC,WAAa,EAAE,QAAQ,KAAM,CAAA;AAoBvD,MAAM,OAAO;AACpB,KAAK,OAAO;AACZ,KAAK,OAAO;;;;;;;;;;;;;;"}
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
- const Toggle = require("./Toggle-CUvIChUA.cjs");
2
+ const Toggle = require("./Toggle-CAW20E9V.cjs");
3
3
  const jsxRuntime = require("./jsx-runtime-B3vWrP5x.cjs");
4
4
  const React = require("react");
5
5
  require("./aggregator-Ca8xiVD2.cjs");
6
6
  const css = require("./css-Pf9qxhQ4.cjs");
7
7
  const Center = require("./Center-5NJ61qfA.cjs");
8
- const Keyboard = require("./Keyboard-_Wf2jKAo.cjs");
8
+ const Keyboard = require("./Keyboard-CsgjS96C.cjs");
9
9
  const Status = (props) => {
10
10
  const { listen } = Toggle.useContext$1();
11
11
  const [trigger, setTrigger] = React.useState([]);
@@ -118,4 +118,4 @@ const external = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
118
118
  exports.Text = Text;
119
119
  exports.external = external;
120
120
  exports.useDrag = useDrag;
121
- //# sourceMappingURL=external-CtX7LOQJ.cjs.map
121
+ //# sourceMappingURL=external-kZAfJn1X.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-CtX7LOQJ.cjs","sources":["../src/triggers/Status.tsx","../src/triggers/useDrag.ts","../src/triggers/Text.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement, useEffect, useState } from \"react\";\n\nimport { Text } from \"@/text\";\nimport { useContext } from \"@/triggers/Provider\";\nimport { type Trigger } from \"@/triggers/triggers\";\n\nexport interface StatusProps extends Text.TextProps {}\n\nexport const Status = (props: StatusProps): ReactElement => {\n const { listen } = useContext();\n const [trigger, setTrigger] = useState<Trigger>([]);\n\n useEffect(\n () => listen(({ next: [trigger] }) => setTrigger(trigger ?? [])),\n [listen, setTrigger],\n );\n\n return <Text.Text {...props}>{trigger.join(\" \")}</Text.Text>;\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type RefObject, useCallback, useRef } from \"react\";\n\nimport { box, xy } from \"@synnaxlabs/x\";\n\nimport { use, type UseEvent } from \"@/triggers/hooks\";\nimport { type Stage, type Trigger } from \"@/triggers/triggers\";\n\nexport interface DragEvent {\n stage: Stage;\n box: box.Box;\n cursor: xy.XY;\n triggers: Trigger[];\n}\n\nexport type DragCallback = (props: DragEvent) => void;\n\nexport interface UseDragProps {\n bound: RefObject<HTMLElement>;\n triggers?: Trigger[];\n onDrag: DragCallback;\n loose?: boolean;\n}\n\nexport const useDrag = ({\n onDrag,\n triggers = [[\"MouseLeft\"], [\"MouseRight\"]],\n bound,\n loose = false,\n}: UseDragProps): void => {\n const triggerRef = useRef<UseEvent | null>(null);\n const startLoc = useRef<xy.XY>(xy.ZERO);\n const onMove = useCallback(\n (e: xy.Client & { buttons: number }) => {\n const cursor = xy.construct(e);\n if (triggerRef.current === null) return;\n const { triggers } = triggerRef.current;\n onDrag({\n box: box.construct(startLoc.current, cursor),\n cursor,\n triggers,\n stage: \"during\",\n });\n },\n [onDrag],\n );\n const handleTrigger = useCallback(\n (event: UseEvent): void => {\n const { stage, cursor } = event;\n if (stage === \"start\") {\n onDrag({ box: box.construct(cursor), ...event });\n window.addEventListener(\"mousemove\", onMove);\n triggerRef.current = event;\n startLoc.current = cursor;\n } else if (stage === \"end\" && triggerRef.current != null) {\n onDrag({ box: box.construct(startLoc.current, cursor), ...event });\n window.removeEventListener(\"mousemove\", onMove);\n triggerRef.current = null;\n startLoc.current = xy.ZERO;\n }\n },\n [onDrag],\n );\n use({ triggers, callback: handleTrigger, region: bound, loose });\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { Icon } from \"@synnaxlabs/media\";\n\nimport { Align } from \"@/align\";\nimport { Text as Core } from \"@/text\";\nimport { type Key, type Trigger } from \"@/triggers/triggers\";\nimport { RenderProp } from \"@/util/renderProp\";\n\nexport type TextProps<L extends Core.Level> = Core.KeyboardProps<L> & {\n trigger: Trigger;\n};\n\nconst CUSTOM_TEXT: Partial<Record<Key, (() => ReactElement) | string>> = {\n Control: () => <Core.Symbols.Meta />,\n Alt: () => <Core.Symbols.Alt />,\n Shift: () => <Icon.Keyboard.Shift />,\n MouseLeft: \"Left Click\",\n MouseRight: \"Right Click\",\n MouseMiddle: \"Middle Click\",\n Enter: () => <Icon.Keyboard.Return />,\n};\n\nconst getCustomText = (trigger: Key): ReactElement | string => {\n const t = CUSTOM_TEXT[trigger];\n if (t != null) return typeof t === \"function\" ? t() : t;\n return trigger;\n};\n\nexport const toSymbols = (trigger: Trigger): (ReactElement | string)[] =>\n trigger.map((t) => getCustomText(t));\n\nexport const Text = <L extends Core.Level>({\n className,\n style,\n trigger,\n ...props\n}: TextProps<L>): ReactElement => {\n return (\n <Align.Space className={className} style={style} direction=\"x\">\n {trigger.map((t) => (\n // @ts-expect-error - issues with generic element types\n <Core.Keyboard<L> key={t} {...props}>\n {getCustomText(t)}\n </Core.Keyboard>\n ))}\n </Align.Space>\n );\n};\n"],"names":["useContext","useState","useEffect","trigger","jsx","Text.Text","useRef","xy","useCallback","triggers","box","use","Core.Symbols","Icon","Align.Space","Core.Keyboard"],"mappings":";;;;;;;;AAiBa,MAAA,SAAS,CAAC,UAAqC;AACpD,QAAA,EAAE,WAAWA,OAAAA;AACnB,QAAM,CAAC,SAAS,UAAU,IAAIC,MAAA,SAAkB,CAAE,CAAA;AAElDC,QAAA;AAAA,IACE,MAAM,OAAO,CAAC,EAAE,MAAM,CAACC,QAAO,EAAA,MAAQ,WAAWA,YAAW,CAAA,CAAE,CAAC;AAAA,IAC/D,CAAC,QAAQ,UAAU;AAAA,EAAA;AAGd,SAAAC,2BAAA,kBAAA,IAACC,aAAA,EAAW,GAAG,OAAQ,UAAA,QAAQ,KAAK,GAAG,EAAE,CAAA;AAClD;ACKO,MAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA,WAAW,CAAC,CAAC,WAAW,GAAG,CAAC,YAAY,CAAC;AAAA,EACzC;AAAA,EACA,QAAQ;AACV,MAA0B;AAClB,QAAA,aAAaC,aAAwB,IAAI;AACzC,QAAA,WAAWA,MAAAA,OAAcC,IAAA,EAAG,IAAI;AACtC,QAAM,SAASC,MAAA;AAAA,IACb,CAAC,MAAuC;AAChC,YAAA,SAASD,IAAAA,EAAG,UAAU,CAAC;AAC7B,UAAI,WAAW,YAAY;AAAM;AACjC,YAAM,EAAE,UAAAE,cAAa,WAAW;AACzB,aAAA;AAAA,QACL,KAAKC,IAAAA,GAAI,UAAU,SAAS,SAAS,MAAM;AAAA,QAC3C;AAAA,QACA,UAAAD;AAAAA,QACA,OAAO;AAAA,MAAA,CACR;AAAA,IACH;AAAA,IACA,CAAC,MAAM;AAAA,EAAA;AAET,QAAM,gBAAgBD,MAAA;AAAA,IACpB,CAAC,UAA0B;AACnB,YAAA,EAAE,OAAO,OAAW,IAAA;AAC1B,UAAI,UAAU,SAAS;AAC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xD,UAAQ,QAAA,IAAI,CAAC;AAAA;AAAA,IAEZV,iDAACW,SAAAA,UAAA,EAA0B,GAAG,OAC3B,UAAA,cAAc,CAAC,EAAA,GADK,CAEvB;AAAA,GACD,EACH,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"external-kZAfJn1X.cjs","sources":["../src/triggers/Status.tsx","../src/triggers/useDrag.ts","../src/triggers/Text.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement, useEffect, useState } from \"react\";\n\nimport { Text } from \"@/text\";\nimport { useContext } from \"@/triggers/Provider\";\nimport { type Trigger } from \"@/triggers/triggers\";\n\nexport interface StatusProps extends Text.TextProps {}\n\nexport const Status = (props: StatusProps): ReactElement => {\n const { listen } = useContext();\n const [trigger, setTrigger] = useState<Trigger>([]);\n\n useEffect(\n () => listen(({ next: [trigger] }) => setTrigger(trigger ?? [])),\n [listen, setTrigger],\n );\n\n return <Text.Text {...props}>{trigger.join(\" \")}</Text.Text>;\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type RefObject, useCallback, useRef } from \"react\";\n\nimport { box, xy } from \"@synnaxlabs/x\";\n\nimport { use, type UseEvent } from \"@/triggers/hooks\";\nimport { type Stage, type Trigger } from \"@/triggers/triggers\";\n\nexport interface DragEvent {\n stage: Stage;\n box: box.Box;\n cursor: xy.XY;\n triggers: Trigger[];\n}\n\nexport type DragCallback = (props: DragEvent) => void;\n\nexport interface UseDragProps {\n bound: RefObject<HTMLElement>;\n triggers?: Trigger[];\n onDrag: DragCallback;\n loose?: boolean;\n}\n\nexport const useDrag = ({\n onDrag,\n triggers = [[\"MouseLeft\"], [\"MouseRight\"]],\n bound,\n loose = false,\n}: UseDragProps): void => {\n const triggerRef = useRef<UseEvent | null>(null);\n const startLoc = useRef<xy.XY>(xy.ZERO);\n const onMove = useCallback(\n (e: xy.Client & { buttons: number }) => {\n const cursor = xy.construct(e);\n if (triggerRef.current === null) return;\n const { triggers } = triggerRef.current;\n onDrag({\n box: box.construct(startLoc.current, cursor),\n cursor,\n triggers,\n stage: \"during\",\n });\n },\n [onDrag],\n );\n const handleTrigger = useCallback(\n (event: UseEvent): void => {\n const { stage, cursor } = event;\n if (stage === \"start\") {\n onDrag({ box: box.construct(cursor), ...event });\n window.addEventListener(\"mousemove\", onMove);\n triggerRef.current = event;\n startLoc.current = cursor;\n } else if (stage === \"end\" && triggerRef.current != null) {\n onDrag({ box: box.construct(startLoc.current, cursor), ...event });\n window.removeEventListener(\"mousemove\", onMove);\n triggerRef.current = null;\n startLoc.current = xy.ZERO;\n }\n },\n [onDrag],\n );\n use({ triggers, callback: handleTrigger, region: bound, loose });\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { Icon } from \"@synnaxlabs/media\";\n\nimport { Align } from \"@/align\";\nimport { Text as Core } from \"@/text\";\nimport { type Key, type Trigger } from \"@/triggers/triggers\";\nimport { RenderProp } from \"@/util/renderProp\";\n\nexport type TextProps<L extends Core.Level> = Core.KeyboardProps<L> & {\n trigger: Trigger;\n};\n\nconst CUSTOM_TEXT: Partial<Record<Key, (() => ReactElement) | string>> = {\n Control: () => <Core.Symbols.Meta />,\n Alt: () => <Core.Symbols.Alt />,\n Shift: () => <Icon.Keyboard.Shift />,\n MouseLeft: \"Left Click\",\n MouseRight: \"Right Click\",\n MouseMiddle: \"Middle Click\",\n Enter: () => <Icon.Keyboard.Return />,\n};\n\nconst getCustomText = (trigger: Key): ReactElement | string => {\n const t = CUSTOM_TEXT[trigger];\n if (t != null) return typeof t === \"function\" ? t() : t;\n return trigger;\n};\n\nexport const toSymbols = (trigger: Trigger): (ReactElement | string)[] =>\n trigger.map((t) => getCustomText(t));\n\nexport const Text = <L extends Core.Level>({\n className,\n style,\n trigger,\n ...props\n}: TextProps<L>): ReactElement => {\n return (\n <Align.Space className={className} style={style} direction=\"x\">\n {trigger.map((t) => (\n // @ts-expect-error - issues with generic element types\n <Core.Keyboard<L> key={t} {...props}>\n {getCustomText(t)}\n </Core.Keyboard>\n ))}\n </Align.Space>\n );\n};\n"],"names":["useContext","useState","useEffect","trigger","jsx","Text.Text","useRef","xy","useCallback","triggers","box","use","Core.Symbols","Icon","Align.Space","Core.Keyboard"],"mappings":";;;;;;;;AAiBa,MAAA,SAAS,CAAC,UAAqC;AACpD,QAAA,EAAE,WAAWA,OAAAA;AACnB,QAAM,CAAC,SAAS,UAAU,IAAIC,MAAA,SAAkB,CAAE,CAAA;AAElDC,QAAA;AAAA,IACE,MAAM,OAAO,CAAC,EAAE,MAAM,CAACC,QAAO,EAAA,MAAQ,WAAWA,YAAW,CAAA,CAAE,CAAC;AAAA,IAC/D,CAAC,QAAQ,UAAU;AAAA,EAAA;AAGd,SAAAC,2BAAA,kBAAA,IAACC,aAAA,EAAW,GAAG,OAAQ,UAAA,QAAQ,KAAK,GAAG,EAAE,CAAA;AAClD;ACKO,MAAM,UAAU,CAAC;AAAA,EACtB;AAAA,EACA,WAAW,CAAC,CAAC,WAAW,GAAG,CAAC,YAAY,CAAC;AAAA,EACzC;AAAA,EACA,QAAQ;AACV,MAA0B;AAClB,QAAA,aAAaC,aAAwB,IAAI;AACzC,QAAA,WAAWA,MAAAA,OAAcC,IAAA,EAAG,IAAI;AACtC,QAA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O,MAAMT,2BAAAA,kBAAAA,IAACS,OAAAA,GAAK,SAAS,QAAd,CAAA,CAAqB;AACrC;AAEA,MAAM,gBAAgB,CAAC,YAAwC;AACvD,QAAA,IAAI,YAAY,OAAO;AAC7B,MAAI,KAAK;AAAM,WAAO,OAAO,MAAM,aAAa,EAAA,IAAM;AAC/C,SAAA;AACT;AAEa,MAAA,YAAY,CAAC,YACxB,QAAQ,IAAI,CAAC,MAAM,cAAc,CAAC,CAAC;AAE9B,MAAM,OAAO,CAAuB;AAAA,EACzC;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAkC;AAE9B,SAAAT,iDAACU,OAAAA,OAAA,EAAY,WAAsB,OAAc,WAAU,KACxD,UAAQ,QAAA,IAAI,CAAC;AAAA;AAAA,IAEZV,iDAACW,SAAAA,UAAA,EAA0B,GAAG,OAC3B,UAAA,cAAc,CAAC,EAAA,GADK,CAEvB;AAAA,GACD,EACH,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  const css = require("./css-Pf9qxhQ4.cjs");
3
3
  const jsxRuntime = require("./jsx-runtime-B3vWrP5x.cjs");
4
- const Toggle = require("./Toggle-CUvIChUA.cjs");
4
+ const Toggle = require("./Toggle-CAW20E9V.cjs");
5
5
  const React = require("react");
6
6
  require("./aggregator-Ca8xiVD2.cjs");
7
7
  require("./Center-5NJ61qfA.cjs");
@@ -104,4 +104,4 @@ const external = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProp
104
104
  }, Symbol.toStringTag, { value: "Module" }));
105
105
  exports.Swatch = Swatch;
106
106
  exports.external = external;
107
- //# sourceMappingURL=external-DqKZO_FH.cjs.map
107
+ //# sourceMappingURL=external-p8bRcctL.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-DqKZO_FH.cjs","sources":["../src/color/Picker/Picker.tsx","../src/color/Swatch/Swatch.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ComponentPropsWithoutRef, type ReactElement } from \"react\";\n\nimport { SketchPicker, type ColorResult } from \"react-color\";\n\nimport { color } from \"@/color/core\";\nimport { CSS } from \"@/css\";\nimport { type Input } from \"@/input\";\n\nimport \"@/color/Picker/Picker.css\";\n\nexport interface PickerProps\n extends Input.Control<color.Crude, color.Color>,\n Omit<ComponentPropsWithoutRef<\"div\">, \"onChange\"> {}\n\nexport const Picker = ({ value, onChange, ...props }: PickerProps): ReactElement => {\n const handleChange = (res: ColorResult): void => {\n if (res.hex === \"transparent\") onChange(color.ZERO);\n onChange(new color.Color(res.hex, res.rgb.a));\n };\n\n return (\n <SketchPicker\n className={CSS.B(\"color-picker\")}\n color={new color.Color(value).hex}\n onChange={handleChange}\n presetColors={[]}\n {...props}\n />\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement, useCallback } from \"react\";\n\nimport { Button } from \"@/button\";\nimport { color } from \"@/color/core\";\nimport { type Crude, type Color } from \"@/color/core/color\";\nimport { Picker } from \"@/color/Picker\";\nimport { CSS } from \"@/css\";\nimport { Dropdown } from \"@/dropdown\";\nimport { type UseProps } from \"@/dropdown/Dropdown\";\nimport { Haul } from \"@/haul\";\nimport { type Input } from \"@/input\";\nimport { Text } from \"@/text\";\nimport { Theming } from \"@/theming\";\n\nimport \"@/color/Swatch/Swatch.css\";\n\nexport interface SwatchProps\n extends Input.Control<Crude, Color>,\n Omit<Button.ButtonProps, \"onChange\" | \"value\">,\n UseProps {}\n\nconst HAUL_TYPE = \"color\";\n\nexport const Swatch = ({\n value,\n onChange,\n className,\n size = \"medium\",\n onVisibleChange,\n initialVisible,\n draggable = true,\n ...props\n}: SwatchProps): ReactElement => {\n const { visible, open, close } = Dropdown.use({ onVisibleChange, initialVisible });\n\n const bg = Theming.use().colors.gray.l0;\n\n const d = new color.Color(value);\n\n const dragging = Haul.useDraggingState();\n\n const canDrop: Haul.CanDrop = useCallback(\n ({ items }) => {\n const [k] = Haul.filterByType(HAUL_TYPE, items);\n return k != null && k.key !== d.hex;\n },\n [d.hex],\n );\n\n const { startDrag, ...haulProps } = Haul.useDragAndDrop({\n type: \"Color.Swatch\",\n onDrop: ({ items }) => {\n const dropped = Haul.filterByType(HAUL_TYPE, items);\n if (items.length > 0) onChange?.(new color.Color(dropped[0].key as string));\n return dropped;\n },\n canDrop,\n });\n\n const swatch = (\n <Button.Button\n className={CSS(\n CSS.B(\"color-swatch\"),\n CSS.size(size),\n d.contrast(bg) > 1.5 && d.a > 0.5 && CSS.M(\"no-border\"),\n CSS.dropRegion(canDrop(dragging)),\n className,\n )}\n draggable={draggable}\n onDragStart={() => startDrag([{ type: HAUL_TYPE, key: d.hex }])}\n style={{ backgroundColor: color.cssString(value) }}\n variant=\"text\"\n onClick={open}\n size={size}\n tooltip={\n onChange != null ? (\n <Text.Text level=\"small\">Click to change color</Text.Text>\n ) : undefined\n }\n {...haulProps}\n {...props}\n />\n );\n\n if (onChange == null) return swatch;\n\n return (\n <Dropdown.Dialog\n close={close}\n visible={visible}\n className={CSS.BE(\"color-swatch\", \"dropdown\")}\n keepMounted={false}\n variant=\"floating\"\n >\n {swatch}\n <Picker value={value} onChange={onChange} />\n </Dropdown.Dialog>\n );\n};\n"],"names":["color.ZERO","color.Color","jsx","SketchPicker","CSS","Dropdown.use","Theming.use","Haul.useDraggingState","useCallback","Haul.filterByType","Haul.useDragAndDrop","Button.Button","color.cssString","Text.Text","jsxs","Dropdown.Dialog"],"mappings":";;;;;;;AAuBO,MAAM,SA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2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ComponentPropsWithoutRef, type ReactElement } from \"react\";\n\nimport { SketchPicker, type ColorResult } from \"react-color\";\n\nimport { color } from \"@/color/core\";\nimport { CSS } from \"@/css\";\nimport { type Input } from \"@/input\";\n\nimport \"@/color/Picker/Picker.css\";\n\nexport interface PickerProps\n extends Input.Control<color.Crude, color.Color>,\n Omit<ComponentPropsWithoutRef<\"div\">, \"onChange\"> {}\n\nexport const Picker = ({ value, onChange, ...props }: PickerProps): ReactElement => {\n const handleChange = (res: ColorResult): void => {\n if (res.hex === \"transparent\") onChange(color.ZERO);\n onChange(new color.Color(res.hex, res.rgb.a));\n };\n\n return (\n <SketchPicker\n className={CSS.B(\"color-picker\")}\n color={new color.Color(value).hex}\n onChange={handleChange}\n presetColors={[]}\n {...props}\n />\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement, useCallback } from \"react\";\n\nimport { Button } from \"@/button\";\nimport { color } from \"@/color/core\";\nimport { type Crude, type Color } from \"@/color/core/color\";\nimport { Picker } from \"@/color/Picker\";\nimport { CSS } from \"@/css\";\nimport { Dropdown } from \"@/dropdown\";\nimport { type UseProps } from \"@/dropdown/Dropdown\";\nimport { Haul } from \"@/haul\";\nimport { type Input } from \"@/input\";\nimport { Text } from \"@/text\";\nimport { Theming } from \"@/theming\";\n\nimport \"@/color/Swatch/Swatch.css\";\n\nexport interface SwatchProps\n extends Input.Control<Crude, Color>,\n Omit<Button.ButtonProps, \"onChange\" | \"value\">,\n UseProps {}\n\nconst HAUL_TYPE = \"color\";\n\nexport const Swatch = ({\n value,\n onChange,\n className,\n size = \"medium\",\n onVisibleChange,\n initialVisible,\n draggable = true,\n ...props\n}: SwatchProps): ReactElement => {\n const { visible, open, close } = Dropdown.use({ onVisibleChange, initialVisible });\n\n const bg = Theming.use().colors.gray.l0;\n\n const d = new color.Color(value);\n\n const dragging = Haul.useDraggingState();\n\n const canDrop: Haul.CanDrop = useCallback(\n ({ items }) => {\n const [k] = Haul.filterByType(HAUL_TYPE, items);\n return k != null && k.key !== d.hex;\n },\n [d.hex],\n );\n\n const { startDrag, ...haulProps } = Haul.useDragAndDrop({\n type: \"Color.Swatch\",\n onDrop: ({ items }) => {\n const dropped = Haul.filterByType(HAUL_TYPE, items);\n if (items.length > 0) onChange?.(new color.Color(dropped[0].key as string));\n return dropped;\n },\n canDrop,\n });\n\n const swatch = (\n <Button.Button\n className={CSS(\n CSS.B(\"color-swatch\"),\n CSS.size(size),\n d.contrast(bg) > 1.5 && d.a > 0.5 && CSS.M(\"no-border\"),\n CSS.dropRegion(canDrop(dragging)),\n className,\n )}\n draggable={draggable}\n onDragStart={() => startDrag([{ type: HAUL_TYPE, key: d.hex }])}\n style={{ backgroundColor: color.cssString(value) }}\n variant=\"text\"\n onClick={open}\n size={size}\n tooltip={\n onChange != null ? (\n <Text.Text level=\"small\">Click to change color</Text.Text>\n ) : undefined\n }\n {...haulProps}\n {...props}\n />\n );\n\n if (onChange == null) return swatch;\n\n return (\n <Dropdown.Dialog\n close={close}\n visible={visible}\n className={CSS.BE(\"color-swatch\", \"dropdown\")}\n keepMounted={false}\n variant=\"floating\"\n >\n {swatch}\n <Picker value={value} onChange={onChange} />\n </Dropdown.Dialog>\n );\n};\n"],"names":["color.ZERO","color.Color","jsx","SketchPicker","CSS","Dropdown.use","Theming.use","Haul.useDraggingState","useCallback","Haul.filterByType","Haul.useDragAndDrop","Button.Button","color.cssString","Text.Text","jsxs","Dropdown.Dialog"],"mappings":";;;;;;;AAuBO,MAAM,SAAS,CAAC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AAQ,CAAC,EAAE,GAAa;AAClE,aAAA;AAAA,IACT;AAAA,IACA;AAAA,EAAA,CACD;AAED,QAAM,SACJC,2BAAA,kBAAA;AAAA,IAACS,OAAO;AAAA,IAAP;AAAA,MACC,WAAWP,IAAA;AAAA,QACTA,IAAA,IAAI,EAAE,cAAc;AAAA,QACpBA,IAAA,IAAI,KAAK,IAAI;AAAA,QACb,EAAE,SAAS,EAAE,IAAI,OAAO,EAAE,IAAI,OAAOA,IAAAA,IAAI,EAAE,WAAW;AAAA,QACtDA,IAAAA,IAAI,WAAW,QAAQ,QAAQ,CAAC;AAAA,QAChC;AAAA,MACF;AAAA,MACA;AAAA,MACA,aAAa,MAAM,UAAU,CAAC,EAAE,MAAM,WAAW,KAAK,EAAE,IAAI,CAAC,CAAC;AAAA,MAC9D,OAAO,EAAE,iBAAiBQ,IAAM,UAAU,KAAK,EAAE;AAAA,MACjD,SAAQ;AAAA,MACR,SAAS;AAAA,MACT;AAAA,MACA,SACE,YAAY,OACTV,2BAAAA,kBAAAA,IAAAW,OAAAA,MAAA,EAAU,OAAM,SAAQ,UAAA,wBAAqB,CAAA,IAC5C;AAAA,MAEL,GAAG;AAAA,MACH,GAAG;AAAA,IAAA;AAAA,EAAA;AAIR,MAAI,YAAY;AAAa,WAAA;AAG3B,SAAAC,2BAAA,kBAAA;AAAA,IAACC,OAAS;AAAA,IAAT;AAAA,MACC;AAAA,MACA;AAAA,MACA,WAAWX,IAAA,IAAI,GAAG,gBAAgB,UAAU;AAAA,MAC5C,aAAa;AAAA,MACb,SAAQ;AAAA,MAEP,UAAA;AAAA,QAAA;AAAA,QACDF,2BAAAA,kBAAAA,IAAC,QAAO,EAAA,OAAc,SAAoB,CAAA;AAAA,MAAA;AAAA,IAAA;AAAA,EAAA;AAGhD;;;;;;;;;;;;;"}
@@ -1,11 +1,11 @@
1
- import { A as Selector, n as Dialog, H as Hover, J as Column, z as Core$1, G as componentRenderProp, K as useSelect, B as Button$1, p as m0, j as use, L as CoreDateTime, N as DateTime, E as Editable, O as Link, M as MaybeEditable, Q as Symbols, e as Text, W as WithIcon, F as edit, R as evalColor, U as formatChildren } from "./Toggle-Cwf_871b.js";
1
+ import { A as Selector, n as Dialog, H as Hover, J as Column, z as Core$1, G as componentRenderProp, K as useSelect, B as Button$1, p as m0, j as use, L as CoreDateTime, N as DateTime, E as Editable, O as Link, M as MaybeEditable, Q as Symbols, e as Text, W as WithIcon, F as edit, R as evalColor, U as formatChildren } from "./Toggle-DcOiWiHG.js";
2
2
  import { C as ComponentSizeLevels, L as LEVELS, j as LevelComponentSizes, k as dimensions, l as levelZ, s as specZ } from "./aggregator-Dl2jHye5.js";
3
- import { K as Keyboard } from "./Keyboard-D_LUXnG3.js";
3
+ import { K as Keyboard } from "./Keyboard-BqO4SYSr.js";
4
4
  import { j as jsxRuntimeExports } from "./jsx-runtime-mMz73N64.js";
5
5
  import { useState, useEffect, useCallback } from "react";
6
6
  import { P as Pack } from "./Center-hbwH7rg9.js";
7
7
  import { C as CSS } from "./css-DoalWJF6.js";
8
- import { L as List } from "./List-T419F-at.js";
8
+ import { L as List } from "./List-aJEsDHql.js";
9
9
  const DEFAULT_COLUMNS = [];
10
10
  const Core = ({
11
11
  data,
@@ -217,4 +217,4 @@ export {
217
217
  defaultButton as d,
218
218
  external as e
219
219
  };
220
- //# sourceMappingURL=external-BbY0o_d-.js.map
220
+ //# sourceMappingURL=external-wfv-EKsR.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"external-BbY0o_d-.js","sources":["../src/select/List.tsx","../src/select/Button.tsx","../src/text/SelectLevel.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type PropsWithChildren, type ReactElement } from \"react\";\n\nimport { type Key, type Keyed } from \"@synnaxlabs/x\";\n\nimport { CSS } from \"@/css\";\nimport { Dropdown } from \"@/dropdown\";\nimport { List as CoreList } from \"@/list\";\nimport { componentRenderProp } from \"@/util/renderProp\";\n\nexport interface SelectListProps<K extends Key = Key, E extends Keyed<K> = Keyed<K>>\n extends CoreList.SelectorProps<K, E>,\n Pick<Partial<CoreList.ColumnHeaderProps<K, E>>, \"columns\">,\n Omit<Dropdown.DialogProps, \"onChange\" | \"children\">,\n PropsWithChildren<{}> {\n data?: E[];\n emptyContent?: ReactElement;\n hideColumnHeader?: boolean;\n omit?: K[];\n}\n\nconst DEFAULT_COLUMNS: CoreList.ColumnSpec[] = [];\n\nexport const Core = <K extends Key, E extends Keyed<K>>({\n data,\n emptyContent,\n value,\n onChange,\n allowMultiple,\n allowNone,\n hideColumnHeader = false,\n children,\n columns = DEFAULT_COLUMNS,\n visible,\n replaceOnSingle,\n omit,\n ...props\n}: SelectListProps<K, E>): ReactElement => (\n <CoreList.List data={data} emptyContent={emptyContent} omit={omit}>\n <CoreList.Selector\n value={value}\n onChange={onChange}\n allowMultiple={allowMultiple}\n allowNone={allowNone}\n replaceOnSingle={replaceOnSingle}\n >\n <Dropdown.Dialog visible={visible} className={CSS.B(\"select\")} {...props}>\n {children}\n <CoreList.Hover disabled={!visible}>\n <CoreList.Column.Header hide={hideColumnHeader} columns={columns}>\n <CoreList.Core.Virtual itemHeight={CoreList.Column.itemHeight}>\n {componentRenderProp(CoreList.Column.Item)}\n </CoreList.Core.Virtual>\n </CoreList.Column.Header>\n </CoreList.Hover>\n </Dropdown.Dialog>\n </CoreList.Selector>\n </CoreList.List>\n);\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n useCallback,\n type ReactElement,\n useState,\n useEffect,\n type ReactNode,\n} from \"react\";\n\nimport { Icon } from \"@synnaxlabs/media\";\nimport { type Keyed, type Key } from \"@synnaxlabs/x\";\n\nimport { Align } from \"@/align\";\nimport { Button as CoreButton } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { Dropdown } from \"@/dropdown\";\nimport { type Input } from \"@/input\";\nimport { type List as CoreList } from \"@/list\";\nimport {\n type UseSelectProps,\n useSelect,\n type UseSelectOnChangeExtra,\n} from \"@/list/useSelect\";\nimport { Core } from \"@/select/List\";\nimport { componentRenderProp, type RenderProp } from \"@/util/renderProp\";\n\nimport \"@/select/Button.css\";\n\nexport interface ButtonOptionProps<K extends Key = Key, E extends Keyed<K> = Keyed<K>>\n extends Pick<CoreButton.ButtonProps, \"onClick\"> {\n key: K;\n selected: boolean;\n entry: E;\n title: E[keyof E];\n}\n\nexport type ButtonProps<K extends Key = Key, E extends Keyed<K> = Keyed<K>> = Omit<\n UseSelectProps<K, E>,\n \"data\"\n> &\n Omit<Align.PackProps, \"children\" | \"onChange\"> & {\n data: E[];\n children?: RenderProp<ButtonOptionProps<K, E>>;\n entryRenderKey?: keyof E;\n };\n\nexport const Button = <K extends Key = Key, E extends Keyed<K> = Keyed<K>>({\n children = defaultSelectButtonOption,\n value,\n onChange,\n entryRenderKey = \"key\",\n allowNone = false,\n allowMultiple = false,\n data,\n replaceOnSingle,\n ...props\n}: ButtonProps<K, E>): JSX.Element => {\n const { onSelect } = useSelect<K, E>({\n allowMultiple,\n allowNone,\n replaceOnSingle,\n data,\n value,\n onChange,\n } as const as UseSelectProps<K, E>);\n\n return (\n <Align.Pack {...props}>\n {data.map((e) => {\n return children({\n key: e.key,\n onClick: () => onSelect(e.key),\n selected: e.key === value,\n entry: e,\n title: e[entryRenderKey],\n });\n })}\n </Align.Pack>\n );\n};\n\nconst defaultSelectButtonOption = <K extends Key = Key, E extends Keyed<K> = Keyed<K>>({\n onClick,\n selected,\n title,\n}: ButtonOptionProps<K, E>): JSX.Element => (\n <CoreButton.Button onClick={onClick} variant={selected ? \"filled\" : \"outlined\"}>\n {title as ReactNode}\n </CoreButton.Button>\n);\n\nexport interface DropdownButtonButtonProps<K extends Key, E extends Keyed<K>>\n extends CoreButton.ButtonProps {\n selected: E | null;\n renderKey: keyof E;\n toggle: () => void;\n visible: boolean;\n}\n\nexport interface DropdownButtonProps<K extends Key, E extends Keyed<K>>\n extends Omit<Dropdown.DialogProps, \"onChange\" | \"visible\" | \"children\" | \"close\">,\n Input.Control<K>,\n Omit<CoreList.ListProps<K, E>, \"children\">,\n Pick<CoreButton.ButtonProps, \"disabled\"> {\n columns?: Array<CoreList.ColumnSpec<K, E>>;\n children?: RenderProp<DropdownButtonButtonProps<K, E>>;\n entryRenderKey?: keyof E;\n allowNone?: boolean;\n hideColumnHeader?: boolean;\n disabled?: boolean;\n omit?: K[];\n}\n\nexport const BaseButton = ({\n selected,\n renderKey,\n toggle,\n visible,\n children,\n ...props\n}: DropdownButtonButtonProps<any, any>): ReactElement => (\n <CoreButton.Button\n className={CSS.B(\"select-button\")}\n onClick={toggle}\n variant=\"outlined\"\n endIcon={<Icon.Caret.Left className={CSS.BE(\"select-button\", \"indicator\")} />}\n {...props}\n >\n {children ?? selected?.[renderKey]}\n </CoreButton.Button>\n);\n\nexport const defaultButton: RenderProp<DropdownButtonButtonProps<any, any>> =\n componentRenderProp(BaseButton);\n\nexport const DropdownButton = <K extends Key = Key, E extends Keyed<K> = Keyed<K>>({\n data,\n value,\n columns = [],\n children = defaultButton,\n entryRenderKey = \"key\",\n allowNone = false,\n onChange,\n disabled,\n hideColumnHeader = true,\n ...props\n}: DropdownButtonProps<K, E>): ReactElement => {\n const { close, visible, toggle } = Dropdown.use();\n const [selected, setSelected] = useState<E | null>(\n data?.find((e) => e.key === value) ?? null,\n );\n\n useEffect(() => {\n setSelected(data?.find((e) => e.key === value) ?? null);\n }, [data, value]);\n\n const handleChange: UseSelectProps<K, E>[\"onChange\"] = useCallback(\n (next: K, e: UseSelectOnChangeExtra<K, E>): void => {\n close();\n if (next == null) {\n setSelected(null);\n return onChange(value);\n }\n setSelected(e.entries[0]);\n onChange(next);\n },\n [onChange, value, close, setSelected],\n );\n\n return (\n <Core<K, E>\n {...props}\n close={close}\n data={data}\n visible={visible}\n value={[value]}\n onChange={handleChange}\n allowMultiple={false}\n allowNone={allowNone}\n columns={columns}\n hideColumnHeader={hideColumnHeader}\n >\n {children({\n selected,\n renderKey: entryRenderKey,\n toggle,\n visible,\n disabled,\n })}\n </Core>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { Button as CoreButton } from \"@/button\";\nimport { Button, type ButtonOptionProps, type ButtonProps } from \"@/select/Button\";\nimport { type text } from \"@/text/core\";\n\ninterface Entry {\n key: text.Level;\n label: string;\n}\n\nexport interface SelectLevelProps\n extends Omit<ButtonProps<text.Level, Entry>, \"data\" | \"entryRenderKey\"> {}\n\nconst DATA: Entry[] = [\n {\n key: \"h2\",\n label: \"XL\",\n },\n {\n key: \"h3\",\n label: \"L\",\n },\n {\n key: \"h4\",\n label: \"M\",\n },\n {\n key: \"p\",\n label: \"S\",\n },\n {\n key: \"small\",\n label: \"XS\",\n },\n];\n\nconst defaultSelectDirectionButton = ({\n key,\n entry,\n onClick,\n selected,\n}: ButtonOptionProps<text.Level, Entry>): ReactElement => {\n return (\n <CoreButton.Button\n key={key}\n variant={selected ? \"filled\" : \"outlined\"}\n onClick={onClick}\n >\n {entry.label}\n </CoreButton.Button>\n );\n};\n\nexport const SelectLevel = ({\n children = defaultSelectDirectionButton,\n ...props\n}: SelectLevelProps): ReactElement => {\n return (\n <Button {...props} data={DATA}>\n {children}\n </Button>\n );\n};\n"],"names":["CoreList.List","jsx","CoreList.Selector","jsxs","Dropdown.Dialog","CoreList.Hover","CoreList.Column","CoreList.Core","Align.Pack","Co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;;;;;;;;"}
1
+ {"version":3,"file":"external-wfv-EKsR.js","sources":["../src/select/List.tsx","../src/select/Button.tsx","../src/text/SelectLevel.tsx"],"sourcesContent":["// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type PropsWithChildren, type ReactElement } from \"react\";\n\nimport { type Key, type Keyed } from \"@synnaxlabs/x\";\n\nimport { CSS } from \"@/css\";\nimport { Dropdown } from \"@/dropdown\";\nimport { List as CoreList } from \"@/list\";\nimport { componentRenderProp } from \"@/util/renderProp\";\n\nexport interface SelectListProps<K extends Key = Key, E extends Keyed<K> = Keyed<K>>\n extends CoreList.SelectorProps<K, E>,\n Pick<Partial<CoreList.ColumnHeaderProps<K, E>>, \"columns\">,\n Omit<Dropdown.DialogProps, \"onChange\" | \"children\">,\n PropsWithChildren<{}> {\n data?: E[];\n emptyContent?: ReactElement;\n hideColumnHeader?: boolean;\n omit?: K[];\n}\n\nconst DEFAULT_COLUMNS: CoreList.ColumnSpec[] = [];\n\nexport const Core = <K extends Key, E extends Keyed<K>>({\n data,\n emptyContent,\n value,\n onChange,\n allowMultiple,\n allowNone,\n hideColumnHeader = false,\n children,\n columns = DEFAULT_COLUMNS,\n visible,\n replaceOnSingle,\n omit,\n ...props\n}: SelectListProps<K, E>): ReactElement => (\n <CoreList.List data={data} emptyContent={emptyContent} omit={omit}>\n <CoreList.Selector\n value={value}\n onChange={onChange}\n allowMultiple={allowMultiple}\n allowNone={allowNone}\n replaceOnSingle={replaceOnSingle}\n >\n <Dropdown.Dialog visible={visible} className={CSS.B(\"select\")} {...props}>\n {children}\n <CoreList.Hover disabled={!visible}>\n <CoreList.Column.Header hide={hideColumnHeader} columns={columns}>\n <CoreList.Core.Virtual itemHeight={CoreList.Column.itemHeight}>\n {componentRenderProp(CoreList.Column.Item)}\n </CoreList.Core.Virtual>\n </CoreList.Column.Header>\n </CoreList.Hover>\n </Dropdown.Dialog>\n </CoreList.Selector>\n </CoreList.List>\n);\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport {\n useCallback,\n type ReactElement,\n useState,\n useEffect,\n type ReactNode,\n} from \"react\";\n\nimport { Icon } from \"@synnaxlabs/media\";\nimport { type Keyed, type Key } from \"@synnaxlabs/x\";\n\nimport { Align } from \"@/align\";\nimport { Button as CoreButton } from \"@/button\";\nimport { CSS } from \"@/css\";\nimport { Dropdown } from \"@/dropdown\";\nimport { type Input } from \"@/input\";\nimport { type List as CoreList } from \"@/list\";\nimport {\n type UseSelectProps,\n useSelect,\n type UseSelectOnChangeExtra,\n} from \"@/list/useSelect\";\nimport { Core } from \"@/select/List\";\nimport { componentRenderProp, type RenderProp } from \"@/util/renderProp\";\n\nimport \"@/select/Button.css\";\n\nexport interface ButtonOptionProps<K extends Key = Key, E extends Keyed<K> = Keyed<K>>\n extends Pick<CoreButton.ButtonProps, \"onClick\"> {\n key: K;\n selected: boolean;\n entry: E;\n title: E[keyof E];\n}\n\nexport type ButtonProps<K extends Key = Key, E extends Keyed<K> = Keyed<K>> = Omit<\n UseSelectProps<K, E>,\n \"data\"\n> &\n Omit<Align.PackProps, \"children\" | \"onChange\"> & {\n data: E[];\n children?: RenderProp<ButtonOptionProps<K, E>>;\n entryRenderKey?: keyof E;\n };\n\nexport const Button = <K extends Key = Key, E extends Keyed<K> = Keyed<K>>({\n children = defaultSelectButtonOption,\n value,\n onChange,\n entryRenderKey = \"key\",\n allowNone = false,\n allowMultiple = false,\n data,\n replaceOnSingle,\n ...props\n}: ButtonProps<K, E>): JSX.Element => {\n const { onSelect } = useSelect<K, E>({\n allowMultiple,\n allowNone,\n replaceOnSingle,\n data,\n value,\n onChange,\n } as const as UseSelectProps<K, E>);\n\n return (\n <Align.Pack {...props}>\n {data.map((e) => {\n return children({\n key: e.key,\n onClick: () => onSelect(e.key),\n selected: e.key === value,\n entry: e,\n title: e[entryRenderKey],\n });\n })}\n </Align.Pack>\n );\n};\n\nconst defaultSelectButtonOption = <K extends Key = Key, E extends Keyed<K> = Keyed<K>>({\n onClick,\n selected,\n title,\n}: ButtonOptionProps<K, E>): JSX.Element => (\n <CoreButton.Button onClick={onClick} variant={selected ? \"filled\" : \"outlined\"}>\n {title as ReactNode}\n </CoreButton.Button>\n);\n\nexport interface DropdownButtonButtonProps<K extends Key, E extends Keyed<K>>\n extends CoreButton.ButtonProps {\n selected: E | null;\n renderKey: keyof E;\n toggle: () => void;\n visible: boolean;\n}\n\nexport interface DropdownButtonProps<K extends Key, E extends Keyed<K>>\n extends Omit<Dropdown.DialogProps, \"onChange\" | \"visible\" | \"children\" | \"close\">,\n Input.Control<K>,\n Omit<CoreList.ListProps<K, E>, \"children\">,\n Pick<CoreButton.ButtonProps, \"disabled\"> {\n columns?: Array<CoreList.ColumnSpec<K, E>>;\n children?: RenderProp<DropdownButtonButtonProps<K, E>>;\n entryRenderKey?: keyof E;\n allowNone?: boolean;\n hideColumnHeader?: boolean;\n disabled?: boolean;\n omit?: K[];\n}\n\nexport const BaseButton = ({\n selected,\n renderKey,\n toggle,\n visible,\n children,\n ...props\n}: DropdownButtonButtonProps<any, any>): ReactElement => (\n <CoreButton.Button\n className={CSS.B(\"select-button\")}\n onClick={toggle}\n variant=\"outlined\"\n endIcon={<Icon.Caret.Left className={CSS.BE(\"select-button\", \"indicator\")} />}\n {...props}\n >\n {children ?? selected?.[renderKey]}\n </CoreButton.Button>\n);\n\nexport const defaultButton: RenderProp<DropdownButtonButtonProps<any, any>> =\n componentRenderProp(BaseButton);\n\nexport const DropdownButton = <K extends Key = Key, E extends Keyed<K> = Keyed<K>>({\n data,\n value,\n columns = [],\n children = defaultButton,\n entryRenderKey = \"key\",\n allowNone = false,\n onChange,\n disabled,\n hideColumnHeader = true,\n ...props\n}: DropdownButtonProps<K, E>): ReactElement => {\n const { close, visible, toggle } = Dropdown.use();\n const [selected, setSelected] = useState<E | null>(\n data?.find((e) => e.key === value) ?? null,\n );\n\n useEffect(() => {\n setSelected(data?.find((e) => e.key === value) ?? null);\n }, [data, value]);\n\n const handleChange: UseSelectProps<K, E>[\"onChange\"] = useCallback(\n (next: K, e: UseSelectOnChangeExtra<K, E>): void => {\n close();\n if (next == null) {\n setSelected(null);\n return onChange(value);\n }\n setSelected(e.entries[0]);\n onChange(next);\n },\n [onChange, value, close, setSelected],\n );\n\n return (\n <Core<K, E>\n {...props}\n close={close}\n data={data}\n visible={visible}\n value={[value]}\n onChange={handleChange}\n allowMultiple={false}\n allowNone={allowNone}\n columns={columns}\n hideColumnHeader={hideColumnHeader}\n >\n {children({\n selected,\n renderKey: entryRenderKey,\n toggle,\n visible,\n disabled,\n })}\n </Core>\n );\n};\n","// Copyright 2023 Synnax Labs, Inc.\n//\n// Use of this software is governed by the Business Source License included in the file\n// licenses/BSL.txt.\n//\n// As of the Change Date specified in that file, in accordance with the Business Source\n// License, use of this software will be governed by the Apache License, Version 2.0,\n// included in the file licenses/APL.txt.\n\nimport { type ReactElement } from \"react\";\n\nimport { Button as CoreButton } from \"@/button\";\nimport { Button, type ButtonOptionProps, type ButtonProps } from \"@/select/Button\";\nimport { type text } from \"@/text/core\";\n\ninterface Entry {\n key: text.Level;\n label: string;\n}\n\nexport interface SelectLevelProps\n extends Omit<ButtonProps<text.Level, Entry>, \"data\" | \"entryRenderKey\"> {}\n\nconst DATA: Entry[] = [\n {\n key: \"h2\",\n label: \"XL\",\n },\n {\n key: \"h3\",\n label: \"L\",\n },\n {\n key: \"h4\",\n label: \"M\",\n },\n {\n key: \"p\",\n label: \"S\",\n },\n {\n key: \"small\",\n label: \"XS\",\n },\n];\n\nconst defaultSelectDirectionButton = ({\n key,\n entry,\n onClick,\n selected,\n}: ButtonOptionProps<text.Level, Entry>): ReactElement => {\n return (\n <CoreButton.Button\n key={key}\n variant={selected ? \"filled\" : \"outlined\"}\n onClick={onClick}\n >\n {entry.label}\n </CoreButton.Button>\n );\n};\n\nexport const SelectLevel = ({\n children = defaultSelectDirectionButton,\n ...props\n}: SelectLevelProps): ReactElement => {\n return (\n <Button {...props} data={DATA}>\n {children}\n </Button>\n );\n};\n"],"names":["CoreList.List","jsx","CoreList.Selector","jsxs","Dropdown.Dialog","CoreList.Hover","CoreList.Column","CoreList.Core","Align.Pack","CoreButton.Button","Icon","Dropdown.use"],"mappings":";;;;;;;;AA6BA,MAAM,kBAAyC,CAAA;AAExC,MAAM,OAAO,CAAoC;AAAA,EACtD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,mBAAmB;AAAA,EACnB;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,4CACGA,MAAA,EAAc,MAAY,cAA4B,MACrD,UAAAC,kCAAA;AAAA,EAACC;AAAAA,EAAA;AAAA,IACC;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IAEA,UAAAC,kCAAA,KAACC,QAAA,EAAgB,SAAkB,WAAW,IAAI,EAAE,QAAQ,GAAI,GAAG,OAChE,UAAA;AAAA,MAAA;AAAA,MACAH,kCAAAA,IAAAI,OAAA,EAAe,UAAU,CAAC,SACzB,UAAAJ,sCAACK,OAAgB,QAAhB,EAAuB,MAAM,kBAAkB,SAC9C,UAACL,kCAAA,IAAAM,OAAc,SAAd,EAAsB,YAAYD,OAAgB,YAChD,UAAA,oBAAoBA,OAAgB,IAAI,EAAA,CAC3C,GACF,EACF,CAAA;AAAA,IAAA,GACF;AAAA,EAAA;AACF,EACF,CAAA;ACXK,MAAM,SAAS,CAAqD;AAAA,EACzE,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,YA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AAA,EACA;AAAA,EACA;AACF,MAA0D;AAEtD,SAAAA,kCAAA;AAAA,IAACQ;AAAAA,IAAA;AAAA,MAEC,SAAS,WAAW,WAAW;AAAA,MAC/B;AAAA,MAEC,UAAM,MAAA;AAAA,IAAA;AAAA,IAJF;AAAA,EAAA;AAOX;AAEO,MAAM,cAAc,CAAC;AAAA,EAC1B,WAAW;AAAA,EACX,GAAG;AACL,MAAsC;AACpC,+CACG,QAAQ,EAAA,GAAG,OAAO,MAAM,MACtB,SACH,CAAA;AAEJ;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
- import { w as useDataUtilContext, as as useDebouncedCallback, ah as Text, J as Column, at as ColumnContext, z as Core, h as DataProvider, H as Hover, au as ItemFrame, av as Search, A as Selector, aw as selectValueIsZero, ax as useDataContext, ay as useGetTransformedData, az as useHoverContext, aA as useSearch, K as useSelect, aB as useSelection, aC as useSelectionContext, v as useSelectionUtils, aD as useSetSourceData, aE as useSourceData, aF as useTransformedData } from "./Toggle-Cwf_871b.js";
1
+ import { w as useDataUtilContext, as as useDebouncedCallback, ah as Text, J as Column, at as ColumnContext, z as Core, h as DataProvider, H as Hover, au as ItemFrame, av as Search, A as Selector, aw as selectValueIsZero, ax as useDataContext, ay as useGetTransformedData, az as useHoverContext, aA as useSearch, K as useSelect, aB as useSelection, aC as useSelectionContext, v as useSelectionUtils, aD as useSetSourceData, aE as useSourceData, aF as useTransformedData } from "./Toggle-DcOiWiHG.js";
2
2
  import { j as jsxRuntimeExports } from "./jsx-runtime-mMz73N64.js";
3
3
  import { useCallback } from "react";
4
4
  import { m as w, h as usePurePassthrough } from "./aggregator-Dl2jHye5.js";
5
5
  import "./css-DoalWJF6.js";
6
6
  import "./Center-hbwH7rg9.js";
7
- import { L as List } from "./List-T419F-at.js";
7
+ import { L as List } from "./List-aJEsDHql.js";
8
8
  function isArray(value) {
9
9
  return !Array.isArray ? getTag(value) === "[object Array]" : Array.isArray(value);
10
10
  }
@@ -1431,13 +1431,13 @@ const defaultFilter = fuseFilter();
1431
1431
  const createFilterTransform = ({
1432
1432
  term,
1433
1433
  searcher = defaultFilter
1434
- }) => proxyMemo((data) => {
1434
+ }) => proxyMemo(({ data }) => {
1435
1435
  if (typeof searcher === "function") {
1436
1436
  if (term.length === 0 || (data == null ? void 0 : data.length) === 0)
1437
- return data;
1438
- return searcher(data).search(term);
1437
+ return { data, transformed: false };
1438
+ return { data: searcher(data).search(term), transformed: true };
1439
1439
  }
1440
- return searcher.search(term);
1440
+ return { data: searcher.search(term), transformed: true };
1441
1441
  });
1442
1442
  const useFilter = ({
1443
1443
  debounce = 250,
@@ -1505,4 +1505,4 @@ export {
1505
1505
  fuseFilter as f,
1506
1506
  proxyMemo as p
1507
1507
  };
1508
- //# sourceMappingURL=external-CaIFl1Z9.js.map
1508
+ //# sourceMappingURL=external-yv4F8ndX.js.map