Skip to content

Commit

Permalink
Merge pull request #7 from new-data-services/2.0
Browse files Browse the repository at this point in the history
2.0
  • Loading branch information
muesker authored Jun 10, 2024
2 parents 6a084d5 + fdb89f8 commit 93e9869
Show file tree
Hide file tree
Showing 30 changed files with 370 additions and 189 deletions.
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!-- statamic:hide -->

# Bard Color Picker
# Statamic Bard Text Color

<!-- /statamic:hide -->

Expand All @@ -9,10 +9,9 @@
## Features

- Set text color in Bard fields
- Customizable layouts
- Predefined color swatches
- Support for HEX, RGB, CMYK and more
- Beautiful and easy to use color panel
- Dark Mode Support

## Installation

Expand All @@ -30,16 +29,31 @@ Open the blueprint or fieldset that contains your Bard field, open the settings

## Configuration

If you want to change the layout, components or predefined colors, make sure that the configuration file is published by entering the following command:
If you want to define swatches or disable the color picker, make sure that the configuration file is published by entering the following command:

``` bash
php artisan vendor:publish --tag=bard-color-picker-config
```

This addon uses the [@simonwep/pickr](https://github.com/Simonwep/pickr) package under the hood and supports many configuration options including different layouts.

Have a look at the [configuration file](config/bard-color-picker.php) for details.

## Migrate from 1.x

Instead of the @simonwep/pickr package, this addon uses a native HTML color picker since v2.0. This causes some breaking changes.

- Statamic 5 is required
- Colors are always saved in HEX format
- The [configuration file](config/bard-color-picker.php) has changed completely

After updating from v1.x to v2.0 we recommend to republish the addon configuration, overwrite old settings and define new ones:

``` bash
php artisan vendor:publish --tag=bard-color-picker-config --force
```

Alternatively, you could rename the `recommended` item to `swatches` in your configuration.


## About us

We develop digital solutions for all kinds of disciplines. From the idea and concepts to implementation and operation.
Expand All @@ -50,7 +64,6 @@ Visit our website: [new-data-services.de](https://new-data-services.de/)

---

<a href="https://statamic.com/addons/new-data-services/bard-color-picker"><img src="https://img.shields.io/badge/Statamic-3.4+-FF269E?style=for-the-badge"></a>
<a href="https://packagist.org/packages/ndx/statamic-bard-color-picker"><img src="https://img.shields.io/packagist/v/ndx/statamic-bard-color-picker?style=for-the-badge"></a>
<a href="https://packagist.org/packages/ndx/statamic-bard-color-picker"><img src="https://img.shields.io/packagist/dt/ndx/statamic-bard-color-picker?style=for-the-badge"></a>

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
}
],
"require": {
"statamic/cms": "^3.4 || ^4.0 || ^5.0"
"statamic/cms": "^5.0"
},
"require-dev": {
"orchestra/testbench": "^9.0",
Expand Down
44 changes: 10 additions & 34 deletions config/bard-color-picker.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,29 @@

/*
|--------------------------------------------------------------------------
| Pickr theme
| Color Swatches
|--------------------------------------------------------------------------
|
| Set the pickr theme
| https://simonwep.github.io/pickr/
| Supported: "classic", "monolith", "nano"
| Specify an array with predefined colors (swatches).
| The colors should be in HEX format.
|
*/

'theme' => 'nano',

/*
|--------------------------------------------------------------------------
| Main components
|--------------------------------------------------------------------------
*/

'components' => [
'preview' => true, // comparison between old and new color
'opacity' => true, // opacity slider
'hue' => true, // hue slider
],

/*
|--------------------------------------------------------------------------
| Pickr swatches (recommended colors)
|--------------------------------------------------------------------------
*/

'recommended' => [
'swatches' => [
//'#FF269E',
//'#01D7B0',
],

/*
|--------------------------------------------------------------------------
| Input / output options
| Allow any Color
|--------------------------------------------------------------------------
|
| Set this to false to deactivate the color picker.
| (Swatches only mode)
|
*/

'interactions' => [
'hex' => false,
'rgba' => false,
'hsla' => false,
'hsva' => false,
'cmyk' => false,
'input' => false,
],
'allow_any' => true,

];
1 change: 1 addition & 0 deletions dist/css/addon.css

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

2 changes: 0 additions & 2 deletions dist/css/classic.css

This file was deleted.

Loading

0 comments on commit 93e9869

Please sign in to comment.