Skip to content

Commit

Permalink
New new page with starter template (#4065)
Browse files Browse the repository at this point in the history
  • Loading branch information
humandad committed Jul 12, 2024
1 parent 1a74fc5 commit e6d51ea
Show file tree
Hide file tree
Showing 14 changed files with 310 additions and 124 deletions.
15 changes: 15 additions & 0 deletions libs/apps/uesio/appkit/bundle/components/form_new.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ category: LAYOUT
type: DECLARATIVE
slots:
- name: content
properties:
- type: SIGNALS
name: onCreateSignals
label: On Create Signals
definition:
- uesio/io.item:
wire: $Prop{wire}
Expand All @@ -21,6 +25,9 @@ definition:
- uesio/io.group:
components:
- uesio/io.button:
uesio.display:
- type: hasNoValue
value: $Prop{onCreateSignals}
signals:
- signal: wire/SAVE
wires:
Expand All @@ -32,6 +39,14 @@ definition:
text: Create $Collection{label}
hotkey: "meta+s"
uesio.variant: uesio/appkit.primary
- uesio/io.button:
uesio.display:
- type: hasValue
value: $Prop{onCreateSignals}
signals: $Prop{onCreateSignals}
text: Create $Collection{label}
hotkey: "meta+s"
uesio.variant: uesio/appkit.primary
- uesio/io.button:
signals:
- signal: wire/RESET
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: selectcard
label: Select Card
public: true
definition:
uesio.styleTokens:
root:
- border-2
- border-slate-200
- rounded-lg
- p-6
- cursor-pointer
- relative
- after:right-4
- after:content-["radio\\_button\\_unchecked"]
- after:font-[Material_Icons]
- after:text-2xl
- after:text-slate-200
- after:absolute
- after:top-3
- after:pointer-events-none
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: selectcard_selected
label: Select Card
public: true
extends: uesio/appkit.selectcard
definition:
uesio.styleTokens:
root:
- border-slate-800
- cursor-default
- after:content-["radio\\_button\\_checked"]
- after:text-slate-800
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { api, definition, component, styles } from "@uesio/ui"
import { api, definition, component, styles, signal } from "@uesio/ui"
import { default as ScrollPanelUtility } from "../../utilities/scrollpanel/scrollpanel"

type Props = {
header?: definition.DefinitionList
content?: definition.DefinitionList
footer?: definition.DefinitionList
signals?: signal.SignalDefinition[]
}

const StyleDefaults = Object.freeze({
Expand All @@ -17,12 +18,15 @@ const StyleDefaults = Object.freeze({
const ScrollPanel: definition.UC<Props> = (props) => {
const { definition, context, path, componentType } = props
const classes = styles.useStyleTokens(StyleDefaults, props)

const handler = api.signal.getHandler(definition.signals, context)
return (
<ScrollPanelUtility
id={api.component.getComponentIdFromProps(props)}
variant={definition[component.STYLE_VARIANT]}
context={context}
classes={classes}
onClick={handler}
header={
<component.Slot
definition={definition}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { ReactNode, forwardRef } from "react"
import { ReactNode, forwardRef, MouseEvent } from "react"
import { definition, styles } from "@uesio/ui"

interface ScrollPanelProps extends definition.UtilityProps {
header?: ReactNode
footer?: ReactNode
onClick?: (e: MouseEvent) => void
}

const StyleDefaults = Object.freeze({
Expand All @@ -15,13 +16,20 @@ const StyleDefaults = Object.freeze({

const ScrollPanel = forwardRef<HTMLDivElement, ScrollPanelProps>(
(props, ref) => {
const { onClick } = props
const classes = styles.useUtilityStyleTokens(
StyleDefaults,
props,
"uesio/io.scrollpanel"
)
return (
<div id={props.id} ref={ref} className={classes.root}>
<div
id={props.id}
role={onClick ? "button" : undefined}
onClick={onClick}
ref={ref}
className={classes.root}
>
<div className={classes.header}>{props.header}</div>
<div className={classes.inner}>{props.children}</div>
<div className={classes.footer}>{props.footer}</div>
Expand Down
10 changes: 10 additions & 0 deletions libs/apps/uesio/io/bundle/components/card.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ properties:
grouping: uesio/io.scrollpanel
defaultValue: uesio/io.card
metadataType: COMPONENTVARIANT
- name: titlebarVariant
label: Title Bar Variant
type: METADATA
metadata:
type: COMPONENTVARIANT
grouping: uesio/io.titlebar
defaultValue: uesio/io.default
metadataType: COMPONENTVARIANT
sections:
- type: HOME
properties:
Expand All @@ -33,10 +41,12 @@ sections:
definition:
- uesio/io.scrollpanel:
uesio.variant: $Prop{scrollpanelVariant}
signals: $Prop{signals}
header:
- uesio/io.titlebar:
title: $Prop{title}
subtitle: $Prop{subtitle}
uesio.variant: $Prop{titlebarVariant}
actions:
- uesio/core.slot:
name: actions
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: use_starter_templates
label: Use Starter Templates
type: CHECKBOX
defaultValue: false
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
name: description
type: TEXT
type: LONGTEXT
label: Description
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
name: starter_template
type: TEXT
label: Starter Template
createOnly: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: show_starter_template
type: CHECKBOX
label: Show Starter Template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
name: starter_template_description
type: LONGTEXT
label: Starter Template Description
Loading

0 comments on commit e6d51ea

Please sign in to comment.