polaris_view_components 0.8.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/icons/polaris/AnalyticsMinor.svg +1 -0
  3. data/app/assets/icons/polaris/AppsMinor.svg +1 -0
  4. data/app/assets/icons/polaris/BlockMinor.svg +1 -0
  5. data/app/assets/icons/polaris/ButtonMinor.svg +1 -0
  6. data/app/assets/icons/polaris/CaretDownMinor.svg +1 -1
  7. data/app/assets/icons/polaris/CaretUpMinor.svg +1 -1
  8. data/app/assets/icons/polaris/CircleTickMinor.svg +1 -0
  9. data/app/assets/icons/polaris/Columns3Minor.svg +1 -0
  10. data/app/assets/icons/polaris/CustomersMinor.svg +1 -1
  11. data/app/assets/icons/polaris/DiscountsMinor.svg +1 -0
  12. data/app/assets/icons/polaris/DropdownMinor.svg +1 -1
  13. data/app/assets/icons/polaris/FinancesMajor.svg +1 -0
  14. data/app/assets/icons/polaris/FinancesMinor.svg +1 -0
  15. data/app/assets/icons/polaris/HomeMinor.svg +1 -0
  16. data/app/assets/icons/polaris/MarketingMinor.svg +1 -0
  17. data/app/assets/icons/polaris/OnlineStoreMinor.svg +1 -0
  18. data/app/assets/icons/polaris/OrdersMinor.svg +1 -0
  19. data/app/assets/icons/polaris/ProductsMinor.svg +1 -0
  20. data/app/assets/icons/polaris/QuestionMarkInverseMajor.svg +1 -0
  21. data/app/assets/icons/polaris/QuestionMarkInverseMinor.svg +1 -0
  22. data/app/assets/icons/polaris/SelectMinor.svg +1 -1
  23. data/app/assets/icons/polaris/TitleMinor.svg +1 -0
  24. data/app/assets/icons/polaris/WandMinor.svg +1 -0
  25. data/app/assets/javascripts/polaris_view_components/collapsible_controller.js +19 -0
  26. data/app/assets/javascripts/polaris_view_components/dropzone_controller.js +15 -3
  27. data/app/assets/javascripts/polaris_view_components/frame_controller.js +1 -1
  28. data/app/assets/javascripts/polaris_view_components/index.js +2 -0
  29. data/app/assets/javascripts/polaris_view_components/polaris_controller.js +4 -0
  30. data/app/assets/javascripts/polaris_view_components/text_field_controller.js +5 -0
  31. data/app/assets/javascripts/polaris_view_components/toast_controller.js +13 -2
  32. data/app/assets/javascripts/polaris_view_components/{utils.js → utils/index.js} +3 -1
  33. data/app/assets/javascripts/polaris_view_components/utils/use-transition.js +162 -0
  34. data/app/assets/javascripts/polaris_view_components.js +201 -162
  35. data/app/assets/stylesheets/polaris_view_components/custom.css +37 -0
  36. data/app/assets/stylesheets/polaris_view_components.css +68 -33
  37. data/app/components/polaris/action_list/item_component.rb +2 -1
  38. data/app/components/polaris/button_component.html.erb +2 -2
  39. data/app/components/polaris/collapsible_component.rb +37 -0
  40. data/app/components/polaris/dropzone_component.html.erb +9 -6
  41. data/app/components/polaris/filters_component.rb +3 -1
  42. data/app/components/polaris/headless_button.html.erb +2 -2
  43. data/app/components/polaris/headless_button.rb +3 -1
  44. data/app/components/polaris/keyboard_key_component.rb +20 -0
  45. data/app/components/polaris/page_component.html.erb +81 -10
  46. data/app/components/polaris/page_component.rb +85 -28
  47. data/app/components/polaris/resource_item_component.rb +7 -2
  48. data/app/components/polaris/skeleton_display_text_component.rb +32 -0
  49. data/app/components/polaris/skeleton_thumbnail_component.rb +31 -0
  50. data/app/components/polaris/text_field_component.html.erb +1 -1
  51. data/app/components/polaris/text_field_component.rb +1 -1
  52. data/app/components/polaris/visually_hidden_component.rb +0 -3
  53. data/app/helpers/polaris/form_builder.rb +1 -1
  54. data/app/helpers/polaris/view_helper.rb +4 -0
  55. data/lib/polaris/view_components/version.rb +1 -1
  56. metadata +111 -15
@@ -1,5 +1,5 @@
1
1
  @charset "UTF-8";
2
- :root { --polaris-version-number: '7.5.0'; --polaris-animation-skeleton-shimmer: polaris-SkeletonShimmerAnimation; }
2
+ :root { --polaris-version-number: '7.6.0'; --polaris-animation-skeleton-shimmer: polaris-SkeletonShimmerAnimation; }
3
3
  html, body { font-size: 1.5rem; font-weight: 400; line-height: 2rem; text-transform: initial; letter-spacing: initial; font-weight: 400; color: var(--p-text); }
4
4
  @media (min-width: 40em) { html, body { font-size: 1.4rem; } }
5
5
  html, body, button { font-family: -apple-system, BlinkMacSystemFont, San Francisco, Segoe UI, Roboto, Helvetica Neue, sans-serif; }
@@ -92,7 +92,7 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
92
92
  .Polaris-Badge--sizeSmall { font-size: 1.2rem; }
93
93
  .Polaris-Badge--statusSuccess { --p-component-badge-pip-color: var(--p-icon-success); background-color: var(--p-surface-success); color: var(--p-text); }
94
94
  .Polaris-Badge--statusInfo { --p-component-badge-pip-color: var(--p-icon-highlight); background-color: var(--p-surface-highlight); color: var(--p-text); }
95
- .Polaris-Badge--statusAttention { --p-component-badge-pip-color: var(--p-text-warning); background-color: var(--p-surface-warning); color: var(--p-text); }
95
+ .Polaris-Badge--statusAttention { --p-component-badge-pip-color: rgb(138, 97, 22); background-color: #ffea8a; color: var(--p-text); }
96
96
  .Polaris-Badge--statusWarning { --p-component-badge-pip-color: var(--p-icon-warning); background-color: var(--p-surface-warning); color: var(--p-text); }
97
97
  .Polaris-Badge--statusCritical { --p-component-badge-pip-color: var(--p-icon-critical); background-color: var(--p-surface-critical); color: var(--p-text); }
98
98
  .Polaris-Badge--statusNew { background-color: var(--p-surface-neutral); color: var(--p-text); font-weight: 500; border: none; }
@@ -105,14 +105,15 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
105
105
  .Polaris-Badge--withinFilter { border-radius: var(--p-border-radius-base); }
106
106
  .Polaris-TextStyle--variationPositive { color: var(--p-text-success); }
107
107
  .Polaris-TextStyle--variationNegative { color: var(--p-text-critical); }
108
+ .Polaris-TextStyle--variationWarning { color: var(--p-text-warning); }
108
109
  .Polaris-TextStyle--variationCode { position: relative; padding: 0 0.4rem; border-radius: 0.3rem; background-color: var(--p-surface-subdued); display: inline-block; font-size: 1.15em; box-shadow: inset 0 0 0 0.1rem var(--p-border-subdued); }
109
110
  .Polaris-TextStyle--variationCode::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0.1rem solid transparent; pointer-events: none; }
110
111
  .Polaris-TextStyle--variationStrong { font-weight: 600; }
111
112
  .Polaris-TextStyle--variationSubdued { color: var(--p-text-subdued); }
112
113
  @media print { .Polaris-TextStyle--variationSubdued { color: var(--p-text-subdued); } }
113
- .Polaris-ActionList { list-style: none; margin: 0; padding: 0; }
114
+ .Polaris-ActionList { outline: none; list-style: none; margin: 0; padding: 0; }
114
115
  .Polaris-ActionList__Section--withoutTitle:not(:first-child) { border-top: 0.1rem solid var(--p-divider); }
115
- .Polaris-ActionList__Actions { list-style: none; margin: 0; border-top: 0.1rem solid var(--p-divider); padding: 0.8rem; }
116
+ .Polaris-ActionList__Actions { outline: none; list-style: none; margin: 0; border-top: 0.1rem solid var(--p-divider); padding: 0.8rem; }
116
117
  .Polaris-ActionList > .Polaris-ActionList__Section--withoutTitle .Polaris-ActionList__Actions, .Polaris-ActionList__Section:first-child > .Polaris-ActionList__Section--withoutTitle .Polaris-ActionList__Actions { border-top: none; }
117
118
  .Polaris-ActionList__Title { font-size: 1.3rem; font-weight: 600; line-height: 1.6rem; text-transform: uppercase; padding: 0.4rem 1.6rem 1.2rem 1.6rem; }
118
119
  @media (min-width: 40em) { .Polaris-ActionList__Title { font-size: 1.2rem; } }
@@ -481,6 +482,7 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
481
482
  .Polaris-TextField__ClearButton:focus { outline: none; }
482
483
  .Polaris-TextField__ClearButton:focus:enabled::after { box-shadow: 0 0 0 0.2rem var(--p-focused); outline: 0.1rem solid transparent; }
483
484
  .Polaris-TextField__ClearButton:disabled { cursor: default; }
485
+ .Polaris-TextField__Hidden { visibility: hidden; }
484
486
  .Polaris-TextField__Spinner { --p-text-field-spinner-offset-large: calc(var(--p-text-field-spinner-offset) + 0.1rem); z-index: 20; margin: var(--p-text-field-spinner-offset-large); color: var(--p-icon); display: flex; align-self: stretch; flex-direction: column; width: 2.2rem; cursor: pointer; }
485
487
  .Polaris-TextField__SpinnerIcon { height: 1.2rem; width: 1.2rem; }
486
488
  .Polaris-TextField__Resizer { position: absolute; bottom: 0; left: 0; right: 0; height: 0; visibility: hidden; overflow: hidden; }
@@ -538,16 +540,18 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
538
540
  .Polaris-Listbox-TextOption { margin: 0.4rem 0.8rem 0; flex: 1 1; border-radius: var(--p-border-radius-base); padding: 0.8rem 0.8rem; cursor: pointer; display: flex; position: relative; }
539
541
  .Polaris-Listbox-TextOption::after { content: ''; position: absolute; z-index: 1; top: -0.1rem; right: -0.1rem; bottom: -0.1rem; left: -0.1rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.1rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
540
542
  .Polaris-Listbox-TextOption.Polaris-Listbox-TextOption--allowMultiple { margin: 0.4rem 0.8rem 0; padding: 0.4rem 0.8rem; }
541
- .Polaris-Listbox-TextOption.Polaris-Listbox-TextOption--isAction { padding: 0; margin-top: 0; }
543
+ .Polaris-Listbox-TextOption.Polaris-Listbox-TextOption--isAction { margin-top: 0; padding: 0.8rem 0.8rem; }
542
544
  .Polaris-Listbox-TextOption:hover { background-color: var(--p-surface-hovered); }
543
545
  .Polaris-Listbox-TextOption:focus { outline: none; }
544
546
  .Polaris-Listbox-TextOption:active { background-color: var(--p-surface-pressed); }
545
547
  .Polaris-Listbox-TextOption.Polaris-Listbox-TextOption--disabled { background-color: var(--p-surface-disabled); color: var(--p-text-disabled); cursor: default; }
546
548
  .Polaris-Listbox-TextOption.Polaris-Listbox-TextOption--selected { background-color: var(--p-surface-selected); }
547
549
  .Polaris-Listbox-TextOption.Polaris-Listbox-TextOption--selected::before { content: ''; position: absolute; top: 0; bottom: 0; left: -0.4rem; height: 100%; width: var(--p-border-radius-base); background-color: var(--p-interactive); border-top-right-radius: var(--p-border-radius-base); border-bottom-right-radius: var(--p-border-radius-base); transform: translateX(-100%); }
550
+ li:first-of-type > .Polaris-Listbox-TextOption { margin-top: 0; }
548
551
  [data-focused] .Polaris-Listbox-TextOption { outline: none; background-color: var(--p-surface-selected); }
549
552
  [data-focused]:not(:focus) .Polaris-Listbox-TextOption::after { box-shadow: 0 0 0 0.2rem var(--p-focused); outline: 0.1rem solid transparent; }
550
553
  .Polaris-Listbox-TextOption__Content { flex: 1 1 auto; display: flex; }
554
+ .Polaris-Listbox-TextOption__Checkbox { pointer-events: none; }
551
555
  .Polaris-Listbox-Option { display: flex; margin: 0; padding: 0; }
552
556
  .Polaris-Listbox-Option:focus { outline: none; }
553
557
  .Polaris-Listbox-Option--divider { border-bottom: 0.1rem solid var(--p-divider); }
@@ -556,6 +560,7 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
556
560
  .Polaris-Listbox-Header { font-size: 1.3rem; font-weight: 600; line-height: 1.6rem; text-transform: uppercase; padding: 0.8rem 1.6rem; color: var(--p-text-subdued); }
557
561
  @media (min-width: 40em) { .Polaris-Listbox-Header { font-size: 1.2rem; } }
558
562
  .Polaris-Listbox-Action { display: flex; flex: 1 1; }
563
+ .Polaris-Listbox-Action__ActionDivider { margin-bottom: 0.4rem; }
559
564
  .Polaris-Listbox-Action__Icon { padding-right: 0.8rem; }
560
565
  .Polaris-Listbox { padding: 0; margin: 0; list-style: none; max-width: 100%; }
561
566
  .Polaris-Listbox:focus { outline: none; }
@@ -567,7 +572,7 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
567
572
  .Polaris-Autocomplete-MappedAction__ActionContainer { margin-bottom: 1.2rem; }
568
573
  [data-focused] .Polaris-Autocomplete-MappedAction__Action svg { fill: var(--p-interactive); }
569
574
  [data-focused] .Polaris-Autocomplete-MappedAction__Action.Polaris-Autocomplete-MappedAction--destructive { background-color: var(--p-surface-critical-subdued-pressed); }
570
- .Polaris-Autocomplete-MappedAction__Action { position: relative; display: block; width: 100%; min-height: 4rem; text-align: left; cursor: pointer; padding: 1rem 0.8rem; border-radius: var(--p-border-radius-base); border-top: 0.1rem solid var(--p-surface); }
575
+ .Polaris-Autocomplete-MappedAction__Action { position: relative; display: block; width: 100%; min-height: 4rem; text-align: left; cursor: pointer; }
571
576
  .Polaris-Autocomplete-MappedAction__Action::after { content: ''; position: absolute; z-index: 1; top: -0.1rem; right: -0.1rem; bottom: -0.1rem; left: -0.1rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.1rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
572
577
  .Polaris-Autocomplete-MappedAction__Action:hover { background-color: var(--p-surface-hovered); text-decoration: none; }
573
578
  @media (-ms-high-contrast: active) { .Polaris-Autocomplete-MappedAction__Action:hover { outline: 0.1rem solid windowText; } }
@@ -894,24 +899,11 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
894
899
  .Polaris-DropZone-FileUpload--large { padding: 3.2rem; }
895
900
  .Polaris-DropZone-FileUpload--small { padding: 1.25rem; }
896
901
  .Polaris-DropZone-FileUpload img { vertical-align: bottom; }
897
- .Polaris-DropZone-FileUpload__Button { position: relative; position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 3.6rem; min-width: 3.6rem; margin: 0; padding: 0.7rem 1.6rem; background: var(--p-surface); box-shadow: var(--p-button-drop-shadow); border-radius: var(--p-border-radius-base); color: var(--p-text); border: 0.1rem solid var(--p-border-neutral-subdued); border-top-color: var(--p-border-subdued); border-bottom-color: var(--p-border-shadow-subdued); line-height: 1; text-align: center; cursor: pointer; -webkit-user-select: none; user-select: none; text-decoration: none; -webkit-tap-highlight-color: transparent; position: relative; }
898
- .Polaris-DropZone-FileUpload__Button svg { fill: var(--p-icon); }
899
- .Polaris-DropZone-FileUpload__Button::after { content: ''; position: absolute; z-index: 1; top: -0.2rem; right: -0.2rem; bottom: -0.2rem; left: -0.2rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.2rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
900
- .Polaris-DropZone-FileUpload__Button:hover { background: var(--p-action-secondary-hovered); outline: 0.1rem solid transparent; }
901
- .Polaris-DropZone-FileUpload__Button:focus { box-shadow: var(--p-button-drop-shadow); outline: 0; }
902
- .Polaris-DropZone-FileUpload__Button:focus::after { box-shadow: 0 0 0 0.2rem var(--p-focused); outline: 0.1rem solid transparent; }
903
- .Polaris-DropZone-FileUpload__Button:active { background: var(--p-action-secondary-pressed); box-shadow: var(--p-button-drop-shadow); }
904
- .Polaris-DropZone-FileUpload__Button:active::after { border: none; box-shadow: none; }
905
- .Polaris-DropZone-FileUpload__Button.Polaris-DropZone-FileUpload--pressed { background: var(--p-action-secondary-depressed); box-shadow: var(--p-button-pressed-inner-shadow); color: var(--p-text-on-primary); border-color: var(--p-border-depressed); }
906
- .Polaris-DropZone-FileUpload__Button.Polaris-DropZone-FileUpload--pressed svg { fill: currentColor; }
907
- @media (-ms-high-contrast: active) { .Polaris-DropZone-FileUpload__Button { border: 0.1rem solid windowText; } }
908
- .Polaris-DropZone-FileUpload__Button::after { content: ''; position: absolute; z-index: 1; top: -0.1rem; right: -0.1rem; bottom: -0.1rem; left: -0.1rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.1rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
909
- .Polaris-DropZone-FileUpload__Button.Polaris-DropZone-FileUpload--disabled { transition: none; box-shadow: none; border-color: var(--p-border-disabled); background: var(--p-surface-disabled); color: var(--p-text-disabled); cursor: not-allowed; box-shadow: none; }
910
- .Polaris-DropZone-FileUpload__Button.Polaris-DropZone-FileUpload--disabled svg { fill: var(--p-icon-disabled); }
911
- .Polaris-DropZone-FileUpload__Button.Polaris-DropZone-FileUpload--focused { outline: 0; box-shadow: none; }
912
- .Polaris-DropZone-FileUpload__Button.Polaris-DropZone-FileUpload--focused::after { box-shadow: 0 0 0 0.2rem var(--p-focused); outline: 0.1rem solid transparent; }
913
- @media (-ms-high-contrast: active) { .Polaris-DropZone-FileUpload__Button.Polaris-DropZone-FileUpload--focused { outline: 0.2rem dotted; } }
914
- .Polaris-DropZone-FileUpload__Button .Polaris-DropZone-FileUpload--sizeSlim { min-height: 3rem; padding: 0.4rem 1.2rem; }
902
+ .Polaris-DropZone-FileUpload__Action { position: relative; display: inline-flex; flex: 0 0 auto; border: none; border-radius: var(--p-border-radius-base); padding: 0.4rem 0.6rem; margin: 0; text-decoration: none; color: var(--p-interactive-hovered); background: var(--p-surface-selected-pressed); font-size: 1.2rem; font-weight: 600; line-height: 1; cursor: pointer; text-align: center; -webkit-appearance: none; appearance: none; }
903
+ .Polaris-DropZone-FileUpload__Action::after { content: ''; position: absolute; z-index: 1; top: -0.1rem; right: -0.1rem; bottom: -0.1rem; left: -0.1rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.1rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
904
+ .Polaris-DropZone-FileUpload__Action:hover { color: var(--p-interactive-pressed); }
905
+ .Polaris-DropZone-FileUpload__Action.Polaris-DropZone-FileUpload--disabled { transition: none; box-shadow: none; border-color: var(--p-border-disabled); background: var(--p-surface-disabled); color: var(--p-text-disabled); cursor: not-allowed; box-shadow: none; }
906
+ .Polaris-DropZone-FileUpload__Action.Polaris-DropZone-FileUpload--disabled svg { fill: var(--p-icon-disabled); }
915
907
  .Polaris-DropZone-FileUpload__ActionTitle { color: var(--p-interactive); text-decoration: none; }
916
908
  .Polaris-DropZone-FileUpload__ActionTitle:not(.Polaris-DropZone-FileUpload__ActionTitle--disabled) { cursor: pointer; }
917
909
  .Polaris-DropZone-FileUpload__ActionTitle:not(.Polaris-DropZone-FileUpload__ActionTitle--disabled):hover, .Polaris-DropZone-FileUpload__ActionTitle:not(.Polaris-DropZone-FileUpload__ActionTitle--disabled):active { color: var(--p-interactive-pressed); text-decoration: underline; }
@@ -922,14 +914,14 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
922
914
  .Polaris-DropZone:not(.Polaris-DropZone--focused)::after { top: 0; left: 0; right: 0; bottom: 0; opacity: 1; transform: scale(1); border: 0.1rem dashed transparent; }
923
915
  .Polaris-DropZone:hover { outline: 0.1rem solid transparent; }
924
916
  .Polaris-DropZone--hasOutline { padding: 0.1rem; }
925
- .Polaris-DropZone--hasOutline::after { border-color: var(--p-border); }
926
- .Polaris-DropZone--hasOutline:not(.Polaris-DropZone--isDisabled):hover { cursor: pointer; background-color: var(--p-surface-selected-hovered); }
917
+ .Polaris-DropZone--hasOutline::after { border-color: var(--p-border-neutral-subdued); }
918
+ .Polaris-DropZone--hasOutline:not(.Polaris-DropZone--isDisabled):hover { cursor: pointer; background-color: var(--p-surface-subdued); }
927
919
  .Polaris-DropZone--hasOutline:not(.Polaris-DropZone--isDisabled):hover::after { border-color: var(--p-interactive-hovered); }
928
- .Polaris-DropZone--hasOutline:not(.Polaris-DropZone--focused)::after { top: 0; left: 0; right: 0; bottom: 0; opacity: 1; transform: scale(1); border: 0.1rem dashed transparent; border-radius: calc(var(--p-border-radius-base) + 0.2rem); border-color: var(--p-border); }
920
+ .Polaris-DropZone--hasOutline:not(.Polaris-DropZone--focused)::after { top: 0; left: 0; right: 0; bottom: 0; opacity: 1; transform: scale(1); border: 0.1rem dashed transparent; border-radius: calc(var(--p-border-radius-base) + 0.2rem); border-color: var(--p-border-neutral-subdued); }
929
921
  .Polaris-DropZone--isDragging:not(.Polaris-DropZone--isDisabled) { background-color: var(--p-surface-hovered); }
930
922
  .Polaris-DropZone--isDisabled { cursor: not-allowed; }
931
923
  .Polaris-DropZone--isDisabled::after { border-color: var(--p-border-disabled); }
932
- .Polaris-DropZone--sizeLarge { min-height: 10rem; }
924
+ .Polaris-DropZone--sizeLarge { min-height: 12rem; }
933
925
  .Polaris-DropZone--sizeMedium { min-height: 10rem; align-items: center; }
934
926
  .Polaris-DropZone--sizeSmall { padding: 0; align-items: center; min-height: 5rem; }
935
927
  .Polaris-DropZone--measuring { visibility: hidden; min-height: 0; }
@@ -985,25 +977,35 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
985
977
  .Polaris-Tag { display: inline-flex; max-width: 100%; align-items: center; min-height: 2.8rem; padding: 0 0.8rem; background-color: var(--p-surface-neutral); border-radius: var(--p-border-radius-base); color: var(--p-text); outline: 0.1rem solid transparent; }
986
978
  .Polaris-Tag.Polaris-Tag--disabled { transition: none; background: var(--p-surface-neutral-disabled); color: var(--p-text-disabled); }
987
979
  .Polaris-Tag.Polaris-Tag--disabled svg { fill: var(--p-icon-disabled); }
988
- .Polaris-Tag.Polaris-Tag--removable { padding-right: 0; }
989
980
  .Polaris-Tag.Polaris-Tag--clickable { -webkit-appearance: none; appearance: none; margin: 0; padding: 0; background: none; border: none; font-size: inherit; line-height: inherit; color: inherit; cursor: pointer; cursor: pointer; padding: 0 0.8rem; background-color: var(--p-surface-neutral); position: relative; }
990
981
  .Polaris-Tag.Polaris-Tag--clickable:focus { outline: none; }
991
982
  .Polaris-Tag.Polaris-Tag--clickable:hover { background: var(--p-surface-neutral-hovered); }
992
983
  .Polaris-Tag.Polaris-Tag--clickable::after { content: ''; position: absolute; z-index: 1; top: -0.1rem; right: -0.1rem; bottom: -0.1rem; left: -0.1rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.1rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
993
984
  .Polaris-Tag.Polaris-Tag--clickable:focus:not(:active)::after { box-shadow: 0 0 0 0.2rem var(--p-focused); outline: 0.1rem solid transparent; }
994
985
  .Polaris-Tag.Polaris-Tag--clickable:active { background: var(--p-surface-neutral-pressed); }
995
- .Polaris-Tag.Polaris-Tag--clickable:disabled { background: var(--p-surface-neutral-disabled); cursor: default; pointer-events: none; }
986
+ .Polaris-Tag.Polaris-Tag--clickable:disabled { background: var(--p-surface-neutral-disabled); cursor: default; pointer-events: none; color: var(--p-text-disabled); }
987
+ .Polaris-Tag.Polaris-Tag--removable { padding-right: 0; }
988
+ .Polaris-Tag.Polaris-Tag--linkable { padding: 0; }
996
989
  .Polaris-Tag__TagText { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
997
- .Polaris-Tag__Button { -webkit-appearance: none; appearance: none; margin: 0; padding: 0; background: none; border: none; font-size: inherit; line-height: inherit; color: inherit; cursor: pointer; display: block; height: 2.8rem; width: 2.8rem; margin-left: 0.4rem; border-radius: 0 0.3rem 0.3rem 0; position: relative; }
990
+ .Polaris-Tag__Button { -webkit-appearance: none; appearance: none; margin: 0; padding: 0; background: none; border: none; font-size: inherit; line-height: inherit; color: inherit; cursor: pointer; display: block; flex-shrink: 0; height: 2.8rem; width: 2.8rem; margin-left: 0.4rem; border-radius: 0 0.3rem 0.3rem 0; position: relative; }
998
991
  .Polaris-Tag__Button svg { fill: var(--p-icon); }
999
992
  .Polaris-Tag__Button:focus { outline: none; }
1000
993
  .Polaris-Tag__Button:hover { background: var(--p-surface-neutral-hovered); outline: 0.1rem solid transparent; }
1001
- .Polaris-Tag__Button:focus { background-color: transparent; }
1002
994
  .Polaris-Tag__Button::after { content: ''; position: absolute; z-index: 1; top: -0.1rem; right: -0.1rem; bottom: -0.1rem; left: -0.1rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.1rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
1003
995
  .Polaris-Tag__Button:focus:not(:active)::after { box-shadow: 0 0 0 0.2rem var(--p-focused); outline: 0.1rem solid transparent; }
1004
996
  .Polaris-Tag__Button:active { background: var(--p-surface-neutral-pressed); }
1005
997
  .Polaris-Tag__Button:disabled { cursor: default; pointer-events: none; }
1006
998
  .Polaris-Tag__Button:disabled svg { fill: var(--p-icon-disabled); }
999
+ .Polaris-Tag__Button.Polaris-Tag--segmented { margin-left: -0.4rem; }
1000
+ .Polaris-Tag__Button.Polaris-Tag--segmented::after { border-top-left-radius: 0; border-bottom-left-radius: 0; }
1001
+ .Polaris-Tag__Link { display: inline-grid; color: var(--p-text); outline: none; border-radius: var(--p-border-radius-base); text-decoration: none; padding: 0.4rem 0.8rem; position: relative; }
1002
+ .Polaris-Tag__Link .Polaris-Tag__LinkText { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
1003
+ .Polaris-Tag__Link::after { content: ''; position: absolute; z-index: 1; top: -0.1rem; right: -0.1rem; bottom: -0.1rem; left: -0.1rem; display: block; pointer-events: none; box-shadow: 0 0 0 -0.1rem var(--p-focused); transition: box-shadow 100ms var(--p-ease); border-radius: calc(var(--p-border-radius-base) + 0.1rem); }
1004
+ .Polaris-Tag__Link:focus:not(:active) { text-decoration: underline; }
1005
+ .Polaris-Tag__Link:focus:not(:active)::after { box-shadow: 0 0 0 0.2rem var(--p-focused); outline: 0.1rem solid transparent; }
1006
+ .Polaris-Tag__Link:hover { background: var(--p-surface-neutral-hovered); text-decoration: underline; }
1007
+ .Polaris-Tag__Link.Polaris-Tag--segmented { border-top-right-radius: 0; border-bottom-right-radius: 0; }
1008
+ .Polaris-Tag__Link.Polaris-Tag--segmented::after { margin-right: 0.4rem; border-top-right-radius: 0; border-bottom-right-radius: 0; }
1007
1009
  .Polaris-Sheet { position: fixed; bottom: 0; width: 100%; height: 100%; background-color: var(--p-surface); box-shadow: var(--p-modal-shadow); }
1008
1010
  @media screen and (-ms-high-contrast: active) { .Polaris-Sheet { border-left: 0.1rem solid var(--p-border-subdued); } }
1009
1011
  @media (min-width: 48.0625em) { .Polaris-Sheet { right: 0; width: 38rem; } }
@@ -1537,6 +1539,9 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
1537
1539
  .Polaris-OptionList-Option--disabled .Polaris-OptionList-Option__Media svg { fill: var(--p-icon-disabled); }
1538
1540
  .Polaris-OptionList-Option__Media { padding: 0 0.8rem; }
1539
1541
  .Polaris-OptionList-Option__Media svg { fill: var(--p-icon); }
1542
+ .Polaris-OptionList-Option--verticalAlignTop { align-items: flex-start; }
1543
+ .Polaris-OptionList-Option--verticalAlignCenter { align-items: center; }
1544
+ .Polaris-OptionList-Option--verticalAlignBottom { align-items: flex-end; }
1540
1545
  .Polaris-OptionList { margin: 0; padding: 0; list-style: none; padding: 0.8rem; }
1541
1546
  .Polaris-OptionList__Options { margin: 0; padding: 0; list-style: none; }
1542
1547
  .Polaris-OptionList__Title { font-size: 1.3rem; font-weight: 600; line-height: 1.6rem; text-transform: uppercase; padding: 0.8rem; color: var(--p-text-subdued); }
@@ -1592,7 +1597,7 @@ button::-moz-focus-inner, [type='button']::-moz-focus-inner, [type='reset']::-mo
1592
1597
  @media (min-width: 30.625em) { .Polaris-Page-Header--mobileView .Polaris-Page-Header__ActionMenuWrapper { right: -0.8rem; } }
1593
1598
  .Polaris-Page-Header--mobileView.Polaris-Page-Header--hasNavigation .Polaris-Page-Header__ActionMenuWrapper { top: 1.8rem; }
1594
1599
  @media print { .Polaris-Page-Header__ActionMenuWrapper { display: none !important; } }
1595
- .Polaris-Page-Header__Row { display: flex; justify-content: space-between; }
1600
+ .Polaris-Page-Header__Row { display: flex; justify-content: space-between; min-height: 3.6rem; }
1596
1601
  .Polaris-Page-Header__Row + .Polaris-Page-Header__Row { margin-top: 0.4rem; }
1597
1602
  .Polaris-Page-Header--mobileView .Polaris-Page-Header__Row + .Polaris-Page-Header__Row { margin-top: 0.8rem; }
1598
1603
  .Polaris-Page-Header__Row + .Polaris-Page-Header__Row .Polaris-Page-Header__RightAlign { margin-left: 0; }
@@ -2320,6 +2325,13 @@ a.Polaris-Tag__Button {
2320
2325
  text-align: center;
2321
2326
  justify-content: center;
2322
2327
  }
2328
+ .Polaris-DropZone__Preview--sizeMedium {
2329
+ justify-content: center;
2330
+ text-align: center;
2331
+ }
2332
+ .Polaris-DropZone__Preview--sizeMedium .Polaris-Stack.Polaris-Stack--alignmentCenter {
2333
+ justify-content: center;
2334
+ }
2323
2335
  .Polaris-DropZone__Preview--sizeSmall {
2324
2336
  padding: 0;
2325
2337
  justify-content: center;
@@ -2338,3 +2350,26 @@ a.Polaris-Tag__Button {
2338
2350
  text-align: center;
2339
2351
  justify-content: center;
2340
2352
  }
2353
+ .Polaris-DropZone__Loader .Polaris-Spinner--sizeSmall {
2354
+ height: 20px;
2355
+ }
2356
+ /* ActionMenu */
2357
+ @media (min-width: 768px){
2358
+ .Polaris-ActionMenu--mobile {
2359
+ display: none
2360
+ }
2361
+ }
2362
+ .Polaris-ActionMenu--desktop {
2363
+ display: none;
2364
+ }
2365
+ @media (min-width: 768px){
2366
+ .Polaris-ActionMenu--desktop {
2367
+ display: block
2368
+ }
2369
+ }
2370
+ /* Page Pagination */
2371
+ @media (max-width: 768px){
2372
+ .Polaris-Page-Header__PaginationWrapper {
2373
+ display: none;
2374
+ }
2375
+ }
@@ -5,6 +5,7 @@ class Polaris::ActionList::ItemComponent < Polaris::Component
5
5
  def initialize(
6
6
  url: nil,
7
7
  icon: nil,
8
+ icon_name: nil,
8
9
  help_text: nil,
9
10
  active: false,
10
11
  destructive: false,
@@ -12,7 +13,7 @@ class Polaris::ActionList::ItemComponent < Polaris::Component
12
13
  **system_arguments
13
14
  )
14
15
  @url = url
15
- @icon = icon
16
+ @icon = icon || icon_name
16
17
  @help_text = help_text
17
18
  @active = active
18
19
  @destructive = destructive
@@ -6,9 +6,9 @@
6
6
  </span>
7
7
  <% end %>
8
8
 
9
- <% if icon.present? %>
9
+ <% if icon.present? || @icon_name.present? %>
10
10
  <div class="Polaris-Button__Icon">
11
- <%= icon %>
11
+ <%= icon.presence || polaris_icon(name: @icon_name) %>
12
12
  </div>
13
13
  <% if content.present? %>
14
14
  &nbsp;
@@ -0,0 +1,37 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Polaris
4
+ class CollapsibleComponent < Polaris::Component
5
+ def initialize(
6
+ expand_on_print: false,
7
+ open: false,
8
+ **system_arguments
9
+ )
10
+ @expand_on_print = expand_on_print
11
+ @open = open
12
+ @system_arguments = system_arguments
13
+ end
14
+
15
+ def system_arguments
16
+ @system_arguments.tap do |opts|
17
+ opts[:tag] = "div"
18
+ opts[:data] ||= {}
19
+ prepend_option(opts[:data], :controller, "polaris-collapsible")
20
+ opts[:classes] = class_names(
21
+ @system_arguments[:classes],
22
+ "Polaris-Collapsible",
23
+ "Polaris-Collapsible--isFullyClosed": !@open,
24
+ "Polaris-Collapsible--expandOnPrint": @expand_on_print
25
+ )
26
+ opts[:style] = class_names(
27
+ @open ? "max-height: none;" : "max-height: 0px;",
28
+ @open ? "overflow: visible;" : "overflow: hidden;"
29
+ )
30
+ end
31
+ end
32
+
33
+ def call
34
+ render(Polaris::BaseComponent.new(**system_arguments)) { content }
35
+ end
36
+ end
37
+ end
@@ -4,10 +4,12 @@
4
4
  class="Polaris-DropZone__Overlay Polaris-VisuallyHidden"
5
5
  data-polaris-dropzone-target="overlay"
6
6
  >
7
- <%= render Polaris::StackComponent.new(vertical: true, spacing: :tight) do |stack| %>
8
- <% stack.item do %>
9
- <%= render Polaris::DisplayTextComponent.new(size: :small) do %>
10
- <%= @overlay_text %>
7
+ <% unless @size == :small %>
8
+ <%= render Polaris::StackComponent.new(vertical: true, spacing: :tight) do |stack| %>
9
+ <% stack.item do %>
10
+ <%= render Polaris::DisplayTextComponent.new(size: :small) do %>
11
+ <%= @overlay_text %>
12
+ <% end %>
11
13
  <% end %>
12
14
  <% end %>
13
15
  <% end %>
@@ -68,7 +70,7 @@
68
70
  <% end %>
69
71
 
70
72
  <div class="Polaris-DropZone__Loader Polaris--hidden" data-polaris-dropzone-target="loader">
71
- <%= polaris_spinner %>
73
+ <%= polaris_spinner(size: (@size == :small) ? :small : :large) %>
72
74
  </div>
73
75
  </div>
74
76
 
@@ -86,7 +88,8 @@
86
88
  class: [
87
89
  "Polaris-DropZone__Preview",
88
90
  "Polaris-DropZone__Preview--singleFile": !@multiple,
89
- "Polaris-DropZone__Preview--sizeSmall": @size == :small
91
+ "Polaris-DropZone__Preview--sizeMedium": @size == :medium,
92
+ "Polaris-DropZone__Preview--sizeSmall": @size == :small,
90
93
  ]
91
94
  ) do %>
92
95
  <% if @size.in?(%i[small]) %>
@@ -74,7 +74,9 @@ module Polaris
74
74
  def popover_arguments
75
75
  {
76
76
  sectioned: @sectioned,
77
- style: ("width: #{@width}" if @width.present?)
77
+ style: ("width: #{@width}" if @width.present?),
78
+ position: :below,
79
+ alignment: :left
78
80
  }
79
81
  end
80
82
 
@@ -5,9 +5,9 @@
5
5
  </span>
6
6
  <% end %>
7
7
 
8
- <% if icon.present? %>
8
+ <% if icon.present? || @icon_name.present? %>
9
9
  <div class="Polaris-Button__Icon">
10
- <%= icon %>
10
+ <%= icon || polaris_icon(name: @icon_name) %>
11
11
  </div>
12
12
  <% if content.present? %>
13
13
  &nbsp;
@@ -42,6 +42,7 @@ module Polaris
42
42
  remove_underline: false,
43
43
  size: SIZE_DEFAULT,
44
44
  text_align: TEXT_ALIGN_DEFAULT,
45
+ icon_name: nil,
45
46
  **system_arguments
46
47
  )
47
48
  @tag = url.present? ? "a" : "button"
@@ -52,6 +53,7 @@ module Polaris
52
53
  @loading = loading
53
54
  @disclosure = fetch_or_fallback(DISCLOSURE_OPTIONS, disclosure, DISCLOSURE_DEFAULT)
54
55
  @disclosure = :down if @disclosure === true
56
+ @icon_name = icon_name
55
57
 
56
58
  @system_arguments = system_arguments
57
59
  @system_arguments[:type] = submit ? "submit" : "button"
@@ -92,7 +94,7 @@ module Polaris
92
94
  def system_arguments
93
95
  @system_arguments[:classes] = class_names(
94
96
  @system_arguments[:classes],
95
- "Polaris-Button--iconOnly": icon.present? && content.blank?
97
+ "Polaris-Button--iconOnly": (icon.present? || @icon_name.present?) && content.blank?
96
98
  )
97
99
  @system_arguments
98
100
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Polaris
4
+ class KeyboardKeyComponent < Polaris::Component
5
+ def initialize(**system_arguments)
6
+ @system_arguments = system_arguments
7
+ end
8
+
9
+ def system_arguments
10
+ @system_arguments.tap do |opts|
11
+ opts[:tag] = "div"
12
+ opts[:classes] = class_names(opts[:classes], "Polaris-KeyboardKey")
13
+ end
14
+ end
15
+
16
+ def call
17
+ render(Polaris::BaseComponent.new(**system_arguments)) { content }
18
+ end
19
+ end
20
+ end
@@ -1,6 +1,6 @@
1
- <%= render Polaris::BaseComponent.new(**@system_arguments) do %>
1
+ <%= render Polaris::BaseComponent.new(**system_arguments) do %>
2
2
  <% if render_header? %>
3
- <%= render Polaris::BaseComponent.new(**@header_arguments) do %>
3
+ <%= render Polaris::BaseComponent.new(**header_arguments) do %>
4
4
  <div class="Polaris-Page-Header__Row">
5
5
  <% if @back_url.present? %>
6
6
  <div class="Polaris-Page-Header__BreadcrumbWrapper">
@@ -17,7 +17,7 @@
17
17
  <% end %>
18
18
 
19
19
  <div class="Polaris-Page-Header__TitleWrapper">
20
- <div <% if thumbnail.present? %>class="Polaris-Header-Title--hasThumbnail"<% end %>>
20
+ <%= tag.div(class: ["Polaris-Header-Title--hasThumbnail": thumbnail.present?]) do %>
21
21
  <% if thumbnail.present? %>
22
22
  <div>
23
23
  <%= thumbnail %>
@@ -38,18 +38,89 @@
38
38
  <% end %>
39
39
 
40
40
  <% if @subtitle.present? %>
41
- <div class="Polaris-Header-Title__SubTitle">
41
+ <%= render Polaris::BaseComponent.new(**subtitle_arguments) do %>
42
42
  <p><%= @subtitle %></p>
43
- </div>
43
+ <% end %>
44
44
  <% end %>
45
45
  </div>
46
- </div>
46
+ <% end %>
47
47
  </div>
48
48
 
49
- <% if primary_action.present? %>
49
+ <% if @secondary_actions.any? || action_group.present? || primary_action.present? || has_pagination? %>
50
50
  <div class="Polaris-Page-Header__RightAlign">
51
- <div class="Polaris-Page-Header__PrimaryActionWrapper">
52
- <%= primary_action %>
51
+ <div class="Polaris-Page-Header__Actions">
52
+ <% if @secondary_actions.any? || action_group.present? %>
53
+ <div class="Polaris-ActionMenu Polaris-ActionMenu--mobile">
54
+ <div class="Polaris-ActionMenu-RollupActions__RollupActivator">
55
+ <%= polaris_popover do |popover| %>
56
+ <% popover.button do |button| %>
57
+ <% button.icon(name: "HorizontalDotsMinor") %>
58
+ <% end %>
59
+ <%= polaris_action_list(style: "text-align: left;") do |action_list| %>
60
+ <% if @secondary_actions.any? %>
61
+ <% action_list.section do |section| %>
62
+ <% @secondary_actions.each do |action| %>
63
+ <% section.item(**action) { action[:content] } %>
64
+ <% end %>
65
+ <% end %>
66
+ <% end %>
67
+
68
+ <% if action_group.present? %>
69
+ <% action_list.section(title: action_group.title) do |section| %>
70
+ <% action_group.actions.each do |action| %>
71
+ <% section.item(**action) { action[:content] } %>
72
+ <% end %>
73
+ <% end %>
74
+ <% end %>
75
+ <% end %>
76
+ <% end %>
77
+ </div>
78
+ </div>
79
+ <div class="Polaris-ActionMenu Polaris-ActionMenu--desktop">
80
+ <div class="Polaris-ActionMenu-Actions__ActionsLayout">
81
+ <%= polaris_button_group(spacing: :extra_tight) do |group| %>
82
+ <% @secondary_actions.each do |action| %>
83
+ <% group.item do %>
84
+ <% destructive = action.delete(:destructive) %>
85
+ <% tag.span(class: ["Polaris-ActionMenu-SecondaryAction", "Polaris-ActionMenu-SecondaryAction--destructive": destructive]) do %>
86
+ <%= polaris_button(**action) { action[:content] } %>
87
+ <% end %>
88
+ <% end %>
89
+ <% end %>
90
+ <% if action_group.present? %>
91
+ <% group.item do %>
92
+ <span class="Polaris-ActionMenu-SecondaryAction">
93
+ <%= action_group %>
94
+ </span>
95
+ <% end %>
96
+ <% end %>
97
+ <% end %>
98
+ </div>
99
+ </div>
100
+ <% end %>
101
+ <% if primary_action.present? %>
102
+ <div class="Polaris-Page-Header__PrimaryActionWrapper">
103
+ <%= primary_action %>
104
+ </div>
105
+ <% end %>
106
+ <% if has_pagination? %>
107
+ <div class="Polaris-Page-Header__PaginationWrapper">
108
+ <nav aria-label="Pagination">
109
+ <%= polaris_button_group(segmented: true) do |group| %>
110
+ <% group.item do %>
111
+ <%= polaris_button(url: @prev_url, outline: true, disabled: @prev_url.blank?) do |button| %>
112
+ <% button.icon(name: "ChevronLeftMinor") %>
113
+ <% end %>
114
+ <% end %>
115
+ <% group.item do %>
116
+ <%= polaris_button(url: @next_url, outline: true, disabled: @next_url.blank?) do |button| %>
117
+ <% button.icon(name: "ChevronRightMinor") %>
118
+ <% end %>
119
+ <% end %>
120
+ <% end %>
121
+ </nav>
122
+ </div>
123
+ <% end %>
53
124
  </div>
54
125
  </div>
55
126
  <% end %>
@@ -57,7 +128,7 @@
57
128
  <% end %>
58
129
  <% end %>
59
130
 
60
- <%= render Polaris::BaseComponent.new(**@content_arguments) do %>
131
+ <%= render Polaris::BaseComponent.new(**content_arguments) do %>
61
132
  <%= content %>
62
133
  <% end %>
63
134
  <% end %>