diff --git a/.eslintrc.js b/.eslintrc.js
index fe7e1075c..d6a7a8314 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -33,7 +33,12 @@ module.exports = {
'**/*.json'
],
plugins: ['jest', 'prettier'],
- extends: ['eslint:recommended', 'plugin:prettier/recommended', 'prettier'],
+ extends: [
+ 'eslint:recommended',
+ 'plugin:prettier/recommended',
+ 'prettier',
+ 'plugin:mdx/recommended'
+ ],
rules: {
'import/no-useless-path-segments': 'error', // Please note this rule has been patched with Yarn to allow imports from npm packages to apply. The open issue can be found here https://github.com/import-js/eslint-plugin-import/issues/1280
'no-console': 'off',
@@ -113,6 +118,11 @@ module.exports = {
'@typescript-eslint/no-redeclare': [1, { ignoreDeclarationMerge: true }]
},
plugins: ['@typescript-eslint', 'eslint-plugin-import']
+ },
+ {
+ files: '*.mdx',
+ parser: 'eslint-mdx',
+ extends: 'plugin:mdx/recommended'
}
]
};
diff --git a/.prettierignore b/.prettierignore
index cc02e7ae1..0a3e79933 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,4 +1,3 @@
-docs
reports
dist
ci
diff --git a/README.md b/README.md
index 77af86633..0054972aa 100644
--- a/README.md
+++ b/README.md
@@ -107,7 +107,7 @@ class MyComponent extends lng.Component {
_getFocused() {
return this.tag('FocusManager');
}
-};
+}
```
## Questions???
diff --git a/STORYBOOK.md b/STORYBOOK.md
deleted file mode 100644
index 9d219f65b..000000000
--- a/STORYBOOK.md
+++ /dev/null
@@ -1,59 +0,0 @@
-
-
-# LUI Storybook Code Organization
-
-`apps/lightning-ui-docs/.storybook`
-
-| Folder | File | Purpose |
-| ------------------------ | :---------------------: | :----------------------------------------------------------- |
-| addons | | |
-| | constants.js | constants for addons |
-| | register.js | registers all addons |
-| addons/components | | |
-| | index.js | |
-| | NumberRow.js | |
-| | Table.js | |
-| | TableRow.js | |
-| addons/decorators | | |
-| | withLightning.js | decorator for Lightning to work in Storybook |
-| addons/panels | | |
-| | ComponentStylesPanel.js | Component Style Panel Addon |
-| | GridOverlayPanel.js | Grid Overlay Panel Addon |
-| | ThemePanel.js | |
-| addons/toolbars | | |
-| | Announce.js | turn on Announce feature |
-| | StageColor.js | stage color toggle |
-| | ThemeDownload.js | download a theme |
-| | ThemePicker.js | select a theme |
-| controls-delete/argTypes | | |
-| | index.js | |
-| utils | | |
-| | helpers.js | helper functions for Storybook config |
-| | registerEvent.js | event listeners for Storybook config |
-| | themeUtils.js | utility functions for Lightning Theming to work in Storybook |
-| / | | |
-| | brand.png | logo for Storybook theme |
-| | main.js | controls server behavior |
-| | manager-head.html | |
-| | manger.js | sets Storybook UI options and themes |
-| | preview-head.html | |
-| | preview.js | controls rendering of stories |
-| | | |
-| | theme.js | theme for Storybook UI |
-| | webpackconfig.js | |
diff --git a/bin/templates/docs.template.js b/bin/templates/docs.template.js
index 013a5f56a..117ad95a9 100644
--- a/bin/templates/docs.template.js
+++ b/bin/templates/docs.template.js
@@ -1,45 +1,48 @@
-/**
- * Copyright 2023 Comcast Cable Communications Management, LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-const urlBase = 'https://github.com/rdkcentral/Lightning-UI-Components/tree/develop/packages/%40lightningjs/ui-components/src/components/';
-
-module.exports = (name, dir) => `
-
-import { Canvas, Story } from '@storybook/addon-docs';
-import ${name} from '.';
-
-# ${name}
+{/* prettier-ignore */}
+{
+ /**
+ * Copyright 2023 Comcast Cable Communications Management, LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+}
+
+const urlBase =
+ 'https://github.com/rdkcentral/Lightning-UI-Components/tree/develop/packages/%40lightningjs/ui-components/src/components/';
+
+module.exports = name => `{/* prettier-ignore */}
+{/*Copyright 2023 Comcast Cable Communications Management, LLC
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+SPDX-License-Identifier: Apache-2.0 */}
+
+import { Meta, Title } from '@storybook/blocks';
+import * ${name}Stories from './${name}.stories';
+
+
+
+
## Source
@@ -61,10 +64,6 @@ class Basic extends lng.Component {
};
\`\`\`
-
-
## API
### Properties
diff --git a/bin/templates/story.template.js b/bin/templates/story.template.js
index af289b285..31859450c 100644
--- a/bin/templates/story.template.js
+++ b/bin/templates/story.template.js
@@ -16,7 +16,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-module.exports = (name) => {
+module.exports = name => {
return `/**
* Copyright 2023 Comcast Cable Communications Management, LLC
*
@@ -37,17 +37,11 @@ module.exports = (name) => {
import lng from '@lightningjs/core';
import ${name} from '.';
-import mdx from './${name}.mdx';
import { CATEGORIES } from '../../docs/constants';
export default {
// TODO: replace categoryIndex with key for which category this component's story should be nested in. See CATEGORIES object in packages/apps/lightning-ui-docs/index.js
title: 'CATEGORIES[categoryIndex]/${name}',
- parameters: {
- docs: {
- page: mdx
- }
- }
};
export const Basic = () =>
diff --git a/package.json b/package.json
index 36056d25d..9eeef7ed2 100644
--- a/package.json
+++ b/package.json
@@ -43,6 +43,7 @@
"eslint-plugin-cypress": "^2.12.1",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^24.3.2",
+ "eslint-plugin-mdx": "^2.1.0",
"eslint-plugin-n": "^15.0.0",
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-promise": "^6.0.0",
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/Overview.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/Overview.mdx
new file mode 100644
index 000000000..4694edda4
--- /dev/null
+++ b/packages/@lightningjs/ui-components-test-utils/src/docs/Overview.mdx
@@ -0,0 +1,53 @@
+{/* prettier-ignore */}
+{/*
+Copyright 2023 Comcast Cable Communications Management, LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+\*/}
+
+import { Meta } from '@storybook/blocks';
+
+
+
+# @lightningjs/ui-components-test-utils
+
+The `@lightningjs/ui-components-test-utils` package provides 2 artifacts to assist with unit testing Lightning components.
+
+1. **Test Renderer**
+
+- [create](/story/docs-unit-testing-test-renderer-create--page): Generates a `testRenderer` object with built in utilities for unit testing Lightning Components.
+- [toJSON](/story/docs-unit-testing-test-renderer-tojson--page): Converts Lightning components to JSON to be used in [Jest Snapshot Tests](https://jestjs.io/docs/snapshot-testing)
+
+2. **Test Utils**
+
+- [makeCreateComponent](/story/docs-unit-testing-test-utils-makecreatecomponent--page): Returns a `createComponent` function which is used to generate an instance of a component to run unit test cases against.
+- [completeAnimation](/story/docs-unit-testing-test-utils-completeanimation--page): Returns a Promise that resolves once all animating properties have updated to their target value(s).
+- [fastForward](/story/docs-unit-testing-test-utils-fastforward--page): Force all running Lightning Transitions on one or more Lightning Elements to finish and update the transitioning property to its target value immediately.
+- [nextTick](/story/docs-unit-testing-test-utils-nexttick--page): Creates a Promise that resolves after a defined amount of time. If no amount of time is specified, the Promise will resolve immediately.
+
+```js
+// jest.config.js
+
+const config = {
+ // ...other Jest config properties
+ setupFiles: ['jest-webgl-canvas-mock'],
+ transformIgnorePatterns: [
+ '/node_modules/(?!(@lightningjs/ui-components-test-utils)/)'
+ ]
+ // ...other Jest config properties
+};
+
+export default config;
+```
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/Overview.stories.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/Overview.stories.mdx
deleted file mode 100644
index afc68babd..000000000
--- a/packages/@lightningjs/ui-components-test-utils/src/docs/Overview.stories.mdx
+++ /dev/null
@@ -1,55 +0,0 @@
-
-
-import { Meta } from '@storybook/addon-docs';
-
-
-
-# @lightningjs/ui-components-test-utils
-
-The `@lightningjs/ui-components-test-utils` package provides 2 artifacts to assist with unit testing Lightning components.
-1. **Test Renderer**
- - [create](/story/docs-unit-testing-test-renderer-create--page): Generates a `testRenderer` object with built in utilities for unit testing Lightning Components.
- - [toJSON](/story/docs-unit-testing-test-renderer-tojson--page): Converts Lightning components to JSON to be used in [Jest Snapshot Tests](https://jestjs.io/docs/snapshot-testing)
-2. **Test Utils**
- - [makeCreateComponent](/story/docs-unit-testing-test-utils-makecreatecomponent--page): Returns a `createComponent` function which is used to generate an instance of a component to run unit test cases against.
- - [completeAnimation](/story/docs-unit-testing-test-utils-completeanimation--page): Returns a Promise that resolves once all animating properties have updated to their target value(s).
- - [fastForward](/story/docs-unit-testing-test-utils-fastforward--page): Force all running Lightning Transitions on one or more Lightning Elements to finish and update the transitioning property to its target value immediately.
- - [nextTick](/story/docs-unit-testing-test-utils-nexttick--page): Creates a Promise that resolves after a defined amount of time. If no amount of time is specified, the Promise will resolve immediately.
-
-
-## Getting Started
-All artifacts within `@lightningjs/ui-components-test-utils` are currently only available using ES Module syntax. This differs from the CommonJS syntax Jest is written in.
-Due to this, the `@lightningjs/ui-components-test-utils` must be converted to CommonJS via the Jest config setting [transformIgnorePatterns](https://jestjs.io/docs/configuration#transformignorepatterns-arraystring).
-
-By default, the Jest jsdom environment does not provide mocks for canvas and WebGL. A recommended solution for this is to add [jest-webgl-canvas-mock](https://www.npmjs.com/package/jest-webgl-canvas-mock) to the [setupFiles](https://jestjs.io/docs/configuration#setupfiles-array) option in your Jest config.
-
-```js
-// jest.config.js
-
-const config = {
- // ...other Jest config properties
- setupFiles: ["jest-webgl-canvas-mock"],
- transformIgnorePatterns: [
- "/node_modules/(?!(@lightningjs/ui-components-test-utils)/)",
- ]
- // ...other Jest config properties
-}
-
-export default config
-```
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/create.stories.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/create.mdx
similarity index 94%
rename from packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/create.stories.mdx
rename to packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/create.mdx
index 95cb0afbd..33eb9c1d8 100644
--- a/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/create.stories.mdx
+++ b/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/create.mdx
@@ -1,22 +1,23 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Meta } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/toJSON.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/toJSON.mdx
new file mode 100644
index 000000000..7a390b948
--- /dev/null
+++ b/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/toJSON.mdx
@@ -0,0 +1,59 @@
+{/* prettier-ignore */}
+{/*
+Copyright 2023 Comcast Cable Communications Management, LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+\*/}
+
+import { Meta } from '@storybook/blocks';
+
+
+
+# toJSON
+
+Convert Lightning components to JSON to be used in [Jest Snapshot Tests](https://jestjs.io/docs/snapshot-testing).
+
+## Arguments
+
+`toJSON(element, { children } = {})`
+
+| argument | type | default | description |
+| -------------- | ----------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------ |
+| element | Lightning.Element | - | element to create JSON from |
+| \{ children \} | object | \{ children: 100 \} | object with `children` property to define the number of layers deep in the render tree should be converted to JSON |
+
+##### Example: Snapshot testing using `TestRenderer.toJSON` and Jest's `toMatchSnapshot` matcher
+
+```js
+import lng from '@lightningjs/core';
+import { TestRenderer } from '@lightningjs/ui-components-test-utils';
+
+class TestComp extends lng.Component {
+ static _template() {
+ return {
+ TextElement: {
+ text: { text: 'foo' }
+ }
+ };
+ }
+}
+
+it('should match the snapshot for the component', () => {
+ const testRenderer = TestRenderer.create({ Component: { type: TestComp } });
+ const testCompInstance = testRenderer.getInstance();
+ const tree = TestRenderer.toJSON(testCompInstance, { children: 1 });
+ expect(tree).toMatchSnapshot();
+});
+```
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/toJSON.stories.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/toJSON.stories.mdx
deleted file mode 100644
index a683208fc..000000000
--- a/packages/@lightningjs/ui-components-test-utils/src/docs/TestRenderer/toJSON.stories.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
-
-
-import { Meta } from '@storybook/addon-docs';
-
-
-
-# toJSON
-
-Convert Lightning components to JSON to be used in [Jest Snapshot Tests](https://jestjs.io/docs/snapshot-testing).
-
-## Arguments
-
-`toJSON(element, { children } = {})`
-
-| argument | type | default | description |
-| ------------ | ----------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------ |
-| element | Lightning.Element | - | element to create JSON from |
-| { children } | object | { children: 100 } | object with `children` property to define the number of layers deep in the render tree should be converted to JSON |
-
-
-
-##### Example: Snapshot testing using `TestRenderer.toJSON` and Jest's `toMatchSnapshot` matcher
-
-```js
-import lng from '@lightningjs/core';
-import { TestRenderer } from '@lightningjs/ui-components-test-utils';
-
-class TestComp extends lng.Component {
- static _template() {
- return {
- TextElement: {
- text: { text: 'foo' }
- }
- };
- }
-}
-
-it('should match the snapshot for the component', () => {
- const testRenderer = TestRenderer.create({ Component: { type: TestComp } });
- const testCompInstance = testRenderer.getInstance();
- const tree = TestRenderer.toJSON(testCompInstance, { children: 1 });
- expect(tree).toMatchSnapshot();
-});
-```
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/completeAnimation.stories.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/completeAnimation.mdx
similarity index 75%
rename from packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/completeAnimation.stories.mdx
rename to packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/completeAnimation.mdx
index b2474d21f..965651800 100644
--- a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/completeAnimation.stories.mdx
+++ b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/completeAnimation.mdx
@@ -1,22 +1,23 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Meta } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/fastForward.stories.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/fastForward.mdx
similarity index 70%
rename from packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/fastForward.stories.mdx
rename to packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/fastForward.mdx
index 2949f8fc4..bc8411672 100644
--- a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/fastForward.stories.mdx
+++ b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/fastForward.mdx
@@ -1,22 +1,23 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Meta } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
@@ -30,9 +31,9 @@ This function is similar to [completeAnimation](/story/docs-unit-testing-test-ut
`fastForward(elements)`
-| argument | type | default | description |
-| -------- | ---------------------------------------------- | ------- | --------------------------------------------- |
-| elements | Array \| Lightning.Element | - | element(s) with transitioning property values |
+| argument | type | default | description |
+| -------- | ----------------------------------------------- | ------- | --------------------------------------------- |
+| elements | Array\ \| Lightning.Element | - | element(s) with transitioning property values |
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/makeCreateComponent.stories.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/makeCreateComponent.mdx
similarity index 91%
rename from packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/makeCreateComponent.stories.mdx
rename to packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/makeCreateComponent.mdx
index d5287182e..f76f5a927 100644
--- a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/makeCreateComponent.stories.mdx
+++ b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/makeCreateComponent.mdx
@@ -1,22 +1,23 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Meta } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/nextTick.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/nextTick.mdx
new file mode 100644
index 000000000..8c28a2d1a
--- /dev/null
+++ b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/nextTick.mdx
@@ -0,0 +1,34 @@
+{/* prettier-ignore */}
+{/*
+Copyright 2023 Comcast Cable Communications Management, LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+\*/}
+
+import { Meta } from '@storybook/blocks';
+
+
+
+# nextTick
+
+Creates a Promise that resolves after a defined amount of time. If no amount of time is specified, the Promise will resolve immediately.
+
+## Arguments
+
+`nextTick(wait = 0)`
+
+| argument | type | default | description |
+| -------- | ------ | ------- | --------------------------------------------------------------------- |
+| wait | number | 0 | amount of time (in milliseconds) before the returned Promise resolves |
diff --git a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/nextTick.stories.mdx b/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/nextTick.stories.mdx
deleted file mode 100644
index b0696de4a..000000000
--- a/packages/@lightningjs/ui-components-test-utils/src/docs/TestUtils/nextTick.stories.mdx
+++ /dev/null
@@ -1,33 +0,0 @@
-
-
-import { Meta } from '@storybook/addon-docs';
-
-
-
-# nextTick
-
-Creates a Promise that resolves after a defined amount of time. If no amount of time is specified, the Promise will resolve immediately.
-
-## Arguments
-
-`nextTick(wait = 0)`
-
-| argument | type | default | description |
-| -------- | ------ | ------- | --------------------------------------------------------------------- |
-| wait | number | 0 | amount of time (in milliseconds) before the returned Promise resolves |
diff --git a/packages/@lightningjs/ui-components-theme-base/theme.js b/packages/@lightningjs/ui-components-theme-base/index.js
similarity index 100%
rename from packages/@lightningjs/ui-components-theme-base/theme.js
rename to packages/@lightningjs/ui-components-theme-base/index.js
diff --git a/packages/@lightningjs/ui-components-theme-base/package.json b/packages/@lightningjs/ui-components-theme-base/package.json
index 6fbb82886..b36f36a2b 100644
--- a/packages/@lightningjs/ui-components-theme-base/package.json
+++ b/packages/@lightningjs/ui-components-theme-base/package.json
@@ -8,7 +8,8 @@
},
"homepage": "https://rdkcentral.github.io/Lightning-UI-Components/",
"type": "module",
- "main": "theme.js",
+ "main": "./index.js",
+ "exports": "./index.js",
"files": [
"*.js"
],
diff --git a/packages/apps/lightning-ui-docs/.storybook/webpack.config.js b/packages/@lightningjs/ui-components/babel.config.cjs
similarity index 63%
rename from packages/apps/lightning-ui-docs/.storybook/webpack.config.js
rename to packages/@lightningjs/ui-components/babel.config.cjs
index 95ee50c2a..743323563 100644
--- a/packages/apps/lightning-ui-docs/.storybook/webpack.config.js
+++ b/packages/@lightningjs/ui-components/babel.config.cjs
@@ -16,14 +16,4 @@
* SPDX-License-Identifier: Apache-2.0
*/
-const path = require('path');
-
-module.exports = async ({ config, mode }) => {
- config.optimization.minimize = false; // Minification seams to to break FocusManager navigation
- // Shorter alias for inspector
- config.resolve.alias['lightningInspect'] = path.resolve(
- __dirname,
- '../../../../node_modules/@lightningjs/core/devtools/lightning-inspect'
- );
- return config;
-};
+module.exports = { presets: ['@babel/preset-env'] };
diff --git a/packages/@lightningjs/ui-components/package.json b/packages/@lightningjs/ui-components/package.json
index a3ecb948a..b65eaa351 100644
--- a/packages/@lightningjs/ui-components/package.json
+++ b/packages/@lightningjs/ui-components/package.json
@@ -21,7 +21,7 @@
"types": "./dist/lightning-ui-components.d.ts",
"scripts": {
"start": "yarn run generateStorybookData && yarn start-storybook --no-manager-cache -p 8000",
- "build": "rm -rf ./dist && rollup --config ../../../rollup/rollup.config.js --name lightning-ui-components",
+ "build": "rm -rf ./dist && rollup --config ../../../rollup/rollup.config.js --configPlugin @rollup/plugin-babel --name lightning-ui-components",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --coverage --colors --silent",
"test:updateSnapshot": "NODE_OPTIONS=--experimental-vm-modules jest --updateSnapshot --colors",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --no-coverage --watch --colors"
diff --git a/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.mdx b/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.mdx
index 9ba44637f..0a7f65f63 100644
--- a/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Artwork from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as ArtworkStories from './Artwork.stories.js';
-# Artwork
+
+
+
Artwork has been architected to be the easiest way to use images in your lightning application.
@@ -45,10 +48,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.stories.js b/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.stories.js
index 4e2459378..5cb948349 100644
--- a/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Artwork/Artwork.stories.js
@@ -18,16 +18,9 @@
import lng from '@lightningjs/core';
import { default as ArtworkComponent } from '.';
-import mdx from './Artwork.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Artwork`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Artwork'
};
export const Artwork = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Badge/Badge.mdx b/packages/@lightningjs/ui-components/src/components/Badge/Badge.mdx
index daa72b589..311b8412c 100644
--- a/packages/@lightningjs/ui-components/src/components/Badge/Badge.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Badge/Badge.mdx
@@ -1,25 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
import Badge from '.';
+import * as BadgeStories from './Badge.stories.js';
-# Badge
+
+
+
This component is used to display small keywords of metadata, like video or audio quality (ie HD or CC).
@@ -47,10 +51,6 @@ class Example extends lng.Component {
}
```
-
-
Or an icon:
```js
@@ -70,10 +70,6 @@ class Example extends lng.Component {
}
```
-
-
A title and an icon can also be used together:
```js
@@ -93,10 +89,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Badge/Badge.stories.js b/packages/@lightningjs/ui-components/src/components/Badge/Badge.stories.js
index 08a18709c..4585b17e0 100644
--- a/packages/@lightningjs/ui-components/src/components/Badge/Badge.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Badge/Badge.stories.js
@@ -18,18 +18,11 @@
import lng from '@lightningjs/core';
import Badge from '.';
-import mdx from './Badge.mdx';
import lightning from '../../assets/images/ic_lightning_white_32.png';
import circle from '../../assets/images/circle.svg';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Badge`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Badge'
};
export const Text = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/Button/Button.mdx b/packages/@lightningjs/ui-components/src/components/Button/Button.mdx
index 7b1116f24..6e2726b44 100644
--- a/packages/@lightningjs/ui-components/src/components/Button/Button.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Button/Button.mdx
@@ -1,23 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Button from '.';
+import { ArgTypes, Meta, Title, Description } from '@storybook/blocks';
+import * as ButtonStories from './Button.stories.js';
+
+
# Button
@@ -46,10 +49,6 @@ class Example extends lng.Component {
}
```
-
-
### Sizing
By default, `Button` widths dynamically adjust to account for `title` and `icon` widths and `padding`, with a minimum width defined by `minWidth`.
diff --git a/packages/@lightningjs/ui-components/src/components/Button/Button.stories.js b/packages/@lightningjs/ui-components/src/components/Button/Button.stories.js
index 1ee6d9fc0..60c01ced6 100644
--- a/packages/@lightningjs/ui-components/src/components/Button/Button.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Button/Button.stories.js
@@ -20,17 +20,77 @@ import lng from '@lightningjs/core';
import { default as ButtonComponent } from '.';
import Icon from '../Icon';
import Checkbox from '../Checkbox';
-import mdx from './Button.mdx';
import lightning from '../../assets/images/ic_lightning_white_32.png';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { controlDescriptions } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Button`,
+ title: 'Components/Button/Button',
+ args: {
+ title: 'Button',
+ fixed: false,
+ w: 200,
+ justify: 'center',
+ prefix: null,
+ suffix: null,
+ mode: 'focused'
+ },
+ argTypes: {
+ ...createModeControl({ summaryValue: 'focused' }),
+ title: {
+ control: 'text',
+ description: 'Title text',
+ table: {
+ defaultValue: { summary: 'undefined' }
+ }
+ },
+ fixed: {
+ control: 'boolean',
+ description: controlDescriptions.fixed,
+ table: {
+ defaultValue: { summary: false }
+ }
+ },
+ w: {
+ control: 'number',
+ description:
+ 'When the fixed property is true, this will set the width of the component',
+ table: {
+ defaultValue: { summary: 0 }
+ }
+ },
+ justify: {
+ control: 'radio',
+ options: ['left', 'center', 'right'],
+ description: 'Justification of button content',
+ table: {
+ defaultValue: { summary: 'center' }
+ }
+ },
+ prefix: {
+ control: 'radio',
+ options: [null, 'icon', 'checkbox', 'combo'],
+ description: 'Lightning components to be placed to the left of the title',
+ table: {
+ defaultValue: { summary: 'undefined' }
+ }
+ },
+ suffix: {
+ control: 'radio',
+ options: [null, 'icon', 'checkbox', 'combo'],
+ description:
+ 'Lightning components to be placed to the right of the title',
+ table: {
+ defaultValue: { summary: 'undefined' }
+ }
+ }
+ },
parameters: {
docs: {
- page: mdx
+ description: {
+ component:
+ 'Basic component that handles styling and functionality for a button.'
+ }
}
}
};
@@ -65,65 +125,6 @@ export const Button = () =>
}
};
-Button.args = {
- title: 'Button',
- fixed: false,
- w: 200,
- justify: 'center',
- prefix: null,
- suffix: null,
- mode: 'focused'
-};
-
-const sharedArgTypes = {
- ...createModeControl({ summaryValue: Button.args.mode }),
- title: {
- control: 'text',
- description: 'Title text',
- table: {
- defaultValue: { summary: 'undefined' }
- }
- },
- fixed: {
- control: 'boolean',
- description: controlDescriptions.fixed,
- table: {
- defaultValue: { summary: false }
- }
- },
- w: {
- control: 'number',
- description:
- 'When the fixed property is true, this will set the width of the component',
- table: {
- defaultValue: { summary: 0 }
- }
- },
- justify: {
- control: 'radio',
- options: ['left', 'center', 'right'],
- description: 'Justification of button content',
- table: {
- defaultValue: { summary: 'center' }
- }
- },
- prefix: {
- control: 'radio',
- options: [null, 'icon', 'checkbox', 'combo'],
- description: 'Lightning components to be placed to the left of the title',
- table: {
- defaultValue: { summary: 'undefined' }
- }
- },
- suffix: {
- control: 'radio',
- options: [null, 'icon', 'checkbox', 'combo'],
- description: 'Lightning components to be placed to the right of the title',
- table: {
- defaultValue: { summary: 'undefined' }
- }
- }
-};
const sharedArgActions = {
prefix: (prefix, component) => {
component.tag('Button').prefix = getComponentArray(prefix);
@@ -133,5 +134,6 @@ const sharedArgActions = {
}
};
-Button.argTypes = sharedArgTypes;
-Button.parameters = { argActions: sharedArgActions };
+Button.parameters = {
+ argActions: sharedArgActions
+};
diff --git a/packages/@lightningjs/ui-components/src/components/Button/ButtonSmall.stories.js b/packages/@lightningjs/ui-components/src/components/Button/ButtonSmall.stories.js
index 056b08bba..ca4eae6d4 100644
--- a/packages/@lightningjs/ui-components/src/components/Button/ButtonSmall.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Button/ButtonSmall.stories.js
@@ -20,19 +20,12 @@ import lng from '@lightningjs/core';
import { ButtonSmall as ButtonSmallComponent } from '.';
import Icon from '../Icon';
import Checkbox from '../Checkbox';
-import mdx from './Button.mdx';
import lightning from '../../assets/images/ic_lightning_white_32.png';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { controlDescriptions } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/ButtonSmall`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Button/ButtonSmall'
};
function getCommponentArray(comps) {
diff --git a/packages/@lightningjs/ui-components/src/components/Card/Card.mdx b/packages/@lightningjs/ui-components/src/components/Card/Card.mdx
index 3fe58d724..1aa6c0921 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/Card.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Card/Card.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Card from './Card';
+import { Meta, Title } from '@storybook/blocks';
+import * as CardStories from './Card.stories';
-# Card
+
+
+# Cards
Cards are very configurable. Cards is the foundational basis for all other card variations.
@@ -46,10 +49,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
@@ -60,10 +59,10 @@ class Basic extends lng.Component {
### Style Properties
-| name | type | description |
-| ------------------------ | ---------------- | ---------------------------------------------------------------------------- |
-| backgroundColor | string | color of the card |
-| paddingHorizontal | number | padding on the x-axis between the right and left of the card and its content |
-| paddingVertical | number | padding on the y-axis between the top and bottom of the card and its content |
-| radius | number \| array | corner radius of card |
-| titleTextStyle | string \| object | text style for the title text |
+| name | type | description |
+| ----------------- | ---------------- | ---------------------------------------------------------------------------- |
+| backgroundColor | string | color of the card |
+| paddingHorizontal | number | padding on the x-axis between the right and left of the card and its content |
+| paddingVertical | number | padding on the y-axis between the top and bottom of the card and its content |
+| radius | number \| array | corner radius of card |
+| titleTextStyle | string \| object | text style for the title text |
diff --git a/packages/@lightningjs/ui-components/src/components/Card/Card.stories.js b/packages/@lightningjs/ui-components/src/components/Card/Card.stories.js
index 534c2c33a..f8b622a54 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/Card.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Card/Card.stories.js
@@ -17,20 +17,11 @@
*/
import lng from '@lightningjs/core';
-import { CATEGORIES } from '../../docs/constants';
import { createModeControl } from '../../docs/utils';
import { default as CardComponent } from './Card.js';
-import mdx from './Card.mdx';
export default {
- title: `${CATEGORIES[8]}/Card`,
- tag: 'Card',
-
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Card/Card'
};
export const Card = args =>
class Card extends lng.Component {
diff --git a/packages/@lightningjs/ui-components/src/components/Card/CardRadio.mdx b/packages/@lightningjs/ui-components/src/components/Card/CardRadio.mdx
index 65d25a20d..068de708d 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/CardRadio.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Card/CardRadio.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import CardRadio from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as CardRadioStories from './CardRadio.stories';
-# CardRadio
+
+
+
This component is a variant of the `Card` component that includes multiple lines of text and radio functionality.
@@ -50,10 +53,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Card/CardRadio.stories.js b/packages/@lightningjs/ui-components/src/components/Card/CardRadio.stories.js
index 3c3fe4c8e..a681cc970 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/CardRadio.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Card/CardRadio.stories.js
@@ -18,19 +18,11 @@
import lng from '@lightningjs/core';
import { default as CardRadioComponent } from './CardRadio.js';
-import mdx from './CardRadio.mdx';
import { Radio as RadioStory } from '../Radio/Radio.stories.js';
import { createModeControl, generateSubStory } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardRadio`,
- tag: 'Card',
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Card/CardRadio'
};
const description =
diff --git a/packages/@lightningjs/ui-components/src/components/Card/CardSection.mdx b/packages/@lightningjs/ui-components/src/components/Card/CardSection.mdx
index 70eec22e5..c2bbd55fb 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/CardSection.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Card/CardSection.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import CardSection from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as CardSectionStories from './CardSection.stories';
-# CardSection
+
+
+
Component shows title and icon to the right of the title.
@@ -47,10 +50,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Card/CardSection.stories.js b/packages/@lightningjs/ui-components/src/components/Card/CardSection.stories.js
index f9a833dde..712fb5eba 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/CardSection.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Card/CardSection.stories.js
@@ -19,18 +19,10 @@
import lng from '@lightningjs/core';
import { default as CardSectionComponent } from './CardSection.js';
import sectionIcon from '../../assets/images/ic_check_circle_outline_inverse_24.png';
-import mdx from './CardSection.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardSection`,
- tag: 'Card',
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Card/CardSection'
};
export const CardSection = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Card/CardTitle.mdx b/packages/@lightningjs/ui-components/src/components/Card/CardTitle.mdx
index 3ee712c4d..f304ba6ef 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/CardTitle.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Card/CardTitle.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import CardTitle from './CardTitle.js';
+import { Meta, Title } from '@storybook/blocks';
+import * as CardTitleStories from './CardTitle.stories';
-# CardTitle
+
+
+
Component shows title and description within a card.
@@ -49,10 +52,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Card/CardTitle.stories.js b/packages/@lightningjs/ui-components/src/components/Card/CardTitle.stories.js
index c5f8f5f0d..ee4cebe46 100644
--- a/packages/@lightningjs/ui-components/src/components/Card/CardTitle.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Card/CardTitle.stories.js
@@ -18,19 +18,10 @@
import lng from '@lightningjs/core';
import { default as CardTitleComponent } from './CardTitle.js';
-import mdx from './CardTitle.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardTitle`,
- tag: 'Card',
-
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Card/CardTitle'
};
export const CardTitle = () =>
class CardTitle extends lng.Component {
diff --git a/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.mdx b/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.mdx
index 90e37dd79..91b7fa5a1 100644
--- a/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.mdx
+++ b/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.mdx
@@ -1,23 +1,25 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import CardContent from '.';
+import { Meta, Title } from '@storybook/blocks';
+
+
# CardContent
@@ -45,10 +47,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
@@ -69,7 +67,7 @@ class Basic extends lng.Component {
| backgroundColor | string | color of the card |
| expandedWidth | number | the desired width of the card when in the fully expanded (not collapsed) mode |
| expandedHeight | number | the desired height of the card when in the fully expanded (not collapsed) mode |
-| imageSize | {w, h} | the desired width and height the image in the card |
+| imageSize | `{w, h}` | the desired width and height the image in the card |
| metadata | string \| object | text style for the metadata |
| paddingHorizontal | number | padding on the x-axis between the right and left of the card and its content |
| paddingVertical | number | padding on the y-axis between the top and bottom of the card and its content |
diff --git a/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.stories.js b/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.stories.js
index 4ffbc32af..f0ce436ab 100644
--- a/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/CardContent/CardContent.stories.js
@@ -19,19 +19,12 @@
import lng from '@lightningjs/core';
import tileImage from '../../assets/images/tile-image.png';
import CardContentComponent from '.';
-import mdx from './CardContent.mdx';
import { MetadataCardContent as MetadataStory } from '../MetadataCardContent/MetadataCardContent.stories';
import { createModeControl, generateSubStory } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { controlDescriptions } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardContent`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/CardContent/CardContent'
};
export const CardContent = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontal.stories.js b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontal.stories.js
index ff936073b..0a8e26b98 100644
--- a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontal.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontal.stories.js
@@ -18,23 +18,16 @@
import lng from '@lightningjs/core';
import tileImage from '../../assets/images/tile-image.png';
-import mdx from './CardContent.mdx';
import { MetadataCardContent as MetadataStory } from '../MetadataCardContent/MetadataCardContent.stories';
import { createModeControl, generateSubStory } from '../../docs/utils';
import { default as CardContentHorizontalComponent } from './CardContentHorizontal';
import { default as Icon } from '../Icon';
import xfinityLogo from '../../assets/images/Xfinity-Provider-Logo-2x1.png';
import { CardContent } from './CardContent.stories';
-import { CATEGORIES } from '../../docs/constants';
import { controlDescriptions } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardContentHorizontal`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/CardContent/CardContentHorizontal'
};
export const CardContentHorizontal = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontalLarge.stories.js b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontalLarge.stories.js
index 1bebafc2b..210af3e60 100644
--- a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontalLarge.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentHorizontalLarge.stories.js
@@ -18,23 +18,16 @@
import lng from '@lightningjs/core';
import tileImage from '../../assets/images/tile-image.png';
-import mdx from './CardContent.mdx';
import { MetadataCardContent as MetadataStory } from '../MetadataCardContent/MetadataCardContent.stories';
import { createModeControl, generateSubStory } from '../../docs/utils';
import { default as CardContentHorizontalLargeComponent } from './CardContentHorizontalLarge';
import { default as Icon } from '../Icon';
import xfinityLogo from '../../assets/images/Xfinity-Provider-Logo-2x1.png';
import { CardContent } from './CardContent.stories';
-import { CATEGORIES } from '../../docs/constants';
import { controlDescriptions } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardContentHorizontalLarge`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/CardContent/CardContentHorizontalLarge'
};
export const CardContentHorizontalLarge = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVertical.stories.js b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVertical.stories.js
index 4e8c16a97..bba954331 100644
--- a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVertical.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVertical.stories.js
@@ -18,22 +18,15 @@
import lng from '@lightningjs/core';
import tileImage from '../../assets/images/tile-image.png';
-import mdx from './CardContent.mdx';
import { MetadataCardContent as MetadataStory } from '../MetadataCardContent/MetadataCardContent.stories';
import { createModeControl, generateSubStory } from '../../docs/utils';
import CardContentVerticalComponent from './CardContentVertical';
import { default as Icon } from '../Icon';
import xfinityLogo from '../../assets/images/Xfinity-Provider-Logo-2x1.png';
import { CardContent } from './CardContent.stories';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardContentVertical`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/CardContent/CardContentVertical'
};
export const CardContentVertical = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVerticalSmall.stories.js b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVerticalSmall.stories.js
index c5579d956..912048039 100644
--- a/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVerticalSmall.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/CardContent/CardContentVerticalSmall.stories.js
@@ -18,20 +18,13 @@
import lng from '@lightningjs/core';
import tileImage from '../../assets/images/tile-image.png';
-import mdx from './CardContent.mdx';
import { MetadataCardContent as MetadataStory } from '../MetadataCardContent/MetadataCardContent.stories';
import { createModeControl, generateSubStory } from '../../docs/utils';
import CardContentVerticalSmallComponent from './CardContentVerticalSmall';
import { CardContent } from './CardContent.stories';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CardContentVerticalSmall`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/CardContent/CardContentVerticalSmall'
};
export const CardContentVerticalSmall = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.mdx b/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.mdx
index aafae9b9a..e4a26e487 100644
--- a/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.mdx
@@ -1,27 +1,31 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Checkbox from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as CheckboxStories from './Checkbox.stories';
+
+
# Checkbox
-A checkbox component that can be toggled between a checked an unchecked state.
+A checkbox component that can be toggled between a checked an unchecked
+state.
## Source
@@ -45,10 +49,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.stories.js b/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.stories.js
index e880b475b..a3aef7cd0 100644
--- a/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Checkbox/Checkbox.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import { default as CheckboxComponent } from '.';
-import mdx from './Checkbox.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Checkbox`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Checkboxes/Checkbox'
};
export const Checkbox = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Checkbox/CheckboxSmall.stories.js b/packages/@lightningjs/ui-components/src/components/Checkbox/CheckboxSmall.stories.js
index 935fd2e47..e85bd5745 100644
--- a/packages/@lightningjs/ui-components/src/components/Checkbox/CheckboxSmall.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Checkbox/CheckboxSmall.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import { default as CheckboxSmallComponent } from './CheckboxSmall.js';
-import mdx from './Checkbox.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/CheckboxSmall`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Checkboxes/CheckboxSmall'
};
export const CheckboxSmall = () => {
diff --git a/packages/@lightningjs/ui-components/src/components/Column/Column.mdx b/packages/@lightningjs/ui-components/src/components/Column/Column.mdx
index 0f198cfa6..adb66b0cd 100644
--- a/packages/@lightningjs/ui-components/src/components/Column/Column.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Column/Column.mdx
@@ -1,26 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
import { DocsLink } from '../../docs/utils';
-import Column from '.';
+import * as ColumnStories from './Column.stories';
-# Column
+
+
+
Focus management and smooth scrolling for a list of vertically-oriented items.
@@ -99,10 +102,6 @@ class ExpandableHeightItems extends lng.Component {
}
```
-
-
### Scrolling
Scroll behavior is determined based on what is passed to the `alwaysScroll` and `neverScroll` properties.
diff --git a/packages/@lightningjs/ui-components/src/components/Column/Column.stories.js b/packages/@lightningjs/ui-components/src/components/Column/Column.stories.js
index a7f3e80c7..7c8a39d09 100644
--- a/packages/@lightningjs/ui-components/src/components/Column/Column.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Column/Column.stories.js
@@ -23,16 +23,11 @@ import Row from '../Row';
import Tile from '../Tile';
import Button from '../Button';
import { default as ColumnComponent } from '.';
-import mdx from './Column.mdx';
-import { CATEGORIES } from '../../docs/constants';
import { SignalButton } from '../../docs/story-components';
export default {
- title: `${CATEGORIES[8]}/Column`,
+ title: 'Components/Column',
parameters: {
- docs: {
- page: mdx
- },
remountAll: true
}
};
@@ -693,7 +688,6 @@ export const AddingItems = args =>
};
AddingItems.args = {
scrollIndex: 0,
- lazyUpCount: undefined,
lazyUpCountBuffer: 2
};
AddingItems.argTypes = {
diff --git a/packages/@lightningjs/ui-components/src/components/Control/Control.mdx b/packages/@lightningjs/ui-components/src/components/Control/Control.mdx
index 21330ab04..5653f557b 100644
--- a/packages/@lightningjs/ui-components/src/components/Control/Control.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Control/Control.mdx
@@ -1,24 +1,27 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
import Control from '.';
+
+
# Control
`Control` is a specific type of `Button` which is used to display video controls (play/pause) that expand with text on focus.
@@ -47,10 +50,6 @@ class Example extends lng.Component {
}
```
-
-
All `Control` components support two types of prefixes (Lightning components placed to the left of the title text): an icon or a logo (image/png/jpg).
### Icon
diff --git a/packages/@lightningjs/ui-components/src/components/Control/Control.stories.js b/packages/@lightningjs/ui-components/src/components/Control/Control.stories.js
index 6a9683d47..165f0dd48 100644
--- a/packages/@lightningjs/ui-components/src/components/Control/Control.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Control/Control.stories.js
@@ -18,20 +18,13 @@
import lng from '@lightningjs/core';
import { default as ControlComponent } from '.';
-import mdx from './Control.mdx';
import lightning from '../../assets/images/ic_lightning_white_32.png';
import xfinity from '../../assets/images/Xfinity-Provider-Logo-Square.png';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { controlDescriptions } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Control`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Control/Control'
};
export const Control = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Control/ControlSmall.stories.js b/packages/@lightningjs/ui-components/src/components/Control/ControlSmall.stories.js
index cbbc8c615..b83c60fc4 100644
--- a/packages/@lightningjs/ui-components/src/components/Control/ControlSmall.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Control/ControlSmall.stories.js
@@ -18,20 +18,13 @@
import lng from '@lightningjs/core';
import { ControlSmall as ControlSmallComponent } from '.';
-import mdx from './Control.mdx';
import lightning from '../../assets/images/ic_lightning_white_32.png';
import xfinity from '../../assets/images/Xfinity-Provider-Logo-Square.png';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { controlDescriptions } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/ControlSmall`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Control/ControlSmall'
};
export const ControlSmall = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.mdx b/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.mdx
index 7b7fbda34..7ca3f0ac5 100644
--- a/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.mdx
+++ b/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import ControlRow from '.';
+import { ArgTypes, Meta, Title } from '@storybook/blocks';
+import * as ControlRowStories from './ControlRow.stories';
-# ControlRow
+
+
+
The `ControlRow` component renders a
[TitleRow](/docs/components-titlerow--basic) component with optional left controls content items, and right controls
@@ -60,10 +63,6 @@ class Example extends lng.Component {
}
```
-
-
### lazyLoading
The `ControlRow` component can be configured for lazy loading content items by utilizing the `lazyLoadBuffer` property and `'loadMoreItems'` signal. When a positive number is assigned to `ControlRow.lazyLoadBuffer`, the `ControlRow` will emit a signal, `'loadMoreItems'`. The `lazyLoadBuffer` property defines how many items before the last `contentItems` is the index at which `'loadMoreItems'` will be emitted. The `ControlRow` does not include further side effects to this signal being emitted, but allows parent components to listen for that signal and add further functionality to the component (ex. fetching more content items and appending them to the ControlRow via the `ControlRow.addContentItems` method). If the number of content items in the `ControlRow` is updated (adding or removing content items), the new length of content items will be used to calculate at which index the next `'loadMoreItems'` signal is emitted.
@@ -96,6 +95,8 @@ class LazyLoad extends lng.Component {
## API
+
+
### Properties
**`ControlRow` is a subclass of the [`TitleRow`](/docs/components-titlerow--basic)**,
diff --git a/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.stories.js b/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.stories.js
index b7c831d21..ec4b5c8a3 100644
--- a/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/ControlRow/ControlRow.stories.js
@@ -23,17 +23,10 @@ import lightningIcon from '../../assets/images/ic_lightning_white_32.png';
import playIcon from '../../assets/images/ic_play_white_32.png';
import { default as TitleRowStory } from '../TitleRow/TitleRow.stories';
import ControlRowComponent from '.';
-import mdx from './ControlRow.mdx';
-import { CATEGORIES } from '../../docs/constants';
import { createModeControl } from '../../docs/utils';
export default {
- title: `${CATEGORIES[8]}/ControlRow`,
- parameters: {
- docs: {
- page: mdx
- }
- },
+ title: 'Components/ControlRow',
args: {
...TitleRowStory.args,
lazyScroll: true,
diff --git a/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.mdx b/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.mdx
index 4a81e76d8..d623fd0ea 100644
--- a/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.mdx
+++ b/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.mdx
@@ -1,25 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
import { DocsLink } from '../../docs/utils';
+import * as FocusManagerStories from './FocusManager.stories';
-# FocusManager
+
+
+
In Lightning, setting focus on elements and managing it manually is required. `FocusManager` is a component that simplifies focus for elements within a list.
@@ -53,10 +57,6 @@ class RowExample extends lng.Component {
}
```
-
-
Set the `direction` property to `row` for left/right or `column` for up/down key handling.
```js
@@ -107,16 +107,16 @@ class FancyFocus extends FocusManager {
### Properties
-| name | type | default | description |
-| ------------- | ------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
-| direction | 'column'\|'row' | undefined | The navigation direction for focus ('left/right' or 'up/down') |
-| selectedIndex | number | undefined | The index of the currently selected item. |
-| items | lng.Component[] | undefined | Child element or elements of the FocusManager. |
-| wrapSelected | boolean | false | When wrapSelected is set to true, the focus will loop back to the beginning of the list after reaching the last item, and vice versa. This enables continuous navigation through the list without dead ends. If wrapSelected is set to false (the default value), the focus will stop at the first or last item, depending on the navigation direction |
+| name | type | default | description |
+| ------------- | ------------------------------------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| direction | 'column'\|'row' | undefined | The navigation direction for focus \('left/right' or 'up/down'\) |
+| selectedIndex | number | undefined | The index of the currently selected item. |
+| items | lng.Component[] | undefined | Child element or elements of the FocusManager. |
+| wrapSelected | boolean | false | When wrapSelected is set to true, the focus will loop back to the beginning of the list after reaching the last item, and vice versa. This enables continuous navigation through the list without dead ends. If wrapSelected is set to false \(the default value\), the focus will stop at the first or last item, depending on the navigation direction |
### Methods
-#### appendItems(items: lng.Component[]): void
+#### appendItems\(items: lng.Component[]\): void
This method appends the provided rows to the end of the FocusManager's children
diff --git a/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.stories.js b/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.stories.js
index ce237be0c..e40cb648f 100644
--- a/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/FocusManager/FocusManager.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import FocusManager from '.';
-import mdx from './FocusManager.mdx';
-import { CATEGORIES } from '../../docs/constants';
import Button from '../Button';
export default {
- title: `${CATEGORIES[8]}/FocusManager`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/FocusManager'
};
export const Basic = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.mdx b/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.mdx
index 9839f8e48..63a70c7be 100644
--- a/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Gradient from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as GradientStories from './Gradient.stories';
-# Gradient
+
+
+
A semitransparent Gradient to be used on top of any component, like Artwork.
@@ -47,10 +50,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Style Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.stories.js b/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.stories.js
index 60718d445..6e740a54f 100644
--- a/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Gradient/Gradient.stories.js
@@ -18,16 +18,9 @@
import lng from '@lightningjs/core';
import { default as GradientComponent } from '.';
-import mdx from './Gradient.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Gradient`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Gradient'
};
export const Gradient = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.mdx b/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.mdx
index dfd018847..6848fccb8 100644
--- a/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.mdx
+++ b/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import GridOverlay from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as GridOverlayStories from './GridOverlay.stories';
-# GridOverlay
+
+
+
This component shows the grid layout, including the column spans and guides for margins and gutters.
@@ -45,10 +48,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.stories.js b/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.stories.js
index 36ae73e16..213d748f0 100644
--- a/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/GridOverlay/GridOverlay.stories.js
@@ -19,16 +19,9 @@
import lng from '@lightningjs/core';
import { context } from '../../globals';
import { default as GridOverlayComponent } from '.';
-import mdx from './GridOverlay.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/GridOverlay`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/GridOverlay'
};
export const GridOverlay = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/Icon/Icon.mdx b/packages/@lightningjs/ui-components/src/components/Icon/Icon.mdx
index bebadc0bc..005f20468 100644
--- a/packages/@lightningjs/ui-components/src/components/Icon/Icon.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Icon/Icon.mdx
@@ -1,24 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
+import * as IconStories from './Icon.stories';
-# Icon
+
+
+
Renders icon paths and inline svgs
@@ -49,18 +53,6 @@ class Example extends lng.Component {
A valid `icon` value can be any path to any [common image type](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types) or an inline SVG.
-With an image path:
-
-
-
-With an inline svg:
-
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Icon/Icon.stories.js b/packages/@lightningjs/ui-components/src/components/Icon/Icon.stories.js
index 9ad435b91..6b330f12d 100644
--- a/packages/@lightningjs/ui-components/src/components/Icon/Icon.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Icon/Icon.stories.js
@@ -19,15 +19,10 @@
import lng from '@lightningjs/core';
import Icon from '.';
import lightning from '../../assets/images/ic_lightning_white_32.png';
-import mdx from './Icon.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Icon`,
+ title: 'Components/Icon',
parameters: {
- docs: {
- page: mdx
- },
argActions: {
w: (w, component) => {
component.tag('Icon').w = w;
diff --git a/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.mdx b/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.mdx
index dd05c0a1a..bbca6faff 100644
--- a/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.mdx
+++ b/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import InlineContent from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as InlineContentStories from './InlineContent.stories';
-# InlineContent
+
+
+
**Depreciated: [TextBox](/docs/components-textbox--basic) is the recommended component for rendering text and supports all properties of InlineContent**
@@ -57,10 +60,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.stories.js b/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.stories.js
index 18cff649d..c3e7e2d8b 100644
--- a/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/InlineContent/InlineContent.stories.js
@@ -18,13 +18,11 @@
import lng from '@lightningjs/core';
import { default as InlineContentComponent } from '.';
-import mdx from './InlineContent.mdx';
import lightningbolt from '../../assets/images/ic_lightning_white_32.png';
import { getHexColor } from '../../utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/InlineContent`,
+ title: 'Components/InlineContent',
args: {
contentWrap: false,
justify: 'center',
@@ -83,11 +81,6 @@ export default {
defaultValue: { summary: '..' }
}
}
- },
- parameters: {
- docs: {
- page: mdx
- }
}
};
diff --git a/packages/@lightningjs/ui-components/src/components/Input/Input.mdx b/packages/@lightningjs/ui-components/src/components/Input/Input.mdx
index b379699e6..bc20b3557 100644
--- a/packages/@lightningjs/ui-components/src/components/Input/Input.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Input/Input.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Input from './Input.js';
+import { Meta, Title } from '@storybook/blocks';
+import * as InputStories from './Input.stories';
-# Input
+
+
+
Text input field component
@@ -55,16 +58,12 @@ class Example extends lng.Component {
}
```
-
-
-### Setting/Inserting values
+### Setting \& Inserting values
The `Input` component provides different ways to manage the input text and cursor position. When the `listening` property is enabled, the cursor blinks as a placeholder, whether the component is in focused or unfocused mode.
The text displayed in the `Input` can be directly set via the `value` property. The following example will display the input with the text "Hello".
-Setting the `value` on the `Input` directly like this will remove any existing text in the input and set the cursor `position` in the Input to `0` (before the 'H' in 'Hello').
+Setting the `value` on the `Input` directly like this will remove any existing text in the input and set the cursor `position` in the Input to `0` \( before the 'H' in 'Hello'\).
The cursor position can be manually updated by setting the `position` property. Setting `value` and `position` like this will update the `Input` regardless of whether or not `listening` is enabled.
```js
@@ -133,7 +132,7 @@ this.tag('Input')._handleLeft();
this.tag('Input').position; //=> 0
```
-The cursor position stays within the bounds of the current `value`, so it is always >= 0 and <= `value.length`
+The cursor position stays within the bounds of the current `value`, so it is always \>\= 0 and \<\= `value.length`
### Password
@@ -141,13 +140,13 @@ Inputs commonly mask the value of passwords and other secure values. To enable i
```js
this.tag('Input').password = true;
-The character used to mask input can be changed as well.
+//The character used to mask input can be changed as well.
this.tag('Input').mask = '•';
-To reveal the input, simply set password back to false.
+//To reveal the input, simply set password back to false.
this.tag('Input').password = false;
-When password is true, the Announcer will say "Input hidden" when the Input is focused.
+//When password is true, the Announcer will say "Input hidden" when the Input is focused.
```
## API
diff --git a/packages/@lightningjs/ui-components/src/components/Input/Input.stories.js b/packages/@lightningjs/ui-components/src/components/Input/Input.stories.js
index 062835baf..07b439b9a 100644
--- a/packages/@lightningjs/ui-components/src/components/Input/Input.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Input/Input.stories.js
@@ -21,18 +21,11 @@ import { default as InputComponent } from '.';
import Icon from '../Icon';
import { createModeControl } from '../../docs/utils';
import lightning from '../../assets/images/ic_lightning_white_32.png';
-import mdx from './Input.mdx';
import eye from '../../assets/images/ic_eye_white_48.png';
import eyeHide from '../../assets/images/ic_eyeHide_white_48.png';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Input`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Input'
};
function getComponentArray(comps) {
diff --git a/packages/@lightningjs/ui-components/src/components/Key/Key.mdx b/packages/@lightningjs/ui-components/src/components/Key/Key.mdx
index 74f770869..80a8751da 100644
--- a/packages/@lightningjs/ui-components/src/components/Key/Key.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Key/Key.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Key from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as KeyStories from './Key.stories';
-# Key
+
+
+
An extension of the Button component that represents an individual key on a keyboard
@@ -45,10 +48,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
@@ -73,14 +72,14 @@ class Basic extends lng.Component {
### Events
-## $onSoftKey({ key: string, toggle: boolean })
+#### `$onSoftKey({ key: string, toggle: boolean })`
Fired when the enter key is pressed while focused on a `Key` component. An event will be emitted
via Lightning's `fireAncestors` with an object of the `Key`'s `title` and `toggle` property values.
If a funciton is passed to the `Key`'s `onEnter` property, that function will be invoked and the
`$onSoftKey` event will not be emitted.
-## $toggleKeyboard({ key: string, toggle: boolean })
+#### `$toggleKeyboard({ key: string, toggle: boolean })`
Fired when the enter key is pressed while focused on a `Key` component with its `toggle` property
set to `true`. If a funciton is passed to the `Key`'s `onEnter` property, that function will be invoked and the
diff --git a/packages/@lightningjs/ui-components/src/components/Key/Key.stories.js b/packages/@lightningjs/ui-components/src/components/Key/Key.stories.js
index cc8a65bf1..c5962faab 100644
--- a/packages/@lightningjs/ui-components/src/components/Key/Key.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Key/Key.stories.js
@@ -19,17 +19,10 @@
import lng from '@lightningjs/core';
import { default as KeyComponent } from '.';
import lightning from '../../assets/images/ic_lightning_white_32.png';
-import mdx from './Key.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Key`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Key'
};
export const Basic = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.mdx b/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.mdx
index 10d12d7bc..063424c46 100644
--- a/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.mdx
@@ -1,22 +1,25 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
+
+
# Keyboard
@@ -45,10 +48,6 @@ class Example extends lng.Component {
}
```
-
-
To create your own formats, you can pass an object of arrays to represent each format.
The array can be flat or two dimensional. If the keyboard is passed other params like `columnCount` or `rowCount`, both will auto layout the keyboard.
The variables in the array can be a single string or an object that defines the same properties as a `Button`.
@@ -117,24 +116,24 @@ All of the following examples will yield the same result.
### Methods
-#### getSelectedKey(): { row:number, column:number }
+#### `getSelectedKey(): { row:number, column:number }`
Returns an object containing the currently selected row and column of the currently focused keyboard.
-#### selectKeyOn(keyboard, { row:number, column:number })
+#### `selectKeyOn(keyboard, { row:number, column:number })`
Takes in a keyboard format and a specified row and column and changes focus on the keyboard to that key.
### Events
-#### $onSoftKey: { key:string, toggle:boolean }
+#### `$onSoftKey: { key:string, toggle:boolean }`
Fired when a key is Entered
-#### $keyboardFocused: bool
+#### `$keyboardFocused: bool`
Fired when keyboard is focused or unfocused. Can be listened to by an input to know if the input should be listening for softkey events
-### $toggleKeyboard: { key:string }
+#### `$toggleKeyboard: { key:string }`
Fired when defaultFormat is toggled between Dialpad and Dialpad extended
diff --git a/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.stories.js b/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.stories.js
index 186238c40..984a2752a 100644
--- a/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Keyboard/Keyboard.stories.js
@@ -18,19 +18,12 @@
import lng from '@lightningjs/core';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { context } from '../../globals';
-import mdx from './Keyboard.mdx';
import utils from '../../utils';
import { default as KeyboardComponent } from './Keyboard';
export default {
- title: `${CATEGORIES[8]}/Keyboard`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Keyboard/Keyboard'
};
export const Keyboard = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardEmail.stories.js b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardEmail.stories.js
index 71906fc8b..cb3441c61 100644
--- a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardEmail.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardEmail.stories.js
@@ -17,20 +17,13 @@
*/
import lng from '@lightningjs/core';
-import mdx from './Keyboard.mdx';
-import { CATEGORIES } from '../../docs/constants';
import { context } from '../../globals';
import utils from '../../utils';
import { default as KeyboardEmailComponent } from './KeyboardEmail';
import { Keyboard } from './Keyboard.stories';
export default {
- title: `${CATEGORIES[8]}/KeyboardEmail`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Keyboard/KeyboardEmail'
};
export const KeyboardEmail = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardFullscreen.stories.js b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardFullscreen.stories.js
index e5b5f9761..bdb4e4611 100644
--- a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardFullscreen.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardFullscreen.stories.js
@@ -17,20 +17,13 @@
*/
import lng from '@lightningjs/core';
-import mdx from './Keyboard.mdx';
-import { CATEGORIES } from '../../docs/constants';
import { context } from '../../globals';
import utils from '../../utils';
import { default as KeyboardFullscreenComponent } from './KeyboardFullscreen';
import { Keyboard } from './Keyboard.stories';
export default {
- title: `${CATEGORIES[8]}/KeyboardFullscreen`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Keyboard/KeyboardFullscreen'
};
export const KeyboardFullscreen = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardInput.stories.js b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardInput.stories.js
index 7c34c9bd1..7ba4a855e 100644
--- a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardInput.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardInput.stories.js
@@ -18,8 +18,6 @@
import lng from '@lightningjs/core';
import { createModeControl, generateSubStory } from '../../docs/utils';
-import mdx from './Keyboard.mdx';
-import { CATEGORIES } from '../../docs/constants';
import { context } from '../../globals';
import utils from '../../utils';
import Icon from '../Icon';
@@ -33,12 +31,7 @@ import eye from '../../assets/images/ic_eye_white_48.png';
import eyeHide from '../../assets/images/ic_eyeHide_white_48.png';
export default {
- title: `${CATEGORIES[8]}/KeyboardInput`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Keyboard/KeyboardInput'
};
function getCommponentArray(comps) {
diff --git a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardNumbers.stories.js b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardNumbers.stories.js
index 56ace8d4f..c8f2a239e 100644
--- a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardNumbers.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardNumbers.stories.js
@@ -17,20 +17,13 @@
*/
import lng from '@lightningjs/core';
-import mdx from './Keyboard.mdx';
-import { CATEGORIES } from '../../docs/constants';
import { context } from '../../globals';
import utils from '../../utils';
import { default as KeyboardNumbersComponent } from './KeyboardNumbers';
import { Keyboard } from './Keyboard.stories';
export default {
- title: `${CATEGORIES[8]}/KeyboardNumbers`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Keyboard/KeyboardNumbers'
};
export const KeyboardNumbers = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardQwerty.stories.js b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardQwerty.stories.js
index 95bb86454..24b8fb549 100644
--- a/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardQwerty.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Keyboard/KeyboardQwerty.stories.js
@@ -17,20 +17,13 @@
*/
import lng from '@lightningjs/core';
-import mdx from './Keyboard.mdx';
-import { CATEGORIES } from '../../docs/constants';
import { context } from '../../globals';
import utils from '../../utils';
import { default as KeyboardQwertyComponent } from './KeyboardQwerty';
import { Keyboard } from './Keyboard.stories';
export default {
- title: `${CATEGORIES[8]}/KeyboardQwerty`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Keyboard/KeyboardQwerty'
};
export const KeyboardQwerty = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Knob/Knob.mdx b/packages/@lightningjs/ui-components/src/components/Knob/Knob.mdx
index 71763c020..94e8eac0b 100644
--- a/packages/@lightningjs/ui-components/src/components/Knob/Knob.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Knob/Knob.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Knob from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as KnobStories from './Knob.stories';
-# Knob
+
+
+
Knob is a circle component that can be added on to other components
@@ -43,10 +46,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Style Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Knob/Knob.stories.js b/packages/@lightningjs/ui-components/src/components/Knob/Knob.stories.js
index 2288b39d9..1f461dffb 100644
--- a/packages/@lightningjs/ui-components/src/components/Knob/Knob.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Knob/Knob.stories.js
@@ -17,19 +17,11 @@
*/
import lng from '@lightningjs/core';
-
import { default as KnobComponent } from '.';
-import mdx from './Knob.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Knob`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Knob'
};
export const Knob = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Label/Label.mdx b/packages/@lightningjs/ui-components/src/components/Label/Label.mdx
index 1f5d9b886..fd0b0e084 100644
--- a/packages/@lightningjs/ui-components/src/components/Label/Label.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Label/Label.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Label from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as LabelStories from './Label.stories';
-# Label
+
+
+
This component is used to convey the status of a program in Tile ex. "Live" or "On Now".
@@ -50,10 +53,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Label/Label.stories.js b/packages/@lightningjs/ui-components/src/components/Label/Label.stories.js
index 673c16f5a..6464e058b 100644
--- a/packages/@lightningjs/ui-components/src/components/Label/Label.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Label/Label.stories.js
@@ -17,18 +17,10 @@
*/
import lng from '@lightningjs/core';
-
import { default as LabelComponent } from '.';
-import mdx from './Label.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Label`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Label'
};
export const Label = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.mdx b/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.mdx
index 9afcc5e0f..0eec2c490 100644
--- a/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.mdx
+++ b/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.mdx
@@ -1,23 +1,33 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import ListItem from '.';
+import {
+ Meta,
+ Title,
+ ArgTypes,
+ Description,
+ Subtitle
+} from '@storybook/blocks';
+import * as ListItemStories from './ListItem.stories';
+import * as ButtonStories from '../Button/Button.stories';
+
+
# ListItem
@@ -29,7 +39,8 @@ https://github.com/rdkcentral/Lightning-UI-Components/tree/develop/packages/%40l
## Usage
-'ListItem' extends 'Button', and therefore utilizes much of the same functionality and properties. It can display an 'Icon' or 'Checkbox' before the text, a title and/or description in the center of the content, and an 'Icon' or 'Checkbox' in the Suffix after the text.
+`ListItem` extends `Button`, and therefore utilizes much of the same functionality and
+properties. It can display an `Icon` or `Checkbox` before the text, a title and/or description in the center of the content, and an `Icon` or `Checkbox` in the Suffix after the text.
```js
import { ListItem } from '@lightningjs/ui-components';
@@ -48,10 +59,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
@@ -75,3 +82,9 @@ class Basic extends lng.Component {
| paddingX | number | padding on left and right sides of text |
| contentSpacing | number | padding between title and prefix |
| titleTextStyle | object | text style to apply to the title |
+
+### Button Properties
+
+List item extends button
+
+
diff --git a/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.stories.js b/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.stories.js
index cc8209fcc..6f28869fc 100644
--- a/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/ListItem/ListItem.stories.js
@@ -18,21 +18,14 @@
import lng from '@lightningjs/core';
import ListItemComponent from './ListItem';
-import mdx from './ListItem.mdx';
import { createModeControl } from '../../docs/utils';
import xfinity from '../../assets/images/Xfinity-Provider-Logo-Square.png';
import { default as Checkbox } from '../Checkbox';
import { default as Radio } from '../Radio';
import { default as Toggle } from '../Toggle';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/ListItem`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/ListItem/ListItem'
};
export const ListItem = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.mdx b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.mdx
index ab76822d5..958c04066 100644
--- a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.mdx
+++ b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import ListItemPicker from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as ListItemPickerStories from './ListItemPicker.stories';
-# ListItemPicker
+
+
+
ListItem component with the ability to let a user pick from a list of options.
@@ -47,10 +50,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.stories.js b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.stories.js
index 27f739513..f21f76c62 100644
--- a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemPicker.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import { default as ListItemPickerComponent } from './ListItemPicker';
-import mdx from './ListItemPicker.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/ListItemPicker`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/ListItem/ListItemPicker'
};
export const ListItemPicker = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.mdx b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.mdx
index 446d747f6..a766f20cb 100644
--- a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.mdx
+++ b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.mdx
@@ -1,25 +1,9 @@
-
-
-import { Canvas, Story } from '@storybook/addon-docs';
-import ListItemSlider from '.';
-
-# ListItemSlider
+
A ListItem component with slider functionality
@@ -47,10 +31,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.stories.js b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.stories.js
index 4b7641462..67878b3f1 100644
--- a/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/ListItem/ListItemSlider.stories.js
@@ -18,18 +18,11 @@
import lng from '@lightningjs/core';
import { default as ListItemSliderComponent } from './ListItemSlider';
-import mdx from './ListItemSlider.mdx';
import { createModeControl, generateSubStory } from '../../docs/utils';
import { Basic as SliderStory } from '../Slider/Slider.stories';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/ListItemSlider`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/ListItem/ListItemSlider'
};
export const ListItemSlider = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.mdx b/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.mdx
index d6c48d9f3..11655b3e7 100644
--- a/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.mdx
@@ -1,24 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Preview, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
+import * as MarqueeStories from './Marquee.stories';
-# Marquee
+
+
+
Scrolls long text
@@ -53,10 +57,6 @@ class Example extends lng.Component {
}
```
-
-
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.stories.js b/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.stories.js
index 8691f7f24..87e96f18e 100644
--- a/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Marquee/Marquee.stories.js
@@ -17,20 +17,12 @@
*/
import lng from '@lightningjs/core';
-
import MarqueeComponent from '.';
import InlineContent from '../InlineContent';
-import mdx from './Marquee.mdx';
import { context } from '../../globals';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Marquee`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Marquee'
};
export const Marquee = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.mdx b/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.mdx
index bcdebe888..f41322d85 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.mdx
+++ b/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import MetadataBase from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as MetadataBaseStories from './MetadataBase.stories.js';
-# MetadataBase
+
+
+
A component to quickly and easily lay out several pieces of content.
@@ -67,10 +70,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.stories.js b/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.stories.js
index 708b345b8..eed6f2d5c 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/MetadataBase/MetadataBase.stories.js
@@ -22,16 +22,9 @@ import circle from '../../assets/images/circle.svg';
import { getHexColor } from '../../utils';
import { createModeControl } from '../../docs/utils';
import { default as MetadataBaseComponent } from '.';
-import mdx from './MetadataBase.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/MetadataBase`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/MetadataBase'
};
export const MetadataBase = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.mdx b/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.mdx
index f98fef5d8..49d54b573 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.mdx
+++ b/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import MetadataCard from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as MetadataCardStories from './MetadataCard.stories.js';
-# MetadataCard
+
+
+
A component to lay out content on Cards.
@@ -52,10 +55,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.stories.js b/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.stories.js
index 53140c5a8..95cd0015a 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/MetadataCard/MetadataCard.stories.js
@@ -22,16 +22,9 @@ import circle from '../../assets/images/circle.svg';
import utils from '../../utils';
import { createModeControl } from '../../docs/utils';
import { default as MetadataCardComponent } from '.';
-import mdx from './MetadataCard.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/MetadataCard`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/MetadataCard'
};
export const MetadataCard = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.mdx b/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.mdx
index 4e30c746e..201d970a1 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.mdx
+++ b/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.mdx
@@ -1,27 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import MetadataCardContent from '.';
-import Provider from '../Provider';
-import xfinityProviderLogo from '../../assets/images/Xfinity-Provider-Logo-Square.png';
+import { Meta, Title } from '@storybook/blocks';
+import * as MetadataCardContentStories from './MetadataCardContent.stories.js';
-# MetadataCardContent
+
+
+
A component to format metadata on CardContent. Contains a [Provider](?path=/docs/components-provider--basic) to format [Icon(s)](?path=/docs/components-icon--png).
@@ -54,10 +55,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.stories.js b/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.stories.js
index 7cc3c32f4..b02f584d1 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/MetadataCardContent/MetadataCardContent.stories.js
@@ -18,18 +18,11 @@
import lng from '@lightningjs/core';
import { default as MetadataCardContentComponent } from '.';
-import mdx from './MetadataCardContent.mdx';
import xfinityProviderLogoSquare from '../../assets/images/Xfinity-Provider-Logo-Square.png';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/MetadataCardContent`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/MetadataCardContent'
};
export const MetadataCardContent = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.mdx b/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.mdx
index 15c08954e..c829d62dc 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.mdx
+++ b/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import MetadataTile from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as MetadataTileStories from './MetadataTile.stories.js';
-# MetadataTile
+
+
+
Metadata to be displayed along with `Tiles`.
@@ -66,10 +69,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.stories.js b/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.stories.js
index 63126e81a..a78e9bb23 100644
--- a/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/MetadataTile/MetadataTile.stories.js
@@ -22,16 +22,9 @@ import circle from '../../assets/images/circle.svg';
import { getHexColor } from '../../utils';
import { createModeControl } from '../../docs/utils';
import { default as MetadataTileComponent } from '.';
-import mdx from './MetadataTile.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/MetadataTile`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/MetadataTile'
};
export const MetadataTile = args =>
diff --git a/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.mdx b/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.mdx
index 95ddbd4c0..41f3db02a 100644
--- a/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.mdx
+++ b/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.mdx
@@ -1,25 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import NavigationManager from '.';
+import { Meta, Title } from '@storybook/blocks';
+import { DocsLink } from '../../docs/utils';
+import * as NavigationManagerStories from './NavigationManager.stories.js';
-# NavigationManager
+
+
+
NavigationManager is a subclass of [FocusManager](?path=/docs/components-focusmanager--rows),
and parent class of [Row](?path=/docs/components-row--row) and [Column](?path=/docs/components-column--column).
@@ -39,10 +43,6 @@ import { NavigationManager } from '@lightningjs/ui-components';
class CustomRow extends NavigationManager {}
```
-
-
### Scrolling
The `scrollIndex` property determines the index at which scrolling should begin. By default, that index is 0.
diff --git a/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.stories.js b/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.stories.js
index 6fa648f1a..eff000949 100644
--- a/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/NavigationManager/NavigationManager.stories.js
@@ -18,8 +18,6 @@
import lng from '@lightningjs/core';
import NavigationManager from '.';
-import mdx from './NavigationManager.mdx';
-import { CATEGORIES } from '../../docs/constants';
import Button from '../Button';
class ButtonFixedWidth extends Button {
@@ -48,12 +46,7 @@ function createRow(props = {}) {
}
export default {
- title: `${CATEGORIES[8]}/NavigationManager`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/NavigationManager'
};
export const Row = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.mdx b/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.mdx
index ee09b28b1..c34535718 100644
--- a/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.mdx
+++ b/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.mdx
@@ -1,26 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-// uncomment the line below and edit the path to point to your component
-// import * as stories from './ProgressBar.stories';
+import { Meta, Title } from '@storybook/blocks';
+import * as ProgressBarStories from './ProgressBar.stories';
-# ProgressBar
+
+
+
Component that shows current progress in a range
@@ -48,10 +50,6 @@ class Example extends lng.Component {
}
```
-
-
The default progress bar width is 410.
## API
diff --git a/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.stories.js b/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.stories.js
index 454baec21..2b292f053 100644
--- a/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/ProgressBar/ProgressBar.stories.js
@@ -18,16 +18,11 @@
import lng from '@lightningjs/core';
import { default as ProgressBarComponent } from '.';
-import mdx from './ProgressBar.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/ProgressBar`,
+ title: 'Components/ProgressBar',
parameters: {
tag: 'ProgressBar',
- docs: {
- page: mdx
- },
actions: {
handles: ['mouseover', 'click .btn']
}
diff --git a/packages/@lightningjs/ui-components/src/components/Provider/Provider.mdx b/packages/@lightningjs/ui-components/src/components/Provider/Provider.mdx
index 821ba8bcb..15929c6e1 100644
--- a/packages/@lightningjs/ui-components/src/components/Provider/Provider.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Provider/Provider.mdx
@@ -1,26 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Provider from '.';
+import { Meta, Title } from '@storybook/blocks';
import xfinityProviderLogo from '../../assets/images/Xfinity-Provider-Logo-Square.png';
+import * as ProviderStories from './Provider.stories.js';
-# Provider
+
+
+
The `Provider` serves to condense a list of providers to show only the number you specify, and add a counter to represent any that remain.
@@ -61,10 +64,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Provider/Provider.stories.js b/packages/@lightningjs/ui-components/src/components/Provider/Provider.stories.js
index 262bfe953..ccb0762d4 100644
--- a/packages/@lightningjs/ui-components/src/components/Provider/Provider.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Provider/Provider.stories.js
@@ -19,18 +19,11 @@
import lng from '@lightningjs/core';
import ProviderComponent from '.';
import { default as Icon } from '../Icon';
-import mdx from './Provider.mdx';
import xfinityLogo from '../../assets/images/XfinityLogo16x9.png';
import xfinity from '../../assets/images/Xfinity-Provider-Logo-Square.png';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Provider`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Provider'
};
const sharedArgs = {
diff --git a/packages/@lightningjs/ui-components/src/components/Radio/Radio.mdx b/packages/@lightningjs/ui-components/src/components/Radio/Radio.mdx
index d1af01414..865472764 100644
--- a/packages/@lightningjs/ui-components/src/components/Radio/Radio.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Radio/Radio.mdx
@@ -1,23 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Radio from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as RadioStories from './Radio.stories';
+
+
# Radio
@@ -45,10 +48,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
@@ -61,7 +60,7 @@ class Example extends lng.Component {
| name | type | description |
| ---------------------- | ------ | -------------------------------------- |
-| alpha | number | alpha value of the Radio |
+| alpha | number | alpha value of the Radio |
| backgroundColor | string | background color of the Radio |
| backgroundColorChecked | string | color of Radio background when checked |
| knobColor | string | color of the Radio knob |
diff --git a/packages/@lightningjs/ui-components/src/components/Radio/Radio.stories.js b/packages/@lightningjs/ui-components/src/components/Radio/Radio.stories.js
index 591d094de..083555c6e 100644
--- a/packages/@lightningjs/ui-components/src/components/Radio/Radio.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Radio/Radio.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import { default as RadioComponent } from '.';
-import mdx from './Radio.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Radio`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Radio/Radio'
};
export const Radio = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Radio/RadioSmall.stories.js b/packages/@lightningjs/ui-components/src/components/Radio/RadioSmall.stories.js
index 045ed17cb..9b41914d1 100644
--- a/packages/@lightningjs/ui-components/src/components/Radio/RadioSmall.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Radio/RadioSmall.stories.js
@@ -19,10 +19,9 @@
import lng from '@lightningjs/core';
import Radio from './RadioSmall.js';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/RadioSmall`
+ title: 'Components/Radio/RadioSmall'
};
export const RadioSmall = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Row/Row.mdx b/packages/@lightningjs/ui-components/src/components/Row/Row.mdx
index b0b5246af..70317c07c 100644
--- a/packages/@lightningjs/ui-components/src/components/Row/Row.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Row/Row.mdx
@@ -1,26 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
import { DocsLink } from '../../docs/utils';
-import Row from '.';
+import * as RowStories from './Row.stories';
-# Row
+
+
+
Focus management and smooth scrolling for a list of horizontally-oriented items.
@@ -49,10 +52,6 @@ class Basic extends lng.Component {
}
```
-
-
### Scrolling
By default, `Row` will scroll horizontally to see any items that are not visible within the width of the Row((or just outside of the `Row` width)
diff --git a/packages/@lightningjs/ui-components/src/components/Row/Row.stories.js b/packages/@lightningjs/ui-components/src/components/Row/Row.stories.js
index 0a3a9224d..74cecbdf8 100644
--- a/packages/@lightningjs/ui-components/src/components/Row/Row.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Row/Row.stories.js
@@ -20,19 +20,14 @@ import lng from '@lightningjs/core';
import { getWidthByUpCount } from '../../utils';
import { default as RowComponent } from '.';
import Column from '../Column';
-import mdx from './Row.mdx';
import { context } from '../../globals';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { SignalButton } from '../../docs/story-components';
import Button from '../Button';
export default {
- title: `${CATEGORIES[8]}/Row`,
+ title: 'Components/Row',
parameters: {
- docs: {
- page: mdx
- },
remountAll: true
}
};
@@ -445,7 +440,6 @@ export const AddingItems = args =>
};
AddingItems.args = {
...sharedArgs,
- lazyUpCount: undefined,
lazyUpCountBuffer: 2
};
AddingItems.argTypes = {
diff --git a/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.mdx b/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.mdx
index a9328f0d5..068d24925 100644
--- a/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.mdx
+++ b/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.mdx
@@ -1,25 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import ScrollWrapper from '.';
+import { Meta, Title } from '@storybook/blocks';
+import { DocsLink } from '../../docs/utils';
+import * as ScrollWrapperStories from './ScrollWrapper.stories';
-# ScrollWrapper
+
+
+
A scrollable container for text content.
@@ -48,10 +52,6 @@ class Example extends lng.Component {
}
```
-
-
Alternatively, an array of components and `style` keys may be provided as `content`.
Styles provided here will override those set by the theme for it's section of text:
@@ -83,10 +83,6 @@ class Example extends lng.Component {
}
```
-
-
The `h` and `w` properties will determine the viewable box for `ScrollWrapper`.
When focused, `ScrollWrapper` will display a scroll bar to the right of the content
and up/down scrolling will be handled.
diff --git a/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.stories.js b/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.stories.js
index 1d1c7a391..287675123 100644
--- a/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/ScrollWrapper/ScrollWrapper.stories.js
@@ -19,9 +19,7 @@
import lng from '@lightningjs/core';
import { default as ScrollWrapperComponent } from '.';
import Tile from '../Tile';
-import mdx from './ScrollWrapper.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import TextBox from '../TextBox/TextBox.js';
const terms = `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Id aliquet risus feugiat in ante metus dictum. Pretium fusce id velit ut tortor pretium viverra suspendisse. Pharetra convallis posuere morbi leo urna. Nunc sed velit dignissim sodales. Feugiat scelerisque varius morbi enim nunc faucibus a pellentesque sit. Facilisis gravida neque convallis a cras semper auctor. Pellentesque pulvinar pellentesque habitant morbi tristique. Non tellus orci ac auctor augue mauris. Semper feugiat nibh sed pulvinar proin gravida hendrerit lectus. Amet risus nullam eget felis eget nunc. Auctor urna nunc id cursus metus aliquam eleifend mi in. Integer malesuada nunc vel risus commodo viverra maecenas accumsan lacus. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper. Ac felis donec et odio pellentesque. Semper auctor neque vitae tempus quam pellentesque nec nam aliquam. Sit amet risus nullam eget felis eget.
@@ -29,12 +27,7 @@ const terms = `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do e
Mi proin sed libero enim sed faucibus. Arcu vitae elementum curabitur vitae nunc sed velit. Volutpat blandit aliquam etiam erat velit. In nulla posuere sollicitudin aliquam ultrices sagittis orci a scelerisque. Tristique risus nec feugiat in. Urna nec tincidunt praesent semper feugiat nibh sed pulvinar proin. Dolor magna eget est lorem ipsum dolor sit amet consectetur. Eget est lorem ipsum dolor sit amet consectetur. At tellus at urna condimentum mattis pellentesque id. Maecenas accumsan lacus vel facilisis. Metus dictum at tempor commodo ullamcorper a lacus. Pellentesque pulvinar pellentesque habitant morbi tristique senectus. Tempor nec feugiat nisl pretium fusce id velit ut.`;
export default {
- title: `${CATEGORIES[8]}/ScrollWrapper`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/ScrollWrapper'
};
const sharedArgs = {
diff --git a/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.mdx b/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.mdx
index 20a9768e0..6c712ea1c 100644
--- a/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Shadow from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as ShadowStories from './Shadow.stories';
-# Shadow
+
+
+
A shadow component generally used to apply dropshadows to other components.
@@ -49,10 +52,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.stories.js b/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.stories.js
index 2cbc33d04..2ba0314d2 100644
--- a/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Shadow/Shadow.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import { default as ShadowComponent } from '.';
-import mdx from './Shadow.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Shadow`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Shadow'
};
export const Shadow = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Slider/Slider.mdx b/packages/@lightningjs/ui-components/src/components/Slider/Slider.mdx
index 5770074f6..5f7b21223 100644
--- a/packages/@lightningjs/ui-components/src/components/Slider/Slider.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Slider/Slider.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
+import * as SliderStories from './Slider.stories';
+
+
# Slider
@@ -44,10 +48,6 @@ class Example extends lng.Component {
}
```
-
-
The `Slider` can be initialized with a `min`, `max` and current `value`. The `min` and `max` properties determine the bounds of the `Slider`. The `value` prop should be greater than or equal to `min` and less than or equal to `max`.
```js
diff --git a/packages/@lightningjs/ui-components/src/components/Slider/Slider.stories.js b/packages/@lightningjs/ui-components/src/components/Slider/Slider.stories.js
index 347d33004..20af18fb7 100644
--- a/packages/@lightningjs/ui-components/src/components/Slider/Slider.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Slider/Slider.stories.js
@@ -19,18 +19,11 @@
import lng from '@lightningjs/core';
import { createModeControl } from '../../docs/utils';
import TextBox from '../TextBox';
-import mdx from './Slider.mdx';
import Slider from '.';
-import { CATEGORIES } from '../../docs/constants';
import { useArgs } from '@storybook/client-api';
export default {
- title: `${CATEGORIES[8]}/Slider`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Slider/Slider'
};
export const Basic = () => {
diff --git a/packages/@lightningjs/ui-components/src/components/Slider/SliderLarge.stories.js b/packages/@lightningjs/ui-components/src/components/Slider/SliderLarge.stories.js
index f49ab6a8d..d3e919c98 100644
--- a/packages/@lightningjs/ui-components/src/components/Slider/SliderLarge.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Slider/SliderLarge.stories.js
@@ -18,19 +18,12 @@
import lng from '@lightningjs/core';
import Slider from './SliderLarge.js';
-import mdx from './Slider.mdx';
import { createModeControl } from '../../docs/utils';
import TextBox from '../TextBox';
-import { CATEGORIES } from '../../docs/constants';
import { useArgs } from '@storybook/client-api';
export default {
- title: `${CATEGORIES[8]}/SliderLarge`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Slider/SliderLarge'
};
export const Basic = () => {
diff --git a/packages/@lightningjs/ui-components/src/components/Surface/Surface.mdx b/packages/@lightningjs/ui-components/src/components/Surface/Surface.mdx
index 248aaab1f..b960cadc9 100644
--- a/packages/@lightningjs/ui-components/src/components/Surface/Surface.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Surface/Surface.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Surface from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as SurfaceStories from './Surface.stories';
-# Surface
+
+
+
Surface allows for the background of components such as listItems, cards, and tiles to change dependent on the state of the component.
@@ -43,10 +46,6 @@ class Basic extends lng.Component {
}
```
-
-
## API
### Style Properties
diff --git a/packages/@lightningjs/ui-components/src/components/Surface/Surface.stories.js b/packages/@lightningjs/ui-components/src/components/Surface/Surface.stories.js
index d6ef8ec88..ab560f0c9 100644
--- a/packages/@lightningjs/ui-components/src/components/Surface/Surface.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Surface/Surface.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import { default as SurfaceComponent } from '.';
-import mdx from './Surface.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Surface`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Surface'
};
export const Surface = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/TabBar/Tab.mdx b/packages/@lightningjs/ui-components/src/components/TabBar/Tab.mdx
index 7840b0e86..3a3c8e6d1 100644
--- a/packages/@lightningjs/ui-components/src/components/TabBar/Tab.mdx
+++ b/packages/@lightningjs/ui-components/src/components/TabBar/Tab.mdx
@@ -1,25 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import { Tab } from '.';
+import { Meta, Title } from '@storybook/blocks';
+import { DocsLink } from '../../docs/utils';
+import * as TabStories from './Tab.stories';
-# Tab
+
+
+
Tab component to be rendered in a [TabBar](/docs/components-tabbar--basic).
@@ -49,10 +53,6 @@ class Example extends lng.Component {
}
```
-
-
### Properties
| name | type | required | default | description |
diff --git a/packages/@lightningjs/ui-components/src/components/TabBar/Tab.stories.js b/packages/@lightningjs/ui-components/src/components/TabBar/Tab.stories.js
index d5957be80..486c05143 100644
--- a/packages/@lightningjs/ui-components/src/components/TabBar/Tab.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/TabBar/Tab.stories.js
@@ -20,16 +20,9 @@ import lng from '@lightningjs/core';
import { createModeControl } from '../../docs/utils';
import lngIcon from '../../assets/images/ic_lightning_white_32.png';
import { default as TabComponent } from './Tab';
-import mdx from './Tab.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Tab`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Tab'
};
export const Tab = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/TabBar/Tab.test.js b/packages/@lightningjs/ui-components/src/components/TabBar/Tab.test.js
index afa28604b..8364426f6 100644
--- a/packages/@lightningjs/ui-components/src/components/TabBar/Tab.test.js
+++ b/packages/@lightningjs/ui-components/src/components/TabBar/Tab.test.js
@@ -52,6 +52,7 @@ describe('Tab', () => {
const title = 'Tab 1';
tab.title = title;
testRenderer.forceAllUpdates();
+ expect(tab.title).toBe(title);
expect(tab.announce).toBe(title);
});
diff --git a/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.mdx b/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.mdx
index 9898f3f8c..f4fbb85bc 100644
--- a/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.mdx
+++ b/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.mdx
@@ -1,25 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import { Tab } from '.';
+import { Meta, Title } from '@storybook/blocks';
+import { DocsLink } from '../../docs/utils';
+import * as TabBarStories from './TabBar.stories';
-# TabBar
+
+
+
Tab navigation between groups of content.
@@ -91,10 +95,6 @@ class Example extends lng.Component {
}
```
-
-
### Properties
| name | type | required | default | description |
diff --git a/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.stories.js b/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.stories.js
index d875db4ba..84adaf5b3 100644
--- a/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/TabBar/TabBar.stories.js
@@ -30,11 +30,9 @@ import Column from '../Column';
import { context } from '../../globals';
import Tab from './Tab.js';
import TabBarComponent from '.';
-import mdx from './TabBar.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/TabBar`,
+ title: 'Components/TabBar',
args: {
collapse: false,
alphaSelectedTab: false,
@@ -61,11 +59,6 @@ export default {
'Enables wrapping behavior, so selectNext selects the first item if the current item is the last on the list and vice versa',
table: { defaultValue: { summary: false } }
}
- },
- parameters: {
- docs: {
- page: mdx
- }
}
};
diff --git a/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.mdx b/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.mdx
index 81eac9d6a..f3761abe1 100644
--- a/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.mdx
+++ b/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.mdx
@@ -1,24 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
+import * as TextBoxStories from './TextBox.stories';
-# TextBox
+
+
+
General purpose TextBox component
@@ -45,10 +49,6 @@ TextBox: {
}
```
-
-
> **Note on width:**
>
> To assign a width to the `TextBox` component, either a `w` value or `wordWrapWidth` (nested within `textStyle` and the `style` prop) value may be provided.
diff --git a/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.stories.js b/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.stories.js
index eaa00f75a..9706a6b6a 100644
--- a/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/TextBox/TextBox.stories.js
@@ -18,19 +18,12 @@
import lng from '@lightningjs/core';
import TextBox from '.';
-import mdx from './TextBox.mdx';
import lightningbolt from '../../assets/images/ic_lightning_white_32.png';
import { getHexColor } from '../../utils';
import inlineContentStory from '../InlineContent/InlineContent.stories';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/TextBox`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/TextBox'
};
const { args: inlineContentArgs, argTypes: inlineContentArgTypes } =
diff --git a/packages/@lightningjs/ui-components/src/components/Tile/Tile.mdx b/packages/@lightningjs/ui-components/src/components/Tile/Tile.mdx
index 744d70411..77351878e 100644
--- a/packages/@lightningjs/ui-components/src/components/Tile/Tile.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Tile/Tile.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Tile from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as TileStories from './Tile.stories';
-# Tile
+
+
+
A flexible solution for displaying artwork and meta information. Used to render entity posters for browsing.
@@ -45,10 +48,6 @@ class Basic extends lng.Component {
}
```
-
-
### Metadata
Tile uses MetadataTile for text formatting by default. The 'metadata' property takes an object with the same properties of MetadataTile and passes them to the MetadataTile.
diff --git a/packages/@lightningjs/ui-components/src/components/Tile/Tile.stories.js b/packages/@lightningjs/ui-components/src/components/Tile/Tile.stories.js
index c6786f3e7..31a26030d 100644
--- a/packages/@lightningjs/ui-components/src/components/Tile/Tile.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Tile/Tile.stories.js
@@ -17,10 +17,8 @@
*/
import lng from '@lightningjs/core';
-import mdx from './Tile.mdx';
import { default as TileComponent } from '.';
import { createModeControl, generateSubStory } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
import { Artwork as ArtworkStory } from '../Artwork/Artwork.stories.js';
import { Checkbox as CheckboxStory } from '../Checkbox/Checkbox.stories.js';
import { MetadataTile as MetadataTileStory } from '../MetadataTile/MetadataTile.stories';
@@ -31,12 +29,7 @@ import { Text as BadgeStory } from '../Badge/Badge.stories.js';
import xfinityLogo from '../../assets/images/Xfinity-Provider-Logo-2x1.png';
export default {
- title: `${CATEGORIES[8]}/Tile`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Tile'
};
export const Tile = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.mdx b/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.mdx
index 6dd5aea62..16dc234ef 100644
--- a/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.mdx
+++ b/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.mdx
@@ -1,25 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import TitleRow from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as TitleRowStories from './TitleRow.stories';
-# TitleRow
+
+
+
The `TitleRow` component renders a [Row](/docs/components-row--basic) component with a title displayed as a [TextBox](/docs/components-textbox--base) above the Row items.
@@ -51,10 +54,6 @@ class Example extends lng.Component {
}
```
-
-
## API
### Properties
diff --git a/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.stories.js b/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.stories.js
index ba593e5dc..945883ace 100644
--- a/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/TitleRow/TitleRow.stories.js
@@ -19,9 +19,7 @@
import lng from '@lightningjs/core';
import { Row as RowBasic } from '../Row/Row.stories.js';
import Tile from '../Tile';
-import mdx from './TitleRow.mdx';
import { default as TitleRowComponent } from '.';
-import { CATEGORIES } from '../../docs/constants';
// add remount to all Row argTypes individually since Row uses remountAll
// TitleRow title prop can be updated without requiring a remount
@@ -34,12 +32,8 @@ const rowArgTypes = Object.keys(RowBasic.argTypes).reduce((acc, key) => {
}, {});
export default {
- title: `${CATEGORIES[8]}/TitleRow`,
- parameters: {
- docs: {
- page: mdx
- }
- },
+ title: 'Components/TitleRow',
+
args: {
title: 'Row Title',
...RowBasic.args
diff --git a/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.mdx b/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.mdx
index a8de56f3d..0cd2e108a 100644
--- a/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.mdx
@@ -1,23 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
-import Toggle from '.';
+import { Meta, Title } from '@storybook/blocks';
+import * as ToggleStories from './Toggle.stories';
+
+
# Toggle
@@ -45,10 +48,6 @@ class Example extends lng.Component {
}
```
-
-
The `checked` state can be programmatically changed with `toggle()`.
```js
diff --git a/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.stories.js b/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.stories.js
index 4c25169c9..24358ca37 100644
--- a/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Toggle/Toggle.stories.js
@@ -18,17 +18,10 @@
import lng from '@lightningjs/core';
import { default as ToggleComponent } from '.';
-import mdx from './Toggle.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Toggle`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Toggle/Toggle'
};
export const Toggle = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Toggle/ToggleSmall.stories.js b/packages/@lightningjs/ui-components/src/components/Toggle/ToggleSmall.stories.js
index 7018fcc1c..53752449c 100644
--- a/packages/@lightningjs/ui-components/src/components/Toggle/ToggleSmall.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Toggle/ToggleSmall.stories.js
@@ -17,19 +17,11 @@
*/
import lng from '@lightningjs/core';
-
import { ToggleSmall as ToggleSmallComponent } from '.';
-import mdx from './Toggle.mdx';
import { createModeControl } from '../../docs/utils';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/ToggleSmall`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Components/Toggle/ToggleSmall'
};
export const ToggleSmall = () =>
diff --git a/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.mdx b/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.mdx
index 8e6d6f8bf..30d8f29b5 100644
--- a/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.mdx
+++ b/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.mdx
@@ -1,24 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Title } from '@storybook/blocks';
+import * as TooltipStories from './Tooltip.stories';
+import { DocsLink } from '../../docs/utils';
-# Tooltip
+
+
+
Component to provide hint information to other components like buttons and action items.
@@ -55,10 +60,6 @@ class Example extends lng.Component {
}
```
-
-
### Sizing
The size of the tooltip is based on the length of it's 'title'. If the 'title' exceeds 400px the text wraps, and the background resizes to accomodate.
diff --git a/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.stories.js b/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.stories.js
index 9cd963830..36e801100 100644
--- a/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.stories.js
+++ b/packages/@lightningjs/ui-components/src/components/Tooltip/Tooltip.stories.js
@@ -19,12 +19,10 @@
import lng from '@lightningjs/core';
import Button from '../Button';
import { createModeControl } from '../../docs/utils';
-import mdx from './Tooltip.mdx';
import { default as TooltipComponent } from '.';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[8]}/Tooltip`,
+ title: 'Components/Tooltip',
args: {
title: 'Tooltip',
delayVisible: 0,
@@ -50,11 +48,6 @@ export default {
'Start with unfocused mode and set the time value in milliseconds, now change the mode to focused to see the required changes',
table: { defaultValue: { summary: 'undefined' } }
}
- },
- parameters: {
- docs: {
- page: mdx
- }
}
};
diff --git a/packages/@lightningjs/ui-components/src/docs/Base.stories.mdx b/packages/@lightningjs/ui-components/src/docs/Base.mdx
similarity index 75%
rename from packages/@lightningjs/ui-components/src/docs/Base.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/Base.mdx
index 5108eb0e3..b29e42eec 100644
--- a/packages/@lightningjs/ui-components/src/docs/Base.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/Base.mdx
@@ -1,24 +1,25 @@
-import { Meta, Description } from '@storybook/addon-docs';
+{/* prettier-ignore */}
+{/*
+Copyright 2023 Comcast Cable Communications Management, LLC
-
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
-
+
# Base Component
@@ -37,6 +38,7 @@ import { Base } from '@lightningjs/ui-components';
class MynewComponent extends Base {}
```
+
### Mixins
The Base component incorporates the following mixins:
@@ -49,7 +51,7 @@ The Base component incorporates the following mixins:
`withLayout`: This mixin provides layout-related functionality, such as centering the component within its parent.
-`withThemeStyles`: When this mixin is used, the component can be styled with theme-specific styles.
+`withThemeStyles`: When this mixin is used, the component can be styled with theme-specific styles.
`withExtensions`: This mixin allows for extending the component with additional functionality. It provides the ability to customize and add new features to the component easily.
@@ -64,12 +66,12 @@ class MyComponent extends withMixins(Base) {}
### Properties
| name | type | required | default | description |
-| -------------- | ------- | -------- | ------- | ------------------------------------------------------------------- |
+| -------------- | ------- | -------- | ------- | -------------------------------------------------------------------- |
| centerInParent | boolean | false | false | if set to true it places the child component in center of the parent |
### Methods
-#### static get __componentName(): string
+#### static get \_\_componentName(): string
Any component which extends the Base component and uses the `withThemeStyles` mixin requires this static accessor, which returns the name of the component. This name is used by the theme file in order to map component overrides and extensions.
@@ -86,6 +88,6 @@ Returns a boolean for whether or not the entirety of the component is rendered w
This method returns the number which is set as focusScale in the theme (context.theme.layout.focusScale). This value can referenced when updating the scale property on the component when it is focused.
-#### getUnfocusScale(): number<1>
+#### getUnfocusScale(): number
-This method returns a value that can be used to apply a scale property on focus to a component from a themed value. This value can referenced when updating the scale property on the component when it is unfocused.
\ No newline at end of file
+This method returns a value that can be used to apply a scale property on focus to a component from a themed value. This value can referenced when updating the scale property on the component when it is unfocused.
diff --git a/packages/@lightningjs/ui-components/src/docs/Introduction.stories.mdx b/packages/@lightningjs/ui-components/src/docs/Introduction.mdx
similarity index 67%
rename from packages/@lightningjs/ui-components/src/docs/Introduction.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/Introduction.mdx
index dd47efa82..5daa126c4 100644
--- a/packages/@lightningjs/ui-components/src/docs/Introduction.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/Introduction.mdx
@@ -1,22 +1,25 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-
+import { Meta } from '@storybook/blocks';
+
+
# Introduction
diff --git a/packages/@lightningjs/ui-components/src/docs/LightningResources.mdx b/packages/@lightningjs/ui-components/src/docs/LightningResources.mdx
new file mode 100644
index 000000000..d1ac9b182
--- /dev/null
+++ b/packages/@lightningjs/ui-components/src/docs/LightningResources.mdx
@@ -0,0 +1,39 @@
+{/* prettier-ignore */}
+{/*
+Copyright 2023 Comcast Cable Communications Management, LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+\*/}
+
+import { Meta } from '@storybook/blocks';
+
+
+
+# Additional Resources
+
+This page provides additional resources that can help users learn more about Lightning-UI.
+
+## Lightning Documentation
+
+- https://lightningjs.io/docs/#/what-is-lightning/index
+
+- https://rdkcentral.github.io/Lightning/
+
+- https://rdkcentral.github.io/Lightning-SDK/
+
+## Lightning UI Components
+
+- #### Open Source Repo
+ - https://github.com/rdkcentral/Lightning-UI-Components
diff --git a/packages/@lightningjs/ui-components/src/docs/LightningResources.stories.mdx b/packages/@lightningjs/ui-components/src/docs/LightningResources.stories.mdx
deleted file mode 100644
index 833c18809..000000000
--- a/packages/@lightningjs/ui-components/src/docs/LightningResources.stories.mdx
+++ /dev/null
@@ -1,50 +0,0 @@
-
-
-import { Story, Preview, Meta, Description } from '@storybook/addon-docs';
-
-
-
-
-## Additional Resources
-This page provides additional resources that can help users learn more about Lightning-UI.
-
-### Lightning Documentation
-
-* https://lightningjs.io/docs/#/what-is-lightning/index
-
-* https://rdkcentral.github.io/Lightning/
-
-* https://rdkcentral.github.io/Lightning-SDK/
-
-### Comcast Internal Community Guide
-* https://github.comcast.com/Lightning/lightning-community-guide
-
-### Lightning UI Components
-* ##### Inner Source Repo
- * https://github.com/rdkcentral/Lightning-UI-Components
-* ##### Open Source Repo
- * https://github.com/rdkcentral/Lightning-UI-Components
-
-### Lightning Tutorials
-* ##### Video of Chelsea and Emily's Knowledgefest Talk
- * [Building a Front-End Lightning App Video](https://web.microsoftstream.com/video/91743666-86e6-4743-b9c4-dd4b7a686a75)
-* ##### GitHub Repo for Chelsea and Emily's Knowledgefest Talk
- * [Building a Front-End Lightning App Repo](https://github.comcast.com/XD-Engineering/knowledgefest-lightning-workshop)
-* ##### Comcast Entertainment Organization's Lightning Strategy Videos
- * https://web.microsoftstream.com/channel/886afb0d-3401-44ee-a322-abd4676f3bc4
diff --git a/packages/@lightningjs/ui-components/src/docs/Storybook.mdx b/packages/@lightningjs/ui-components/src/docs/Storybook.mdx
new file mode 100644
index 000000000..ee781c549
--- /dev/null
+++ b/packages/@lightningjs/ui-components/src/docs/Storybook.mdx
@@ -0,0 +1,112 @@
+{/* prettier-ignore */}
+{/*
+Copyright 2023 Comcast Cable Communications Management, LLC
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+SPDX-License-Identifier: Apache-2.0
+\*/}
+
+import { Meta } from '@storybook/blocks';
+
+
+
+# LUI Storybook Code Organization
+
+`apps/lightning-ui-docs/.storybook`
+
+| Folder | File | Purpose |
+| ----------------- | :---------------------: | :---------------------------------------------------------------- |
+| addons | | |
+| | constants.js | constants for addons |
+| addons/components | | |
+| | index.js | |
+| | NumberRow.js | |
+| | Table.js | |
+| | TableRow.js | |
+| addons/decorators | | |
+| | withLightning.js | decorator for Lightning to work in Storybook |
+| addons/panels | | |
+| | ComponentStylesPanel.js | Lightning Custom Component Style Panel |
+| | GridOverlayPanel.js | Lighting Custom Grid Overlay Panel |
+| | ThemePanel.js | Lightning Custom Theme Panel |
+| addons/toolbars | | |
+| | Announce.js | turn on Announce feature |
+| | StageColor.js | stage color toggle |
+| | ThemeDownload.js | download a theme |
+| | ThemePicker.js | select a theme |
+| utils | | |
+| | helpers.js | helper functions for Storybook config |
+| | registerEvent.js | event listeners for Storybook config |
+| | themeUtils.js | utility functions for Lightning Theming to work in Storybook |
+| / | | |
+| | brand.png | Lightning logo for Storybook theme |
+| | main.js | controls server behavior |
+| | manager-head.html | |
+| | manger.js | sets Storybook UI options and themes, and registers custom addons |
+| | preview-head.html | |
+| | preview.js | controls rendering of stories |
+| | theme.js | theme for Storybook UI |
+
+### useArgs
+
+There may be cases throughout our Stories where we want one control to affect the value of another control, or a user interaction with the component to update the value of a control.
+
+This can be achieved through Storybook's `useArgs` hook and `updateArgs` method. For more information, check out the documentation [here](https://storybook.js.org/docs/vue/addons/addons-api#useargs).
+
+`useArgs` is a hook that is a part of the Storybook API that allows **args** to be read or updated.
+
+Specifically, `useArgs` has a method called `updateArgs` that can be used to update an arg when it changes value.
+
+Below is an example of how to use `updateArgs` along with the value property:
+
+```js
+import { useArgs } from '@storybook/client-api';
+
+const [{ value }, updateArgs] = useArgs();
+
+// update arg control when value changes
+onChange(value) {
+ updateArgs({ value });
+}
+```
+
+For example, in our [Slider component](../?path=/story/utilities-slider--basic), when in the `focused` mode, if a user hits left or right on their keyboard, the value of the Slider changes accordingly. However, the Storybook control for the current `value` never updates. This puts the component and the control out of sync. The next time the user updates a control, the value will be reapplied, wiping out whatever was set via the keyboard interaction.
+
+To keep the Slider control in sync, we used the `updateArgs` method. In Slider.js, the component emits a signal called "onChange" whenever its value is updated:
+
+```js
+this.signal('onChange', this.value, this);
+```
+
+In Slider.stories.js, our component intercepts the signal:
+
+```js
+Slider: {
+ type: Slider,
+ value: value,
+ signals: {
+ onChange: true
+ }
+}
+```
+
+That signal gets mapped to a new method local to our story that then calls the `updateArgs` method
+
+```js
+onChange(value) {
+ updateArgs({ value })
+}
+```
+
+This `updateArgs` method is what then updates the value control in Storybook to match the value of the component (the one set by the user when hitting left and right).
diff --git a/packages/@lightningjs/ui-components/src/docs/Storybook.stories.mdx b/packages/@lightningjs/ui-components/src/docs/Storybook.stories.mdx
deleted file mode 100644
index 873074c20..000000000
--- a/packages/@lightningjs/ui-components/src/docs/Storybook.stories.mdx
+++ /dev/null
@@ -1,60 +0,0 @@
-import { Meta, Description } from '@storybook/addon-docs';
-import StorybookStructure from '../../../../../STORYBOOK.md';
-
-
-
-{StorybookStructure}
-
-### useArgs
-
-There may be cases throughout our Stories where we want one control to affect the value of another control, or a user interaction with the component to update the value of a control.
-
-This can be achieved through Storybook's `useArgs` hook and `updateArgs` method. For more information, check out the documentation [here](https://storybook.js.org/docs/vue/addons/addons-api#useargs).
-
-`useArgs` is a hook that is a part of the Storybook API that allows **args** to be read or updated.
-
-Specifically, `useArgs` has a method called `updateArgs` that can be used to update an arg when it changes value.
-
-Below is an example of how to use `updateArgs` along with the value property:
-
-```js
-import { useArgs } from '@storybook/client-api';
-
-const [{ value }, updateArgs] = useArgs();
-
-// update arg control when value changes
-onChange(value) {
- updateArgs({ value });
-}
-```
-
-For example, in our [Slider component](../?path=/story/utilities-slider--basic), when in the `focused` mode, if a user hits left or right on their keyboard, the value of the Slider changes accordingly. However, the Storybook control for the current `value` never updates. This puts the component and the control out of sync. The next time the user updates a control, the value will be reapplied, wiping out whatever was set via the keyboard interaction.
-
-To keep the Slider control in sync, we used the `updateArgs` method. In Slider.js, the component emits a signal called "onChange" whenever its value is updated:
-
-```js
-this.signal('onChange', this.value, this);
-```
-
-In Slider.stories.js, our component intercepts the signal:
-
-```js
-Slider: {
- type: Slider,
- value: value,
- signals: {
- onChange: true
- }
-}
-```
-
-That signal gets mapped to a new method local to our story that then calls the `updateArgs` method
-
-```js
-onChange(value) {
- updateArgs({ value });
-}
-```
-
-This `updateArgs` method is what then updates the value control in Storybook to match the value of the component (the one set by the user when hitting left and right).
-
diff --git a/packages/@lightningjs/ui-components/src/docs/Theming.stories.mdx b/packages/@lightningjs/ui-components/src/docs/Theming.mdx
similarity index 79%
rename from packages/@lightningjs/ui-components/src/docs/Theming.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/Theming.mdx
index ebded3664..c21a725ba 100644
--- a/packages/@lightningjs/ui-components/src/docs/Theming.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/Theming.mdx
@@ -1,25 +1,25 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Meta, Description } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
import CustomThemeProgressBar from '../assets/images/CustomThemeProgressBar.png';
-import CustomUpdatedProgressBar from '../assets/images/CustomProgressBar.png'
-import { Canvas, Story } from '@storybook/addon-docs';
+import CustomUpdatedProgressBar from '../assets/images/CustomProgressBar.png';
@@ -46,15 +46,17 @@ Each of the components references specific style properties that map back to a g
7. And lastly, theming can even allow for user initiated personalization, by giving our users the ability to choose their preferred color scheme or font styles.
## Context
+
`Context` allows you to set and update your theme from anywhere in the application. `Context` holds settings and logic that can be used across all Lightning-UI components.
### Setting the Global Context
To start applying themes to your components you need to import both `context` and the theme you want to use in your file, if different from the Base theme. If you do not import a theme, you will default to the open-source Base theme.
-``` js
+```js
import { context } from '@lightningjs/ui-components';
```
+
You can configure `context` in a single call by using the function `context.config()`. `Context` is used as the global store for all Lightning-UI components and contains multiple settings. Utilizing this method allows all configurations to easily be set at one time.
Here we can apply a custom theme. In order to apply it, simply import the theme and pass it into the context config.
@@ -71,6 +73,7 @@ window.CONTEXT = context.config({
```
If you do not apply a custom theme, the Base open-source theme will be used by default. Custom themes can override any combination or subset of the properties detailed in the schema below. A deep merge is conducted on the custom theme with the Base theme, so any properties that are not defined will fallback to the default value from the Base theme.
+
```js
export default {
alpha,
@@ -84,7 +87,6 @@ export default {
typography,
componentConfig
};
-
```
### Utilizing Context
@@ -92,16 +94,23 @@ export default {
The primary `context` methods to utilize when modifying your theme are `setTheme` and `updateTheme`. These methods will allow you to set up a global theme.
#### Setting the theme
+
The `setTheme` method takes in a theme object as a parameter and replaces the currently defined theme with the theme object being passed in. This will execute a deep merge with the original Base theme in case any values are missing.
For example, let's say 'customTheme' changes the Base theme's radius and `coreNeutral` color values slightly.
Then, the function `context.setTheme(customTheme)` takes in the imported theme object (customTheme) as a parameter to create a `ProgressBar` that looks like this:
-
+
+
If you tried to change the bar color or the progress color in the `ProgressBar` component, the method `context.setTheme(customTheme)` will overwrite those changes with values from the 'customTheme' theme.
Setting the theme completely wipes out the modifications on components made by the previously defined theme.
#### Updating the Theme
+
The `updateTheme` method merges the component styles you have updated with the currently selected theme. For example:
```js
@@ -112,9 +121,14 @@ context.updateTheme(
}
);
```
+
The above line of code could create a `ProgressBar` that looks like this:
-
+
Here `progressColor` and `barColor` are merged in with your selected theme, in this case, 'customTheme.' This means that some of the theme properties are consistent with your custom values and some of the properties are updated with the 'customTheme' theme.
If you updated `barColor` and `progressColor` with the method `context.updateTheme()` but did not update the radius, this would yield a theme where the colors are what you defined, but the radius is that of the 'customTheme' theme.
@@ -127,12 +141,15 @@ Logger functions can be used as such:
```js
context.log('Some info here');
```
+
```js
context.warn('Surface a warning!');
```
+
```js
context.error('Broken!');
```
+
```js
context.info('Emergency');
```
@@ -142,17 +159,17 @@ context.info('Emergency');
If you choose to apply a theme at a **global level**, the theme values you have selected will be mapped to a broader set of components.
For example, `fillNeutral` is used by `ProgressBar` and `Checkbox`. If you wanted to change the colors of both of these components you can update the `fillNeutral` value. The two components' color would now be updated to the new `fillNeutral` value. This would be considered a **global level** change.
-``` js
+```js
context.updateTheme({
color: { fillNeutral: [value, 1] }
});
-
```
+
Alternatively, you can apply theme changes at a **component level** via the `componentConfig`. In this case, every instance of a particular component type will use the new values, but the changes will not affect other types of components referencing the same theme values.
The `fillNeutral` is used by both `ProgressBar` and `Checkbox`. If you wanted to only change the color of `ProgressBar`, you would use `componentConfig` to impact only the value of `progressColor`:
-``` js
+```js
context.updateTheme({
componentConfig: {
ProgressBar: {
@@ -168,7 +185,7 @@ context.updateTheme({
Additionally, while not recommended (see below), to make changes on one singular instance of a component you would have to change the theme values under each component's style file. For example, you could change a component's `ProgressBar` color by coding:
```js
-MyComponent.style = { progressColor: 0xf000000 }
+MyComponent.style = { progressColor: 0xf000000 };
```
or
@@ -184,14 +201,14 @@ MyComponent: {
**NOTE:** In order to change a specific component's style properties, you must use the `style` setter. This will trigger the update lifecycle for the component. Trying to directly set the nested style property (eg. `MyComponent.style.progressColor = 0xf000000`) will **NOT** work unless you directly call the component's `_update()` method after. Nested style property updates may be part of a future enhancement.
- **As a WARNING, it is strongly discouraged to make changes to an instance of a component**. Doing so comes with risks given that this is an anti-pattern and no other components will be changed.
+**As a WARNING, it is strongly discouraged to make changes to an instance of a component**. Doing so comes with risks given that this is an anti-pattern and no other components will be changed.
- **We highly RECOMMEND** that if you want to make a global change to an existing theme, it is best to make a custom theme based off of one of the existing themes and then update relevant theme values. This is a great place to use componentConfig overrides and [extensions](../?path=/docs/docs-theming-extensions--page).
+**We highly RECOMMEND** that if you want to make a global change to an existing theme, it is best to make a custom theme based off of one of the existing themes and then update relevant theme values. This is a great place to use componentConfig overrides and [extensions](../?path=/docs/docs-theming-extensions--page).
Continuing with the `ProgressBar` example, let's summarize all the different ways you can change the `ProgressBar` color (`progressColor`) and how it will impact other components:
-| Ways to apply theming | Will it impact an instance of a `ProgressBar`? | Will it impact all `ProgressBar`s? | Will it impact all `FocusRing`s? |
-|-------------------------------------|------------------------------------------------|-----------------------------------|---------------------------------|
-| Updating a components' styles file **(Bad!)** | Yes | No | No |
-| Updating theme on a component level | Yes | Yes | No |
-|Updating theme on a global level | Yes | Yes | Yes |
+| Ways to apply theming | Will it impact an instance of a `ProgressBar`? | Will it impact all `ProgressBar`s? | Will it impact all `FocusRing`s? |
+| --------------------------------------------- | ---------------------------------------------- | ---------------------------------- | -------------------------------- |
+| Updating a components' styles file **(Bad!)** | Yes | No | No |
+| Updating theme on a component level | Yes | Yes | No |
+| Updating theme on a global level | Yes | Yes | Yes |
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingAttributes.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingAttributes.mdx
similarity index 74%
rename from packages/@lightningjs/ui-components/src/docs/ThemingAttributes.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingAttributes.mdx
index 08da9e726..faf3ea748 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingAttributes.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingAttributes.mdx
@@ -1,43 +1,40 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Meta, Description } from '@storybook/addon-docs';
-import radiusTable from '../../../../apps/lightning-ui-docs/scripts/themePropertyTables/radius.md';
-import colorTable from '../../../../apps/lightning-ui-docs/scripts/themePropertyTables/color.md';
-import typographyTable from '../../../../apps/lightning-ui-docs/scripts/themePropertyTables/typography.md';
+import { Meta, Markdown } from '@storybook/blocks';
+import radiusTable from '../../../../apps/lightning-ui-docs/scripts/themePropertyTables/radius.md?raw';
+import colorTable from '../../../../apps/lightning-ui-docs/scripts/themePropertyTables/color.md?raw';
+import typographyTable from '../../../../apps/lightning-ui-docs/scripts/themePropertyTables/typography.md?raw';
# Theming Properties in Our Components
-
-
## Radius
-{radiusTable}
-
-
+{radiusTable}
## Typography
Theme typography is set up to use semantically-named tokens. They are JavaScript objects, with keys for different font attributes and positioning.
-{typographyTable}
+{typographyTable}
### Font Fallback
@@ -52,10 +49,7 @@ export default {
font: [
{
family: 'MyCustomFont',
- src: [
- 'https://myfontwebsite.com/myfont.woff2',
- './fonts/myfont.woff2',
- ]
+ src: ['https://myfontwebsite.com/myfont.woff2', './fonts/myfont.woff2']
}
]
};
@@ -84,10 +78,9 @@ Theme colors are set up using semantically-named tokens, which are then used wit
These tokens are set up to take an array of two values: the first is the six character hex code for the color; the second is the alpha value, ranging from 0 to 100. For example:
```js
-
fillNeutral = ['#ffffff', 95];
```
-{colorTable}
-
+{colorTable}
+
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingComponentConfig.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingComponentConfig.mdx
similarity index 75%
rename from packages/@lightningjs/ui-components/src/docs/ThemingComponentConfig.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingComponentConfig.mdx
index 245c9832e..7efedb7e5 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingComponentConfig.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingComponentConfig.mdx
@@ -1,23 +1,23 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-
-import { Meta, Description } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
@@ -30,10 +30,14 @@ The `componentConfig` object can take in key value pairs of component names to n
The `style` object can be used to override the predetermined style properties of the given component type.
For example:
+
+{/* prettier-ignore */}
```js
componentConfig: {
ProgressBar: {
- style: { radius: 20 }
+ style: {
+ radius: 20
+ }
}
}
```
@@ -43,6 +47,7 @@ componentConfig: {
For a deeper dive on `tones`, see ["Tones"](../?path=/docs/docs-theming-tones--page).
The `tone` property expects a string which will determine the default color palette to apply to a component. Unless you have created a custom tone, this string should match one of the following:
+
- neutral (meant for use on dark backgrounds)
- inverse (meant for use on light backgrounds)
- brand (meant to call branded focus to an element)
@@ -50,6 +55,8 @@ The `tone` property expects a string which will determine the default color pale
When specified, these strings will override the default tone used by the component in our library to quickly change the appearance of the component.
For example:
+
+{/* prettier-ignore */}
```js
componentConfig: {
ProgressBar: {
@@ -72,6 +79,8 @@ The `mode` property expects a string which will determine the default interactio
- pressed (can change the style when a Button is clicked down versus hovered on)
For example:
+
+{/* prettier-ignore */}
```js
componentConfig: {
ProgressBar: {
@@ -85,6 +94,7 @@ componentConfig: {
The `styleConfig` object contains overrides for a component's `tone` and `mode` styles that will be applied when a component is switched into those tone or mode states.
For example:
+
```js
componentConfig: {
ProgressBar: {
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingExtensions.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingExtensions.mdx
similarity index 88%
rename from packages/@lightningjs/ui-components/src/docs/ThemingExtensions.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingExtensions.mdx
index 9faf7cedf..dd1555b20 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingExtensions.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingExtensions.mdx
@@ -1,31 +1,25 @@
-
-
-import { Meta, Description } from '@storybook/addon-docs';
+SPDX-License-Identifier: Apache-2.0
+\*/}
+import { Meta } from '@storybook/blocks';
import ExtensionProgressBar from '../assets/images/ExtensionProgressBar.png';
-
-
# Extensions
@@ -47,7 +41,7 @@ The `withExtensions` mixin, specifically, contains functions that allow for the
The example below shows how the `withExtensions` mixin is used on the `ProgressBar` component.
```js
-export default withExtensions(ProgressBar)
+export default withExtensions(ProgressBar);
```
> To reiterate, extensions are a way to modify any component at runtime using ES6 class inheritance patterns and apply that change easily across your entire application.
@@ -86,6 +80,7 @@ Now that we have the extension defined, we can apply the extension to components
Let's say we have a theme called 'customTheme' and we want to apply our newly created extension, `textAdditionExtension`, to the `ProgressBar` component. Our theme file where we define all our theme properties might look something like:
##### ./customTheme/index.js
+
```js
import textAdditionExtension from '../../extensions/textAddition.extension';
@@ -122,7 +117,11 @@ context.updateTheme({ extensions: textAdditionExtension });
After doing all three steps, for our example, we should see a `ProgressBar` with text below it saying 'Extension Applied!' as displayed below:
-
+
## Use Cases Outside of UI Enhancements
@@ -172,7 +171,7 @@ _extensionCleanup() {
Extensions are applied top to bottom. That is, the first extension in the extensions array will be added first, then the second one, and so on.
```js
-import { focusRingExtension } from '../../extensions/FocusRing.extension';
+import { focusRingExtension } from '../../extensions/FocusRing.extension';
import textAdditionExtension from '../../extensions/textAddition.extension';
export default [
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingFoundations.stories.js b/packages/@lightningjs/ui-components/src/docs/ThemingFoundations.stories.js
index 156c7bac7..c7ae561c3 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingFoundations.stories.js
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingFoundations.stories.js
@@ -127,7 +127,7 @@ class Radius extends Base {
_update() {
if (this.radiusName) {
const radius = context.theme.radius[this.radiusName];
- this._Text.content = `${this.radiusName}: ${radius}px`;
+ this._Text.content = `${this.radiusName}: ${radius}`;
this._Corner.patch({
texture: lng.Tools.getRoundRect(
this._Corner.w,
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingHierarchy.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingHierarchy.mdx
similarity index 69%
rename from packages/@lightningjs/ui-components/src/docs/ThemingHierarchy.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingHierarchy.mdx
index 7a169eba3..e966850bf 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingHierarchy.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingHierarchy.mdx
@@ -1,28 +1,29 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Meta, Description } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
import Flowchart from '../assets/images/Flowchart.png';
# Theming Hierarchy
-
+
The above flowchart serves to demonstrate how the different theming-related concepts covered in previous documentation come together to build the final styles for each component.
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingMode.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingMode.mdx
similarity index 61%
rename from packages/@lightningjs/ui-components/src/docs/ThemingMode.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingMode.mdx
index 76fb1f068..22b0ab355 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingMode.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingMode.mdx
@@ -1,23 +1,23 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-
-import { Meta, Description } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
@@ -27,10 +27,10 @@ LightningUI components utilize modes to update `this.style`. The component's app
**Common modes include:**
-* unfocused (default)
-* focused
-* disabled
-* selected
+- unfocused (default)
+- focused
+- disabled
+- selected
By default each component will attempt to find a `focused` mode when thte component gains focus.
@@ -38,7 +38,8 @@ By default each component will attempt to find a `focused` mode when thte compon
You can set any component's default mode by specifying it in the `componentConfig` property of your theme. For a deeper dive on `tones`, see ["Component Config"](../?path=/docs/docs-theming-component-config--page).
-```js
+{/* prettier-ignore */}
+```js
componentConfig: {
Tile: {
mode: 'focused'
@@ -48,6 +49,7 @@ componentConfig: {
You can also adjust the functionality of a mode by overriding it in your theme using the `styleConfig` property nested inside `componentConfig`.
+{/* prettier-ignore */}
```js
componentConfig: {
Tile: {
@@ -68,10 +70,11 @@ Modes can be set on individual components as well.
In the example below this instance of a Tile would be shown in it's focused state
+{/* prettier-ignore */}
```js
ModeTest: {
type: Tile,
- mode: 'focused',
+ mode: 'focused'
...
}
```
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingStorybook.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingStorybook.mdx
similarity index 75%
rename from packages/@lightningjs/ui-components/src/docs/ThemingStorybook.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingStorybook.mdx
index e478b6bdf..055da14ca 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingStorybook.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingStorybook.mdx
@@ -1,38 +1,42 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-
-import { Meta, Description } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
# Theming and Storybook
## Controls Table
+
Storybook controls and addons are helpful in visualizing the impact of theming on Lightning-UI components. The controls are split into two categories, **properties**, and **theme values**.
### Properties versus Theme Values
+
Controls in the properties category are values that you can change **regardless of theme**. For example, if you were to modify the `ProgressBar` component by changing the width of the bar, this change would persist regardless of the selected theme. Theme values are the style properties that change based on the current theme. On the ProgressBar, theme properties would be things like progressColor or radius.
### Themes
+
We have created a custom "Theme Dropdown" addon to the Storybook toolbar, which allows you to select which theme you would like to apply to the components. The default theme is `Base`, which is bundled into the library. However, in Storybook, we also allow you to create and download a custom theme.
### Global versus Component
+
Choosing a theme target at a **global level** means that the theme values you have selected will be mapped to a broader set of components.
Choosing a theme target at a **component level** means that every instance of a particular component type will use the new values set by the controls, but the changes will not affect other types of components referencing the same theme values.
@@ -40,7 +44,7 @@ Choosing a theme target at a **component level** means that every instance of a
To learn more, check out ["Theming at a Global versus Component Level"](../?path=/story/docs-theming-overview--page#theming-at-a-global-versus-component-level).
## Downloading JSON data
+
You can also download your custom theme, which will include any property overrides you made in Storybook, by hitting the export/download button on the Storybook toolbar. By hitting the export button you will see JSON values relating to your theme selections.
If you overrode any "global" properties via the "Global Theme Values" tab, you will see that reflected in the main property objects like colors and typography. If you overrode any "component" properties via the "Component Style Theme Values" tab, you will see them in the JSON file under the `componentConfig` object.
-
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingSubTheming.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingSubTheming.mdx
similarity index 86%
rename from packages/@lightningjs/ui-components/src/docs/ThemingSubTheming.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingSubTheming.mdx
index 163868686..43e77fba8 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingSubTheming.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingSubTheming.mdx
@@ -1,33 +1,27 @@
-
-
-import { Meta, Description } from '@storybook/addon-docs';
+SPDX-License-Identifier: Apache-2.0
+\*/}
+import { Meta } from '@storybook/blocks';
import SubThemingExample from '../assets/images/SubTheming.png';
import July4thProgressBar from '../assets/images/July4thProgressBar.png';
import UpdatedJuly4thProgressBar from '../assets/images/UpdatedJuly4thProgressBar.png';
import MultiSubThemeProgressBars from '../assets/images/MultiSubThemeProgressBars.png';
-
-
# Subtheming
@@ -74,8 +68,9 @@ context.setSubTheme('4thOfJuly', {
}
}
}
-})
+});
```
+
Here we're changing the colors of the existing theme, specifically the `coreNeutral` values and the `textColor` of the `Tile`'s description text, to reflect that of the holiday.
### 3. Apply the sub-theme to the components in need
@@ -116,11 +111,16 @@ static _template() {
Here we have two `Row` components each containing a set amount of movie `Tiles`. The first `Row` features the 4th of July movies so the '4thOfJuly' `subTheme` with its red, white, and blue values has been applied to it. On the other hand, the second `Row` will only reflect the main theme. The following should be displayed:
-
+
#### Method 2: `subTheme` Getter Method
Another way to apply the sub-theme is by using a `subTheme` getter method that returns the name of the sub-theme to be used.
+
> **Note:** This will also apply the sub-theme to all LUI components that are children of this component.
For example, let's focus on the `ProgressBar` component. We can include this:
@@ -133,7 +133,11 @@ get subTheme() {
Assuming we are generating a `ProgressBar` component, our resulting `ProgressBar` should display:
-
+
The `ProgressBar` uses both `coreNeutral` and `coreNeutralTertiary` to define its `progressColor` and `barColor`, respectively. Since our '4thOfJuly' sub-theme updated those values, we see the `progressColor` and `barColor` of the `ProgressBar` reflecting the values set in the sub-theme.
@@ -150,7 +154,6 @@ Now that we understand how to create and use a sub-theme, let's digest how the c
The `_getSubTheme` method is executed on the `_setup` lifecycle event. In this function (displayed below), we can see that each component continuously goes through its parents to check if a sub-theme is applied to that component until there are no more parent components left to check.
-
```js
_getSubTheme() {
let parent = this.p;
@@ -178,22 +181,25 @@ For example:
```js
context.updateSubTheme('4thOfJuly', {
color: {
- coreNeutral: ['#FAF2E6', 85],
+ coreNeutral: ['#FAF2E6', 85]
}
-})
+});
```
Here, we updated the `coreNeutral` value to white, which will then update the `ProgressBar`'s `progressColor`. This will only affect the `ProgressBar` to which we have applied the sub-theme. All other colors, like `barColor` will remain unchanged.
-
-
+
### removeSubTheme
The `removeSubTheme` method helps to free up memory when a sub-theme is no longer needed. This can be especially important for devices with limited resources.
```js
-context.removeSubTheme('4thOfJuly')
+context.removeSubTheme('4thOfJuly');
```
### setSubThemes
@@ -211,14 +217,14 @@ context.setSubThemes({
coreNeutralTertiary: ['#80A1C2', 85] // blue
}
},
- 'sharkWeek': {
+ sharkWeek: {
color: {
coreNeutral: ['#0078F0', 85],
coreNeutralSecondary: ['#A9ABAB', 24],
coreNeutralTertiary: ['#05C5FF', 27]
}
}
-})
+});
```
The sub-themes can be applied using the 'Lightning Element' method described in step 3 of 'Steps to Utilizing a Sub-Theme.'
@@ -249,7 +255,11 @@ static _template() {
The above code will render two `ProgressBar` components, each utilizing a different sub-theme, as shown below.
-
+
->**Note:** Utilizing `setSubThemes` is a convenient way to add multiple sub-themes at one time.
->It does not provide any performance enhancements over using `setSubTheme` for each individual sub-theme.
+> **Note:** Utilizing `setSubThemes` is a convenient way to add multiple sub-themes at one time.
+> It does not provide any performance enhancements over using `setSubTheme` for each individual sub-theme.
diff --git a/packages/@lightningjs/ui-components/src/docs/ThemingTone.stories.mdx b/packages/@lightningjs/ui-components/src/docs/ThemingTone.mdx
similarity index 69%
rename from packages/@lightningjs/ui-components/src/docs/ThemingTone.stories.mdx
rename to packages/@lightningjs/ui-components/src/docs/ThemingTone.mdx
index 4e373ef48..3207a22b6 100644
--- a/packages/@lightningjs/ui-components/src/docs/ThemingTone.stories.mdx
+++ b/packages/@lightningjs/ui-components/src/docs/ThemingTone.mdx
@@ -1,27 +1,28 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-
-import { Meta, Description } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
# Tone
+
Each Lightning-UI component can be displayed in one of three visual modes that are referred to as a tone. All components have three tone options by default: **neutral**, **brand**, and **inverse**.
Some components can also utilize status colors, like **positive**, **negative**, **caution**, and **info**.
@@ -30,10 +31,12 @@ Each component has a default tone. For example, Base theme `Buttons` and `ListIt
A component's tone can be set at the theme or component level. It is also possible to add custom tones.
### Theme Level
+
You may change the default tone across all LUI components by setting this value in your theme file's `componentConfig`. For a deeper dive on `tones`, see ["Component Config"](../?path=/docs/docs-theming-component-config--page).
For example, if you want to use a brand tone on all `ProgressBar` components, add ProgressBar's tone to `componentConfig`:
+{/* prettier-ignore */}
```js
componentConfig: {
ProgressBar: {
@@ -73,5 +76,5 @@ MyComponent: {
tone: 'inverse'
}
```
-In this example, **only** MyComponent's `ProgressBar` will use the inverse tone.
+In this example, **only** MyComponent's `ProgressBar` will use the inverse tone.
diff --git a/packages/@lightningjs/ui-components/src/docs/constants.js b/packages/@lightningjs/ui-components/src/docs/constants.js
index 4de5dca6a..385ceade1 100644
--- a/packages/@lightningjs/ui-components/src/docs/constants.js
+++ b/packages/@lightningjs/ui-components/src/docs/constants.js
@@ -48,12 +48,7 @@ export const storySortOrder = [
'*'
],
'Unit Testing',
- [
- 'Overview',
- 'Test Renderer',
- 'Test Utils',
- ['makeCreateComponent', '*']
- ]
+ ['Overview', 'Test Renderer', 'Test Utils', ['makeCreateComponent', '*']]
],
CATEGORIES[2],
CATEGORIES[4],
diff --git a/packages/@lightningjs/ui-components/src/docs/story-components/index.js b/packages/@lightningjs/ui-components/src/docs/story-components/index.js
index bf52584d1..08c2f4f1d 100644
--- a/packages/@lightningjs/ui-components/src/docs/story-components/index.js
+++ b/packages/@lightningjs/ui-components/src/docs/story-components/index.js
@@ -1 +1 @@
-export { default as SignalButton } from './SignalButton'
+export { default as SignalButton } from './SignalButton';
diff --git a/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.mdx b/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.mdx
index 213e939fb..5f907ea10 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withAnnouncerStories from './withAnnouncer.stories';
+
+
# withAnnouncer
@@ -38,9 +42,11 @@ https://github.com/rdkcentral/Lightning-UI-Components/blob/develop/packages/@lig
Extend your application with `withAnnouncer` before boot:
```js
-import { withAnnouncer } from '@lightningjs/ui-components'
-const Base = withAnnouncer(lng.Application, window.Speech, { language: 'en-US'} )
-export default class App extends Base {
+import { withAnnouncer } from '@lightningjs/ui-components';
+const Base = withAnnouncer(lng.Application, window.Speech, {
+ language: 'en-US'
+});
+export default class App extends Base {}
```
Set `announcerEnabled` to true in your app and optionally `debug` to true to see console tables of the output as shown below.
@@ -68,7 +74,7 @@ The `withAnnouncer` will travel through the `_focusPath` looking for `component.
All of the properties may return values compatible with the following recursive type definition:
-```
+```js
SpeechType = string | Array | Promise | () => SpeechType
```
@@ -147,10 +153,6 @@ const CustomComp = withAnnouncer(lng.Component, customSpeechImpl, {
});
```
-
-
## API
### Options
diff --git a/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.stories.js b/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.stories.js
index d8b704264..63d1512d6 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withAnnouncer/withAnnouncer.stories.js
@@ -19,17 +19,10 @@
import lng from '@lightningjs/core';
import withAnnouncer, { defaultAbbrevConfig } from '.';
import { Column, Row, Button } from '../../components';
-import mdx from './withAnnouncer.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[4]}/withAnnouncer`,
- component: withAnnouncer,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withAnnouncer',
+ component: withAnnouncer
};
const rows = [
diff --git a/packages/@lightningjs/ui-components/src/mixins/withClassCache/withClassCache.mdx b/packages/@lightningjs/ui-components/src/mixins/withClassCache/withClassCache.mdx
index b2cfb153d..b26c410c4 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withClassCache/withClassCache.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withClassCache/withClassCache.mdx
@@ -1,22 +1,25 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+
+
# withClassCache
diff --git a/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.mdx b/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.mdx
index 1f4507f53..21f14b4da 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withEditItemsStories from './withEditItems.stories';
+
+
# withEditItems
diff --git a/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.stories.js b/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.stories.js
index 934c51031..e2adfd101 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withEditItems/withEditItems.stories.js
@@ -17,21 +17,16 @@
*/
import lng from '@lightningjs/core';
-
import { Button, TextBox, Row } from '../../components';
-import mdx from './withEditItems.mdx';
import { default as withEditItemsMixin } from '.';
-import { CATEGORIES } from '../../docs/constants';
+
/**
* Shared Args and Arg Types from Row
*/
import * as RowProps from '../../components/Row/Row.stories.js';
export default {
- title: `${CATEGORIES[4]}/withEditItems`,
+ title: 'Utilities/withEditItems',
parameters: {
- docs: {
- page: mdx
- },
remountAll: true
}
};
diff --git a/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.mdx b/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.mdx
index dea6cf063..be433d026 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withHandleKeyStories from './withHandleKey.stories';
+
+
# withHandleKey
@@ -29,7 +33,7 @@ https://github.com/rdkcentral/Lightning-UI-Components/blob/develop/packages/@lig
## Usage
-Out of the box, `withHandleKey` adds a generic \_handleKey & \_handleKeyRelease function and calls the corresponding `on{Key}` handler. If no key handler is found, it fires an `$on{Key}` & $on${Key}Release event.
+Out of the box, `withHandleKey` adds a generic \_handleKey & \_handleKeyRelease function and calls the corresponding `on{Key}` handler. If no key handler is found, it fires an `$on{Key}` & `$on${Key}Release` event.
Additionally, if a `metricsPayload` is defined, the global `keyMetricsCallbackHandler` in Context will be invoked with
the given `metricsPayload`.
@@ -60,13 +64,9 @@ class Example extends lng.Component {
}
```
-
-
Take a look at the preview above. Tile component is using the withHandleKey mixin.
If you press enter on the first tile, you should see it print a metrics payload in the console (inspector view)
-In this example, Tile extends `withHandleKey` and allows dynamically adding on${Key} functions or event listener for $on{key}.
+In this example, Tile extends `withHandleKey` and allows dynamically adding `on${Key}` functions or event listener for `$on{key}`.
Example below - an metricPayload is provided, which will be invoked when any key is handled, with the payload
`metricsPayload: { buttonName: 'arrowUp', uniqueId: 'unique-123' }`
diff --git a/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.stories.js b/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.stories.js
index ef97d2ec6..660f44625 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withHandleKey/withHandleKey.stories.js
@@ -19,9 +19,7 @@
import lng from '@lightningjs/core';
import { Tile, Row } from '../../components';
import { context } from '../../globals';
-import mdx from './withHandleKey.mdx';
import withHandleKeyMixin from '.';
-import { CATEGORIES } from '../../docs/constants';
context.config({
// Inspect console to see - should only be called when pressing enter on first tile.
@@ -32,12 +30,7 @@ context.config({
});
export default {
- title: `${CATEGORIES[4]}/withHandleKey`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withHandleKey'
};
export const withHandleKey = args => {
diff --git a/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.mdx b/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.mdx
index 9ebc375b0..30d95c285 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withLayoutStories from './withLayout.stories';
+
+
# withLayout
@@ -108,10 +112,6 @@ Auto sizing of the item will happen based on the above priority. So if the `w an
If the mixin is unable to calculate the height OR width from the passed parameters. The height will default 9/16 of the width. Inversely the width will default to 16/9 of the height.
If the mixin is unable to calculate height AND width from the passed parameters. No autosize will occur.
-
-
### Properties
| name | type | required | default | description |
diff --git a/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.stories.js b/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.stories.js
index bee2ff515..c89cfbd06 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withLayout/withLayout.stories.js
@@ -17,17 +17,10 @@
*/
import lng from '@lightningjs/core';
-import mdx from './withLayout.mdx';
import { Tile } from '../../components';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[4]}/withLayout`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withLayout'
};
export const withLayout = () => {
diff --git a/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.mdx b/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.mdx
index 952152385..ee6acc369 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withMarqueeSyncStories from './withMarqueeSync.stories';
+
+
# withMarqueeSync
@@ -57,10 +61,6 @@ class Basic extends withMarqueeSync(Base) {
}
```
-
-
### Properties
| name | type | required | default | description |
diff --git a/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.stories.js b/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.stories.js
index 8d95ce8a0..a8889233a 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withMarqueeSync/withMarqueeSync.stories.js
@@ -18,17 +18,10 @@
import withMarqueeSync from './withMarqueeSync';
import Base from '../../components/Base';
-import mdx from './withMarqueeSync.mdx';
import TextBox from '../../components/TextBox';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[4]}/withMarqueeSync`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withMarqueeSync'
};
export const Basic = () => {
diff --git a/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.mdx b/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.mdx
index 30444f59d..2720991fd 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta, Canvas } from '@storybook/blocks';
+import * as withSelectionsStories from './withSelections.stories';
+
+
# withSelections
@@ -58,9 +62,7 @@ class Example extends lng.Component {
}
```
-
+
Take a look at the preview above. The row of modified [Buttons](?path=/docs/components-button--button) has navigation managed by the [Row](?path=/docs/components-row--row) component, which is also wrapped in `withSelections`. Navigate with the arrow keys to see the `focus` state change for each [Button](?path=/docs/components-button--button). Hit the `Enter` key to set the currently focused `Button` to be `isSelected`, giving it an underline. Also notice that underline of the previously selected `Button` is removed.
diff --git a/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.stories.js b/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.stories.js
index a350b92e5..0c0be78d6 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withSelections/withSelections.stories.js
@@ -19,16 +19,9 @@
import lng from '@lightningjs/core';
import { Button, Row } from '../../components';
import withSelectionsMixin from '.';
-import mdx from './withSelections.mdx';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[4]}/withSelections`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withSelections'
};
export const withSelections = () => {
diff --git a/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.mdx b/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.mdx
index 21ccb484d..5e6806ac3 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withTagsStories from './withTags.stories';
+
+
# withTags
diff --git a/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.stories.js b/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.stories.js
index 980ba8dd2..0d1956243 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withTags/withTags.stories.js
@@ -17,17 +17,10 @@
*/
import lng from '@lightningjs/core';
-import mdx from './withTags.mdx';
import withTagsMixin from '.';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[4]}/withTags`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withTags'
};
export const withTags = () =>
diff --git a/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.mdx b/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.mdx
index 458b7b009..8eb653bbe 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withThemeStylesStories from './withThemeStyles.stories';
+
+
# withThemeStyles
@@ -24,10 +28,6 @@ Use `withThemeStyles` to create composable components that can be easily themed
The `withThemeStyles` mixin provides flexibility with _composability_: the concept of combining the properties of multiple components to create a new component. This is not intended to be a replacement for building a component API, but rather a tool for augmentation.
-
-
## Usage
Here is an example of applying `withThemeStyles`. Start with an un-styled `Box` component containing a defined width and height.
diff --git a/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.stories.js b/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.stories.js
index 2c5dd66a4..bfaaf2240 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withThemeStyles/withThemeStyles.stories.js
@@ -17,18 +17,11 @@
*/
import lng from '@lightningjs/core';
-import mdx from './withThemeStyles.mdx';
import withThemeStylesMixin from './index.js';
-import { CATEGORIES } from '../../docs/constants';
import { context } from '../../globals';
export default {
- title: `${CATEGORIES[4]}/withThemeStyles`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withThemeStyles'
};
export const withThemeStyles = () => {
diff --git a/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.mdx b/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.mdx
index 4defb66dd..ccda5e6df 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.mdx
+++ b/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.mdx
@@ -1,22 +1,26 @@
-
+SPDX-License-Identifier: Apache-2.0
+\*/}
-import { Canvas, Story } from '@storybook/addon-docs';
+import { Meta } from '@storybook/blocks';
+import * as withUpdatesStories from './withUpdates.stories';
+
+
# withUpdates
diff --git a/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.stories.js b/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.stories.js
index 3f8c7d6bf..ceb56ebfc 100644
--- a/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.stories.js
+++ b/packages/@lightningjs/ui-components/src/mixins/withUpdates/withUpdates.stories.js
@@ -17,17 +17,10 @@
*/
import lng from '@lightningjs/core';
-import mdx from './withUpdates.mdx';
import withUpdatesMixin from '.';
-import { CATEGORIES } from '../../docs/constants';
export default {
- title: `${CATEGORIES[4]}/withUpdates`,
- parameters: {
- docs: {
- page: mdx
- }
- }
+ title: 'Utilities/withUpdates'
};
export const withUpdates = args =>
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/components/NumberRow.js b/packages/apps/lightning-ui-docs/.storybook/addons/components/NumberRow.js
index fe8ab7368..c80d8e88a 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/components/NumberRow.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/components/NumberRow.js
@@ -17,12 +17,11 @@
*/
import React, { useState } from 'react';
-import { NumberControl } from '@storybook/components';
+import { NumberControl } from '@storybook/blocks';
import TableRow from './TableRow';
export default function NumberRow({ label, defaultValue, scope, onChange }) {
const [value, setValue] = useState(defaultValue);
-
return (
{
if (h > context.theme.layout.marginY) {
- console.log(y + h + context.theme.spacer.xl);
app.tag('StoryComponent').y = y + h + context.theme.spacer.xl;
}
}
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/panels/ComponentStylesPanel.js b/packages/apps/lightning-ui-docs/.storybook/addons/panels/ComponentStylesPanel.js
index 36f899dc0..be7dfd517 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/panels/ComponentStylesPanel.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/panels/ComponentStylesPanel.js
@@ -17,10 +17,11 @@
*/
import React, { useState, useEffect } from 'react';
-import { useGlobals } from '@storybook/api';
-import { OptionsControl, ColorControl } from '@storybook/components';
+import { useGlobals } from '@storybook/manager-api';
+import { AddonPanel } from '@storybook/components';
+import { OptionsControl, ColorControl } from '@storybook/blocks';
import { Table, TableRow, NumberRow } from '../components';
-import { utils } from '@lightningjs/ui-components';
+import { utils } from '@lightningjs/ui-components/src';
import debounce from 'debounce';
import {
@@ -30,6 +31,7 @@ import {
updateGlobalTheme
} from '../../utils/themeUtils';
+//NOTE: returns string for the control type to use
function getControlType(value) {
try {
if (utils.getValidColor(value)) {
@@ -42,6 +44,7 @@ function getControlType(value) {
}
}
+//NOTE: called in debouncedUpdateComponentValue(),
const updateComponentValue = (
componentName,
styleProp,
@@ -60,6 +63,7 @@ const updateComponentValue = (
);
};
+//NOTE: delays processing for # microseconds
const debouncedUpdateComponentValue = debounce(function (
componentName,
prop,
@@ -180,41 +184,47 @@ export default params => {
}
return (
-
- {params.active ? (
- styleRows && styleRows.length ? (
- <>
-
Current Theme: {utils.capitalizeFirstLetter(LUITheme)}
-
-
{
- updateToneState(val);
- }}
- />
- }
- />,
- ...styleRows
- ].filter(Boolean)}
- />
-
- >
+
+
+ {params.active ? (
+ styleRows && styleRows.length ? (
+ <>
+
Current Theme: {utils.capitalizeFirstLetter(LUITheme)}
+
+
{
+ updateToneState(val);
+ }}
+ />
+ }
+ />,
+ ...styleRows
+ ].filter(Boolean)}
+ />
+
+ >
+ ) : (
+ No theme values available on this component.
+ )
) : (
- No theme values available on this component.
- )
- ) : (
- <>>
- )}
-
+ <>>
+ )}
+
+
);
};
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/panels/GridOverlayPanel.js b/packages/apps/lightning-ui-docs/.storybook/addons/panels/GridOverlayPanel.js
index e2e9e41d6..73c8da723 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/panels/GridOverlayPanel.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/panels/GridOverlayPanel.js
@@ -18,8 +18,8 @@
import React from 'react';
import { GRIDOVERLAY_ID } from '../constants';
-import { BooleanControl, RangeControl } from '@storybook/components';
-import { useGlobals } from '@storybook/api';
+import { BooleanControl, RangeControl } from '@storybook/blocks';
+import { useGlobals } from '@storybook/manager-api';
import { Table, TableRow } from '../components';
function Controls() {
@@ -39,7 +39,7 @@ function Controls() {
let rows = [];
const alpha = 'alpha';
- const alphaProp = gridName+alpha;
+ const alphaProp = gridName + alpha;
if (globalProps[alphaProp]) {
rows.push(
);
}
- rows.push(...propList.map(prop => {
- const propName = prop.replace(prefix, '');
- return (
- updateGlobals({ [prop]: val.toString() })}
- />
- }
- />
- );
- }));
+ rows.push(
+ ...propList.map(prop => {
+ const propName = prop.replace(prefix, '');
+ return (
+ updateGlobals({ [prop]: val.toString() })}
+ />
+ }
+ />
+ );
+ })
+ );
return <>{rows}>;
}
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/panels/ThemePanel.js b/packages/apps/lightning-ui-docs/.storybook/addons/panels/ThemePanel.js
index 3cfa93f1f..5eb7c5aa5 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/panels/ThemePanel.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/panels/ThemePanel.js
@@ -18,10 +18,14 @@
import React from 'react';
import lng from '@lightningjs/core';
-import { ColorControl, NumberControl } from '@storybook/components';
-import { utils } from '@lightningjs/ui-components';
-import { useGlobals } from '@storybook/api';
-import { colorUpdate, getPanelsTheme, updateGlobalTheme } from '../../utils/themeUtils';
+import { ColorControl, NumberControl } from '@storybook/blocks';
+import { utils } from '@lightningjs/ui-components/src';
+import { useGlobals } from '@storybook/manager-api';
+import {
+ colorUpdate,
+ getPanelsTheme,
+ updateGlobalTheme
+} from '../../utils/themeUtils';
import { Table, TableRow } from '../components';
function Colors() {
@@ -38,7 +42,7 @@ function Colors() {
const rgbaColor = lng.StageUtils.getRgbaString(color);
return (
{
return (
{
- addons.add(ids.ANNOUNCE_ID, {
- type: types.TOOL,
- title: 'Announce Toggle',
- render: Announce
- });
-});
-
-addons.register(ids.THEMEPICKER_ID, () => {
- addons.add(ids.THEMEPICKER_ID, {
- type: types.TOOL,
- title: 'Theme',
- render: ThemePicker
- });
-});
-
-addons.register(ids.DOWNLOAD_ID, () => {
- addons.add(ids.DOWNLOAD_ID, {
- type: types.TOOL,
- title: 'Download Button',
- render: ThemeDownload
- });
-});
-
-addons.register(ids.STAGECOLOR_ID, () => {
- addons.add(ids.STAGECOLOR_ID, {
- type: types.TOOL,
- title: 'Stage Color',
- render: StageColor
- });
-});
-
-addons.register(ids.GRIDOVERLAY_ID, () => {
- addons.add(ids.GRIDOVERLAY_ID, {
- type: types.PANEL,
- title: 'Grid Layout Overlay',
- render: params => GridOverlayPanel(params)
- });
-});
-
-addons.register(ids.COMPONENTSTYLES_ID, api => {
- addons.add(ids.COMPONENTSTYLES_ID, {
- type: types.PANEL,
- title: 'Component Style Theme Values',
- render: params => ComponentStylesPanel(params, api)
- });
-});
-
-addons.register(ids.THEMEPANEL_ID, () => {
- addons.add(ids.THEMEPANEL_ID, {
- type: types.PANEL,
- title: 'Global Theme Values',
- render: ({ key, active }) =>
- });
-});
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/Announce.js b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/Announce.js
index df76a39b9..0c81f119c 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/Announce.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/Announce.js
@@ -16,30 +16,37 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import React, { useCallback } from 'react';
-import { useGlobals } from '@storybook/api';
+import React, { memo, useCallback, useEffect } from 'react';
+import { useGlobals, useStorybookApi } from '@storybook/manager-api';
import { Icons, IconButton } from '@storybook/components';
-import { ANNOUNCE_ID } from '../constants';
+import { ADDON_ID, ANNOUNCE_ID } from '../constants';
-export default () => {
+export const Announce = memo(function MyAddonSelector() {
const [{ announce }, updateGlobals] = useGlobals();
+ const api = useStorybookApi();
+ const isActive = [true, 'true'].includes(announce);
+ const toggleAnnounce = useCallback(() => {
+ updateGlobals({
+ announce: !isActive
+ });
+ }, [isActive]);
- const toggleMyTool = useCallback(
- () =>
- updateGlobals({
- announce: !announce
- }),
- [announce]
- );
+ useEffect(() => {
+ api.setAddonShortcut(ADDON_ID, {
+ label: 'Announce Toggle [0]',
+ actionName: 'Announce',
+ action: toggleAnnounce
+ });
+ }, [toggleAnnounce, api]);
return (
);
-};
+});
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/StageColor.js b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/StageColor.js
index 3c1582ac2..16518845c 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/StageColor.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/StageColor.js
@@ -16,30 +16,37 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import React, { useCallback } from 'react';
-import { useGlobals } from '@storybook/api';
+import React, { useCallback, memo, useEffect } from 'react';
+import { useGlobals, useStorybookApi } from '@storybook/manager-api';
import { Icons, IconButton } from '@storybook/components';
-import { STAGECOLOR_ID } from '../constants';
+import { ADDON_ID, STAGECOLOR_ID } from '../constants';
-export default () => {
+export const StageColor = memo(function MyAddonSelector() {
const [{ stageColor }, updateGlobals] = useGlobals();
-
- const toggleStage = useCallback(
- () =>
- updateGlobals({
- stageColor: !stageColor
- }),
- [stageColor]
- );
+ const api = useStorybookApi();
+ const isActiveStage = [true, 'true'].includes(stageColor);
+ const toggleStage = useCallback(() => {
+ updateGlobals({
+ stageColor: !isActiveStage
+ });
+ }, [isActiveStage]);
+ useEffect(() => {
+ api.setAddonShortcut(ADDON_ID, {
+ label: 'Stage Color Toggle',
+ actionName: 'stage color',
+ showInMenu: false,
+ action: toggleStage
+ });
+ }, [toggleStage, api]);
return (
);
-};
+});
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemeDownload.js b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemeDownload.js
index 9003d85c9..c7735e661 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemeDownload.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemeDownload.js
@@ -17,10 +17,10 @@
*/
import React from 'react';
+import { DOWNLOAD_ID } from '../constants';
import { Icons, IconButton } from '@storybook/components';
import { convertNumToHexAlphaArray } from '../../utils/helpers';
-import { utils } from '@lightningjs/ui-components';
-import { DOWNLOAD_ID } from '../constants';
+import { utils } from '@lightningjs/ui-components/src';
export default () => {
const download = () => {
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemePicker.js b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemePicker.js
index e11f53e98..7ad17157a 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemePicker.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/ThemePicker.js
@@ -16,17 +16,18 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { setGlobalTheme } from '../../utils/themeUtils';
-import { TabButton, TooltipLinkList, WithTooltip } from '@storybook/components';
-import { THEMEPICKER_ID, THEMES } from '../constants';
-import { useGlobals } from '@storybook/api';
import React, { useState, useEffect } from 'react';
-import { utils } from '@lightningjs/ui-components';
+import { useGlobals } from '@storybook/manager-api';
+import { TabButton, TooltipLinkList, WithTooltip } from '@storybook/components';
+import { THEMEPICKER_ID } from '../constants';
+import { setGlobalTheme } from '../../utils/themeUtils';
+import { utils } from '@lightningjs/ui-components/src';
export default () => {
const [{ LUITheme }, updateGlobals] = useGlobals();
const [tooltipLinks, updateTooltipLinks] = useState([]);
const [firstLoad, updateFirstLoad] = useState(true);
+
useEffect(() => {
if (!LUITheme) return; // LUITheme is not set until the iframe has first been loaded in preview.js
if (firstLoad && 'custom' === LUITheme) {
@@ -39,7 +40,7 @@ export default () => {
updateFirstLoad(false); // Makes sure the block above only runs once
updateTooltipLinks(
- ['base', ...Object.keys(THEMES), 'custom']
+ ['base']
.filter(theme => ('custom' === LUITheme ? theme : 'custom' !== theme))
.map((theme, idx) => {
const active = theme.toLowerCase() === LUITheme;
@@ -54,12 +55,12 @@ export default () => {
})
);
}, [LUITheme]);
-
return (
}
>
diff --git a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/index.js b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/index.js
index 8f0750e83..1305aa61b 100644
--- a/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/index.js
+++ b/packages/apps/lightning-ui-docs/.storybook/addons/toolbars/index.js
@@ -16,7 +16,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-export { default as Announce } from './Announce';
-export { default as StageColor } from './StageColor';
+export { Announce } from './Announce';
+export { StageColor } from './StageColor';
export { default as ThemeDownload } from './ThemeDownload';
export { default as ThemePicker } from './ThemePicker';
diff --git a/packages/apps/lightning-ui-docs/.storybook/controls-delete/argTypes/index.js b/packages/apps/lightning-ui-docs/.storybook/controls-delete/argTypes/index.js
deleted file mode 100644
index a255e3427..000000000
--- a/packages/apps/lightning-ui-docs/.storybook/controls-delete/argTypes/index.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
- * Copyright 2023 Comcast Cable Communications Management, LLC
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- */
-
-export const createModeControl = ({ options, summaryValue } = {}) => {
- return {
- mode: {
- control: 'radio',
- options:
- options && Array.isArray(options)
- ? ['unfocused', ...options]
- : ['unfocused', 'focused', 'disabled'],
- description: 'Sets the visual mode for the component',
- table: {
- defaultValue: { summary: summaryValue } // need to figure out how to add default value per story, maybe the args?
- },
- type: { name: 'mode', required: true }
- }
- };
-};
diff --git a/packages/apps/lightning-ui-docs/.storybook/main.js b/packages/apps/lightning-ui-docs/.storybook/main.js
index f2a824b81..6ca6b6fcc 100644
--- a/packages/apps/lightning-ui-docs/.storybook/main.js
+++ b/packages/apps/lightning-ui-docs/.storybook/main.js
@@ -1,4 +1,4 @@
-/**
+/**
* Copyright 2023 Comcast Cable Communications Management, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -15,24 +15,63 @@
*
* SPDX-License-Identifier: Apache-2.0
*/
+import remarkGfm from 'remark-gfm'; // needed for Tables, Links, etc in MDX
+const path = require('path');
-module.exports = {
+const config = {
addons: [
- '@storybook/addon-docs',
- '@storybook/addon-essentials',
- '@storybook/addon-storysource',
- './addons/register',
- 'storybook-addon-turbo-build' // Speed up final build
+ {
+ name: '@storybook/addon-essentials',
+ options: {
+ backgrounds: false,
+ outline: false, // disable outline addon
+ measure: false, // disable measure addon
+ viewport: false // disable viewport addon
+ }
+ },
+ {
+ name: '@storybook/addon-docs',
+ options: {
+ mdxPluginOptions: {
+ mdxCompileOptions: {
+ remarkPlugins: [remarkGfm] // needed for MDX to use Github Flavored Markdown
+ }
+ }
+ }
+ },
+ '@storybook/addon-designs',
+ '@storybook/addon-storysource'
],
stories: [
- '../src/*.stories.@(js|jsx|ts|tsx|mdx)',
+ '../src/*.mdx',
+ '../../../@lightningjs/ui-components/src/**/*.mdx',
'../../../@lightningjs/ui-components/src/**/*.stories.@(js|jsx|ts|tsx)',
- '../../../@lightningjs/ui-components/src/docs/*.stories.@(js|jsx|ts|tsx|mdx)',
- '../../../@lightningjs/ui-components-test-utils/src/docs/*.stories.@(js|jsx|ts|tsx|mdx)',
- '../../../@lightningjs/ui-components-test-utils/src/docs/**/*.stories.@(js|jsx|ts|tsx|mdx)'
+ '../../../@lightningjs/ui-components-test-utils/src/docs/*.mdx',
+ '../../../@lightningjs/ui-components-test-utils/src/docs/**/*.mdx'
],
- staticDirs: ['../../../@lightningjs/ui-components/src/assets'], // TODO: How to handle images between projects
+ staticDirs: ['../../../@lightningjs/ui-components/src/assets'],
+ // TODO: How to handle images between projects
+ // could use something like '../public' or '../static' in the root
core: {
disableTelemetry: true
+ },
+ framework: {
+ name: '@storybook/html-webpack5',
+ options: {}
+ },
+ docs: {
+ autodocs: false
+ },
+ async webpackFinal(config) {
+ config.optimization.minimize = false; // Minification seams to to break FocusManager navigation
+ // Shorter alias for inspector
+ config.resolve.alias['lightningInspect'] = path.resolve(
+ __dirname,
+ '../../../../node_modules/@lightningjs/core/devtools/lightning-inspect'
+ );
+
+ return config;
}
};
+
+export default config;
diff --git a/packages/apps/lightning-ui-docs/.storybook/manager-head.html b/packages/apps/lightning-ui-docs/.storybook/manager-head.html
index 2ae769b69..8c243824b 100644
--- a/packages/apps/lightning-ui-docs/.storybook/manager-head.html
+++ b/packages/apps/lightning-ui-docs/.storybook/manager-head.html
@@ -67,4 +67,9 @@
border: 1px solid rgb(74, 74, 74);
padding: 10px 20px;
}
+
+ /* temporary solution for background issue not being recognized by appContentBG */
+ #storybook-preview-iframe {
+ background-color: transparent !important;
+ }
diff --git a/packages/apps/lightning-ui-docs/.storybook/manager.js b/packages/apps/lightning-ui-docs/.storybook/manager.js
index d0167989b..141c91649 100644
--- a/packages/apps/lightning-ui-docs/.storybook/manager.js
+++ b/packages/apps/lightning-ui-docs/.storybook/manager.js
@@ -16,10 +16,77 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { addons } from '@storybook/addons';
+import { addons, types } from '@storybook/manager-api';
import theme from './theme';
+import * as ids from './addons/constants';
+import {
+ Announce,
+ StageColor,
+ ThemeDownload,
+ ThemePicker
+} from './addons/toolbars';
+import {
+ ComponentStylesPanel,
+ GridOverlayPanel,
+ ThemePanel
+} from './addons/panels';
addons.setConfig({
- theme,
+ theme: theme, // setting Storybook theme
enableShortcuts: false
});
+
+// register addons
+addons.register(ids.ADDON_ID, () => {
+ // Announce toggle
+ addons.add(ids.ANNOUNCE_ID, {
+ type: types.TOOL,
+ title: 'Announce Toggle',
+ match: ({ viewMode }) => viewMode === 'story', // show only in story
+ render: Announce
+ });
+ // // Theme Picker
+ addons.add(ids.THEMEPICKER_ID, {
+ type: types.TOOL,
+ title: 'Theme',
+ match: ({ viewMode }) => viewMode === 'story',
+ render: ThemePicker
+ });
+ // // Theme Download tool
+ addons.add(ids.DOWNLOAD_ID, {
+ type: types.TOOL,
+ title: 'Download Button',
+ match: ({ viewMode }) => viewMode === 'story',
+ render: ThemeDownload
+ });
+ // // Stage Color Toggle
+ addons.add(ids.STAGECOLOR_ID, {
+ type: types.TOOL,
+ title: 'Stage Color',
+ match: ({ viewMode }) => viewMode === 'story',
+ render: StageColor
+ });
+ // // Grid Overlay Panel
+ addons.add(ids.GRIDOVERLAY_ID, {
+ type: types.PANEL,
+ title: 'Grid Layout Overlay',
+ match: ({ viewMode }) => viewMode === 'story',
+ render: params => GridOverlayPanel(params)
+ });
+
+ // // Component Style Panel
+ addons.add(ids.COMPONENTSTYLES_ID, {
+ type: types.PANEL,
+ title: 'Component Style Theme Values',
+ match: ({ viewMode }) => viewMode === 'story',
+ render: params => ComponentStylesPanel(params)
+ });
+
+ // // Global Theme Panel
+ addons.add(ids.THEMEPANEL_ID, {
+ type: types.PANEL,
+ title: 'Global Theme Values',
+ match: ({ viewMode }) => viewMode === 'story',
+ render: ThemePanel
+ });
+});
diff --git a/packages/apps/lightning-ui-docs/.storybook/preview-head.html b/packages/apps/lightning-ui-docs/.storybook/preview-head.html
index 9884b990a..7664fd4a7 100644
--- a/packages/apps/lightning-ui-docs/.storybook/preview-head.html
+++ b/packages/apps/lightning-ui-docs/.storybook/preview-head.html
@@ -17,9 +17,7 @@
-->
diff --git a/packages/apps/lightning-ui-docs/.storybook/preview.js b/packages/apps/lightning-ui-docs/.storybook/preview.js
index 2c83b4d60..91a977bf0 100644
--- a/packages/apps/lightning-ui-docs/.storybook/preview.js
+++ b/packages/apps/lightning-ui-docs/.storybook/preview.js
@@ -18,71 +18,105 @@
// these two lines need to be in this order
// to wait until the inspector is enabled before attaching it
-import theme from './theme';
import { withLightning } from './addons/decorators/withLightning';
import { registerEventListeners } from './utils/registerEvents';
-import { storySortOrder } from '@lightningjs/ui-components/src/docs/constants';
+import { themes } from '@storybook/theming';
// loads window event listeners
registerEventListeners();
-
/**
* custom global props that can be accessed in decorators and add-ons
* globalTypes can only be set in preview.js
* @see https://storybook.js.org/docs/react/essentials/toolbars-and-globals#globals
*/
-
-export const globalTypes = {
- LUITheme: {
- name: 'Theme',
- description: 'Theme select',
- defaultValue: 'xfinity'
- },
- 'GridOverlay-alpha': {
- defaultValue: '0'
- },
- 'GridOverlay-toggle-showColumns': {
- defaultValue: 'true'
- },
- 'GridOverlay-toggle-showMargins': {
- defaultValue: 'false'
- },
- 'GridOverlay-toggle-showSafe': {
- defaultValue: 'false'
- },
- 'GridOverlay-toggle-showGutters': {
- defaultValue: 'false'
- },
- 'GridOverlay-toggle-showText': {
- defaultValue: 'false'
- }
-};
-
-export const parameters = {
- actions: { argTypesRegex: '^on[A-Z].*' },
- backgrounds: {
- disable: true
- },
- controls: {
- hideNoControlsWarning: true,
- expanded: true,
- sort: 'requiredFirst'
- },
- docs: {
- inlineStories: false, // sets docs to use iframes
- theme, // Storybook global theme object
- iframeHeight: 300 // sets height for examples in docs
+const preview = {
+ parameters: {
+ actions: { argTypesRegex: '^on[A-Z].*' },
+ backgrounds: {
+ disable: true
+ },
+ controls: {
+ hideNoControlsWarning: true,
+ expanded: true,
+ sort: 'requiredFirst'
+ },
+ docs: {
+ theme: themes.dark
+ },
+ options: {
+ /** NOTE: v7 storySort must be self-contained function & no reference to outside variables
+ https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#v7-style-story-sort
+ */
+ storySort: {
+ method: 'alphabetical',
+ order: [
+ 'Docs',
+ [
+ 'Introduction',
+ 'Read Me',
+ 'Base',
+ 'Contributing',
+ 'Lightning Resources',
+ 'Theming',
+ [
+ 'Overview',
+ 'Component Config',
+ 'Tones',
+ 'Modes',
+ 'Extensions',
+ 'Subtheming',
+ 'Use in Storybook',
+ 'Theme Properties',
+ '*'
+ ],
+ 'Unit Testing',
+ [
+ 'Overview',
+ 'Test Renderer',
+ 'Test Utils',
+ ['makeCreateComponent', '*']
+ ]
+ ],
+ 'Collections',
+ 'Utilities',
+ 'Components',
+ 'Patterns',
+ 'Templates'
+ ]
+ }
+ }
},
- options: {
- /** Sort method that accepts a function or configuration object
- * @see https://storybook.js.org/docs/react/writing-stories/naming-components-and-hierarchy#sorting-stories
- */
- storySort: {
- method: 'alphabetical',
- order: storySortOrder
+ globalTypes: {
+ LUITheme: {
+ name: 'Theme',
+ description: 'Theme select',
+ defaultValue: 'base'
+ },
+ 'GridOverlay-alpha': {
+ defaultValue: '0'
+ },
+ 'GridOverlay-toggle-showColumns': {
+ defaultValue: 'true'
+ },
+ 'GridOverlay-toggle-showMargins': {
+ defaultValue: 'false'
+ },
+ 'GridOverlay-toggle-showSafe': {
+ defaultValue: 'false'
+ },
+ 'GridOverlay-toggle-showGutters': {
+ defaultValue: 'false'
+ },
+ 'GridOverlay-toggle-showText': {
+ defaultValue: 'false'
+ },
+ announce: {
+ defaultValue: false
+ },
+ stageColor: {
+ defaultValue: false
}
- }
+ },
+ decorators: [withLightning]
};
-
-// adding Lightning decorator globally
-export const decorators = [withLightning];
+export default preview;
diff --git a/packages/apps/lightning-ui-docs/.storybook/theme.js b/packages/apps/lightning-ui-docs/.storybook/theme.js
index 005c16fe7..41c08e545 100644
--- a/packages/apps/lightning-ui-docs/.storybook/theme.js
+++ b/packages/apps/lightning-ui-docs/.storybook/theme.js
@@ -16,14 +16,13 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { create } from '@storybook/theming/create';
+import { create, themes } from '@storybook/theming/create';
import brand from './brand.png';
-import { version } from '@lightningjs/ui-components/package.json';
+import { version } from '../../../@lightningjs/ui-components/package.json'; // TODO: follow up on this temp fix to get the import to work
export default create({
+ ...themes.dark,
base: 'dark',
- appBg: 'rgba(33, 35, 43, 1)',
- textColor: 'white',
brandTitle: `Lightning UI Components v${version}`,
brandUrl: 'https://github.com/rdkcentral/Lightning-UI-Components',
brandImage: brand
diff --git a/packages/apps/lightning-ui-docs/.storybook/utils/registerEvents.js b/packages/apps/lightning-ui-docs/.storybook/utils/registerEvents.js
index a983fbcd9..3f08ee18b 100644
--- a/packages/apps/lightning-ui-docs/.storybook/utils/registerEvents.js
+++ b/packages/apps/lightning-ui-docs/.storybook/utils/registerEvents.js
@@ -16,7 +16,7 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { context } from '@lightningjs/ui-components';
+import { context } from '@lightningjs/ui-components/src';
// creates an array of extensions
// added to the theme by setTheme in themeSelect
@@ -25,7 +25,6 @@ import { context } from '@lightningjs/ui-components';
export const themeSelectFromMessageEvent = event => {
themeSelect(event.data.theme);
};
-
// called in ThemePicker
export const themeSelect = theme => {
if (!theme) return;
diff --git a/packages/apps/lightning-ui-docs/.storybook/utils/themeUtils.js b/packages/apps/lightning-ui-docs/.storybook/utils/themeUtils.js
index bcee6ed20..1e2fd1463 100644
--- a/packages/apps/lightning-ui-docs/.storybook/utils/themeUtils.js
+++ b/packages/apps/lightning-ui-docs/.storybook/utils/themeUtils.js
@@ -17,7 +17,7 @@
*/
import baseTheme from '@lightningjs/ui-components-theme-base';
-import { utils } from '@lightningjs/ui-components';
+import { utils } from '@lightningjs/ui-components/src';
import debounce from 'debounce';
// Component Styles Panel
@@ -49,7 +49,6 @@ export function setGlobalTheme(theme, updateGlobals) {
document.querySelector('iframe') &&
document.querySelector('iframe').contentWindow &&
document.querySelector('iframe').contentWindow.postMessage({ theme });
- //globalContext().setTheme(THEMES[theme] || {}); // If no theme is found it means that the base theme should be set
if (updateGlobals) updateGlobals({ LUITheme: theme });
}
diff --git a/packages/apps/lightning-ui-docs/index.js b/packages/apps/lightning-ui-docs/index.js
index 5d3a0876a..01cafbbdc 100644
--- a/packages/apps/lightning-ui-docs/index.js
+++ b/packages/apps/lightning-ui-docs/index.js
@@ -23,7 +23,7 @@ import {
Speech,
pool,
context
-} from '@lightningjs/ui-components';
+} from '@lightningjs/ui-components/src';
import {
themeSelect,
themeSelectFromMessageEvent
@@ -109,13 +109,4 @@ export const clearInspector = () => {
const div = document.querySelector('[type=StoryApp]');
div && div.parentNode.remove();
}
-
- // Move lightning inspector out of the foreground
- if (window.top.location.search.indexOf('path=/docs/') > -1) {
- document.body.classList.remove('canvas');
- const div = document.querySelector('[type=StoryApp]');
- div && (div.parentNode.style.zIndex = -1);
- } else {
- document.body.classList.add('canvas');
- }
};
diff --git a/packages/apps/lightning-ui-docs/package.json b/packages/apps/lightning-ui-docs/package.json
index 0df1fb7f4..23330ba6c 100644
--- a/packages/apps/lightning-ui-docs/package.json
+++ b/packages/apps/lightning-ui-docs/package.json
@@ -3,17 +3,12 @@
"sideEffects": false,
"private": true,
"scripts": {
- "start": "yarn run generateStorybookData && start-storybook --no-manager-cache -p 8000",
- "build": "yarn run generateStorybookData && build-storybook",
- "storybook": "start-storybook -p 6006",
+ "start": "yarn run generateStorybookData && storybook dev -p 8000",
+ "build": "yarn run generateStorybookData && storybook build",
+ "storybook": "storybook dev -p 6006",
"generateStorybookData": "node ./scripts/generate-theme-props-table.mjs",
"styleDocs": "node bin/translationScript.js"
},
- "exports": {
- ".": {
- "default": "./index.js"
- }
- },
"devDependencies": {
"@babel/core": "^7.19.6",
"@babel/plugin-transform-runtime": "^7.19.1",
@@ -22,17 +17,17 @@
"@lightningjs/ui-components": "workspace:^",
"@lightningjs/ui-components-theme-base": "workspace:^",
"@mdx-js/react": "^1.6.22",
- "@storybook/addon-actions": "^6.5.12",
- "@storybook/addon-docs": "^6.5.12",
- "@storybook/addon-essentials": "^6.5.12",
- "@storybook/addon-interactions": "^6.5.12",
- "@storybook/addon-links": "^6.5.12",
- "@storybook/addon-storysource": "^6.5.12",
- "@storybook/builder-webpack4": "^6.5.12",
- "@storybook/html": "^6.5.12",
- "@storybook/manager-webpack4": "^6.5.12",
- "@storybook/manager-webpack5": "^6.5.12",
- "@storybook/testing-library": "^0.0.13",
+ "@storybook/addon-actions": "^7.5.0",
+ "@storybook/addon-designs": "^7.0.5",
+ "@storybook/addon-essentials": "^7.5.0",
+ "@storybook/addon-interactions": "^7.5.0",
+ "@storybook/addon-links": "^7.5.0",
+ "@storybook/addon-mdx-gfm": "^7.5.0",
+ "@storybook/addon-storysource": "^7.5.0",
+ "@storybook/blocks": "^7.5.0",
+ "@storybook/html": "^7.5.0",
+ "@storybook/html-webpack5": "^7.5.0",
+ "@storybook/testing-library": "^0.2.2",
"@yarnpkg/pnpify": "^4.0.0-rc.21",
"babel-jest": "^29.0.3",
"babel-loader": "^8.2.5",
@@ -40,8 +35,8 @@
"line-reader-sync": "^0.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
- "storybook": "^6.5.12",
- "storybook-addon-turbo-build": "^1.1.0"
+ "remark-gfm": "^3.0.1",
+ "storybook": "^7.5.0"
},
"dependencies": {
"@babel/preset-react": "^7.18.6"
diff --git a/packages/apps/lightning-ui-docs/scripts/get-storybook-links.mjs b/packages/apps/lightning-ui-docs/scripts/get-storybook-links.mjs
index 5009da307..6a71260b8 100644
--- a/packages/apps/lightning-ui-docs/scripts/get-storybook-links.mjs
+++ b/packages/apps/lightning-ui-docs/scripts/get-storybook-links.mjs
@@ -27,12 +27,12 @@ import fs from 'fs';
* @returns {string} holds the url the user would navigate to when a component is clicked
*/
export function getStorybookLinks(component, path, name) {
- // get mdx paths
- const originalPath = `../${path}/${component}.mdx`;
+ // get stories.js paths
+ const originalPath = `../${path}/${component}.stories.js`;
let modifiedPath = originalPath;
if (component != name) {
// this is incase there are multiple elements nested inside of one folder
- modifiedPath = `../../${path}/${name}.mdx`;
+ modifiedPath = `../../${path}/${name}.stories.js`;
if (!fs.existsSync(modifiedPath)) {
modifiedPath = originalPath; // this is in case there are multiple elements nested inside of one folder but not all of them have .mdx files
}
@@ -42,22 +42,26 @@ export function getStorybookLinks(component, path, name) {
return;
}
const lrs = new LineReaderSync(modifiedPath);
- const storyIdString = '
+
+# Contributing to `@lightningjs/ui-components`
+
+First off, thanks for taking the time to contribute!
+
+The following is a set of guidelines for contributing to `@lightningjs/ui-components`. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
+
+## Table of Contents
+
+- [I don't want to read this whole thing I just have a question!!!](#i-dont-want-to-read-this-whole-thing-i-just-have-a-question)
+- [How Can I Contribute?](#how-can-i-contribute)
+ - [Reporting Bugs](#reporting-bugs)
+ - [Suggesting Enhancements](#suggesting-enhancements)
+ - [Your First Code Contribution](#your-first-code-contribution)
+ - [Pull Requests](#pull-requests)
+- [Style Guides](#style-guides)
+ - [TypeScript](#typescript)
+ - [Git Commit Messages](#git-commit-messages)
+ - [JavaScript Style Guide](#javascript-style-guide)
+ - [Test Style Guide](#test-style-guide)
+ - [Documentation Style Guide](#documentation-style-guide)
+ - [Live Examples](#live-examples)
+ - [Storybook](#storybook)
+ - [Usage Documentation](#usage-documentation)
+ - [API Documentation](#api-documentation)
+
+## I don't want to read this whole thing I just have a question!!!
+
+> **Note:** Before you file an issue with a question, you'll get faster results by using the resources below.
+
+
+
+**Documentation**
+
+- [See the README for setup help](../?path=/story/docs-read-me--page)
+- [See Storybook for component docs with live examples](https://rdkcentral.github.io/Lightning-UI-Components/)
+
+**Discuss on Slack**
+
+
+ #lightning-ui-components-support
+
+
+## How Can I Contribute?
+
+### Reporting Bugs
+
+This section guides you through submitting a bug report for `@lightningjs/ui-components`. Following these guidelines helps maintainers and the community understand your report, reproduce the behavior, and find related reports.
+
+When you are creating a bug report please check the version of LUI that you are using. Include as many details as possible, and post either as an issue [here](https://github.com/rdkcentral/Lightning-UI-Components/issues) on GitHub.
+
+> **Note:** If you find a **Closed** issue that seems like it is the same thing that you're experiencing, open a new issue and include a link to the original issue in the body of your new one.
+
+#### How Do I Submit A (Good) Bug Report?
+
+Bugs are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information:
+
+- Tell us the specific version of LUI you are using
+- Paste code snippets using the markdown code formatters (walls of unformatted copy and pasted text are very difficult to parse)
+- Provide links to any relevant code, tickets, or GitHub issues
+- Provide screenshots/videos to illustrate the bug you are facing
+- Provide detailed reproduction steps
+
+### Suggesting Enhancements
+
+This section guides you through submitting an enhancement suggestion for `@lightningjs/ui-components`, including new components, completely new features, and minor improvements to existing functionality. Following these guidelines helps maintainers and the community understand your suggestion and find related suggestions.
+
+#### Before Submitting An Enhancement Suggestion
+
+- **Check if there's already a component which provides that enhancement.**
+- **Perform a [cursory search](https://github.com/rdkcentral/Lightning-UI-Components/issues)** to see if the enhancement has already been suggested. If it has, add a comment to the existing issue instead of opening a new one.
+
+#### How Do I Submit A (Good) Enhancement Suggestion?
+
+Enhancement suggestions are tracked as [GitHub issues](https://guides.github.com/features/issues/). Create an issue and provide the following information:
+
+- **Use a clear and descriptive title** for the issue to identify the suggestion.
+- **Provide a step-by-step description of the suggested enhancement** in as many details as possible.
+- **Provide specific examples to demonstrate the steps**. Include copy/pasteable snippets which you use in those examples, as [Markdown code blocks](https://help.github.com/articles/markdown-basics/#multiple-lines).
+- **Describe the current behavior** and **explain which behavior you expected to see instead** and why.
+- **Include screenshots and animated GIFs** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [this tool](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and [this tool](https://github.com/colinkeenan/silentcast) on Linux.
+- **Explain why this enhancement would be useful** to most `@lightningjs/ui-components` users.
+- **Include any additional information** that might be helpful
+
+### Your First Code Contribution
+
+Unsure where to begin contributing to `@lightningjs/ui-components`? You can start by looking through these `beginner` and `help-wanted` issues:
+
+- [Beginner issues][beginner] \- issues which should only require a few lines of code, and a test or two.
+- [Help wanted issues][help-wanted] \- issues which should be a bit more involved than `beginner` issues.
+
+Follow the instructions below to get started with local development:
+
+Fork and clone the project from here: https://github.com/rdkcentral/Lightning-UI-Components.
+
+In your local terminal, follow these steps:
+
+```bash
+# enter project directory
+cd packages/@lightningjs/ui-components
+```
+
+## Installation
+
+The Lightning UI Monorepo requires yarn 3.2.3^
+
+The preferred way to manage Yarn is through Corepack, a new binary shipped with all Node.js releases starting from 16.10. It acts as an intermediary between you and Yarn, and lets you use different package manager versions across multiple projects without having to check-in the Yarn binary anymore.
+
+Corepack is included by default with all Node.js installs, but is currently opt-in. To enable it, run the following command:
+
+```sh
+corepack enable
+```
+
+```sh
+corepack prepare yarn@3.2.3 --activate
+```
+
+### Installing dependencies
+
+```sh
+yarn install
+```
+
+### Starting the project
+
+```sh
+yarn start
+```
+
+Running this command will start storybook which is located in packages/apps/lightning-ui-docs. All changes made in packages/@lightningjs/ui & packages/@lightningjs/ui-components will be reflected in the storybook instance at http://localhost:8000
+
+## New component
+
+### Requirements
+
+Before a new component will be reviewed, it must meet the following prerequisite:
+
+- Component concept has been approved by @Lightning/lightning-team
+
+> **Note:** Development on a component may be broken up in separate PRs or done all at once, use your best judgement when breaking up work.
+
+### Development
+
+If you are creating a new component, you can bootstrap the required file structure with:
+
+```sh
+yarn createComponent
+```
+
+- `packageName`: name of which package the component will be published to (`@lightningjs/ui-components` or `@lightningjs/ui-components`)
+- `componentName`: name of component to be added
+
+Example: add a new component, `MyComponent`, to the `@lightningjs/ui-components` package
+
+```sh
+yarn createComponent @lightningjs/ui-components MyComponent
+```
+
+This will create the following files:
+
+```
+/
+└── packages
+ └── @lightning
+ └── ui-components
+ └── src
+ └── components
+ └── MyComponent
+ ├── index.js
+ ├── MyComponent.d.ts
+ ├── MyComponent.mdx
+ ├── MyComponent.stories.js
+ ├── MyComponent.styles.js
+ └── MyComponent.test.js
+```
+
+### Pull Requests
+
+NOTE: Before RDK accepts your code into the project you must sign the RDK Contributor License Agreement (CLA).
+
+The process described here has several goals:
+
+- Maintain `@lightningjs/ui-components`'s quality
+- Fix problems that are important to users
+- Engage the community in working toward the best possible `@lightningjs/ui-components`
+- Enable a sustainable system for `@lightningjs/ui-components` maintainers to review contributions
+
+Please follow these steps to have your contribution considered by the maintainers:
+
+1. When creating a pull request, fill out the default template. Include as much detail as possible, the changes made in the pull request and how to best approach testing the changes
+2. Follow the [style guides](#style-guides)
+3. Follow the [new component guide](#new-component) if you are submitting a new component
+4. After you submit your pull request, verify that all [status checks](https://help.github.com/articles/about-status-checks/) are passing What if the status checks are failing?
If a status check is failing, and you believe that the failure is unrelated to your change, please leave a comment on the pull request explaining why you believe the failure is unrelated. A maintainer will re-run the status check for you. If we conclude that the failure was a false positive, then we will open an issue to track that problem with our status check suite.
+
+While the prerequisites above must be satisfied prior to having your pull request reviewed, the reviewer(s) may ask you to complete additional design work, tests, or other changes before your pull request can be ultimately accepted.
+
+## Style Guides
+
+### TypeScript
+
+As of version 2.7.0, Lightning Core comes bundled with type definitions and in-code documentation which allow you to build Lightning apps in [TypeScript](https://www.typescriptlang.org/). The following [documentation](https://lightningjs.io/docs/#/lightning-core-reference/TypeScript/index) assumes that you are already familiar with the basics of writing a Lightning app in JavaScript. Even if you have no Lightning experience, the tips below, the Lightning CLI lng create boilerplate (coming soon), and the types documentation available now in your IDE will be enough to get started.
+
+TypeScript compilation is supported out of the box by Lightning CLI as of version v2.8.0.
+
+Per TypeScript standards all types should be in PascalCase, similar to our class definitions
+
+### Git Commit Messages
+
+**IMPORTANT**: `@lightningjs/ui-components` releases are automatically triggered on merge to the `release` branch (and possibly other release branches like `next`). The new version number is determined by [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) which are enforced through [husky](https://github.com/typicode/husky) pre-commit hooks. Read through this section carefully because it will directly impact semantic versioning.
+
+This is the message template:
+
+```
+[optional scope]:
+
+[optional body]
+
+[optional footer(s)]
+```
+
+**Breaking Changes**
+
+If your feature includes a breaking change (i.e. changes a component API), be sure to add `BREAKING CHANGE` to the body of the commit message
+
+Example:
+
+```
+feat(Button): change focus behavior
+
+BREAKING CHANGE
+```
+
+**Types**
+
+Example: `feat: `
+
+- `feat:` new feature or enhancement
+- `fix:` bug fix
+- `chore:` repo maintenance
+- `docs:` update documentation
+- `test:` test-related changes
+
+**Scope**
+
+Example: `fix(Button): `
+
+Use scope to specify which component your changes are related to.
+
+**Description**
+
+Example: `feat(Button): add key-down handler`
+
+- Start description with lower-case letter ("do something" not "Do something")
+- Use the present tense ("add feature" not "added feature")
+- Use the imperative mood ("move cursor to..." not "the cursor was moved to...")
+- Limit the first line to 72 characters or less
+- Reference issues and pull requests liberally in the body
+- When only changing documentation, include `[ci skip]` in the commit title
+
+### JavaScript Style Guide
+
+`@lightningjs/ui-components` enforces [the Prettier style guide](https://prettier.io/) through [husky](https://github.com/typicode/husky) pre-commit hooks.
+
+To run the linter manually:
+
+```sh
+yarn lint
+
+# to auto-fix lint errors
+yarn lint:fix
+```
+
+### Test Style Guide
+
+`@lightningjs/ui-components` enforces [Jest](https://jestjs.io/en/) test coverage of changes through [husky](https://github.com/typicode/husky) pre-commit hooks. 90% coverage of statements, functions and lines are required.
+
+To run tests manually:
+
+```sh
+# will run tests against both lightning/ui, lightning/ui-core, and lightning/ui-extensions
+yarn test
+
+# to run in watch mode
+yarn workspace @lightningjs/ui-components test --watch
+```
+
+## `spyOnMethods`
+
+spyOnMethods is an optional array that may be passed to `makeCreateComponent` via the `defaultOptions` or `options` object. Doing so will extend the component being tested and provide methods that use Jest spies to create mock functions for each method included in the `spyOnMethods` array. Each spy method created is a Promise, which resolves after the spied upon method is invoked, and can be awaited in tests.
+
+The most common usage of this is to await the completion of the `_update` method in a component being invoked after changes to a component.
+
+Example below:
+
+```js
+it('should stop loading once title is set', async () => {
+ [Button, testRenderer] = createButton({}, { spyOnMethods: ['_update'] });
+ // ensure _update has completed on the initial render of the component
+ await Button.__updateSpyPromise;
+
+ expect(Button._loading.isPlaying()).toBe(true);
+
+ // ensure _update has completed after the title property has been changed
+ Button.title = 'Action Button';
+ await Button.__updateSpyPromise;
+
+ // assertions may now be made on the state of the component after _update has been called
+ expect(Button._loading.isPlaying()).toBe(false);
+});
+```
+
+### Documentation Style Guide
+
+Component documentation is covered through a combination of `.mdx` and `.stories.js` files within each component directory. This guide is intended to help you understand how to add [usage documentation](#usage-documentation), [API documentation](#api-documentation), and [live examples](#live-examples).
+
+**Live Examples**
+
+
+
+Live examples are driven by [Storybook](https://storybook.js.org/) stories, and live in `//.stories.js`. If you generated a new component with `yarn createComponent`, a template layout should exist for your component.
+
+If you are contributing to an existing component, follow the patterns established there. Adding a story looks like this:
+
+```js
+export const StoryName = () =>
+ class StoryName extends lng.Component {
+ static _template() {
+ return {
+ MyComponent: {
+ type: MyComponent
+ }
+ };
+ }
+ };
+```
+
+Run Storybook to see your live examples:
+
+```sh
+yarn start
+```
+
+Storybook will generate an ID for each story that follows the pattern `componentname--storyname`. You can use this ID to embed examples when [documenting usage](#usage-documentation).
+
+**Storybook**
+
+
+
+This section is dedicated to some specifics around our implementation of [Storybook](https://storybook.js.org), which is using Storybook v6.0. If you are new to Storybook (or even 6.0), we highly recommend you check out their [updated documentation](https://storybook.js.org/docs/react/writing-stories/introduction).
+
+You can add interactivity to your documentation with **args**. For the purposes of this project, you will likely only encounter **actions** and **controls**. We're going to walk through a simple example to illustrate the concepts that are necessary to understand for writing stories in the project.
+
+Let's take a simple `Button` component. The `Button` accepts a `title` property and an `onEnter` callback.
+
+Our static story would look something like this:
+
+```js
+import lng from '@lightningjs/core';
+import Button from './Button';
+
+export default {
+ title: 'Button'
+};
+
+export const Basic = args =>
+ class Basic extends lng.Component {
+ static _template() {
+ return {
+ Button: {
+ type: 'Button',
+ title: args.title,
+ onEnter: args.onEnter
+ }
+ };
+ }
+
+ _getFocused() {
+ return this.tag('Button');
+ }
+ };
+```
+
+We can re-work this to support `args` so our users can set their own `title` in the **Controls** tab and the `'onEnter'` log in the **Actions** tab.
+
+```js
+export const Basic = args =>
+ class Basic extends lng.Component {
+ static _template() {
+ return {
+ Button: {
+ type: 'Button',
+ title: args.title,
+ onEnter: args.onEnter
+ }
+ };
+ }
+
+ _getFocused() {
+ return this.tag('Button');
+ }
+ };
+Basic.args = { title: 'Hello' };
+Basic.argTypes = {
+ onEnter: { action: 'onEnter' },
+ title: { control: 'text' }
+};
+```
+
+There are a few new concepts here: **args**, **argTypes**, **action**, and **control**.
+
+Let's break down **argTypes** first. Defining **argTypes** on the story function is how Storybook knows the controls and actions. `onEnter: { action: 'onEnter' }` tells Storybook to set `args.onEnter` as a function with the label `'onEnter'`. `title: { control: 'text' }` tells Storybook to create a text input **control** for `args.title`.
+
+Shifting focus to **args**, we can see that we have a definition for `'title'` but not for `'onEnter'`. Setting the **args** object on a story function tells Storybook what the _default values_ will be for controls defined in **argTypes**.
+
+Check out the [args docs](https://storybook.js.org/docs/react/writing-stories/args) and [essential addons docs](https://storybook.js.org/docs/react/essentials/introduction) for additional details.
+
+Now, let's say you want to execute some side effect when an arg value changes. To do this, we're going to introduce a new concept that _is not explicitly a part of Storybook_, `parameters.argActions`.
+
+You can use `argActions` to define functions to execute on changes to an arg. Let's do this for `title`:
+
+```js
+Basic.parameters = {
+ argActions: {
+ title: (title, storyComponent) => {
+ console.log('Setting title...');
+ storyComponent.tag('Button').title = title;
+ }
+ }
+};
+```
+
+In this example, the console will display `'Setting title...'` every time a user changes the value of the `title` control.
+
+The callback accepts three arguments:
+
+- `argValue: any` - current value of the given arg key
+- `storyComponent: lng.Component` - instance of returned class in the story
+- `args: Object` - complete args object passed into the Story function (the exported anonymous function all of the stories contain)
+
+The render logic for story previews lives in `./.storybook/preview.js`
+
+**Usage Documentation**
+
+
+
+Usage documentation lives in `//.mdx`. [MDX](https://mdxjs.com/) allows you to combine [markdown](https://daringfireball.net/projects/markdown/syntax) and [React JSX](https://reactjs.org/docs/introducing-jsx.html) syntax within the same file!
+
+If you generated a new component with `yarn createComponent`, a template layout should exist for your component. If you are contributing to an existing component, follow the patterns established there. Adding usage steps should look like this example:
+
+```js
+import { Canvas, Story } from '@storybook/addon-docs';
+import from '.';
+
+// title, description, etc. (eg # )
+
+## Usage
+
+Implementation description here
+
+
+// example implementation
+import lng from '@lightningjs/core';
+import { MyComponent } from '@lightningjs/ui-components';
+
+class Example extends lng.Component {
+ static _template() {
+ return {
+ type: MyComponent
+ };
+ }
+}
+
+// Embed live example from Storybook
+
+```
+
+The `