playbook_ui 14.9.0.pre.alpha.PLAY16264818 → 14.9.0.pre.alpha.play1703errorstatealignment4889
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/pb_advanced_table/table_header.html.erb +5 -3
- data/app/pb_kits/playbook/pb_avatar/_avatar.scss +0 -2
- data/app/pb_kits/playbook/pb_body/_body.scss +14 -13
- data/app/pb_kits/playbook/pb_body/_body_mixins.scss +22 -16
- data/app/pb_kits/playbook/pb_bread_crumbs/docs/_bread_crumbs_default.jsx +6 -0
- data/app/pb_kits/playbook/pb_caption/_caption_mixin.scss +2 -1
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +1 -1
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.scss +5 -0
- data/app/pb_kits/playbook/pb_file_upload/_file_upload.tsx +7 -2
- data/app/pb_kits/playbook/pb_file_upload/file_upload.html.erb +8 -2
- data/app/pb_kits/playbook/pb_form_group/_form_group.scss +15 -3
- data/app/pb_kits/playbook/pb_nav/_bold_mixin.scss +11 -1
- data/app/pb_kits/playbook/pb_nav/_collapsible_nav.scss +16 -2
- data/app/pb_kits/playbook/pb_nav/_vertical_nav.scss +1 -1
- data/app/pb_kits/playbook/pb_select/_select.tsx +14 -19
- data/app/pb_kits/playbook/pb_select/docs/example.yml +0 -1
- data/app/pb_kits/playbook/pb_select/docs/index.js +0 -1
- data/app/pb_kits/playbook/pb_selectable_card/_selectable_card.scss +4 -4
- data/app/pb_kits/playbook/pb_selectable_card/selectable_card.html.erb +1 -1
- data/app/pb_kits/playbook/pb_stat_change/_stat_change.tsx +44 -36
- data/app/pb_kits/playbook/pb_stat_change/stat_change.html.erb +4 -4
- data/app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb +95 -0
- data/app/pb_kits/playbook/pb_table/index.ts +100 -26
- data/app/pb_kits/playbook/pb_table/table.html.erb +1 -1
- data/app/pb_kits/playbook/pb_table/table.rb +17 -2
- data/app/pb_kits/playbook/pb_title/_title.scss +6 -5
- data/app/pb_kits/playbook/pb_title/_title_mixin.scss +13 -0
- data/app/pb_kits/playbook/tokens/_titles.scss +0 -8
- data/app/pb_kits/playbook/utilities/_hover.scss +11 -2
- data/app/pb_kits/playbook/utilities/globalProps.ts +2 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/hover.test.js +15 -0
- data/dist/chunks/{_typeahead-B8fkIeXA.js → _typeahead-4sdDeM4X.js} +2 -2
- data/dist/chunks/_weekday_stacked-CblTZ9cd.js +45 -0
- data/dist/chunks/{lib-SyD3buPZ.js → lib-CVPInSs5.js} +1 -1
- data/dist/chunks/{pb_form_validation-Dt8UJgrJ.js → pb_form_validation-CDLJ5eAG.js} +1 -1
- data/dist/chunks/vendor.js +1 -1
- data/dist/playbook-doc.js +1 -1
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/hover.rb +7 -1
- data/lib/playbook/version.rb +1 -1
- metadata +7 -8
- data/app/pb_kits/playbook/pb_select/docs/_select_form.jsx +0 -108
- data/app/pb_kits/playbook/utilities/hookFormProps.ts +0 -16
- data/dist/chunks/_weekday_stacked-DxlPBh55.js +0 -45
data/lib/playbook/hover.rb
CHANGED
@@ -29,12 +29,16 @@ module Playbook
|
|
29
29
|
[]
|
30
30
|
end
|
31
31
|
|
32
|
+
def hover_underline_values
|
33
|
+
[true, false]
|
34
|
+
end
|
35
|
+
|
32
36
|
def hover_values
|
33
37
|
hover_options.keys.select { |sk| try(sk) }
|
34
38
|
end
|
35
39
|
|
36
40
|
def hover_attributes
|
37
|
-
%w[background shadow scale color]
|
41
|
+
%w[background shadow scale color underline]
|
38
42
|
end
|
39
43
|
|
40
44
|
def hover_props
|
@@ -51,6 +55,8 @@ module Playbook
|
|
51
55
|
value.each do |key, val|
|
52
56
|
if %i[background color].include?(key)
|
53
57
|
css += "#{prefix}_#{key}-#{val} " if hover_attributes.include?(key.to_s)
|
58
|
+
elsif %i[underline].include?(key) && val == true
|
59
|
+
css += "hover_underline "
|
54
60
|
elsif hover_attributes.include?(key.to_s) && send("hover_#{key}_values").include?(val.to_s)
|
55
61
|
css += "#{prefix}_#{key}_#{val} "
|
56
62
|
end
|
data/lib/playbook/version.rb
CHANGED
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: 14.9.0.pre.alpha.
|
4
|
+
version: 14.9.0.pre.alpha.play1703errorstatealignment4889
|
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: 2024-12-
|
12
|
+
date: 2024-12-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
@@ -2370,7 +2370,6 @@ files:
|
|
2370
2370
|
- app/pb_kits/playbook/pb_select/docs/_select_error.jsx
|
2371
2371
|
- app/pb_kits/playbook/pb_select/docs/_select_error.md
|
2372
2372
|
- app/pb_kits/playbook/pb_select/docs/_select_error_swift.md
|
2373
|
-
- app/pb_kits/playbook/pb_select/docs/_select_form.jsx
|
2374
2373
|
- app/pb_kits/playbook/pb_select/docs/_select_inline.html.erb
|
2375
2374
|
- app/pb_kits/playbook/pb_select/docs/_select_inline.jsx
|
2376
2375
|
- app/pb_kits/playbook/pb_select/docs/_select_inline_compact.html.erb
|
@@ -2618,6 +2617,7 @@ files:
|
|
2618
2617
|
- app/pb_kits/playbook/pb_table/docs/_table_sticky.html.erb
|
2619
2618
|
- app/pb_kits/playbook/pb_table/docs/_table_sticky.jsx
|
2620
2619
|
- app/pb_kits/playbook/pb_table/docs/_table_sticky.md
|
2620
|
+
- app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.html.erb
|
2621
2621
|
- app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns.jsx
|
2622
2622
|
- app/pb_kits/playbook/pb_table/docs/_table_sticky_left_columns_react.md
|
2623
2623
|
- app/pb_kits/playbook/pb_table/docs/_table_striped.html.erb
|
@@ -3165,7 +3165,6 @@ files:
|
|
3165
3165
|
- app/pb_kits/playbook/utilities/flexbox_global_props/_order.scss
|
3166
3166
|
- app/pb_kits/playbook/utilities/globalPropNames.mjs
|
3167
3167
|
- app/pb_kits/playbook/utilities/globalProps.ts
|
3168
|
-
- app/pb_kits/playbook/utilities/hookFormProps.ts
|
3169
3168
|
- app/pb_kits/playbook/utilities/icons/allicons.tsx
|
3170
3169
|
- app/pb_kits/playbook/utilities/icons/angle-down.svg
|
3171
3170
|
- app/pb_kits/playbook/utilities/icons/clock.svg
|
@@ -3191,11 +3190,11 @@ files:
|
|
3191
3190
|
- app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js
|
3192
3191
|
- app/pb_kits/playbook/utilities/text.ts
|
3193
3192
|
- app/pb_kits/playbook/utilities/validEmojiChecker.ts
|
3194
|
-
- dist/chunks/_typeahead-
|
3195
|
-
- dist/chunks/_weekday_stacked-
|
3193
|
+
- dist/chunks/_typeahead-4sdDeM4X.js
|
3194
|
+
- dist/chunks/_weekday_stacked-CblTZ9cd.js
|
3196
3195
|
- dist/chunks/lazysizes-B7xYodB-.js
|
3197
|
-
- dist/chunks/lib-
|
3198
|
-
- dist/chunks/pb_form_validation-
|
3196
|
+
- dist/chunks/lib-CVPInSs5.js
|
3197
|
+
- dist/chunks/pb_form_validation-CDLJ5eAG.js
|
3199
3198
|
- dist/chunks/vendor.js
|
3200
3199
|
- dist/menu.yml
|
3201
3200
|
- dist/playbook-doc.js
|
@@ -1,108 +0,0 @@
|
|
1
|
-
import React from 'react'
|
2
|
-
import { useForm } from 'react-hook-form'
|
3
|
-
import { Select, Card, Body, Button } from 'playbook-ui'
|
4
|
-
|
5
|
-
const SelectForm = (props) => {
|
6
|
-
const {
|
7
|
-
register,
|
8
|
-
handleSubmit,
|
9
|
-
formState: { errors },
|
10
|
-
watch,
|
11
|
-
} = useForm({
|
12
|
-
defaultValues: {
|
13
|
-
favoriteFood: '',
|
14
|
-
mealType: '',
|
15
|
-
dietaryRestrictions: '',
|
16
|
-
}
|
17
|
-
})
|
18
|
-
|
19
|
-
const onSubmit = (data) => {
|
20
|
-
console.log('Form submitted:', data)
|
21
|
-
}
|
22
|
-
|
23
|
-
// Watch form values for real-time display
|
24
|
-
const formValues = watch()
|
25
|
-
|
26
|
-
const foodOptions = [
|
27
|
-
{ value: 'pizza', text: 'Pizza' },
|
28
|
-
{ value: 'burger', text: 'Burger' },
|
29
|
-
{ value: 'sushi', text: 'Sushi' },
|
30
|
-
{ value: 'salad', text: 'Salad' },
|
31
|
-
]
|
32
|
-
|
33
|
-
const mealTypes = [
|
34
|
-
{ value: 'breakfast', text: 'Breakfast' },
|
35
|
-
{ value: 'lunch', text: 'Lunch' },
|
36
|
-
{ value: 'dinner', text: 'Dinner' },
|
37
|
-
]
|
38
|
-
|
39
|
-
const dietaryOptions = [
|
40
|
-
{ value: 'none', text: 'No Restrictions' },
|
41
|
-
{ value: 'vegetarian', text: 'Vegetarian' },
|
42
|
-
{ value: 'vegan', text: 'Vegan' },
|
43
|
-
{ value: 'glutenFree', text: 'Gluten Free' },
|
44
|
-
]
|
45
|
-
|
46
|
-
return (
|
47
|
-
<div>
|
48
|
-
<Card>
|
49
|
-
<form onSubmit={handleSubmit(onSubmit)}>
|
50
|
-
<Select
|
51
|
-
error={errors.favoriteFood?.message}
|
52
|
-
label="What's your favorite food?"
|
53
|
-
name="favoriteFood"
|
54
|
-
options={foodOptions}
|
55
|
-
register={register}
|
56
|
-
rules={{
|
57
|
-
required: 'Please select your favorite food',
|
58
|
-
}}
|
59
|
-
{...props}
|
60
|
-
/>
|
61
|
-
<Select
|
62
|
-
blankSelection="Choose a meal type..."
|
63
|
-
error={errors.mealType?.message}
|
64
|
-
label="Preferred meal time"
|
65
|
-
marginTop="md"
|
66
|
-
name="mealType"
|
67
|
-
options={mealTypes}
|
68
|
-
register={register}
|
69
|
-
rules={{
|
70
|
-
required: 'Please select a meal type',
|
71
|
-
}}
|
72
|
-
{...props}
|
73
|
-
/>
|
74
|
-
<Select
|
75
|
-
label="Dietary Restrictions"
|
76
|
-
marginTop="md"
|
77
|
-
name="dietaryRestrictions"
|
78
|
-
options={dietaryOptions}
|
79
|
-
register={register}
|
80
|
-
{...props}
|
81
|
-
/>
|
82
|
-
|
83
|
-
<Button
|
84
|
-
marginTop="lg"
|
85
|
-
text="Submit"
|
86
|
-
type="submit"
|
87
|
-
variant="primary"
|
88
|
-
|
89
|
-
/>
|
90
|
-
</form>
|
91
|
-
<Card marginTop="lg">
|
92
|
-
<Body
|
93
|
-
text="Current Form Values:"
|
94
|
-
variant="bold"
|
95
|
-
/>
|
96
|
-
<pre style={{ marginTop: '8px', color: "white" }}>
|
97
|
-
{JSON.stringify(formValues, null, 2)}
|
98
|
-
</pre>
|
99
|
-
</Card>
|
100
|
-
</Card>
|
101
|
-
</div>
|
102
|
-
)
|
103
|
-
}
|
104
|
-
|
105
|
-
export default SelectForm
|
106
|
-
|
107
|
-
|
108
|
-
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import { UseFormRegister, FieldValues, RegisterOptions } from 'react-hook-form'
|
2
|
-
|
3
|
-
export type HookFormProps<T extends FieldValues = FieldValues> = {
|
4
|
-
register?: UseFormRegister<T>
|
5
|
-
rules?: RegisterOptions
|
6
|
-
name: string
|
7
|
-
}
|
8
|
-
|
9
|
-
export const withHookForm = <T extends FieldValues = FieldValues>(
|
10
|
-
props: HookFormProps<T>
|
11
|
-
) => {
|
12
|
-
const { register, name, rules } = props
|
13
|
-
if (!register) return {}
|
14
|
-
|
15
|
-
return register(name, rules)
|
16
|
-
}
|