playbook_ui 12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680 → 12.22.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: 9561ff1283a2c2a61fd7562e899a6c2391f1cbf95010e4365229d432904b878a
4
- data.tar.gz: 8e70472802e711a1d8d304e973f1bca85a9b496c1d7af38af367e931dcf320f6
3
+ metadata.gz: 4bbbcbbc5dcde74cb026a9f2b5d510c6362f2654c8c06885b25881598603b1b4
4
+ data.tar.gz: 5f7fa24b05cee92ce96deab0f358fe0bfbc0909753555b7d13179423d13d26cc
5
5
  SHA512:
6
- metadata.gz: 3bead3870a688c20c322c9bf534ddef966ed46e361eeded0d79b351e99640693bd9bb3f6ab5a2b2e62129145c189b5d2becc7c6fd34647f6b2485c1cc42ed077
7
- data.tar.gz: f572b39bd3f17ea6619df329cd1e5986f8374b7b713e74ffab52094b45180c9f8a5a168651e909ad3d4b1af7d5097503d4dc156ab0f49c334e67b2b1c9c1c94a
6
+ metadata.gz: 9532f359c1aa5bd18300c006a1e9cb97d80377fa4616354c38087b5725e399f3296c179862789c48d04dc34506ffc31a07a3c9a0e9f24498f33e1d98c31ca535
7
+ data.tar.gz: 86612e31acd71f850bb381a30cf6e044ebf502d4e4be657bfab6bde5bd1a0bf3ebc10106c2e3e4c36c708bf1b4500d4ef701f58f0f9835bbfe566d8ccb269b51
@@ -20,9 +20,9 @@ const MoreExtensionsDropdown = ({extensions}: any) => {
20
20
 
21
21
  const popoverReference = (
22
22
  <button
23
- className="toolbar_button"
24
- onClick={handleTogglePopover}
25
- >
23
+ className="toolbar_button"
24
+ onClick={handleTogglePopover}
25
+ >
26
26
  <Flex
27
27
  align="center"
28
28
  className="toolbar_button_icon"
@@ -53,14 +53,14 @@ const popoverReference = (
53
53
  cursor="pointer"
54
54
  className={`pb_tiptap_toolbar_dropdown_list_item ${isActive ? "is-active" : ""}`}
55
55
  iconLeft={icon}
56
- key={`${text}_${index}`}
56
+ key={`${text}_${index}`}
57
57
  margin='none'
58
58
  onClick={()=> {onclick(); setShowPopover(false)}}
59
59
  text={text}
60
60
  paddingTop='xxs'
61
61
  paddingBottom='xxs'
62
62
  />
63
- ))}
63
+ ))}
64
64
  </Nav>
65
65
  </PbReactPopover>
66
66
  )
@@ -53,13 +53,12 @@ const EditorToolbar = ({ editor, extensions }:any) => {
53
53
  <SectionSeparator orientation="vertical" />
54
54
  <ToolbarNodes editor={editor} />
55
55
  {
56
- extensions && (
57
- <>
58
- <MoreExtensionsDropdown extensions={extensions}/>
59
- </>
60
- )
61
- }
62
-
56
+ extensions && (
57
+ <>
58
+ <MoreExtensionsDropdown extensions={extensions}/>
59
+ </>
60
+ )
61
+ }
63
62
  </FlexItem>
64
63
  <ToolbarHistoryItems editor={editor} />
65
64
  </Flex>
@@ -12,18 +12,17 @@ import DateTime from '../pb_kit/dateTime'
12
12
 
13
13
  type WeekdayStackedProps = {
14
14
  align?: "left" | "center" | "right",
15
- aria?: object,
15
+ aria?: {[key:string]:string },
16
16
  className?: string,
17
17
  dark?: boolean,
18
18
  data?: object,
19
- date: date,
19
+ date: Date,
20
20
  id?: string,
21
21
  variant?: "day_only" | "month_day" | "expanded",
22
22
  compact?: boolean,
23
- id?: string,
24
23
  }
25
24
 
26
- const getDayOfWeek = (value, compact) => {
25
+ const getDayOfWeek = (value: Date | string, compact: boolean) => {
27
26
  const dateTime = new DateTime({ value })
28
27
  if (compact) {
29
28
  return dateTime.toDayAbbr()
@@ -32,7 +31,7 @@ const getDayOfWeek = (value, compact) => {
32
31
  }
33
32
  }
34
33
 
35
- const getFormattedDate = (value, variant) => {
34
+ const getFormattedDate = (value: Date | string, variant: "day_only" | "month_day" | "expanded") => {
36
35
  const dateTime = new DateTime({ value })
37
36
  if (variant === 'day_only') {
38
37
  return dateTime.toDay()
@@ -0,0 +1,105 @@
1
+ import React from "react";
2
+ import { render, screen } from "../utilities/test-utils";
3
+
4
+ import WeekdayStacked from "./_weekday_stacked";
5
+
6
+ const TEST_DATE = "01/01/2020 00:00:000 GMT-0500";
7
+ jest.setSystemTime(new Date(TEST_DATE));
8
+ const testId = "weekdaystacked-kit";
9
+ const realDate = Date;
10
+
11
+ beforeEach(() => {
12
+ global.Date.now = jest.fn(() => new Date(TEST_DATE));
13
+ });
14
+
15
+ afterEach(() => {
16
+ global.Date = realDate;
17
+ });
18
+
19
+ describe("WeekdayStacked Kit", () => {
20
+ test("renders className", () => {
21
+ render(
22
+ <WeekdayStacked
23
+ data={{ testid: testId }}
24
+ />
25
+ );
26
+
27
+ const kit = screen.getByTestId(testId);
28
+ expect(kit).toHaveClass("pb_weekday_stacked_kit_left");
29
+ });
30
+
31
+ test("renders Caption with weekday", () => {
32
+ render(
33
+ <WeekdayStacked
34
+ data={{ testid: testId }}
35
+ />
36
+ );
37
+
38
+ const kit = screen.getByTestId(testId);
39
+ const text = kit.querySelector(".pb_caption_kit_md");
40
+ expect(text.textContent).toEqual("Wed")
41
+ });
42
+
43
+ test("renders Title with date", () => {
44
+ render(
45
+ <WeekdayStacked
46
+ data={{ testid: testId }}
47
+ />
48
+ );
49
+
50
+ const kit = screen.getByTestId(testId);
51
+ const text = kit.querySelector(".pb_title_kit_size_4");
52
+ expect(text.textContent).toEqual("1/1")
53
+ });
54
+
55
+ test("renders compact prop", () => {
56
+ render(
57
+ <WeekdayStacked
58
+ compact
59
+ data={{ testid: testId }}
60
+ />
61
+ );
62
+
63
+ const kit = screen.getByTestId(testId);
64
+ const text = kit.querySelector(".pb_caption_kit_md");
65
+ expect(text.textContent).toEqual("W")
66
+ });
67
+
68
+ test("renders align prop", () => {
69
+ render(
70
+ <WeekdayStacked
71
+ align="left"
72
+ data={{ testid: testId }}
73
+ />
74
+ );
75
+
76
+ const kit = screen.getByTestId(testId);
77
+ expect(kit).toHaveClass("pb_weekday_stacked_kit_left")
78
+ });
79
+
80
+ test("renders day_only variant prop", () => {
81
+ render(
82
+ <WeekdayStacked
83
+ data={{ testid: testId }}
84
+ variant="day_only"
85
+ />
86
+ );
87
+
88
+ const kit = screen.getByTestId(testId);
89
+ const text = kit.querySelector(".pb_title_kit_size_4");
90
+ expect(text.textContent).toEqual("1")
91
+ });
92
+
93
+ test("renders expanded variant prop", () => {
94
+ render(
95
+ <WeekdayStacked
96
+ data={{ testid: testId }}
97
+ variant="expanded"
98
+ />
99
+ );
100
+
101
+ const kit = screen.getByTestId(testId);
102
+ const text = kit.querySelector(".pb_title_kit_size_4");
103
+ expect(text.textContent).toEqual("Jan 1")
104
+ });
105
+ });
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.21.0"
5
- VERSION = "12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680"
5
+ VERSION = "12.22.0"
6
6
  end
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.21.0.pre.alpha.PLAY807RTEcustomtoolbar680
4
+ version: 12.22.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
8
8
  - Power Devs
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
  date: 2023-05-18 00:00:00.000000000 Z
@@ -2350,8 +2350,8 @@ files:
2350
2350
  - app/pb_kits/playbook/pb_walkthrough/docs/example.yml
2351
2351
  - app/pb_kits/playbook/pb_walkthrough/docs/index.js
2352
2352
  - app/pb_kits/playbook/pb_walkthrough/walkthrough.test.jsx
2353
- - app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.jsx
2354
2353
  - app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.scss
2354
+ - app/pb_kits/playbook/pb_weekday_stacked/_weekday_stacked.tsx
2355
2355
  - app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_compact.html.erb
2356
2356
  - app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_compact.jsx
2357
2357
  - app/pb_kits/playbook/pb_weekday_stacked/docs/_weekday_stacked_default.html.erb
@@ -2362,6 +2362,7 @@ files:
2362
2362
  - app/pb_kits/playbook/pb_weekday_stacked/docs/index.js
2363
2363
  - app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.html.erb
2364
2364
  - app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.rb
2365
+ - app/pb_kits/playbook/pb_weekday_stacked/weekday_stacked.test.jsx
2365
2366
  - app/pb_kits/playbook/playbook-doc.js
2366
2367
  - app/pb_kits/playbook/playbook-rails-react-bindings.js
2367
2368
  - app/pb_kits/playbook/playbook-rails.js
@@ -2490,7 +2491,7 @@ homepage: http://playbook.powerapp.cloud
2490
2491
  licenses:
2491
2492
  - ISC
2492
2493
  metadata: {}
2493
- post_install_message:
2494
+ post_install_message:
2494
2495
  rdoc_options: []
2495
2496
  require_paths:
2496
2497
  - lib
@@ -2501,12 +2502,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
2501
2502
  version: '0'
2502
2503
  required_rubygems_version: !ruby/object:Gem::Requirement
2503
2504
  requirements:
2504
- - - ">"
2505
+ - - ">="
2505
2506
  - !ruby/object:Gem::Version
2506
- version: 1.3.1
2507
+ version: '0'
2507
2508
  requirements: []
2508
2509
  rubygems_version: 3.3.7
2509
- signing_key:
2510
+ signing_key:
2510
2511
  specification_version: 4
2511
2512
  summary: Playbook Design System
2512
2513
  test_files: []