Skip to content

XPEHO/yaki_ui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yaki UI

This is the UI for the Yaki project.

Supported platforms

  • Web CSS
  • Flutter multiplatform

Getting Started

Web

TODO - Describe how to import Web library using npm

Flutter

TODO - Describe how to import Flutter library using pub

Components

Button

Web usage

<!DOCTYPE html>
<html>
  <head>
    <title>Yaki UI</title>
    <link rel="stylesheet" href="css/yaki_ui.css" />
  </head>
  <body>
    <!-- Primary button -->
    <div class="button primary">Button</div>
    <!-- Secondary button -->
    <div class="button secondary">Button</div>
  </body>
</html>

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';

// Primary button
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Button(
      text: 'Button',
      onPressed: () {},
    );
  }
}

// Secondary button
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Button.secondary(
      text: 'Button',
      onPressed: () {},
    );
  }
}

// Tertiary button
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Button.tertiary(
      text: 'Button',
      onPressed: () {},
    );
  }
}

Icon chip

Web usage

TODO

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';

// Icon chip
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return IconChip(
      label: 'Hello World !',
      backgroundColor: Colors.blue,
      image: ClipRRect(
        borderRadius: BorderRadius.circular(50),
        child: Image.network(
          'https://picsum.photos/200',
          width: 100,
          height: 100,
        ),
      ),
    );
  }
}

Cell

Web usage

TODO

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';

// Icon chip
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Cell(
      title: 'Hello World',
      subtitle: 'Welcome to Yaki UI !',
      image: Container(
        height: 48,
        width: 48,
        decoration: BoxDecoration(
          borderRadius: BorderRadius.circular(
            20,
          ),
          image: const DecorationImage(
            image: NetworkImage(
              'https://picsum.photos/200/300',
            ),
            fit: BoxFit.cover,
          ),
        ),
      ),
      chips: const Icon(Icons.abc),
      child: IconChip(
        image: const Icon(Icons.abc),
        label: 'ABC',
        backgroundColor: Colors.grey.shade300,
      ),
    );
  }
}

TeamSelectionCard

Web usage

TODO

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';

// Icon chip
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return TeamSelectionCard(
      picture: Image.network(
        'https://picsum.photos/200',
      ),
      title: 'Yaki',
      subtitle: 'Yaki is a design system',
      onSelectionChanged: (selected) {
        debugPrint('Team selection changed: $selected');
      },
    );
  }
}

InputText

Web usage

TODO

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';

// Icon chip
class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return InputText(
      type: InputTextType.email,
      label: 'Email',
      controller: TextEditingController(),
      enabled: true,
    );
  }
}

LocationSelectionCard

Web usage

TODO

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return LocationSelectionCard(
      picture: const Icon(Icons.abc),
      title: 'Yaki',
      subtitle: 'Yaki is a design system',
      onSelectionChanged: (selected) {},
    );
  }
}

ToggleButton

Web usage

TODO

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';
// Toggle button
class MyWidget extends StatelessWidget {
  const MyWidget({super.key});
  @override
  Widget build(BuildContext context) {
    return ToggleButton(
      isSelected: const [true, false],
      labels: const ['Morning', 'Noon'],
      onToggleButtonSelect: (selectedOption) {
        debugPrint('Selected option: $selectedOption');
      },
    );
  }
}

DatePickerCard

Web usage

TODO

Flutter usage

import 'package:yaki_ui/yaki_ui.dart';
// darte picker card
class MyWidget extends StatelessWidget {
  const MyWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return DatePickerCard(
      title: "Start",
      initialButtonLabel: "Pick a date",
      earliestSelectableDate: DateTime.now(),
      onDateSelection: (selectedDateTime) {
        debugPrint('Date selected: $selectedDateTime');
      },
      toggleLabels: const ["Morning", "Noon"],
    );
  }
}

Widgetbook

This project uses Widgetbook to document the widgets.

More information about Widgetbook can be found on widgetbook.io