playbook_ui 12.19.0.pre.alpha.movemarkdown639 → 12.20.0.pre.alpha.movemarkdown668

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleContent.tsx +38 -0
  3. data/app/pb_kits/playbook/pb_collapsible/child_kits/CollapsibleMain.tsx +94 -0
  4. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_calendar_input_icon.scss +33 -0
  5. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_day_styles.scss +78 -0
  6. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_flatpickr_styles.scss +775 -0
  7. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_header_styles.scss +116 -0
  8. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_inline_styles.scss +173 -0
  9. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_input_styles.scss +68 -0
  10. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_month_and_year_styles.scss +127 -0
  11. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_overrides.scss +47 -0
  12. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_time_selection_styles.scss +64 -0
  13. data/app/pb_kits/playbook/pb_date_picker/sass_partials/_week_styles.scss +127 -0
  14. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_body.tsx +25 -0
  15. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_footer.tsx +56 -0
  16. data/app/pb_kits/playbook/pb_dialog/child_kits/_dialog_header.tsx +68 -0
  17. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.scss +1 -2
  18. data/app/pb_kits/playbook/pb_multi_level_select/_multi_level_select.tsx +22 -7
  19. data/app/pb_kits/playbook/pb_multi_level_select/helper_functions.ts +32 -5
  20. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +9 -4
  21. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +5 -3
  22. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +2 -1
  23. data/app/pb_kits/playbook/pb_table/styles/_alignment.scss +32 -0
  24. data/app/pb_kits/playbook/pb_table/styles/_all.scss +19 -0
  25. data/app/pb_kits/playbook/pb_table/styles/_content.scss +13 -0
  26. data/app/pb_kits/playbook/pb_table/styles/_desktop_collapse.scss +125 -0
  27. data/app/pb_kits/playbook/pb_table/styles/_headers.scss +16 -0
  28. data/app/pb_kits/playbook/pb_table/styles/_hover.scss +74 -0
  29. data/app/pb_kits/playbook/pb_table/styles/_mobile.scss +125 -0
  30. data/app/pb_kits/playbook/pb_table/styles/_mobile_collapse.scss +125 -0
  31. data/app/pb_kits/playbook/pb_table/styles/_reset.scss +17 -0
  32. data/app/pb_kits/playbook/pb_table/styles/_side_highlight.scss +24 -0
  33. data/app/pb_kits/playbook/pb_table/styles/_single-line.scss +34 -0
  34. data/app/pb_kits/playbook/pb_table/styles/_sticky_header.scss +23 -0
  35. data/app/pb_kits/playbook/pb_table/styles/_structure.scss +50 -0
  36. data/app/pb_kits/playbook/pb_table/styles/_table-card.scss +62 -0
  37. data/app/pb_kits/playbook/pb_table/styles/_table-dark.scss +100 -0
  38. data/app/pb_kits/playbook/pb_table/styles/_tablet_collapse.scss +125 -0
  39. data/app/pb_kits/playbook/pb_table/styles/_variables.scss +26 -0
  40. data/app/pb_kits/playbook/pb_table/styles/_vertical_border.scss +16 -0
  41. data/app/pb_kits/playbook/pb_typeahead/{_typeahead.jsx → _typeahead.tsx} +24 -12
  42. data/app/pb_kits/playbook/pb_typeahead/components/ClearIndicator.tsx +18 -0
  43. data/app/pb_kits/playbook/pb_typeahead/components/Control.tsx +28 -0
  44. data/app/pb_kits/playbook/pb_typeahead/components/IndicatorsContainer.tsx +11 -0
  45. data/app/pb_kits/playbook/pb_typeahead/components/MenuList.tsx +10 -0
  46. data/app/pb_kits/playbook/pb_typeahead/components/MultiValue.tsx +66 -0
  47. data/app/pb_kits/playbook/pb_typeahead/components/Option.tsx +37 -0
  48. data/app/pb_kits/playbook/pb_typeahead/components/Placeholder.tsx +26 -0
  49. data/app/pb_kits/playbook/pb_typeahead/components/ValueContainer.tsx +11 -0
  50. data/app/pb_kits/playbook/pb_typeahead/{index.js → index.ts} +37 -29
  51. data/app/pb_kits/playbook/pb_typeahead/types.d.ts +2 -0
  52. data/app/pb_kits/playbook/pb_user/_user.tsx +1 -1
  53. data/app/pb_kits/playbook/utilities/_positioning.scss +14 -0
  54. data/app/pb_kits/playbook/utilities/globalProps.ts +16 -4
  55. data/dist/playbook-rails.js +4 -4
  56. data/lib/playbook/version.rb +2 -2
  57. data/lib/playbook/z_index.rb +20 -7
  58. metadata +46 -4
@@ -0,0 +1,25 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+ import { buildCss } from '../../utilities/props'
4
+ import { globalProps } from '../../utilities/globalProps'
5
+
6
+ type DialogBodyProps = {
7
+ children: React.ReactNode | React.ReactNode[] | string,
8
+ padding?: "xxs" | "xs" | "sm" | "md" | "lg" | "xl",
9
+ className?: string
10
+ }
11
+
12
+ // Body component
13
+ const DialogBody = (props: DialogBodyProps) => {
14
+ const { children, padding = "sm", className } = props
15
+ const bodyCSS = buildCss("dialog_body")
16
+ const bodySpacing = globalProps(props, { padding })
17
+
18
+ return (
19
+ <div className={classnames(bodyCSS, bodySpacing, className)}>
20
+ {children}
21
+ </div>
22
+ )
23
+ }
24
+
25
+ export default DialogBody
@@ -0,0 +1,56 @@
1
+ import React from 'react'
2
+ import classnames from 'classnames'
3
+
4
+ import { buildCss } from '../../utilities/props'
5
+ import { GlobalProps, globalProps } from '../../utilities/globalProps'
6
+
7
+ import Flex from '../../pb_flex/_flex'
8
+ import SectionSeparator from '../../pb_section_separator/_section_separator'
9
+
10
+
11
+ type DialogFooterProps = {
12
+ aria?: {[key: string]: string},
13
+ children: React.ReactChild[] | React.ReactChild | string,
14
+ className?: string,
15
+ data?: {[key: string]: string},
16
+ id?: string,
17
+ padding?: string,
18
+ paddingBottom?: string,
19
+ paddingX?: string,
20
+ separator?: boolean,
21
+ spacing?: "none" | "between" | "around" | "evenly",
22
+ } & GlobalProps
23
+
24
+ // Footer component
25
+ const DialogFooter = (props: DialogFooterProps) => {
26
+ const {
27
+ children,
28
+ padding = "sm",
29
+ paddingBottom = "sm",
30
+ paddingX = "sm",
31
+ className,
32
+ spacing = "between",
33
+ separator = false,
34
+ } = props
35
+
36
+ const footerCSS = buildCss("dialog_footer")
37
+ const footerSpacing = globalProps(props, { padding, paddingBottom, paddingX })
38
+
39
+ return (
40
+ <>
41
+ {separator &&
42
+ <SectionSeparator />
43
+ }
44
+ <div className="dialog-pseudo-footer">
45
+ </div>
46
+ <Flex
47
+ className={classnames(footerCSS, footerSpacing, className)}
48
+ spacing={spacing}
49
+ >
50
+ {children}
51
+ </Flex>
52
+ </>
53
+ )
54
+ }
55
+
56
+ export default DialogFooter
@@ -0,0 +1,68 @@
1
+ import React, { useContext } from 'react'
2
+ import classnames from 'classnames'
3
+ import { buildAriaProps, buildCss, buildDataProps } from '../../utilities/props'
4
+ import { globalProps, GlobalProps } from '../../utilities/globalProps'
5
+
6
+ import { CloseIcon } from '../_close_icon'
7
+ import { DialogContext } from '../_dialog_context'
8
+ import Flex from '../../pb_flex/_flex'
9
+ import SectionSeparator from '../../pb_section_separator/_section_separator'
10
+
11
+ type DialogHeaderProps = {
12
+ aria?: {[key: string]: string},
13
+ children: React.ReactNode[] | React.ReactNode | string,
14
+ className?: string,
15
+ closeable?: boolean,
16
+ data?: object,
17
+ id?: string,
18
+ padding?: string,
19
+ separator?: boolean,
20
+ spacing?: "none" | "between" | "around" | "evenly",
21
+ text?: string,
22
+ title?: string,
23
+ } & GlobalProps
24
+
25
+ const DialogHeader = (props: DialogHeaderProps) => {
26
+ const {
27
+ aria = {},
28
+ children,
29
+ className,
30
+ data = {},
31
+ padding = "sm",
32
+ spacing = "between",
33
+ closeable = true,
34
+ separator = true,
35
+ } = props
36
+
37
+ const ariaProps = buildAriaProps(aria)
38
+ const dataProps = buildDataProps(data)
39
+ const api = useContext(DialogContext)
40
+ const headerCSS = buildCss("dialog_header")
41
+ const headerSpacing = globalProps(props, { padding })
42
+
43
+ /* eslint-disable react/jsx-handler-names */
44
+
45
+ return (
46
+ <div className="dialog_sticky_header">
47
+ <Flex
48
+ {...ariaProps}
49
+ {...dataProps}
50
+ className={classnames(headerCSS, headerSpacing, className)}
51
+ spacing={spacing}
52
+ >
53
+ {children}
54
+ {closeable &&
55
+ <CloseIcon
56
+ onClose={api.onClose}
57
+ />
58
+ }
59
+
60
+ </Flex>
61
+ {separator &&
62
+ <SectionSeparator />
63
+ }
64
+ </div>
65
+ )
66
+ }
67
+
68
+ export default DialogHeader
@@ -36,10 +36,9 @@
36
36
  vertical-align: top;
37
37
  width: 0.6em;
38
38
  top: 10px;
39
- transform: rotate(135deg);
40
39
  font-size: 0.5em;
41
40
 
42
- transform: rotate(-45deg);
41
+ transform: rotate(45deg);
43
42
  top: 12px;
44
43
  }
45
44
 
@@ -2,7 +2,7 @@ import React, { useState, useEffect, useMemo } from "react";
2
2
  import classnames from "classnames";
3
3
  import { buildAriaProps, buildCss, buildDataProps } from "../utilities/props";
4
4
  import { globalProps } from "../utilities/globalProps";
5
- import { findItemById, checkIt, unCheckIt } from "./helper_functions";
5
+ import { findItemById, checkIt, unCheckIt, getParentAndAncestorsIds } from "./helper_functions";
6
6
  import MultiSelectHelper from "./_multi_select_helper";
7
7
 
8
8
  type MultiLevelSelectProps = {
@@ -42,17 +42,31 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
42
42
  const updatedData = formattedData.map((item: any) => {
43
43
  if (item.id === currentNode._id) {
44
44
  if (currentNode.checked) {
45
- checkIt(item, selectedItems, setSelectedItems);
45
+ checkIt(item, selectedItems, setSelectedItems, false);
46
46
  } else {
47
- unCheckIt(item, selectedItems, setSelectedItems);
47
+ unCheckIt(item, selectedItems, setSelectedItems, false);
48
48
  }
49
49
  } else if (item.children) {
50
50
  const foundItem = findItemById(item.children, currentNode._id);
51
51
  if (foundItem) {
52
52
  if (currentNode.checked) {
53
- checkIt(foundItem, selectedItems, setSelectedItems);
53
+ checkIt(foundItem, selectedItems, setSelectedItems, false);
54
+ if (currentNode._parent) {
55
+ const parents = getParentAndAncestorsIds(currentNode._parent, formattedData)
56
+ parents.forEach((item:string) => {
57
+ const ancestor = findItemById(formattedData,item)
58
+ ancestor.expanded = true
59
+ });
60
+ }
54
61
  } else {
55
- unCheckIt(foundItem, selectedItems, setSelectedItems);
62
+ unCheckIt(foundItem, selectedItems, setSelectedItems, false);
63
+ if (currentNode._parent) {
64
+ const parents = getParentAndAncestorsIds(currentNode._parent, formattedData)
65
+ parents.forEach((item:string) => {
66
+ const ancestor = findItemById(formattedData,item)
67
+ ancestor.expanded = true
68
+ });
69
+ }
56
70
  }
57
71
  }
58
72
  }
@@ -92,17 +106,18 @@ const MultiLevelSelect = (props: MultiLevelSelectProps) => {
92
106
  treeData={formattedData}
93
107
  onChange={(
94
108
  // @ts-ignore
95
- selectedNodes: { [key: string]: any }[],
109
+ selectedNodes: { [key: string]: any }[],
96
110
  currentNode: { [key: string]: any }[]
97
111
  ) => {
98
112
  setCheckedData(currentNode);
99
113
  onSelect(currentNode);
114
+
100
115
  }}
101
116
  id={id}
102
117
  {...props}
103
118
  />
104
119
  );
105
- }, [formattedData]);
120
+ }, [formattedData])
106
121
 
107
122
  return (
108
123
  <div {...ariaProps} {...dataProps} className={classes} id={id}>
@@ -19,19 +19,20 @@ export const findItemById = (
19
19
  export const checkIt = (
20
20
  foundItem: { [key: string]: any },
21
21
  selectedItems: any[],
22
- setSelectedItems: Function
22
+ setSelectedItems: Function,
23
+ expand: boolean
23
24
  ) => {
24
25
  if (!foundItem) {
25
26
  return;
26
27
  }
27
28
 
28
29
  foundItem.checked = true;
29
- foundItem.expanded = true;
30
+ foundItem.expanded = expand;
30
31
  selectedItems.push(foundItem);
31
32
 
32
33
  if (foundItem.children) {
33
34
  foundItem.children.map((x: any) => {
34
- checkIt(x, selectedItems, setSelectedItems);
35
+ checkIt(x, selectedItems, setSelectedItems, expand);
35
36
  });
36
37
  }
37
38
 
@@ -41,20 +42,46 @@ export const checkIt = (
41
42
  export const unCheckIt = (
42
43
  foundItem: { [key: string]: any },
43
44
  selectedItems: any,
44
- setSelectedItems: any
45
+ setSelectedItems: any,
46
+ expand: boolean
45
47
  ) => {
46
48
  if (!foundItem) {
47
49
  return;
48
50
  }
49
51
 
50
52
  foundItem.checked = false;
53
+ foundItem.expanded = false;
51
54
  const newSelectedItems = selectedItems.filter(
52
55
  (item: any) => item.id !== foundItem.id
53
56
  );
54
57
  if (foundItem.children) {
55
58
  foundItem.children.map((x: any) => {
56
- unCheckIt(x, selectedItems, setSelectedItems);
59
+ unCheckIt(x, selectedItems, setSelectedItems, expand);
57
60
  });
58
61
  }
59
62
  setSelectedItems([...newSelectedItems]);
60
63
  };
64
+
65
+
66
+ export const getParentAndAncestorsIds = (itemId:string, items:{ [key: string]: string; }[], ancestors:string[] = []):any => {
67
+ for (let i = 0; i < items.length; i++) {
68
+ const item:any = items[i];
69
+ if (item.id === itemId) {
70
+ // item found in current level of items array
71
+ return [...ancestors, item.id];
72
+ }
73
+ if (item.children && item.children.length > 0) {
74
+ // recursively search through children
75
+ const foundAncestors = getParentAndAncestorsIds(
76
+ itemId,
77
+ item.children,
78
+ [...ancestors, item.id]
79
+ );
80
+ if (foundAncestors) {
81
+ return foundAncestors;
82
+ }
83
+ }
84
+ }
85
+ // item not found in this level of items array or its children
86
+ return null;
87
+ }
@@ -81,10 +81,11 @@ $pb_selectable_card_border: 2px;
81
81
  }
82
82
 
83
83
  .separator {
84
- width: 2px;
85
- margin-right: 0px;
86
84
  background: $royal;
87
85
  }
86
+ .psuedo_separator {
87
+ background-color: $royal;
88
+ }
88
89
  }
89
90
  }
90
91
  }
@@ -125,13 +126,17 @@ $pb_selectable_card_border: 2px;
125
126
 
126
127
  .separator {
127
128
  align-self: stretch;
128
- width: 1px;
129
- margin-right: 1px;
129
+ padding-right: 1px;
130
130
  margin-top: -1px;
131
131
  margin-bottom: -1px;
132
132
  background: $border_light;
133
133
  }
134
134
 
135
+ .psuedo_separator {
136
+ align-self: stretch;
137
+ padding-right: 1px;
138
+ }
139
+
135
140
  &.error {
136
141
  > label {
137
142
  border-color: $error;
@@ -13,9 +13,9 @@ import {
13
13
 
14
14
  import Icon from '../pb_icon/_icon'
15
15
  import Checkbox from '../pb_checkbox/_checkbox'
16
- import Card from '../pb_card/_card'
17
16
  import Flex from '../pb_flex/_flex'
18
17
  import Radio from '../pb_radio/_radio'
18
+ import Card from '../pb_card/_card'
19
19
 
20
20
  type SelectableCardProps = {
21
21
  aria?: { [key: string]: string },
@@ -149,13 +149,15 @@ const SelectableCard = (props: SelectableCardProps) => {
149
149
  </Input>
150
150
  </Flex>
151
151
  <div className="separator" />
152
- <Card.Body
152
+ <div className="psuedo_separator"/>
153
+ <Card
154
+ borderNone
153
155
  dark={dark}
154
156
  padding="sm"
155
157
  status={error ? 'negative' : null}
156
158
  >
157
159
  {text ||props.children}
158
- </Card.Body>
160
+ </Card>
159
161
  </Flex>
160
162
  :
161
163
  text || props.children
@@ -24,7 +24,8 @@
24
24
  <% end %>
25
25
  <% end %>
26
26
  <div class="separator"></div>
27
- <%= pb_rails("card/card_body", props: { padding: "sm", status: object.status }) do %>
27
+ <div class="psuedo_separator"></div>
28
+ <%= pb_rails("card", props: { padding: "sm", status: object.status, border_none: true }) do %>
28
29
  <% if content.nil? %>
29
30
  <%= pb_rails("body", props: { text: object.text }) %>
30
31
  <% else %>
@@ -0,0 +1,32 @@
1
+ [class^=pb_table] {
2
+ tr {
3
+ vertical-align: top;
4
+ }
5
+
6
+ // Text Align
7
+ tr[align=center] th,
8
+ tr th[align=center] {
9
+ text-align: center !important;
10
+ }
11
+ tr[align=right] th,
12
+ tr th[align=right] {
13
+ text-align: right !important;
14
+ }
15
+
16
+ // Column Align
17
+ tr[shift=up],
18
+ td[shift=up],
19
+ th[shift=up] {
20
+ vertical-align: top;
21
+ }
22
+ tr[shift=middle],
23
+ td[shift=middle],
24
+ th[shift=middle] {
25
+ vertical-align: middle;
26
+ }
27
+ tr[shift=down],
28
+ td[shift=down],
29
+ th[shift=down] {
30
+ vertical-align: bottom;
31
+ }
32
+ }
@@ -0,0 +1,19 @@
1
+ @import "../../tokens/colors";
2
+
3
+ @import "variables";
4
+ @import "reset";
5
+ @import "structure";
6
+ @import "table-card";
7
+ @import "content";
8
+ @import "headers";
9
+ @import "side_highlight";
10
+ @import "alignment";
11
+ @import "hover";
12
+ @import "single-line";
13
+ @import "table-dark";
14
+ @import "mobile";
15
+ @import "mobile_collapse";
16
+ @import "tablet_collapse";
17
+ @import "desktop_collapse";
18
+ @import "sticky_header";
19
+ @import "vertical_border";
@@ -0,0 +1,13 @@
1
+ [class^=pb_table] {
2
+ &.table-sm,
3
+ &.table-md,
4
+ &.table-lg {
5
+ tbody {
6
+ tr {
7
+ td {
8
+ font-size: $default-font-size;
9
+ }
10
+ }
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,125 @@
1
+ @import "../../tokens/border_radius";
2
+ @import "../../tokens/positioning";
3
+ @import "../../pb_caption/caption_mixin";
4
+
5
+ @media only screen and (max-width: $screen-xl-min) {
6
+ [class^=pb_table] {
7
+ &.table-sm.table-collapse-lg,
8
+ &.table-md.table-collapse-lg,
9
+ &.table-lg.table-collapse-lg {
10
+ width: 100%;
11
+ background: none !important;
12
+
13
+ thead {
14
+ tr {
15
+ left: $offscreen;
16
+ position: absolute;
17
+ top: $offscreen;
18
+
19
+ th {
20
+ display: block;
21
+ visibility: visible;
22
+ }
23
+ }
24
+ }
25
+ tbody {
26
+ tr {
27
+ td {
28
+ display: block;
29
+ visibility: visible;
30
+ border-left-width: 1px !important;
31
+ border-right-width: 1px !important;
32
+ border-bottom-width: 0 !important;
33
+ border-color: $border_light !important;
34
+ min-height: 2.2em;
35
+ position: relative;
36
+ text-align:left;
37
+ white-space: normal;
38
+ &:before {
39
+ content: attr(data-title);
40
+ @include caption;
41
+ width: 100% !important;
42
+ white-space: nowrap !important;
43
+ text-overflow: ellipsis !important;
44
+ position: relative !important;
45
+ top: 0 !important;
46
+ left: 0 !important;
47
+ height: 100% !important;
48
+ padding-left: 0 !important;
49
+ display: block !important;
50
+ }
51
+
52
+ &:first-child {
53
+ margin-top: $space_md !important;
54
+ border-top-width: 1px !important;
55
+ border-top-color: $border_light !important;
56
+ border-radius: $border_rad_light $border_rad_light 0 0;
57
+ }
58
+
59
+ &:last-child {
60
+ border-radius: 0 0 $border_rad_light $border_rad_light;
61
+ border-bottom-width: 1px !important;
62
+ }
63
+ }
64
+
65
+ &:first-child {
66
+ td {
67
+ &:first-child {
68
+ margin-top: $space-xs !important;
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ &.table-card {
75
+ background: none !important;
76
+
77
+ tbody {
78
+ tr {
79
+ td {
80
+ background: $white !important;
81
+ border-left-width: 1px !important;
82
+ border-right-width: 1px !important;
83
+ border-top-width: 1px !important;
84
+ &:after {
85
+ height: 0;
86
+ background-color: transparent;
87
+ }
88
+
89
+ &:first-child {
90
+ border-radius: $border_rad_light $border_rad_light 0 0 !important;
91
+ }
92
+ &:last-child {
93
+ border-radius: 0 0 $border_rad_light $border_rad_light !important;
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ @media (hover:hover) {
100
+ &:hover {
101
+ tbody {
102
+ tr {
103
+ box-shadow: 0 0 0 $white !important;
104
+ }
105
+ }
106
+ }
107
+ }
108
+ // reset the first and last to normalize
109
+ @each $name, $value in $cell-pad-list {
110
+ &.#{$name} {
111
+ tbody {
112
+ tr {
113
+ td {
114
+ &:first-child,
115
+ &:last-child {
116
+ padding: $value $cell-gutter !important;
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ }
124
+ }
125
+ }
@@ -0,0 +1,16 @@
1
+ @import "../../pb_caption/caption_mixin";
2
+
3
+ [class^=pb_table] {
4
+ &.table-sm,
5
+ &.table-md,
6
+ &.table-lg {
7
+ thead {
8
+ tr {
9
+ th {
10
+ @include caption;
11
+ border-bottom: 1px solid $border_light;
12
+ }
13
+ }
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,74 @@
1
+ @import "../../tokens/opacity";
2
+
3
+ $transition-speed: 0.2s;
4
+
5
+ [class^=pb_table] {
6
+ &.table-sm,
7
+ &.table-md,
8
+ &.table-lg {
9
+ &:not(.no-hover) {
10
+ border-collapse: collapse;
11
+ tbody {
12
+ tr {
13
+ box-shadow: 0 0 0 $white;
14
+ transition: box-shadow $transition-speed ease;
15
+ td {
16
+ border-top-color: transparent;
17
+ border-top-width: 0;
18
+ transition: all $transition-speed ease;
19
+ }
20
+ @media (hover:hover) {
21
+ td {
22
+ position: relative;
23
+ &:after {
24
+ transition: background-color $transition-speed ease, height $transition-speed ease;
25
+ content: "";
26
+ position: absolute;
27
+ display: block;
28
+ top: -1px;
29
+ left: 0;
30
+ right: 0;
31
+ height: 0;
32
+ background-color: transparent;
33
+ }
34
+ &:first-child:after {
35
+ left: -1px;
36
+ }
37
+ &:last-child:after {
38
+ right: -1px;
39
+ }
40
+ }
41
+ &:hover {
42
+ box-shadow: 0 2px 10px 0 rgba($slate, $opacity-6);
43
+ td {
44
+ border-color: darken($border_light, 10%);
45
+ border-top-width: 0;
46
+ border-top-color: transparent;
47
+ &:after {
48
+ transition: background-color $transition-speed ease, height $transition-speed ease;
49
+ background-color: darken($border_light, 10%);
50
+ height: 1px;
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ &.table-card {
58
+ border-collapse: separate;
59
+ tbody {
60
+ tr {
61
+ td {
62
+ &:first-child {
63
+ border-left-width: 1px;
64
+ }
65
+ &:last-child {
66
+ border-right-width: 1px;
67
+ }
68
+ }
69
+ }
70
+ }
71
+ }
72
+ }
73
+ }
74
+ }