### Installing Dependencies and Starting the Development Server
Source: https://github.com/kajabi/pine/blob/main/libs/core/readme.md
Installs the necessary npm packages for the Stencil component and starts the development server.
```bash
npm install
npm start
```
--------------------------------
### Starting the development server
Source: https://github.com/kajabi/pine/blob/main/CONTRIBUTING.md
This command starts a local development server for testing changes in the Pine Design System. A local instance of Storybook will be served at `http://localhost:6006`.
```zsh
npm run start
```
--------------------------------
### Installing rollup-plugin-copy
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/guides/assets.docs.mdx
Install the rollup-plugin-copy plugin using npm. This plugin allows copying files and folders during the build process.
```sh
npm install rollup-plugin-copy -D
```
--------------------------------
### Creating a new branch with conventional naming
Source: https://github.com/kajabi/pine/blob/main/CONTRIBUTING.md
This example demonstrates the conventional branch naming convention used in the Pine Design System. Branches that don't adhere to this style won't be able to be pushed, so be sure your branch begins with one of the accepted prefixes.
```zsh
style/button-accent-update
```
--------------------------------
### Install Pine React Components
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/introduction/welcome.docs.mdx
Install the Pine React components via npm to use them within React projects.
```Shell
npm install @pine-ds/react
```
--------------------------------
### Core Token Examples
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/tokens.docs.mdx
Examples of core tokens, which represent the most basic values like colors and font sizes. These tokens should be used sparingly in code.
```text
color.purple.500: #6B62F2;
font-size.100: 14px;
```
--------------------------------
### Importing Component in Stencil App
Source: https://github.com/kajabi/pine/blob/main/libs/core/readme.md
Install the component as a node module and import it into a stencil-starter app.
```javascript
import my-component;
```
--------------------------------
### Installing Pine React Package
Source: https://github.com/kajabi/pine/blob/main/README.md
Installs the Pine Design System React package using npm. This is required to use the components within React projects.
```bash
npm install @pine-ds/react
```
--------------------------------
### Semantic Token Examples
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/tokens.docs.mdx
Examples of semantic tokens, which reference core tokens and are used to apply styles in specific contexts. These tokens drive component styling and are intended for liberal use.
```text
color.accent: {color.purple.500}
font-size.default: {font-size.100}
```
--------------------------------
### Import Storybook Blocks
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/stories/pds-input.docs.mdx
Imports necessary components from the @storybook/blocks library for creating documentation and interactive examples within Storybook.
```JavaScript
import { Meta, Canvas, Controls } from '@storybook/blocks';
```
--------------------------------
### Component Token Example
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/tokens.docs.mdx
Example of a component-level token, which is defined and used locally within a component for component-specific styling.
```text
chip.color.accent: {color.purple.100};
```
--------------------------------
### New Dimension Token Example
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/tokens.docs.mdx
Example of creating a new dimension token for 72px using the provided formula, resulting in a token with a value of 900.
```css
--pine-dimension-900: 72px
```
--------------------------------
### Dimension Token Example
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/tokens.docs.mdx
Example of a dimension token in the Pine design system, representing a base dimension of 8px.
```css
--pine-dimension-100
```
--------------------------------
### Initializing Default Chip Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-chip/docs/pds-chip.mdx
This example demonstrates the basic usage of the Chip component with a default label. It shows how to render a simple chip element in both React and Web Component formats.
```react
Label
```
```webComponent
Label
```
--------------------------------
### Using Component via Node Modules
Source: https://github.com/kajabi/pine/blob/main/libs/core/readme.md
Install the component as a node module and include it in a web page using a script tag that points to the component's esm.js file in node_modules.
```html
```
--------------------------------
### Display Documentation with MDX
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-popover/stories/pds-popover.docs.mdx
Renders the documentation imported from the MDX file. This allows for rich text, examples, and other content to be displayed alongside the component stories.
```jsx
```
--------------------------------
### CSS with Core Tokens
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/tokens.docs.mdx
Example of CSS using core tokens directly for background colors. This approach requires separate updates for each component.
```css
/* Card */
background-color: var(--pine-color-white);
/* Table */
background-color: var(--pine-color-white);
/* Box */
background-color: var(--pine-color-white);
```
--------------------------------
### Initializing PdsSelect with Helper Message (Web Component)
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-select/docs/pds-select.mdx
This example shows how to initialize a PdsSelect web component with a helper message. The helper message provides additional context or instructions to the user below the select component. The component uses the `helper-message` attribute to display the message.
```Web Component
```
--------------------------------
### Include Pine Core CSS and JavaScript
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/introduction/welcome.docs.mdx
Include the necessary CSS and JavaScript files directly in your project using and
```
--------------------------------
### Linting all files
Source: https://github.com/kajabi/pine/blob/main/CONTRIBUTING.md
This command runs the prettier linter on all files in the Pine Design System. It ensures that the code adheres to the defined coding standards.
```zsh
npm run lint.all
```
--------------------------------
### Importing Documentation from MDX
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-copytext/stories/pds-copytext.docs.mdx
Imports the documentation for the PDS Copytext component from an MDX file. This allows the documentation to include detailed information and examples.
```JavaScript
import Docs from '../docs/pds-copytext.mdx';
```
--------------------------------
### Storybook Meta Configuration
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/resources/support.docs.mdx
Configures Storybook metadata for the 'Get Support' resource, hiding the canvas tab in the preview.
```jsx
```
--------------------------------
### Initializing PdsSelect with Autocomplete (Web Component)
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-select/docs/pds-select.mdx
This example shows how to initialize a PdsSelect web component with the autocomplete feature enabled. The `autocomplete` attribute is set to `on`, allowing browsers to suggest previously entered values, improving the user's input experience.
```Web Component
```
--------------------------------
### Primary Button Examples - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Illustrates the usage of the primary button variant with different states (default, disabled, and with an icon) using web components. It showcases the basic implementation and customization options.
```html
PrimaryDisabledIcon
```
--------------------------------
### Import PDS Text Stories
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-text/stories/pds-text.docs.mdx
Imports all stories related to the PDS Text component from the './pds-text.stories.js' file. These stories are used to generate the interactive examples and playground.
```JavaScript
import * as stories from './pds-text.stories.js';
```
--------------------------------
### Initializing PdsSelect with Helper Message (React)
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-select/docs/pds-select.mdx
This example shows how to initialize a PdsSelect component with a helper message. The helper message provides additional context or instructions to the user below the select component. The component uses the `helper-message` prop to display the message.
```React
```
--------------------------------
### Secondary Button Examples - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Illustrates the usage of the secondary button variant with different states (default, disabled, and with an icon) using web components. It showcases the basic implementation and customization options.
```html
SecondaryDisabledIcon
```
--------------------------------
### Displaying a Default Image with PdsImage
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-image/docs/pds-image.mdx
Demonstrates how to display a default image using the PdsImage component with a source URL and alt text for accessibility. The example shows both the React and web component implementations.
```react
```
```webComponent
```
```HTML
```
--------------------------------
### Accent Button Examples - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Illustrates the usage of the accent button variant with different states (default, disabled, and with an icon) using web components. It showcases the basic implementation and customization options.
```html
AccentDisabledIcon
```
--------------------------------
### Generating a new component
Source: https://github.com/kajabi/pine/blob/main/CONTRIBUTING.md
This command generates the initial component files for a new component in the Pine Design System. After running this command, you will need to update the generated files to match other components.
```zsh
npm run stencil.generate pds-[component name]
```
--------------------------------
### Helper Message Input Example - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Shows an input field with a helper message using web components. The `helper-message` attribute provides additional information or instructions to the user. The `type` is set to `email`.
```HTML
```
--------------------------------
### Initializing PdsSelect with Autocomplete (React)
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-select/docs/pds-select.mdx
This example shows how to initialize a PdsSelect component with the autocomplete feature enabled. The `autocomplete` prop is set to `on`, allowing browsers to suggest previously entered values, improving the user's input experience.
```React
```
--------------------------------
### Primary Button Examples - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Illustrates the usage of the primary button variant with different states (default, disabled, and with an icon) in a React environment. It showcases the basic implementation and customization options.
```jsx
PrimaryDisabledIcon
```
--------------------------------
### Configuring Vite with rollup-plugin-copy
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/guides/assets.docs.mdx
Configure Vite to copy Pine Design System assets from the 'node_modules' folder to the 'public' folder using the rollup-plugin-copy plugin. This ensures that Vite bundles the assets.
```typescript
// vite.config.ts
import { defineConfig } from 'vite'
import copy from 'rollup-plugin-copy'
export default defineConfig({
plugins: [
copy({
targets: [
{
src: 'node_modules/@pine-ds/core/dist/pine-core/svg/*',
dest: 'public/assets/pine-ds/svg',
},
],
hook: 'buildStart',
}),
// ...other plugins e.g. react()
],
// ...other config options
})
```
--------------------------------
### Secondary Button Examples - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Illustrates the usage of the secondary button variant with different states (default, disabled, and with an icon) in a React environment. It showcases the basic implementation and customization options.
```jsx
SecondaryDisabledIcon
```
--------------------------------
### Default Text Input Example - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Demonstrates the default text input with a label and a pre-filled value using web components. The `type` is set to `text`, allowing any single-line data. The `label` provides context for the input field.
```HTML
```
--------------------------------
### Helper Message Input Example - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Shows an input field with a helper message. The `helperMessage` attribute provides additional information or instructions to the user. The `type` is set to `email`.
```React
```
--------------------------------
### Building the Component for Production
Source: https://github.com/kajabi/pine/blob/main/libs/core/readme.md
Builds the Stencil component for production, creating optimized and distributable files.
```bash
npm run build
```
--------------------------------
### Rebasing a branch against main
Source: https://github.com/kajabi/pine/blob/main/CONTRIBUTING.md
These commands rebase your feature branch against the main branch and resolve any conflicts. This ensures that your changes are based on the latest version of the codebase.
```zsh
git checkout your/branch-name
git rebase main
```
--------------------------------
### Cloning the Stencil Component Starter
Source: https://github.com/kajabi/pine/blob/main/libs/core/readme.md
Clones the Stencil component starter repository to a new directory, navigates into the directory, and removes the origin remote.
```bash
git clone https://github.com/ionic-team/stencil-component-starter.git my-component
cd my-component
git remote rm origin
```
--------------------------------
### Accent Button Examples - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Illustrates the usage of the accent button variant with different states (default, disabled, and with an icon) in a React environment. It showcases the basic implementation and customization options.
```jsx
AccentDisabledIcon
```
--------------------------------
### Running Unit Tests
Source: https://github.com/kajabi/pine/blob/main/libs/core/readme.md
Executes the unit tests for the Stencil components to ensure code quality and functionality.
```bash
npm test
```
--------------------------------
### Rendering Chip Component as Dropdown
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-chip/docs/pds-chip.mdx
This example demonstrates how to render the Chip component in a dropdown style by setting the `variant` property to `"dropdown"`. It showcases various sentiment options with the dropdown variant in both React and Web Component formats.
```react
AccentDangerInfoNeutralSuccessWarning
```
```webComponent
AccentDangerInfoNeutralSuccessWarning
```
--------------------------------
### Running spec and e2e tests
Source: https://github.com/kajabi/pine/blob/main/CONTRIBUTING.md
This command runs both spec and end-to-end (E2E) tests in the Pine Design System. It is used for quality assurance to ensure that new features and changes are well-tested.
```zsh
npm run test.all
```
--------------------------------
### Default Text Input Example - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Demonstrates the default text input with a label and a pre-filled value. The `type` is set to `text`, allowing any single-line data. The `label` provides context for the input field.
```React
```
--------------------------------
### Using Component via Script Tag
Source: https://github.com/kajabi/pine/blob/main/libs/core/readme.md
Include the component in a web page using a script tag that points to the component's esm.js file hosted on a CDN.
```html
```
--------------------------------
### Placeholder Email Input Example - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Demonstrates an email input with a placeholder text using web components. The `placeholder` attribute provides a hint to the user about the expected input format. The `type` is set to `email` for email validation.
```HTML
```
--------------------------------
### Placeholder Email Input Example - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Demonstrates an email input with a placeholder text. The `placeholder` attribute provides a hint to the user about the expected input format. The `type` is set to `email` for email validation.
```React
```
--------------------------------
### PDS Input Error Example in HTML
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
This HTML example demonstrates how to use the `invalid` attribute to display an error message for an invalid email address. The `error-message` attribute is used to specify the error message to be displayed.
```HTML
```
--------------------------------
### Default Accordion Implementation
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-accordion/docs/pds-accordion.mdx
This example demonstrates the default Accordion component with no slots set, rendering a default trigger label and no panel content. It showcases the basic implementation in both React and Web Component formats.
```React
```
```Web Component
```
--------------------------------
### PDS Input Error Example in React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
This React example demonstrates how to use the `invalid` prop to display an error message for an invalid email address. The `errorMessage` prop is used to specify the error message to be displayed.
```React
```
--------------------------------
### PDS Input Error Example as Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
This Web Component example demonstrates how to use the `invalid` attribute to display an error message for an invalid email address. The `error-message` attribute is used to specify the error message to be displayed.
```HTML
```
--------------------------------
### Handling pdsCheckboxChange event in Vanilla JS
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/guides/events.docs.mdx
This example demonstrates how to listen for the `pdsCheckboxChange` event on a `pds-checkbox` element using Vanilla JavaScript. It attaches an event listener to the element with the ID 'example' and logs a message to the console when the event is triggered.
```html
```
--------------------------------
### Initializing PdsSelect with Multiple Selection in Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-select/docs/pds-select.mdx
This example shows how to initialize the PdsSelect component with the `multiple` attribute enabled in a Web Component. When the `multiple` attribute is enabled, the `value` property should be an array of selected values. The component allows users to select multiple options from the list.
```html
```
--------------------------------
### Initializing Preset Size Loader - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-loader/docs/pds-loader.mdx
This snippet initializes a Loader web component with a preset size. The `is-loading` attribute is set to true, `size` is set to "xs", and the `variant` attribute is set to "spinner".
```Web Component
```
--------------------------------
### CSS with Semantic Tokens
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/tokens.docs.mdx
Example of CSS using semantic tokens for background colors. Updating the semantic token updates all components referencing it.
```css
/* Card */
background-color: var(--pine-color-background-container);
/* Table */
background-color: var(--pine-color-background-container);
/* Box */
background-color: var(--pine-color-background-container);
```
--------------------------------
### Implementing Responsive Images with Srcset and Sizes
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-image/docs/pds-image.mdx
Illustrates how to implement responsive images using the PdsImage component with the srcset and sizes attributes. This allows the browser to select the appropriate image based on viewport size, optimizing performance and user experience.
```react
```
```webComponent
```
```HTML
```
--------------------------------
### Creating Transaction Boxes Layout with Web Components
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/guides/layout.docs.mdx
This HTML code snippet demonstrates the creation of a similar layout using web components. It utilizes pds-box, pds-row, and pds-icon to structure the content. The layout includes three transaction boxes with titles, transaction counts, and icons, mirroring the React example.
```HTML
Transactions
0Successful transactions
Transactions
0Successful transactions
Transactions
0Successful transactions
```
--------------------------------
### Disclosure Button Variant
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Demonstrates the disclosure button variant for toggling the visibility of content. Includes examples with enabled and disabled states.
```webComponent
DisclosureDisabled
```
--------------------------------
### Importing Storybook and Doc Components
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/core/box-shadow.docs.mdx
This code imports necessary modules from Storybook and a custom documentation component library. It imports Meta and Story from '@storybook/blocks' for defining Storybook stories and DocTokenTable from '@pine-ds/doc-components' for rendering a table of design tokens.
```JavaScript
import { Meta, Story } from '@storybook/blocks';
import {DocTokenTable} from '@pine-ds/doc-components';
```
--------------------------------
### Adding Pine via CDN
Source: https://github.com/kajabi/pine/blob/main/README.md
Adds Pine Design System to a project via CDN. Include the stylesheet and script tags in the
of the HTML document. Replace [VERSION] with the desired version number or 'latest'.
```HTML
```
--------------------------------
### Disclosure Button Variant
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Demonstrates the disclosure button variant for toggling the visibility of content. Includes examples with enabled and disabled states.
```react
DisclosureDisabled
```
--------------------------------
### Icon Only Button Variant
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Demonstrates the icon-only button variant, which displays only an icon. Includes examples with primary, secondary, accent, and destructive variants.
```webComponent
Icon OnlyIcon OnlyIcon OnlyIcon Only
```
--------------------------------
### Initializing Visible Label Loader - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-loader/docs/pds-loader.mdx
This snippet initializes a Loader web component with a visible label. The `is-loading` attribute is set to true, `show-label` is set to true, and the `variant` attribute is set to "spinner".
```Web Component
```
--------------------------------
### Icon Only Button Variant
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Demonstrates the icon-only button variant, which displays only an icon. Includes examples with primary, secondary, accent, and destructive variants.
```react
Icon Only
Icon Only
Icon OnlyIcon Only
```
--------------------------------
### Custom Avatar Size
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-avatar/docs/pds-avatar.mdx
Illustrates how to customize the size of the avatar using the `size` property. This example sets the size to `128px` in both React and Web Components.
```React
```
```Web Components
```
--------------------------------
### Text Alignment - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-text/docs/pds-text.mdx
Shows how to align text within the PdsText component using the `align` prop in a React environment. The example aligns the text to the center.
```javascript
"Had to be me. Someone else might have gotten it wrong."
```
--------------------------------
### Initializing Default Loader - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-loader/docs/pds-loader.mdx
This snippet initializes a default Loader component as a web component with the `is-loading` attribute set to true, displaying a spinner. The `variant` attribute is set to "spinner".
```Web Component
```
--------------------------------
### Borderless Copy Text - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-copytext/docs/pds-copytext.mdx
This example shows the copy text component without a border. The `border` prop is set to `false` to remove the border.
```React
```
--------------------------------
### Updating main branch
Source: https://github.com/kajabi/pine/blob/main/CONTRIBUTING.md
These commands update the local main branch with the latest changes from the upstream repository. This is a prerequisite for rebasing your feature branch.
```zsh
git checkout main
git pull upstream main
```
--------------------------------
### Importing Storybook and Doc Components
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/core/colors.docs.mdx
Imports necessary modules from Storybook and a custom documentation component library. Meta and Story are from '@storybook/blocks', and DocTokenTable is from '@pine-ds/doc-components'.
```javascript
import { Meta, Story } from '@storybook/blocks';
import {DocTokenTable} from '@pine-ds/doc-components';
```
--------------------------------
### Initializing Default PdsSelect Component - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-select/docs/pds-select.mdx
This code initializes a default PdsSelect component as a web component with a label and a set of options. The component allows users to select one of the predefined options from the dropdown list. The 'value' attribute sets the initially selected option.
```Web Component
```
--------------------------------
### Default Checkbox Implementation - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-checkbox/docs/pds-checkbox.mdx
Demonstrates the basic implementation of a PdsCheckbox component in React with a default label. This example shows how to create a simple, unchecked checkbox.
```jsx
```
--------------------------------
### Include Documentation
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/stories/pds-input.docs.mdx
Includes the imported MDX documentation within the Storybook page, displaying the component's documentation and usage guidelines.
```MDX
```
--------------------------------
### Destructive Button Variant
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Demonstrates the destructive button variant for actions like deleting or removing items. Includes examples with and without icons, and a disabled state.
```webComponent
DestructiveDisabledIcon
```
--------------------------------
### Destructive Button Variant
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/docs/pds-button.mdx
Demonstrates the destructive button variant for actions like deleting or removing items. Includes examples with and without icons, and a disabled state.
```react
DestructiveDisabledIcon
```
--------------------------------
### Render Canvas Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-text/stories/pds-text.docs.mdx
Renders the Canvas component, which displays a live, interactive example of the 'Default' story from the imported stories. This allows users to see the component in action.
```MDX
```
--------------------------------
### Initializing Custom Size Loader - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-loader/docs/pds-loader.mdx
This snippet initializes a Loader web component with a custom size. The `is-loading` attribute is set to true, `size` is set to "128px", and the `variant` attribute is set to "spinner".
```Web Component
```
--------------------------------
### Text Alignment - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-text/docs/pds-text.mdx
Shows how to align text within the PdsText component using the `align` prop in a web component environment. The example aligns the text to the center.
```html
"Had to be me. Someone else might have gotten it wrong."
```
--------------------------------
### Initializing Typing Loader - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-loader/docs/pds-loader.mdx
This snippet initializes a Loader web component with the `typing` variant. The `is-loading` attribute is set to true, and the `variant` attribute is set to "typing".
```Web Component
```
--------------------------------
### Default Horizontal Divider - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-divider/docs/pds-divider.mdx
This example demonstrates the default horizontal divider using the PdsDivider React component. It displays a simple horizontal line to visually separate content.
```React
```
--------------------------------
### Box with Border Color - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-box/docs/pds-box.mdx
Demonstrates how to change the border color of the Box component using the `border-color` property in React. Several examples are provided with different color values.
```React
Border ColorBorder ColorBorder ColorBorder Color
```
--------------------------------
### Import PDS Chip Documentation
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-chip/stories/pds-chip.docs.mdx
Imports the documentation for the PDS Chip component from the '../docs/pds-chip.mdx' file. This documentation is written in MDX format and provides detailed information about the component's usage and properties.
```javascript
import Docs from '../docs/pds-chip.mdx';
```
--------------------------------
### Admin Avatar Variant
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-avatar/docs/pds-avatar.mdx
Shows the admin avatar variant, which features less-rounded borders for distinction. This example illustrates how to set the `variant` property to `admin` in both React and Web Components.
```React
```
```Web Components
```
--------------------------------
### Switch with Helper Message - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-switch/docs/pds-switch.mdx
Illustrates how to display a helper message under the switch label using the `helper-message` property in the web component.
```HTML
```
--------------------------------
### Setting Asset Path in Window Object
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/guides/assets.docs.mdx
Specify the asset path by setting the `__PINE_ASSET_PATH__` variable on the `window` object. This is particularly useful in server-side rendering contexts.
```typescript
// main.tsx
// if-clause only required in server-side rendering context
if (typeof window !== 'undefined') {
window.__PINE_ASSET_PATH__ = '/assets/pine-ds/'
}
```
--------------------------------
### Import PDS Button Documentation
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/stories/pds-button.docs.mdx
Imports the MDX documentation file for the PDS Button component. This file likely contains detailed information about the component's usage, props, and design guidelines.
```javascript
import Docs from '../docs/pds-button.mdx';
```
--------------------------------
### Default Horizontal Divider - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-divider/docs/pds-divider.mdx
This example demonstrates the default horizontal divider using the pds-divider web component. It displays a simple horizontal line to visually separate content.
```HTML
```
--------------------------------
### Initializing Default Radio Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-radio/docs/pds-radio.mdx
This snippet demonstrates how to initialize a default Radio component with a label. It shows the basic implementation in both React and Web Components.
```React
```
```Web Components
```
--------------------------------
### Include Documentation
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-button/stories/pds-button.docs.mdx
Includes the imported MDX documentation within the Storybook page. This renders the content of the MDX file, providing detailed information about the component.
```mdx
```
--------------------------------
### Row Wrapping with React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-row/docs/pds-row.mdx
Illustrates how `PdsBox` components wrap to the next line within a `PdsRow` when the sum of their `size-xs` values exceeds 12. The example uses `size-xs` values of 4 and 10.
```JavaScript
size-xs 4size-xs 10
```
--------------------------------
### Default Switch Implementation - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-switch/docs/pds-switch.mdx
Demonstrates the default switch style using the web component. It behaves like a standard checkbox input with a label.
```HTML
```
--------------------------------
### Offset Vertical Divider - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-divider/docs/pds-divider.mdx
This example demonstrates how to create a vertical divider with an offset using the PdsDivider React component. The `offset` prop is set to `lg` (large), and `vertical` is set to `true`.
```React
```
--------------------------------
### Offset Horizontal Divider - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-divider/docs/pds-divider.mdx
This example demonstrates how to create a horizontal divider with an offset using the PdsDivider React component. The `offset` prop is set to `lg` (large), which applies a spacing of 32px.
```React
```
--------------------------------
### Using Pine Component in React
Source: https://github.com/kajabi/pine/blob/main/README.md
Demonstrates how to use a Pine component within a React file. Components should follow PascalCase to match React component convention.
```HTML
```
--------------------------------
### Box with Border Color - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-box/docs/pds-box.mdx
Demonstrates how to change the border color of the Box component using the `border-color` property in a Web Component. Several examples are provided with different color values.
```WebComponent
Border ColorBorder ColorBorder ColorBorder Color
```
--------------------------------
### Row Wrapping with Web Components
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-row/docs/pds-row.mdx
Illustrates how `pds-box` components wrap to the next line within a `pds-row` when the sum of their `size-xs` values exceeds 12. The example uses `size-xs` values of 4 and 10.
```HTML
size-xs 4size-xs 10
```
--------------------------------
### Import PDS Popover Documentation
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-popover/stories/pds-popover.docs.mdx
Imports the PDS Popover documentation from the specified MDX file. This documentation likely contains detailed information about the component's props, usage, and behavior.
```javascript
import Docs from '../docs/pds-popover.mdx';
```
--------------------------------
### Readonly Email Input Example - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Demonstrates a readonly email input field. The `readonly` attribute prevents modification of the input value, but the value is still submitted with the form. The `type` is set to `email`.
```React
```
--------------------------------
### Initializing Default Progress Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-progress/docs/pds-progress.mdx
This snippet initializes a default Progress component with a label and a fixed percentage. The `percent` value is set to 15 for demonstration purposes to make the progress bar visible.
```react
```
```webComponent
```
--------------------------------
### Importing Meta and Story from Storybook
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/stories/tokens/core/spacing.docs.mdx
Imports the Meta and Story components from the @storybook/blocks library. These components are used for structuring and defining stories within Storybook.
```JavaScript
import { Meta, Story } from '@storybook/blocks';
```
--------------------------------
### Disabled Email Input Example - React
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-input/docs/pds-input.mdx
Shows a disabled email input field. The `disabled` attribute prevents user interaction and provides a visual indication of its disabled state. The `type` is set to `email`.
```React
```
--------------------------------
### Using docCanvas Component
Source: https://github.com/kajabi/pine/blob/main/libs/doc-components/readme.md
This code snippet demonstrates how to use the `DocCanvas` component to display source code snippets for a component in different formats (React and Web Component). It imports the `DocCanvas` component and provides an `mdxSource` object containing the source code for each format. The component then renders the specified component within the canvas.
```JavaScript
import { DocCanvas } from '@pine-ds/doc-components';
`,
webComponent: ``
}}>
```
--------------------------------
### Offset Vertical Divider - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-divider/docs/pds-divider.mdx
This example demonstrates how to create a vertical divider with an offset using the pds-divider web component. The `offset` attribute is set to `lg` (large), and `vertical` is set to `true`.
```HTML
```
--------------------------------
### Offset Horizontal Divider - Web Component
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-divider/docs/pds-divider.mdx
This example demonstrates how to create a horizontal divider with an offset using the pds-divider web component. The `offset` attribute is set to `lg` (large), which applies a spacing of 32px.
```HTML
```
--------------------------------
### Creating a Compact Table with Web Components
Source: https://github.com/kajabi/pine/blob/main/libs/core/src/components/pds-table/docs/pds-table.mdx
This code snippet demonstrates how to create a compact table using Web Components. The `pds-table` component is used with the `compact` attribute to reduce row spacing. The table includes a header and body with sample data.
```Web Component
Column TitleColumn TitleColumn TitleRow Item AlphaRow Item BetaRow Item CharlieRow Item AlphaRow Item BetaRow Item CharlieRow Item AlphaRow Item BetaRow Item Charlie
```