@itcase/ui 1.0.99 → 1.0.101

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 (66) hide show
  1. package/dist/components/Button.js +3 -3
  2. package/dist/components/DatePicker.js +46 -28
  3. package/dist/components/FormField.js +1 -1
  4. package/dist/components/Response.js +246 -0
  5. package/dist/components/Select.js +62 -65
  6. package/dist/css/components/Avatar/Avatar.css +1 -1
  7. package/dist/css/components/Badge/Badge.css +1 -1
  8. package/dist/css/components/Checkbox/Checkbox.css +2 -1
  9. package/dist/css/components/DatePicker/DatePicker.css +1 -1
  10. package/dist/css/components/Menu/Menu.css +3 -2
  11. package/dist/css/components/MenuItem/MenuItem.css +26 -0
  12. package/dist/css/components/Pagination/Pagination.css +5 -3
  13. package/dist/css/components/Pagination/css/__item/pagination__item.css +4 -3
  14. package/dist/css/components/Pagination/css/__item/pagination__item_state_disabled.css +1 -0
  15. package/dist/css/components/Response/Response.css +21 -0
  16. package/dist/css/components/Tile/Tile.css +7 -0
  17. package/dist/css/components/Tooltip/Tooltip.css +9 -9
  18. package/dist/{floating-ui.dom-D_Zct5p2.js → floating-ui.dom-C34fOuI9.js} +20 -39
  19. package/dist/stories/Accordion.stories.js +88 -0
  20. package/dist/stories/AccordionItem.stories.js +150 -0
  21. package/dist/stories/Badge.stories.js +116 -0
  22. package/dist/stories/Button.stories.js +287 -0
  23. package/dist/stories/Checkbox.stories.js +116 -0
  24. package/dist/stories/Chips.stories.js +151 -0
  25. package/dist/stories/Choice.stories.js +117 -0
  26. package/dist/stories/Code.stories.js +99 -0
  27. package/dist/stories/DatePicker.stories.js +178 -0
  28. package/dist/stories/Divider.stories.js +132 -0
  29. package/dist/stories/Dot.stories.js +86 -0
  30. package/dist/stories/Dropdown.stories.js +74 -0
  31. package/dist/stories/DropdownItem.stories.js +152 -0
  32. package/dist/stories/Empty.stories.js +115 -0
  33. package/dist/stories/FormFieldCheckbox.stories.js +77 -0
  34. package/dist/stories/FormFieldChoice.stories.js +75 -0
  35. package/dist/stories/FormFieldDatepicker.stories.js +51 -0
  36. package/dist/stories/FormFieldFileInput.stories.js +58 -0
  37. package/dist/stories/FormFieldInput.stories.js +66 -0
  38. package/dist/stories/FormFieldInputPassword.stories.js +66 -0
  39. package/dist/stories/FormFieldMultiBadgeSelect.stories.js +132 -0
  40. package/dist/stories/FormFieldMultiSelect.stories.js +127 -0
  41. package/dist/stories/FormFieldSelect.stories.js +99 -0
  42. package/dist/stories/FormFieldSelectGroup.stories.js +84 -0
  43. package/dist/stories/Icon.stories.js +208 -0
  44. package/dist/stories/Input.stories.js +124 -0
  45. package/dist/stories/InputPassword.stories.js +114 -0
  46. package/dist/stories/Label.stories.js +163 -0
  47. package/dist/stories/Loader.stories.js +121 -0
  48. package/dist/stories/Logo.stories.js +99 -0
  49. package/dist/stories/MenuItem.stories.js +193 -0
  50. package/dist/stories/ModalConfirm.stories.js +61 -0
  51. package/dist/stories/ModalDefault.stories.js +34 -0
  52. package/dist/stories/NotFound.stories.js +94 -0
  53. package/dist/stories/Notification.stories.js +128 -0
  54. package/dist/stories/Pagination.stories.js +66 -0
  55. package/dist/stories/RadioButton.stories.js +101 -0
  56. package/dist/stories/Search-input.stories.js +182 -0
  57. package/dist/stories/Segmented.stories.js +110 -0
  58. package/dist/stories/Select.stories.js +280 -0
  59. package/dist/stories/Switch.stories.js +84 -0
  60. package/dist/stories/Tab.appearance.stories.js +260 -0
  61. package/dist/stories/Tab.group.stories.js +149 -0
  62. package/dist/stories/Tab.size.stories.js +259 -0
  63. package/dist/stories/Tab.state.stories.js +227 -0
  64. package/dist/stories/Textarea.stories.js +90 -0
  65. package/dist/stories/Tile.stories.js +235 -0
  66. package/package.json +1 -1
@@ -13,11 +13,12 @@
13
13
  }
14
14
  }
15
15
  .pagination {
16
+ margin: var(--paginator-margin, initial);
16
17
  &__item {
17
- width: 40px;
18
- height: 40px;
18
+ width: var(--paginator-item-width, 40px);
19
+ height: var(--paginator-item-height, 40px);
19
20
  background: var(--paginator-item-default-fill);
20
- border: solid 1px var(--paginator-item-default-border);
21
+ border: var(--paginator-item-border, solid 1px var(--paginator-item-default-border));
21
22
  border-radius: var(--paginator-item-border-radius, 6px);
22
23
  display: flex;
23
24
  transition: var(--paginator-item-transition);
@@ -74,6 +75,7 @@
74
75
  & svg {
75
76
  fill: var(--paginator-item-disabled-icon);
76
77
  }
78
+ display: var(--pagination-item-state-disabled-display, initial);
77
79
  }
78
80
  }
79
81
  }
@@ -1,9 +1,10 @@
1
1
  .pagination {
2
+ margin: var(--paginator-margin, initial);
2
3
  &__item {
3
- width: 40px;
4
- height: 40px;
4
+ width: var(--paginator-item-width, 40px);
5
+ height: var(--paginator-item-height, 40px);
5
6
  background: var(--paginator-item-default-fill);
6
- border: solid 1px var(--paginator-item-default-border);
7
+ border: var(--paginator-item-border, solid 1px var(--paginator-item-default-border));
7
8
  border-radius: var(--paginator-item-border-radius, 6px);
8
9
  display: flex;
9
10
  transition: var(--paginator-item-transition);
@@ -13,6 +13,7 @@
13
13
  & svg {
14
14
  fill: var(--paginator-item-disabled-icon);
15
15
  }
16
+ display: var(--pagination-item-state-disabled-display, initial);
16
17
  }
17
18
  }
18
19
  }
@@ -0,0 +1,21 @@
1
+ .response {
2
+ display: flex;
3
+ flex-flow: column nowrap;
4
+ justify-content: center;
5
+ align-items: center;
6
+ gap: 32px;
7
+ &__desc {
8
+ display: flex;
9
+ flex-direction: column;
10
+ justify-content: center;
11
+ align-items: center;
12
+ gap: 16px;
13
+ }
14
+ &__button {
15
+ display: flex;
16
+ flex-direction: column;
17
+ justify-content: center;
18
+ align-items: center;
19
+ gap: 16px;
20
+ }
21
+ }
@@ -1,6 +1,13 @@
1
1
  .tile {
2
2
  &__wrapper {
3
3
  position: relative;
4
+ flex: var(--tile-wrapper-flex, auto);
5
+ & .group {
6
+ flex: var(--tile-wrapper-group-flex, auto);
7
+ }
8
+ }
9
+ &__title {
10
+ margin-right: var(--tile-title-margin-right, initial);
4
11
  }
5
12
  }
6
13
  .tile {
@@ -54,20 +54,20 @@
54
54
 
55
55
  .tooltip {
56
56
  &_type_arrow {
57
- ^&__inner {
58
- position: relative;
59
- background-color: inherit;
60
- z-index: 1;
61
- }
62
57
  &::after {
63
- content: '';
64
- display: block;
65
- position: absolute;
66
- background-color: var(--tooltip-arrow-color, #fff);
67
58
  width: var(--tooltip-arrow-width);
68
59
  height: var(--tooltip-arrow-height);
69
60
  border-radius: var(--tooltip-arrow-radius);
61
+ position: absolute;
62
+ content: '';
63
+ display: block;
70
64
  z-index: 0;
65
+ background-color: var(--tooltip-arrow-color, #fff);
66
+ }
67
+ ^&__inner {
68
+ position: relative;
69
+ background-color: inherit;
70
+ z-index: 1;
71
71
  }
72
72
  }
73
73
  }
@@ -844,8 +844,9 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
844
844
  if (domElement) {
845
845
  const win = getWindow(domElement);
846
846
  const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
847
- let currentIFrame = win.frameElement;
848
- while (currentIFrame && offsetParent && offsetWin !== win) {
847
+ let currentWin = win;
848
+ let currentIFrame = currentWin.frameElement;
849
+ while (currentIFrame && offsetParent && offsetWin !== currentWin) {
849
850
  const iframeScale = getScale(currentIFrame);
850
851
  const iframeRect = currentIFrame.getBoundingClientRect();
851
852
  const css = getComputedStyle(currentIFrame);
@@ -857,7 +858,8 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
857
858
  height *= iframeScale.y;
858
859
  x += left;
859
860
  y += top;
860
- currentIFrame = getWindow(currentIFrame).frameElement;
861
+ currentWin = getWindow(currentIFrame);
862
+ currentIFrame = currentWin.frameElement;
861
863
  }
862
864
  }
863
865
  return rectToClientRect({
@@ -869,27 +871,14 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
869
871
  }
870
872
 
871
873
  const topLayerSelectors = [':popover-open', ':modal'];
872
- function topLayer(floating) {
873
- let isTopLayer = false;
874
- let x = 0;
875
- let y = 0;
876
- function setIsTopLayer(selector) {
874
+ function isTopLayer(floating) {
875
+ return topLayerSelectors.some(selector => {
877
876
  try {
878
- isTopLayer = isTopLayer || floating.matches(selector);
879
- } catch (e) {}
880
- }
881
- topLayerSelectors.forEach(selector => {
882
- setIsTopLayer(selector);
883
- });
884
- if (isTopLayer) {
885
- const containingBlock = getContainingBlock(floating);
886
- if (containingBlock) {
887
- const rect = containingBlock.getBoundingClientRect();
888
- x = rect.x;
889
- y = rect.y;
877
+ return floating.matches(selector);
878
+ } catch (e) {
879
+ return false;
890
880
  }
891
- }
892
- return [isTopLayer, x, y];
881
+ });
893
882
  }
894
883
 
895
884
  function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
@@ -899,9 +888,10 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
899
888
  offsetParent,
900
889
  strategy
901
890
  } = _ref;
891
+ const isFixed = strategy === 'fixed';
902
892
  const documentElement = getDocumentElement(offsetParent);
903
- const [isTopLayer] = elements ? topLayer(elements.floating) : [false];
904
- if (offsetParent === documentElement || isTopLayer) {
893
+ const topLayer = elements ? isTopLayer(elements.floating) : false;
894
+ if (offsetParent === documentElement || topLayer && isFixed) {
905
895
  return rect;
906
896
  }
907
897
  let scroll = {
@@ -911,7 +901,7 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
911
901
  let scale = createCoords(1);
912
902
  const offsets = createCoords(0);
913
903
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
914
- if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
904
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
915
905
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
916
906
  scroll = getNodeScroll(offsetParent);
917
907
  }
@@ -1102,7 +1092,7 @@ function getDimensions(element) {
1102
1092
  };
1103
1093
  }
1104
1094
 
1105
- function getRectRelativeToOffsetParent(element, offsetParent, strategy, floating) {
1095
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
1106
1096
  const isOffsetParentAnElement = isHTMLElement(offsetParent);
1107
1097
  const documentElement = getDocumentElement(offsetParent);
1108
1098
  const isFixed = strategy === 'fixed';
@@ -1124,17 +1114,8 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy, floating
1124
1114
  offsets.x = getWindowScrollBarX(documentElement);
1125
1115
  }
1126
1116
  }
1127
- let x = rect.left + scroll.scrollLeft - offsets.x;
1128
- let y = rect.top + scroll.scrollTop - offsets.y;
1129
- const [isTopLayer, topLayerX, topLayerY] = topLayer(floating);
1130
- if (isTopLayer) {
1131
- x += topLayerX;
1132
- y += topLayerY;
1133
- if (isOffsetParentAnElement) {
1134
- x += offsetParent.clientLeft;
1135
- y += offsetParent.clientTop;
1136
- }
1137
- }
1117
+ const x = rect.left + scroll.scrollLeft - offsets.x;
1118
+ const y = rect.top + scroll.scrollTop - offsets.y;
1138
1119
  return {
1139
1120
  x,
1140
1121
  y,
@@ -1157,7 +1138,7 @@ function getTrueOffsetParent(element, polyfill) {
1157
1138
  // such as table ancestors and cross browser bugs.
1158
1139
  function getOffsetParent(element, polyfill) {
1159
1140
  const window = getWindow(element);
1160
- if (!isHTMLElement(element)) {
1141
+ if (!isHTMLElement(element) || isTopLayer(element)) {
1161
1142
  return window;
1162
1143
  }
1163
1144
  let offsetParent = getTrueOffsetParent(element, polyfill);
@@ -1174,7 +1155,7 @@ const getElementRects = async function (data) {
1174
1155
  const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
1175
1156
  const getDimensionsFn = this.getDimensions;
1176
1157
  return {
1177
- reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy, data.floating),
1158
+ reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),
1178
1159
  floating: {
1179
1160
  x: 0,
1180
1161
  y: 0,
@@ -0,0 +1,88 @@
1
+ import React from 'react'
2
+
3
+ import { Accordion, AccordionItem } from '@itcase/ui/components/Accordion'
4
+ import { borderColorProps, directionProps, fillProps, shapeProps } from '@itcase/ui/constants'
5
+
6
+ export default {
7
+ title: 'Atoms / Accordion / Default',
8
+ component: Accordion,
9
+ parameters: {
10
+ controls: {
11
+ exclude: [
12
+ 'directionDesktop',
13
+ 'directionMobile',
14
+ 'directionTablet',
15
+ 'fillDesktop',
16
+ 'fillMobile',
17
+ 'fillTablet',
18
+ 'initial',
19
+ 'onClickItem',
20
+ 'items',
21
+ ],
22
+ },
23
+ },
24
+ argTypes: {
25
+ advancedProps: { control: 'boolean' },
26
+ className: {
27
+ if: { arg: 'advancedProps' },
28
+ },
29
+ borderColor: {
30
+ options: borderColorProps,
31
+ control: 'select',
32
+ },
33
+ fill: {
34
+ options: fillProps,
35
+ control: 'select',
36
+ },
37
+ direction: {
38
+ options: directionProps,
39
+ control: 'inline-radio',
40
+ },
41
+ shape: {
42
+ options: shapeProps,
43
+ control: 'inline-radio',
44
+ },
45
+ },
46
+ }
47
+
48
+ export const Default = {
49
+ args: {
50
+ borderColor: 'accentBorderPrimary',
51
+ fill: 'surfaceSecondary',
52
+ shape: 'rounded',
53
+ children: (
54
+ <React.Fragment>
55
+ <AccordionItem
56
+ content="content 1"
57
+ contentFill="primaryPrimary"
58
+ contentTextColor="surfaceTextPrimary"
59
+ contentTextSize="m"
60
+ fillHover="accentTertiary"
61
+ isExpanded={true}
62
+ size="xs"
63
+ title="Title 1"
64
+ titleFill="secondaryPrimary"
65
+ titleFillHover="secondaryPrimaryHover"
66
+ titleTextColor="surfaceTextPrimary"
67
+ titleTextSize="m"
68
+ />
69
+ <AccordionItem
70
+ content="content 2"
71
+ fillHover="accentTertiary"
72
+ size="xs"
73
+ title="Title 2"
74
+ titleTextColor="surfaceTextPrimary"
75
+ titleTextSize="m"
76
+ />
77
+ <AccordionItem
78
+ content="content 3"
79
+ fillHover="accentTertiary"
80
+ size="xs"
81
+ title="Title 3"
82
+ titleTextColor="surfaceTextPrimary"
83
+ titleTextSize="m"
84
+ />
85
+ </React.Fragment>
86
+ ),
87
+ },
88
+ }
@@ -0,0 +1,150 @@
1
+ import { AccordionItem } from '@itcase/ui/components/Accordion'
2
+
3
+ import {
4
+ borderColorProps,
5
+ fillProps,
6
+ fillHoverProps,
7
+ shapeProps,
8
+ sizeProps,
9
+ textSizeProps,
10
+ textColorProps,
11
+ textWeightProps,
12
+ } from '@itcase/ui/constants'
13
+
14
+ export default {
15
+ title: 'Atoms / Accordion / Item',
16
+ component: AccordionItem,
17
+ parameters: {
18
+ controls: {
19
+ exclude: [
20
+ 'shapeDesktop',
21
+ 'shapeMobile',
22
+ 'shapeTablet',
23
+ 'fillDesktop',
24
+ 'fillMobile',
25
+ 'fillTablet',
26
+ 'iconFillDesktop',
27
+ 'iconFillMobile',
28
+ 'iconFillTablet',
29
+ ],
30
+ },
31
+ },
32
+ argTypes: {
33
+ advancedProps: { control: 'boolean' },
34
+ afterContent: {
35
+ if: { arg: 'advancedProps' },
36
+ },
37
+ beforeContent: {
38
+ if: { arg: 'advancedProps' },
39
+ },
40
+ children: {
41
+ if: { arg: 'advancedProps' },
42
+ },
43
+ className: {
44
+ if: { arg: 'advancedProps' },
45
+ },
46
+ id: {
47
+ if: { arg: 'advancedProps' },
48
+ },
49
+ isExpanded: {
50
+ control: 'boolean',
51
+ },
52
+ onClick: {
53
+ if: { arg: 'advancedProps' },
54
+ },
55
+ iconFill: {
56
+ options: fillProps,
57
+ control: 'select',
58
+ },
59
+ borderColor: {
60
+ options: borderColorProps,
61
+ control: 'select',
62
+ },
63
+ contentBorderColor: {
64
+ options: borderColorProps,
65
+ control: 'select',
66
+ },
67
+ titleBorderColor: {
68
+ options: borderColorProps,
69
+ control: 'select',
70
+ },
71
+
72
+ fill: {
73
+ options: fillProps,
74
+ control: 'select',
75
+ },
76
+ fillHover: {
77
+ options: fillHoverProps,
78
+ control: 'select',
79
+ },
80
+ contentFill: {
81
+ options: fillProps,
82
+ control: 'select',
83
+ },
84
+ titleFill: {
85
+ options: fillProps,
86
+ control: 'select',
87
+ },
88
+ titleFillHover: {
89
+ options: fillHoverProps,
90
+ control: 'select',
91
+ },
92
+ shape: {
93
+ options: shapeProps,
94
+ control: 'inline-radio',
95
+ },
96
+ contentTextColor: {
97
+ options: textColorProps,
98
+ control: 'select',
99
+ },
100
+ contentTextSize: {
101
+ options: textSizeProps,
102
+ control: 'inline-radio',
103
+ },
104
+ contentTextWeight: {
105
+ options: textWeightProps,
106
+ control: 'select',
107
+ },
108
+ size: {
109
+ options: ['xs', 'l'],
110
+ control: 'inline-radio',
111
+ },
112
+ titleTextColor: {
113
+ options: textColorProps,
114
+ control: 'select',
115
+ },
116
+ titleTextSize: {
117
+ options: textSizeProps,
118
+ control: 'inline-radio',
119
+ },
120
+ titleTextWeight: {
121
+ options: textWeightProps,
122
+ control: 'select',
123
+ },
124
+ },
125
+ }
126
+
127
+ export const Default = {
128
+ args: {
129
+ content: 'content 1',
130
+ title: 'Title 1',
131
+ contentTextColor: 'surfaceTextPrimary',
132
+ contentTextSize: 'm',
133
+ titleTextColor: 'surfaceTextPrimary',
134
+ titleTextSize: 'm',
135
+ },
136
+ }
137
+
138
+ export const Closed = {
139
+ args: {
140
+ ...Default.args,
141
+ isExpanded: false,
142
+ },
143
+ }
144
+
145
+ export const Opened = {
146
+ args: {
147
+ ...Default.args,
148
+ isExpanded: true,
149
+ },
150
+ }
@@ -0,0 +1,116 @@
1
+ import { Badge, badgeConfig } from '@itcase/ui/components/Badge'
2
+ import {
3
+ borderColorHoverProps,
4
+ borderColorProps,
5
+ borderTypeProps,
6
+ borderWidthProps,
7
+ fillProps,
8
+ shapeProps,
9
+ sizeProps,
10
+ textColorProps,
11
+ } from '@itcase/ui/constants'
12
+
13
+ import badgeAppearance from 'src/components/Badge/appearance.json'
14
+
15
+ badgeConfig.setAppearance(badgeAppearance)
16
+
17
+ export default {
18
+ title: 'Atoms / Badge',
19
+ component: Badge,
20
+ argTypes: {
21
+ appearance: {
22
+ options: [null, 'accent', 'secondary', 'primary'],
23
+ control: 'inline-radio',
24
+ },
25
+ shape: {
26
+ options: shapeProps,
27
+ control: 'inline-radio',
28
+ },
29
+ size: {
30
+ options: sizeProps,
31
+ control: 'inline-radio',
32
+ },
33
+ textSize: {
34
+ options: sizeProps,
35
+ control: 'inline-radio',
36
+ },
37
+ fill: {
38
+ options: fillProps,
39
+ control: 'select',
40
+ },
41
+ textColor: {
42
+ options: textColorProps,
43
+ control: 'select',
44
+ },
45
+ borderColor: {
46
+ options: borderColorProps,
47
+ control: 'select',
48
+ },
49
+ borderType: {
50
+ options: borderTypeProps,
51
+ control: 'inline-radio',
52
+ },
53
+ borderColorHover: {
54
+ options: borderColorHoverProps,
55
+ control: 'select',
56
+ },
57
+ borderWidth: {
58
+ options: borderWidthProps,
59
+ control: 'select',
60
+ },
61
+ advancedProps: { control: 'boolean' },
62
+ after: {
63
+ if: { arg: 'advancedProps' },
64
+ },
65
+ children: {
66
+ if: { arg: 'advancedProps' },
67
+ },
68
+ className: {
69
+ if: { arg: 'advancedProps' },
70
+ },
71
+ type: {
72
+ if: { arg: 'advancedProps' },
73
+ },
74
+ mode: {
75
+ options: [null, 'skeleton'],
76
+ control: 'inline-radio',
77
+ },
78
+ },
79
+ }
80
+
81
+ export const Default = {
82
+ args: {
83
+ shape: 'circular',
84
+ size: 's',
85
+ textSize: 'xs',
86
+ value: 3,
87
+ },
88
+ }
89
+
90
+ export const Accent = {
91
+ args: {
92
+ ...Default.args,
93
+ appearance: 'accent',
94
+ },
95
+ }
96
+
97
+ export const Secondary = {
98
+ args: {
99
+ ...Default.args,
100
+ appearance: 'secondary',
101
+ },
102
+ }
103
+
104
+ export const Primary = {
105
+ args: {
106
+ ...Default.args,
107
+ appearance: 'primary',
108
+ },
109
+ }
110
+
111
+ export const SkeletonMode = {
112
+ args: {
113
+ ...Default.args,
114
+ mode: 'skeleton',
115
+ },
116
+ }