@itcase/ui 1.2.18 → 1.2.19

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 (39) hide show
  1. package/dist/{Group-BDuYmoBK.js → Group-B2oTJg0t.js} +1 -1
  2. package/dist/{Group-12uup5mu.js → Group-CVUfaHaS.js} +1 -1
  3. package/dist/cjs/components/Choice.js +11 -3
  4. package/dist/cjs/components/CookiesWarning.js +1 -1
  5. package/dist/cjs/components/FormField.js +1 -1
  6. package/dist/cjs/components/Group.js +1 -1
  7. package/dist/cjs/components/Panel.js +1 -1
  8. package/dist/cjs/components/Response.js +1 -1
  9. package/dist/cjs/components/Select.js +1 -1
  10. package/dist/cjs/hooks/useViewportFix.js +43 -0
  11. package/dist/components/Choice.js +11 -3
  12. package/dist/components/CookiesWarning.js +1 -1
  13. package/dist/components/FormField.js +1 -1
  14. package/dist/components/Group.js +1 -1
  15. package/dist/components/Panel.js +1 -1
  16. package/dist/components/Response.js +1 -1
  17. package/dist/components/Select.js +1 -1
  18. package/dist/css/components/Choice/Choice.css +14 -0
  19. package/dist/css/components/Icon/Icon.css +10 -6
  20. package/dist/css/components/Select/Select.css +1 -1
  21. package/dist/css/components/Select/css/__input-container/select__input-container.css +1 -1
  22. package/dist/css/mixins/mixin.css +5 -0
  23. package/dist/css/mixins/mixin_animation.css +1 -1
  24. package/dist/css/mixins/mixin_typography.css +4 -3
  25. package/dist/css/styles/width/width.css +1 -1
  26. package/dist/hooks/useViewportFix.js +41 -0
  27. package/dist/stories/Appearance.mdx +20 -0
  28. package/dist/stories/Appearance.stories.js +47 -0
  29. package/dist/stories/Configure.mdx +364 -0
  30. package/dist/stories/Header.stories.js +29 -0
  31. package/dist/stories/Overview.mdx +12 -0
  32. package/dist/stories/Page.stories.js +28 -0
  33. package/dist/stories/Playground.mdx +11 -0
  34. package/dist/stories/Tile.stories.js +5 -5
  35. package/dist/types/components/Choice/Choice.interface.d.ts +3 -1
  36. package/dist/types/hooks/useViewportFix.d.ts +2 -0
  37. package/dist/types/types/componentProps/flexWrap.d.ts +1 -1
  38. package/dist/types/types/componentProps/wrap.d.ts +1 -1
  39. package/package.json +27 -5
@@ -122,7 +122,7 @@ var Group = React.forwardRef(function Group(props, ref) {
122
122
  ((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderWidth) &&
123
123
  "border-width_".concat(appearanceConfig.borderWidth)
124
124
  .replace(/([A-Z])/g, '-$1')
125
- .toLowerCase()), borderTypeClass, elevationClass, justifyContentClass), ref: ref, name: name, "data-tour": dataTour, htmlFor: htmlFor, id: id, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsxRuntime.jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
125
+ .toLowerCase()), borderTypeClass, elevationClass, justifyContentClass, onClick && 'cursor_type_pointer'), ref: ref, name: name, "data-tour": dataTour, htmlFor: htmlFor, id: id, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsxRuntime.jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
126
126
  });
127
127
 
128
128
  exports.Group = Group;
@@ -120,7 +120,7 @@ var Group = React.forwardRef(function Group(props, ref) {
120
120
  ((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderWidth) &&
121
121
  "border-width_".concat(appearanceConfig.borderWidth)
122
122
  .replace(/([A-Z])/g, '-$1')
123
- .toLowerCase()), borderTypeClass, elevationClass, justifyContentClass), ref: ref, name: name, "data-tour": dataTour, htmlFor: htmlFor, id: id, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
123
+ .toLowerCase()), borderTypeClass, elevationClass, justifyContentClass, onClick && 'cursor_type_pointer'), ref: ref, name: name, "data-tour": dataTour, htmlFor: htmlFor, id: id, style: Object.assign({}, groupStyles, style), onClick: onClick, children: horizontalScroll ? (jsx("div", { className: "group__wrapper", style: groupWrapperStyles, children: children })) : (children) }));
124
124
  });
125
125
 
126
126
  export { Group as G, groupConfig as g };
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var tslib_es6 = require('../../tslib.es6-CCZ3TN_7.js');
4
3
  var jsxRuntime = require('react/jsx-runtime');
5
4
  var React = require('react');
6
5
  var clsx = require('clsx');
@@ -20,6 +19,7 @@ require('lodash/maxBy');
20
19
  require('lodash/upperFirst');
21
20
  require('../hooks/styleAttributes.js');
22
21
  require('../../Link-CqWzwh8V.js');
22
+ require('../../tslib.es6-CCZ3TN_7.js');
23
23
  require('../../Tooltip-DkTKx9n-.js');
24
24
  require('../../Title-zwP6c2U2.js');
25
25
 
@@ -30,7 +30,7 @@ var choiceConfig = {
30
30
  },
31
31
  };
32
32
  var Choice = React.forwardRef(function Choice(props, ref) {
33
- var gap = props.gap, _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
33
+ props.flexWrap; props.gap; var _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
34
34
  var controlRef = React.useRef(null);
35
35
  var optionsRefs = React.useMemo(function () { return new Map(options.map(function (item) { return [item.value, React.createRef()]; })); }, [options]);
36
36
  var onChange = React.useCallback(function (event, item) {
@@ -73,6 +73,14 @@ var Choice = React.forwardRef(function Choice(props, ref) {
73
73
  prefix: 'fill_active_disabled_',
74
74
  propsKey: 'fillActiveDisabled',
75
75
  });
76
+ var wrapClass = useDeviceTargetClass.useDeviceTargetClass(props, {
77
+ prefix: 'choice_wrap_',
78
+ propsKey: 'wrap',
79
+ });
80
+ var gapClass = useDeviceTargetClass.useDeviceTargetClass(props, {
81
+ prefix: 'gap_',
82
+ propsKey: 'gap',
83
+ });
76
84
  // prettier-ignore
77
85
  var appearanceConfig = (appearance && choiceConfig.appearance && choiceConfig.appearance[appearance]);
78
86
  return (jsxRuntime.jsx("div", { className: clsx(className, 'choice', shapeClass ||
@@ -81,7 +89,7 @@ var Choice = React.forwardRef(function Choice(props, ref) {
81
89
  ((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderColor) &&
82
90
  "border-color_".concat(appearanceConfig.borderColor)
83
91
  .replace(/([A-Z])/g, '-$1')
84
- .toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), ref: controlRef, children: isLoading ? (jsxRuntime.jsx(Loader.Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsxRuntime.jsx("div", { className: "choice__wrapper", style: tslib_es6.__assign({}, (gap && { gap: gap })), children: options.map(function (item) {
92
+ .toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), ref: controlRef, children: isLoading ? (jsxRuntime.jsx(Loader.Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsxRuntime.jsx("div", { className: clsx(className, 'choice__wrapper', gapClass, wrapClass), children: options.map(function (item) {
85
93
  // prettier-ignore
86
94
  var isActive = typeof active === 'object'
87
95
  ? String(item.value) === String(active.value)
@@ -6,7 +6,7 @@ var clsx = require('clsx');
6
6
  var Cookies = require('js-cookie');
7
7
  var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
8
8
  var Button = require('../../Button-D1PnF1C-.js');
9
- var Group = require('../../Group-BDuYmoBK.js');
9
+ var Group = require('../../Group-B2oTJg0t.js');
10
10
  var Text = require('../../Text-_YhyTsQ1.js');
11
11
  require('lodash/castArray');
12
12
  require('lodash/camelCase');
@@ -13,7 +13,7 @@ require('react-select');
13
13
  var index = require('./Select.js');
14
14
  require('react');
15
15
  require('../../Badge-2JkquAEb.js');
16
- require('../../Group-BDuYmoBK.js');
16
+ require('../../Group-B2oTJg0t.js');
17
17
  var Switch = require('../../Switch-B5yVEqxz.js');
18
18
  require('react-inlinesvg');
19
19
  require('../../Link-CqWzwh8V.js');
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var Group = require('../../Group-BDuYmoBK.js');
3
+ var Group = require('../../Group-B2oTJg0t.js');
4
4
  require('react/jsx-runtime');
5
5
  require('react');
6
6
  require('clsx');
@@ -5,7 +5,7 @@ var React = require('react');
5
5
  var clsx = require('clsx');
6
6
  var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
7
7
  var useStyles = require('../hooks/useStyles.js');
8
- var Group = require('../../Group-BDuYmoBK.js');
8
+ var Group = require('../../Group-B2oTJg0t.js');
9
9
  var Text = require('../../Text-_YhyTsQ1.js');
10
10
  require('lodash/castArray');
11
11
  require('lodash/camelCase');
@@ -7,7 +7,7 @@ var SVG = require('react-inlinesvg');
7
7
  var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
8
8
  var useStyles = require('../hooks/useStyles.js');
9
9
  var Button = require('../../Button-D1PnF1C-.js');
10
- var Group = require('../../Group-BDuYmoBK.js');
10
+ var Group = require('../../Group-B2oTJg0t.js');
11
11
  var Text = require('../../Text-_YhyTsQ1.js');
12
12
  var Title = require('../../Title-zwP6c2U2.js');
13
13
  require('lodash/castArray');
@@ -10,7 +10,7 @@ var CreatableSelect = require('react-select/creatable');
10
10
  var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
11
11
  var Text = require('../../Text-_YhyTsQ1.js');
12
12
  var Badge = require('../../Badge-2JkquAEb.js');
13
- var Group = require('../../Group-BDuYmoBK.js');
13
+ var Group = require('../../Group-B2oTJg0t.js');
14
14
  var Divider = require('../../Divider-BjB5MD6u.js');
15
15
  require('react-inlinesvg');
16
16
  require('../hooks/useStyles.js');
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+
5
+ function useViewportFix() {
6
+ React.useEffect(function () {
7
+ // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
8
+ var setViewportProperty = function () {
9
+ // "vh" unit is equal to 1% of the height of the initial containing block
10
+ // https://www.w3.org/TR/css-values-3/#viewport-relative-lengths
11
+ var vh = window.innerHeight * 0.01;
12
+ /** NOTE:
13
+ * In JavaScript, you can always get the value of the current viewport
14
+ * by using the global variable window.innerHeight. This value takes
15
+ * the browser’s interface into account and is updated when its
16
+ * visibility changes. The trick is to store the viewport value
17
+ * in a CSS variable and apply that to the element instead of the vh unit.
18
+ * Let’s say our CSS custom variable is --vh for this example.
19
+ * That means we will want to apply it in our CSS like this:
20
+ * ```
21
+ * .my-element {
22
+ * height: 100vh; (Fallback for browsers that do not support Custom Properties)
23
+ * height: calc(var(--vh, 1vh) * 100);
24
+ * }
25
+ * ```
26
+ * We told JavaScript to grab the height of the viewport and then
27
+ * drilled it down into 1/100th of that total so we have a value
28
+ * to assign as our viewport height unit value.
29
+ * Then we politely asked JS to create the CSS variable "--vh" at the ":root":
30
+ */
31
+ document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
32
+ };
33
+ // Update the value of "--vh" after render
34
+ setViewportProperty();
35
+ // Update the value of "--vh" by listening to the window resize event
36
+ window.addEventListener('resize', setViewportProperty);
37
+ return function () {
38
+ window.removeEventListener('resize', setViewportProperty);
39
+ };
40
+ }, []);
41
+ }
42
+
43
+ exports.useViewportFix = useViewportFix;
@@ -1,4 +1,3 @@
1
- import { _ as __assign } from '../tslib.es6-5FtW-kfi.js';
2
1
  import { jsx, jsxs } from 'react/jsx-runtime';
3
2
  import React, { useRef, useMemo, createRef, useCallback } from 'react';
4
3
  import clsx from 'clsx';
@@ -18,6 +17,7 @@ import 'lodash/maxBy';
18
17
  import 'lodash/upperFirst';
19
18
  import '../hooks/styleAttributes.js';
20
19
  import '../Link-CeQuavin.js';
20
+ import '../tslib.es6-5FtW-kfi.js';
21
21
  import '../Tooltip-DJufHBiQ.js';
22
22
  import '../Title-BfSFPJtJ.js';
23
23
 
@@ -28,7 +28,7 @@ var choiceConfig = {
28
28
  },
29
29
  };
30
30
  var Choice = React.forwardRef(function Choice(props, ref) {
31
- var gap = props.gap, _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
31
+ props.flexWrap; props.gap; var _a = props.isCheckbox, isCheckbox = _a === void 0 ? false : _a, _b = props.isDisabled, isDisabled = _b === void 0 ? false : _b, _c = props.isLoading, isLoading = _c === void 0 ? false : _c, _d = props.active, active = _d === void 0 ? { value: undefined } : _d, activeIcon = props.activeIcon, activeIconItemFill = props.activeIconItemFill, after = props.after, appearance = props.appearance, before = props.before, className = props.className, icon = props.icon, iconFillDisabled = props.iconFillDisabled, iconItemFill = props.iconItemFill, iconSize = props.iconSize, labelTextActiveColor = props.labelTextActiveColor, labelTextActiveColorDisabled = props.labelTextActiveColorDisabled, labelTextColor = props.labelTextColor, labelTextColorDisabled = props.labelTextColorDisabled, labelTextSize = props.labelTextSize, labelTextWeight = props.labelTextWeight, name = props.name, _e = props.options, options = _e === void 0 ? [] : _e, set = props.set, setActiveSegment = props.setActiveSegment, _f = props.size, size = _f === void 0 ? 'normal' : _f, type = props.type;
32
32
  var controlRef = useRef(null);
33
33
  var optionsRefs = useMemo(function () { return new Map(options.map(function (item) { return [item.value, createRef()]; })); }, [options]);
34
34
  var onChange = useCallback(function (event, item) {
@@ -71,6 +71,14 @@ var Choice = React.forwardRef(function Choice(props, ref) {
71
71
  prefix: 'fill_active_disabled_',
72
72
  propsKey: 'fillActiveDisabled',
73
73
  });
74
+ var wrapClass = useDeviceTargetClass(props, {
75
+ prefix: 'choice_wrap_',
76
+ propsKey: 'wrap',
77
+ });
78
+ var gapClass = useDeviceTargetClass(props, {
79
+ prefix: 'gap_',
80
+ propsKey: 'gap',
81
+ });
74
82
  // prettier-ignore
75
83
  var appearanceConfig = (appearance && choiceConfig.appearance && choiceConfig.appearance[appearance]);
76
84
  return (jsx("div", { className: clsx(className, 'choice', shapeClass ||
@@ -79,7 +87,7 @@ var Choice = React.forwardRef(function Choice(props, ref) {
79
87
  ((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderColor) &&
80
88
  "border-color_".concat(appearanceConfig.borderColor)
81
89
  .replace(/([A-Z])/g, '-$1')
82
- .toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), ref: controlRef, children: isLoading ? (jsx(Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsx("div", { className: "choice__wrapper", style: __assign({}, (gap && { gap: gap })), children: options.map(function (item) {
90
+ .toLowerCase()), borderWidthClass, borderTypeClass, set && "choice_set_".concat(set), size && "choice_size_".concat(size), type && "choice_type_".concat(type)), ref: controlRef, children: isLoading ? (jsx(Loader, { width: "fill", height: "fill", fill: "surfacePrimary", itemFill: "surfaceItemAccent", set: "simple" })) : (jsx("div", { className: clsx(className, 'choice__wrapper', gapClass, wrapClass), children: options.map(function (item) {
83
91
  // prettier-ignore
84
92
  var isActive = typeof active === 'object'
85
93
  ? String(item.value) === String(active.value)
@@ -4,7 +4,7 @@ import clsx from 'clsx';
4
4
  import Cookies from 'js-cookie';
5
5
  import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
6
6
  import { B as Button } from '../Button--5mnRJi2.js';
7
- import { G as Group } from '../Group-12uup5mu.js';
7
+ import { G as Group } from '../Group-CVUfaHaS.js';
8
8
  import { T as Text } from '../Text-CG3xPG27.js';
9
9
  import 'lodash/castArray';
10
10
  import 'lodash/camelCase';
@@ -11,7 +11,7 @@ import 'react-select';
11
11
  import { SelectInput } from './Select.js';
12
12
  import 'react';
13
13
  import '../Badge-CrhdvxY6.js';
14
- import '../Group-12uup5mu.js';
14
+ import '../Group-CVUfaHaS.js';
15
15
  import { S as Switch } from '../Switch-DEXsrPCo.js';
16
16
  import 'react-inlinesvg';
17
17
  import '../Link-CeQuavin.js';
@@ -1,4 +1,4 @@
1
- export { G as Group, g as groupConfig } from '../Group-12uup5mu.js';
1
+ export { G as Group, g as groupConfig } from '../Group-CVUfaHaS.js';
2
2
  import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import 'clsx';
@@ -3,7 +3,7 @@ import React from 'react';
3
3
  import clsx from 'clsx';
4
4
  import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
5
5
  import { useStyles } from '../hooks/useStyles.js';
6
- import { G as Group } from '../Group-12uup5mu.js';
6
+ import { G as Group } from '../Group-CVUfaHaS.js';
7
7
  import { T as Text } from '../Text-CG3xPG27.js';
8
8
  import 'lodash/castArray';
9
9
  import 'lodash/camelCase';
@@ -5,7 +5,7 @@ import SVG from 'react-inlinesvg';
5
5
  import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
6
6
  import { useStyles } from '../hooks/useStyles.js';
7
7
  import { B as Button } from '../Button--5mnRJi2.js';
8
- import { G as Group } from '../Group-12uup5mu.js';
8
+ import { G as Group } from '../Group-CVUfaHaS.js';
9
9
  import { T as Text } from '../Text-CG3xPG27.js';
10
10
  import { T as Title } from '../Title-BfSFPJtJ.js';
11
11
  import 'lodash/castArray';
@@ -8,7 +8,7 @@ import CreatableSelect from 'react-select/creatable';
8
8
  import { useDeviceTargetClass } from '../hooks/useDeviceTargetClass.js';
9
9
  import { T as Text } from '../Text-CG3xPG27.js';
10
10
  import { B as Badge } from '../Badge-CrhdvxY6.js';
11
- import { G as Group } from '../Group-12uup5mu.js';
11
+ import { G as Group } from '../Group-CVUfaHaS.js';
12
12
  import { D as Divider } from '../Divider-U5UdY-ef.js';
13
13
  import 'react-inlinesvg';
14
14
  import '../hooks/useStyles.js';
@@ -101,6 +101,20 @@
101
101
  }
102
102
  }
103
103
 
104
+ .choice {
105
+ &_wrap {
106
+ &_wrap {
107
+ flex-wrap: wrap;
108
+ }
109
+ &_nowrap {
110
+ flex-wrap: nowrap;
111
+ }
112
+ &_wrap-reverse {
113
+ flex-wrap: wrap-reverse;
114
+ }
115
+ }
116
+ }
117
+
104
118
  :root {
105
119
  --choice-item-background-hover: var(--color-surface-secondary);
106
120
 
@@ -9,16 +9,20 @@
9
9
  }
10
10
  .icon {
11
11
  &_size {
12
- @each $size in 14, 16, 24, 32, 40, 48, 56, 60, 64, 72, 80, 96, 112, 144 {
12
+ @each $size in 14, 16, 24, 32, 40, 48, 56, 60, 64, 72, 80, 96, 112, 144 {
13
13
  &_$(size) {
14
- width: $(size)px;
15
- height: $(size)px;
16
- min-width: $(size)px;
17
- min-height: $(size)px;
18
- font-size: $(size)px;
14
+ width: $(size) px;
15
+ height: $(size) px;
16
+ min-width: $(size) px;
17
+ min-height: $(size) px;
18
+ font-size: $(size) px;
19
19
  display: flex;
20
20
  justify-content: center;
21
21
  align-items: center;
22
+ & > svg {
23
+ width: $(size) px;
24
+ height: $(size) px;
25
+ }
22
26
  }
23
27
  }
24
28
  }
@@ -168,7 +168,7 @@
168
168
  .select {
169
169
  &__input-container {
170
170
  flex: 1;
171
- @each $sizeText in xs, s, m, l, xl, xxl {
171
+ @each $sizeText in xxs, xs, s, m, l, xl, xxl {
172
172
  &.text_size_$(sizeText) {
173
173
  & input {
174
174
  @mixin text-$(sizeText);
@@ -1,7 +1,7 @@
1
1
  .select {
2
2
  &__input-container {
3
3
  flex: 1;
4
- @each $sizeText in xs, s, m, l, xl, xxl {
4
+ @each $sizeText in xxs, xs, s, m, l, xl, xxl {
5
5
  &.text_size_$(sizeText) {
6
6
  & input {
7
7
  @mixin text-$(sizeText);
@@ -35,6 +35,11 @@
35
35
  var(--font-primary);
36
36
  }
37
37
 
38
+ @define-mixin text-xxs $weight: normal, $minLetterSpacing: 0px, $maxLetterSpacing: 0px {
39
+ @mixin font $weight, 9px, 12px, $minLetterSpacing, 9px, 12px, $maxLetterSpacing,
40
+ var(--font-primary);
41
+ }
42
+
38
43
  @define-mixin text-xs $weight: normal, $minLetterSpacing: 0px, $maxLetterSpacing: 0px {
39
44
  @mixin font $weight, 9px, 12px, $minLetterSpacing, 9px, 12px, $maxLetterSpacing,
40
45
  var(--font-primary);
@@ -5,4 +5,4 @@
5
5
 
6
6
  @define-mixin easing $ease: easeInSine, $type: all, $time: 0.2s {
7
7
  transition: $type $time $ease;
8
- }
8
+ }
@@ -1,7 +1,8 @@
1
1
  @define-mixin h1-new $weight: normal, $minLetterSpacing: 0, $maxLetterSpacing: 0 {
2
- @mixin font $weight, var(--typography-h1-min), var(--typography-h1-max), $minLetterSpacing,
3
- var(--typography-h1-min-line-height), var(--typography-h1-max-line-height), $maxLetterSpacing,
4
- var(--typography-h1-font);
2
+ @mixin font $weight, var(--typography-h1-min, 32px), var(--typography-h1-max, 48px),
3
+ $minLetterSpacing, var(--typography-h1-min-line-height, 80px),
4
+ var(--typography-h1-max-line-height, 96px), $maxLetterSpacing,
5
+ var(--typography-h1-font, system-ui);
5
6
  }
6
7
 
7
8
  @define-mixin h2-new $weight: normal, $minLetterSpacing: 0, $maxLetterSpacing: 0 {
@@ -8,4 +8,4 @@
8
8
  &_auto {
9
9
  width: auto;
10
10
  }
11
- }
11
+ }
@@ -0,0 +1,41 @@
1
+ import { useEffect } from 'react';
2
+
3
+ function useViewportFix() {
4
+ useEffect(function () {
5
+ // https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
6
+ var setViewportProperty = function () {
7
+ // "vh" unit is equal to 1% of the height of the initial containing block
8
+ // https://www.w3.org/TR/css-values-3/#viewport-relative-lengths
9
+ var vh = window.innerHeight * 0.01;
10
+ /** NOTE:
11
+ * In JavaScript, you can always get the value of the current viewport
12
+ * by using the global variable window.innerHeight. This value takes
13
+ * the browser’s interface into account and is updated when its
14
+ * visibility changes. The trick is to store the viewport value
15
+ * in a CSS variable and apply that to the element instead of the vh unit.
16
+ * Let’s say our CSS custom variable is --vh for this example.
17
+ * That means we will want to apply it in our CSS like this:
18
+ * ```
19
+ * .my-element {
20
+ * height: 100vh; (Fallback for browsers that do not support Custom Properties)
21
+ * height: calc(var(--vh, 1vh) * 100);
22
+ * }
23
+ * ```
24
+ * We told JavaScript to grab the height of the viewport and then
25
+ * drilled it down into 1/100th of that total so we have a value
26
+ * to assign as our viewport height unit value.
27
+ * Then we politely asked JS to create the CSS variable "--vh" at the ":root":
28
+ */
29
+ document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
30
+ };
31
+ // Update the value of "--vh" after render
32
+ setViewportProperty();
33
+ // Update the value of "--vh" by listening to the window resize event
34
+ window.addEventListener('resize', setViewportProperty);
35
+ return function () {
36
+ window.removeEventListener('resize', setViewportProperty);
37
+ };
38
+ }, []);
39
+ }
40
+
41
+ export { useViewportFix };
@@ -0,0 +1,20 @@
1
+ import { Canvas, Meta } from '@storybook/blocks'
2
+
3
+ import * as TooltipStories from '../Appearance.stories.js'
4
+
5
+ <Meta title="Atoms / Tooltip / Appearance" />
6
+
7
+ # Appearance
8
+
9
+ ## surfacePrimary
10
+
11
+ <Canvas sourceState="shown" of={TooltipStories.surfacePrimary} />
12
+
13
+ ## surfaceSecondary
14
+
15
+ <Canvas sourceState="shown" of={TooltipStories.surfaceSecondary} />
16
+
17
+ ## surfaceTertiary
18
+
19
+ <Canvas sourceState="shown" of={TooltipStories.surfaceTertiary} />
20
+ ./stories/Appearance.stories.js
@@ -0,0 +1,47 @@
1
+ import { Tooltip } from '@itcase/ui/components/Tooltip'
2
+
3
+ import { argTypes, parameters } from './args'
4
+
5
+ export default {
6
+ title: 'Atoms / Tooltip / Variants / Appearance',
7
+ component: Tooltip,
8
+ parameters: {
9
+ ...parameters,
10
+ },
11
+ argTypes: {
12
+ ...argTypes,
13
+ },
14
+ }
15
+
16
+ const DEFAULT_PROPS = {
17
+ padding: 10,
18
+ size: 'm',
19
+ text: 'text',
20
+ textSize: 'm',
21
+ title: 'Title',
22
+ titleSize: 'h4',
23
+ shape: 'rounded',
24
+ initialIsVisible: true,
25
+ elevation: 8,
26
+ }
27
+
28
+ export const surfacePrimary = {
29
+ args: {
30
+ ...DEFAULT_PROPS,
31
+ appearance: 'surfacePrimary',
32
+ },
33
+ }
34
+
35
+ export const surfaceSecondary = {
36
+ args: {
37
+ ...DEFAULT_PROPS,
38
+ appearance: 'surfaceSecondary',
39
+ },
40
+ }
41
+
42
+ export const surfaceTertiary = {
43
+ args: {
44
+ ...DEFAULT_PROPS,
45
+ appearance: 'surfaceTertiary',
46
+ },
47
+ }
@@ -0,0 +1,364 @@
1
+ import { Meta } from "@storybook/blocks";
2
+
3
+ import Github from "./assets/github.svg";
4
+ import Discord from "./assets/discord.svg";
5
+ import Youtube from "./assets/youtube.svg";
6
+ import Tutorials from "./assets/tutorials.svg";
7
+ import Styling from "./assets/styling.png";
8
+ import Context from "./assets/context.png";
9
+ import Assets from "./assets/assets.png";
10
+ import Docs from "./assets/docs.png";
11
+ import Share from "./assets/share.png";
12
+ import FigmaPlugin from "./assets/figma-plugin.png";
13
+ import Testing from "./assets/testing.png";
14
+ import Accessibility from "./assets/accessibility.png";
15
+ import Theming from "./assets/theming.png";
16
+ import AddonLibrary from "./assets/addon-library.png";
17
+
18
+ export const RightArrow = () => <svg
19
+ viewBox="0 0 14 14"
20
+ width="8px"
21
+ height="14px"
22
+ style={{
23
+ marginLeft: '4px',
24
+ display: 'inline-block',
25
+ shapeRendering: 'inherit',
26
+ verticalAlign: 'middle',
27
+ fill: 'currentColor',
28
+ 'path fill': 'currentColor'
29
+ }}
30
+ >
31
+ <path d="m11.1 7.35-5.5 5.5a.5.5 0 0 1-.7-.7L10.04 7 4.9 1.85a.5.5 0 1 1 .7-.7l5.5 5.5c.2.2.2.5 0 .7Z" />
32
+ </svg>
33
+
34
+ <Meta title="Configure your project" />
35
+
36
+ <div className="sb-container">
37
+ <div className='sb-section-title'>
38
+ # Configure your project
39
+
40
+ Because Storybook works separately from your app, you'll need to configure it for your specific stack and setup. Below, explore guides for configuring Storybook with popular frameworks and tools. If you get stuck, learn how you can ask for help from our community.
41
+ </div>
42
+ <div className="sb-section">
43
+ <div className="sb-section-item">
44
+ <img
45
+ src={Styling}
46
+ alt="A wall of logos representing different styling technologies"
47
+ />
48
+ <h4 className="sb-section-item-heading">Add styling and CSS</h4>
49
+ <p className="sb-section-item-paragraph">Like with web applications, there are many ways to include CSS within Storybook. Learn more about setting up styling within Storybook.</p>
50
+ <a
51
+ href="https://storybook.js.org/docs/configure/styling-and-css/?renderer=react"
52
+ target="_blank"
53
+ >Learn more<RightArrow /></a>
54
+ </div>
55
+ <div className="sb-section-item">
56
+ <img
57
+ src={Context}
58
+ alt="An abstraction representing the composition of data for a component"
59
+ />
60
+ <h4 className="sb-section-item-heading">Provide context and mocking</h4>
61
+ <p className="sb-section-item-paragraph">Often when a story doesn't render, it's because your component is expecting a specific environment or context (like a theme provider) to be available.</p>
62
+ <a
63
+ href="https://storybook.js.org/docs/writing-stories/decorators/?renderer=react#context-for-mocking"
64
+ target="_blank"
65
+ >Learn more<RightArrow /></a>
66
+ </div>
67
+ <div className="sb-section-item">
68
+ <img src={Assets} alt="A representation of typography and image assets" />
69
+ <div>
70
+ <h4 className="sb-section-item-heading">Load assets and resources</h4>
71
+ <p className="sb-section-item-paragraph">To link static files (like fonts) to your projects and stories, use the
72
+ `staticDirs` configuration option to specify folders to load when
73
+ starting Storybook.</p>
74
+ <a
75
+ href="https://storybook.js.org/docs/configure/images-and-assets/?renderer=react"
76
+ target="_blank"
77
+ >Learn more<RightArrow /></a>
78
+ </div>
79
+ </div>
80
+ </div>
81
+ </div>
82
+ <div className="sb-container">
83
+ <div className='sb-section-title'>
84
+ # Do more with Storybook
85
+
86
+ Now that you know the basics, let's explore other parts of Storybook that will improve your experience. This list is just to get you started. You can customise Storybook in many ways to fit your needs.
87
+ </div>
88
+
89
+ <div className="sb-section">
90
+ <div className="sb-features-grid">
91
+ <div className="sb-grid-item">
92
+ <img src={Docs} alt="A screenshot showing the autodocs tag being set, pointing a docs page being generated" />
93
+ <h4 className="sb-section-item-heading">Autodocs</h4>
94
+ <p className="sb-section-item-paragraph">Auto-generate living,
95
+ interactive reference documentation from your components and stories.</p>
96
+ <a
97
+ href="https://storybook.js.org/docs/writing-docs/autodocs/?renderer=react"
98
+ target="_blank"
99
+ >Learn more<RightArrow /></a>
100
+ </div>
101
+ <div className="sb-grid-item">
102
+ <img src={Share} alt="A browser window showing a Storybook being published to a chromatic.com URL" />
103
+ <h4 className="sb-section-item-heading">Publish to Chromatic</h4>
104
+ <p className="sb-section-item-paragraph">Publish your Storybook to review and collaborate with your entire team.</p>
105
+ <a
106
+ href="https://storybook.js.org/docs/sharing/publish-storybook/?renderer=react#publish-storybook-with-chromatic"
107
+ target="_blank"
108
+ >Learn more<RightArrow /></a>
109
+ </div>
110
+ <div className="sb-grid-item">
111
+ <img src={FigmaPlugin} alt="Windows showing the Storybook plugin in Figma" />
112
+ <h4 className="sb-section-item-heading">Figma Plugin</h4>
113
+ <p className="sb-section-item-paragraph">Embed your stories into Figma to cross-reference the design and live
114
+ implementation in one place.</p>
115
+ <a
116
+ href="https://storybook.js.org/docs/sharing/design-integrations/?renderer=react#embed-storybook-in-figma-with-the-plugin"
117
+ target="_blank"
118
+ >Learn more<RightArrow /></a>
119
+ </div>
120
+ <div className="sb-grid-item">
121
+ <img src={Testing} alt="Screenshot of tests passing and failing" />
122
+ <h4 className="sb-section-item-heading">Testing</h4>
123
+ <p className="sb-section-item-paragraph">Use stories to test a component in all its variations, no matter how
124
+ complex.</p>
125
+ <a
126
+ href="https://storybook.js.org/docs/writing-tests/?renderer=react"
127
+ target="_blank"
128
+ >Learn more<RightArrow /></a>
129
+ </div>
130
+ <div className="sb-grid-item">
131
+ <img src={Accessibility} alt="Screenshot of accessibility tests passing and failing" />
132
+ <h4 className="sb-section-item-heading">Accessibility</h4>
133
+ <p className="sb-section-item-paragraph">Automatically test your components for a11y issues as you develop.</p>
134
+ <a
135
+ href="https://storybook.js.org/docs/writing-tests/accessibility-testing/?renderer=react"
136
+ target="_blank"
137
+ >Learn more<RightArrow /></a>
138
+ </div>
139
+ <div className="sb-grid-item">
140
+ <img src={Theming} alt="Screenshot of Storybook in light and dark mode" />
141
+ <h4 className="sb-section-item-heading">Theming</h4>
142
+ <p className="sb-section-item-paragraph">Theme Storybook's UI to personalize it to your project.</p>
143
+ <a
144
+ href="https://storybook.js.org/docs/configure/theming/?renderer=react"
145
+ target="_blank"
146
+ >Learn more<RightArrow /></a>
147
+ </div>
148
+ </div>
149
+ </div>
150
+ </div>
151
+ <div className='sb-addon'>
152
+ <div className='sb-addon-text'>
153
+ <h4>Addons</h4>
154
+ <p className="sb-section-item-paragraph">Integrate your tools with Storybook to connect workflows.</p>
155
+ <a
156
+ href="https://storybook.js.org/addons/"
157
+ target="_blank"
158
+ >Discover all addons<RightArrow /></a>
159
+ </div>
160
+ <div className='sb-addon-img'>
161
+ <img src={AddonLibrary} alt="Integrate your tools with Storybook to connect workflows." />
162
+ </div>
163
+ </div>
164
+
165
+ <div className="sb-section sb-socials">
166
+ <div className="sb-section-item">
167
+ <img src={Github} alt="Github logo" className="sb-explore-image"/>
168
+ Join our contributors building the future of UI development.
169
+
170
+ <a
171
+ href="https://github.com/storybookjs/storybook"
172
+ target="_blank"
173
+ >Star on GitHub<RightArrow /></a>
174
+ </div>
175
+ <div className="sb-section-item">
176
+ <img src={Discord} alt="Discord logo" className="sb-explore-image"/>
177
+ <div>
178
+ Get support and chat with frontend developers.
179
+
180
+ <a
181
+ href="https://discord.gg/storybook"
182
+ target="_blank"
183
+ >Join Discord server<RightArrow /></a>
184
+ </div>
185
+ </div>
186
+ <div className="sb-section-item">
187
+ <img src={Youtube} alt="Youtube logo" className="sb-explore-image"/>
188
+ <div>
189
+ Watch tutorials, feature previews and interviews.
190
+
191
+ <a
192
+ href="https://www.youtube.com/@chromaticui"
193
+ target="_blank"
194
+ >Watch on YouTube<RightArrow /></a>
195
+ </div>
196
+ </div>
197
+ <div className="sb-section-item">
198
+ <img src={Tutorials} alt="A book" className="sb-explore-image"/>
199
+ <p>Follow guided walkthroughs on for key workflows.</p>
200
+
201
+ <a
202
+ href="https://storybook.js.org/tutorials/"
203
+ target="_blank"
204
+ >Discover tutorials<RightArrow /></a>
205
+ </div>
206
+ </div>
207
+
208
+ <style>
209
+ {`
210
+ .sb-container {
211
+ margin-bottom: 48px;
212
+ }
213
+
214
+ .sb-section {
215
+ width: 100%;
216
+ display: flex;
217
+ flex-direction: row;
218
+ gap: 20px;
219
+ }
220
+
221
+ img {
222
+ object-fit: cover;
223
+ }
224
+
225
+ .sb-section-title {
226
+ margin-bottom: 32px;
227
+ }
228
+
229
+ .sb-section a:not(h1 a, h2 a, h3 a) {
230
+ font-size: 14px;
231
+ }
232
+
233
+ .sb-section-item, .sb-grid-item {
234
+ flex: 1;
235
+ display: flex;
236
+ flex-direction: column;
237
+ }
238
+
239
+ .sb-section-item-heading {
240
+ padding-top: 20px !important;
241
+ padding-bottom: 5px !important;
242
+ margin: 0 !important;
243
+ }
244
+ .sb-section-item-paragraph {
245
+ margin: 0;
246
+ padding-bottom: 10px;
247
+ }
248
+
249
+ .sb-chevron {
250
+ margin-left: 5px;
251
+ }
252
+
253
+ .sb-features-grid {
254
+ display: grid;
255
+ grid-template-columns: repeat(2, 1fr);
256
+ grid-gap: 32px 20px;
257
+ }
258
+
259
+ .sb-socials {
260
+ display: grid;
261
+ grid-template-columns: repeat(4, 1fr);
262
+ }
263
+
264
+ .sb-socials p {
265
+ margin-bottom: 10px;
266
+ }
267
+
268
+ .sb-explore-image {
269
+ max-height: 32px;
270
+ align-self: flex-start;
271
+ }
272
+
273
+ .sb-addon {
274
+ width: 100%;
275
+ display: flex;
276
+ align-items: center;
277
+ position: relative;
278
+ background-color: #EEF3F8;
279
+ border-radius: 5px;
280
+ border: 1px solid rgba(0, 0, 0, 0.05);
281
+ background: #EEF3F8;
282
+ height: 180px;
283
+ margin-bottom: 48px;
284
+ overflow: hidden;
285
+ }
286
+
287
+ .sb-addon-text {
288
+ padding-left: 48px;
289
+ max-width: 240px;
290
+ }
291
+
292
+ .sb-addon-text h4 {
293
+ padding-top: 0px;
294
+ }
295
+
296
+ .sb-addon-img {
297
+ position: absolute;
298
+ left: 345px;
299
+ top: 0;
300
+ height: 100%;
301
+ width: 200%;
302
+ overflow: hidden;
303
+ }
304
+
305
+ .sb-addon-img img {
306
+ width: 650px;
307
+ transform: rotate(-15deg);
308
+ margin-left: 40px;
309
+ margin-top: -72px;
310
+ box-shadow: 0 0 1px rgba(255, 255, 255, 0);
311
+ backface-visibility: hidden;
312
+ }
313
+
314
+ @media screen and (max-width: 800px) {
315
+ .sb-addon-img {
316
+ left: 300px;
317
+ }
318
+ }
319
+
320
+ @media screen and (max-width: 600px) {
321
+ .sb-section {
322
+ flex-direction: column;
323
+ }
324
+
325
+ .sb-features-grid {
326
+ grid-template-columns: repeat(1, 1fr);
327
+ }
328
+
329
+ .sb-socials {
330
+ grid-template-columns: repeat(2, 1fr);
331
+ }
332
+
333
+ .sb-addon {
334
+ height: 280px;
335
+ align-items: flex-start;
336
+ padding-top: 32px;
337
+ overflow: hidden;
338
+ }
339
+
340
+ .sb-addon-text {
341
+ padding-left: 24px;
342
+ }
343
+
344
+ .sb-addon-img {
345
+ right: 0;
346
+ left: 0;
347
+ top: 130px;
348
+ bottom: 0;
349
+ overflow: hidden;
350
+ height: auto;
351
+ width: 124%;
352
+ }
353
+
354
+ .sb-addon-img img {
355
+ width: 1200px;
356
+ transform: rotate(-12deg);
357
+ margin-left: 0;
358
+ margin-top: 48px;
359
+ margin-bottom: -40px;
360
+ margin-left: -24px;
361
+ }
362
+ }
363
+ `}
364
+ </style>
@@ -0,0 +1,29 @@
1
+ import { fn } from '@storybook/test';
2
+
3
+ import { Header } from './Header';
4
+
5
+ export default {
6
+ title: 'Example/Header',
7
+ component: Header,
8
+ // This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
9
+ tags: ['autodocs'],
10
+ parameters: {
11
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
12
+ layout: 'fullscreen',
13
+ },
14
+ args: {
15
+ onLogin: fn(),
16
+ onLogout: fn(),
17
+ onCreateAccount: fn(),
18
+ },
19
+ };
20
+
21
+ export const LoggedIn = {
22
+ args: {
23
+ user: {
24
+ name: 'Jane Doe',
25
+ },
26
+ },
27
+ };
28
+
29
+ export const LoggedOut = {};
@@ -0,0 +1,12 @@
1
+ import { Meta, Story } from '@storybook/blocks'
2
+
3
+ import * as TooltipStories from '../Appearance.stories.js'
4
+
5
+ <Meta title="Atoms / Tooltip / Overview" />
6
+
7
+ # Tooltip
8
+
9
+ `Tooltip` - это небольшой фрагмент контекстной информации, который появляется, когда пользователи наводят курсор мыши на элемент пользовательского интерфейса.
10
+
11
+ <Story of={TooltipStories.surfacePrimary} />
12
+ ./stories/Appearance.stories.js
@@ -0,0 +1,28 @@
1
+ import { expect, userEvent, within } from '@storybook/test';
2
+
3
+ import { Page } from './Page';
4
+
5
+ export default {
6
+ title: 'Example/Page',
7
+ component: Page,
8
+ parameters: {
9
+ // More on how to position stories at: https://storybook.js.org/docs/configure/story-layout
10
+ layout: 'fullscreen',
11
+ },
12
+ };
13
+
14
+ export const LoggedOut = {};
15
+
16
+ // More on interaction testing: https://storybook.js.org/docs/writing-tests/interaction-testing
17
+ export const LoggedIn = {
18
+ play: async ({ canvasElement }) => {
19
+ const canvas = within(canvasElement);
20
+ const loginButton = canvas.getByRole('button', { name: /Log in/i });
21
+ await expect(loginButton).toBeInTheDocument();
22
+ await userEvent.click(loginButton);
23
+ await expect(loginButton).not.toBeInTheDocument();
24
+
25
+ const logoutButton = canvas.getByRole('button', { name: /Log out/i });
26
+ await expect(logoutButton).toBeInTheDocument();
27
+ },
28
+ };
@@ -0,0 +1,11 @@
1
+ import { Canvas, Controls, Meta } from '@storybook/blocks'
2
+
3
+ import * as TooltipStories from '../Appearance.stories.js'
4
+
5
+ <Meta title="Atoms / Tooltip / Playground" />
6
+
7
+ # Playground
8
+
9
+ <Canvas sourceState="shown" of={TooltipStories.surfacePrimary} />
10
+ <Controls of={TooltipStories.surfacePrimary} />
11
+ ./stories/Appearance.stories.js
@@ -1,6 +1,6 @@
1
- import { Tile } from '@itcase/ui/components/Tile'
2
- import { Button, buttonConfig } from '@itcase/ui/components/Button'
3
- import buttonAppearance from 'src/components/Button/appearance.json'
1
+ import { Tile } from '../Tile'
2
+ import { Button, buttonConfig } from '../../Button'
3
+ import buttonAppearance from '../../Button/appearance.json'
4
4
 
5
5
  import {
6
6
  alignProps,
@@ -19,11 +19,11 @@ import {
19
19
  textColorProps,
20
20
  textSizeProps,
21
21
  titleSizeProps,
22
- } from '@itcase/ui/constants'
22
+ } from '../../../constants'
23
23
 
24
24
  buttonConfig.setAppearance(buttonAppearance)
25
25
 
26
- import { icon24 } from 'src/icons'
26
+ import { icon24 } from '../../../icons'
27
27
 
28
28
  export default {
29
29
  title: 'Atoms / Tile',
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { iStyleAttributes } from '../../hooks/styleAttributes.interface';
3
- import type { borderTypePropsType, iconSizePropsType, sizeOptionPropsType, tBorderColorProps, tBorderWidthProps, tFillHoverProps, tFillProps, tItemColorProps, tShapeProps, tTextColorProps, tTextSizeProps, tTextWeightProps } from '../../types';
3
+ import type { borderTypePropsType, iconSizePropsType, sizeOptionPropsType, tBorderColorProps, tBorderWidthProps, tFillHoverProps, tFillProps, tItemColorProps, tShapeProps, tTextColorProps, tTextSizeProps, tTextWeightProps, wrapPropsType } from '../../types';
4
4
  import type { tAppearanceKeysDefault } from '../../types/componentProps/appearanceKeys';
5
5
  interface iChoiceThemeColor {
6
6
  activeIconItemFill?: tItemColorProps;
@@ -12,6 +12,7 @@ interface iChoiceThemeColor {
12
12
  fillActiveDisabled?: tFillProps;
13
13
  fillDisabled?: tFillProps;
14
14
  fillHover?: tFillHoverProps;
15
+ gap?: string;
15
16
  iconFillDisabled?: tItemColorProps;
16
17
  iconItemFill?: tItemColorProps;
17
18
  iconSize?: iconSizePropsType;
@@ -22,6 +23,7 @@ interface iChoiceThemeColor {
22
23
  labelTextSize?: tTextSizeProps;
23
24
  labelTextWeight?: tTextWeightProps;
24
25
  shape?: tShapeProps;
26
+ wrap?: wrapPropsType;
25
27
  }
26
28
  type tChoiceAppearance = {
27
29
  [key in tAppearanceKeysDefault]?: iChoiceThemeColor;
@@ -0,0 +1,2 @@
1
+ declare function useViewportFix(): void;
2
+ export { useViewportFix };
@@ -1 +1 @@
1
- export type flexWrapPropsType = 'wrap' | 'nowrap' | 'wrap-reverse';
1
+ export type flexWrapPropsType = 'nowrap' | 'wrap' | 'wrap-reverse';
@@ -1 +1 @@
1
- export type wrapPropsType = 'wrap' | 'no-wrap' | 'nowrap' | 'wrap-reverse';
1
+ export type wrapPropsType = 'no-wrap' | 'nowrap' | 'wrap' | 'wrap-reverse';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.2.18",
3
+ "version": "1.2.19",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -75,7 +75,10 @@
75
75
  "prepare": "husky",
76
76
  "prepack": "npm run build",
77
77
  "semantic-release": "semantic-release",
78
- "typecheck": "tsc --noEmit"
78
+ "typecheck": "tsc --noEmit",
79
+ "storybook": "storybook dev -p 6006",
80
+ "build-storybook": "storybook build",
81
+ "test-storybook": "test-storybook -c .storybook --watch"
79
82
  },
80
83
  "files": [
81
84
  "dist",
@@ -92,7 +95,6 @@
92
95
  "dependencies": {
93
96
  "@itcase/common": "^1.2.13",
94
97
  "clsx": "^2.1.1",
95
- "html5-boilerplate": "^9.0.1",
96
98
  "js-cookie": "^3.0.5",
97
99
  "lodash": "^4.17.21",
98
100
  "luxon": "^3.5.0",
@@ -121,6 +123,7 @@
121
123
  "@babel/eslint-plugin": "^7.25.7",
122
124
  "@babel/preset-env": "^7.25.8",
123
125
  "@babel/preset-react": "^7.25.7",
126
+ "@chromatic-com/storybook": "^1.9.0",
124
127
  "@commitlint/cli": "^19.5.0",
125
128
  "@commitlint/config-conventional": "^19.5.0",
126
129
  "@itcase/lint": "^1.0.13",
@@ -133,11 +136,22 @@
133
136
  "@semantic-release/changelog": "^6.0.3",
134
137
  "@semantic-release/git": "^10.0.1",
135
138
  "@semantic-release/release-notes-generator": "14.0.1",
139
+ "@storybook/addon-essentials": "^8.3.5",
140
+ "@storybook/addon-interactions": "^8.3.5",
141
+ "@storybook/addon-links": "^8.3.5",
142
+ "@storybook/addon-onboarding": "^8.3.5",
143
+ "@storybook/addon-styling-webpack": "^1.0.0",
144
+ "@storybook/addon-themes": "^8.3.5",
145
+ "@storybook/addon-webpack5-compiler-swc": "^1.0.5",
146
+ "@storybook/blocks": "^8.3.5",
147
+ "@storybook/react": "^8.3.5",
148
+ "@storybook/react-webpack5": "^8.3.5",
149
+ "@storybook/test": "^8.3.5",
136
150
  "@types/js-cookie": "^3.0.6",
137
151
  "@types/lodash": "^4.17.10",
138
152
  "@types/react": "^18",
139
153
  "@types/react-datepicker": "^7.0.0",
140
- "@types/react-dom": "^18.3.0",
154
+ "@types/react-dom": "^18.3.1",
141
155
  "@types/react-scroll": "^1.8.10",
142
156
  "@types/uuid": "^10.0.0",
143
157
  "babel-loader": "^9.2.1",
@@ -146,6 +160,7 @@
146
160
  "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
147
161
  "conventional-changelog-conventionalcommits": "^8.0.0",
148
162
  "eslint": "9.12.0",
163
+ "eslint-plugin-storybook": "^0.9.0",
149
164
  "husky": "^9.1.6",
150
165
  "lint-staged": "^15.2.10",
151
166
  "npm": "^10.9.0",
@@ -162,6 +177,7 @@
162
177
  "postcss-hexrgba": "^2.1.0",
163
178
  "postcss-import": "^16.1.0",
164
179
  "postcss-import-ext-glob": "^2.1.1",
180
+ "postcss-loader": "^8.1.1",
165
181
  "postcss-mixins": "^11.0.3",
166
182
  "postcss-nested": "^6.2.0",
167
183
  "postcss-nested-ancestors": "^3.0.0",
@@ -178,7 +194,13 @@
178
194
  "rollup-plugin-peer-deps-external": "^2.2.4",
179
195
  "rollup-preserve-directives": "^1.1.2",
180
196
  "semantic-release": "^24.1.2",
181
- "stylelint": "^16.9.0",
197
+ "storybook": "^8.3.5",
198
+ "stylelint": "^16.10.0",
182
199
  "typescript": "^5.6.3"
200
+ },
201
+ "eslintConfig": {
202
+ "extends": [
203
+ "plugin:storybook/recommended"
204
+ ]
183
205
  }
184
206
  }