playbook_ui 12.31.0.pre.alpha.multilevelnopillsdesigns944 → 12.32.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1f4769b966dabf8cf4ccc54f825aa29b69560d0884a39c590518e17262c5e329
4
- data.tar.gz: 60f2476c312db5941580e09b6f14604dd6b536308b740a84f1126abca811de67
3
+ metadata.gz: a79955ccab5fc9bbdbb96a5a4d10cd3f65f6e85801573552c171032bae82ca4b
4
+ data.tar.gz: bb3d6b87543fbfce6c0ce0d1d006d73b670d239ae77acde85be73effcb5af1a9
5
5
  SHA512:
6
- metadata.gz: 369f3abd7579952d66f1eda983def3158e94ded442861a8a5890b6def5fcbbc0ac4bb83776d8702c8fa973ccdc37f561daf3539676bb5333ac74096a2bbd8662
7
- data.tar.gz: 189f950cd2d49e95781c1af4f8f5db4006cd3d826641d15e91e13cac284fc17a66f5a15998063b16ae9fc7ede82adc929a7e6220bf3d731ef9a1b497d4180b4f
6
+ metadata.gz: 3a9c508c6a7fef4e46f8bc0127a8afd4cfa33f3e7622428447c7beac1849bccb0a671ddb3eeb3c53344c699b067dbfd612f770e31abf643ccff9b1468ff97c13
7
+ data.tar.gz: e996bd743ae739a19a668a12ad4668acb3da51787e7b83f9dec559e88fb9cb75dae48191097fe5d46768ca360a57d43784fac4c3b4aae30a1b7209abc602ee68
@@ -0,0 +1,3 @@
1
+ <%= pb_rails("button", props: { hover: { shadow: "deep"}, text: "Shadow Deep", margin_right: "lg" }) %>
2
+ <%= pb_rails("button", props: { hover: { shadow: "deeper"}, text: "Shadow Deeper", margin_right: "lg" }) %>
3
+ <%= pb_rails("button", props: { hover: { shadow: "deepest"}, text: "Shadow Deepest", margin_right: "lg" }) %>
@@ -10,6 +10,7 @@ examples:
10
10
  - button_options: Button Additional Options
11
11
  - button_size: Button Size
12
12
  - button_form: Button Form Attribute
13
+
13
14
  react:
14
15
  - button_default: Button Variants
15
16
  - button_full_width: Button Full Width
@@ -53,7 +53,7 @@ $pb_card_header_colors: map-merge(map-merge($product_colors, $additional_colors)
53
53
  };
54
54
 
55
55
  @each $name, $shadow in $box_shadows {
56
- &[class*=_#{$name}] {
56
+ &[class^=_#{$name}] {
57
57
  box-shadow: $shadow;
58
58
  }
59
59
  }
@@ -71,13 +71,42 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
71
71
  }
72
72
  }
73
73
  const disabledParser = () => {
74
- if (disableDate && disableDate.length > 0) {
75
- return disableDate
76
- } else if (disableRange && disableRange.length > 0) {
77
- return disableRange
78
- } else {
79
- return []
80
- }
74
+ const disabledArray=[]
75
+
76
+ disableDate && disableDate.length > 0 && disabledArray.push(...disableDate)
77
+ disableRange && disableRange.length > 0 && disabledArray.push(...disableRange)
78
+ disableWeekdays && disableWeekdays.length > 0 && disabledArray.push(...disabledWeekDays())
79
+
80
+ return disabledArray
81
+ }
82
+
83
+ const disabledWeekDays = () => {
84
+ return (
85
+ [
86
+ (date:any) => {
87
+ const weekdayObj: {
88
+ [day: string]: number
89
+ } = {
90
+ Sunday: 0,
91
+ Monday: 1,
92
+ Tuesday: 2,
93
+ Wednesday: 3,
94
+ Thursday: 4,
95
+ Friday: 5,
96
+ Saturday: 6,
97
+ }
98
+ return (
99
+ date.getDay() === weekdayObj[disableWeekdays[0]] ||
100
+ date.getDay() === weekdayObj[disableWeekdays[1]] ||
101
+ date.getDay() === weekdayObj[disableWeekdays[2]] ||
102
+ date.getDay() === weekdayObj[disableWeekdays[3]] ||
103
+ date.getDay() === weekdayObj[disableWeekdays[4]] ||
104
+ date.getDay() === weekdayObj[disableWeekdays[5]] ||
105
+ date.getDay() === weekdayObj[disableWeekdays[6]]
106
+ )
107
+ },
108
+ ]
109
+ )
81
110
  }
82
111
  const calendarResizer = () => {
83
112
  const cal = document.querySelector(`#cal-${pickerId}.open`) as HTMLElement
@@ -127,30 +156,7 @@ const datePickerHelper = (config: DatePickerConfig, scrollContainer: string | HT
127
156
  disableMobile: true,
128
157
  dateFormat: getDateFormat(),
129
158
  defaultDate: defaultDateGetter(),
130
- disable: disableWeekdays && disableWeekdays.length > 0 ? [
131
- (date) => {
132
- const weekdayObj: {
133
- [day: string]: number
134
- } = {
135
- Sunday: 0,
136
- Monday: 1,
137
- Tuesday: 2,
138
- Wednesday: 3,
139
- Thursday: 4,
140
- Friday: 5,
141
- Saturday: 6,
142
- }
143
- return (
144
- date.getDay() === weekdayObj[disableWeekdays[0]] ||
145
- date.getDay() === weekdayObj[disableWeekdays[1]] ||
146
- date.getDay() === weekdayObj[disableWeekdays[2]] ||
147
- date.getDay() === weekdayObj[disableWeekdays[3]] ||
148
- date.getDay() === weekdayObj[disableWeekdays[4]] ||
149
- date.getDay() === weekdayObj[disableWeekdays[5]] ||
150
- date.getDay() === weekdayObj[disableWeekdays[6]]
151
- )
152
- },
153
- ] : disabledParser(),
159
+ disable: disabledParser(),
154
160
  enableTime,
155
161
  locale: {
156
162
  rangeSeparator: ' to '
@@ -14,24 +14,26 @@ const iconMap = {
14
14
  };
15
15
 
16
16
  type FixedConfirmationToastProps = {
17
- autoClose?: number;
18
- className?: string;
19
- closeable?: boolean;
20
- data?: string;
21
- horizontal?: "right" | "left" | "center";
22
- id?: string;
23
- multiLine?: boolean;
24
- onClose?: () => void;
25
- open?: boolean;
26
- status?: "success" | "error" | "neutral" | "tip";
27
- text: string;
28
- vertical?: "top" | "bottom";
29
- };
17
+ autoClose?: number,
18
+ children?: React.ReactChild[] | React.ReactChild,
19
+ className?: string,
20
+ closeable?: boolean,
21
+ data?: string,
22
+ horizontal?: "right" | "left" | "center",
23
+ id?: string,
24
+ multiLine?: boolean,
25
+ onClose?: () => void,
26
+ open?: boolean,
27
+ status?: "success" | "error" | "neutral" | "tip",
28
+ text?: string,
29
+ vertical?: "top" | "bottom",
30
+ }
30
31
 
31
32
  const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
32
33
  const [showToast, toggleToast] = useState(true);
33
34
  const {
34
35
  autoClose = 0,
36
+ children,
35
37
  className,
36
38
  closeable = false,
37
39
  horizontal,
@@ -75,13 +77,20 @@ const FixedConfirmationToast = (props: FixedConfirmationToastProps) => {
75
77
  {showToast && (
76
78
  <div className={css} onClick={handleClick}>
77
79
  {icon && <Icon className="pb_icon" fixedWidth icon={icon} />}
78
- <Title
79
- className="pb_fixed_confirmation_toast_text"
80
- size={4}
81
- text={text}
82
- />
80
+
81
+ {
82
+ children && children ||
83
+ text && (
84
+ <Title
85
+ className="pb_fixed_confirmation_toast_text"
86
+ size={4}
87
+ text={text}
88
+ />
89
+ )
90
+ }
91
+
83
92
  {closeable && (
84
- <Icon className="pb_icon" fixedWidth={false} icon="times" />
93
+ <Icon className="pb_icon" cursor="pointer" fixedWidth={false} icon="times" />
85
94
  )}
86
95
  </div>
87
96
  )}
@@ -0,0 +1,17 @@
1
+ <%= pb_rails("fixed_confirmation_toast", props: {
2
+ padding_y: "none",
3
+ status: "success"
4
+ }) do %>
5
+ <%= pb_rails("title", props: {
6
+ dark: true,
7
+ margin_left: "md",
8
+ text: "Design & Handoff Process was moved to UX Designer Learning Track.",
9
+ size: 4
10
+ }) %>
11
+ <%= pb_rails("button", props: {
12
+ dark: true,
13
+ padding_right: "none",
14
+ text: "Undo",
15
+ variant: "link"
16
+ }) %>
17
+ <% end %>
@@ -0,0 +1,33 @@
1
+ import React from 'react'
2
+
3
+ import FixedConfirmationToast from '../_fixed_confirmation_toast'
4
+ import Button from '../../pb_button/_button'
5
+ import Title from '../../pb_title/_title'
6
+
7
+ const FixedConfirmationToastChildren = (props) => {
8
+ return (
9
+ <>
10
+ <FixedConfirmationToast
11
+ paddingY="none"
12
+ status="success"
13
+ {...props}
14
+ >
15
+ <Title
16
+ dark
17
+ marginLeft="md"
18
+ size={4}
19
+ text="Design & Handoff Process was moved to UX Designer Learning Track."
20
+ />
21
+ <Button
22
+ dark
23
+ onClick={() => alert("button clicked!")}
24
+ paddingRight="none"
25
+ text="Undo"
26
+ variant="link"
27
+ />
28
+ </FixedConfirmationToast>
29
+ </>
30
+ )
31
+ }
32
+
33
+ export default FixedConfirmationToastChildren
@@ -0,0 +1,3 @@
1
+ Pass anything (including any of our kits) to the `children` prop to customize the content of the fixed confirmation toast.
2
+
3
+ **NOTE:** passing `children` overrides any content passed to `text`
@@ -5,6 +5,7 @@ examples:
5
5
  - fixed_confirmation_toast_multi_line: Multi Line
6
6
  - fixed_confirmation_toast_close: Click to Close
7
7
  - fixed_confirmation_toast_positions: Click to Show Positions
8
+ - fixed_confirmation_toast_children: Children
8
9
 
9
10
  react:
10
11
  - fixed_confirmation_toast_default: Default
@@ -12,3 +13,4 @@ examples:
12
13
  - fixed_confirmation_toast_close: Click to Close
13
14
  - fixed_confirmation_toast_positions: Click to Show Positions
14
15
  - fixed_confirmation_toast_auto_close: Click to Show Auto Close
16
+ - fixed_confirmation_toast_children: Children
@@ -3,3 +3,4 @@ export { default as FixedConfirmationToastMultiLine } from './_fixed_confirmatio
3
3
  export { default as FixedConfirmationToastClose } from './_fixed_confirmation_toast_close.jsx'
4
4
  export { default as FixedConfirmationToastPositions } from './_fixed_confirmation_toast_positions.jsx'
5
5
  export { default as FixedConfirmationToastAutoClose } from './_fixed_confirmation_toast_auto_close.jsx'
6
+ export { default as FixedConfirmationToastChildren } from './_fixed_confirmation_toast_children.jsx'
@@ -4,6 +4,12 @@
4
4
  data: object.data,
5
5
  class: object.classname) do %>
6
6
  <%= pb_rails("icon", props: { icon: object.icon_value, classname: "pb_icon", fixed_width: true }) %>
7
- <%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_fixed_confirmation_toast_text" }) if object.show_text? %>
8
- <%= pb_rails("icon", props: { icon: "times", classname: "pb_icon" }) if object.closeable %>
7
+
8
+ <% if content %>
9
+ <%= content %>
10
+ <% elsif object.show_text? %>
11
+ <%= pb_rails("title", props: { text: object.text, size: 4, classname: "pb_fixed_confirmation_toast_text" }) %>
12
+ <% end %>
13
+
14
+ <%= pb_rails("icon", props: { icon: "times", classname: "pb_icon", cursor: "pointer" }) if object.closeable %>
9
15
  <% end %>
@@ -0,0 +1,25 @@
1
+ <%= pb_rails("message", props: {
2
+ avatar_name: "Mike Bishop",
3
+ avatar_status: "online",
4
+ avatar_url: "https://randomuser.me/api/portraits/men/50.jpg",
5
+ border_radius: "rounded",
6
+ hover: { background: "success_subtle" },
7
+ label: "Anna Black",
8
+ message: "How can we assist you today?",
9
+ padding: "xs",
10
+ }) %>
11
+
12
+ <br><br>
13
+
14
+ <%= pb_rails("message", props: {
15
+ align_timestamp: "left",
16
+ avatar_name: "Lucille Sanchez",
17
+ avatar_url: "https://randomuser.me/api/portraits/women/50.jpg",
18
+ border_radius: "rounded",
19
+ hover: { shadow: "deepest" },
20
+ label: "Becca Jacobs",
21
+ message: "Application for Kate Smith is waiting for your approval",
22
+ padding: "xs",
23
+ }) %>
24
+
25
+ <br><br>
@@ -3,6 +3,7 @@ examples:
3
3
  rails:
4
4
  - message_default: Default
5
5
  - message_timestamp: With Timestamp Hover
6
+ - message_hover: Hover
6
7
 
7
8
 
8
9
  react:
@@ -2,7 +2,7 @@
2
2
 
3
3
  @mixin hover-color-classes($colors-list) {
4
4
  @each $name, $color in $colors-list {
5
- .bg-hover-#{$name}:hover {
5
+ .hover_background_#{$name}:hover {
6
6
  background-color: $color !important;
7
7
  transition: background-color $transition-speed ease;
8
8
  }
@@ -147,7 +147,7 @@ const PROP_CATEGORIES: {[key:string]: (props: {[key: string]: any}) => string} =
147
147
  let css = '';
148
148
  if (!hover) return css;
149
149
  css += hover.shadow ? `hover_shadow_${hover.shadow} ` : '';
150
- css += hover.background ? `bg-hover-${hover.background } ` : '';
150
+ css += hover.background ? `hover_background_${hover.background } ` : '';
151
151
  css += hover.scale ? `hover_scale_${hover.scale} ` : '';
152
152
  return css;
153
153
  },