Skip to content

Commit

Permalink
Merge pull request #144 from PrestaShop/develop
Browse files Browse the repository at this point in the history
Release 1.2.2
  • Loading branch information
PierreRambaud authored Mar 17, 2021
2 parents 5ddca9d + cec9272 commit 0134ac6
Show file tree
Hide file tree
Showing 17 changed files with 147 additions and 32 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Open up `admin-dev/themes/new-theme/package.json` of your PrestaShop install, an
```js
{
// ...
prestakit: "1.2.0"
prestakit: "1.2.2";
// ...
}
```
Expand All @@ -63,7 +63,7 @@ Change the version so it looks like this:

```js
{
prestakit: "/path/to/your/local/ui-kit"
prestakit: "/path/to/your/local/ui-kit";
}
```

Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrap-prestashop-ui-kit.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/css/bootstrap-prestashop-ui-kit.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/prestashop-ui-kit.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/js/prestashop-ui-kit.js.map

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions js/prestashop-ui-kit.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import './utils/migrate-mute';
import 'jquery-migrate';
import 'tether';
import 'bootstrap';
import 'select2';
Expand Down Expand Up @@ -171,14 +173,27 @@ $.fn.pstooltip = $.fn.tooltip;
PSNumbers('.ps-number-input');
});
},

initSelects: function () {
initSelect2();
},

initToolTips: function () {
initToolTips();
},
initToggleButtons: function () {
initToggleButtons();
},
initAlerts: function () {
initAlerts();
},
initSearchBar: function () {
initSearchBar();
},
initInputFile: function () {
initInputFile();
},
initNumbers: function () {
PSNumbers('.ps-number-input');
},
};

global.prestaShopUiKit.init();
Expand Down
34 changes: 34 additions & 0 deletions js/utils/migrate-mute.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* Copyright since 2007 PrestaShop SA and Contributors
* PrestaShop is an International Registered Trademark & Property of PrestaShop SA
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/OSL-3.0
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to [email protected] so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to https://devdocs.prestashop.com/ for more information.
*
* @author PrestaShop SA and Contributors <[email protected]>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
*/

(function () {
if (
typeof jQuery.migrateMute === 'undefined' &&
typeof window.prestashop !== 'undefined' &&
typeof window.prestashop.debug !== 'undefined'
) {
jQuery.migrateMute = !window.prestashop.debug;
}
})();
38 changes: 25 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "prestakit",
"version": "1.2.1",
"version": "1.2.2",
"description": "Prestashop UI Kit integration",
"repository": {
"type": "git",
"url": "https://github.com/PrestaShop/prestashop-ui-kit.git"
},
"keywords": ["prestashop", "uikit"],
"keywords": [
"prestashop",
"uikit"
],
"scripts": {
"watch": "webpack -w --progress --debug",
"build": "NODE_ENV=production webpack --progress --debug",
Expand Down Expand Up @@ -46,6 +49,7 @@
"expose-loader": "^0.7.5",
"file-loader": "^6.0.0",
"jquery": "^3.5.0",
"jquery-migrate": "^3.3.2",
"mini-css-extract-plugin": "^0.9.0",
"node-sass": "^4.13.0",
"popper.js": "^1.14.1",
Expand Down
19 changes: 17 additions & 2 deletions scss/_floating-button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
bottom: calc(100% + 1rem);
@include transition(.25s ease-out);


&.collapsing {
.btn-floating-menu {
&::after {
Expand All @@ -46,11 +45,13 @@
}

& &-menu {
position: relative;
display: flex;
flex-direction: column;
align-items: flex-start;
width: 20rem;
padding: .5rem;
overflow: hidden;
@include border-radius(.5rem);

a,
button {
Expand Down Expand Up @@ -90,9 +91,23 @@
align-items: center;
justify-content: space-between;
width: 100%;
padding: .5rem .75rem;
font-weight: 500;
color: $gray-750;
@include transition(.25s ease-out);
@include border-radius(0);

.material-icon {
margin-top: 0;
}

&:first-of-type {
@include border-top-radius(.5rem);
}

&:last-of-type {
@include border-bottom-radius(.5rem);
}

&:hover {
color: $white;
Expand Down
2 changes: 0 additions & 2 deletions scss/_forms.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,6 @@ $form-check-name: form-check;

input {
position: absolute;
width: 0;
height: 0;
cursor: pointer;
opacity: 0;
}
Expand Down
1 change: 1 addition & 0 deletions scss/_modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ $component-name: modal;
.#{$component-name} {
.#{$component-name}-dialog {
top: 50%;
max-height: 100vh;
}

&.show {
Expand Down
3 changes: 1 addition & 2 deletions scss/_ps-switch.scss
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
z-index: 0;
}

&:first-of-type:checked,
&:first-of-type:disabled {
&:first-of-type:checked {
~ label:first-of-type {
opacity: 1;
}
Expand Down
4 changes: 2 additions & 2 deletions scss/_select2.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ $component-name: select2;
background: rgba($primary, .1);
}

&:focus,
&:active {
&:not([role="group"]):focus,
&:not([role="group"]):active {
color: #fff;
background: $primary;
}
Expand Down
18 changes: 18 additions & 0 deletions stories/html/floating/floating.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<div class="floating-buttons">
<div class="btn-floating">
<button
class="btn btn-primary collapsed"
data-toggle="collapse"
data-target=".btn-floating-container"
>
<i class="material-icons">add</i>
</button>
<div class="btn-floating-container collapse">
<div class="btn-floating-menu">
<a class="btn btn-floating-item" href="#"
>Upload a module <i class="material-icons">download</i></a
>
</div>
</div>
</div>
</div>
14 changes: 14 additions & 0 deletions stories/html/floating/index.stories.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks';
import floatingContent from './floating.html'

<Meta title="Floating" />

# Floating button

Used in the backoffice on responsive view, to contains pages actions

<Canvas>
<Story name="Floating" parameters={{ docs: { source: { code: floatingContent } } }}>
{() => floatingContent}
</Story>
</Canvas>
7 changes: 6 additions & 1 deletion stories/html/form/index.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,12 @@ import loginContent from './login-example.html'

<Canvas>
<Story name="Selects" parameters={{ docs: { source: { code: selectContent } } }}>
{() => selectContent}
{() => {
useEffect(() => {
window.prestaShopUiKit.init();
});
return selectContent;
}}
</Story>
</Canvas>

Expand Down

0 comments on commit 0134ac6

Please sign in to comment.