@redsift/dashboard 7.2.1 → 7.4.0-alpha.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/CONTRIBUTING.md +2 -2
- package/index.d.ts +92 -2
- package/index.js +644 -111
- package/index.js.map +1 -1
- package/package.json +5 -4
package/CONTRIBUTING.md
CHANGED
|
@@ -32,7 +32,7 @@ The Design System is following a monorepo architecture, providing multiple packa
|
|
|
32
32
|
|
|
33
33
|
- `@redsift/icons`
|
|
34
34
|
|
|
35
|
-
This package provides icons based on [Material Design Icon](https://
|
|
35
|
+
This package provides icons based on [Material Design Icon](https://pictogrammers.com/library/mdi/) library.
|
|
36
36
|
|
|
37
37
|
- `@redsift/design-system`
|
|
38
38
|
|
|
@@ -123,7 +123,7 @@ import { Comp } from '~/types';
|
|
|
123
123
|
import { StyledBadge } from './styles';
|
|
124
124
|
import { BadgeProps } from './types';
|
|
125
125
|
|
|
126
|
-
const COMPONENT_NAME = '
|
|
126
|
+
const COMPONENT_NAME = 'Badge';
|
|
127
127
|
const CLASSNAME = 'redsift-badge';
|
|
128
128
|
const DEFAULT_PROPS: Partial<BadgeProps> = {
|
|
129
129
|
// default values
|
package/index.d.ts
CHANGED
|
@@ -54,6 +54,7 @@ type Comp<P, T = HTMLElement> = {
|
|
|
54
54
|
};
|
|
55
55
|
/** Get types of the values of a record. */
|
|
56
56
|
type ValueOf<T extends Record<any, any>> = T[keyof T];
|
|
57
|
+
|
|
57
58
|
/**
|
|
58
59
|
* Color palette.
|
|
59
60
|
*/
|
|
@@ -77,6 +78,93 @@ declare const ProductColorPalette: {
|
|
|
77
78
|
};
|
|
78
79
|
type ProductColorPalette = ValueOf<typeof ProductColorPalette>;
|
|
79
80
|
|
|
81
|
+
declare const AlignSelf: {
|
|
82
|
+
readonly auto: "auto";
|
|
83
|
+
readonly normal: "normal";
|
|
84
|
+
readonly start: "start";
|
|
85
|
+
readonly end: "end";
|
|
86
|
+
readonly center: "center";
|
|
87
|
+
readonly 'flex-start': "flex-start";
|
|
88
|
+
readonly 'flex-end': "flex-end";
|
|
89
|
+
readonly 'self-start': "self-start";
|
|
90
|
+
readonly 'self-end': "self-end";
|
|
91
|
+
readonly baseline: "baseline";
|
|
92
|
+
readonly stretch: "stretch";
|
|
93
|
+
};
|
|
94
|
+
type AlignSelf = ValueOf<typeof AlignSelf>;
|
|
95
|
+
interface LayoutProps {
|
|
96
|
+
/** When used in a flex layout, specifies how the element will grow or shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex">MDN</a>. */
|
|
97
|
+
flex?: string;
|
|
98
|
+
/** When used in a flex layout, specifies how the element will grow to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-grow">MDN</a>. */
|
|
99
|
+
flexGrow?: number;
|
|
100
|
+
/** When used in a flex layout, specifies how the element will shrink to fit the space available. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex-shrink">MDN</a>. */
|
|
101
|
+
flexShrink?: number;
|
|
102
|
+
/** When used in a flex layout, specifies the initial main size of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/flex_basis">MDN</a>. */
|
|
103
|
+
flexBasis?: string;
|
|
104
|
+
/** Overrides the alignItems property of a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/align-self">MDN</a>. */
|
|
105
|
+
alignSelf?: AlignSelf;
|
|
106
|
+
/** Specifies how the element is justified inside a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/justify-self">MDN</a>. */
|
|
107
|
+
justifySelf?: string;
|
|
108
|
+
/** The layout order for the element within a flex or grid container. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/order">MDN</a>. */
|
|
109
|
+
order?: number;
|
|
110
|
+
/** When used in a grid layout, specifies the named grid area that the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-area">MDN</a>. */
|
|
111
|
+
gridArea?: string;
|
|
112
|
+
/** When used in a grid layout, specifies the column the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column">MDN</a>. */
|
|
113
|
+
gridColumn?: string;
|
|
114
|
+
/** When used in a grid layout, specifies the row the element should be placed in within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row">MDN</a>. */
|
|
115
|
+
gridRow?: string;
|
|
116
|
+
/** When used in a grid layout, specifies the starting column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-start">MDN</a>. */
|
|
117
|
+
gridColumnStart?: string;
|
|
118
|
+
/** When used in a grid layout, specifies the ending column to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-column-end">MDN</a>. */
|
|
119
|
+
gridColumnEnd?: string;
|
|
120
|
+
/** When used in a grid layout, specifies the starting row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-start">MDN</a>. */
|
|
121
|
+
gridRowStart?: string;
|
|
122
|
+
/** When used in a grid layout, specifies the ending row to span within the grid. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/grid-row-end">MDN</a>. */
|
|
123
|
+
gridRowEnd?: string;
|
|
124
|
+
}
|
|
125
|
+
interface SpacingProps {
|
|
126
|
+
/** The margin for all four sides of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin">MDN</a>. */
|
|
127
|
+
margin?: string;
|
|
128
|
+
/** The margin for the bottom side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom">MDN</a>. */
|
|
129
|
+
marginBottom?: string;
|
|
130
|
+
/** The margin for the left side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left">MDN</a>. */
|
|
131
|
+
marginLeft?: string;
|
|
132
|
+
/** The margin for the right side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right">MDN</a>. */
|
|
133
|
+
marginRight?: string;
|
|
134
|
+
/** The margin for the top side of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top">MDN</a>. */
|
|
135
|
+
marginTop?: string;
|
|
136
|
+
}
|
|
137
|
+
interface SizingProps {
|
|
138
|
+
/** The height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/height">MDN</a>. */
|
|
139
|
+
height?: string | number;
|
|
140
|
+
/** The maximum height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/max-height">MDN</a>. */
|
|
141
|
+
maxHeight?: string;
|
|
142
|
+
/** The maximum width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/max-width">MDN</a>. */
|
|
143
|
+
maxWidth?: string;
|
|
144
|
+
/** The minimum height of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-height">MDN</a>. */
|
|
145
|
+
minHeight?: string;
|
|
146
|
+
/** The minimum width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/min-width">MDN</a>. */
|
|
147
|
+
minWidth?: string;
|
|
148
|
+
/** The width of the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/width">MDN</a>. */
|
|
149
|
+
width?: string | number;
|
|
150
|
+
}
|
|
151
|
+
interface PositioningProps {
|
|
152
|
+
/** Specifies how the element is positioned. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position">MDN</a>. */
|
|
153
|
+
position?: string;
|
|
154
|
+
/** The top position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/top">MDN</a>. */
|
|
155
|
+
top?: string;
|
|
156
|
+
/** The bottom position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/bottom">MDN</a>. */
|
|
157
|
+
bottom?: string;
|
|
158
|
+
/** The left position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/left">MDN</a>. Consider using start instead for RTL support. */
|
|
159
|
+
left?: string;
|
|
160
|
+
/** The right position for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/right">MDN</a>. Consider using start instead for RTL support. */
|
|
161
|
+
right?: string;
|
|
162
|
+
/** The stacking order for the element. See <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/z-index">MDN</a>. */
|
|
163
|
+
zIndex?: string;
|
|
164
|
+
}
|
|
165
|
+
interface StylingProps extends LayoutProps, SpacingProps, SizingProps, PositioningProps {
|
|
166
|
+
}
|
|
167
|
+
|
|
80
168
|
/*
|
|
81
169
|
* Copyright 2020 Adobe. All rights reserved.
|
|
82
170
|
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
@@ -121,11 +209,11 @@ type ButtonVariant = ValueOf<typeof ButtonVariant>;
|
|
|
121
209
|
/**
|
|
122
210
|
* Component color.
|
|
123
211
|
*/
|
|
124
|
-
type ButtonColor =
|
|
212
|
+
type ButtonColor = ColorPalette | ProductColorPalette;
|
|
125
213
|
/**
|
|
126
214
|
* Component props.
|
|
127
215
|
*/
|
|
128
|
-
interface ButtonProps extends ComponentProps<'button'
|
|
216
|
+
interface ButtonProps extends ComponentProps<'button'>, StylingProps {
|
|
129
217
|
/** Color variant. The product colors are available but should only be used to display the Button in the color of another product. To display a Button with a color of the current product, use `default`. */
|
|
130
218
|
color?: ButtonColor;
|
|
131
219
|
/** Whether the component take the full width or not. */
|
|
@@ -134,6 +222,8 @@ interface ButtonProps extends ComponentProps<'button'> {
|
|
|
134
222
|
isActive?: boolean;
|
|
135
223
|
/** Whether the component is disabled or not. */
|
|
136
224
|
isDisabled?: boolean;
|
|
225
|
+
/** Whether the component is in a loading state or not. */
|
|
226
|
+
isLoading?: boolean;
|
|
137
227
|
/**
|
|
138
228
|
* Icon path data (`d` property of the `path` SVG element).<br />
|
|
139
229
|
* See <a href="https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths">https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/Paths</a>.<br />
|