Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Go BLUI #34

Merged
merged 9 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/.npmrc
echo "//registry.yarnpkg.com/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- run:
name: Publish @pxblue/storybook-rtl-addon
name: Publish @brightlayer-ui/storybook-rtl-addon
command: |
cd rtl && yarn publish:package -b $CIRCLE_BRANCH
tag:
Expand All @@ -61,9 +61,9 @@ jobs:
- checkout
- gh/setup
- run:
name: Tag @pxblue/storybook-rtl-addon
name: Tag @brightlayer-ui/storybook-rtl-addon
command: |
cd rtl && yarn tag:package -b $CIRCLE_BRANCH
cd rtl && yarn tag:package -b $CIRCLE_BRANCH -s -blui-storybook-rtl-addon
workflows:
version: 2
storybook-addons:
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2020 - present, Power Xpert Blue
Copyright (c) 2020 - present, Eaton
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# PX Blue Storybook Addons
# Brightlayer UI Storybook Addons

This repository contains custom Storybook addons.
2 changes: 1 addition & 1 deletion rtl/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
parser: '@typescript-eslint/parser',
extends: [ '@pxblue/eslint-config/tsx' ],
extends: [ '@brightlayer-ui/eslint-config/tsx' ],
parserOptions: {
project: "./tsconfig.json",
},
Expand Down
14 changes: 13 additions & 1 deletion rtl/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Change Log
# Changelog

## v1.1.0 (October 21, 2021)

### Changed

- Changed package namespace from `@pxblue` to `@brightlayer-ui`.

## Package Migration Notice

Previous versions listed after this indicator refer to our deprecated `@pxblue` packages.

___

## v1.1.0 (October 21, 2021)

Expand Down
26 changes: 13 additions & 13 deletions rtl/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![npm](https://img.shields.io/npm/v/@pxblue/storybook-rtl-addon?label=%40pxblue%2Fstorybook-rtl-addon)
![npm](https://img.shields.io/npm/v/@brightlayer-ui/storybook-rtl-addon?label=%40brightlayer-ui%2Fstorybook-rtl-addon)


# @pxblue/storybook-rtl-addon
# @brightlayer-ui/storybook-rtl-addon

This storybook addon provides a Right-to-Left toggle used to test your component's bidirectionality support.
When this addon is active, it sets the current story body's `dir` attribute to `rtl`.
Expand All @@ -11,16 +11,16 @@ This addon assumes the default text orientation of the parent storybook app is L

## Installation

To install the `@pxblue/storybook-rtl-addon` run:
To install the `@brightlayer-ui/storybook-rtl-addon` run:

```
yarn add @pxblue/storybook-rtl-addon
yarn add @brightlayer-ui/storybook-rtl-addon
```

In your `main.js` file, register this addon:

```
addons: ['@pxblue/storybook-rtl-addon/register']
addons: ['@brightlayer-ui/storybook-rtl-addon/register']
```

## Usage
Expand All @@ -31,14 +31,14 @@ This package exports two functions `getDirection` & `useDirection` that returns
`getDirection` is used within Stories to access the current `Direction`. In React, this is value is only set during the initial component mount.


PX Blue uses this addon extensively in our storybook documentation to guarantee bidirectional support of our components and examples.
Brightlayer UI uses this addon extensively in our storybook documentation to guarantee bidirectional support of our components and examples.

To see live-example usage of this addon, click on the "Story" tab of each linked example.

### Angular Usage

```ts
import { getDirection } from '@pxblue/storybook-rtl-addon';
import { getDirection } from '@brightlayer-ui/storybook-rtl-addon';

export const angularExampleStory = () => ({
template: `
Expand All @@ -53,21 +53,21 @@ export const angularExampleStory = () => ({

> **Angular Components**: If your component uses the Direction service, use the exported function `getDirection()` to supply the `[dir]` directive with the appropriate direction.

[Live Example](https://pxblue-components.github.io/angular/?path=/story/components-score-card--with-full-config)
[Live Example](https://brightlayer-ui-components.github.io/angular/?path=/story/components-score-card--with-full-config)


### React Usage

```ts
import { getDirection } from '@pxblue/storybook-rtl-addon';
import { getDirection } from '@brightlayer-ui/storybook-rtl-addon';

export const reactExampleStory = () => {
const direction = getDirection();
return <div>{direction}</div>;
}

```
[Live Example](https://pxblue-components.github.io/react/?path=/story/components-user-menu--within-toolbar)
[Live Example](https://brightlayer-ui-components.github.io/react/?path=/story/components-user-menu--within-toolbar)



Expand All @@ -76,7 +76,7 @@ export const reactExampleStory = () => {


```ts
import useDirection from "@pxblue/storybook-rtl-addon/useDirection";
import useDirection from "@brightlayer-ui/storybook-rtl-addon/useDirection";

export const decorators = [
(Story) => {
Expand Down Expand Up @@ -109,11 +109,11 @@ From another terminal, run:

From your storybook app's root folder, run:

```yarn link @pxblue/storybook-rtl-addon```
```yarn link @brightlayer-ui/storybook-rtl-addon```

When finished testing the local version of this addon, run:

```yarn unlink @pxblue/storybook-rtl-addon```
```yarn unlink @brightlayer-ui/storybook-rtl-addon```



25 changes: 12 additions & 13 deletions rtl/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@pxblue/storybook-rtl-addon",
"name": "@brightlayer-ui/storybook-rtl-addon",
"version": "1.1.0",
"description": "RTL Toggle for Storybook",
"main": "dist/index.js",
Expand All @@ -15,39 +15,38 @@
],
"repository": {
"type": "git",
"url": "git+https://github.com/pxblue/storybook-addons.git"
"url": "git+https://github.com/brightlayer-ui/storybook-addons.git"
},
"keywords": [
"pxblue",
"brightlayer-ui",
"storybook",
"addon",
"addons",
"rtl",
"i18n",
"bidirection",
"pxblue",
"storybook-addon",
"style"
],
"storybook": {
"displayName": "@pxblue/storybook-rtl-addon",
"displayName": "@brightlayer-ui/storybook-rtl-addon",
"unsupportedFrameworks": ["vue", "web-components", "ember", "html", "riot", "mithril", "marko", "svelte", "rax", "preact", "auerlia", "marionette", "react-native"],
"supportedFrameworks": ["react, angular"],
"icon": "https://pxblue.github.io/pxblue.png"
"icon": "https://brightlayer-ui.github.io/brightlayer-ui.png"
},
"author": "PX Blue <pxblue@eaton.com>",
"author": "Brightlayer UI <brightlayer-ui@eaton.com>",
"license": "BSD-3-Clause",
"bugs": {
"url": "https://github.com/pxblue/storybook-addons/issues"
"url": "https://github.com/brightlayer-ui/storybook-addons/issues"
},
"homepage": "https://github.com/pxblue/storybook-addons#readme",
"homepage": "https://github.com/brightlayer-ui/storybook-addons#readme",
"scripts": {
"build": "tsc",
"watch": "tsc --watch",
"prettier": "prettier \"src/**/**.{ts,json,css,scss,html,tsx}\" --write",
"prettier:check": "prettier \"src/**/**.{ts,json,css,scss,html}\" --check",
"publish:package": "set npm_config_yes=true && npx -p @pxblue/publish pxb-publish",
"tag:package": "npx -p @pxblue/tag pxb-tag",
"publish:package": "set npm_config_yes=true && npx -p @brightlayer-ui/publish blui-publish",
"tag:package": "npx -p @brightlayer-ui/tag blui-tag",
"lint": "eslint \"src/**/**.tsx\"",
"lint:fix": "eslint \"src/**/**.tsx\" --fix"
},
Expand All @@ -61,8 +60,8 @@
"@babel/preset-env": "^7.10.3",
"@babel/preset-react": "^7.10.1",
"@babel/preset-typescript": "^7.10.1",
"@pxblue/eslint-config": "^2.0.1",
"@pxblue/prettier-config": "^1.0.2",
"@brightlayer-ui/eslint-config": "^2.0.1",
"@brightlayer-ui/prettier-config": "^1.0.2",
"@storybook/addons": "5.3.19",
"@storybook/api": "5.3.19",
"@storybook/components": "5.3.19",
Expand Down
4 changes: 2 additions & 2 deletions rtl/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const ADDON_ID = "@PXBLUE/RTL_ADDON";
export const ADDON_ID = "@BRIGHTLAYER_UI/RTL_ADDON";
export const DIR_CHANGE_EVENT = `${ADDON_ID}/DIRECTION_CHANGE`;
export const DIRECTION_STORAGE_ID = `${ADDON_ID}/CURRENT_DIRECTION`;
export const PARAM_KEY = "pxb-rtl";
export const PARAM_KEY = "blui-rtl";
2 changes: 1 addition & 1 deletion rtl/useDirection.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Shim to provide types for `@pxblue/storybook-rtl-addon/useDirection` imports
// Shim to provide types for `@brightlayer-ui/storybook-rtl-addon/useDirection` imports

import { useDirection } from "./dist/useDirection";
export default useDirection;
Loading