@purple/phoenix-components 5.3.0 → 5.4.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
@@ -51,12 +51,23 @@ declare type TextColor = typeof TextColor[number];
51
51
  declare const isTextColor: (color?: Color) => color is "primary" | "secondary" | "tertiary" | "quaternary";
52
52
  declare type Color = TextColor | ColorTheme | CSSColor;
53
53
 
54
+ declare const Sizing: readonly ["xs", "sm", "md", "lg"];
55
+ declare type Sizing = typeof Sizing[number];
56
+ declare const isSizing: (size?: Sizing | CSSValue) => size is "xs" | "sm" | "md" | "lg";
57
+ declare const SizingSmMd: readonly ["sm", "md"];
58
+ declare type SizingSmMd = typeof SizingSmMd[number];
59
+ declare const SizingMdLg: readonly ["md", "lg"];
60
+ declare type SizingMdLg = typeof SizingMdLg[number];
61
+ declare const SizingSmMdLg: readonly ["sm", "md", "lg"];
62
+ declare type SizingSmMdLg = typeof SizingSmMdLg[number];
63
+
54
64
  declare const TextAlignment: readonly ["left", "center", "right", "justify"];
55
65
  declare type TextAlignment = typeof TextAlignment[number];
56
66
 
57
67
  interface CommonTextProps<T> extends HTMLAttributes<T>, GenericComponentProps, TextAlignProp {
58
68
  color?: Color;
59
69
  bold?: boolean;
70
+ size?: Sizing | CSSValue;
60
71
  }
61
72
  interface TextAlignProp {
62
73
  textAlign?: TextAlignment;
@@ -283,16 +294,6 @@ declare type PhoenixIcons = keyof typeof PhoenixIconsSrc;
283
294
 
284
295
  declare type IconType = PhoenixIconsOutlined | React.ReactElement | string;
285
296
 
286
- declare const Sizing: readonly ["xs", "sm", "md", "lg"];
287
- declare type Sizing = typeof Sizing[number];
288
- declare const isSizing: (size?: Sizing | CSSValue) => size is "xs" | "sm" | "md" | "lg";
289
- declare const SizingSmMd: readonly ["sm", "md"];
290
- declare type SizingSmMd = typeof SizingSmMd[number];
291
- declare const SizingMdLg: readonly ["md", "lg"];
292
- declare type SizingMdLg = typeof SizingMdLg[number];
293
- declare const SizingSmMdLg: readonly ["sm", "md", "lg"];
294
- declare type SizingSmMdLg = typeof SizingSmMdLg[number];
295
-
296
297
  interface CommonButtonProps extends MarginProps {
297
298
  colorTheme?: ColorTheme;
298
299
  size?: Sizing;
@@ -352,8 +353,13 @@ interface CollapsibleProps extends GenericComponentProps {
352
353
  declare const Collapsible: React$1.FC<PropsWithChildren<CollapsibleProps>>;
353
354
 
354
355
  interface CollapsibleCardProps extends CardProps, GenericComponentProps {
355
- heading: string;
356
- rightContent?: React$1.ReactNode;
356
+ heading: ReactElement | string;
357
+ headingMarginBottom?: Spacing | CSSValue;
358
+ rightContent?: ReactElement;
359
+ initialOpen?: boolean;
360
+ arrowReverse?: boolean;
361
+ arrow?: ReactElement;
362
+ showCard?: boolean;
357
363
  }
358
364
  declare const CollapsibleCard: React$1.FC<PropsWithChildren<CollapsibleCardProps>>;
359
365
 
@@ -503,7 +509,6 @@ declare const Grid: React$1.FC<BoxProps>;
503
509
  declare type HeadingElement = 'h1' | 'h2' | 'h3' | 'h4';
504
510
  interface HeadingProps extends CommonTextProps<HTMLHeadingElement>, PaddingProps, MarginProps {
505
511
  element?: HeadingElement;
506
- size?: Sizing | CSSValue;
507
512
  }
508
513
  declare const Heading: React$1.FC<HeadingProps>;
509
514
 
@@ -628,7 +633,6 @@ interface NoticeProps extends GenericComponentProps, MarginProps, PaddingProps {
628
633
  declare const Notice: React$1.FC<PropsWithChildren<NoticeProps>>;
629
634
 
630
635
  interface ParagraphProps extends CommonTextProps<HTMLParagraphElement>, PaddingProps, MarginProps {
631
- size?: Sizing | CSSValue;
632
636
  lineHeight?: Sizing | CSSValue;
633
637
  }
634
638
  declare const Paragraph: React$1.FC<ParagraphProps>;
@@ -718,7 +722,6 @@ interface TagProps extends GenericComponentProps, MarginProps {
718
722
  declare const Tag: React$1.FC<TagProps>;
719
723
 
720
724
  interface TextProps extends CommonTextProps<HTMLDivElement>, PaddingProps, MarginProps {
721
- size?: Sizing | CSSValue;
722
725
  ellipsize?: boolean;
723
726
  element?: 'div' | 'span';
724
727
  title?: string;
@@ -738,6 +741,14 @@ declare const TimezonePicker: React$1.FC<TimezonePickerProps>;
738
741
 
739
742
  declare const getOptions: () => SelectOption[];
740
743
 
744
+ interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size'>, GenericComponentProps {
745
+ colorTheme?: ColorTheme;
746
+ label?: React$1.ReactNode;
747
+ warning?: FormControlWarningType;
748
+ error?: FormControlErrorType;
749
+ }
750
+ declare const Toggle: React$1.FC<ToggleProps>;
751
+
741
752
  declare type TooltipProps = Omit<TippyProps, 'theme'> & GenericComponentProps;
742
753
  declare const Tooltip: React$1.FC<TooltipProps>;
743
754
 
@@ -1516,6 +1527,63 @@ declare const prefixedTheme: {
1516
1527
  fontWeight: string;
1517
1528
  borderWidth: string;
1518
1529
  };
1530
+ toggle: {
1531
+ sizing: {
1532
+ container: {
1533
+ md: {
1534
+ width: string;
1535
+ height: string;
1536
+ };
1537
+ };
1538
+ slider: {
1539
+ md: string;
1540
+ };
1541
+ };
1542
+ color: {
1543
+ background: {
1544
+ container: {
1545
+ off: string;
1546
+ offDisabled: string;
1547
+ offInteraction: string;
1548
+ };
1549
+ slider: {
1550
+ off: string;
1551
+ offDisabled: string;
1552
+ };
1553
+ };
1554
+ border: {
1555
+ container: {
1556
+ off: string;
1557
+ offDisabled: string;
1558
+ offInteraction: string;
1559
+ };
1560
+ };
1561
+ };
1562
+ };
1563
+ modal: {
1564
+ color: {
1565
+ background: {
1566
+ overlay: string;
1567
+ };
1568
+ };
1569
+ sizing: {
1570
+ maxWidth: {
1571
+ xs: string;
1572
+ sm: string;
1573
+ md: string;
1574
+ lg: string;
1575
+ };
1576
+ };
1577
+ boxShadow: {
1578
+ x: string;
1579
+ y: string;
1580
+ blur: string;
1581
+ spread: string;
1582
+ color: string;
1583
+ type: string;
1584
+ };
1585
+ borderRadius: string;
1586
+ };
1519
1587
  color: {
1520
1588
  background: {
1521
1589
  primary: string;
@@ -1748,30 +1816,6 @@ declare const prefixedTheme: {
1748
1816
  };
1749
1817
  };
1750
1818
  };
1751
- modal: {
1752
- sizing: {
1753
- maxWidth: {
1754
- xs: string;
1755
- sm: string;
1756
- md: string;
1757
- lg: string;
1758
- };
1759
- };
1760
- boxShadow: {
1761
- x: string;
1762
- y: string;
1763
- blur: string;
1764
- spread: string;
1765
- color: string;
1766
- type: string;
1767
- };
1768
- borderRadius: string;
1769
- color: {
1770
- background: {
1771
- overlay: string;
1772
- };
1773
- };
1774
- };
1775
1819
  tabs: {
1776
1820
  borderWidth: {
1777
1821
  tab: {
@@ -1806,4 +1850,4 @@ interface BoxShadowObj {
1806
1850
  }
1807
1851
  declare const getBoxShadow: (shadow: BoxShadowObj | BoxShadowObj[]) => string;
1808
1852
 
1809
- export { Box, BoxProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, Checkbox, CheckboxProps, ClosableButton, ClosableButtonProps, ClosableItem, ClosableItemProps, Collapsible, CollapsibleCard, CollapsibleCardProps, CollapsibleProps, Color, ColorAndTheme, ColorTheme, DateInput, DateInputProps, DatePicker, DatePickerProps, DateRangePicker, DateRangePickerProps, DateRangeValue, DateValue, Dropdown, DropdownProps, FileUpload, FileUploadProps, FileWithPreview, Flex, GlobalStyles, Grid, Heading, HeadingElement, HeadingProps, HorizontalDivider, HorizontalDividerProps, Icon, IconAlignment, IconProps, IconType, Image, Label, LabelProps, Link, LinkButton, LinkButtonProps, LinkProps, List, ListItem, ListItemProps, ListProps, Menu, MenuItem, MenuItemProps, MenuProps, Modal, ModalProps, MultiSelect, MultiSelectProps, MultiSlider, MultiSliderProps, MultiSliderValue, Notice, NoticeProps, NumberInput, NumberInputProps, Paragraph, ParagraphProps, PhoenixIcons, PhoenixIconsColored, PhoenixIconsColoredSrc, PhoenixIconsOutlined, PhoenixIconsOutlinedSrc, PhoenixIconsSrc, Radio, RadioProps, Select, SelectNative, SelectNativeProps, SelectOption, SelectPicker, SelectPickerOption, SelectPickerProps, SelectProps, Sizing, SizingMdLg, SizingSmMd, SizingSmMdLg, Slider, SliderProps, SliderValue, Spacing, Spinner, SpinnerProps, Tab, TabFunctionProps, TabList, TabListProps, TabProps, Tag, TagProps, Text, TextArea, TextAreaProps, TextColor, TextInput, TextInputProps, TextProps, prefixedTheme as Theme, TimezonePicker, TimezonePickerProps, Tooltip, TooltipProps, getBoxShadow, getLineHeightUnitless, getSpacingCssValue, getTextColor, getOptions as getTimezoneOptions, getUnitlessNumber, isColorTheme, isSizing, isSpacing, isTextColor };
1853
+ export { Box, BoxProps, Button, ButtonGroup, ButtonGroupProps, ButtonProps, Card, CardProps, Checkbox, CheckboxProps, ClosableButton, ClosableButtonProps, ClosableItem, ClosableItemProps, Collapsible, CollapsibleCard, CollapsibleCardProps, CollapsibleProps, Color, ColorAndTheme, ColorTheme, DateInput, DateInputProps, DatePicker, DatePickerProps, DateRangePicker, DateRangePickerProps, DateRangeValue, DateValue, Dropdown, DropdownProps, FileUpload, FileUploadProps, FileWithPreview, Flex, GlobalStyles, Grid, Heading, HeadingElement, HeadingProps, HorizontalDivider, HorizontalDividerProps, Icon, IconAlignment, IconProps, IconType, Image, Label, LabelProps, Link, LinkButton, LinkButtonProps, LinkProps, List, ListItem, ListItemProps, ListProps, Menu, MenuItem, MenuItemProps, MenuProps, Modal, ModalProps, MultiSelect, MultiSelectProps, MultiSlider, MultiSliderProps, MultiSliderValue, Notice, NoticeProps, NumberInput, NumberInputProps, Paragraph, ParagraphProps, PhoenixIcons, PhoenixIconsColored, PhoenixIconsColoredSrc, PhoenixIconsOutlined, PhoenixIconsOutlinedSrc, PhoenixIconsSrc, Radio, RadioProps, Select, SelectNative, SelectNativeProps, SelectOption, SelectPicker, SelectPickerOption, SelectPickerProps, SelectProps, Sizing, SizingMdLg, SizingSmMd, SizingSmMdLg, Slider, SliderProps, SliderValue, Spacing, Spinner, SpinnerProps, Tab, TabFunctionProps, TabList, TabListProps, TabProps, Tag, TagProps, Text, TextArea, TextAreaProps, TextColor, TextInput, TextInputProps, TextProps, prefixedTheme as Theme, TimezonePicker, TimezonePickerProps, Toggle, Tooltip, TooltipProps, getBoxShadow, getLineHeightUnitless, getSpacingCssValue, getTextColor, getOptions as getTimezoneOptions, getUnitlessNumber, isColorTheme, isSizing, isSpacing, isTextColor };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@purple/phoenix-components",
3
- "version": "5.3.0",
3
+ "version": "5.4.0",
4
4
  "description": "",
5
5
  "main": "dist/bundle.umd.js",
6
6
  "module": "dist/bundle.esm.js",
@@ -29,7 +29,8 @@
29
29
  "scripts": {
30
30
  "lint": "eslint 'src' '.storybook' --ext .ts,.tsx,.js,.jsx,.json,.d.ts",
31
31
  "lint:fix": "eslint 'src' '.storybook' --ext .ts,.tsx,.js,.jsx,.json,.d.ts --fix",
32
- "build:tokens": "(git -C my-axiory-tokens pull || git clone https://github.com/purple-technology/my-axiory-tokens.git) && ts-node --project ./ts-node.tsconfig.json --files src/tokens/build.ts && eslint 'src/tokens/' --ext .json --fix",
32
+ "build:tokens": "ts-node --project ./ts-node.tsconfig.json --files src/tokens/build.ts && eslint 'src/tokens/' --ext .json --fix",
33
+ "tokens": "(git -C my-axiory-tokens pull || git clone https://github.com/purple-technology/my-axiory-tokens.git) && npm run build:tokens",
33
34
  "build": "rollup -c && rm -r ./dist/types",
34
35
  "build-watch": "rollup -c -w",
35
36
  "prepare": "husky install",
@@ -55,6 +56,7 @@
55
56
  "@react-hook/previous": "~1.0.1",
56
57
  "@tippyjs/react": "~4.2.6",
57
58
  "countries-and-timezones": "^3.3.0",
59
+ "formik": "~2.2.9",
58
60
  "is-mobile": "~3.1.1",
59
61
  "lodash": "~4.17.21",
60
62
  "nanoid": "~3.3.4",
@@ -114,7 +116,6 @@
114
116
  "eslint-plugin-react": "^7.23.2",
115
117
  "eslint-plugin-react-hooks": "^4.2.0",
116
118
  "eslint-plugin-simple-import-sort": "^7.0.0",
117
- "formik": "^2.1.4",
118
119
  "husky": "^7.0.1",
119
120
  "jest": "^27.2.4",
120
121
  "lint-staged": "^12.0.0",