Sha256: ba1a59b872284fa4d86d088d928c7f026714495248072e30fac4d7e77258b69e

Contents?: true

Size: 888 Bytes

Versions: 24

Compression:

Stored size: 888 Bytes

Contents

# frozen_string_literal: true

module TailwindDsl
  module Etl
    module RawComponents
      # Design System
      #
      # DesignSystem represents a collection of Tailwind CSS components that follow a specific design system
      class DesignSystem < TailwindDsl::Etl::Element
        attr_accessor :name
        attr_accessor :stats
        attr_accessor :groups

        def initialize(**args)
          @name = grab_arg(args, :name, guard: 'Missing name')
          @stats = grab_arg(args, :stats, default: {})
          @groups = grab_arg(args, :groups, default: []).map { |group| map_to(Group, group) }.compact
        end

        def add_group(group)
          add_to_list(Group, groups, group)
        end

        def to_h
          {
            name: name,
            stats: stats,
            groups: groups.map(&:to_h)
          }
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
tailwind_dsl-0.0.32 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.31 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.30 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.29 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.28 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.27 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.26 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.25 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.24 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.23 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.22 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.21 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.20 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.19 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.18 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.17 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.16 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.15 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.14 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb
tailwind_dsl-0.0.13 lib/tailwind_dsl/etl/raw_components/schema/design_system.rb