@mailstep/design-system 0.7.2 → 0.7.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.7.2",
3
+ "version": "0.7.4",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ export type BarChartSymbolProps = {
3
+ selected?: number;
4
+ total?: number;
5
+ height?: number;
6
+ width?: number;
7
+ gap?: number;
8
+ color?: string;
9
+ };
10
+ export declare const BarChartSymbol: FC<BarChartSymbolProps>;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { x } from '@xstyled/styled-components';
3
+ import { Bar } from './styles';
4
+ export var BarChartSymbol = function (_a) {
5
+ var _b = _a.total, total = _b === void 0 ? 3 : _b, _c = _a.height, height = _c === void 0 ? 14 : _c, _d = _a.selected, selected = _d === void 0 ? 3 : _d, _e = _a.gap, gap = _e === void 0 ? 2 : _e, _f = _a.width, width = _f === void 0 ? 3 : _f, color = _a.color;
6
+ return (_jsx(x.div, { display: "flex", alignItems: "flex-end", gap: "".concat(gap, "px"), children: Array.from({ length: total }).map(function (_, index) { return (_jsx(Bar, { total: total, index: index + 1, height: height, selected: selected, color: color, width: width }, index)); }) }));
7
+ };
@@ -0,0 +1 @@
1
+ export { BarChartSymbol } from './BarChartSymbol';
@@ -0,0 +1 @@
1
+ export { BarChartSymbol } from './BarChartSymbol';
@@ -0,0 +1,13 @@
1
+ /// <reference types="react" />
2
+ import type { StoryObj } from '@storybook/react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: import("react").FC<import("../BarChartSymbol").BarChartSymbolProps>;
6
+ tags: string[];
7
+ argTypes: {};
8
+ };
9
+ export default meta;
10
+ type Story = StoryObj<typeof meta>;
11
+ export declare const Default: Story;
12
+ export declare const MediumBarchChart: Story;
13
+ export declare const LowBarChart: Story;
@@ -0,0 +1,26 @@
1
+ import { BarChartSymbol } from '../';
2
+ var meta = {
3
+ title: 'Elements/BarChartSymbol',
4
+ component: BarChartSymbol,
5
+ tags: ['autodocs'],
6
+ argTypes: {}
7
+ };
8
+ export default meta;
9
+ export var Default = {
10
+ args: {
11
+ selected: 3,
12
+ color: 'green'
13
+ }
14
+ };
15
+ export var MediumBarchChart = {
16
+ args: {
17
+ selected: 2,
18
+ color: 'orange',
19
+ }
20
+ };
21
+ export var LowBarChart = {
22
+ args: {
23
+ selected: 1,
24
+ color: 'red1',
25
+ }
26
+ };
@@ -0,0 +1,8 @@
1
+ export declare const Bar: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
2
+ height: number;
3
+ index: number;
4
+ total: number;
5
+ selected: number;
6
+ color?: string | undefined;
7
+ width?: number | undefined;
8
+ }, never>;
@@ -0,0 +1,17 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import { styled, th } from '@xstyled/styled-components';
6
+ var minHeight = 7;
7
+ export var Bar = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: ", "px;\n height: ", "px;\n background-color: ", ";\n border-radius: 7px;\n"], ["\n width: ", "px;\n height: ", "px;\n background-color: ", ";\n border-radius: 7px;\n"])), function (_a) {
8
+ var width = _a.width;
9
+ return width;
10
+ }, function (_a) {
11
+ var index = _a.index, height = _a.height, total = _a.total;
12
+ return minHeight + (index - 1) * ((height - minHeight) / (total - 1));
13
+ }, function (_a) {
14
+ var selected = _a.selected, index = _a.index, color = _a.color;
15
+ return (selected >= index ? th.color(color || 'red1') : th.color('lightGray6'));
16
+ });
17
+ var templateObject_1;
@@ -12,5 +12,7 @@ export type TextProps = {
12
12
  mb?: string | number;
13
13
  ml?: string | number;
14
14
  color?: string;
15
+ textDecoration?: string;
16
+ onClick?: (e: React.MouseEvent<HTMLParagraphElement>) => void;
15
17
  as?: string | ComponentType<any>;
16
18
  };