Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(desc): add actions option #582

Merged
merged 1 commit into from
Feb 19, 2025
Merged

feat(desc): add actions option #582

merged 1 commit into from
Feb 19, 2025

Conversation

kiaking
Copy link
Member

@kiaking kiaking commented Feb 18, 2025

Add option to show "actions" in <SDesc>. It can have simple buttons and action menu for dropdown.

This PR increases desc label font size to 14 and height to 28px in order to have enough space to show buttons.

Adding actions with <SDesc dir="row"> is not supported.

<script setup lang="ts">
import IconDotsThree from '~icons/ph/dots-three-bold'
import IconNotePencil from '~icons/ph/note-pencil'

const actions = [
  { icon: IconNotePencil, onClick: () => {} },
  {
    type: 'menu' as const,
    icon: IconDotsThree,
    options: [
      { label: 'Inspect', onClick: () => {} },
      { label: 'Preview', onClick: () => {} },
      { label: 'Delete', onClick: () => {} }
    ]
  }
]
</script>

<template>
  <SDesc cols="2" gap="24">
    <SDescItem span="1">
      <SDescLabel :actions="actions">Full name</SDescLabel>
      <SDescText>Margot Foster</SDescText>
    </SDescItem>
    <SDescItem span="1">
      <SDescLabel :actions="actions">Website</SDescLabel>
      <SDescLink>https://margot.example</SDescLink>
    </SDescItem>
  </SDesc>
</template>
Screenshot 2025-02-18 at 15 09 04 Screenshot 2025-02-18 at 15 09 08

@kiaking kiaking self-assigned this Feb 18, 2025
@kiaking kiaking requested a review from brc-dd as a code owner February 18, 2025 06:19
Copy link

netlify bot commented Feb 18, 2025

Deploy Preview for sefirot-story ready!

Name Link
🔨 Latest commit b3ab60f
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-story/deploys/67b4265ce744ac00087c4235
😎 Deploy Preview https://deploy-preview-582--sefirot-story.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Feb 18, 2025

Deploy Preview for sefirot-docs ready!

Name Link
🔨 Latest commit b3ab60f
🔍 Latest deploy log https://app.netlify.com/sites/sefirot-docs/deploys/67b4265ce425f200083be992
😎 Deploy Preview https://deploy-preview-582--sefirot-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kiaking kiaking merged commit d6203f1 into main Feb 19, 2025
9 checks passed
@kiaking kiaking deleted the desc-actions branch February 19, 2025 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants