@alfalab/core-components-picker-button 7.4.3 → 7.6.1

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 (77) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/Component.d.ts +28 -6
  3. package/dist/Component.js +13 -7
  4. package/dist/cssm/Component.d.ts +28 -6
  5. package/dist/cssm/Component.js +13 -6
  6. package/dist/cssm/field/Component.d.ts +10 -0
  7. package/dist/cssm/field/Component.js +25 -8
  8. package/dist/cssm/field/index.d.ts +1 -1
  9. package/dist/cssm/field/index.js +7 -3
  10. package/dist/cssm/index.js +9 -3
  11. package/dist/cssm/index.module.css +4 -0
  12. package/dist/cssm/option/Component.d.ts +11 -0
  13. package/dist/cssm/option/Component.js +25 -0
  14. package/dist/cssm/option/index.d.ts +1 -0
  15. package/dist/cssm/option/index.js +13 -0
  16. package/dist/cssm/option/index.module.css +24 -0
  17. package/dist/cssm/tslib.es6-ce870b46.d.ts +32 -0
  18. package/dist/cssm/tslib.es6-ce870b46.js +42 -0
  19. package/dist/{Component-52c236b9.d.ts → cssm/typings-a22d6eaf.d.ts} +180 -187
  20. package/dist/cssm/utils/index.d.ts +4 -0
  21. package/dist/cssm/utils/index.js +17 -0
  22. package/dist/esm/Component.d.ts +28 -6
  23. package/dist/esm/Component.js +14 -8
  24. package/dist/esm/field/Component.d.ts +10 -0
  25. package/dist/esm/field/Component.js +24 -6
  26. package/dist/esm/field/index.css +3 -3
  27. package/dist/esm/field/index.d.ts +1 -1
  28. package/dist/esm/field/index.js +7 -3
  29. package/dist/esm/index.css +9 -5
  30. package/dist/esm/index.js +8 -3
  31. package/dist/esm/option/Component.d.ts +11 -0
  32. package/dist/esm/option/Component.js +18 -0
  33. package/dist/esm/option/index.css +25 -0
  34. package/dist/esm/option/index.d.ts +1 -0
  35. package/dist/esm/option/index.js +4 -0
  36. package/dist/esm/tslib.es6-bb0d3a15.d.ts +32 -0
  37. package/dist/esm/tslib.es6-bb0d3a15.js +40 -0
  38. package/dist/esm/{Component-d3b8be4d.d.ts → typings-a22d6eaf.d.ts} +180 -187
  39. package/dist/esm/utils/index.d.ts +4 -0
  40. package/dist/esm/utils/index.js +13 -0
  41. package/dist/field/Component.d.ts +10 -0
  42. package/dist/field/Component.js +26 -7
  43. package/dist/field/index.css +3 -3
  44. package/dist/field/index.d.ts +1 -1
  45. package/dist/field/index.js +7 -3
  46. package/dist/index.css +9 -5
  47. package/dist/index.js +8 -3
  48. package/dist/modern/Component.d.ts +28 -6
  49. package/dist/modern/Component.js +12 -7
  50. package/dist/modern/field/Component.d.ts +5 -707
  51. package/dist/modern/field/Component.js +10 -7
  52. package/dist/modern/field/index.css +3 -3
  53. package/dist/modern/field/index.js +5 -2
  54. package/dist/modern/index.css +9 -5
  55. package/dist/modern/index.js +6 -2
  56. package/dist/modern/option/Component.d.ts +11 -0
  57. package/dist/modern/option/Component.js +16 -0
  58. package/dist/modern/option/index.css +25 -0
  59. package/dist/modern/option/index.d.ts +1 -0
  60. package/dist/modern/option/index.js +3 -0
  61. package/dist/{cssm/Component-aeb02c1b.d.ts → modern/typings-a22d6eaf.d.ts} +180 -187
  62. package/dist/modern/utils/index.d.ts +4 -0
  63. package/dist/modern/utils/index.js +13 -0
  64. package/dist/option/Component.d.ts +11 -0
  65. package/dist/option/Component.js +26 -0
  66. package/dist/option/index.css +25 -0
  67. package/dist/option/index.d.ts +1 -0
  68. package/dist/option/index.js +12 -0
  69. package/dist/tslib.es6-b5c82847.d.ts +32 -0
  70. package/dist/tslib.es6-b5c82847.js +42 -0
  71. package/dist/typings-a22d6eaf.d.ts +867 -0
  72. package/dist/utils/index.d.ts +4 -0
  73. package/dist/utils/index.js +17 -0
  74. package/package.json +4 -4
  75. package/dist/Component-52c236b9.js +0 -67
  76. package/dist/cssm/Component-aeb02c1b.js +0 -66
  77. package/dist/esm/Component-d3b8be4d.js +0 -59
@@ -1,22 +1,25 @@
1
1
  import React from 'react';
2
2
  import cn from 'classnames';
3
3
  import { Button } from '@alfalab/core-components-button/dist/modern';
4
- import { ArrowDownMIcon } from '@alfalab/icons-classic/ArrowDownMIcon';
5
- import { ArrowDownSIcon } from '@alfalab/icons-classic/ArrowDownSIcon';
4
+ import '@alfalab/icons-glyph/ChevronDownMIcon';
5
+ import '@alfalab/icons-glyph/ChevronDownCompactSIcon';
6
+ import '@alfalab/icons-glyph/MoreMIcon';
7
+ import '@alfalab/icons-glyph/MoreSIcon';
8
+ import { getIcon } from '../utils/index.js';
6
9
 
7
- var styles = {"iconContainer":"picker-button__iconContainer_gcut4","open":"picker-button__open_gcut4"};
10
+ var styles = {"iconContainer":"picker-button__iconContainer_18u4x","open":"picker-button__open_18u4x"};
8
11
  require('./index.css')
9
12
 
10
- const Field = ({ buttonSize = 'm', view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, valueRenderer, ...restProps }) => {
11
- const Icon = buttonSize === 'xs' ? ArrowDownSIcon : ArrowDownMIcon;
13
+ const Field = ({ buttonSize = 'm', buttonVariant = 'default', view, label, open, multiple, rightAddons, Arrow, innerProps, className, selected, selectedMultiple, valueRenderer, ...restProps }) => {
14
+ const Icon = getIcon(buttonVariant, buttonSize);
12
15
  const { ref, ...restInnerProps } = innerProps;
13
16
  const buttonProps = {
14
17
  ...restProps,
15
18
  ...restInnerProps,
16
19
  };
17
20
  return (React.createElement("div", { ref: ref },
18
- React.createElement(Button, Object.assign({}, buttonProps, { rightAddons: rightAddons ?? (React.createElement("span", { className: cn(styles.iconContainer, open && styles.open) },
19
- React.createElement(Icon, { "data-test-id": 'picker-button-icon' }))), block: true, view: view, size: buttonSize, className: cn(styles.component, view === 'primary' && styles.primary, className) }), label)));
21
+ React.createElement(Button, Object.assign({}, buttonProps, { rightAddons: rightAddons ?? (React.createElement("span", { className: cn(styles.iconContainer, buttonVariant !== 'compact' && open && styles.open) },
22
+ React.createElement(Icon, { "data-test-id": 'picker-button-icon' }))), block: true, view: view, size: buttonSize, className: cn(styles.component, view === 'primary' && styles.primary, className) }), buttonVariant !== 'compact' && label)));
20
23
  };
21
24
 
22
25
  export { Field };
@@ -1,4 +1,4 @@
1
- /* hash: 730bk */
1
+ /* hash: 4hptb */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -10,10 +10,10 @@
10
10
  :root {
11
11
  --arrow-transform: rotate(180deg);
12
12
  }
13
- .picker-button__iconContainer_gcut4 {
13
+ .picker-button__iconContainer_18u4x {
14
14
  display: flex;
15
15
  transition: transform 0.15s ease-in-out;
16
16
  }
17
- .picker-button__open_gcut4 {
17
+ .picker-button__open_18u4x {
18
18
  transform: var(--arrow-transform);
19
19
  }
@@ -1,6 +1,9 @@
1
1
  import 'react';
2
2
  import 'classnames';
3
3
  import '@alfalab/core-components-button/dist/modern';
4
- import '@alfalab/icons-classic/ArrowDownMIcon';
5
- import '@alfalab/icons-classic/ArrowDownSIcon';
4
+ import '@alfalab/icons-glyph/ChevronDownMIcon';
5
+ import '@alfalab/icons-glyph/ChevronDownCompactSIcon';
6
+ import '@alfalab/icons-glyph/MoreMIcon';
7
+ import '@alfalab/icons-glyph/MoreSIcon';
8
+ import '../utils/index.js';
6
9
  export { Field } from './Component.js';
@@ -1,4 +1,4 @@
1
- /* hash: 11tf9 */
1
+ /* hash: z84rf */
2
2
  :root {
3
3
 
4
4
  /* Hard */
@@ -9,19 +9,23 @@
9
9
  }
10
10
  :root {
11
11
  --gap-xs: 8px;
12
+ --gap-m: 16px;
12
13
  }
13
14
  :root {
14
15
  --border-radius-s: 4px;
15
16
  }
16
- .picker-button__container_1b5wz {
17
+ .picker-button__container_1mcgq {
17
18
  min-width: auto;
18
19
  }
19
- .picker-button__optionsPopover_1b5wz {
20
+ .picker-button__optionsPopover_1mcgq {
20
21
  padding: var(--gap-xs) 0
21
22
  }
22
- .picker-button__optionsPopover_1b5wz.picker-button__sideGap_1b5wz {
23
+ .picker-button__optionsPopover_1mcgq.picker-button__sideGap_1mcgq {
23
24
  padding: 0 var(--gap-xs);
24
25
  }
25
- .picker-button__optionsListContainer_1b5wz {
26
+ .picker-button__optionsListContainer_1mcgq {
26
27
  border-radius: var(--border-radius-s);
27
28
  }
29
+ .picker-button__option_1mcgq {
30
+ padding: 0 var(--gap-m);
31
+ }
@@ -2,7 +2,11 @@ import 'react';
2
2
  import 'classnames';
3
3
  import '@alfalab/core-components-select/dist/modern';
4
4
  import '@alfalab/core-components-button/dist/modern';
5
- import '@alfalab/icons-classic/ArrowDownMIcon';
6
- import '@alfalab/icons-classic/ArrowDownSIcon';
5
+ import '@alfalab/icons-glyph/ChevronDownMIcon';
6
+ import '@alfalab/icons-glyph/ChevronDownCompactSIcon';
7
+ import '@alfalab/icons-glyph/MoreMIcon';
8
+ import '@alfalab/icons-glyph/MoreSIcon';
9
+ import './utils/index.js';
7
10
  import './field/Component.js';
11
+ import './option/Component.js';
8
12
  export { PickerButton } from './Component.js';
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { FC, SVGProps } from 'react';
3
+ import { OptionShape } from "../typings-a22d6eaf";
4
+ import { OptionProps as BaseOptionProps } from "../typings-a22d6eaf";
5
+ type OptionProps = Omit<BaseOptionProps, 'option'> & {
6
+ option: OptionShape & {
7
+ icon?: FC<SVGProps<SVGSVGElement>>;
8
+ };
9
+ };
10
+ declare const Option: ({ option, children, ...restProps }: OptionProps) => JSX.Element;
11
+ export { Option };
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { Option as Option$1 } from '@alfalab/core-components-select/dist/modern';
3
+
4
+ var styles = {"container":"picker-button__container_ez0vh","icon":"picker-button__icon_ez0vh","content":"picker-button__content_ez0vh"};
5
+ require('./index.css')
6
+
7
+ const Option = ({ option, children, ...restProps }) => {
8
+ const content = children || option.content || option.key;
9
+ const Icon = option.icon;
10
+ return (React.createElement(Option$1, Object.assign({ option: option }, restProps),
11
+ React.createElement("div", { className: styles.container },
12
+ Icon && React.createElement(Icon, { className: styles.icon }),
13
+ React.createElement("div", { className: styles.content }, content))));
14
+ };
15
+
16
+ export { Option };
@@ -0,0 +1,25 @@
1
+ /* hash: wiwip */
2
+ :root {
3
+
4
+ /* Hard */
5
+
6
+ /* Up */
7
+
8
+ /* Hard up */
9
+ }
10
+ :root {
11
+ --gap-s: 12px;
12
+ }
13
+ .picker-button__container_ez0vh {
14
+ display: flex;
15
+ align-items: center;
16
+ }
17
+ .picker-button__icon_ez0vh {
18
+ display: flex;
19
+ margin-right: var(--gap-s);
20
+ }
21
+ .picker-button__content_ez0vh {
22
+ overflow: hidden;
23
+ flex: 1;
24
+ text-overflow: ellipsis;
25
+ }
@@ -0,0 +1 @@
1
+ export * from "./Component";
@@ -0,0 +1,3 @@
1
+ import 'react';
2
+ import '@alfalab/core-components-select/dist/modern';
3
+ export { Option } from './Component.js';