playbook_ui 12.6.0.pre.alpha.cssphone1 → 12.6.0.pre.alpha.sectionseparator1

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: 605be9613bb09fd58884e033677ec9bb2d87872b384d0ea087c715c5f53d451c
4
- data.tar.gz: e37094c320262d4ebd8c5da72a6a36773718c62944ed6ed203953e3cbe017f89
3
+ metadata.gz: 54b4b391e78f2f58e670391168634c536434667a6e53d4ae31e803f738ee5a1d
4
+ data.tar.gz: 871163ff18b7cc73cd8591158fbff9aedb2cbfa647c95a68e5921ccd319fede0
5
5
  SHA512:
6
- metadata.gz: be6f1cecdfe0783360be888c294a56c6936279fc04c8394cacb208a1d2915ae7e1eb66251a5bfa0d77e341cbb1c334154bd201ba5cfb432f6cfb8dae6d781e65
7
- data.tar.gz: a4021982214cf9b87f14415e3de00e4d0fa781a62fc1049c72d0c25a91d5f13cf593c7a9084b8334b10111b53b69aaa24d2110acdae6b7de135ca0a3f688e52b
6
+ metadata.gz: 4ab7c44f1c8cdd068026bedde9b01b656e4b209bf0997ff539857867c5d5a1cd591a153084716f983b8749d643ecf8a747fde4b05600260e0312b3d02e004d7a
7
+ data.tar.gz: 918ca1022a5c4c4ea45436892b8fc5608b10bf06a3d0fbcb495b5f2e8f63bb2ff144b15e039eec1bd6d1ea433680c398a5324829b1f31a5afd619273c7a75271
@@ -1,6 +1,6 @@
1
1
  <%= pb_rails("card", props: { classname: "pb--doc", padding: "none", dark: dark }) do %>
2
2
  <div class="pb--kit-example">
3
- <%= pb_rails("caption", props: { text: example_title }) %>
3
+ <%= pb_rails("caption", props: { text: example_title, dark: dark }) %>
4
4
  <br />
5
5
  <%= example %>
6
6
  <br>
@@ -14,6 +14,7 @@ type NavProps = {
14
14
  children?: React.Node,
15
15
  className?: string | array<string>,
16
16
  data?: object,
17
+ dark?: boolean,
17
18
  highlight?: boolean,
18
19
  id?: string,
19
20
  onClick?: EventHandler,
@@ -29,6 +30,7 @@ const Nav = (props: NavProps) => {
29
30
  children,
30
31
  className,
31
32
  data = {},
33
+ dark = false,
32
34
  highlight = true,
33
35
  id,
34
36
  link = '#',
@@ -64,6 +66,7 @@ const Nav = (props: NavProps) => {
64
66
  onClick={onClick}
65
67
  >
66
68
  <Caption
69
+ dark={dark}
67
70
  size="md"
68
71
  text={`${title}`}
69
72
  />
@@ -6,7 +6,7 @@
6
6
  <% if object.title %>
7
7
  <%= content_tag(:div, class: "pb_nav_list_title") do %>
8
8
  <%= content_tag(:a, class: "pb_nav_list_item_link_text", href: object.link) do %>
9
- <%= pb_rails("caption", props: { text: object.title }) %>
9
+ <%= pb_rails("caption", props: { text: object.title, dark: dark }) %>
10
10
  <% end %>
11
11
  <% end %>
12
12
  <% end %>
@@ -1,46 +1,16 @@
1
1
  @import "../tokens/colors";
2
2
 
3
- $transform-rotate-deg: 135deg;
4
- $input-max-width: 284px;
5
- $dropdown-min-width: 340px;
6
- $flag-min-resolution: 192dpi;
7
-
8
3
  .pb_phone_number_input {
9
4
  input::placeholder {
10
5
  color: $focus_input_light;
11
6
  }
12
7
 
13
- .text_input {
14
- max-width: $input-max-width;
15
- }
16
-
17
- .dropdown_open {
18
- .text_input {
19
- border-color: $primary !important;
20
- }
21
-
22
- .iti__selected-flag:focus-visible {
23
- outline-style: none;
24
- }
25
- }
26
-
27
8
  .iti__country {
28
9
  padding: 5px 10px 5px 16px;
29
- transition: $transition_default;
30
10
  }
31
11
 
32
12
  .iti__selected-flag {
33
- padding: 0 $space_xxs 0 $space_sm;
34
-
35
- &[aria-expanded="true"] {
36
- color: $primary_action;
37
- }
38
-
39
- &:focus-visible {
40
- outline-style: solid;
41
- border-radius: $space_xxs 0px 0px $space_xxs;
42
- outline-color: $primary;
43
- }
13
+ padding: 0 6px 0 16px;
44
14
  }
45
15
 
46
16
  .iti__country.iti__highlight {
@@ -61,11 +31,6 @@ $flag-min-resolution: 192dpi;
61
31
 
62
32
  .iti__flag {
63
33
  background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.19/img/flags.png");
64
- border-radius: 1px;
65
- }
66
-
67
- .iti--separate-dial-code {
68
- width: 100%;
69
34
  }
70
35
 
71
36
  .iti--separate-dial-code .iti__selected-flag {
@@ -87,50 +52,49 @@ $flag-min-resolution: 192dpi;
87
52
 
88
53
  .iti__arrow::before {
89
54
  border-style: solid;
90
- border-width: 1px 1px 0 0;
55
+ border-width: 0.1em 0.1em 0 0;
91
56
  content: '';
92
57
  display: inline-block;
93
- height: $space_xxs + 1px;
94
- left: 1px;
58
+ height: 0.6em;
59
+ left: 0.1em;
95
60
  position: relative;
96
61
  vertical-align: top;
97
- width: $space_xxs + 1px;
98
- top: $space_xs + 2px;
99
- transform: rotate($transform-rotate-deg);
62
+ width: 0.6em;
63
+ top: 10px;
64
+ transform: rotate(135deg);
65
+ font-size: 0.5em;
100
66
  color: $slate;
101
67
  }
102
68
 
103
69
  .iti__arrow.iti__arrow--up::before {
104
- transform: rotate(-($transform-rotate-deg/3));
105
- top: $space_xs + 4px;
106
- color: $primary_action;
70
+ transform: rotate(-45deg);
71
+ top: 12px;
107
72
  }
108
73
 
109
74
  .iti__active::after {
110
75
  float: right;
111
76
  content: "";
112
- margin-top: $space_xxs + 1px;
113
- transform: rotate($transform-rotate-deg/3);
114
- height: $space_xs + 4px;
115
- width: $space_xxs + 2px;
77
+ margin-top: 5px;
78
+ transform: rotate(45deg);
79
+ height: 12px;
80
+ width: 6px;
116
81
  border-bottom: 2px solid;
117
82
  border-right: 2px solid;
118
83
  border-radius: 1px;
119
84
  }
120
85
 
121
86
  .iti__country-list {
122
- min-width: $dropdown-min-width;
87
+ min-width: 340px;
123
88
  border-radius: $border_radius_md;
124
89
  border: 1px solid $border_light;
125
90
  box-shadow: $shadow_deep;
126
- margin-top: 1px;
127
91
  }
128
92
 
129
93
  .iti__divider {
130
94
  border-bottom: 1px solid $border_light;
131
95
  }
132
96
 
133
- @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: $flag-min-resolution) {
97
+ @media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
134
98
  .iti__flag {
135
99
  background-image: url("https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.19/img/flags@2x.png");
136
100
  }
@@ -1,11 +1,11 @@
1
1
  /* @flow */
2
- import React, { useEffect, useRef, useState } from 'react'
3
- import classnames from 'classnames'
4
- import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props'
5
- import { globalProps } from '../utilities/globalProps'
6
- import intlTelInput from 'intl-tel-input'
7
- import TextInput from '../pb_text_input/_text_input'
8
- import 'intl-tel-input/build/js/utils.js'
2
+ import React, { useEffect, useRef, useState } from "react"
3
+ import classnames from "classnames"
4
+ import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props"
5
+ import { globalProps } from "../utilities/globalProps"
6
+ import intlTelInput from "intl-tel-input"
7
+ import "intl-tel-input/build/css/intlTelInput.css"
8
+ import TextInput from "../pb_text_input/_text_input"
9
9
 
10
10
  declare global {
11
11
  interface Window {
@@ -50,7 +50,7 @@ const formatAllCountries = () => {
50
50
  formatAllCountries()
51
51
 
52
52
  const containOnlyNumbers = (value: string) => {
53
- return /^[()+\-\ .\d]*$/g.test(value)
53
+ return /^(\++)*(\d+)$/.test(value)
54
54
  }
55
55
 
56
56
  const PhoneNumberInput = (props: PhoneNumberInputProps) => {
@@ -85,8 +85,7 @@ const PhoneNumberInput = (props: PhoneNumberInputProps) => {
85
85
  const inputRef = useRef<HTMLInputElement>()
86
86
  const [inputValue, setInputValue] = useState(value)
87
87
  const [itiInit, setItiInit] = useState<any>()
88
- const [error, setError] = useState('')
89
- const [dropDownIsOpen, setDropDownIsOpen] = useState(false)
88
+ const [error, setError] = useState("")
90
89
 
91
90
  const validateTooLongNumber = (itiInit: any) => {
92
91
  const error = itiInit.getValidationError()
@@ -134,17 +133,18 @@ const PhoneNumberInput = (props: PhoneNumberInputProps) => {
134
133
 
135
134
  useEffect(() => {
136
135
  const telInputInit = new intlTelInput(inputRef.current, {
137
- separateDialCode: true,
138
- preferredCountries,
139
- allowDropdown: !disabled,
140
- initialCountry,
141
- onlyCountries,
142
- }
136
+ utilsScript:
137
+ "https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.19/js/utils.js",
138
+ separateDialCode: true,
139
+ preferredCountries,
140
+ allowDropdown: !disabled,
141
+ initialCountry,
142
+ onlyCountries,
143
+ })
144
+
145
+ inputRef.current.addEventListener("countrychange", () =>
146
+ validateTooLongNumber(telInputInit)
143
147
  )
144
-
145
- inputRef.current.addEventListener("countrychange", () => validateTooLongNumber(telInputInit))
146
- inputRef.current.addEventListener("open:countrydropdown", () => setDropDownIsOpen(true))
147
- inputRef.current.addEventListener("close:countrydropdown", () => setDropDownIsOpen(false))
148
148
 
149
149
  setItiInit(telInputInit)
150
150
  }, [])
@@ -152,7 +152,6 @@ const PhoneNumberInput = (props: PhoneNumberInputProps) => {
152
152
  return (
153
153
  <div {...ariaProps} {...dataProps} className={classes}>
154
154
  <TextInput
155
- className={dropDownIsOpen ? 'dropdown_open' : ''}
156
155
  disabled={disabled}
157
156
  error={error}
158
157
  id={id}
@@ -1,6 +1,5 @@
1
1
  import React from 'react'
2
2
  import { PhoneNumberInput } from '../../'
3
- import "intl-tel-input/build/css/intlTelInput.min.css"
4
3
 
5
4
  const PhoneNumberInputDefault = () => (
6
5
  <>
@@ -18,19 +18,21 @@ $section_colors_dark: (
18
18
  justify-content: center;
19
19
  align-items: center;
20
20
  position: relative;
21
- @each $color_name, $color_value in $section_colors_light {
22
- &[class*=_#{$color_name}] {
23
- span {
24
- display: inline-block;
25
- padding: 0 $space_xs;
26
- background: #{$color_value};
27
- position: relative;
28
- z-index: 1;
29
- }
30
- }
21
+ span {
22
+ padding: 0 $space_xs;
23
+ display: flex;
24
+ }
25
+ &::before {
26
+ content: "";
27
+ height: 1px;
28
+ flex: 1;
29
+ @include section_separator_horizontal;
31
30
  }
32
31
  &::after {
33
- @include section_separator_horizontal(false);
32
+ content: "";
33
+ height: 1px;
34
+ flex: 1;
35
+ @include section_separator_horizontal;
34
36
  }
35
37
  &[class*=_horizontal] {
36
38
  justify-content: center;
@@ -46,23 +48,13 @@ $section_colors_dark: (
46
48
  // Dark =========================
47
49
 
48
50
  &.dark {
49
- &::after {
51
+ &::before {
50
52
  @include section_separator_horizontal(true);
51
53
  }
52
- @each $color_name, $color_value in $section_colors_dark {
53
- &[class*=_#{$color_name}] {
54
- span {
55
- display: inline-block;
56
- padding: 0 $space_xs;
57
- background: #{$color_value};
58
- position: relative;
59
- z-index: 1;
60
- }
61
- }
54
+ &::after {
55
+ @include section_separator_horizontal(true);
62
56
  }
63
57
  &[class*=_vertical] {
64
- margin-left: $space_xs;
65
- margin-right: $space_xs;
66
58
  &::after {
67
59
  @include section_separator_vertical(true);
68
60
  }
@@ -25,6 +25,7 @@ const SectionSeparator = (props: SectionSeparatorProps) => {
25
25
  id,
26
26
  orientation = 'horizontal',
27
27
  text,
28
+ dark = false,
28
29
  variant = 'card',
29
30
  } = props
30
31
  const ariaProps = buildAriaProps(aria)
@@ -42,7 +43,7 @@ const SectionSeparator = (props: SectionSeparatorProps) => {
42
43
  {
43
44
  text && (
44
45
  <span>
45
- <Caption text={text} />
46
+ <Caption text={text} dark={dark}/>
46
47
  </span>
47
48
  )
48
49
  }
@@ -20,11 +20,4 @@
20
20
  } @else {
21
21
  background: $border_dark;
22
22
  }
23
- content: "";
24
- height: 1px;
25
- width: 100%;
26
- position: absolute;
27
- top: 50%;
28
- left: 0;
29
- z-index: 0;
30
23
  }
@@ -3,12 +3,10 @@ examples:
3
3
  rails:
4
4
  - section_separator_text: Text Separator
5
5
  - section_separator_line: Line Separator
6
- - section_separator_text_background: Background Variant
7
6
  - section_separator_vertical: Vertical
8
7
 
9
8
 
10
9
  react:
11
10
  - section_separator_text: Text Separator
12
11
  - section_separator_line: Line Separator
13
- - section_separator_text_background: Background Variant
14
12
  - section_separator_vertical: Vertical
@@ -1,4 +1,3 @@
1
1
  export { default as SectionSeparatorLine } from './_section_separator_line.jsx'
2
2
  export { default as SectionSeparatorText } from './_section_separator_text.jsx'
3
- export { default as SectionSeparatorTextBackground } from './_section_separator_text_background.jsx'
4
3
  export { default as SectionSeparatorVertical } from './_section_separator_vertical.jsx'
@@ -4,7 +4,9 @@
4
4
  data: object.data,
5
5
  class: object.classname) do %>
6
6
  <% if object.orientation === 'horizontal' %>
7
- <span><%= pb_rails("caption", props: { text: object.text }) %></span>
7
+ <% if object.text %>
8
+ <span><%= pb_rails("caption", props: { text: object.text }) %></span>
9
+ <%end%>
8
10
  <% end %>
9
11
  <% if object.orientation === 'vertical' %>
10
12
  <%= pb_rails("flex", props: { orientation: "column"}) do %>
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Playbook
4
4
  PREVIOUS_VERSION = "12.6.0"
5
- VERSION = "12.6.0.pre.alpha.cssphone1"
5
+ VERSION = "12.6.0.pre.alpha.sectionseparator1"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.6.0.pre.alpha.cssphone1
4
+ version: 12.6.0.pre.alpha.sectionseparator1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Power UX
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-03-06 00:00:00.000000000 Z
12
+ date: 2023-03-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -1729,8 +1729,6 @@ files:
1729
1729
  - app/pb_kits/playbook/pb_section_separator/docs/_section_separator_line.jsx
1730
1730
  - app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.html.erb
1731
1731
  - app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text.jsx
1732
- - app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_background.html.erb
1733
- - app/pb_kits/playbook/pb_section_separator/docs/_section_separator_text_background.jsx
1734
1732
  - app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.html.erb
1735
1733
  - app/pb_kits/playbook/pb_section_separator/docs/_section_separator_vertical.jsx
1736
1734
  - app/pb_kits/playbook/pb_section_separator/docs/example.yml
@@ -1 +0,0 @@
1
- <%= pb_rails("section_separator", props: { text: "Title Separator", variant: "background"}) %>
@@ -1,14 +0,0 @@
1
- import React from 'react'
2
- import { SectionSeparator } from '../../'
3
-
4
- const SectionSeparatorTextBackground = (props) => {
5
- return (
6
- <SectionSeparator
7
- {...props}
8
- text="Title Separator"
9
- variant="background"
10
- />
11
- )
12
- }
13
-
14
- export default SectionSeparatorTextBackground