@redsift/products 10.3.0-alpha.10
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 +415 -0
- package/index.d.ts +86 -0
- package/index.js +184 -0
- package/index.js.map +1 -0
- package/package.json +99 -0
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
# Contribute
|
|
2
|
+
|
|
3
|
+
## Develop
|
|
4
|
+
|
|
5
|
+
Make sure you have the following requirements installed: [node](https://nodejs.org/) (v16+) and [yarn](https://yarnpkg.com/en/) (v1.22.0+)
|
|
6
|
+
|
|
7
|
+
Clone the repo (or fork it first if you're not part of Red Sift organization).
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
git clone git@github.com:redsift/design-system.git
|
|
11
|
+
cd design-system
|
|
12
|
+
yarn install
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Set up your environment variable file by copying the template file:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cp .env.template .env
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then edit the `.env` file with the correct values. NEVER commit the `.env` file directly or any secrets and credentials it might contain.
|
|
22
|
+
|
|
23
|
+
You can then run the storybook and browse to [http://localhost:9000](http://localhost:9000) with:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
yarn start:storybook
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Architecture
|
|
30
|
+
|
|
31
|
+
The Design System is following a monorepo architecture, providing multiple packages based on different use cases.
|
|
32
|
+
|
|
33
|
+
- `@redsift/icons`
|
|
34
|
+
|
|
35
|
+
This package provides icons based on [Material Design Icon](https://pictogrammers.com/library/mdi/) library.
|
|
36
|
+
|
|
37
|
+
- `@redsift/design-system`
|
|
38
|
+
|
|
39
|
+
This package is the main package of Red Sift's Design System. It provides the majority of the components, including layout, formatting, navigation, form and interactive components.
|
|
40
|
+
|
|
41
|
+
- `@redsift/popovers`
|
|
42
|
+
|
|
43
|
+
This package provides popover components. Popover components are based on [floating-ui](https://floating-ui.com/) and [@floating-ui/react](https://floating-ui.com/docs/react). Toasts are based on [react-toastify](https://fkhadra.github.io/react-toastify).
|
|
44
|
+
|
|
45
|
+
- `@redsift/pickers`
|
|
46
|
+
|
|
47
|
+
This package provides selection components. The Popover part of the Pickers comes from `@redsift/popovers`.
|
|
48
|
+
|
|
49
|
+
- `@redsift/table`
|
|
50
|
+
|
|
51
|
+
This package provides datagrid components and features based on [MUI DataGrid](https://mui.com/x/react-data-grid/). Due to the use of advanced features, a [premium license](https://mui.com/x/introduction/licensing/#premium-plan) from MUI is required.
|
|
52
|
+
|
|
53
|
+
- `@redsift/charts`
|
|
54
|
+
|
|
55
|
+
This package provides charts components. Charts are based on [d3.js](https://d3js.org/) for computation, [react](https://react.dev/) for rendering and events and [react-spring](https://www.react-spring.dev/) for animations and transitions.
|
|
56
|
+
|
|
57
|
+
- `@redsift/dashboard`
|
|
58
|
+
|
|
59
|
+
This package provides dashboard-related components and decorators to make charts and datagrid filterable using [crossfilter](https://crossfilter.github.io/crossfilter/).
|
|
60
|
+
|
|
61
|
+
- `@redsift/products`
|
|
62
|
+
|
|
63
|
+
This package provides ready-to-use implementation of components with a customize style to fit Red Sift's use cases. It is based on all other packages.
|
|
64
|
+
|
|
65
|
+
- _Deprecated_ `@redsift/design-system-legacy`
|
|
66
|
+
|
|
67
|
+
This package contains all components prior to the 6.0.0 version. These components are deprecated and contributing to this package is discouraged since it will be removed in the future.
|
|
68
|
+
|
|
69
|
+
Please make sure to work inside the correct package when making contribution.
|
|
70
|
+
|
|
71
|
+
### Shared code
|
|
72
|
+
|
|
73
|
+
If you need something inside more than one package, do not duplicate the code. Place it inside one package, export it from this package and import it inside the others.
|
|
74
|
+
|
|
75
|
+
For instance, `@redsift/dashboard` and `@redsift/charts` both have a `PieChart` component that both share the `PieChartVariant` type interface. `PieChartVariant` has been implemented inside `@redsift/charts` and is imported inside `@redsift/dashboard`.
|
|
76
|
+
|
|
77
|
+
For more convenience, add an export of this shared code in every package using it. In this example, `@redsift/dashboard` also exports `PieChartVariant`. This will make it easier for the user later.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
// Even if PieChartVariant is implemented inside the charts package, the following code is not practical
|
|
81
|
+
import { PieChartVariant } from '@redsift/charts';
|
|
82
|
+
import { PieChart } from '@redsift/dashbord';
|
|
83
|
+
|
|
84
|
+
// Reexporting it from the dashboard package makes it really easier
|
|
85
|
+
import { PieChart, PieChartVariant } from '@redsift/dashbord';
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
To define which package should contain the shared code, select the one that would not create any circular dependencies.
|
|
89
|
+
|
|
90
|
+
### Dependencies
|
|
91
|
+
|
|
92
|
+
We try to use as few dependencies as possible.
|
|
93
|
+
|
|
94
|
+
For instance, we don't want to use `lodash` or `underscore` in the Design System. See why [you don't need them](https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore) and how to work without them.
|
|
95
|
+
|
|
96
|
+
We also don't want to use `momentjs`. See why [you don't need it](https://github.com/you-dont-need/You-Dont-Need-Momentjs) and what alternatives are there.
|
|
97
|
+
|
|
98
|
+
When dependencies are required, we try not to import them entirely to optimise the tree-shaking of the Design System.
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
// don't
|
|
102
|
+
import * as d3 from 'd3';
|
|
103
|
+
|
|
104
|
+
// do
|
|
105
|
+
import { sum, scaleOrdinal } from 'd3';
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Scaffolding
|
|
109
|
+
|
|
110
|
+
Each component should be in its own folder. If a subcomponent can be used as a standalone component, it should be in its own folder too. For instance, `CheckboxGroup` uses `Checkbox` but `Checkbox` can be used alone. In this case, `CheckboxGroup` and `Checkbox` both have their own folder. For `PieChart` and `PieChartSlice`, a `PieChartSlice` can not be used alone. It only exists inside a `PieChart` component. Therefore, both components are inside the same folder.
|
|
111
|
+
|
|
112
|
+
The name of the folder shoud be in kebab-case, the names of the component files are in PascalCase and the names of others files are in kebab-case. The scaffolding should be the same for every component. For instance, for the `Badge` component, it looks like this:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
badge/
|
|
116
|
+
__snapshots__/
|
|
117
|
+
Badge.stories.tsx
|
|
118
|
+
Badge.test.tsx
|
|
119
|
+
Badge.tsx
|
|
120
|
+
index.ts
|
|
121
|
+
styles.ts
|
|
122
|
+
types.ts
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
See the Typescript section to see what to put inside the `types.ts` file.
|
|
126
|
+
|
|
127
|
+
See the Styling section to see what to put inside the `styles.ts` file.
|
|
128
|
+
|
|
129
|
+
The component should stricly follow the following structure:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
import React, { forwardRef, RefObject, useRef } from 'react';
|
|
133
|
+
import classNames from 'classnames';
|
|
134
|
+
import { Comp } from '../../types';
|
|
135
|
+
import { StyledBadge } from './styles';
|
|
136
|
+
import { BadgeProps } from './types';
|
|
137
|
+
|
|
138
|
+
const COMPONENT_NAME = 'Badge';
|
|
139
|
+
const CLASSNAME = 'redsift-badge';
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* The Badge component.
|
|
143
|
+
*/
|
|
144
|
+
export const Badge: Comp<BadgeProps, HTMLDivElement> = forwardRef((props, ref) => {
|
|
145
|
+
const {
|
|
146
|
+
// props
|
|
147
|
+
...forwardedProps
|
|
148
|
+
} = props;
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<StyledBadge
|
|
152
|
+
{...forwardedProps}
|
|
153
|
+
// transient props
|
|
154
|
+
className={classNames(Badge.className, `${Badge.className}-${variant}`, className)}
|
|
155
|
+
ref={ref as RefObject<HTMLDivElement>}
|
|
156
|
+
>
|
|
157
|
+
// content of the component if needed
|
|
158
|
+
</StyledBadge>
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
Badge.className = CLASSNAME;
|
|
162
|
+
Badge.displayName = COMPONENT_NAME;
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The main things to keep in mind here are:
|
|
166
|
+
|
|
167
|
+
- to use the custom `Comp` type,
|
|
168
|
+
- to forward ref and props,
|
|
169
|
+
- to concatenate classNames,
|
|
170
|
+
- to define default values and
|
|
171
|
+
- to use types from `types.ts` and styles from `styles.ts`.
|
|
172
|
+
|
|
173
|
+
### API
|
|
174
|
+
|
|
175
|
+
The API of the components should be consistent with other components.
|
|
176
|
+
|
|
177
|
+
For instance, `isSelected` is the dedicated name for a prop indicating whether a component is selected or not. You should not use `selected` for instance. You could even be tempted to use `checked` or `isChecked` for a Checkbox component, but even if it can feel more suitable for this particular component, it creates inconsistencies among all components.
|
|
178
|
+
|
|
179
|
+
Try to think Design System when creating the API of your component. We want to provide visual options and variants for our components, but the possibilities should be limited.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
// don't
|
|
183
|
+
innerRadius?: number;
|
|
184
|
+
outerRadius?: number;
|
|
185
|
+
height?: number;
|
|
186
|
+
width?: number;
|
|
187
|
+
|
|
188
|
+
// do
|
|
189
|
+
size?: PieChartSize;
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
To know how to define your API, to name and document your props, take a look at the existing components.
|
|
193
|
+
|
|
194
|
+
## Tests
|
|
195
|
+
|
|
196
|
+
We use [jest](https://jestjs.io/) for unit tests and [react-testing-library](https://testing-library.com/docs/react-testing-library/intro) for rendering and writing assertions. We also use [Storyshots](https://storybook.js.org/addons/@storybook/addon-storyshots) to automatically take a code snapshot of every story.
|
|
197
|
+
|
|
198
|
+
Please make sure you include tests with your pull requests. Our CI will run the tests on each PR. A minimum of 90% code coverage is required for statements, branches, functions and lines of every package. However, in practice, we try to reach a 100% code coverage.
|
|
199
|
+
|
|
200
|
+
We split the tests into 2 groups.
|
|
201
|
+
|
|
202
|
+
_Visual tests_
|
|
203
|
+
|
|
204
|
+
- A Storybook story should be written for each visual state that a component can be in (based on props).
|
|
205
|
+
|
|
206
|
+
_Unit tests_
|
|
207
|
+
|
|
208
|
+
- (Props) Anything that should be changed by a prop should be tested via react-testing-library.
|
|
209
|
+
- (Events) Anything that should trigger an event should be tested via react-testing-library.
|
|
210
|
+
|
|
211
|
+
You can run the tests with:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
yarn test
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Or for a specific package with:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
yarn test:charts
|
|
221
|
+
yarn test:design-system
|
|
222
|
+
yarn test:dashboard
|
|
223
|
+
yarn test:table
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Do not forget to update the snapshots with the `-u` option when you modify or create stories. However, you should **always** check the generated snapshots to see if they are correct. Do **not** blindly update the snapshots.
|
|
227
|
+
|
|
228
|
+
## Linting
|
|
229
|
+
|
|
230
|
+
The code is linted with [eslint](https://eslint.org/). You can run the linter with:
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
yarn lint
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
Or for a specific package with:
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
yarn lint:charts
|
|
240
|
+
yarn lint:dashboard
|
|
241
|
+
yarn lint:design-system
|
|
242
|
+
yarn lint:table
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
## TypeScript
|
|
246
|
+
|
|
247
|
+
The code is written in [TypeScript](https://www.typescriptlang.org/). The type checker will usually run in your editor, but also runs when you run:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
yarn check-types
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Or for a specific package with:
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
yarn check-types:charts
|
|
257
|
+
yarn check-types:dashboard
|
|
258
|
+
yarn check-types:design-system
|
|
259
|
+
yarn check-types:table
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Types and interfaces are implemented inside `types.ts` files. Every shared type and interface should be placed inside a `types.ts` file at the root of the `src` folder of a component.
|
|
263
|
+
|
|
264
|
+
The `types.ts` file of a component should at minima export an interface for the component itself, named using the name of the component followed by `Props` (i.e. `BadgeProps`) and extending the HTML element it is based on (i.e. `React.ComponentProps<'div'>`). It should also export an interface for the main styled components it uses, using the same name prefixed by `Styled` (i.e. `StyledBadgeProps`). The props of the main interface **must** be documented with [jsdoc](https://jsdoc.app/) comments because this will be automatically parsed to fill the prop table inside the documentation website.
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
/**
|
|
268
|
+
* Component props.
|
|
269
|
+
*/
|
|
270
|
+
export interface BadgeProps extends ComponentProps<'div'> {
|
|
271
|
+
/** Badge variant. */
|
|
272
|
+
variant?: BadgeVariant;
|
|
273
|
+
}
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
The styled component interface should be based on the main interface but omit every prop you don't want to forward to the rendered component. Every non native prop you need to use inside the styled component should be use as [transient props](https://styled-components.com/docs/api#transient-props) and therefore prefixed by a `$` character.
|
|
277
|
+
|
|
278
|
+
```ts
|
|
279
|
+
export type StyledBadgeProps = Omit<BadgeProps, 'variant'> & {
|
|
280
|
+
$variant: BadgeProps['variant'];
|
|
281
|
+
};
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
This file is also use to implement and export any other props you may need for your component like variant interface, color interface, etc.
|
|
285
|
+
|
|
286
|
+
```ts
|
|
287
|
+
/**
|
|
288
|
+
* Component variant.
|
|
289
|
+
*/
|
|
290
|
+
export const BadgeVariant = {
|
|
291
|
+
dot: 'dot',
|
|
292
|
+
standard: 'standard',
|
|
293
|
+
} as const;
|
|
294
|
+
export type BadgeVariant = ValueOf<typeof BadgeVariant>;
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
The variants, colors and all other enum-based interfaces should be implemented exactly as above to make the property compatible with both the enum values and their string equivalent values. In this example, `BadgeVariant.standard` and `"standard"` are both valid values for the `variant` prop.
|
|
298
|
+
|
|
299
|
+
## Styling
|
|
300
|
+
|
|
301
|
+
We use [styled-components](https://styled-components.com/) and [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_custom_properties) for styling. CSS variables are centralized through a [style dictionary](https://amzn.github.io/style-dictionary/#/).
|
|
302
|
+
|
|
303
|
+
The `styles.ts` of a component should contain all the styled-component codes. At least one main variable should be implemented and named using the name of the component prefixed by `Styled` (i.e. `StyledBadge`).
|
|
304
|
+
|
|
305
|
+
```ts
|
|
306
|
+
/**
|
|
307
|
+
* Component style.
|
|
308
|
+
*/
|
|
309
|
+
export const StyledBadge = styled.div<StyledBadgeProps>`
|
|
310
|
+
${({ $color }) =>
|
|
311
|
+
$color
|
|
312
|
+
? css`
|
|
313
|
+
color: var(--redsift-color-neutral-white);
|
|
314
|
+
background-color: var(--redsift-color-presentation-color-${$color}-standard);
|
|
315
|
+
`
|
|
316
|
+
: ''}
|
|
317
|
+
`;
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
Make sure you are using the same HTML element for the styled component (i.e. `styled.div`) and the type interface (i.e. `ComponentProps<'div'>`). Type your variable with the interface you created in the `types.ts` file.
|
|
321
|
+
|
|
322
|
+
Make sure to use only [transient props](https://styled-components.com/docs/api#transient-props) and to use the styled-component's `css` helper when conditionnaly creating a new CSS block.
|
|
323
|
+
|
|
324
|
+
## Accessibility
|
|
325
|
+
|
|
326
|
+
We are trying to make the Design System as accessible as possible by following the [Web Accessibility Initiative guidelines](https://www.w3.org/WAI/ARIA/apg/).
|
|
327
|
+
|
|
328
|
+
Before implementing a component, try to see if there is a [pattern](https://www.w3.org/WAI/ARIA/apg/patterns/) - or a composition of multiple patterns - that is suitable for this component and follow the guidelines.
|
|
329
|
+
|
|
330
|
+
However, before using any ARIA, [read this disclaimer carefully](https://www.w3.org/WAI/ARIA/apg/practices/read-me-first/).
|
|
331
|
+
|
|
332
|
+
## Storybook
|
|
333
|
+
|
|
334
|
+
We use [Storybook](https://storybooks.js.org) for local development. Run the following command to start it:
|
|
335
|
+
|
|
336
|
+
```bash
|
|
337
|
+
yarn start:storybook
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
Then, open [http://localhost:9000](http://localhost:9000) in your browser to play around with the components and test your changes.
|
|
341
|
+
|
|
342
|
+
You can use knobs and other storybook addons to create your stories. However, it is necessary to create stories covering all the options and variants of your component to generate snapshots.
|
|
343
|
+
|
|
344
|
+
Storybook is shared among every packages of the Design System. Follow the naming of the components that already exists in the same package to make sure it will appear in the correct section.
|
|
345
|
+
|
|
346
|
+
## Documentation
|
|
347
|
+
|
|
348
|
+
We use a [Next.js](https://nextjs.org/) app with [MDX](https://mdxjs.com/) support as a documentation and demonstration site for the Design System. This app can be run as following:
|
|
349
|
+
|
|
350
|
+
```bash
|
|
351
|
+
yarn dev:website
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
Then, open [http://localhost:3000](http://localhost:3000) in your browser.
|
|
355
|
+
|
|
356
|
+
To add documentation for a component, a MDX file should be created in the `apps/website/pages/` folder and more precisely inside the subfolder corresponding to the section the page belongs to (i.e. `apps/website/pages/forms/checkbox.mdx` for the `Checkbox` component inside the `Forms` section).
|
|
357
|
+
|
|
358
|
+
To appear in the website's Side Panel, the page should be listed in `apps/website/components/CustomAppSidePanel/CustomAppSidePanel.tsx`) under the corresponding section.
|
|
359
|
+
|
|
360
|
+
A component page should be structured as following:
|
|
361
|
+
|
|
362
|
+
- **Introduction**
|
|
363
|
+
- **Installation**: explains which package to install and how
|
|
364
|
+
- **Usage**: explains how to import the component
|
|
365
|
+
- **Example**: explains the simplest example of usage for the component
|
|
366
|
+
- **Content** (optional): explains what the component can contain, if it can (for instance, a CheckboxGroup can contain Checkboxes)
|
|
367
|
+
- **Labeling** (optional): explains how to label the component, with accessibility and internationalization concerns; should only be used when the label is the only accessibility concern for this component, if there is more, use the Accessbility section below instead
|
|
368
|
+
- **Value** (optional): explains the values and states a component can have; only used for form components
|
|
369
|
+
- **Data** (optional): explains how the data should be formatted to display the component; only used for charts, table and dashboard components
|
|
370
|
+
- **Events** (optional): explains the different events attached to the component, controlled and uncontrolled version, validation system, etc...
|
|
371
|
+
- **Accessibility** (optional): dedicated accessibility section when it goes beyond the labeling, for instance to give navigation advice, etc
|
|
372
|
+
- **Visual options**: displays all the visual options and variants of the component
|
|
373
|
+
- **Props**: displays a table of component props
|
|
374
|
+
|
|
375
|
+
To display a prop table, use the `PropsTable` component as following:
|
|
376
|
+
|
|
377
|
+
```ts
|
|
378
|
+
<PropsTable component="Button" />
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
To display a demo, first create a demo (a simple `tsx` file) in the demo folder (`apps/website/demo/`) inside a subfolder with the name of the component (i.e. `apps/website/demo/button/coloring` for a coloring demo of the `Button` component). Then use the `DemoBlock` as following:
|
|
382
|
+
|
|
383
|
+
```ts
|
|
384
|
+
<DemoBlock withThemeSwitcher path="button/coloring" />
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
To display simple code, use the `CodeBlock` as following:
|
|
388
|
+
|
|
389
|
+
```ts
|
|
390
|
+
<CodeBlock
|
|
391
|
+
codeString={`
|
|
392
|
+
yarn add @redsift/design-system
|
|
393
|
+
`}
|
|
394
|
+
language="sh"
|
|
395
|
+
/>
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
## Build
|
|
399
|
+
|
|
400
|
+
The Design System is built using [Rollup](https://rollupjs.org/guide/en/) inside the `dist` folder of each package by running the following command:
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
yarn build
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
Or for a specific package with:
|
|
407
|
+
|
|
408
|
+
```bash
|
|
409
|
+
yarn build:charts
|
|
410
|
+
yarn build:dashboard
|
|
411
|
+
yarn build:design-system
|
|
412
|
+
yarn build:icons
|
|
413
|
+
yarn build:legacy
|
|
414
|
+
yarn build:table
|
|
415
|
+
```
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
import * as _redsift_design_system from '@redsift/design-system';
|
|
4
|
+
import { Comp, ButtonProps, ItemProps, IconProps } from '@redsift/design-system';
|
|
5
|
+
import * as _redsift_pickers from '@redsift/pickers';
|
|
6
|
+
import { MenuButtonProps, MenuButtonContentProps, MenuButtonContentHeaderProps, MenuButtonContentMenuProps } from '@redsift/pickers';
|
|
7
|
+
|
|
8
|
+
declare const RadarSimple: {
|
|
9
|
+
MenuButton: _redsift_design_system.Comp<Omit<_redsift_pickers.MenuButtonProps, "children"> & {
|
|
10
|
+
title: string;
|
|
11
|
+
subtitle?: string | undefined;
|
|
12
|
+
icon?: Omit<_redsift_design_system.IconProps, "ref"> | undefined;
|
|
13
|
+
} & Pick<_redsift_pickers.MenuButtonContentMenuProps, "children">, HTMLDivElement>;
|
|
14
|
+
};
|
|
15
|
+
declare const Radar: {
|
|
16
|
+
Simple: {
|
|
17
|
+
MenuButton: _redsift_design_system.Comp<Omit<_redsift_pickers.MenuButtonProps, "children"> & {
|
|
18
|
+
title: string;
|
|
19
|
+
subtitle?: string | undefined;
|
|
20
|
+
icon?: Omit<_redsift_design_system.IconProps, "ref"> | undefined;
|
|
21
|
+
} & Pick<_redsift_pickers.MenuButtonContentMenuProps, "children">, HTMLDivElement>;
|
|
22
|
+
};
|
|
23
|
+
Button: _redsift_design_system.Comp<_redsift_design_system.ButtonProps, HTMLButtonElement>;
|
|
24
|
+
Item: _redsift_design_system.Comp<_redsift_design_system.ItemProps, HTMLDivElement>;
|
|
25
|
+
MenuButton: React.FC<_redsift_pickers.MenuButtonProps> & {
|
|
26
|
+
displayName?: string | undefined;
|
|
27
|
+
className?: string | undefined;
|
|
28
|
+
} & {
|
|
29
|
+
Trigger: _redsift_design_system.Comp<_redsift_pickers.MenuButtonTriggerProps, HTMLButtonElement>;
|
|
30
|
+
Content: _redsift_design_system.Comp<_redsift_pickers.MenuButtonContentProps, HTMLDivElement> & {
|
|
31
|
+
Header: _redsift_design_system.Comp<_redsift_pickers.MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
32
|
+
Menu: _redsift_design_system.Comp<_redsift_pickers.MenuButtonContentMenuProps, HTMLDivElement>;
|
|
33
|
+
Footer: _redsift_design_system.Comp<_redsift_pickers.MenuButtonContentFooterProps, HTMLDivElement>;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* The RadarButton component.
|
|
40
|
+
*/
|
|
41
|
+
declare const RadarButton: Comp<ButtonProps, HTMLButtonElement>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* The RadarItem component.
|
|
45
|
+
*/
|
|
46
|
+
declare const RadarItem: Comp<ItemProps, HTMLDivElement>;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The RadarMenuButton component.
|
|
50
|
+
*/
|
|
51
|
+
declare const BaseRadarMenuButton: React__default.FC<MenuButtonProps> & {
|
|
52
|
+
displayName?: string;
|
|
53
|
+
className?: string;
|
|
54
|
+
};
|
|
55
|
+
declare const RadarMenuButtonTrigger: Comp<_redsift_pickers.MenuButtonTriggerProps, HTMLButtonElement>;
|
|
56
|
+
declare const BaseRadarMenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement>;
|
|
57
|
+
declare const RadarMenuButtonContentHeader: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
58
|
+
declare const RadarMenuButtonContentMenu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
|
|
59
|
+
declare const RadarMenuButtonContentFooter: Comp<_redsift_pickers.MenuButtonContentFooterProps, HTMLDivElement>;
|
|
60
|
+
declare const RadarMenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement> & {
|
|
61
|
+
Header: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
62
|
+
Menu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
|
|
63
|
+
Footer: Comp<_redsift_pickers.MenuButtonContentFooterProps, HTMLDivElement>;
|
|
64
|
+
};
|
|
65
|
+
declare const RadarMenuButton: React__default.FC<MenuButtonProps> & {
|
|
66
|
+
displayName?: string | undefined;
|
|
67
|
+
className?: string | undefined;
|
|
68
|
+
} & {
|
|
69
|
+
Trigger: Comp<_redsift_pickers.MenuButtonTriggerProps, HTMLButtonElement>;
|
|
70
|
+
Content: Comp<MenuButtonContentProps, HTMLDivElement> & {
|
|
71
|
+
Header: Comp<MenuButtonContentHeaderProps, HTMLDivElement>;
|
|
72
|
+
Menu: Comp<MenuButtonContentMenuProps, HTMLDivElement>;
|
|
73
|
+
Footer: Comp<_redsift_pickers.MenuButtonContentFooterProps, HTMLDivElement>;
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* The RadarSimpleMenuButton component.
|
|
79
|
+
*/
|
|
80
|
+
declare const RadarSimpleMenuButton: Comp<Omit<MenuButtonProps, 'children'> & {
|
|
81
|
+
title: string;
|
|
82
|
+
subtitle?: string;
|
|
83
|
+
icon?: Omit<IconProps, 'ref'>;
|
|
84
|
+
} & Pick<MenuButtonContentMenuProps, 'children'>, HTMLDivElement>;
|
|
85
|
+
|
|
86
|
+
export { BaseRadarMenuButton, BaseRadarMenuButtonContent, Radar, RadarButton, RadarItem, RadarMenuButton, RadarMenuButtonContent, RadarMenuButtonContentFooter, RadarMenuButtonContentHeader, RadarMenuButtonContentMenu, RadarMenuButtonTrigger, RadarSimple, RadarSimpleMenuButton };
|
package/index.js
ADDED
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { Button, Item, Flexbox, Icon, Text } from '@redsift/design-system';
|
|
3
|
+
import { MenuButton, MenuButtonTrigger, MenuButtonContent, MenuButtonContentHeader, MenuButtonContentMenu, MenuButtonContentFooter } from '@redsift/pickers';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { rsiRadarSparkleWhite, rsiSparkleGradient } from '@redsift/icons';
|
|
6
|
+
|
|
7
|
+
function _extends() {
|
|
8
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
9
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
10
|
+
var source = arguments[i];
|
|
11
|
+
for (var key in source) {
|
|
12
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
13
|
+
target[key] = source[key];
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return target;
|
|
18
|
+
};
|
|
19
|
+
return _extends.apply(this, arguments);
|
|
20
|
+
}
|
|
21
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
22
|
+
if (source == null) return {};
|
|
23
|
+
var target = {};
|
|
24
|
+
var sourceKeys = Object.keys(source);
|
|
25
|
+
var key, i;
|
|
26
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
27
|
+
key = sourceKeys[i];
|
|
28
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
29
|
+
target[key] = source[key];
|
|
30
|
+
}
|
|
31
|
+
return target;
|
|
32
|
+
}
|
|
33
|
+
function _objectWithoutProperties(source, excluded) {
|
|
34
|
+
if (source == null) return {};
|
|
35
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
36
|
+
var key, i;
|
|
37
|
+
if (Object.getOwnPropertySymbols) {
|
|
38
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
39
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
40
|
+
key = sourceSymbolKeys[i];
|
|
41
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
42
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
43
|
+
target[key] = source[key];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return target;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const COMPONENT_NAME$1 = 'Button';
|
|
50
|
+
const CLASSNAME$1 = 'redsift-radar-button';
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The RadarButton component.
|
|
54
|
+
*/
|
|
55
|
+
const RadarButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
56
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
57
|
+
variant: "primary",
|
|
58
|
+
leftIcon: rsiRadarSparkleWhite,
|
|
59
|
+
color: "radar"
|
|
60
|
+
}, props, {
|
|
61
|
+
ref: ref
|
|
62
|
+
}), props.children || 'Radar');
|
|
63
|
+
});
|
|
64
|
+
RadarButton.className = CLASSNAME$1;
|
|
65
|
+
RadarButton.displayName = COMPONENT_NAME$1;
|
|
66
|
+
|
|
67
|
+
const COMPONENT_NAME = 'Item';
|
|
68
|
+
const CLASSNAME = 'redsift-radar-item';
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The RadarItem component.
|
|
72
|
+
*/
|
|
73
|
+
const RadarItem = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(Item, _extends({
|
|
74
|
+
padding: "11px 15px",
|
|
75
|
+
color: "radar",
|
|
76
|
+
hasBorder: true,
|
|
77
|
+
borderRadius: "4px"
|
|
78
|
+
}, props, {
|
|
79
|
+
ref: ref
|
|
80
|
+
})));
|
|
81
|
+
RadarItem.className = CLASSNAME;
|
|
82
|
+
RadarItem.displayName = COMPONENT_NAME;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The RadarMenuButton component.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
const BaseRadarMenuButton = props => {
|
|
89
|
+
return /*#__PURE__*/React.createElement(MenuButton, _extends({
|
|
90
|
+
offset: 0,
|
|
91
|
+
minWidth: 545,
|
|
92
|
+
color: "radar"
|
|
93
|
+
}, props));
|
|
94
|
+
};
|
|
95
|
+
BaseRadarMenuButton.displayName = 'MenuButton';
|
|
96
|
+
const RadarMenuButtonTrigger = MenuButtonTrigger;
|
|
97
|
+
RadarMenuButtonTrigger.displayName = 'MenuButtonTrigger';
|
|
98
|
+
const StyledMenuButtonContent = styled(MenuButtonContent)`
|
|
99
|
+
background: transparent;
|
|
100
|
+
background-image: linear-gradient(90deg, white, white), linear-gradient(90deg, #51b7a4, #0081c3);
|
|
101
|
+
background-clip: padding-box, border-box;
|
|
102
|
+
background-origin: border-box;
|
|
103
|
+
border: 2px solid transparent;
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
`;
|
|
106
|
+
const BaseRadarMenuButtonContent = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(StyledMenuButtonContent, _extends({}, props, {
|
|
107
|
+
ref: ref
|
|
108
|
+
})));
|
|
109
|
+
BaseRadarMenuButtonContent.displayName = 'MenuButtonContent';
|
|
110
|
+
const RadarMenuButtonContentHeader = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(MenuButtonContentHeader, _extends({
|
|
111
|
+
margin: "24px 16px 8px",
|
|
112
|
+
display: "flex",
|
|
113
|
+
flexDirection: "column",
|
|
114
|
+
gap: "8px"
|
|
115
|
+
}, props, {
|
|
116
|
+
ref: ref
|
|
117
|
+
})));
|
|
118
|
+
RadarMenuButtonContentHeader.displayName = 'MenuButtonContentHeader';
|
|
119
|
+
const RadarMenuButtonContentMenu = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/React.createElement(MenuButtonContentMenu, _extends({
|
|
120
|
+
margin: "0 16px 20px 49px",
|
|
121
|
+
width: "calc(100% - 64px)"
|
|
122
|
+
}, props, {
|
|
123
|
+
ref: ref
|
|
124
|
+
})));
|
|
125
|
+
RadarMenuButtonContentMenu.displayName = 'MenuButtonContentMenu';
|
|
126
|
+
const RadarMenuButtonContentFooter = MenuButtonContentFooter;
|
|
127
|
+
RadarMenuButtonContentFooter.displayName = 'MenuButtonContentFooter';
|
|
128
|
+
const RadarMenuButtonContent = Object.assign(BaseRadarMenuButtonContent, {
|
|
129
|
+
Header: RadarMenuButtonContentHeader,
|
|
130
|
+
Menu: RadarMenuButtonContentMenu,
|
|
131
|
+
Footer: RadarMenuButtonContentFooter
|
|
132
|
+
});
|
|
133
|
+
const RadarMenuButton = Object.assign(BaseRadarMenuButton, {
|
|
134
|
+
Trigger: RadarMenuButtonTrigger,
|
|
135
|
+
Content: RadarMenuButtonContent
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
const _excluded = ["icon", "children"];
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The RadarSimpleMenuButton component.
|
|
142
|
+
*/
|
|
143
|
+
|
|
144
|
+
const RadarSimpleMenuButton = props => {
|
|
145
|
+
const {
|
|
146
|
+
icon,
|
|
147
|
+
children
|
|
148
|
+
} = props,
|
|
149
|
+
forwardedProps = _objectWithoutProperties(props, _excluded);
|
|
150
|
+
return /*#__PURE__*/React.createElement(RadarMenuButton, forwardedProps, /*#__PURE__*/React.createElement(RadarMenuButton.Trigger, null, /*#__PURE__*/React.createElement(RadarButton, null)), /*#__PURE__*/React.createElement(RadarMenuButton.Content, null, /*#__PURE__*/React.createElement(RadarMenuButton.Content.Header, null, /*#__PURE__*/React.createElement(Flexbox, {
|
|
151
|
+
flexDirection: "row",
|
|
152
|
+
gap: "0"
|
|
153
|
+
}, /*#__PURE__*/React.createElement(Icon, _extends({
|
|
154
|
+
icon: rsiSparkleGradient,
|
|
155
|
+
size: "medium",
|
|
156
|
+
marginRight: "8px"
|
|
157
|
+
}, icon)), /*#__PURE__*/React.createElement(Text, {
|
|
158
|
+
fontSize: "20px",
|
|
159
|
+
fontWeight: "500"
|
|
160
|
+
}, "How can I help?")), /*#__PURE__*/React.createElement(Flexbox, {
|
|
161
|
+
marginLeft: "32px",
|
|
162
|
+
marginRight: "16px"
|
|
163
|
+
}, /*#__PURE__*/React.createElement(Text, {
|
|
164
|
+
fontSize: "12px"
|
|
165
|
+
}, "Based on your search here is some more help we can offer"))), /*#__PURE__*/React.createElement(RadarMenuButton.Content.Menu, null, children)));
|
|
166
|
+
};
|
|
167
|
+
RadarSimpleMenuButton.displayName = 'MenuButton';
|
|
168
|
+
|
|
169
|
+
RadarButton.displayName = 'Button';
|
|
170
|
+
RadarItem.displayName = 'Item';
|
|
171
|
+
RadarMenuButton.displayName = 'MenuButton';
|
|
172
|
+
RadarSimpleMenuButton.displayName = 'MenuButton';
|
|
173
|
+
const RadarSimple = {
|
|
174
|
+
MenuButton: RadarSimpleMenuButton
|
|
175
|
+
};
|
|
176
|
+
const Radar = {
|
|
177
|
+
Simple: RadarSimple,
|
|
178
|
+
Button: RadarButton,
|
|
179
|
+
Item: RadarItem,
|
|
180
|
+
MenuButton: RadarMenuButton
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
export { BaseRadarMenuButton, BaseRadarMenuButtonContent, Radar, RadarButton, RadarItem, RadarMenuButton, RadarMenuButtonContent, RadarMenuButtonContentFooter, RadarMenuButtonContentHeader, RadarMenuButtonContentMenu, RadarMenuButtonTrigger, RadarSimple, RadarSimpleMenuButton };
|
|
184
|
+
//# sourceMappingURL=index.js.map
|
package/index.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/components/radar-button/RadarButton.tsx","../src/components/radar-item/RadarItem.tsx","../src/components/radar-menu-button/RadarMenuButton.tsx","../src/components/radar-menu-button/RadarSimpleMenuButton.tsx","../src/components/radar/index.ts"],"sourcesContent":["import React, { forwardRef } from 'react';\n\nimport { Button, Comp, ButtonProps } from '@redsift/design-system';\nimport { rsiRadarSparkleWhite } from '@redsift/icons';\n\nconst COMPONENT_NAME = 'Button';\nconst CLASSNAME = 'redsift-radar-button';\n\n/**\n * The RadarButton component.\n */\nexport const RadarButton: Comp<ButtonProps, HTMLButtonElement> = forwardRef((props, ref) => {\n return (\n <Button variant=\"primary\" leftIcon={rsiRadarSparkleWhite} color=\"radar\" {...props} ref={ref}>\n {props.children || 'Radar'}\n </Button>\n );\n});\nRadarButton.className = CLASSNAME;\nRadarButton.displayName = COMPONENT_NAME;\n","import React, { forwardRef } from 'react';\n\nimport { Item, Comp, ItemProps } from '@redsift/design-system';\n\nconst COMPONENT_NAME = 'Item';\nconst CLASSNAME = 'redsift-radar-item';\n\n/**\n * The RadarItem component.\n */\nexport const RadarItem: Comp<ItemProps, HTMLDivElement> = forwardRef((props, ref) => (\n <Item padding=\"11px 15px\" color=\"radar\" hasBorder borderRadius=\"4px\" {...props} ref={ref} />\n));\nRadarItem.className = CLASSNAME;\nRadarItem.displayName = COMPONENT_NAME;\n","import React from 'react';\nimport {\n MenuButton,\n MenuButtonContent,\n MenuButtonContentProps,\n MenuButtonTrigger,\n MenuButtonContentFooter,\n MenuButtonContentHeaderProps,\n MenuButtonContentHeader,\n MenuButtonContentMenuProps,\n MenuButtonContentMenu,\n MenuButtonProps,\n} from '@redsift/pickers';\nimport { Comp } from '@redsift/design-system';\nimport { forwardRef } from 'react';\nimport styled from 'styled-components';\n\n/**\n * The RadarMenuButton component.\n */\n\nexport const BaseRadarMenuButton: React.FC<MenuButtonProps> & {\n displayName?: string;\n className?: string;\n} = (props) => {\n return <MenuButton offset={0} minWidth={545} color=\"radar\" {...props} />;\n};\nBaseRadarMenuButton.displayName = 'MenuButton';\n\nexport const RadarMenuButtonTrigger = MenuButtonTrigger;\nRadarMenuButtonTrigger.displayName = 'MenuButtonTrigger';\n\nconst StyledMenuButtonContent = styled(MenuButtonContent)`\n background: transparent;\n background-image: linear-gradient(90deg, white, white), linear-gradient(90deg, #51b7a4, #0081c3);\n background-clip: padding-box, border-box;\n background-origin: border-box;\n border: 2px solid transparent;\n border-radius: 4px;\n`;\n\nexport const BaseRadarMenuButtonContent: Comp<MenuButtonContentProps, HTMLDivElement> = forwardRef((props, ref) => (\n <StyledMenuButtonContent {...props} ref={ref} />\n));\nBaseRadarMenuButtonContent.displayName = 'MenuButtonContent';\n\nexport const RadarMenuButtonContentHeader: Comp<MenuButtonContentHeaderProps, HTMLDivElement> = forwardRef(\n (props, ref) => (\n <MenuButtonContentHeader\n margin=\"24px 16px 8px\"\n display=\"flex\"\n flexDirection=\"column\"\n gap=\"8px\"\n {...props}\n ref={ref}\n />\n )\n);\nRadarMenuButtonContentHeader.displayName = 'MenuButtonContentHeader';\n\nexport const RadarMenuButtonContentMenu: Comp<MenuButtonContentMenuProps, HTMLDivElement> = forwardRef((props, ref) => (\n <MenuButtonContentMenu margin=\"0 16px 20px 49px\" width=\"calc(100% - 64px)\" {...props} ref={ref} />\n));\nRadarMenuButtonContentMenu.displayName = 'MenuButtonContentMenu';\n\nexport const RadarMenuButtonContentFooter = MenuButtonContentFooter;\nRadarMenuButtonContentFooter.displayName = 'MenuButtonContentFooter';\n\nexport const RadarMenuButtonContent = Object.assign(BaseRadarMenuButtonContent, {\n Header: RadarMenuButtonContentHeader,\n Menu: RadarMenuButtonContentMenu,\n Footer: RadarMenuButtonContentFooter,\n});\n\nexport const RadarMenuButton = Object.assign(BaseRadarMenuButton, {\n Trigger: RadarMenuButtonTrigger,\n Content: RadarMenuButtonContent,\n});\n","import React from 'react';\nimport { MenuButtonContentMenuProps, MenuButtonProps } from '@redsift/pickers';\nimport { Comp, Flexbox, Icon, IconProps, Text } from '@redsift/design-system';\nimport { rsiSparkleGradient } from '@redsift/icons';\nimport { RadarButton } from '../radar-button';\nimport { RadarMenuButton } from './RadarMenuButton';\n\n/**\n * The RadarSimpleMenuButton component.\n */\n\nexport const RadarSimpleMenuButton: Comp<\n Omit<MenuButtonProps, 'children'> & { title: string; subtitle?: string; icon?: Omit<IconProps, 'ref'> } & Pick<\n MenuButtonContentMenuProps,\n 'children'\n >,\n HTMLDivElement\n> = (props) => {\n const { icon, children, ...forwardedProps } = props;\n\n return (\n <RadarMenuButton {...forwardedProps}>\n <RadarMenuButton.Trigger>\n <RadarButton />\n </RadarMenuButton.Trigger>\n <RadarMenuButton.Content>\n <RadarMenuButton.Content.Header>\n <Flexbox flexDirection=\"row\" gap=\"0\">\n <Icon icon={rsiSparkleGradient} size=\"medium\" marginRight=\"8px\" {...icon} />\n <Text fontSize=\"20px\" fontWeight=\"500\">\n How can I help?\n </Text>\n </Flexbox>\n <Flexbox marginLeft=\"32px\" marginRight=\"16px\">\n <Text fontSize=\"12px\">Based on your search here is some more help we can offer</Text>\n </Flexbox>\n </RadarMenuButton.Content.Header>\n <RadarMenuButton.Content.Menu>{children}</RadarMenuButton.Content.Menu>\n </RadarMenuButton.Content>\n </RadarMenuButton>\n );\n};\nRadarSimpleMenuButton.displayName = 'MenuButton';\n","import { RadarButton } from '../radar-button';\nimport { RadarItem } from '../radar-item';\nimport { RadarMenuButton, RadarSimpleMenuButton } from '../radar-menu-button';\n\nRadarButton.displayName = 'Button';\nRadarItem.displayName = 'Item';\nRadarMenuButton.displayName = 'MenuButton';\nRadarSimpleMenuButton.displayName = 'MenuButton';\n\nexport const RadarSimple = {\n MenuButton: RadarSimpleMenuButton,\n};\n\nexport const Radar = {\n Simple: RadarSimple,\n Button: RadarButton,\n Item: RadarItem,\n MenuButton: RadarMenuButton,\n};\n"],"names":["COMPONENT_NAME","CLASSNAME","RadarButton","forwardRef","props","ref","React","createElement","Button","_extends","variant","leftIcon","rsiRadarSparkleWhite","color","children","className","displayName","RadarItem","Item","padding","hasBorder","borderRadius","BaseRadarMenuButton","MenuButton","offset","minWidth","RadarMenuButtonTrigger","MenuButtonTrigger","StyledMenuButtonContent","styled","MenuButtonContent","BaseRadarMenuButtonContent","RadarMenuButtonContentHeader","MenuButtonContentHeader","margin","display","flexDirection","gap","RadarMenuButtonContentMenu","MenuButtonContentMenu","width","RadarMenuButtonContentFooter","MenuButtonContentFooter","RadarMenuButtonContent","Object","assign","Header","Menu","Footer","RadarMenuButton","Trigger","Content","RadarSimpleMenuButton","icon","forwardedProps","_objectWithoutProperties","_excluded","Flexbox","Icon","rsiSparkleGradient","size","marginRight","Text","fontSize","fontWeight","marginLeft","RadarSimple","Radar","Simple"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAMA,gBAAc,GAAG,QAAQ,CAAA;AAC/B,MAAMC,WAAS,GAAG,sBAAsB,CAAA;;AAExC;AACA;AACA;AACO,MAAMC,WAAiD,gBAAGC,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": "https://github.com/redsift/design-system/issues"
|
|
7
|
+
},
|
|
8
|
+
"description": "Library providing hands-on implementation of components from Red Sift's Design System to fit their use cases.",
|
|
9
|
+
"homepage": "https://github.com/redsift/design-system",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"main": "index.js",
|
|
12
|
+
"module": "index.js",
|
|
13
|
+
"name": "@redsift/products",
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"directory": "dist"
|
|
16
|
+
},
|
|
17
|
+
"repository": {
|
|
18
|
+
"type": "git",
|
|
19
|
+
"url": "git+https://github.com/redsift/design-system"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "rollup -c",
|
|
24
|
+
"check-types": "tsc && tsc-strict",
|
|
25
|
+
"lint": "eslint --ext .js,.jsx,.ts,.tsx src/",
|
|
26
|
+
"prepare": "install-peers || exit 0",
|
|
27
|
+
"prepublishOnly": "yarn build",
|
|
28
|
+
"test:unit": "NODE_ENV=test jest --verbose",
|
|
29
|
+
"test:storybook": "test-storybook -c ../../.storybook --url http://localhost:9000/ --coverage",
|
|
30
|
+
"test": "yarn test:unit && yarn test:storybook"
|
|
31
|
+
},
|
|
32
|
+
"types": "index.d.ts",
|
|
33
|
+
"version": "10.3.0-alpha.10",
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@redsift/design-system": "^10.3.0-alpha.10",
|
|
36
|
+
"@redsift/icons": "^10.3.0-alpha.10",
|
|
37
|
+
"@redsift/pickers": "^10.3.0-alpha.10",
|
|
38
|
+
"classnames": "^2.3.1",
|
|
39
|
+
"styled-components": "^5.3.5"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@babel/core": "^7.8.3",
|
|
43
|
+
"@babel/plugin-proposal-class-properties": "^7.16.7",
|
|
44
|
+
"@babel/plugin-proposal-export-default-from": "^7.16.7",
|
|
45
|
+
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.16.7",
|
|
46
|
+
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
|
|
47
|
+
"@babel/plugin-proposal-optional-chaining": "^7.16.7",
|
|
48
|
+
"@babel/plugin-proposal-private-methods": "^7.16.11",
|
|
49
|
+
"@babel/plugin-proposal-private-property-in-object": "^7.16.7",
|
|
50
|
+
"@babel/preset-env": "^7.17.10",
|
|
51
|
+
"@babel/preset-react": "^7.17.12",
|
|
52
|
+
"@babel/preset-typescript": "^7.16.7",
|
|
53
|
+
"@rollup/plugin-babel": "^6.0.2",
|
|
54
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
55
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
56
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
57
|
+
"@svgr/rollup": "^6.2.1",
|
|
58
|
+
"@testing-library/dom": "^8.5.0",
|
|
59
|
+
"@testing-library/jest-dom": "^5.16.4",
|
|
60
|
+
"@testing-library/react": "^13.4.0",
|
|
61
|
+
"@testing-library/user-event": "14.2.1",
|
|
62
|
+
"@types/jest": "^27.5.1",
|
|
63
|
+
"@types/react": "18.0.12",
|
|
64
|
+
"@types/react-dom": "18.0.5",
|
|
65
|
+
"@types/react-transition-group": "^4.4.5",
|
|
66
|
+
"@types/styled-components": "^5.1.25",
|
|
67
|
+
"@typescript-eslint/eslint-plugin": "^5.48.0",
|
|
68
|
+
"@typescript-eslint/parser": "^5.26.0",
|
|
69
|
+
"autoprefixer": "^9.7.4",
|
|
70
|
+
"babel-plugin-require-context-hook": "^1.0.0",
|
|
71
|
+
"changelog-verify": "^1.1.2",
|
|
72
|
+
"identity-obj-proxy": "^3.0.0",
|
|
73
|
+
"install-peers-cli": "^2.2.0",
|
|
74
|
+
"jest": "^28.1.0",
|
|
75
|
+
"jest-environment-jsdom": "^29.3.0",
|
|
76
|
+
"react": "18.2.0",
|
|
77
|
+
"react-dom": "18.2.0",
|
|
78
|
+
"rollup": "^2.72.1",
|
|
79
|
+
"rollup-plugin-analyzer": "^4.0.0",
|
|
80
|
+
"rollup-plugin-auto-external": "^2.0.0",
|
|
81
|
+
"rollup-plugin-cleaner": "^1.0.0",
|
|
82
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
83
|
+
"rollup-plugin-dts": "^5.0.0",
|
|
84
|
+
"rollup-plugin-execute": "^1.1.0",
|
|
85
|
+
"rollup-plugin-svg": "^2.0.0",
|
|
86
|
+
"rollup-plugin-ts-paths-resolve": "^1.7.1",
|
|
87
|
+
"rollup-plugin-typescript-paths": "^1.3.1",
|
|
88
|
+
"ts-jest": "^28.0.3"
|
|
89
|
+
},
|
|
90
|
+
"peerDependencies": {
|
|
91
|
+
"@redsift/design-system": "^10.3.0-0",
|
|
92
|
+
"@redsift/icons": "^10.3.0-0",
|
|
93
|
+
"@redsift/pickers": "^10.3.0-0",
|
|
94
|
+
"react": ">=17",
|
|
95
|
+
"react-dom": ">=17",
|
|
96
|
+
"styled-components": "^5.3.5"
|
|
97
|
+
},
|
|
98
|
+
"gitHead": "df5c2f525b5fe807f878b52bb87efe55ce5a320a"
|
|
99
|
+
}
|