@popmenu/common-ui 0.172.1 → 0.172.3

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 (23) hide show
  1. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +2 -0
  2. package/build/cjs/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +3 -1
  3. package/build/cjs/index.js +75 -37
  4. package/build/cjs/index.js.map +1 -1
  5. package/build/cjs/util/selectDisplay.d.ts +8 -0
  6. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js +16 -5
  7. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialog.js.map +1 -1
  8. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationDialogProps.d.ts +2 -0
  9. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js +3 -1
  10. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationForm.js.map +1 -1
  11. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.d.ts +3 -1
  12. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js +2 -2
  13. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationTitle.js.map +1 -1
  14. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationUserForm.js +20 -12
  15. package/build/esm/components/FollowerAuthenticationDialog/FollowerAuthenticationUserForm.js.map +1 -1
  16. package/build/esm/components/Icon/Icon.js +8 -11
  17. package/build/esm/components/Icon/Icon.js.map +1 -1
  18. package/build/esm/components/Icon/IconStyles.js +12 -7
  19. package/build/esm/components/Icon/IconStyles.js.map +1 -1
  20. package/build/esm/util/selectDisplay.d.ts +8 -0
  21. package/build/esm/util/selectDisplay.js +21 -0
  22. package/build/esm/util/selectDisplay.js.map +1 -0
  23. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"IconStyles.js","sources":["../../../../src/components/Icon/IconStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { IconProps } from './IconProps'\n\ntype StyleProps = Pick<IconProps, 'color' | 'size'>\n\nexport const useIconStyles = makeStyles<Theme, StyleProps>(({ spacing, palette }) => {\n const getFontSize = ({ size }: StyleProps) => {\n return (\n {\n inherit: 'inherit',\n small: spacing(1.5),\n medium: spacing(2),\n large: spacing(2.5),\n 'extra-large': spacing(3),\n }[size] ?? 'inherit'\n )\n }\n\n const getColor = (props: StyleProps) => {\n const semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error']\n let value = 'inherit'\n if (props.color) {\n if (semanticColors.includes(props.color.split('.')[0])) {\n const [color, variant = 'main'] = props.color.split('.')\n // @ts-expect-error - todo.\n value = palette[color][variant]\n } else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {\n value = props.color\n }\n }\n return value\n }\n\n return {\n root: {\n color: getColor,\n fontSize: getFontSize,\n width: '1em',\n height: '1em',\n strokeWidth: '1.3px',\n },\n }\n})\n"],"names":[],"mappings":";;AAKO,MAAM,aAAa,GAAG,UAAU,CAAoB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAI;AAClF,IAAA,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAc,KAAI;AAC3C,QAAA,QACE;AACE,YAAA,OAAO,EAAE,SAAS;AAClB,YAAA,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC;AACnB,YAAA,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AAClB,YAAA,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC;AACnB,YAAA,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1B,SAAA,CAAC,IAAI,CAAC,IAAI,SAAS;AAExB,KAAC;AAED,IAAA,MAAM,QAAQ,GAAG,CAAC,KAAiB,KAAI;AACrC,QAAA,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;QACtF,IAAI,KAAK,GAAG,SAAS;AACrB,QAAA,IAAI,KAAK,CAAC,KAAK,EAAE;AACf,YAAA,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;AACtD,gBAAA,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;gBAExD,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;;AAC1B,iBAAA,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE;AACrD,gBAAA,KAAK,GAAG,KAAK,CAAC,KAAK;;;AAGvB,QAAA,OAAO,KAAK;AACd,KAAC;IAED,OAAO;AACL,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,QAAQ;AACf,YAAA,QAAQ,EAAE,WAAW;AACrB,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,WAAW,EAAE,OAAO;AACrB,SAAA;KACF;AACH,CAAC;;;;"}
1
+ {"version":3,"file":"IconStyles.js","sources":["../../../../src/components/Icon/IconStyles.ts"],"sourcesContent":["import { makeStyles, Theme } from '@material-ui/core'\nimport { IconProps } from './IconProps'\n\ntype StyleProps = Pick<IconProps, 'color' | 'size'>\n\nexport const useIconStyles = makeStyles<Theme, StyleProps>(({ spacing, palette }) => {\n const getFontSize = ({ size }: StyleProps) => {\n switch (size) {\n case 'small':\n return spacing(1.5)\n case 'medium':\n return spacing(2)\n case 'large':\n return spacing(2.5)\n case 'extra-large':\n return spacing(3)\n default:\n return 'inherit'\n }\n }\n\n const getColor = (props: StyleProps) => {\n const semanticColors = ['primary', 'secondary', 'info', 'success', 'warning', 'error']\n let value = 'inherit'\n if (props.color) {\n if (semanticColors.includes(props.color.split('.')[0])) {\n const [color, variant = 'main'] = props.color.split('.')\n // @ts-expect-error - todo.\n value = palette[color][variant]\n } else if (props.color.search(/^(rgb|hsla|#)/) !== -1) {\n value = props.color\n }\n }\n return value\n }\n\n return {\n root: {\n color: getColor,\n fontSize: getFontSize,\n width: '1em',\n height: '1em',\n strokeWidth: '1.3px',\n },\n }\n})\n"],"names":[],"mappings":";;AAKO,MAAM,aAAa,GAAG,UAAU,CAAoB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,KAAI;AAClF,IAAA,MAAM,WAAW,GAAG,CAAC,EAAE,IAAI,EAAc,KAAI;QAC3C,QAAQ,IAAI;AACV,YAAA,KAAK,OAAO;AACV,gBAAA,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,YAAA,KAAK,QAAQ;AACX,gBAAA,OAAO,OAAO,CAAC,CAAC,CAAC;AACnB,YAAA,KAAK,OAAO;AACV,gBAAA,OAAO,OAAO,CAAC,GAAG,CAAC;AACrB,YAAA,KAAK,aAAa;AAChB,gBAAA,OAAO,OAAO,CAAC,CAAC,CAAC;AACnB,YAAA;AACE,gBAAA,OAAO,SAAS;;AAEtB,KAAC;AAED,IAAA,MAAM,QAAQ,GAAG,CAAC,KAAiB,KAAI;AACrC,QAAA,MAAM,cAAc,GAAG,CAAC,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC;QACtF,IAAI,KAAK,GAAG,SAAS;AACrB,QAAA,IAAI,KAAK,CAAC,KAAK,EAAE;AACf,YAAA,IAAI,cAAc,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;AACtD,gBAAA,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC;;gBAExD,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;;AAC1B,iBAAA,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,eAAe,CAAC,KAAK,EAAE,EAAE;AACrD,gBAAA,KAAK,GAAG,KAAK,CAAC,KAAK;;;AAGvB,QAAA,OAAO,KAAK;AACd,KAAC;IAED,OAAO;AACL,QAAA,IAAI,EAAE;AACJ,YAAA,KAAK,EAAE,QAAQ;AACf,YAAA,QAAQ,EAAE,WAAW;AACrB,YAAA,KAAK,EAAE,KAAK;AACZ,YAAA,MAAM,EAAE,KAAK;AACb,YAAA,WAAW,EAAE,OAAO;AACrB,SAAA;KACF;AACH,CAAC;;;;"}
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Replaces Material UI's display computation for a single-value select, so an empty one
4
+ * renders no zero-width space. Pass the same children given to the select, and set
5
+ * `displayEmpty`, otherwise Material UI skips `renderValue` while the value is empty.
6
+ * Values are compared as strings, the way Material UI compares its own non-object values.
7
+ */
8
+ export declare const renderSelectValue: (children: ReactNode) => (selected: unknown) => ReactNode;
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+
3
+ // Material UI renders <span>&#8203;</span> whenever a select has nothing to display, and a
4
+ // screen reader announces that zero-width space as part of the combobox value. Returning
5
+ // null or an empty string from renderValue brings that placeholder back, so an empty select
6
+ // renders an empty span instead. The field keeps its height either way, from the min-height
7
+ // Material UI sets on the display element.
8
+ const emptySelectDisplay = React.createElement("span", { "aria-hidden": "true" });
9
+ const isOption = (child) => React.isValidElement(child);
10
+ /**
11
+ * Replaces Material UI's display computation for a single-value select, so an empty one
12
+ * renders no zero-width space. Pass the same children given to the select, and set
13
+ * `displayEmpty`, otherwise Material UI skips `renderValue` while the value is empty.
14
+ * Values are compared as strings, the way Material UI compares its own non-object values.
15
+ */
16
+ const renderSelectValue = (children) => (selected) => React.Children.toArray(children)
17
+ .filter(isOption)
18
+ .find((option) => String(option.props.value) === String(selected))?.props.children ?? emptySelectDisplay;
19
+
20
+ export { renderSelectValue };
21
+ //# sourceMappingURL=selectDisplay.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"selectDisplay.js","sources":["../../../src/util/selectDisplay.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode } from 'react'\n\n// Material UI renders <span>&#8203;</span> whenever a select has nothing to display, and a\n// screen reader announces that zero-width space as part of the combobox value. Returning\n// null or an empty string from renderValue brings that placeholder back, so an empty select\n// renders an empty span instead. The field keeps its height either way, from the min-height\n// Material UI sets on the display element.\nconst emptySelectDisplay = <span aria-hidden=\"true\" />\n\ntype Option = ReactElement<{ children?: ReactNode; value?: unknown }>\n\nconst isOption = (child: ReactNode): child is Option => React.isValidElement(child)\n\n/**\n * Replaces Material UI's display computation for a single-value select, so an empty one\n * renders no zero-width space. Pass the same children given to the select, and set\n * `displayEmpty`, otherwise Material UI skips `renderValue` while the value is empty.\n * Values are compared as strings, the way Material UI compares its own non-object values.\n */\nexport const renderSelectValue =\n (children: ReactNode) =>\n (selected: unknown): ReactNode =>\n React.Children.toArray(children)\n .filter(isOption)\n .find((option) => String(option.props.value) === String(selected))?.props.children ?? emptySelectDisplay\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM,kBAAkB,GAAG,KAAkB,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAA,MAAM,GAAG;AAItD,MAAM,QAAQ,GAAG,CAAC,KAAgB,KAAsB,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;AAEnF;;;;;AAKG;MACU,iBAAiB,GAC5B,CAAC,QAAmB,KACpB,CAAC,QAAiB,KAChB,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,QAAQ;KAC5B,MAAM,CAAC,QAAQ;KACf,IAAI,CAAC,CAAC,MAAM,KAAK,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,IAAI;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@popmenu/common-ui",
3
- "version": "0.172.1",
3
+ "version": "0.172.3",
4
4
  "license": "MIT",
5
5
  "author": "Popmenu Design System Team",
6
6
  "description": "React components for all Popmenu apps on the web.",
@@ -31,5 +31,5 @@
31
31
  "react": "18.x || 19.x"
32
32
  },
33
33
  "sideEffects": false,
34
- "gitHead": "b0c3500e2ec768ddf4856c1983c6787fc540b0f0"
34
+ "gitHead": "b7adfd39a80e94956a2df92c3c95ba7500d57d17"
35
35
  }