playbook_ui 14.12.0.pre.alpha.PLAY1888initializeOncereactdatepickerslowdown5956 → 14.12.0.pre.alpha.PLAY18565866

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +3 -10
  3. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.scss +6 -6
  4. data/app/pb_kits/playbook/pb_advanced_table/_advanced_table.tsx +21 -34
  5. data/app/pb_kits/playbook/pb_copy_button/_copy_button.scss +1 -2
  6. data/app/pb_kits/playbook/pb_copy_button/docs/example.yml +3 -3
  7. data/app/pb_kits/playbook/pb_date_picker/_date_picker.tsx +1 -3
  8. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_breakpoints.jsx +71 -36
  9. data/app/pb_kits/playbook/pb_drawer/docs/_drawer_menu.jsx +6 -6
  10. data/app/pb_kits/playbook/pb_drawer/docs/example.yml +1 -0
  11. data/app/pb_kits/playbook/pb_home_address_street/_home_address_street.tsx +11 -7
  12. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.html.erb +11 -0
  13. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting.jsx +22 -0
  14. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_rails.md +1 -0
  15. data/app/pb_kits/playbook/pb_home_address_street/docs/_home_address_street_formatting_react.md +1 -0
  16. data/app/pb_kits/playbook/pb_home_address_street/docs/example.yml +2 -0
  17. data/app/pb_kits/playbook/pb_home_address_street/docs/index.js +1 -0
  18. data/app/pb_kits/playbook/pb_home_address_street/home_address_street.rb +11 -2
  19. data/app/pb_kits/playbook/pb_lightbox/lightbox.scss +6 -7
  20. data/app/pb_kits/playbook/pb_link/_link.tsx +0 -18
  21. data/app/pb_kits/playbook/pb_link/docs/example.yml +3 -5
  22. data/app/pb_kits/playbook/pb_link/docs/index.js +1 -2
  23. data/app/pb_kits/playbook/pb_link/link.html.erb +1 -1
  24. data/app/pb_kits/playbook/pb_link/link.rb +0 -6
  25. data/app/pb_kits/playbook/pb_link/link.test.jsx +0 -30
  26. data/app/pb_kits/playbook/pb_progress_step/docs/_progress_step_tooltip.html.erb +6 -6
  27. data/app/pb_kits/playbook/pb_tooltip/docs/_tooltip_default.html.erb +1 -1
  28. data/app/pb_kits/playbook/pb_tooltip/index.js +27 -45
  29. data/app/pb_kits/playbook/pb_tooltip/tooltip.rb +1 -5
  30. data/dist/chunks/{_typeahead-CkemExmL.js → _typeahead-W0hatdPs.js} +1 -1
  31. data/dist/chunks/_weekday_stacked-C98LOqgG.js +45 -0
  32. data/dist/chunks/{lib-DjpLC8uO.js → lib-kMuhBuU7.js} +1 -1
  33. data/dist/chunks/{pb_form_validation-S56UaHZl.js → pb_form_validation-DBJ0wZuS.js} +1 -1
  34. data/dist/chunks/vendor.js +1 -1
  35. data/dist/menu.yml +2 -2
  36. data/dist/playbook-doc.js +1 -1
  37. data/dist/playbook-rails-react-bindings.js +1 -1
  38. data/dist/playbook-rails.js +1 -1
  39. data/dist/playbook.css +1 -1
  40. data/lib/playbook/version.rb +1 -1
  41. metadata +10 -14
  42. data/app/pb_kits/playbook/pb_advanced_table/Utilities/ActionBarAnimationHelper.ts +0 -26
  43. data/app/pb_kits/playbook/pb_copy_button/copy_button.html.erb +0 -15
  44. data/app/pb_kits/playbook/pb_copy_button/copy_button.rb +0 -28
  45. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_default.html.erb +0 -2
  46. data/app/pb_kits/playbook/pb_copy_button/docs/_copy_button_from.html.erb +0 -5
  47. data/app/pb_kits/playbook/pb_copy_button/index.js +0 -47
  48. data/app/pb_kits/playbook/pb_link/docs/_link_target.html.erb +0 -15
  49. data/app/pb_kits/playbook/pb_link/docs/_link_target.jsx +0 -29
  50. data/dist/chunks/_weekday_stacked-4-ehPAbR.js +0 -45
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ce26ea4ae1198511f9c6a804ac3eec019188d988ddb66b30f1a6ceabfc9e589
4
- data.tar.gz: 0f2e7f4cf50aab69444666dff81daf2732ec181f117ae90208a59c987367f8d9
3
+ metadata.gz: 2036447bc24867ea60730bcd2106f70198ab5d0b0469fcf4536e95bc467d0438
4
+ data.tar.gz: 49c1a74a43759e755c88ff965447295cb4beb5ed1e8f6da6d049d4dac840feee
5
5
  SHA512:
6
- metadata.gz: 1efdf76471fd6db0e49fd5b9f39dc27089b7ad8d60c6429a4cfcaf9fe0fd743461d1b208a0cbf038ef6275c632b93601afca00de6d24a890c12fedaf25eb2929
7
- data.tar.gz: b445830027fd9114880207b3cc33c1fb3df745ef23a2d84b078306a38d57eb319a21e8f6537448e4636698f2806d236425a89577eb99cd8de7242d7fb3559394
6
+ metadata.gz: f2c5119a00e999065041fe72546b5236642efc0131902b659f3e89d3b4c381bd747f107bc9142858cd05ff8907716c642e7b8ef3c5ef6717b0f19894874afde9
7
+ data.tar.gz: 249ba89e0cbd98113f0d0e913fd039608d585e9f5ae1c9b4d1f5002c4b3dded98964692616c341ff476f2a5602e7a29c45cd5287459182fa3c145fedf3ebe5fc
@@ -39,15 +39,8 @@ export const TableHeaderCell = ({
39
39
  sortIcon,
40
40
  table
41
41
  }: TableHeaderCellProps) => {
42
- const {
43
- sortControl,
44
- responsive,
45
- selectableRows,
46
- hasAnySubRows,
47
- showActionsBar,
48
- inlineRowLoading,
49
- isActionBarVisible,
50
- } = useContext(AdvancedTableContext);
42
+ const { sortControl, responsive, selectableRows, hasAnySubRows, showActionsBar, inlineRowLoading } =
43
+ useContext(AdvancedTableContext);
51
44
 
52
45
  type justifyTypes = "none" | "center" | "start" | "end" | "between" | "around" | "evenly"
53
46
 
@@ -72,7 +65,7 @@ export const TableHeaderCell = ({
72
65
 
73
66
  const cellClassName = classnames(
74
67
  "table-header-cells",
75
- `${showActionsBar && isActionBarVisible && "header-cells-with-actions"}`,
68
+ `${showActionsBar && "header-cells-with-actions"}`,
76
69
  `${isChrome() ? "chrome-styles" : ""}`,
77
70
  `${enableSorting ? "table-header-cells-active" : ""}`,
78
71
  { "pinned-left": responsive === "scroll" && isPinnedLeft },
@@ -31,12 +31,12 @@
31
31
  width: 100%;
32
32
  }
33
33
 
34
- .row-selection-actions-card {
35
- border-bottom-right-radius: 0px !important;
36
- border-bottom-left-radius: 0px !important;
37
- border-bottom-color: transparent;
38
- transition: height 300ms ease;
39
- }
34
+ .row-selection-actions-card {
35
+ border-bottom-right-radius: 0px !important;
36
+ border-bottom-left-radius: 0px !important;
37
+ border-bottom-color: transparent;
38
+ }
39
+
40
40
  .table-header-cells:first-child {
41
41
  min-width: 180px;
42
42
  }
@@ -1,4 +1,4 @@
1
- import React, { useState, useEffect, useCallback, useRef } from "react"
1
+ import React, { useState, useEffect, useCallback } from "react"
2
2
  import classnames from "classnames"
3
3
 
4
4
  import { GenericObject } from "../types"
@@ -27,7 +27,6 @@ import FlexItem from "../pb_flex/_flex_item"
27
27
  import AdvancedTableContext from "./Context/AdvancedTableContext"
28
28
 
29
29
  import { updateExpandAndCollapseState } from "./Utilities/ExpansionControlHelpers"
30
- import { showActionBar, hideActionBar } from "./Utilities/ActionBarAnimationHelper"
31
30
 
32
31
  import { CustomCell } from "./Components/CustomCell"
33
32
  import { TableHeader } from "./SubKits/TableHeader"
@@ -296,20 +295,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
296
295
  const onPageChange = (page: number) => {
297
296
  table.setPageIndex(page - 1)
298
297
  }
299
- //When to show the actions bar as a whole
300
- const isActionBarVisible = selectableRows && showActionsBar && selectedRowsLength > 0
301
-
302
- //Ref and useEffect for animating the actions bar
303
- const cardRef = useRef(null);
304
- useEffect(() => {
305
- if (cardRef.current) {
306
- if (isActionBarVisible) {
307
- showActionBar(cardRef.current);
308
- } else {
309
- hideActionBar(cardRef.current);
310
- }
311
- }
312
- }, [isActionBarVisible]);
313
298
 
314
299
  return (
315
300
  <div {...ariaProps}
@@ -326,7 +311,6 @@ const AdvancedTable = (props: AdvancedTableProps) => {
326
311
  expandedControl,
327
312
  handleExpandOrCollapse,
328
313
  inlineRowLoading,
329
- isActionBarVisible,
330
314
  loading,
331
315
  responsive,
332
316
  setExpanded,
@@ -349,24 +333,27 @@ const AdvancedTable = (props: AdvancedTableProps) => {
349
333
  total={table.getPageCount()}
350
334
  />
351
335
  }
352
- <Card
353
- borderNone={!isActionBarVisible}
354
- className={`${isActionBarVisible && "show-action-card row-selection-actions-card"}`}
355
- htmlOptions={{ ref: cardRef as any }}
356
- padding={`${isActionBarVisible ? "xs" : "none"}`}
357
- >
358
- <Flex alignItems="center"
359
- justify="between"
360
- >
361
- <Caption color="light"
362
- paddingLeft="xs"
363
- size="xs"
336
+ {
337
+ selectableRows && showActionsBar && (
338
+ <Card className="row-selection-actions-card"
339
+ padding="xs"
364
340
  >
365
- {selectedRowsLength} Selected
366
- </Caption>
367
- <FlexItem>{actions}</FlexItem>
368
- </Flex>
369
- </Card>
341
+ <Flex alignItems="center"
342
+ justify="between"
343
+ >
344
+ <Caption color="light"
345
+ paddingLeft="xs"
346
+ size="xs"
347
+ >
348
+ {selectedRowsLength} Selected
349
+ </Caption>
350
+ <FlexItem>
351
+ {actions}
352
+ </FlexItem>
353
+ </Flex>
354
+ </Card>
355
+ )
356
+ }
370
357
  <Table
371
358
  className={`${loading ? "content-loading" : ""}`}
372
359
  dark={dark}
@@ -1,4 +1,3 @@
1
1
  .pb_copy_button_kit {
2
- width: fit-content;
3
- height: fit-content;
2
+
4
3
  }
@@ -1,8 +1,8 @@
1
1
  examples:
2
- rails:
3
- - copy_button_default: Default
4
- - copy_button_from: Copy From
2
+
5
3
 
6
4
  react:
7
5
  - copy_button_default: Default
8
6
  - copy_button_from: Copy From
7
+
8
+
@@ -29,7 +29,6 @@ type DatePickerProps = {
29
29
  hideLabel?: boolean,
30
30
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
31
31
  id?: string,
32
- initializeOnce?: boolean,
33
32
  inLine?: boolean,
34
33
  inputAria?: { [key: string]: string },
35
34
  inputData?: { [key: string]: string },
@@ -74,7 +73,6 @@ const DatePicker = (props: DatePickerProps): React.ReactElement => {
74
73
  hideLabel = false,
75
74
  htmlOptions = {},
76
75
  id,
77
- initializeOnce = false,
78
76
  inLine = false,
79
77
  inputAria = {},
80
78
  inputData = {},
@@ -136,7 +134,7 @@ useEffect(() => {
136
134
  yearRange,
137
135
  required: false,
138
136
  }, scrollContainer)
139
- }, initializeOnce ? [] : undefined)
137
+ })
140
138
  const filteredProps = {...props}
141
139
  if (filteredProps.marginBottom === undefined) {
142
140
  filteredProps.marginBottom = "sm"
@@ -1,42 +1,77 @@
1
- import React, { useState } from "react";
2
- import { Button, Drawer, Flex } from "playbook-ui";
1
+ import React, { useState, useEffect } from "react"
2
+ import { Button, Drawer, Icon, Nav, NavItem } from "playbook-ui"
3
3
 
4
- const useDrawer = (visible = false) => {
5
- const [opened, setOpened] = useState(visible);
6
- const toggle = () => setOpened(!opened);
4
+ const DrawerMenu = () => {
5
+ const [isSmallScreen, setIsSmallScreen] = useState(false)
6
+ const navItems = ["Overview", "Albums", "Similar Artists"]
7
7
 
8
- return [opened, toggle];
9
- };
10
-
11
- const DrawerBreakpoints = () => {
12
- const [smallDrawerOpened, toggleSmallDrawer] = useDrawer();
8
+ useEffect(() => {
9
+ const mediaQuery = window.matchMedia("(max-width: 992px)")
10
+ const updateScreen = (e) => setIsSmallScreen(e.matches)
11
+ updateScreen(mediaQuery)
12
+ mediaQuery.addEventListener('change', updateScreen)
13
+ return () => mediaQuery.removeEventListener('change', updateScreen)
14
+ }, [])
13
15
 
14
16
  return (
15
- <>
16
- <Flex wrap>
17
- <Button
18
- id="sm"
19
- marginRight="md"
20
- onClick={toggleSmallDrawer}
21
- >
22
- {"Will open at small breakpoint"}
23
- </Button>
24
- </Flex>
25
- <Flex>
26
- <Drawer
27
- behavior={"push"}
28
- breakpoint="sm"
29
- onClose={toggleSmallDrawer}
30
- opened={smallDrawerOpened}
31
- overlay={false}
32
- placement={"right"}
33
- size={"lg"}
17
+ <div>
18
+ <Button id='sidebar'
19
+ padding='xs'
20
+ >
21
+ <Icon icon='bars'
22
+ size='2x'
23
+ />
24
+ </Button>
25
+ <Drawer
26
+ behavior={"push"}
27
+ breakpoint='md'
28
+ overlay={isSmallScreen ? true : false}
29
+ placement='left'
30
+ size='md'
31
+ triggerId='sidebar'
32
+ >
33
+ <Nav
34
+ link='#'
35
+ orientation='vertical'
36
+ padding={isSmallScreen ? "none" : "sm"}
37
+ variant='bold'
34
38
  >
35
- Open because small breakpoint
36
- </Drawer>
37
- </Flex>
38
- </>
39
- );
40
- };
39
+ {navItems.map((text, index) => {
40
+ return (
41
+ <NavItem
42
+ collapsible
43
+ collapsibleTrail
44
+ fontWeight='bolder'
45
+ iconLeft='city'
46
+ iconRight={["plus", "minus"]}
47
+ key={index}
48
+ link='#'
49
+ text={text}
50
+ >
51
+ <NavItem fontSize='small'
52
+ link='#'
53
+ marginY='none'
54
+ text='City'
55
+ />
56
+ <NavItem
57
+ fontSize='small'
58
+ link='#'
59
+ marginY='none'
60
+ text='People'
61
+ />
62
+ <NavItem
63
+ fontSize='small'
64
+ link='#'
65
+ marginY='none'
66
+ text='Business'
67
+ />
68
+ </NavItem>
69
+ )
70
+ })}
71
+ </Nav>
72
+ </Drawer>
73
+ </div>
74
+ )
75
+ }
41
76
 
42
- export default DrawerBreakpoints;
77
+ export default DrawerMenu
@@ -8,8 +8,8 @@ const DrawerMenu = () => {
8
8
  const mediaQuery = window.matchMedia("(max-width: 600px)")
9
9
  setIsSmallScreen(mediaQuery.matches)
10
10
  const handler = (e) => setIsSmallScreen(e.matches)
11
- mediaQuery.addEventListener('change', handler)
12
- return () => mediaQuery.removeEventListener('change', handler)
11
+ mediaQuery.addEventListener("change", handler)
12
+ return () => mediaQuery.removeEventListener("change", handler)
13
13
  }, [])
14
14
 
15
15
  return (
@@ -22,17 +22,17 @@ const DrawerMenu = () => {
22
22
  />
23
23
  </Button>
24
24
  <Drawer
25
- breakpoint="md"
25
+ breakpoint='md'
26
26
  placement='bottom'
27
27
  size='full'
28
28
  triggerId='menuButton'
29
29
  withinElement
30
30
  >
31
- <Nav
31
+ <Nav
32
32
  highlight={false}
33
33
  link='#'
34
- orientation={isSmallScreen ? 'vertical' : 'horizontal'}
35
- padding={isSmallScreen ? 'none' : 'sm'}
34
+ orientation={isSmallScreen ? "vertical" : "horizontal"}
35
+ padding={isSmallScreen ? "none" : "sm"}
36
36
  >
37
37
  <NavItem link='#'
38
38
  text='About'
@@ -10,4 +10,5 @@ examples:
10
10
  - drawer_menu: Within Element
11
11
  - drawer_sizes: Sizes
12
12
  - drawer_overlay: Overlay
13
+ - drawer_breakpoints: Breakpoints
13
14
  - drawer_borders: Borders
@@ -18,6 +18,7 @@ type HomeAddressStreetProps = {
18
18
  className?: string,
19
19
  data?: { [key: string]: string },
20
20
  dark?: boolean,
21
+ preserveCase?: boolean,
21
22
  emphasis: "street" | "city" | "none",
22
23
  htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
23
24
  homeId: string,
@@ -43,6 +44,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
43
44
  htmlOptions = {},
44
45
  homeId,
45
46
  homeUrl,
47
+ preserveCase = false,
46
48
  target,
47
49
  newWindow,
48
50
  houseStyle,
@@ -77,6 +79,8 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
77
79
  return null
78
80
  }
79
81
 
82
+ const formatStreetAdr = (address: string): string => preserveCase ? address : titleize(address)
83
+
80
84
  return (
81
85
  <div
82
86
  className={classes(className, dark)}
@@ -91,7 +95,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
91
95
  dark={dark}
92
96
  size={4}
93
97
  >
94
- {joinPresent([titleize(address), houseStyle], ' · ')}
98
+ {joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
95
99
  </Title>
96
100
  <Title
97
101
  className="pb_home_address_street_address"
@@ -101,14 +105,14 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
101
105
  {titleize(addressCont)}
102
106
  </Title>
103
107
  <Body color="light">
104
- {`${titleize(city)}, ${state} ${zipcode}`}
108
+ {`${titleize(city)}, ${state.toUpperCase()} ${zipcode}`}
105
109
  </Body>
106
110
  </div>
107
111
  }
108
112
  {emphasis == 'city' &&
109
113
  <div>
110
114
  <Body color="light">
111
- {joinPresent([titleize(address), houseStyle], ' · ')}
115
+ {joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
112
116
  </Body>
113
117
  <Body color="light">{titleize(addressCont)}</Body>
114
118
  <div>
@@ -118,7 +122,7 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
118
122
  size={4}
119
123
  tag="span"
120
124
  >
121
- {`${titleize(city)}, ${state}`}
125
+ {`${titleize(city)}, ${state.toUpperCase()}`}
122
126
  </Title>
123
127
  <Body
124
128
  color="light"
@@ -132,15 +136,15 @@ const HomeAddressStreet = (props: HomeAddressStreetProps): React.ReactElement =>
132
136
  {emphasis == 'none' &&
133
137
  <div>
134
138
  <Body dark={dark}>
135
- {joinPresent([titleize(address), houseStyle], ' · ')}
139
+ {joinPresent([formatStreetAdr(address), houseStyle], ' · ')}
136
140
  </Body>
137
- <Body dark={dark}>{titleize(addressCont)}</Body>
141
+ <Body dark={dark}>{formatStreetAdr(addressCont)}</Body>
138
142
  <div>
139
143
  <Body
140
144
  color="light"
141
145
  dark={dark}
142
146
  >
143
- {`${titleize(city)}, ${state} ${zipcode}`}
147
+ {`${titleize(city)}, ${state.toUpperCase()} ${zipcode}`}
144
148
  </Body>
145
149
  </div>
146
150
  </div>
@@ -0,0 +1,11 @@
1
+ <%= pb_rails("home_address_street", props: {
2
+ address: "70 pRoSpEcT ave",
3
+ address_cont: "Apt M18",
4
+ city: "West Chester",
5
+ home_id: 8250263,
6
+ home_url: "https://powerhrg.com/",
7
+ preserve_case: true,
8
+ state: "pa",
9
+ zipcode: "19382",
10
+ territory: "PHL",
11
+ }) %>
@@ -0,0 +1,22 @@
1
+ import React from 'react'
2
+
3
+ import HomeAddressStreet from '../_home_address_street'
4
+
5
+ const HomeAddressStreetFormatting = (props) => {
6
+ return (
7
+ <HomeAddressStreet
8
+ address="70 pRoSpEcT ave"
9
+ addressCont="Apt M18"
10
+ city="West Chester"
11
+ homeId="8250263"
12
+ homeUrl="https://powerhrg.com/"
13
+ preserveCase
14
+ state="pa"
15
+ territory="PHL"
16
+ zipcode="19382"
17
+ {...props}
18
+ />
19
+ )
20
+ }
21
+
22
+ export default HomeAddressStreetFormatting
@@ -0,0 +1 @@
1
+ The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserve_case: true`, the street address will be rendered exactly as entered, without automatic title capitalization.
@@ -0,0 +1 @@
1
+ The `state` prop will always capitalize the state name, even if the data entered is in lowercase. For example, when `state="pa"` is passed, it will be rendered as "PA". When you pass `preserveCase`, the street address will be rendered exactly as entered, without automatic title capitalization.
@@ -5,12 +5,14 @@ examples:
5
5
  - home_address_street_emphasis: Emphasis
6
6
  - home_address_street_modified: Modified
7
7
  - home_address_street_link: Link
8
+ - home_address_street_formatting: Formatting
8
9
 
9
10
  react:
10
11
  - home_address_street_default: Default
11
12
  - home_address_street_emphasis: Emphasis
12
13
  - home_address_street_modified: Modified
13
14
  - home_address_street_link: Link
15
+ - home_address_street_formatting: Formatting
14
16
 
15
17
  swift:
16
18
  - home_address_street_default_swift: Default
@@ -2,3 +2,4 @@ export { default as HomeAddressStreetDefault } from './_home_address_street_defa
2
2
  export { default as HomeAddressStreetEmphasis } from './_home_address_street_emphasis.jsx'
3
3
  export { default as HomeAddressStreetModified } from './_home_address_street_modified.jsx'
4
4
  export { default as HomeAddressStreetLink } from './_home_address_street_link.jsx'
5
+ export { default as HomeAddressStreetFormatting } from './_home_address_street_formatting.jsx'
@@ -18,6 +18,7 @@ module Playbook
18
18
  prop :state
19
19
  prop :zipcode
20
20
  prop :territory
21
+ prop :preserve_case, default: false
21
22
  prop :dark, type: Playbook::Props::Boolean, default: false
22
23
 
23
24
  def classname
@@ -29,7 +30,7 @@ module Playbook
29
30
  end
30
31
 
31
32
  def city_state
32
- [city&.titleize, state].join(", ")
33
+ [city&.titleize, state&.upcase].join(", ")
33
34
  end
34
35
 
35
36
  def zip
@@ -37,7 +38,7 @@ module Playbook
37
38
  end
38
39
 
39
40
  def address_house_style
40
- [address&.titleize, house_style].join(separator)
41
+ [format_street_address, house_style].join(separator)
41
42
  end
42
43
 
43
44
  def address_house_style2
@@ -48,6 +49,14 @@ module Playbook
48
49
  house_style ? " \u00b7 " : ""
49
50
  end
50
51
 
52
+ def format_street_address
53
+ preserve_case ? address : custom_titleize(address)
54
+ end
55
+
56
+ def custom_titleize(str)
57
+ str.split(" ").map(&:capitalize).join(" ")
58
+ end
59
+
51
60
  def city_emphasis_props
52
61
  {
53
62
  address_house_style: address_house_style,
@@ -2,7 +2,6 @@
2
2
  @import "../tokens/screen_sizes";
3
3
 
4
4
  $slides-margin: $space-md;
5
- $lightbox-z-index-floor: $z_10 !default;
6
5
 
7
6
  .carousel {
8
7
 
@@ -14,7 +13,7 @@ $lightbox-z-index-floor: $z_10 !default;
14
13
  top: 0;
15
14
  left: 0;
16
15
  right: 0;
17
- z-index: $lightbox-z-index-floor + 99;
16
+ z-index: 9999999;
18
17
  align-items: center;
19
18
  transition: all .5s;
20
19
 
@@ -56,7 +55,7 @@ $lightbox-z-index-floor: $z_10 !default;
56
55
  justify-content: space-between;
57
56
  flex-direction: column;
58
57
  background-color: black;
59
- z-index: $lightbox-z-index-floor + 1;
58
+ z-index: 1;
60
59
  overflow: hidden;
61
60
  }
62
61
 
@@ -64,7 +63,7 @@ $lightbox-z-index-floor: $z_10 !default;
64
63
  display: flex;
65
64
  height: calc(100% - 120px);
66
65
  width: 100%;
67
- z-index: $lightbox-z-index-floor + 1;
66
+ z-index: 1;
68
67
 
69
68
  [class^="react-transform-wrapper"] {
70
69
  flex-shrink: 0;
@@ -88,7 +87,7 @@ $lightbox-z-index-floor: $z_10 !default;
88
87
  .carousel-arrow-left {
89
88
  display: block;
90
89
  position: absolute;
91
- z-index: $lightbox-z-index-floor + 4;
90
+ z-index: 4;
92
91
  top: 50%;
93
92
  @media only screen and (max-width: $screen-xs-max) {
94
93
  display: none;
@@ -98,7 +97,7 @@ $lightbox-z-index-floor: $z_10 !default;
98
97
  .carousel-arrow-right {
99
98
  display: block;
100
99
  position: absolute;
101
- z-index: $lightbox-z-index-floor + 4;
100
+ z-index: 4;
102
101
  top: 50%;
103
102
  right: 0;
104
103
  @media only screen and (max-width: $screen-xs-max) {
@@ -141,7 +140,7 @@ $lightbox-z-index-floor: $z_10 !default;
141
140
  width: 100vw;
142
141
  padding: 3px;
143
142
  overflow: scroll;
144
- z-index: $lightbox-z-index-floor + 20;
143
+ z-index: 20;
145
144
  &.centered {
146
145
  justify-content: center;
147
146
  }
@@ -19,9 +19,7 @@ type LinkProps = {
19
19
  icon?: string,
20
20
  iconRight?: string,
21
21
  id?: string,
22
- tabIndex?: number,
23
22
  tag?: 'a' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
24
- target?: string,
25
23
  text?: string,
26
24
  underline?: boolean,
27
25
  } & GlobalProps
@@ -39,9 +37,7 @@ const Link = (props: LinkProps): React.ReactElement => {
39
37
  icon = '',
40
38
  iconRight = '',
41
39
  id = '',
42
- tabIndex,
43
40
  tag = 'a',
44
- target = '',
45
41
  text = '',
46
42
  underline = false,
47
43
  } = props
@@ -56,14 +52,6 @@ const Link = (props: LinkProps): React.ReactElement => {
56
52
  )
57
53
  const Tag = tag as keyof JSX.IntrinsicElements
58
54
 
59
- const getTargetAttribute = () => {
60
- if (target && href) {
61
- return target
62
- }
63
-
64
- return undefined
65
- }
66
-
67
55
  const renderContent = () => (
68
56
  <>
69
57
  {icon && (
@@ -99,9 +87,6 @@ const Link = (props: LinkProps): React.ReactElement => {
99
87
  <a
100
88
  {...commonProps}
101
89
  href={href}
102
- rel={target !== 'child' ? 'noreferrer' : undefined}
103
- tabIndex={tabIndex}
104
- target={getTargetAttribute()}
105
90
  >
106
91
  {renderContent()}
107
92
  </a>
@@ -111,9 +96,6 @@ const Link = (props: LinkProps): React.ReactElement => {
111
96
  <a
112
97
  {...commonProps}
113
98
  href={href}
114
- rel={target !== 'child' ? 'noreferrer' : undefined}
115
- tabIndex={tabIndex}
116
- target={getTargetAttribute()}
117
99
  >
118
100
  <Tag>{renderContent()}</Tag>
119
101
  </a>
@@ -1,18 +1,16 @@
1
1
  examples:
2
-
2
+
3
3
  rails:
4
4
  - link_color: Color
5
5
  - link_underline: Underline
6
6
  - link_icon: Icon
7
7
  - link_disabled: Disabled
8
8
  - link_tag: Tag
9
- - link_target: Target
10
-
11
-
9
+
10
+
12
11
  react:
13
12
  - link_color: Color
14
13
  - link_underline: Underline
15
14
  - link_icon: Icon
16
15
  - link_disabled: Disabled
17
16
  - link_tag: Tag
18
- - link_target: Target