Skip to content

Commit

Permalink
Merge pull request #41 from undone-labs/feat-plugins-docs
Browse files Browse the repository at this point in the history
feat: plugins docs
  • Loading branch information
timelytree authored Sep 30, 2024
2 parents 99bc8dc + 3bddfea commit dce7090
Show file tree
Hide file tree
Showing 30 changed files with 647 additions and 520 deletions.
1 change: 1 addition & 0 deletions package-lock.json

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

11 changes: 11 additions & 0 deletions packages/docs/.vitepress/theme/assets/scss/markdown.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
h1 {
&:not(:first-child) {
padding-top: toRem(28);
margin-top: 3.75rem;
border-top: 1px solid var(--vp-c-divider);
a {
transform: translateY(toRem(32));
}
}
}

h4 {
margin-top: toRem(48) !important;
}
Expand Down
6 changes: 3 additions & 3 deletions packages/docs/content/zero-core/composables/highlight-code.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a name="zeroHighlightCode"></a>
#### zeroHighlightCode()



## zeroHighlightCode()
**Kind**: global function
6 changes: 3 additions & 3 deletions packages/docs/content/zero-core/composables/open-popup.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a name="zeroOpenPopup"></a>
#### zeroOpenPopup()



## zeroOpenPopup()
**Kind**: global function
4 changes: 4 additions & 0 deletions packages/docs/content/zero-core/composables/unslugify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#### exports()



6 changes: 3 additions & 3 deletions packages/docs/content/zero-core/composables/uuid.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a name="zeroUuid"></a>
#### zeroUuid()



## zeroUuid()
**Kind**: global function
48 changes: 48 additions & 0 deletions packages/docs/content/zero-core/example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

<a name="module_useZeroAlertStore"></a>

# useZeroAlertStore
The alert store module


* [useZeroAlertStore](#module_useZeroAlertStore)
* [~alerts](#module_useZeroAlertStore..alerts) : <code>Object</code>
* [~setAlert()](#module_useZeroAlertStore..setAlert)
* [~getAlert()](#module_useZeroAlertStore..getAlert)
* [~removeAlert()](#module_useZeroAlertStore..removeAlert)
* [~updateAlertData()](#module_useZeroAlertStore..updateAlertData)
* [~openAlert()](#module_useZeroAlertStore..openAlert)
* [~closeAlert()](#module_useZeroAlertStore..closeAlert)

<a name="module_useZeroAlertStore..alerts"></a>

## useZeroAlertStore~alerts : <code>Object</code>
An object that contains a nested objects for each [Alert component](/zero-core/modules/alert/components) instance. The top level key referencing each nested alert object is that alert's AlertId.

**Kind**: inner ref of [<code>useZeroAlertStore</code>](#module_useZeroAlertStore)
<a name="module_useZeroAlertStore..setAlert"></a>

## useZeroAlertStore~setAlert()
- set alert

**Kind**: inner method of [<code>useZeroAlertStore</code>](#module_useZeroAlertStore)
<a name="module_useZeroAlertStore..getAlert"></a>

## useZeroAlertStore~getAlert()
**Kind**: inner method of [<code>useZeroAlertStore</code>](#module_useZeroAlertStore)
<a name="module_useZeroAlertStore..removeAlert"></a>

## useZeroAlertStore~removeAlert()
**Kind**: inner method of [<code>useZeroAlertStore</code>](#module_useZeroAlertStore)
<a name="module_useZeroAlertStore..updateAlertData"></a>

## useZeroAlertStore~updateAlertData()
**Kind**: inner method of [<code>useZeroAlertStore</code>](#module_useZeroAlertStore)
<a name="module_useZeroAlertStore..openAlert"></a>

## useZeroAlertStore~openAlert()
**Kind**: inner method of [<code>useZeroAlertStore</code>](#module_useZeroAlertStore)
<a name="module_useZeroAlertStore..closeAlert"></a>

## useZeroAlertStore~closeAlert()
**Kind**: inner method of [<code>useZeroAlertStore</code>](#module_useZeroAlertStore)
35 changes: 0 additions & 35 deletions packages/docs/content/zero-core/modules/accordion/store.md
Original file line number Diff line number Diff line change
@@ -1,36 +1 @@

## Functions

<dl>
<dt><a href="#setAccordion">setAccordion()</a></dt>
<dd></dd>
<dt><a href="#removeAccordion">removeAccordion()</a></dt>
<dd></dd>
<dt><a href="#setAccordionSection">setAccordionSection()</a></dt>
<dd></dd>
<dt><a href="#toggleAccordionSection">toggleAccordionSection()</a></dt>
<dd></dd>
<dt><a href="#toggleAllSections">toggleAllSections()</a></dt>
<dd></dd>
</dl>

<a name="setAccordion"></a>

## setAccordion()
**Kind**: global function
<a name="removeAccordion"></a>

## removeAccordion()
**Kind**: global function
<a name="setAccordionSection"></a>

## setAccordionSection()
**Kind**: global function
<a name="toggleAccordionSection"></a>

## toggleAccordionSection()
**Kind**: global function
<a name="toggleAllSections"></a>

## toggleAllSections()
**Kind**: global function
40 changes: 36 additions & 4 deletions packages/docs/content/zero-core/modules/alert/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,39 @@
# Zero Alert



This module uses the 'Alert' nomenclature in reference to the pop-up or modal-like nature of its component. It is a combination of a wrapper component (documented here) that renders its contents visible as a modal and a [store](/zero-core/modules/alert/store) which tracks the existence and states of all modals. Before the component mounts, it will register a tracking object with its own ID and closed state in the Alert store.

## Props

| Prop | type | description | values |
| ---- | ---- | ----------- | ------ |
| `alertId` | string | | |
| `alertId` | string | An identifier for this Alert. Should be unique across all instances.<ul></ul> | |

## Computed properties

#### alert()


Returns the alert object associated with this component instance from the [Alert store](/zero-core/modules/alert/store#alerts).


- **returns:** `Object`

#### open()


Test indicating if this alert is currently open.


- **returns:** `boolean`

#### data()


Returns data associated with this alert.


- **returns:** `any`

## Slots

Expand All @@ -17,10 +43,13 @@

**name:** `default` **scoped:** `true`


The Alert contents to render as a modal.

| binding | type | description |
| ------- | ---- | ----------- |
| `close-alert` | | |
| `data` | | |
| `close-alert` | `func` | The component's [closeAlert](/zero-core/modules/alert/components#closealert) method. |
| `data` | `any` | The alert data associated with this component and stored in the [Alert store](/zero-core/modules/alert/store). |

## Emitters

Expand All @@ -30,3 +59,6 @@
## Methods

#### closeAlert()


Closes this alert by calling the Alert Store [closeAlert](/zero-core/modules/alert/store#closealert) method.

This file was deleted.

153 changes: 112 additions & 41 deletions packages/docs/content/zero-core/modules/alert/store.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,113 @@

## Functions

<dl>
<dt><a href="#setAlert">setAlert()</a></dt>
<dd></dd>
<dt><a href="#getAlert">getAlert()</a></dt>
<dd></dd>
<dt><a href="#removeAlert">removeAlert()</a></dt>
<dd></dd>
<dt><a href="#updateAlertData">updateAlertData()</a></dt>
<dd></dd>
<dt><a href="#openAlert">openAlert()</a></dt>
<dd></dd>
<dt><a href="#closeAlert">closeAlert()</a></dt>
<dd></dd>
</dl>

<a name="setAlert"></a>

## setAlert()
**Kind**: global function
<a name="getAlert"></a>

## getAlert()
**Kind**: global function
<a name="removeAlert"></a>

## removeAlert()
**Kind**: global function
<a name="updateAlertData"></a>

## updateAlertData()
**Kind**: global function
<a name="openAlert"></a>

## openAlert()
**Kind**: global function
<a name="closeAlert"></a>

## closeAlert()
**Kind**: global function
# useZeroAlertStore()


A store that registers [Alert component](/zero-core/modules/alert/components) instances, records their open/closed states and contains methods to update them.

## Data


- [alerts](#alerts)

## Methods


- [setAlert()](#setalert)
- [getAlert()](#getalert)
- [removeAlert()](#removealert)
- [updateAlertData()](#updatealertdata)
- [openAlert()](#openalert)
- [closeAlert()](#closealert)

## All Members

#### alerts


**type:** `Object`


An object that maps alert IDs to nested tracking objects for each [Alert component](/zero-core/modules/alert/components) instance. The top level key referencing each nested alert object is that alert's AlertId.


**Kind:** inner ref of [useZeroAlertStore](#usezeroalertstore)

#### setAlert()


Register an alert instance.


**Kind:** inner method of [useZeroAlertStore](#usezeroalertstore)

| param | type | description |
| ----- | ---- | ----------- |
| `payload` | Object | A tracking object containing data about an alert instance. |
| `payload.id` | string | The Alert ID. |
| `payload.status` | string | The status of the alert; either `open` or `closed`. |
| `payload.data`<span>(optional)</span> | any | Data to associate with the alert. |

#### getAlert()


Returns a single alert object stored at a key in the [alerts](#alerts) map.


**Kind:** inner method of [useZeroAlertStore](#usezeroalertstore)

| param | type | description |
| ----- | ---- | ----------- |
| `alertId` | string | The ID of the alert object to retrieve. |


- **Returns:** `Object`

#### removeAlert()


Removes an alert mapping from the [alerts](#alerts) map.


**Kind:** inner method of [useZeroAlertStore](#usezeroalertstore)

| param | type | description |
| ----- | ---- | ----------- |
| `alertId` | string | The ID of the alert object to remove. |

#### updateAlertData()


Updates the `data` key of an alert object.


**Kind:** inner method of [useZeroAlertStore](#usezeroalertstore)

| param | type | description |
| ----- | ---- | ----------- |
| `alertId` | string | The ID of the alert object to update. |
| `payload` | any | Data to save to the `data` key of the alert object. |

#### openAlert()


Sets the status of an alert to 'open'.


**Kind:** inner method of [useZeroAlertStore](#usezeroalertstore)

| param | type | description |
| ----- | ---- | ----------- |
| `alertId` | string | The ID of the alert object to update. |
| `data`<span>(optional)</span> | any | Data to save to the `data` key of the alert object. |

#### closeAlert()


Sets the status of an alert to 'closed'. Sets the alert's `data` key to `null`.


**Kind:** inner method of [useZeroAlertStore](#usezeroalertstore)

| param | type | description |
| ----- | ---- | ----------- |
| `alertId` | string | The ID of the alert object to update. |
Loading

0 comments on commit dce7090

Please sign in to comment.