playbook_ui 14.6.2.pre.alpha.PLAY15814384 → 14.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/app/pb_kits/playbook/_playbook.scss +1 -2
  3. data/app/pb_kits/playbook/pb_card/_card.tsx +4 -11
  4. data/app/pb_kits/playbook/pb_card/_card_mixin.scss +2 -1
  5. data/app/pb_kits/playbook/pb_currency/_currency.tsx +6 -16
  6. data/app/pb_kits/playbook/pb_currency/currency.rb +11 -38
  7. data/app/pb_kits/playbook/pb_currency/currency.test.js +0 -35
  8. data/app/pb_kits/playbook/pb_currency/docs/example.yml +1 -3
  9. data/app/pb_kits/playbook/pb_currency/docs/index.js +0 -1
  10. data/app/pb_kits/playbook/pb_dialog/_dialog.tsx +1 -5
  11. data/app/pb_kits/playbook/pb_flex/_flex.tsx +1 -3
  12. data/app/pb_kits/playbook/pb_flex/_flex_item.tsx +2 -8
  13. data/app/pb_kits/playbook/pb_flex/flex_item.html.erb +6 -3
  14. data/app/pb_kits/playbook/pb_flex/flex_item.rb +2 -7
  15. data/app/pb_kits/playbook/pb_form_pill/_form_pill.scss +2 -6
  16. data/app/pb_kits/playbook/pb_form_pill/_form_pill.tsx +26 -30
  17. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb +1 -24
  18. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx +2 -25
  19. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md +1 -0
  20. data/app/pb_kits/playbook/pb_form_pill/form_pill.html.erb +8 -46
  21. data/app/pb_kits/playbook/pb_popover/_popover.tsx +1 -1
  22. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +1 -67
  23. data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.tsx +0 -1
  24. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
  25. data/app/pb_kits/playbook/pb_selectable_card/selectable_card.rb +1 -5
  26. data/app/pb_kits/playbook/pb_timeline/_item.tsx +23 -59
  27. data/app/pb_kits/playbook/pb_timeline/_timeline.tsx +0 -8
  28. data/app/pb_kits/playbook/pb_timeline/docs/example.yml +1 -2
  29. data/app/pb_kits/playbook/pb_timeline/docs/index.js +0 -1
  30. data/app/pb_kits/playbook/pb_timeline/item.html.erb +21 -17
  31. data/app/pb_kits/playbook/pb_timeline/item.rb +0 -4
  32. data/app/pb_kits/playbook/pb_timeline/timeline.test.js +0 -84
  33. data/app/pb_kits/playbook/tokens/_typography.scss +0 -35
  34. data/app/pb_kits/playbook/utilities/globalPropNames.mjs +0 -3
  35. data/app/pb_kits/playbook/utilities/globalProps.ts +2 -39
  36. data/dist/chunks/_typeahead-BV_n6U5W.js +22 -0
  37. data/dist/chunks/_weekday_stacked-Cy__g00H.js +45 -0
  38. data/dist/chunks/lazysizes-DHz07jlL.js +1 -0
  39. data/dist/chunks/vendor.js +1 -1
  40. data/dist/menu.yml +0 -3
  41. data/dist/playbook-doc.js +1 -1
  42. data/dist/playbook-rails-react-bindings.js +1 -1
  43. data/dist/playbook-rails.js +1 -1
  44. data/dist/playbook.css +1 -1
  45. data/lib/playbook/kit_base.rb +5 -43
  46. data/lib/playbook/version.rb +2 -2
  47. metadata +9 -43
  48. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb +0 -7
  49. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx +0 -18
  50. data/app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.md +0 -3
  51. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_rails.md +0 -3
  52. data/app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_react.md +0 -1
  53. data/app/pb_kits/playbook/pb_link/_link.scss +0 -66
  54. data/app/pb_kits/playbook/pb_link/_link.tsx +0 -107
  55. data/app/pb_kits/playbook/pb_link/docs/_link_color.html.erb +0 -30
  56. data/app/pb_kits/playbook/pb_link/docs/_link_color.jsx +0 -40
  57. data/app/pb_kits/playbook/pb_link/docs/_link_disabled.html.erb +0 -5
  58. data/app/pb_kits/playbook/pb_link/docs/_link_disabled.jsx +0 -15
  59. data/app/pb_kits/playbook/pb_link/docs/_link_icon.html.erb +0 -15
  60. data/app/pb_kits/playbook/pb_link/docs/_link_icon.jsx +0 -25
  61. data/app/pb_kits/playbook/pb_link/docs/_link_tag.html.erb +0 -35
  62. data/app/pb_kits/playbook/pb_link/docs/_link_tag.jsx +0 -45
  63. data/app/pb_kits/playbook/pb_link/docs/_link_underline.html.erb +0 -5
  64. data/app/pb_kits/playbook/pb_link/docs/_link_underline.jsx +0 -15
  65. data/app/pb_kits/playbook/pb_link/docs/example.yml +0 -16
  66. data/app/pb_kits/playbook/pb_link/docs/index.js +0 -5
  67. data/app/pb_kits/playbook/pb_link/link.html.erb +0 -21
  68. data/app/pb_kits/playbook/pb_link/link.rb +0 -44
  69. data/app/pb_kits/playbook/pb_link/link.test.jsx +0 -92
  70. data/app/pb_kits/playbook/pb_timeline/detail.html.erb +0 -3
  71. data/app/pb_kits/playbook/pb_timeline/detail.rb +0 -11
  72. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb +0 -43
  73. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx +0 -68
  74. data/app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.md +0 -2
  75. data/app/pb_kits/playbook/pb_timeline/label.html.erb +0 -12
  76. data/app/pb_kits/playbook/pb_timeline/label.rb +0 -13
  77. data/app/pb_kits/playbook/pb_timeline/step.html.erb +0 -14
  78. data/app/pb_kits/playbook/pb_timeline/step.rb +0 -16
  79. data/app/pb_kits/playbook/pb_timeline/subcomponents/Detail.tsx +0 -29
  80. data/app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx +0 -38
  81. data/app/pb_kits/playbook/pb_timeline/subcomponents/Step.tsx +0 -42
  82. data/app/pb_kits/playbook/pb_timeline/subcomponents/index.tsx +0 -3
  83. data/dist/chunks/_typeahead-C-6MLSyC.js +0 -22
  84. data/dist/chunks/_weekday_stacked-CFhGhr9V.js +0 -45
  85. data/dist/chunks/lazysizes-B7xYodB-.js +0 -1
@@ -73,15 +73,15 @@ module Playbook
73
73
  prop :aria, type: Playbook::Props::HashProp, default: {}
74
74
  prop :html_options, type: Playbook::Props::HashProp, default: {}
75
75
  prop :children, type: Playbook::Props::Proc
76
- prop :style, type: Playbook::Props::HashProp, default: {}
77
- prop :height
78
- prop :min_height
79
- prop :max_height
80
76
 
81
77
  def object
82
78
  self
83
79
  end
84
80
 
81
+ def combined_html_options
82
+ default_html_options.merge(html_options.deep_merge(data_attributes))
83
+ end
84
+
85
85
  # rubocop:disable Layout/CommentIndentation
86
86
  # pb_content_tag information (potentially to be abstracted into its own dev doc in the future)
87
87
  # The pb_content_tag generates HTML content tags for rails kits with flexible options.
@@ -110,48 +110,15 @@ module Playbook
110
110
  end
111
111
  # rubocop:enable Style/OptionalBooleanParameter
112
112
 
113
- def combined_html_options
114
- merged = default_html_options.dup
115
-
116
- html_options.each do |key, value|
117
- if key == :style && value.is_a?(Hash)
118
- # Convert style hash to CSS string
119
- merged[:style] = value.map { |k, v| "#{k.to_s.gsub('_', '-')}: #{v}" }.join("; ")
120
- else
121
- merged[key] = value
122
- end
123
- end
124
-
125
- inline_styles = dynamic_inline_props
126
- merged[:style] = if inline_styles.present?
127
- merged[:style].present? ? "#{merged[:style]}; #{inline_styles}" : inline_styles
128
- end
129
-
130
- merged.deep_merge(data_attributes)
131
- end
132
-
133
- def global_inline_props
134
- {
135
- height: height,
136
- min_height: min_height,
137
- max_height: max_height,
138
- }.compact
139
- end
140
-
141
113
  private
142
114
 
143
115
  def default_options
144
- options = {
116
+ {
145
117
  id: id,
146
118
  data: data,
147
119
  class: classname,
148
120
  aria: aria,
149
121
  }
150
-
151
- inline_styles = dynamic_inline_props
152
- options[:style] = inline_styles if inline_styles.present? && !html_options.key?(:style)
153
-
154
- options
155
122
  end
156
123
 
157
124
  def default_html_options
@@ -164,10 +131,5 @@ module Playbook
164
131
  aria: aria,
165
132
  }.transform_keys { |key| key.to_s.tr("_", "-").to_sym }
166
133
  end
167
-
168
- def dynamic_inline_props
169
- styles = global_inline_props.map { |key, value| "#{key.to_s.gsub('_', '-')}: #{value}" if value.present? }.compact
170
- styles.join("; ").presence
171
- end
172
134
  end
173
135
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Playbook
4
- PREVIOUS_VERSION = "14.6.2"
5
- VERSION = "14.6.2.pre.alpha.PLAY15814384"
4
+ PREVIOUS_VERSION = "14.6.1"
5
+ VERSION = "14.6.2"
6
6
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: playbook_ui
3
3
  version: !ruby/object:Gem::Version
4
- version: 14.6.2.pre.alpha.PLAY15814384
4
+ version: 14.6.2
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
- date: 2024-11-05 00:00:00.000000000 Z
12
+ date: 2024-10-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -762,9 +762,6 @@ files:
762
762
  - app/pb_kits/playbook/pb_currency/docs/_currency_alignment.html.erb
763
763
  - app/pb_kits/playbook/pb_currency/docs/_currency_alignment.jsx
764
764
  - app/pb_kits/playbook/pb_currency/docs/_currency_alignment_swift.md
765
- - app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.html.erb
766
- - app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.jsx
767
- - app/pb_kits/playbook/pb_currency/docs/_currency_comma_separator.md
768
765
  - app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals.html.erb
769
766
  - app/pb_kits/playbook/pb_currency/docs/_currency_matching_decimals.jsx
770
767
  - app/pb_kits/playbook/pb_currency/docs/_currency_no_symbol.html.erb
@@ -1385,8 +1382,7 @@ files:
1385
1382
  - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_tag.jsx
1386
1383
  - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.html.erb
1387
1384
  - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.jsx
1388
- - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_rails.md
1389
- - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text_react.md
1385
+ - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_truncated_text.md
1390
1386
  - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.html.erb
1391
1387
  - app/pb_kits/playbook/pb_form_pill/docs/_form_pill_user.jsx
1392
1388
  - app/pb_kits/playbook/pb_form_pill/docs/example.yml
@@ -1736,23 +1732,6 @@ files:
1736
1732
  - app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js
1737
1733
  - app/pb_kits/playbook/pb_line_graph/line_graph.html.erb
1738
1734
  - app/pb_kits/playbook/pb_line_graph/line_graph.rb
1739
- - app/pb_kits/playbook/pb_link/_link.scss
1740
- - app/pb_kits/playbook/pb_link/_link.tsx
1741
- - app/pb_kits/playbook/pb_link/docs/_link_color.html.erb
1742
- - app/pb_kits/playbook/pb_link/docs/_link_color.jsx
1743
- - app/pb_kits/playbook/pb_link/docs/_link_disabled.html.erb
1744
- - app/pb_kits/playbook/pb_link/docs/_link_disabled.jsx
1745
- - app/pb_kits/playbook/pb_link/docs/_link_icon.html.erb
1746
- - app/pb_kits/playbook/pb_link/docs/_link_icon.jsx
1747
- - app/pb_kits/playbook/pb_link/docs/_link_tag.html.erb
1748
- - app/pb_kits/playbook/pb_link/docs/_link_tag.jsx
1749
- - app/pb_kits/playbook/pb_link/docs/_link_underline.html.erb
1750
- - app/pb_kits/playbook/pb_link/docs/_link_underline.jsx
1751
- - app/pb_kits/playbook/pb_link/docs/example.yml
1752
- - app/pb_kits/playbook/pb_link/docs/index.js
1753
- - app/pb_kits/playbook/pb_link/link.html.erb
1754
- - app/pb_kits/playbook/pb_link/link.rb
1755
- - app/pb_kits/playbook/pb_link/link.test.jsx
1756
1735
  - app/pb_kits/playbook/pb_list/_list.scss
1757
1736
  - app/pb_kits/playbook/pb_list/_list.tsx
1758
1737
  - app/pb_kits/playbook/pb_list/_list_item.tsx
@@ -2739,16 +2718,11 @@ files:
2739
2718
  - app/pb_kits/playbook/pb_timeline/_item.tsx
2740
2719
  - app/pb_kits/playbook/pb_timeline/_timeline.scss
2741
2720
  - app/pb_kits/playbook/pb_timeline/_timeline.tsx
2742
- - app/pb_kits/playbook/pb_timeline/detail.html.erb
2743
- - app/pb_kits/playbook/pb_timeline/detail.rb
2744
2721
  - app/pb_kits/playbook/pb_timeline/docs/_description.md
2745
2722
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_default.html.erb
2746
2723
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_default.jsx
2747
2724
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.html.erb
2748
2725
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_vertical.jsx
2749
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.html.erb
2750
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.jsx
2751
- - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_children.md
2752
2726
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.html.erb
2753
2727
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.jsx
2754
2728
  - app/pb_kits/playbook/pb_timeline/docs/_timeline_with_date.md
@@ -2756,14 +2730,6 @@ files:
2756
2730
  - app/pb_kits/playbook/pb_timeline/docs/index.js
2757
2731
  - app/pb_kits/playbook/pb_timeline/item.html.erb
2758
2732
  - app/pb_kits/playbook/pb_timeline/item.rb
2759
- - app/pb_kits/playbook/pb_timeline/label.html.erb
2760
- - app/pb_kits/playbook/pb_timeline/label.rb
2761
- - app/pb_kits/playbook/pb_timeline/step.html.erb
2762
- - app/pb_kits/playbook/pb_timeline/step.rb
2763
- - app/pb_kits/playbook/pb_timeline/subcomponents/Detail.tsx
2764
- - app/pb_kits/playbook/pb_timeline/subcomponents/Label.tsx
2765
- - app/pb_kits/playbook/pb_timeline/subcomponents/Step.tsx
2766
- - app/pb_kits/playbook/pb_timeline/subcomponents/index.tsx
2767
2733
  - app/pb_kits/playbook/pb_timeline/timeline.html.erb
2768
2734
  - app/pb_kits/playbook/pb_timeline/timeline.rb
2769
2735
  - app/pb_kits/playbook/pb_timeline/timeline.test.js
@@ -3133,9 +3099,9 @@ files:
3133
3099
  - app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
3134
3100
  - app/pb_kits/playbook/utilities/text.ts
3135
3101
  - app/pb_kits/playbook/utilities/validEmojiChecker.ts
3136
- - dist/chunks/_typeahead-C-6MLSyC.js
3137
- - dist/chunks/_weekday_stacked-CFhGhr9V.js
3138
- - dist/chunks/lazysizes-B7xYodB-.js
3102
+ - dist/chunks/_typeahead-BV_n6U5W.js
3103
+ - dist/chunks/_weekday_stacked-Cy__g00H.js
3104
+ - dist/chunks/lazysizes-DHz07jlL.js
3139
3105
  - dist/chunks/lib-D-mTv-kp.js
3140
3106
  - dist/chunks/pb_form_validation-BkWGwJsl.js
3141
3107
  - dist/chunks/vendor.js
@@ -3219,7 +3185,7 @@ homepage: https://playbook.powerapp.cloud/
3219
3185
  licenses:
3220
3186
  - ISC
3221
3187
  metadata: {}
3222
- post_install_message:
3188
+ post_install_message:
3223
3189
  rdoc_options: []
3224
3190
  require_paths:
3225
3191
  - lib
@@ -3235,7 +3201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
3235
3201
  version: '0'
3236
3202
  requirements: []
3237
3203
  rubygems_version: 3.5.3
3238
- signing_key:
3204
+ signing_key:
3239
3205
  specification_version: 4
3240
3206
  summary: Playbook Design System
3241
3207
  test_files: []
@@ -1,7 +0,0 @@
1
- <%= pb_rails("currency", props: {
2
- amount: '1234567.89',
3
- comma_separator: true,
4
- size: 'lg',
5
- emphasized: false,
6
- decimals: 'matching',
7
- }) %>
@@ -1,18 +0,0 @@
1
- import React from "react"
2
-
3
- import Currency from "../_currency"
4
-
5
- const CurrencyCommaSeparator = (props) => {
6
- return (
7
- <Currency
8
- amount='1234567.89'
9
- commaSeparator
10
- decimals="matching"
11
- emphasized={false}
12
- size="lg"
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- export default CurrencyCommaSeparator
@@ -1,3 +0,0 @@
1
- The optional `commaSeparator` can be used to auto-format the use of commas as a thousands separator.
2
-
3
- **NOTE:** If the value passed into the `amount` prop is already comma-dilineated, it will not add additional commas.
@@ -1,3 +0,0 @@
1
- For Form Pills with longer text, the truncate global prop can be used to truncate the label within each Form Pill. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
2
-
3
- __NOTE__: For Rails Form Pills (not ones embedded within a React-rendered Typeahead or MultiLevelSelect), a unique `id` is required to enable the Tooltip functionality displaying the text or tag section of the Form Pill.
@@ -1 +0,0 @@
1
- For Form Pills with longer text, the `truncate` global prop can be used to truncate the label within each Form Pill. Hover over the truncated Form Pill and a Tooltip containing the text or tag section of the Form Pill will appear. See [here](https://playbook.powerapp.cloud/visual_guidelines/truncate) for more information on the truncate global prop.
@@ -1,66 +0,0 @@
1
- @import "../tokens/colors";
2
- @import "../tokens/line_height";
3
- @import "../tokens/typography";
4
- @import "../tokens/border_radius";
5
-
6
- [class^=pb_link_kit]{
7
- @include pb_link($primary);
8
- &:hover {
9
- color: $text_lt_default;
10
- }
11
- &:focus {
12
- outline: none;
13
- }
14
- &:focus-visible {
15
- border-radius: $border_rad_light;
16
- outline: 1px solid $primary;
17
- outline-offset: 2px;
18
- }
19
- &:visited {
20
- color: $data_3;
21
- }
22
- &.dark {
23
- @include pb_link($active_dark);
24
- &:hover {
25
- color: $text_dk_default;
26
- }
27
- }
28
- @each $color_name, $color_value in $pb_link_colors {
29
- &[class*=_#{"" + $color_name}] {
30
- @include pb_link($color_value);
31
-
32
- &:hover {
33
- color: map-get($pb_link_hover_colors, $color_name);
34
- }
35
-
36
- &:visited {
37
- color: $data_3;
38
- }
39
- }
40
- }
41
-
42
- @each $dark_color_name, $dark_color_value in $pb_dark_link_colors{
43
- &[class*=_#{$dark_color_name}][class*=dark]{
44
- @include pb_link($dark_color_value);
45
-
46
- &:hover {
47
- color: map-get($pb_dark_link_hover_colors, $dark_color_name);
48
- }
49
-
50
- &:visited {
51
- color: $data_3;
52
- }
53
- }
54
- }
55
-
56
- &[class*=_underline] {
57
- text-decoration: underline;
58
- }
59
-
60
- &[class*=_disabled] {
61
- pointer-events: none;
62
- cursor: default;
63
- color: $text_lt_lighter;
64
- }
65
-
66
- }
@@ -1,107 +0,0 @@
1
- import React from 'react'
2
- import classnames from 'classnames'
3
-
4
- import { buildAriaProps, buildCss, buildDataProps, buildHtmlProps } from '../utilities/props'
5
- import { globalProps, GlobalProps } from '../utilities/globalProps'
6
-
7
- import Icon from '../pb_icon/_icon'
8
-
9
- type LinkProps = {
10
- aria?: {[key: string]: string},
11
- className?: string,
12
- children?: React.ReactChild[] | React.ReactChild,
13
- color?: 'default' | 'body' | 'muted' | 'destructive',
14
- dark?: boolean,
15
- data?: {[key: string]: string},
16
- disabled?: boolean,
17
- href?: string,
18
- htmlOptions?: {[key: string]: string | number | boolean | (() => void) | ((arg?: Event) => void)},
19
- icon?: string,
20
- iconRight?: string,
21
- id?: string,
22
- tag?: 'a' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'span' | 'div',
23
- text?: string,
24
- underline?: boolean,
25
- } & GlobalProps
26
-
27
- const Link = (props: LinkProps): React.ReactElement => {
28
- const {
29
- aria = {},
30
- children,
31
- className,
32
- color = '',
33
- data = {},
34
- disabled = false,
35
- href= '',
36
- htmlOptions = {},
37
- icon = '',
38
- iconRight = '',
39
- id = '',
40
- tag = 'a',
41
- text = '',
42
- underline = false,
43
- } = props
44
-
45
- const ariaProps: {[key: string]: string} = buildAriaProps(aria)
46
- const dataProps: {[key: string]: string} = buildDataProps(data)
47
- const htmlProps = buildHtmlProps(htmlOptions);
48
- const classes = classnames(
49
- buildCss('pb_link_kit', color, underline ? 'underline' : '', disabled ? 'disabled' : ''),
50
- globalProps(props),
51
- className
52
- )
53
- const Tag = tag as keyof JSX.IntrinsicElements
54
-
55
- const renderContent = () => (
56
- <>
57
- {icon && (
58
- <Icon
59
- fixedWidth
60
- icon={icon}
61
- marginRight="xxs"
62
- size="xs"
63
- />
64
- )}
65
- {text || children}
66
- {iconRight && (
67
- <Icon
68
- fixedWidth
69
- icon={iconRight}
70
- marginLeft="xxs"
71
- size="xs"
72
- />
73
- )}
74
- </>
75
- )
76
-
77
- const commonProps = {
78
- ...ariaProps,
79
- ...dataProps,
80
- ...htmlProps,
81
- className: classes,
82
- id,
83
- }
84
-
85
- if (tag === 'a') {
86
- return (
87
- <a
88
- {...commonProps}
89
- href={href}
90
- >
91
- {renderContent()}
92
- </a>
93
- )
94
- } else {
95
- return (
96
- <a
97
- {...commonProps}
98
- href={href}
99
- >
100
- <Tag>{renderContent()}</Tag>
101
- </a>
102
- )
103
- }
104
-
105
- }
106
-
107
- export default Link
@@ -1,30 +0,0 @@
1
- <div>
2
- <%= pb_rails("link", props: {
3
- text: "link example",
4
- href: "https://www.google.com/search?q=playbook+design+system",
5
- }) %>
6
- </div>
7
-
8
- <div>
9
- <%= pb_rails("link", props: {
10
- text: "link example",
11
- href: "https://www.youtube.com/@PowerHRG",
12
- color: "body",
13
- }) %>
14
- </div>
15
-
16
- <div>
17
- <%= pb_rails("link", props: {
18
- text: "link example",
19
- href: "https://github.com/powerhome/.github/blob/main/profile/README.md",
20
- color: "muted",
21
- }) %>
22
- </div>
23
-
24
- <div>
25
- <%= pb_rails("link", props: {
26
- text: "link example",
27
- href: "https://rubygems.org/gems/playbook_ui/",
28
- color: "destructive",
29
- }) %>
30
- </div>
@@ -1,40 +0,0 @@
1
- import React from 'react'
2
- import { Link } from 'playbook-ui'
3
-
4
- const LinkColor = (props) => (
5
- <div>
6
- <div>
7
- <Link
8
- href="https://www.google.com/search?q=playbook+design+system"
9
- text="link example"
10
- {...props}
11
- />
12
- </div>
13
- <div>
14
- <Link
15
- color="body"
16
- href="https://www.youtube.com/@PowerHRG"
17
- text="link example"
18
- {...props}
19
- />
20
- </div>
21
- <div>
22
- <Link
23
- color="muted"
24
- href="https://github.com/powerhome/.github/blob/main/profile/README.md"
25
- text="link example"
26
- {...props}
27
- />
28
- </div>
29
- <div>
30
- <Link
31
- color="destructive"
32
- href="https://rubygems.org/gems/playbook_ui/"
33
- text="link example"
34
- {...props}
35
- />
36
- </div>
37
- </div>
38
- )
39
-
40
- export default LinkColor
@@ -1,5 +0,0 @@
1
- <%= pb_rails("link", props: {
2
- text: "link example",
3
- href: "#disabled",
4
- disabled: true,
5
- }) %>
@@ -1,15 +0,0 @@
1
- import React from 'react'
2
- import { Link } from 'playbook-ui'
3
-
4
- const LinkDisabled = (props) => (
5
- <div>
6
- <Link
7
- disabled
8
- href="#disabled"
9
- text="link example"
10
- {...props}
11
- />
12
- </div>
13
- )
14
-
15
- export default LinkDisabled
@@ -1,15 +0,0 @@
1
- <div>
2
- <%= pb_rails("link", props: {
3
- text: "link example",
4
- href: "#icon",
5
- icon: "arrow-up-right-from-square",
6
- }) %>
7
- </div>
8
-
9
- <div>
10
- <%= pb_rails("link", props: {
11
- text: "link example",
12
- href: "#icon2",
13
- icon_right: "chevron-right",
14
- }) %>
15
- </div>
@@ -1,25 +0,0 @@
1
- import React from 'react'
2
- import { Link } from 'playbook-ui'
3
-
4
- const LinkIcon = (props) => (
5
- <div>
6
- <div>
7
- <Link
8
- href="#icon"
9
- icon="arrow-up-right-from-square"
10
- text="link example"
11
- {...props}
12
- />
13
- </div>
14
- <div>
15
- <Link
16
- href="#icon2"
17
- iconRight="chevron-right"
18
- text="link example"
19
- {...props}
20
- />
21
- </div>
22
- </div>
23
- )
24
-
25
- export default LinkIcon
@@ -1,35 +0,0 @@
1
- <%= pb_rails("link", props: {
2
- text: "h1 link example",
3
- href: "#tag",
4
- icon: "arrow-up-right-from-square",
5
- tag: "h1",
6
- }) %>
7
-
8
- <%= pb_rails("link", props: {
9
- text: "h3 link example",
10
- href: "#tag2",
11
- tag: "h3",
12
- underline: true,
13
- }) %>
14
-
15
- <%= pb_rails("link", props: {
16
- color: "destructive",
17
- text: "h6 link example",
18
- href: "#tag3",
19
- tag: "h6",
20
- }) %>
21
-
22
- <%= pb_rails("link", props: {
23
- text: "p link example",
24
- href: "#tag4",
25
- icon_right: "chevron-right",
26
- tag: "p",
27
- }) %>
28
-
29
- <div>
30
- This is a <%= pb_rails("link", props: {
31
- text: "span link example",
32
- href: "#tag5",
33
- tag: "span",
34
- }) %>
35
- </div>
@@ -1,45 +0,0 @@
1
- import React from 'react'
2
- import { Link } from 'playbook-ui'
3
-
4
- const LinkTag = (props) => (
5
- <div>
6
- <Link
7
- href="#tag"
8
- icon="arrow-up-right-from-square"
9
- tag="h1"
10
- text="h1 link example"
11
- {...props}
12
- />
13
- <Link
14
- href="#tag2"
15
- tag="h3"
16
- text="h3 link example"
17
- underline
18
- {...props}
19
- />
20
- <Link
21
- color="destructive"
22
- href="#tag3"
23
- tag="h6"
24
- text="h6 link example"
25
- {...props}
26
- />
27
- <Link
28
- href="#tag4"
29
- iconRight="chevron-right"
30
- tag="p"
31
- text="p link example"
32
- {...props}
33
- />
34
- <div>
35
- This is a <Link
36
- href="#tag5"
37
- tag="span"
38
- text="span link example"
39
- {...props}
40
- />
41
- </div>
42
- </div>
43
- )
44
-
45
- export default LinkTag
@@ -1,5 +0,0 @@
1
- <%= pb_rails("link", props: {
2
- text: "link example",
3
- href: "#underline",
4
- underline: true,
5
- }) %>
@@ -1,15 +0,0 @@
1
- import React from 'react'
2
- import { Link } from 'playbook-ui'
3
-
4
- const LinkUnderline = (props) => (
5
- <div>
6
- <Link
7
- href="#underline"
8
- text="link example"
9
- underline
10
- {...props}
11
- />
12
- </div>
13
- )
14
-
15
- export default LinkUnderline