@activecollab/components 2.0.119 → 2.0.121

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 (46) hide show
  1. package/dist/cjs/components/Card/Card.js +7 -4
  2. package/dist/cjs/components/Card/Card.js.map +1 -1
  3. package/dist/cjs/components/Card/Styles.js +7 -3
  4. package/dist/cjs/components/Card/Styles.js.map +1 -1
  5. package/dist/cjs/components/Entity/EntityCard.js +1 -1
  6. package/dist/cjs/components/Entity/EntityCard.js.map +1 -1
  7. package/dist/cjs/components/EntityCard/EntityCard.js +1 -1
  8. package/dist/cjs/components/EntityCard/EntityCard.js.map +1 -1
  9. package/dist/cjs/components/Paper/Paper.js.map +1 -1
  10. package/dist/cjs/components/Paper/Styles.js +4 -2
  11. package/dist/cjs/components/Paper/Styles.js.map +1 -1
  12. package/dist/cjs/utils/index.js +0 -7
  13. package/dist/cjs/utils/index.js.map +1 -1
  14. package/dist/cjs/utils/timeUtils.js +1 -70
  15. package/dist/cjs/utils/timeUtils.js.map +1 -1
  16. package/dist/esm/components/Card/Card.d.ts +1 -1
  17. package/dist/esm/components/Card/Card.d.ts.map +1 -1
  18. package/dist/esm/components/Card/Card.js +5 -2
  19. package/dist/esm/components/Card/Card.js.map +1 -1
  20. package/dist/esm/components/Card/Styles.d.ts +5 -1
  21. package/dist/esm/components/Card/Styles.d.ts.map +1 -1
  22. package/dist/esm/components/Card/Styles.js +7 -2
  23. package/dist/esm/components/Card/Styles.js.map +1 -1
  24. package/dist/esm/components/Entity/EntityCard.js +1 -1
  25. package/dist/esm/components/Entity/EntityCard.js.map +1 -1
  26. package/dist/esm/components/EntityCard/EntityCard.js +1 -1
  27. package/dist/esm/components/EntityCard/EntityCard.js.map +1 -1
  28. package/dist/esm/components/Paper/Paper.d.ts +1 -1
  29. package/dist/esm/components/Paper/Paper.d.ts.map +1 -1
  30. package/dist/esm/components/Paper/Paper.js.map +1 -1
  31. package/dist/esm/components/Paper/Styles.d.ts.map +1 -1
  32. package/dist/esm/components/Paper/Styles.js +1 -1
  33. package/dist/esm/components/Paper/Styles.js.map +1 -1
  34. package/dist/esm/utils/index.d.ts +1 -1
  35. package/dist/esm/utils/index.d.ts.map +1 -1
  36. package/dist/esm/utils/index.js +1 -1
  37. package/dist/esm/utils/index.js.map +1 -1
  38. package/dist/esm/utils/timeUtils.d.ts +0 -18
  39. package/dist/esm/utils/timeUtils.d.ts.map +1 -1
  40. package/dist/esm/utils/timeUtils.js +0 -68
  41. package/dist/esm/utils/timeUtils.js.map +1 -1
  42. package/dist/index.js +17 -79
  43. package/dist/index.js.map +1 -1
  44. package/dist/index.min.js +1 -1
  45. package/dist/index.min.js.map +1 -1
  46. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EntityCard.js","names":["React","forwardRef","useCallback","classnames","StyledEntityCard","EntityCard","_ref","ref","renderAs","properties","className","renderAsListItem","filter","p","showInList","map","createElement","key","name","render","renderAsGridItem","headerSection","cardSection","bodySection","footerSection","renderProperty","Fragment","hoverable","paperType","$renderAs","displayName"],"sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"sourcesContent":["import React, {\n Ref,\n HTMLAttributes,\n forwardRef,\n ReactNode,\n useCallback,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledEntityCard } from \"./Styles\";\n\nexport type cardSection = \"header\" | \"body\" | \"footer\";\n\nexport interface IEntityProperties {\n name: string;\n render: () => ReactNode;\n showInList?: boolean;\n cardSection: cardSection;\n className?: string;\n}\n\nexport interface IEntityCardProps {\n renderAs?: \"list-item\" | \"grid-item\";\n properties: IEntityProperties[];\n ref?: Ref<HTMLDivElement>;\n link?: string;\n className?: string;\n}\n\nexport const EntityCard = forwardRef(\n (\n {\n renderAs = \"list-item\",\n properties,\n className,\n }: HTMLAttributes<HTMLDivElement> & IEntityCardProps,\n ref: Ref<HTMLDivElement> | null | undefined\n ) => {\n const renderAsListItem = useCallback((properties: IEntityProperties[]) => {\n return properties\n .filter((p) => p.showInList)\n .map((p) => {\n return (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n });\n }, []);\n\n const renderAsGridItem = useCallback((properties: IEntityProperties[]) => {\n const headerSection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"header\"\n );\n const bodySection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"body\"\n );\n const footerSection = properties.filter(\n (p) => p.cardSection === \"footer\"\n );\n const renderProperty = (p: IEntityProperties): ReactNode => (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n return (\n <>\n <div className=\"card-header\">\n {headerSection.map((p) => renderProperty(p))}\n </div>\n <div className=\"card-body\">\n {bodySection.map((p) => renderProperty(p))}\n </div>\n <div className=\"card-footer\">\n {footerSection.map((p) => renderProperty(p))}\n </div>\n </>\n );\n }, []);\n\n return (\n <StyledEntityCard\n ref={ref}\n hoverable\n className={classnames(\n \"entity-card-wrapper\",\n {\n \"grid-item\": renderAs === \"grid-item\",\n \"list-item\": renderAs === \"list-item\",\n },\n className\n )}\n paperType={renderAs === \"grid-item\" ? \"paper-1\" : \"paper-2\"}\n $renderAs={renderAs}\n >\n {renderAs === \"list-item\" ? renderAsListItem(properties) : null}\n {renderAs === \"grid-item\" ? renderAsGridItem(properties) : null}\n </StyledEntityCard>\n );\n }\n);\n\nEntityCard.displayName = \"EntityCard\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAGVC,UAAU,EAEVC,WAAW,QACN,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,gBAAgB,QAAQ,UAAU;AAoB3C,OAAO,MAAMC,UAAU,gBAAGJ,UAAU,CAClC,CAAAK,IAAA,EAMEC,GAA2C,KACxC;EAAA,IANH;IACEC,QAAQ,GAAG,WAAW;IACtBC,UAAU;IACVC;EACiD,CAAC,GAAAJ,IAAA;EAGpD,MAAMK,gBAAgB,GAAGT,WAAW,CAAEO,UAA+B,IAAK;IACxE,OAAOA,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GACzBc,aAAa,CAACT,GAAG,CAAEF,CAAC,IAAKY,cAAc,CAACZ,CAAC,CAAC,CACxC,CACL,CAAC;EAEP,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEb,KAAA,CAAAgB,aAAA,CAACZ,gBAAgB;IACfG,GAAG,EAAEA,GAAI;IACToB,SAAS;IACTjB,SAAS,EAAEP,UAAU,CACnB,qBAAqB,EACrB;MACE,WAAW,EAAEK,QAAQ,KAAK,WAAW;MACrC,WAAW,EAAEA,QAAQ,KAAK;IAC5B,CAAC,EACDE,SACF,CAAE;IACFkB,SAAS,EAAEpB,QAAQ,KAAK,WAAW,GAAG,SAAS,GAAG,SAAU;IAC5DqB,SAAS,EAAErB;EAAS,GAEnBA,QAAQ,KAAK,WAAW,GAAGG,gBAAgB,CAACF,UAAU,CAAC,GAAG,IAAI,EAC9DD,QAAQ,KAAK,WAAW,GAAGY,gBAAgB,CAACX,UAAU,CAAC,GAAG,IAC3C,CAAC;AAEvB,CACF,CAAC;AAEDJ,UAAU,CAACyB,WAAW,GAAG,YAAY"}
1
+ {"version":3,"file":"EntityCard.js","names":["React","forwardRef","useCallback","classnames","StyledEntityCard","EntityCard","_ref","ref","renderAs","properties","className","renderAsListItem","filter","p","showInList","map","createElement","key","name","render","renderAsGridItem","headerSection","cardSection","bodySection","footerSection","renderProperty","Fragment","hoverable","variant","$renderAs","displayName"],"sources":["../../../../src/components/EntityCard/EntityCard.tsx"],"sourcesContent":["import React, {\n Ref,\n HTMLAttributes,\n forwardRef,\n ReactNode,\n useCallback,\n} from \"react\";\n\nimport classnames from \"classnames\";\n\nimport { StyledEntityCard } from \"./Styles\";\n\nexport type cardSection = \"header\" | \"body\" | \"footer\";\n\nexport interface IEntityProperties {\n name: string;\n render: () => ReactNode;\n showInList?: boolean;\n cardSection: cardSection;\n className?: string;\n}\n\nexport interface IEntityCardProps {\n renderAs?: \"list-item\" | \"grid-item\";\n properties: IEntityProperties[];\n ref?: Ref<HTMLDivElement>;\n link?: string;\n className?: string;\n}\n\nexport const EntityCard = forwardRef(\n (\n {\n renderAs = \"list-item\",\n properties,\n className,\n }: HTMLAttributes<HTMLDivElement> & IEntityCardProps,\n ref: Ref<HTMLDivElement> | null | undefined\n ) => {\n const renderAsListItem = useCallback((properties: IEntityProperties[]) => {\n return properties\n .filter((p) => p.showInList)\n .map((p) => {\n return (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n });\n }, []);\n\n const renderAsGridItem = useCallback((properties: IEntityProperties[]) => {\n const headerSection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"header\"\n );\n const bodySection = properties.filter(\n (p: IEntityProperties) => p.cardSection === \"body\"\n );\n const footerSection = properties.filter(\n (p) => p.cardSection === \"footer\"\n );\n const renderProperty = (p: IEntityProperties): ReactNode => (\n <div key={p.name} className={`entity-property-${p.name}`}>\n {p.render()}\n </div>\n );\n return (\n <>\n <div className=\"card-header\">\n {headerSection.map((p) => renderProperty(p))}\n </div>\n <div className=\"card-body\">\n {bodySection.map((p) => renderProperty(p))}\n </div>\n <div className=\"card-footer\">\n {footerSection.map((p) => renderProperty(p))}\n </div>\n </>\n );\n }, []);\n\n return (\n <StyledEntityCard\n ref={ref}\n hoverable\n className={classnames(\n \"entity-card-wrapper\",\n {\n \"grid-item\": renderAs === \"grid-item\",\n \"list-item\": renderAs === \"list-item\",\n },\n className\n )}\n variant={renderAs === \"grid-item\" ? \"paper-1\" : \"paper-2\"}\n $renderAs={renderAs}\n >\n {renderAs === \"list-item\" ? renderAsListItem(properties) : null}\n {renderAs === \"grid-item\" ? renderAsGridItem(properties) : null}\n </StyledEntityCard>\n );\n }\n);\n\nEntityCard.displayName = \"EntityCard\";\n"],"mappings":"AAAA,OAAOA,KAAK,IAGVC,UAAU,EAEVC,WAAW,QACN,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,gBAAgB,QAAQ,UAAU;AAoB3C,OAAO,MAAMC,UAAU,gBAAGJ,UAAU,CA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C,eACNb,KAAA,CAAAgB,aAAA;MAAKN,SAAS,EAAC;IAAW,GACvBa,WAAW,CAACR,GAAG,CAAEF,CAAC,IAAKY,cAAc,CAACZ,CAAC,CAAC,CACtC,CAAC,eACNb,KAAA,CAAAgB,aAAA;MAAKN,SAAS,EAAC;IAAa,GACzBc,aAAa,CAACT,GAAG,CAAEF,CAAC,IAAKY,cAAc,CAACZ,CAAC,CAAC,CACxC,CACL,CAAC;EAEP,CAAC,EAAE,EAAE,CAAC;EAEN,oBACEb,KAAA,CAAAgB,aAAA,CAACZ,gBAAgB;IACfG,GAAG,EAAEA,GAAI;IACToB,SAAS;IACTjB,SAAS,EAAEP,UAAU,CACnB,qBAAqB,EACrB;MACE,WAAW,EAAEK,QAAQ,KAAK,WAAW;MACrC,WAAW,EAAEA,QAAQ,KAAK;IAC5B,CAAC,EACDE,SACF,CAAE;IACFkB,OAAO,EAAEpB,QAAQ,KAAK,WAAW,GAAG,SAAS,GAAG,SAAU;IAC1DqB,SAAS,EAAErB;EAAS,GAEnBA,QAAQ,KAAK,WAAW,GAAGG,gBAAgB,CAACF,UAAU,CAAC,GAAG,IAAI,EAC9DD,QAAQ,KAAK,WAAW,GAAGY,gBAAgB,CAACX,UAAU,CAAC,GAAG,IAC3C,CAAC;AAEvB,CACF,CAAC;AAEDJ,UAAU,CAACyB,WAAW,GAAG,YAAY"}
@@ -9,7 +9,7 @@ export interface IPaperProps {
9
9
  /** Define custom style */
10
10
  style?: object;
11
11
  /** Type of paper to be used */
12
- type?: "paper-1" | "paper-2" | "paper-3";
12
+ type?: "paper-1" | "paper-2" | "paper-3" | "tile-1" | "tile-2";
13
13
  /** Paper has hover or not */
14
14
  hover?: boolean;
15
15
  /** Use optimized shadow */
@@ -1 +1 @@
1
- {"version":3,"file":"Paper.d.ts","sourceRoot":"","sources":["../../../../src/components/Paper/Paper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,SAAS,EAET,SAAS,EACV,MAAM,OAAO,CAAC;AAMf,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,kBAAkB;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACrC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACzC,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,2HAqCjB,CAAC"}
1
+ {"version":3,"file":"Paper.d.ts","sourceRoot":"","sources":["../../../../src/components/Paper/Paper.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAGZ,SAAS,EAET,SAAS,EACV,MAAM,OAAO,CAAC;AAMf,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,QAAQ,EAAE,SAAS,CAAC;IACpB,kBAAkB;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB;IAClB,QAAQ,CAAC,EAAE,SAAS,CAAC,cAAc,CAAC,CAAC;IACrC,0BAA0B;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,IAAI,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAC/D,6BAA6B;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,2BAA2B;IAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED;;GAEG;AACH,eAAO,MAAM,KAAK,2HAqCjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Paper.js","names":["React","forwardRef","classNames","StyledPaper","Paper","_ref","innerRef","children","className","type","hover","useOptimizedShadow","rest","createElement","_extends","ref","displayName"],"sources":["../../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n ReactNode,\n Ref,\n RefObject,\n} from \"react\";\n\nimport classNames from \"classnames\";\n\nimport { StyledPaper } from \"./Styles\";\n\nexport interface IPaperProps {\n /** Children type of node or string */\n children: ReactNode;\n /** CSS classes */\n className?: string;\n /** Ref object. */\n innerRef?: RefObject<HTMLDivElement>;\n /** Define custom style */\n style?: object;\n /** Type of paper to be used */\n type?: \"paper-1\" | \"paper-2\" | \"paper-3\";\n /** Paper has hover or not */\n hover?: boolean;\n /** Use optimized shadow */\n useOptimizedShadow?: boolean;\n}\n\n/**\n * This is a component description and should sit directly above your component\n */\nexport const Paper = forwardRef(\n (\n {\n children,\n className,\n type = \"paper-1\",\n hover = false,\n useOptimizedShadow = false,\n ...rest\n }: HTMLAttributes<HTMLDivElement> & IPaperProps,\n innerRef: Ref<HTMLDivElement> | null | undefined\n ) => {\n return (\n <StyledPaper\n className={classNames(className, {\n \"ac-shadow--raised--lg\":\n !useOptimizedShadow && hover && type === \"paper-1\",\n \"ac-shadow-optimized--lg\":\n useOptimizedShadow && hover && type === \"paper-1\",\n \"ac-shadow--lg\": !hover && type === \"paper-1\",\n \"ac-shadow--raised--sm\":\n (!useOptimizedShadow && hover && type === \"paper-2\") ||\n (!useOptimizedShadow && hover && type === \"paper-3\"),\n \"ac-shadow-optimized--sm\":\n (useOptimizedShadow && hover && type === \"paper-2\") ||\n (useOptimizedShadow && hover && type === \"paper-3\"),\n \"ac-shadow--sm\":\n (!hover && type === \"paper-2\") || (!hover && type === \"paper-3\"),\n })}\n ref={innerRef}\n type={type}\n {...rest}\n >\n {children}\n </StyledPaper>\n );\n }\n);\n\nPaper.displayName = \"Paper\";\n"],"mappings":";AAAA,OAAOA,KAAK,IACVC,UAAU,QAKL,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,WAAW,QAAQ,UAAU;AAmBtC;AACA;AACA;AACA,OAAO,MAAMC,KAAK,gBAAGH,UAAU,CAC7B,CAAAI,IAAA,EASEC,QAAgD,KAC7C;EAAA,IATH;IACEC,QAAQ;IACRC,SAAS;IACTC,IAAI,GAAG,SAAS;IAChBC,KAAK,GAAG,KAAK;IACbC,kBAAkB,GAAG,KAAK;IAC1B,GAAGC;EACyC,CAAC,GAAAP,IAAA;EAG/C,oBACEL,KAAA,CAAAa,aAAA,CAACV,WAAW,EAAAW,QAAA;IACVN,SAAS,EAAEN,UAAU,CAACM,SAAS,EAAE;MAC/B,uBAAuB,EACrB,CAACG,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS;MACpD,yBAAyB,EACvBE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS;MACnD,eAAe,EAAE,CAACC,KAAK,IAAID,IAAI,KAAK,SAAS;MAC7C,uBAAuB,EACpB,CAACE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS,IAClD,CAACE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAU;MACtD,yBAAyB,EACtBE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS,IACjDE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAU;MACrD,eAAe,EACZ,CAACC,KAAK,IAAID,IAAI,KAAK,SAAS,IAAM,CAACC,KAAK,IAAID,IAAI,KAAK;IAC1D,CAAC,CAAE;IACHM,GAAG,EAAET,QAAS;IACdG,IAAI,EAAEA;EAAK,GACPG,IAAI,GAEPL,QACU,CAAC;AAElB,CACF,CAAC;AAEDH,KAAK,CAACY,WAAW,GAAG,OAAO"}
1
+ {"version":3,"file":"Paper.js","names":["React","forwardRef","classNames","StyledPaper","Paper","_ref","innerRef","children","className","type","hover","useOptimizedShadow","rest","createElement","_extends","ref","displayName"],"sources":["../../../../src/components/Paper/Paper.tsx"],"sourcesContent":["import React, {\n forwardRef,\n HTMLAttributes,\n ReactNode,\n Ref,\n RefObject,\n} from \"react\";\n\nimport classNames from \"classnames\";\n\nimport { StyledPaper } from \"./Styles\";\n\nexport interface IPaperProps {\n /** Children type of node or string */\n children: ReactNode;\n /** CSS classes */\n className?: string;\n /** Ref object. */\n innerRef?: RefObject<HTMLDivElement>;\n /** Define custom style */\n style?: object;\n /** Type of paper to be used */\n type?: \"paper-1\" | \"paper-2\" | \"paper-3\" | \"tile-1\" | \"tile-2\";\n /** Paper has hover or not */\n hover?: boolean;\n /** Use optimized shadow */\n useOptimizedShadow?: boolean;\n}\n\n/**\n * This is a component description and should sit directly above your component\n */\nexport const Paper = forwardRef(\n (\n {\n children,\n className,\n type = \"paper-1\",\n hover = false,\n useOptimizedShadow = false,\n ...rest\n }: HTMLAttributes<HTMLDivElement> & IPaperProps,\n innerRef: Ref<HTMLDivElement> | null | undefined\n ) => {\n return (\n <StyledPaper\n className={classNames(className, {\n \"ac-shadow--raised--lg\":\n !useOptimizedShadow && hover && type === \"paper-1\",\n \"ac-shadow-optimized--lg\":\n useOptimizedShadow && hover && type === \"paper-1\",\n \"ac-shadow--lg\": !hover && type === \"paper-1\",\n \"ac-shadow--raised--sm\":\n (!useOptimizedShadow && hover && type === \"paper-2\") ||\n (!useOptimizedShadow && hover && type === \"paper-3\"),\n \"ac-shadow-optimized--sm\":\n (useOptimizedShadow && hover && type === \"paper-2\") ||\n (useOptimizedShadow && hover && type === \"paper-3\"),\n \"ac-shadow--sm\":\n (!hover && type === \"paper-2\") || (!hover && type === \"paper-3\"),\n })}\n ref={innerRef}\n type={type}\n {...rest}\n >\n {children}\n </StyledPaper>\n );\n }\n);\n\nPaper.displayName = \"Paper\";\n"],"mappings":";AAAA,OAAOA,KAAK,IACVC,UAAU,QAKL,OAAO;AAEd,OAAOC,UAAU,MAAM,YAAY;AAEnC,SAASC,WAAW,QAAQ,UAAU;AAmBtC;AACA;AACA;AACA,OAAO,MAAMC,KAAK,gBAAGH,UAAU,CAC7B,CAAAI,IAAA,EASEC,QAAgD,KAC7C;EAAA,IATH;IACEC,QAAQ;IACRC,SAAS;IACTC,IAAI,GAAG,SAAS;IAChBC,KAAK,GAAG,KAAK;IACbC,kBAAkB,GAAG,KAAK;IAC1B,GAAGC;EACyC,CAAC,GAAAP,IAAA;EAG/C,oBACEL,KAAA,CAAAa,aAAA,CAACV,WAAW,EAAAW,QAAA;IACVN,SAAS,EAAEN,UAAU,CAACM,SAAS,EAAE;MAC/B,uBAAuB,EACrB,CAACG,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS;MACpD,yBAAyB,EACvBE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS;MACnD,eAAe,EAAE,CAACC,KAAK,IAAID,IAAI,KAAK,SAAS;MAC7C,uBAAuB,EACpB,CAACE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS,IAClD,CAACE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAU;MACtD,yBAAyB,EACtBE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAS,IACjDE,kBAAkB,IAAID,KAAK,IAAID,IAAI,KAAK,SAAU;MACrD,eAAe,EACZ,CAACC,KAAK,IAAID,IAAI,KAAK,SAAS,IAAM,CAACC,KAAK,IAAID,IAAI,KAAK;IAC1D,CAAC,CAAE;IACHM,GAAG,EAAET,QAAS;IACdG,IAAI,EAAEA;EAAK,GACPG,IAAI,GAEPL,QACU,CAAC;AAElB,CACF,CAAC;AAEDH,KAAK,CAACY,WAAW,GAAG,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Paper/Styles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC,eAAO,MAAM,WAAW,wDAMvB,CAAC;AACF,eAAO,MAAM,WAAW,6EAQvB,CAAC"}
1
+ {"version":3,"file":"Styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Paper/Styles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC,eAAO,MAAM,WAAW,wDAMvB,CAAC;AACF,eAAO,MAAM,WAAW,6EAgBvB,CAAC"}
@@ -7,6 +7,6 @@ export const PaperStyles = css(["", " border-radius:var(--ac-br-8);", " ", ""],
7
7
  export const StyledPaper = styled.div.withConfig({
8
8
  displayName: "Styles__StyledPaper",
9
9
  componentId: "sc-1ld1e2o-0"
10
- })(["", " ", ""], PaperStyles, props => props.type === "paper-3" && css(["border:solid 1px var(--border-primary);"]));
10
+ })(["", " ", " ", ""], PaperStyles, props => (props.type === "paper-3" || props.type === "tile-1") && css(["border:solid 1px var(--border-primary);"]), props => (props.type === "tile-1" || props.type === "tile-2") && css(["&:hover{background-color:var(--color-theme-200);}"]));
11
11
  StyledPaper.displayName = "StyledPaper";
12
12
  //# sourceMappingURL=Styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","PaperStyles","StyledPaper","div","withConfig","displayName","componentId","props","type"],"sources":["../../../../src/components/Paper/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { IPaperProps } from \"./Paper\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const PaperStyles = css`\n ${tw`tw-bg-page-paper-main`}\n border-radius: var(--ac-br-8);\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nexport const StyledPaper = styled.div<IPaperProps>`\n ${PaperStyles}\n\n ${(props) =>\n props.type === \"paper-3\" &&\n css`\n border: solid 1px var(--border-primary);\n `}\n`;\n\nStyledPaper.displayName = \"StyledPaper\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAI/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,MAAMC,WAAW,GAAGH,GAAG,kDACxB;EAAA;AAAsB,CAAC,EAGzBE,SAAS,EACTD,cAAc,CACjB;AACD,OAAO,MAAMG,WAAW,GAAGL,MAAM,CAACM,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,kBACjCL,WAAW,EAEVM,KAAK,IACNA,KAAK,CAACC,IAAI,KAAK,SAAS,IACxBV,GAAG,6CAEF,CACJ;AAEDI,WAAW,CAACG,WAAW,GAAG,aAAa"}
1
+ {"version":3,"file":"Styles.js","names":["styled","css","BoxSizingStyle","FontStyle","PaperStyles","StyledPaper","div","withConfig","displayName","componentId","props","type"],"sources":["../../../../src/components/Paper/Styles.ts"],"sourcesContent":["import styled, { css } from \"styled-components\";\nimport tw from \"twin.macro\";\n\nimport { IPaperProps } from \"./Paper\";\nimport { BoxSizingStyle } from \"../BoxSizingStyle\";\nimport { FontStyle } from \"../FontStyle\";\n\nexport const PaperStyles = css`\n ${tw`tw-bg-page-paper-main`}\n border-radius: var(--ac-br-8);\n\n ${FontStyle}\n ${BoxSizingStyle}\n`;\nexport const StyledPaper = styled.div<IPaperProps>`\n ${PaperStyles}\n\n ${(props) =>\n (props.type === \"paper-3\" || props.type === \"tile-1\") &&\n css`\n border: solid 1px var(--border-primary);\n `}\n\n ${(props) =>\n (props.type === \"tile-1\" || props.type === \"tile-2\") &&\n css`\n &:hover {\n background-color: var(--color-theme-200);\n }\n `}\n`;\n\nStyledPaper.displayName = \"StyledPaper\";\n"],"mappings":"AAAA,OAAOA,MAAM,IAAIC,GAAG,QAAQ,mBAAmB;AAI/C,SAASC,cAAc,QAAQ,mBAAmB;AAClD,SAASC,SAAS,QAAQ,cAAc;AAExC,OAAO,MAAMC,WAAW,GAAGH,GAAG,kDACxB;EAAA;AAAsB,CAAC,EAGzBE,SAAS,EACTD,cAAc,CACjB;AACD,OAAO,MAAMG,WAAW,GAAGL,MAAM,CAACM,GAAG,CAAAC,UAAA;EAAAC,WAAA;EAAAC,WAAA;AAAA,uBACjCL,WAAW,EAEVM,KAAK,IACN,CAACA,KAAK,CAACC,IAAI,KAAK,SAAS,IAAID,KAAK,CAACC,IAAI,KAAK,QAAQ,KACpDV,GAAG,6CAEF,EAEIS,KAAK,IACV,CAACA,KAAK,CAACC,IAAI,KAAK,QAAQ,IAAID,KAAK,CAACC,IAAI,KAAK,QAAQ,KACnDV,GAAG,uDAIF,CACJ;AAEDI,WAAW,CAACG,WAAW,GAAG,aAAa"}
@@ -3,6 +3,6 @@ export * from "./colors";
3
3
  export * from "./validation";
4
4
  export { default as useForkRef } from "./useForkRef";
5
5
  export { default as useResizeObserver } from "./useResizeObserver";
6
- export { decimalToHours, formatHours } from "./timeUtils";
6
+ export { formatHours } from "./timeUtils";
7
7
  export { formatNumber, formatCurrency, numberWithSeparator, getNumberFromString, } from "./currencyUtils";
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EACL,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EACL,YAAY,EACZ,cAAc,EACd,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,iBAAiB,CAAC"}
@@ -3,6 +3,6 @@ export * from "./colors";
3
3
  export * from "./validation";
4
4
  export { default as useForkRef } from "./useForkRef";
5
5
  export { default as useResizeObserver } from "./useResizeObserver";
6
- export { decimalToHours, formatHours } from "./timeUtils";
6
+ export { formatHours } from "./timeUtils";
7
7
  export { formatNumber, formatCurrency, numberWithSeparator, getNumberFromString } from "./currencyUtils";
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["default","useForkRef","useResizeObserver","decimalToHours","formatHours","formatNumber","formatCurrency","numberWithSeparator","getNumberFromString"],"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from \"./layers\";\nexport * from \"./colors\";\nexport * from \"./validation\";\nexport { default as useForkRef } from \"./useForkRef\";\nexport { default as useResizeObserver } from \"./useResizeObserver\";\nexport { decimalToHours, formatHours } from \"./timeUtils\";\nexport {\n formatNumber,\n formatCurrency,\n numberWithSeparator,\n getNumberFromString,\n} from \"./currencyUtils\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qBAAqB;AAClE,SAASC,cAAc,EAAEC,WAAW,QAAQ,aAAa;AACzD,SACEC,YAAY,EACZC,cAAc,EACdC,mBAAmB,EACnBC,mBAAmB,QACd,iBAAiB"}
1
+ {"version":3,"file":"index.js","names":["default","useForkRef","useResizeObserver","formatHours","formatNumber","formatCurrency","numberWithSeparator","getNumberFromString"],"sources":["../../../src/utils/index.ts"],"sourcesContent":["export * from \"./layers\";\nexport * from \"./colors\";\nexport * from \"./validation\";\nexport { default as useForkRef } from \"./useForkRef\";\nexport { default as useResizeObserver } from \"./useResizeObserver\";\nexport { formatHours } from \"./timeUtils\";\nexport {\n formatNumber,\n formatCurrency,\n numberWithSeparator,\n getNumberFromString,\n} from \"./currencyUtils\";\n"],"mappings":"AAAA,cAAc,UAAU;AACxB,cAAc,UAAU;AACxB,cAAc,cAAc;AAC5B,SAASA,OAAO,IAAIC,UAAU,QAAQ,cAAc;AACpD,SAASD,OAAO,IAAIE,iBAAiB,QAAQ,qBAAqB;AAClE,SAASC,WAAW,QAAQ,aAAa;AACzC,SACEC,YAAY,EACZC,cAAc,EACdC,mBAAmB,EACnBC,mBAAmB,QACd,iBAAiB"}
@@ -15,24 +15,6 @@
15
15
  * formatHours("3.5", true) // "03:30"
16
16
  */
17
17
  export declare const formatHours: (num: number | string | undefined, withLeadingZeroHours?: boolean) => string;
18
- /**
19
- * @function decimalToHours
20
- * @deprecated
21
- * @description
22
- * Converts a decimal number representing hours into a formatted string (HH:MM).
23
- * The input can be a number, string, or undefined. The function handles various formats
24
- * and can optionally add a leading zero to the hours component.
25
- *
26
- * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.
27
- * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.
28
- *
29
- * @returns {string} - A formatted time string in HH:MM format.
30
- *
31
- * @example
32
- * decimalToHours(1.5) // "1:30"
33
- * decimalToHours("3.5", true) // "03:30"
34
- */
35
- export declare const decimalToHours: (num: number | string | undefined, withLeadingZeroHours?: boolean) => string;
36
18
  export declare const withLeadingZero: (num: string | number, size?: number) => string;
37
19
  export declare const isDecimal: (num: number) => boolean;
38
20
  //# sourceMappingURL=timeUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/timeUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,QACjB,MAAM,GAAG,MAAM,GAAG,SAAS,qCAE/B,MAkDF,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,cAAc,QACpB,MAAM,GAAG,MAAM,GAAG,SAAS,qCAE/B,MAqDF,CAAC;AAEF,eAAO,MAAM,eAAe,QAAS,MAAM,GAAG,MAAM,0BAInD,CAAC;AAEF,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,OAEvC,CAAC"}
1
+ {"version":3,"file":"timeUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/timeUtils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,WAAW,QACjB,MAAM,GAAG,MAAM,GAAG,SAAS,qCAE/B,MAkDF,CAAC;AAEF,eAAO,MAAM,eAAe,QAAS,MAAM,GAAG,MAAM,0BAInD,CAAC;AAEF,eAAO,MAAM,SAAS,QAAS,MAAM,KAAG,OAEvC,CAAC"}
@@ -63,74 +63,6 @@ export const formatHours = function (num, withLeadingZeroHours) {
63
63
  const minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
64
64
  return hours + ":" + withLeadingZero(minutes_formatted);
65
65
  };
66
-
67
- /**
68
- * @function decimalToHours
69
- * @deprecated
70
- * @description
71
- * Converts a decimal number representing hours into a formatted string (HH:MM).
72
- * The input can be a number, string, or undefined. The function handles various formats
73
- * and can optionally add a leading zero to the hours component.
74
- *
75
- * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.
76
- * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.
77
- *
78
- * @returns {string} - A formatted time string in HH:MM format.
79
- *
80
- * @example
81
- * decimalToHours(1.5) // "1:30"
82
- * decimalToHours("3.5", true) // "03:30"
83
- */
84
- export const decimalToHours = function (num, withLeadingZeroHours) {
85
- if (withLeadingZeroHours === void 0) {
86
- withLeadingZeroHours = false;
87
- }
88
- console.warn("Deprecated. Please use formatHours from @activecollab/components.");
89
- if (!num) {
90
- return "";
91
- }
92
- if (typeof num === "string" && !num) {
93
- return withLeadingZeroHours ? "00:00" : "0:00";
94
- }
95
- if (typeof num === "string" && num.indexOf(":") >= 0) {
96
- //eslint-disable-next-line
97
- let [_hours, _minutes] = num.split(":");
98
- if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {
99
- _minutes = Number(_minutes) + "0";
100
- }
101
- if (_hours && _minutes) {
102
- if (withLeadingZeroHours) {
103
- return withLeadingZero(_hours) + ":" + _minutes;
104
- }
105
- return _hours + ":" + _minutes;
106
- } else if (!_hours && _minutes) {
107
- return withLeadingZeroHours ? "00:" + _minutes : "0:" + _minutes;
108
- } else if (!_minutes && _hours) {
109
- return withLeadingZeroHours ? withLeadingZero(_hours) + ":00" : _hours + ":00";
110
- } else {
111
- return withLeadingZeroHours ? "00:00" : "0:00";
112
- }
113
- }
114
- if (typeof num === "string" && num.indexOf(",") >= 0) {
115
- num = num.replace(",", ".");
116
- }
117
- const input = typeof num === "string" ? parseFloat(num) : num;
118
- if (!isDecimal(input)) {
119
- if (withLeadingZeroHours) {
120
- return withLeadingZero(input) + ":00";
121
- }
122
- return input + ":00";
123
- }
124
- const decimal = input.toFixed(2);
125
- const time = decimal.toString().split(".");
126
- let hours = time[0];
127
- if (withLeadingZeroHours) {
128
- hours = withLeadingZero(hours);
129
- }
130
- const minutes = time[1];
131
- const minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
132
- return hours + ":" + withLeadingZero(minutes_formatted);
133
- };
134
66
  export const withLeadingZero = function (num, size) {
135
67
  if (size === void 0) {
136
68
  size = 2;
@@ -1 +1 @@
1
- {"version":3,"file":"timeUtils.js","names":["formatHours","num","withLeadingZeroHours","indexOf","_hours","_minutes","split","length","Number","withLeadingZero","replace","input","parseFloat","isDecimal","decimal","toFixed","time","toString","hours","minutes","minutes_formatted","Math","round","parseInt","decimalToHours","console","warn","size","s","isInteger"],"sources":["../../../src/utils/timeUtils.ts"],"sourcesContent":["/**\n * @function formatHours\n * @description\n * Formats a decimal number representing hours into a formatted string (HH:MM).\n * The input can be a number, string, or undefined. The function handles various formats\n * and can optionally add a leading zero to the hours component.\n *\n * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.\n * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.\n *\n * @returns {string} - A formatted time string in HH:MM format.\n *\n * @example\n * formatHours(1.5) // \"1:30\"\n * formatHours(\"3.5\", true) // \"03:30\"\n */\nexport const formatHours = (\n num: number | string | undefined,\n withLeadingZeroHours = false\n): string => {\n if (!num) {\n return \"\";\n }\n if (typeof num === \"string\" && !num) {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n if (typeof num === \"string\" && num.indexOf(\":\") >= 0) {\n //eslint-disable-next-line\n let [_hours, _minutes] = num.split(\":\");\n if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {\n _minutes = `${Number(_minutes)}0`;\n }\n if (_hours && _minutes) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(_hours)}:${_minutes}`;\n }\n return `${_hours}:${_minutes}`;\n } else if (!_hours && _minutes) {\n return withLeadingZeroHours ? `00:${_minutes}` : `0:${_minutes}`;\n } else if (!_minutes && _hours) {\n return withLeadingZeroHours\n ? `${withLeadingZero(_hours)}:00`\n : `${_hours}:00`;\n } else {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n }\n if (typeof num === \"string\" && num.indexOf(\",\") >= 0) {\n num = num.replace(\",\", \".\");\n }\n const input = typeof num === \"string\" ? parseFloat(num) : num;\n\n if (!isDecimal(input)) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(input)}:00`;\n }\n return `${input}:00`;\n }\n\n const decimal = input.toFixed(2);\n const time = decimal.toString().split(\".\");\n let hours: string = time[0];\n if (withLeadingZeroHours) {\n hours = withLeadingZero(hours);\n }\n const minutes: string = time[1];\n const minutes_formatted = Math.round((parseInt(minutes, 10) / 100) * 60);\n\n return `${hours}:${withLeadingZero(minutes_formatted)}`;\n};\n\n/**\n * @function decimalToHours\n * @deprecated\n * @description\n * Converts a decimal number representing hours into a formatted string (HH:MM).\n * The input can be a number, string, or undefined. The function handles various formats\n * and can optionally add a leading zero to the hours component.\n *\n * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.\n * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.\n *\n * @returns {string} - A formatted time string in HH:MM format.\n *\n * @example\n * decimalToHours(1.5) // \"1:30\"\n * decimalToHours(\"3.5\", true) // \"03:30\"\n */\nexport const decimalToHours = (\n num: number | string | undefined,\n withLeadingZeroHours = false\n): string => {\n console.warn(\n \"Deprecated. Please use formatHours from @activecollab/components.\"\n );\n if (!num) {\n return \"\";\n }\n if (typeof num === \"string\" && !num) {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n if (typeof num === \"string\" && num.indexOf(\":\") >= 0) {\n //eslint-disable-next-line\n let [_hours, _minutes] = num.split(\":\");\n if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {\n _minutes = `${Number(_minutes)}0`;\n }\n if (_hours && _minutes) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(_hours)}:${_minutes}`;\n }\n return `${_hours}:${_minutes}`;\n } else if (!_hours && _minutes) {\n return withLeadingZeroHours ? `00:${_minutes}` : `0:${_minutes}`;\n } else if (!_minutes && _hours) {\n return withLeadingZeroHours\n ? `${withLeadingZero(_hours)}:00`\n : `${_hours}:00`;\n } else {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n }\n if (typeof num === \"string\" && num.indexOf(\",\") >= 0) {\n num = num.replace(\",\", \".\");\n }\n const input = typeof num === \"string\" ? parseFloat(num) : num;\n\n if (!isDecimal(input)) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(input)}:00`;\n }\n return `${input}:00`;\n }\n\n const decimal = input.toFixed(2);\n const time = decimal.toString().split(\".\");\n let hours: string = time[0];\n if (withLeadingZeroHours) {\n hours = withLeadingZero(hours);\n }\n const minutes: string = time[1];\n const minutes_formatted = Math.round((parseInt(minutes, 10) / 100) * 60);\n\n return `${hours}:${withLeadingZero(minutes_formatted)}`;\n};\n\nexport const withLeadingZero = (num: string | number, size = 2) => {\n let s = `${num}`;\n while (s.length < size) s = `0` + s;\n return s;\n};\n\nexport const isDecimal = (num: number): boolean => {\n return !Number.isInteger(num);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,GAAG,SAAAA,CACzBC,GAAgC,EAChCC,oBAAoB,EACT;EAAA,IADXA,oBAAoB;IAApBA,oBAAoB,GAAG,KAAK;EAAA;EAE5B,IAAI,CAACD,GAAG,EAAE;IACR,OAAO,EAAE;EACX;EACA,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACA,GAAG,EAAE;IACnC,OAAOC,oBAAoB,aAAa,MAAM;EAChD;EACA,IAAI,OAAOD,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;IACpD;IACA,IAAI,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGJ,GAAG,CAACK,KAAK,CAAC,GAAG,CAAC;IACvC,IAAID,QAAQ,IAAIA,QAAQ,CAACE,MAAM,KAAK,CAAC,IAAIC,MAAM,CAACH,QAAQ,CAAC,GAAG,EAAE,EAAE;MAC9DA,QAAQ,GAAMG,MAAM,CAACH,QAAQ,CAAC,MAAG;IACnC;IACA,IAAID,MAAM,IAAIC,QAAQ,EAAE;MACtB,IAAIH,oBAAoB,EAAE;QACxB,OAAUO,eAAe,CAACL,MAAM,CAAC,SAAIC,QAAQ;MAC/C;MACA,OAAUD,MAAM,SAAIC,QAAQ;IAC9B,CAAC,MAAM,IAAI,CAACD,MAAM,IAAIC,QAAQ,EAAE;MAC9B,OAAOH,oBAAoB,WAASG,QAAQ,UAAUA,QAAU;IAClE,CAAC,MAAM,IAAI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exOf","_hours","_minutes","split","length","Number","withLeadingZero","replace","input","parseFloat","isDecimal","decimal","toFixed","time","toString","hours","minutes","minutes_formatted","Math","round","parseInt","size","s","isInteger"],"sources":["../../../src/utils/timeUtils.ts"],"sourcesContent":["/**\n * @function formatHours\n * @description\n * Formats a decimal number representing hours into a formatted string (HH:MM).\n * The input can be a number, string, or undefined. The function handles various formats\n * and can optionally add a leading zero to the hours component.\n *\n * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.\n * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.\n *\n * @returns {string} - A formatted time string in HH:MM format.\n *\n * @example\n * formatHours(1.5) // \"1:30\"\n * formatHours(\"3.5\", true) // \"03:30\"\n */\nexport const formatHours = (\n num: number | string | undefined,\n withLeadingZeroHours = false\n): string => {\n if (!num) {\n return \"\";\n }\n if (typeof num === \"string\" && !num) {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n if (typeof num === \"string\" && num.indexOf(\":\") >= 0) {\n //eslint-disable-next-line\n let [_hours, _minutes] = num.split(\":\");\n if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {\n _minutes = `${Number(_minutes)}0`;\n }\n if (_hours && _minutes) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(_hours)}:${_minutes}`;\n }\n return `${_hours}:${_minutes}`;\n } else if (!_hours && _minutes) {\n return withLeadingZeroHours ? `00:${_minutes}` : `0:${_minutes}`;\n } else if (!_minutes && _hours) {\n return withLeadingZeroHours\n ? `${withLeadingZero(_hours)}:00`\n : `${_hours}:00`;\n } else {\n return withLeadingZeroHours ? `00:00` : \"0:00\";\n }\n }\n if (typeof num === \"string\" && num.indexOf(\",\") >= 0) {\n num = num.replace(\",\", \".\");\n }\n const input = typeof num === \"string\" ? parseFloat(num) : num;\n\n if (!isDecimal(input)) {\n if (withLeadingZeroHours) {\n return `${withLeadingZero(input)}:00`;\n }\n return `${input}:00`;\n }\n\n const decimal = input.toFixed(2);\n const time = decimal.toString().split(\".\");\n let hours: string = time[0];\n if (withLeadingZeroHours) {\n hours = withLeadingZero(hours);\n }\n const minutes: string = time[1];\n const minutes_formatted = Math.round((parseInt(minutes, 10) / 100) * 60);\n\n return `${hours}:${withLeadingZero(minutes_formatted)}`;\n};\n\nexport const withLeadingZero = (num: string | number, size = 2) => {\n let s = `${num}`;\n while (s.length < size) s = `0` + s;\n return s;\n};\n\nexport const isDecimal = (num: number): boolean => {\n return !Number.isInteger(num);\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMA,WAAW,GAAG,SAAAA,CACzBC,GAAgC,EAChCC,oBAAoB,EACT;EAAA,IADXA,oBAAoB;IAApBA,oBAAoB,GAAG,KAAK;EAAA;EAE5B,IAAI,CAACD,GAAG,EAAE;IACR,OAAO,EAAE;EACX;EACA,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACA,GAAG,EAAE;IACnC,OAAOC,oBAAoB,aAAa,MAAM;EAChD;EACA,IAAI,OAAOD,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;IACpD;IACA,IAAI,CAACC,MAAM,EAAEC,QAAQ,CAAC,GAAGJ,GAAG,CAACK,KAAK,CAAC,GAAG,CAAC;IACvC,IAAID,QAAQ,IAAIA,QAAQ,CAACE,MAAM,KAAK,CAAC,IAAIC,MAAM,CAACH,QAAQ,CAAC,GAAG,EAAE,EAAE;MAC9DA,QAAQ,GAAMG,MAAM,CAACH,QAAQ,CAAC,MAAG;IACnC;IACA,IAAID,MAAM,IAAIC,QAAQ,EAAE;MACtB,IAAIH,oBAAoB,EAAE;QACxB,OAAUO,eAAe,CAACL,MAAM,CAAC,SAAIC,QAAQ;MAC/C;MACA,OAAUD,MAAM,SAAIC,QAAQ;IAC9B,CAAC,MAAM,IAAI,CAACD,MAAM,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AACR,GAAoB,EAAEuB,IAAI,EAAS;EAAA,IAAbA,IAAI;IAAJA,IAAI,GAAG,CAAC;EAAA;EAC5D,IAAIC,CAAC,QAAMxB,GAAK;EAChB,OAAOwB,CAAC,CAAClB,MAAM,GAAGiB,IAAI,EAAEC,CAAC,GAAG,MAAMA,CAAC;EACnC,OAAOA,CAAC;AACV,CAAC;AAED,OAAO,MAAMZ,SAAS,GAAIZ,GAAW,IAAc;EACjD,OAAO,CAACO,MAAM,CAACkB,SAAS,CAACzB,GAAG,CAAC;AAC/B,CAAC"}
package/dist/index.js CHANGED
@@ -833,75 +833,6 @@
833
833
  var minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
834
834
  return "".concat(hours, ":").concat(withLeadingZero(minutes_formatted));
835
835
  };
836
-
837
- /**
838
- * @function decimalToHours
839
- * @deprecated
840
- * @description
841
- * Converts a decimal number representing hours into a formatted string (HH:MM).
842
- * The input can be a number, string, or undefined. The function handles various formats
843
- * and can optionally add a leading zero to the hours component.
844
- *
845
- * @param {number | string | undefined} num - The input representing the hours, which can be in decimal format, a time string, or undefined.
846
- * @param {boolean} [withLeadingZeroHours=false] - Whether to add a leading zero to the hours part of the output.
847
- *
848
- * @returns {string} - A formatted time string in HH:MM format.
849
- *
850
- * @example
851
- * decimalToHours(1.5) // "1:30"
852
- * decimalToHours("3.5", true) // "03:30"
853
- */
854
- var decimalToHours = function decimalToHours(num) {
855
- var withLeadingZeroHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
856
- console.warn("Deprecated. Please use formatHours from @activecollab/components.");
857
- if (!num) {
858
- return "";
859
- }
860
- if (typeof num === "string" && !num) {
861
- return withLeadingZeroHours ? "00:00" : "0:00";
862
- }
863
- if (typeof num === "string" && num.indexOf(":") >= 0) {
864
- //eslint-disable-next-line
865
- var _num$split3 = num.split(":"),
866
- _num$split4 = _slicedToArray(_num$split3, 2),
867
- _hours = _num$split4[0],
868
- _minutes = _num$split4[1];
869
- if (_minutes && _minutes.length === 1 && Number(_minutes) < 10) {
870
- _minutes = "".concat(Number(_minutes), "0");
871
- }
872
- if (_hours && _minutes) {
873
- if (withLeadingZeroHours) {
874
- return "".concat(withLeadingZero(_hours), ":").concat(_minutes);
875
- }
876
- return "".concat(_hours, ":").concat(_minutes);
877
- } else if (!_hours && _minutes) {
878
- return withLeadingZeroHours ? "00:".concat(_minutes) : "0:".concat(_minutes);
879
- } else if (!_minutes && _hours) {
880
- return withLeadingZeroHours ? "".concat(withLeadingZero(_hours), ":00") : "".concat(_hours, ":00");
881
- } else {
882
- return withLeadingZeroHours ? "00:00" : "0:00";
883
- }
884
- }
885
- if (typeof num === "string" && num.indexOf(",") >= 0) {
886
- num = num.replace(",", ".");
887
- }
888
- var input = typeof num === "string" ? parseFloat(num) : num;
889
- if (!isDecimal(input)) {
890
- if (withLeadingZeroHours) {
891
- return "".concat(withLeadingZero(input), ":00");
892
- }
893
- return "".concat(input, ":00");
894
- }
895
- var decimal = input.toFixed(2);
896
- var time = decimal.toString().split(".");
897
- var hours = time[0];
898
- if (withLeadingZeroHours) {
899
- hours = withLeadingZero(hours);
900
- }
901
- var minutes = time[1];
902
- var minutes_formatted = Math.round(parseInt(minutes, 10) / 100 * 60);
903
- return "".concat(hours, ":").concat(withLeadingZero(minutes_formatted));
904
- };
905
836
  var withLeadingZero = function withLeadingZero(num) {
906
837
  var size = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
907
838
  var s = "".concat(num);
@@ -10775,8 +10706,10 @@
10775
10706
  var StyledPaper = styled__default["default"].div.withConfig({
10776
10707
  displayName: "Styles__StyledPaper",
10777
10708
  componentId: "sc-1ld1e2o-0"
10778
- })(["", " ", ""], PaperStyles, function (props) {
10779
- return props.type === "paper-3" && styled.css(["border:solid 1px var(--border-primary);"]);
10709
+ })(["", " ", " ", ""], PaperStyles, function (props) {
10710
+ return (props.type === "paper-3" || props.type === "tile-1") && styled.css(["border:solid 1px var(--border-primary);"]);
10711
+ }, function (props) {
10712
+ return (props.type === "tile-1" || props.type === "tile-2") && styled.css(["&:hover{background-color:var(--color-theme-200);}"]);
10780
10713
  });
10781
10714
  StyledPaper.displayName = "StyledPaper";
10782
10715
 
@@ -10841,24 +10774,30 @@
10841
10774
  var StyledCard = styled__default["default"](Paper).withConfig({
10842
10775
  displayName: "Styles__StyledCard",
10843
10776
  componentId: "sc-hllbj1-0"
10844
- })(["", ""], {
10777
+ })(["", " ", ""], {
10845
10778
  "color": "var(--color-theme-900)"
10779
+ }, function (_ref) {
10780
+ var $pointer = _ref.$pointer;
10781
+ return $pointer && styled.css(["cursor:pointer;"]);
10846
10782
  });
10847
10783
  StyledCard.displayName = "StyledCard";
10848
10784
 
10849
- var _excluded$16 = ["children", "className", "hoverable", "paperType"];
10785
+ var _excluded$16 = ["children", "className", "hoverable", "variant", "onClick"];
10850
10786
  var Card = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
10851
10787
  var children = _ref.children,
10852
10788
  className = _ref.className,
10853
10789
  _ref$hoverable = _ref.hoverable,
10854
10790
  hoverable = _ref$hoverable === void 0 ? false : _ref$hoverable,
10855
- _ref$paperType = _ref.paperType,
10856
- paperType = _ref$paperType === void 0 ? "paper-2" : _ref$paperType,
10791
+ _ref$variant = _ref.variant,
10792
+ variant = _ref$variant === void 0 ? "paper-2" : _ref$variant,
10793
+ onClick = _ref.onClick,
10857
10794
  rest = _objectWithoutProperties(_ref, _excluded$16);
10858
10795
  return /*#__PURE__*/React__default["default"].createElement(StyledCard, _extends({}, rest, {
10859
- type: paperType,
10796
+ type: variant,
10860
10797
  className: classNames__default["default"]("c-card", className),
10861
10798
  hover: hoverable,
10799
+ $pointer: typeof onClick === "function",
10800
+ onClick: onClick,
10862
10801
  useOptimizedShadow: true,
10863
10802
  ref: ref
10864
10803
  }), children);
@@ -10927,7 +10866,7 @@
10927
10866
  "grid-item": renderAs === "grid-item",
10928
10867
  "list-item": renderAs === "list-item"
10929
10868
  }, className),
10930
- paperType: renderAs === "grid-item" ? "paper-1" : "paper-2",
10869
+ variant: renderAs === "grid-item" ? "paper-1" : "paper-2",
10931
10870
  $renderAs: renderAs
10932
10871
  }, renderAs === "list-item" ? renderAsListItem(properties) : null, renderAs === "grid-item" ? renderAsGridItem(properties) : null);
10933
10872
  });
@@ -18489,7 +18428,7 @@
18489
18428
  as: Component,
18490
18429
  $renderAs: renderAs,
18491
18430
  $background: background,
18492
- paperType: paperType,
18431
+ variant: paperType,
18493
18432
  className: classNames__default["default"]("c-entity-card", classSuffix, className),
18494
18433
  $isCollection: isCollection
18495
18434
  }, rest, {
@@ -20066,7 +20005,6 @@
20066
20005
  exports._Dialog = _Dialog;
20067
20006
  exports._List = _List;
20068
20007
  exports.colors = colors$1;
20069
- exports.decimalToHours = decimalToHours;
20070
20008
  exports.formatCurrency = formatCurrency;
20071
20009
  exports.formatHours = formatHours;
20072
20010
  exports.formatNumber = formatNumber;