@purple/phoenix-components 4.15.0 → 4.18.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/dist/index.d.ts CHANGED
@@ -1,22 +1,67 @@
1
1
  import * as React$1 from 'react';
2
- import React__default, { InputHTMLAttributes, ReactElement, JSXElementConstructor, HTMLAttributes, MouseEventHandler, FocusEventHandler, TextareaHTMLAttributes } from 'react';
2
+ import React__default, { HTMLAttributes, InputHTMLAttributes, ReactElement, JSXElementConstructor, MouseEventHandler, FocusEventHandler, TextareaHTMLAttributes } from 'react';
3
+ import * as styled_components from 'styled-components';
4
+ import { IntrinsicElementsKeys } from 'styled-components';
5
+ import { LayoutProps, FlexboxProps, GridProps, BackgroundColorProps, BackgroundProps, OpacityProps, PositionProps } from 'styled-system';
3
6
  import { DayPickerProps } from 'react-day-picker';
4
7
  import { Props } from 'tippy.js';
5
8
  import { OptionTypeBase, NamedProps } from 'react-select';
6
9
  import { TippyProps } from '@tippyjs/react';
7
10
  export { TabPanel, Tabs } from 'react-tabs';
8
- import * as styled_components from 'styled-components';
9
11
 
10
12
  declare type GenericComponentProps = {
11
13
  testId?: string;
12
14
  className?: string;
13
15
  };
14
16
 
17
+ declare const Spacing: readonly ["xxxs", "xxs", "xs", "s", "m", "l", "xl", "xxl", "xxxl"];
18
+ declare type Spacing = typeof Spacing[number];
19
+
20
+ interface MarginProps {
21
+ ml?: Spacing | string | number;
22
+ mr?: Spacing | string | number;
23
+ mt?: Spacing | string | number;
24
+ mb?: Spacing | string | number;
25
+ mx?: Spacing | string | number;
26
+ my?: Spacing | string | number;
27
+ m?: Spacing | string | number;
28
+ }
29
+
30
+ interface PaddingProps {
31
+ pl?: Spacing | string | number;
32
+ pr?: Spacing | string | number;
33
+ pt?: Spacing | string | number;
34
+ pb?: Spacing | string | number;
35
+ px?: Spacing | string | number;
36
+ py?: Spacing | string | number;
37
+ p?: Spacing | string | number;
38
+ }
39
+
15
40
  declare const ColorTheme: readonly ["primary", "success", "warning", "error", "info", "neutral"];
16
41
  declare type ColorTheme = typeof ColorTheme[number];
17
42
  declare const ButtonColorTheme: readonly ["primary", "success", "error", "neutral"];
18
43
  declare type ButtonColorTheme = typeof ButtonColorTheme[number];
19
44
 
45
+ declare const TextAlignment: readonly ["left", "center", "right", "justify"];
46
+ declare type TextAlignment = typeof TextAlignment[number];
47
+
48
+ declare const TextColor: readonly ["darkest", "dark", "light", "lightest", "white"];
49
+ declare type TextColor = typeof TextColor[number];
50
+
51
+ interface CommonTextProps<T> extends HTMLAttributes<T>, GenericComponentProps, TextAlignProp {
52
+ colorTheme?: ColorTheme;
53
+ color?: TextColor;
54
+ bold?: boolean;
55
+ }
56
+ interface TextAlignProp {
57
+ textAlign?: TextAlignment;
58
+ }
59
+
60
+ interface BoxProps extends Omit<HTMLAttributes<HTMLDivElement>, 'color'>, LayoutProps, FlexboxProps, GridProps, MarginProps, PaddingProps, BackgroundColorProps, BackgroundProps, OpacityProps, PositionProps, TextAlignProp, GenericComponentProps {
61
+ element?: IntrinsicElementsKeys;
62
+ }
63
+ declare const Box: React__default.FC<BoxProps>;
64
+
20
65
  declare const ComponentSize: readonly ["tiny", "small", "medium", "large"];
21
66
  declare type ComponentSize = typeof ComponentSize[number];
22
67
  declare const ComponentSizeSmallMedium: readonly ["small", "medium"];
@@ -197,28 +242,15 @@ declare const PhoenixIconsSrc: {
197
242
  readonly withdrawal: string;
198
243
  readonly wrench: string;
199
244
  };
200
- declare const PhoenixIconsOutlined: ("filter" | "actions" | "add-circle" | "android" | "angled-arrow-left" | "angled-arrow-right" | "apple" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "asterisk" | "browser" | "burger" | "calendar" | "camera" | "check" | "check-circle" | "clock" | "cog" | "copy" | "cross" | "deposit" | "document" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "dots-handle-reorder" | "download" | "edit" | "ellipsis" | "email" | "exclamation" | "exit" | "external" | "forward-arrow" | "gift" | "history" | "house" | "id-card" | "info-circle" | "language" | "list" | "lock" | "paper" | "passport" | "photo-user" | "pin" | "play-circle" | "profile" | "question-circle" | "refresh" | "revert" | "scales" | "search" | "star" | "star-circle" | "stopwatch" | "subtract-circle" | "times-circle" | "transfer" | "trash" | "upload" | "windows" | "withdrawal" | "wrench")[];
245
+ declare const PhoenixIconsOutlined: ("filter" | "revert" | "document" | "list" | "search" | "email" | "copy" | "download" | "actions" | "add-circle" | "android" | "angled-arrow-left" | "angled-arrow-right" | "apple" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "asterisk" | "browser" | "burger" | "calendar" | "camera" | "check" | "check-circle" | "clock" | "cog" | "cross" | "deposit" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "dots-handle-reorder" | "edit" | "ellipsis" | "exclamation" | "exit" | "external" | "forward-arrow" | "gift" | "history" | "house" | "id-card" | "info-circle" | "language" | "lock" | "paper" | "passport" | "photo-user" | "pin" | "play-circle" | "profile" | "question-circle" | "refresh" | "scales" | "star" | "star-circle" | "stopwatch" | "subtract-circle" | "times-circle" | "transfer" | "trash" | "upload" | "windows" | "withdrawal" | "wrench")[];
201
246
  declare type PhoenixIconsOutlined = keyof typeof PhoenixIconsOutlinedSrc;
202
247
  declare const PhoenixIconsColored: ("calendar-primary" | "camera-primary" | "email-primary" | "exclamation-error" | "exclamation-warning" | "house-primary" | "id-card-primary" | "lock-primary" | "lock-success" | "paper-primary" | "passport-primary" | "photo-user-primary" | "pin-primary" | "trash-error")[];
203
248
  declare type PhoenixIconsColored = keyof typeof PhoenixIconsColoredSrc;
204
- declare const PhoenixIcons: ("filter" | "actions" | "add-circle" | "android" | "angled-arrow-left" | "angled-arrow-right" | "apple" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "asterisk" | "browser" | "burger" | "calendar" | "camera" | "check" | "check-circle" | "clock" | "cog" | "copy" | "cross" | "deposit" | "document" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "dots-handle-reorder" | "download" | "edit" | "ellipsis" | "email" | "exclamation" | "exit" | "external" | "forward-arrow" | "gift" | "history" | "house" | "id-card" | "info-circle" | "language" | "list" | "lock" | "paper" | "passport" | "photo-user" | "pin" | "play-circle" | "profile" | "question-circle" | "refresh" | "revert" | "scales" | "search" | "star" | "star-circle" | "stopwatch" | "subtract-circle" | "times-circle" | "transfer" | "trash" | "upload" | "windows" | "withdrawal" | "wrench" | "calendar-primary" | "camera-primary" | "email-primary" | "exclamation-error" | "exclamation-warning" | "house-primary" | "id-card-primary" | "lock-primary" | "lock-success" | "paper-primary" | "passport-primary" | "photo-user-primary" | "pin-primary" | "trash-error")[];
249
+ declare const PhoenixIcons: ("filter" | "revert" | "document" | "list" | "search" | "email" | "copy" | "download" | "actions" | "add-circle" | "android" | "angled-arrow-left" | "angled-arrow-right" | "apple" | "arrow-down" | "arrow-left" | "arrow-right" | "arrow-up" | "asterisk" | "browser" | "burger" | "calendar" | "camera" | "check" | "check-circle" | "clock" | "cog" | "cross" | "deposit" | "chevron-down" | "chevron-left" | "chevron-right" | "chevron-up" | "dots-handle-reorder" | "edit" | "ellipsis" | "exclamation" | "exit" | "external" | "forward-arrow" | "gift" | "history" | "house" | "id-card" | "info-circle" | "language" | "lock" | "paper" | "passport" | "photo-user" | "pin" | "play-circle" | "profile" | "question-circle" | "refresh" | "scales" | "star" | "star-circle" | "stopwatch" | "subtract-circle" | "times-circle" | "transfer" | "trash" | "upload" | "windows" | "withdrawal" | "wrench" | "calendar-primary" | "camera-primary" | "email-primary" | "exclamation-error" | "exclamation-warning" | "house-primary" | "id-card-primary" | "lock-primary" | "lock-success" | "paper-primary" | "passport-primary" | "photo-user-primary" | "pin-primary" | "trash-error")[];
205
250
  declare type PhoenixIcons = keyof typeof PhoenixIconsSrc;
206
251
 
207
252
  declare type IconType = PhoenixIconsOutlined | React.ReactElement | string;
208
253
 
209
- declare const Spacing: readonly ["xxxs", "xxs", "xs", "s", "m", "l", "xl", "xxl", "xxxl"];
210
- declare type Spacing = typeof Spacing[number];
211
-
212
- interface MarginProps {
213
- ml?: Spacing | string | number;
214
- mr?: Spacing | string | number;
215
- mt?: Spacing | string | number;
216
- mb?: Spacing | string | number;
217
- mx?: Spacing | string | number;
218
- my?: Spacing | string | number;
219
- m?: Spacing | string | number;
220
- }
221
-
222
254
  interface CommonButtonProps extends MarginProps {
223
255
  colorTheme?: ButtonColorTheme;
224
256
  size?: ComponentSize;
@@ -239,20 +271,10 @@ interface ButtonGroupProps extends GenericComponentProps {
239
271
  }
240
272
  declare const ButtonGroup: React__default.FC<ButtonGroupProps>;
241
273
 
242
- interface PaddingProps {
243
- pl?: Spacing | string | number;
244
- pr?: Spacing | string | number;
245
- pt?: Spacing | string | number;
246
- pb?: Spacing | string | number;
247
- px?: Spacing | string | number;
248
- py?: Spacing | string | number;
249
- p?: Spacing | string | number;
250
- }
251
-
252
274
  interface CardProps extends PaddingProps, MarginProps, GenericComponentProps {
253
275
  elevated?: boolean;
254
276
  disabled?: boolean;
255
- onClick?: () => void;
277
+ onClick?: React__default.MouseEventHandler<HTMLDivElement>;
256
278
  }
257
279
  declare const Card: React__default.FC<CardProps>;
258
280
 
@@ -267,12 +289,12 @@ declare type CheckboxProps = CheckboxRadioCommonProps;
267
289
  declare const Checkbox: React__default.VoidFunctionComponent<CheckboxProps>;
268
290
 
269
291
  interface ClosableButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElement>, GenericComponentProps {
270
- onClose?: () => void;
292
+ onClose?: React__default.MouseEventHandler<HTMLButtonElement>;
271
293
  }
272
294
  declare const ClosableButton: React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<ClosableButtonProps> & React__default.RefAttributes<HTMLButtonElement>>;
273
295
 
274
296
  interface ClosableItemProps extends GenericComponentProps {
275
- onClose?: () => void;
297
+ onClose?: React__default.MouseEventHandler<HTMLButtonElement>;
276
298
  }
277
299
  declare const ClosableItem: React__default.FC<ClosableItemProps>;
278
300
 
@@ -283,6 +305,7 @@ declare const Collapsible: React$1.FC<CollapsibleProps>;
283
305
 
284
306
  interface CollapsibleCardProps extends CardProps, GenericComponentProps {
285
307
  heading: string;
308
+ rightContent?: React$1.ReactNode;
286
309
  }
287
310
  declare const CollapsibleCard: React$1.FC<CollapsibleCardProps>;
288
311
 
@@ -369,14 +392,9 @@ interface FileUploadProps extends GenericComponentProps {
369
392
  }
370
393
  declare const FileUpload: React__default.FC<FileUploadProps>;
371
394
 
372
- declare const TextColor: readonly ["darkest", "dark", "light", "lightest", "white"];
373
- declare type TextColor = typeof TextColor[number];
395
+ declare const Flex: React__default.FC<BoxProps>;
374
396
 
375
- interface CommonTextProps<T> extends HTMLAttributes<T>, GenericComponentProps {
376
- colorTheme?: ColorTheme;
377
- color?: TextColor;
378
- bold?: boolean;
379
- }
397
+ declare const Grid: React__default.FC<BoxProps>;
380
398
 
381
399
  declare type HeadingSizes = 'h1' | 'h2' | 'h3' | 'h4';
382
400
  interface HeadingProps extends CommonTextProps<HTMLHeadingElement>, PaddingProps, MarginProps {
@@ -402,9 +420,13 @@ declare const Icon: React__default.ForwardRefExoticComponent<React__default.Prop
402
420
  declare type LabelProps = React__default.LabelHTMLAttributes<HTMLLabelElement> & GenericComponentProps;
403
421
  declare const Label: React__default.FC<LabelProps>;
404
422
 
405
- interface LinkProps extends React__default.AnchorHTMLAttributes<HTMLAnchorElement>, GenericComponentProps {
423
+ interface LinkProps extends React__default.AnchorHTMLAttributes<HTMLAnchorElement>, GenericComponentProps, MarginProps, PaddingProps {
406
424
  icon?: IconType;
407
425
  iconAlignment?: IconAlignment;
426
+ colorTheme?: ColorTheme;
427
+ color?: TextColor;
428
+ bold?: boolean;
429
+ noUnderline?: boolean;
408
430
  }
409
431
  declare const Link: React__default.ForwardRefExoticComponent<React__default.PropsWithoutRef<LinkProps> & React__default.RefAttributes<HTMLAnchorElement>>;
410
432
 
@@ -422,11 +444,21 @@ interface MenuItemProps extends GenericComponentProps {
422
444
  target?: string;
423
445
  href?: string;
424
446
  onClick?: MouseEventHandler<HTMLAnchorElement>;
425
- icon?: IconType;
447
+ icon?: IconType | PhoenixIconsColored;
426
448
  colorTheme?: ColorTheme;
427
449
  }
428
450
  declare const MenuItem: React__default.FC<MenuItemProps>;
429
451
 
452
+ interface ModalProps extends GenericComponentProps, PaddingProps, MarginProps {
453
+ open: boolean;
454
+ onClose: () => void;
455
+ showCloseButton?: boolean;
456
+ size?: ComponentSize;
457
+ animate?: boolean;
458
+ center?: boolean;
459
+ }
460
+ declare const Modal: React__default.FC<ModalProps>;
461
+
430
462
  declare type SubRange = number | [number] | [number, number];
431
463
  interface CommonSliderProps extends GenericComponentProps {
432
464
  range: {
@@ -759,6 +791,17 @@ declare const prefixedTheme: {
759
791
  h4: number;
760
792
  };
761
793
  };
794
+ modal: {
795
+ zIndex: number;
796
+ overlayBackground: string;
797
+ windowShadow: string;
798
+ size: {
799
+ tiny: number;
800
+ small: number;
801
+ medium: number;
802
+ large: number;
803
+ };
804
+ };
762
805
  multiSelect: {
763
806
  multiValueLabel: {
764
807
  paddingX: {
@@ -822,4 +865,4 @@ declare const prefixedTheme: {
822
865
 
823
866
  declare const GlobalStyles: styled_components.GlobalStyleComponent<{}, styled_components.DefaultTheme>;
824
867
 
825
- export { Button, ButtonColorTheme, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, Checkbox, CheckboxProps, ClosableButton, ClosableButtonProps, ClosableItem, ClosableItemProps, Collapsible, CollapsibleCard, CollapsibleCardProps, CollapsibleProps, ColorTheme, ComponentSize, ComponentSizeMediumLarge, ComponentSizeSmallMedium, ComponentSizeSmallMediumLarge, DateInput, DateInputProps, DatePicker, DatePickerProps, DateRangePicker, DateRangePickerProps, DateRangeValue, DateValue, Dropdown, DropdownProps, FileUpload, FileUploadProps, FileWithPreview, GlobalStyles, Heading, HeadingProps, HeadingSizes, HorizontalDivider, HorizontalDividerProps, Icon, IconAlignment, IconProps, IconType, Label, LabelProps, Link, LinkButton, LinkButtonProps, LinkProps, Menu, MenuDivider, MenuItem, MenuItemProps, MenuProps, MultiSlider, MultiSliderProps, MultiSliderValue, Notice, NoticeProps, Paragraph, ParagraphProps, PhoenixIcons, PhoenixIconsColored, PhoenixIconsColoredSrc, PhoenixIconsOutlined, PhoenixIconsOutlinedSrc, PhoenixIconsSrc, Radio, RadioProps, Select, SelectNative, SelectNativeProps, SelectOption, SelectPicker, SelectPickerOption, SelectPickerProps, SelectProps, Slider, SliderProps, SliderValue, Spacer, SpacerProps, Spacing, Spinner, SpinnerProps, Tab, TabFunctionProps, TabList, TabListProps, TabProps, Tag, TagProps, Text, TextArea, TextAreaProps, TextColor, TextInput, TextInputProps, TextProps, prefixedTheme as Theme, TimezonePicker, TimezonePickerProps, Tooltip, TooltipProps, getOptions as getTimezoneOptions };
868
+ export { Box, BoxProps, Button, ButtonColorTheme, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, Checkbox, CheckboxProps, ClosableButton, ClosableButtonProps, ClosableItem, ClosableItemProps, Collapsible, CollapsibleCard, CollapsibleCardProps, CollapsibleProps, ColorTheme, ComponentSize, ComponentSizeMediumLarge, ComponentSizeSmallMedium, ComponentSizeSmallMediumLarge, DateInput, DateInputProps, DatePicker, DatePickerProps, DateRangePicker, DateRangePickerProps, DateRangeValue, DateValue, Dropdown, DropdownProps, FileUpload, FileUploadProps, FileWithPreview, Flex, GlobalStyles, Grid, Heading, HeadingProps, HeadingSizes, HorizontalDivider, HorizontalDividerProps, Icon, IconAlignment, IconProps, IconType, Label, LabelProps, Link, LinkButton, LinkButtonProps, LinkProps, Menu, MenuDivider, MenuItem, MenuItemProps, MenuProps, Modal, ModalProps, MultiSlider, MultiSliderProps, MultiSliderValue, Notice, NoticeProps, Paragraph, ParagraphProps, PhoenixIcons, PhoenixIconsColored, PhoenixIconsColoredSrc, PhoenixIconsOutlined, PhoenixIconsOutlinedSrc, PhoenixIconsSrc, Radio, RadioProps, Select, SelectNative, SelectNativeProps, SelectOption, SelectPicker, SelectPickerOption, SelectPickerProps, SelectProps, Slider, SliderProps, SliderValue, Spacer, SpacerProps, Spacing, Spinner, SpinnerProps, Tab, TabFunctionProps, TabList, TabListProps, TabProps, Tag, TagProps, Text, TextArea, TextAreaProps, TextColor, TextInput, TextInputProps, TextProps, prefixedTheme as Theme, TimezonePicker, TimezonePickerProps, Tooltip, TooltipProps, getOptions as getTimezoneOptions };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purple/phoenix-components",
3
- "version": "4.15.0",
3
+ "version": "4.18.0",
4
4
  "description": "",
5
5
  "main": "dist/bundle.umd.js",
6
6
  "module": "dist/bundle.esm.js",
@@ -60,7 +60,8 @@
60
60
  "react-inlinesvg": "~2.3.0",
61
61
  "react-pdf": "~5.3.2",
62
62
  "react-select": "~4.3.1",
63
- "react-tabs": "~3.2.2"
63
+ "react-tabs": "~3.2.2",
64
+ "styled-system": "~5.1.5"
64
65
  },
65
66
  "peerDependencies": {
66
67
  "react": ">=16.3",
@@ -68,15 +69,11 @@
68
69
  "styled-components": "^5.1.0"
69
70
  },
70
71
  "devDependencies": {
71
- "jest": "^27.2.4",
72
- "@babel/preset-typescript": "^7.15.0",
73
- "@types/jest": "^27.0.2",
74
- "@testing-library/jest-dom": "^5.14.1",
75
- "@testing-library/react": "^12.1.2",
76
72
  "@babel/cli": "^7.4.4",
77
73
  "@babel/core": "^7.4.4",
78
74
  "@babel/preset-env": "^7.4.4",
79
75
  "@babel/preset-react": "^7.0.0",
76
+ "@babel/preset-typescript": "^7.15.0",
80
77
  "@commitlint/cli": "^12.1.4",
81
78
  "@commitlint/config-conventional": "^12.1.4",
82
79
  "@percy/storybook": "^3.3.1",
@@ -84,15 +81,18 @@
84
81
  "@rollup/plugin-node-resolve": "^13.0.4",
85
82
  "@rollup/plugin-typescript": "^8.2.1",
86
83
  "@rollup/plugin-url": "^6.0.0",
87
- "@storybook/addon-links": "^6.3.9",
88
84
  "@storybook/addon-a11y": "^6.3.8",
89
85
  "@storybook/addon-docs": "^6.3.8",
90
86
  "@storybook/addon-essentials": "^6.3.8",
87
+ "@storybook/addon-links": "^6.3.9",
91
88
  "@storybook/addon-viewport": "^6.3.8",
92
89
  "@storybook/client-api": "^6.3.8",
93
90
  "@storybook/react": "^6.3.8",
94
91
  "@storybook/storybook-deployer": "^2.8.10",
92
+ "@testing-library/jest-dom": "^5.14.1",
93
+ "@testing-library/react": "^12.1.2",
95
94
  "@types/countries-and-timezones": "^2.0.3",
95
+ "@types/jest": "^27.0.2",
96
96
  "@types/lodash.isequal": "^4.5.5",
97
97
  "@types/node": "^12.7.2",
98
98
  "@types/react": "^17.0.6",
@@ -100,6 +100,7 @@
100
100
  "@types/react-select": "^4.0.15",
101
101
  "@types/react-tabs": "^2.3.3",
102
102
  "@types/styled-components": "^5.1.9",
103
+ "@types/styled-system": "^5.1.13",
103
104
  "@typescript-eslint/eslint-plugin": "^4.8.2",
104
105
  "@typescript-eslint/parser": "^4.8.2",
105
106
  "awesome-typescript-loader": "^5.2.1",
@@ -114,6 +115,7 @@
114
115
  "eslint-plugin-simple-import-sort": "^7.0.0",
115
116
  "formik": "^2.1.4",
116
117
  "husky": "^7.0.1",
118
+ "jest": "^27.2.4",
117
119
  "lint-staged": "^11.0.0",
118
120
  "prettier": "2.3.2",
119
121
  "react": "^17.0.2",
@@ -129,6 +131,7 @@
129
131
  "standard-version": "^9.3.0",
130
132
  "storybook-addon-designs": "^6.0.0",
131
133
  "styled-components": "^5.3.0",
134
+ "ts-transformer-keys": "^0.4.3",
132
135
  "tslib": "^2.2.0",
133
136
  "typescript": "~4.2.2",
134
137
  "webpack-cli": "^3.3.1"