@moda/om 17.13.0 → 17.14.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file. See
4
4
  [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [17.14.0](https://github.com/ModaOperandi/om/compare/v17.13.0...v17.14.0) (2022-11-15)
7
+
8
+
9
+ ### Features
10
+
11
+ * **loading-shapes:** adds the component, imported from discovery and its stories ([#3055](https://github.com/ModaOperandi/om/issues/3055)) ([c242985](https://github.com/ModaOperandi/om/commit/c242985806107cc78e550f030cf0975301067c17))
12
+
6
13
  # [17.13.0](https://github.com/ModaOperandi/om/compare/v17.12.0...v17.13.0) (2022-11-14)
7
14
 
8
15
 
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import './LoadingShapes.scss';
3
+ export declare const LoadingShapes: () => JSX.Element;
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ declare const _default: {
3
+ title: string;
4
+ };
5
+ export default _default;
6
+ export declare const Default: () => JSX.Element;
@@ -0,0 +1 @@
1
+ export * from './LoadingShapes';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moda/om",
3
- "version": "17.13.0",
3
+ "version": "17.14.0",
4
4
  "description": "Moda Operandi design system",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -0,0 +1,9 @@
1
+ @import '~om';
2
+
3
+ .LoadingShapes__item--current {
4
+ // stylelint-disable-next-line plugin/selector-bem-pattern
5
+ path {
6
+ fill: color(snow);
7
+ transition: fill 1s;
8
+ }
9
+ }
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { States } from 'storybook-states';
3
+ import { LoadingShapes } from './LoadingShapes';
4
+
5
+ export default { title: 'Components/LoadingShapes' };
6
+
7
+ export const Default = () => (
8
+ <States>
9
+ <LoadingShapes />
10
+ </States>
11
+ );
@@ -0,0 +1,37 @@
1
+ import classNames from 'classnames';
2
+ import React, { useEffect } from 'react';
3
+ import { useCursor } from 'use-cursor';
4
+ import { ArcWindow, Circle, Diamond, Triangle } from '../Shape';
5
+ import { Stack } from '../Stack';
6
+
7
+ import './LoadingShapes.scss';
8
+
9
+ const INTERVAL = 100;
10
+
11
+ export const LoadingShapes = () => {
12
+ const items = [Triangle, Diamond, ArcWindow, Circle];
13
+ const { index, handleNext } = useCursor({ max: items.length });
14
+
15
+ useEffect(() => {
16
+ const interval = setInterval(() => {
17
+ handleNext();
18
+ }, INTERVAL);
19
+
20
+ return () => clearInterval(interval);
21
+ }, [handleNext]);
22
+
23
+ return (
24
+ <Stack className='LoadingShapes' direction='horizontal' space={2}>
25
+ {items.map((Item, itemIndex) => (
26
+ <div
27
+ className={classNames('LoadingShapes__item', {
28
+ 'LoadingShapes__item--current': itemIndex !== index
29
+ })}
30
+ key={itemIndex}
31
+ >
32
+ <Item />
33
+ </div>
34
+ ))}
35
+ </Stack>
36
+ );
37
+ };
@@ -0,0 +1 @@
1
+ export * from './LoadingShapes';